diff options
author | Stefan Metzmacher <metze@samba.org> | 2022-11-07 17:15:32 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2022-11-24 11:01:37 +0000 |
commit | 73ec7253139cf4704135ec7abfa6a669e158fddc (patch) | |
tree | 9ad2c24f0e37a5152673396bb60e6f2beed934a3 /source4/lib | |
parent | 1414269dccfd7cb831889cc92df35920b034457c (diff) | |
download | samba-73ec7253139cf4704135ec7abfa6a669e158fddc.tar.gz |
s4:messaging: add irpc_bh_do_ndr_print() in order to debug irpc calls
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15253
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/lib')
-rw-r--r-- | source4/lib/messaging/messaging.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/source4/lib/messaging/messaging.c b/source4/lib/messaging/messaging.c index 8603c167ad4..3705ffc5bef 100644 --- a/source4/lib/messaging/messaging.c +++ b/source4/lib/messaging/messaging.c @@ -1391,6 +1391,38 @@ static bool irpc_bh_ref_alloc(struct dcerpc_binding_handle *h) return true; } +static void irpc_bh_do_ndr_print(struct dcerpc_binding_handle *h, + int ndr_flags, + const void *_struct_ptr, + const struct ndr_interface_call *call) +{ + void *struct_ptr = discard_const(_struct_ptr); + bool print_in = false; + bool print_out = false; + + if (DEBUGLEVEL >= 11) { + print_in = true; + print_out = true; + } + + if (ndr_flags & NDR_IN) { + if (print_in) { + ndr_print_function_debug(call->ndr_print, + call->name, + ndr_flags, + struct_ptr); + } + } + if (ndr_flags & NDR_OUT) { + if (print_out) { + ndr_print_function_debug(call->ndr_print, + call->name, + ndr_flags, + struct_ptr); + } + } +} + static const struct dcerpc_binding_handle_ops irpc_bh_ops = { .name = "wbint", .is_connected = irpc_bh_is_connected, @@ -1401,6 +1433,7 @@ static const struct dcerpc_binding_handle_ops irpc_bh_ops = { .disconnect_recv = irpc_bh_disconnect_recv, .ref_alloc = irpc_bh_ref_alloc, + .do_ndr_print = irpc_bh_do_ndr_print, }; /* initialise a irpc binding handle */ |