diff options
Diffstat (limited to 'source4/librpc/ndr')
-rw-r--r-- | source4/librpc/ndr/libndr.h | 6 | ||||
-rw-r--r-- | source4/librpc/ndr/ndr.c | 19 | ||||
-rw-r--r-- | source4/librpc/ndr/ndr_basic.c | 19 |
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) |