summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/common-utils.c
diff options
context:
space:
mode:
authorPranith K <pranithk@gluster.com>2011-03-10 02:19:39 +0000
committerVijay Bellur <vijay@dev.gluster.com>2011-03-10 08:09:47 -0800
commit34bf8de743aaff3e7c242833a10791aedc404ea3 (patch)
tree0d00570fead89437cb4612a510c3978dd5907530 /libglusterfs/src/common-utils.c
parent970b22e377e20408df8646cdc61a968b55c145b1 (diff)
mgmt/glusterd: gluster profile implementation
Signed-off-by: Pranith Kumar K <pranithk@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 1965 (need a cmd to get io-stat details) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1965
Diffstat (limited to 'libglusterfs/src/common-utils.c')
-rw-r--r--libglusterfs/src/common-utils.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/libglusterfs/src/common-utils.c b/libglusterfs/src/common-utils.c
index 38623dc79..931cc66fb 100644
--- a/libglusterfs/src/common-utils.c
+++ b/libglusterfs/src/common-utils.c
@@ -47,6 +47,7 @@
#include "glusterfs.h"
#include "stack.h"
#include "globals.h"
+#include "md5.h"
typedef int32_t (*rw_op_t)(int32_t fd, char *buf, int32_t size);
typedef int32_t (*rwv_op_t)(int32_t fd, const struct iovec *buf, int32_t size);
@@ -1711,3 +1712,16 @@ uuid_utoa_r (uuid_t uuid, char *dst)
uuid_unparse (uuid, dst);
return dst;
}
+
+void _get_md5_str (char *out_str, size_t outlen,
+ const uint8_t *input, int n)
+{
+ uint8_t out[MD5_DIGEST_LEN] = {0};
+ int j = 0;
+
+ GF_ASSERT (outlen >= (2*MD5_DIGEST_LEN + 1));
+ get_md5 (out, input, n);
+ for (j = 0; j < MD5_DIGEST_LEN; j++)
+ snprintf(out_str + j * 2, outlen-j*2, "%02x", out[j]);
+
+}