1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-26 01:49:31 +03:00

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>
This commit is contained in:
Stefan Metzmacher
2022-11-07 17:15:32 +01:00
parent 1414269dcc
commit 73ec725313

View File

@ -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 */