summaryrefslogtreecommitdiff
path: root/librpc/ndr/uuid.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2008-11-13 21:28:02 +0100
committerStefan Metzmacher <metze@samba.org>2008-11-16 16:37:22 +0100
commit2cff27cefdd7f898349e8853f2c6307d1fb28855 (patch)
tree07489a487555c0fe605cb786479137f0e428fab9 /librpc/ndr/uuid.c
parent69af236e7772e85b7b8dc7045c6737d85f4b189a (diff)
downloadsamba-2cff27cefdd7f898349e8853f2c6307d1fb28855.tar.gz
samba-2cff27cefdd7f898349e8853f2c6307d1fb28855.tar.bz2
samba-2cff27cefdd7f898349e8853f2c6307d1fb28855.zip
librpc/ndr: add GUID_hexstring()
metze
Diffstat (limited to 'librpc/ndr/uuid.c')
-rw-r--r--librpc/ndr/uuid.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/librpc/ndr/uuid.c b/librpc/ndr/uuid.c
index bb8c49254d..aa24ac4494 100644
--- a/librpc/ndr/uuid.c
+++ b/librpc/ndr/uuid.c
@@ -251,6 +251,31 @@ _PUBLIC_ char *GUID_string2(TALLOC_CTX *mem_ctx, const struct GUID *guid)
return ret;
}
+_PUBLIC_ char *GUID_hexstring(TALLOC_CTX *mem_ctx, const struct GUID *guid)
+{
+ char *ret;
+ DATA_BLOB guid_blob;
+ enum ndr_err_code ndr_err;
+ TALLOC_CTX *tmp_mem;
+
+ tmp_mem = talloc_new(mem_ctx);
+ if (!tmp_mem) {
+ return NULL;
+ }
+ ndr_err = ndr_push_struct_blob(&guid_blob, tmp_mem,
+ NULL,
+ guid,
+ (ndr_push_flags_fn_t)ndr_push_GUID);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(tmp_mem);
+ return NULL;
+ }
+
+ ret = data_blob_hex_string(mem_ctx, &guid_blob);
+ talloc_free(tmp_mem);
+ return ret;
+}
+
_PUBLIC_ char *NS_GUID_string(TALLOC_CTX *mem_ctx, const struct GUID *guid)
{
return talloc_asprintf(mem_ctx,