summaryrefslogtreecommitdiffstats
path: root/libglusterfs
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
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')
-rw-r--r--libglusterfs/src/common-utils.c14
-rw-r--r--libglusterfs/src/common-utils.h2
-rw-r--r--libglusterfs/src/dict.h1
3 files changed, 17 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]);
+
+}
diff --git a/libglusterfs/src/common-utils.h b/libglusterfs/src/common-utils.h
index 0d93e5bee..96a7c3e4f 100644
--- a/libglusterfs/src/common-utils.h
+++ b/libglusterfs/src/common-utils.h
@@ -353,5 +353,7 @@ char valid_internet_address (char *address);
char *uuid_utoa (uuid_t uuid);
char *uuid_utoa_r (uuid_t uuid, char *dst);
+void _get_md5_str (char *out_str, size_t outlen,
+ const uint8_t *input, int n);
#endif /* _COMMON_UTILS_H */
diff --git a/libglusterfs/src/dict.h b/libglusterfs/src/dict.h
index 417967051..ac587f59a 100644
--- a/libglusterfs/src/dict.h
+++ b/libglusterfs/src/dict.h
@@ -127,6 +127,7 @@ void *data_to_bin (data_t *data);
void *data_to_ptr (data_t *data);
data_t *get_new_data ();
+data_t * data_copy (data_t *old);
dict_t *get_new_dict_full (int size_hint);
dict_t *get_new_dict ();