From 34bf8de743aaff3e7c242833a10791aedc404ea3 Mon Sep 17 00:00:00 2001 From: Pranith K Date: Thu, 10 Mar 2011 02:19:39 +0000 Subject: mgmt/glusterd: gluster profile implementation Signed-off-by: Pranith Kumar K Signed-off-by: Vijay Bellur BUG: 1965 (need a cmd to get io-stat details) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1965 --- libglusterfs/src/common-utils.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'libglusterfs/src/common-utils.c') diff --git a/libglusterfs/src/common-utils.c b/libglusterfs/src/common-utils.c index 38623dc79ac..931cc66fbbc 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]); + +} -- cgit