diff options
Diffstat (limited to 'source4/librpc/ndr')
-rw-r--r-- | source4/librpc/ndr/libndr.h | 2 | ||||
-rw-r--r-- | source4/librpc/ndr/ndr.c | 30 |
2 files changed, 14 insertions, 18 deletions
diff --git a/source4/librpc/ndr/libndr.h b/source4/librpc/ndr/libndr.h index 15ac1b2d4c..dd775d62ad 100644 --- a/source4/librpc/ndr/libndr.h +++ b/source4/librpc/ndr/libndr.h @@ -86,6 +86,7 @@ struct ndr_push_save { struct ndr_print { uint32_t flags; /* LIBNDR_FLAG_* */ uint32_t depth; + struct ndr_token_list *switch_list; void (*print)(struct ndr_print *, const char *, ...); void *private; }; @@ -248,5 +249,4 @@ typedef NTSTATUS (*ndr_push_const_fn_t)(struct ndr_push *, int ndr_flags, const typedef NTSTATUS (*ndr_pull_flags_fn_t)(struct ndr_pull *, int ndr_flags, void *); typedef void (*ndr_print_fn_t)(struct ndr_print *, const char *, void *); typedef void (*ndr_print_function_t)(struct ndr_print *, const char *, int, void *); -typedef void (*ndr_print_union_fn_t)(struct ndr_print *, const char *, uint32_t, void *); diff --git a/source4/librpc/ndr/ndr.c b/source4/librpc/ndr/ndr.c index de8a01f5d5..de87f0850a 100644 --- a/source4/librpc/ndr/ndr.c +++ b/source4/librpc/ndr/ndr.c @@ -324,23 +324,6 @@ void ndr_print_debug(ndr_print_fn_t fn, const char *name, void *ptr) talloc_free(ndr); } - -/* - a useful helper function for printing idl unions via DEBUG() -*/ -void ndr_print_union_debug(ndr_print_union_fn_t fn, const char *name, uint32_t level, void *ptr) -{ - struct ndr_print *ndr; - - ndr = talloc(NULL, struct ndr_print); - if (!ndr) return; - ndr->print = ndr_print_debug_helper; - ndr->depth = 1; - ndr->flags = 0; - fn(ndr, name, level, ptr); - talloc_free(ndr); -} - /* a useful helper function for printing idl function calls via DEBUG() */ @@ -690,6 +673,19 @@ uint32_t ndr_pull_get_switch_value(struct ndr_pull *ndr, const void *p) return ndr_token_peek(&ndr->switch_list, p); } +NTSTATUS ndr_print_set_switch_value(struct ndr_print *ndr, const void *p, uint32_t val) +{ + return ndr_token_store(ndr, &ndr->switch_list, p, val); +} + +/* + retrieve a switch value + */ +uint32_t ndr_print_get_switch_value(struct ndr_print *ndr, const void *p) +{ + return ndr_token_peek(&ndr->switch_list, p); +} + /* pull a relative object - stage1 called during SCALARS processing |