summaryrefslogtreecommitdiff
path: root/source4/librpc/ndr
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2003-11-24 01:24:29 +0000
committerAndrew Tridgell <tridge@samba.org>2003-11-24 01:24:29 +0000
commitc7fd83d0b280810f16f7ef99ba58efb007f93920 (patch)
tree4a3cb1b009b6a4ed5980a4bc1cd30376c003f0b1 /source4/librpc/ndr
parent27b1dbaea64e02eccf07ff6643bffc2991264533 (diff)
downloadsamba-c7fd83d0b280810f16f7ef99ba58efb007f93920.tar.gz
samba-c7fd83d0b280810f16f7ef99ba58efb007f93920.tar.bz2
samba-c7fd83d0b280810f16f7ef99ba58efb007f93920.zip
added the dcerpc remote management interfaces as mgmt.idl, and wrote a
test suite. The test suite dumps all of the interfaces available on all pipes. There sure are a lot more interfaces on w2k3 than w2k ! (This used to be commit f94bc079902d725b63155d8d2de5bf408c6e7335)
Diffstat (limited to 'source4/librpc/ndr')
-rw-r--r--source4/librpc/ndr/libndr.h6
-rw-r--r--source4/librpc/ndr/ndr.c19
-rw-r--r--source4/librpc/ndr/ndr_basic.c19
3 files changed, 38 insertions, 6 deletions
diff --git a/source4/librpc/ndr/libndr.h b/source4/librpc/ndr/libndr.h
index 5c51113874..42238fd17b 100644
--- a/source4/librpc/ndr/libndr.h
+++ b/source4/librpc/ndr/libndr.h
@@ -247,3 +247,9 @@ typedef void (*ndr_print_union_fn_t)(struct ndr_print *, const char *, uint32, v
#include "librpc/gen_ndr/ndr_eventlog.h"
#include "librpc/gen_ndr/ndr_epmapper.h"
#include "librpc/gen_ndr/ndr_winreg.h"
+#include "librpc/gen_ndr/ndr_mgmt.h"
+
+/* this can be used to loop over all pipes - please extend the table
+ in librpc/ndr/ndr.c
+*/
+extern const struct dcerpc_interface_table *dcerpc_pipes[];
diff --git a/source4/librpc/ndr/ndr.c b/source4/librpc/ndr/ndr.c
index 00f8eaed46..6116150cea 100644
--- a/source4/librpc/ndr/ndr.c
+++ b/source4/librpc/ndr/ndr.c
@@ -31,6 +31,23 @@
#define NDR_BASE_MARSHALL_SIZE 1024
+const struct dcerpc_interface_table *dcerpc_pipes[] = {
+ &dcerpc_table_samr,
+ &dcerpc_table_lsarpc,
+ &dcerpc_table_netdfs,
+ &dcerpc_table_atsvc,
+ &dcerpc_table_dcerpc,
+ &dcerpc_table_rpcecho,
+ &dcerpc_table_epmapper,
+ &dcerpc_table_eventlog,
+ &dcerpc_table_spoolss,
+ &dcerpc_table_srvsvc,
+ &dcerpc_table_winreg,
+ &dcerpc_table_wkssvc,
+ &dcerpc_table_mgmt,
+ NULL
+};
+
/*
work out the number of bytes needed to align on a n byte boundary
@@ -772,3 +789,5 @@ NTSTATUS ndr_pull_struct_blob(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, void *p,
}
return fn(ndr, NDR_SCALARS|NDR_BUFFERS, p);
}
+
+
diff --git a/source4/librpc/ndr/ndr_basic.c b/source4/librpc/ndr/ndr_basic.c
index 081d9ff87a..5f59899133 100644
--- a/source4/librpc/ndr/ndr_basic.c
+++ b/source4/librpc/ndr/ndr_basic.c
@@ -730,14 +730,21 @@ void ndr_print_array_uint8(struct ndr_print *ndr, const char *name,
ndr->depth--;
}
+const char *GUID_string(TALLOC_CTX *mem_ctx, const struct GUID *guid)
+{
+ return talloc_asprintf(mem_ctx,
+ "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
+ IVAL(guid->info, 0), SVAL(guid->info, 4),
+ SVAL(guid->info, 6),
+ guid->info[8], guid->info[9],
+ guid->info[10], guid->info[11],
+ guid->info[12], guid->info[13],
+ guid->info[14], guid->info[15]);
+}
+
void ndr_print_GUID(struct ndr_print *ndr, const char *name, const struct GUID *guid)
{
- ndr->print(ndr, "%-25s: %08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
- name,
- IVAL(guid->info, 0), SVAL(guid->info, 4), SVAL(guid->info, 6),
- guid->info[8], guid->info[9],
- guid->info[10], guid->info[11], guid->info[12], guid->info[13],
- guid->info[14], guid->info[15]);
+ ndr->print(ndr, "%-25s: %s", GUID_string(ndr->mem_ctx, guid));
}
void ndr_print_DATA_BLOB(struct ndr_print *ndr, const char *name, DATA_BLOB r)