From 5b46116923fb7c2945db128736b7f8113ea1a160 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 1 Dec 2003 03:19:43 +0000 Subject: added netr_ServerReqChallenge and cleaned up byte array printing (This used to be commit bb42107dccf3a384a4a5c029b4d2752e0898d7cb) --- source4/librpc/ndr/libndr.h | 3 +++ source4/librpc/ndr/ndr_basic.c | 21 ++++++++++----------- 2 files changed, 13 insertions(+), 11 deletions(-) (limited to 'source4/librpc/ndr') diff --git a/source4/librpc/ndr/libndr.h b/source4/librpc/ndr/libndr.h index 8440e9c1a0..cce0b12b73 100644 --- a/source4/librpc/ndr/libndr.h +++ b/source4/librpc/ndr/libndr.h @@ -110,6 +110,9 @@ struct ndr_print { #define LIBNDR_ALIGN_FLAGS (LIBNDR_FLAG_ALIGN2|LIBNDR_FLAG_ALIGN4|LIBNDR_FLAG_ALIGN8) +#define LIBNDR_PRINT_ARRAY_HEX (1<<15) + + /* useful macro for debugging */ #define NDR_PRINT_DEBUG(type, p) ndr_print_debug((ndr_print_fn_t)ndr_print_ ##type, #p, p) #define NDR_PRINT_UNION_DEBUG(type, level, p) ndr_print_union_debug((ndr_print_union_fn_t)ndr_print_ ##type, #p, level, p) diff --git a/source4/librpc/ndr/ndr_basic.c b/source4/librpc/ndr/ndr_basic.c index 32cc7bac5f..0300bdd3fb 100644 --- a/source4/librpc/ndr/ndr_basic.c +++ b/source4/librpc/ndr/ndr_basic.c @@ -707,6 +707,16 @@ void ndr_print_array_uint8(struct ndr_print *ndr, const char *name, { int i; + if (count <= 32 && (ndr->flags & LIBNDR_PRINT_ARRAY_HEX)) { + char s[65]; + for (i=0;iprint(ndr, "%-25s: %s", name, s); + return; + } + ndr->print(ndr, "%s: ARRAY(%d)", name, count); ndr->depth++; for (i=0;ioffset += length; return NT_STATUS_OK; } - - -void ndr_print_policy_handle(struct ndr_print *ndr, const char *name, struct policy_handle *r) -{ - ndr->print(ndr, "%-25s: policy_handle %02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x", - name, - r->data[0], r->data[1], r->data[2], r->data[3], r->data[4], - r->data[5], r->data[6], r->data[7], r->data[8], r->data[9], - r->data[10], r->data[11], r->data[12], r->data[13], r->data[14], - r->data[15], r->data[16], r->data[17], r->data[18], r->data[19]); -} -- cgit