From 86a0e4850e02efc406ae5e1ee7cdc6a61eebef76 Mon Sep 17 00:00:00 2001 From: =?utf8?q?G=C3=BCnther=20Deschner?= Date: Tue, 24 Sep 2019 23:10:50 +0200 Subject: [PATCH] librpc/ndr: add ndr_print_netlogon_samlogon_response() Guenther Signed-off-by: Guenther Deschner Reviewed-by: Jeremy Allison --- librpc/ndr/ndr_nbt.c | 13 +++++++++++++ librpc/ndr/ndr_nbt.h | 1 + 2 files changed, 14 insertions(+) diff --git a/librpc/ndr/ndr_nbt.c b/librpc/ndr/ndr_nbt.c index 838f947a168..b15dc5c06e5 100644 --- a/librpc/ndr/ndr_nbt.c +++ b/librpc/ndr/ndr_nbt.c @@ -449,3 +449,16 @@ _PUBLIC_ enum ndr_err_code ndr_pull_netlogon_samlogon_response(struct ndr_pull * return NDR_ERR_SUCCESS; } + +_PUBLIC_ void ndr_print_netlogon_samlogon_response(struct ndr_print *ndr, const char *name, struct netlogon_samlogon_response *r) +{ + ndr_print_struct(ndr, name, "netlogon_samlogon_response"); + if (r == NULL) { ndr_print_null(ndr); return; } + if (r->ntver == NETLOGON_NT_VERSION_1) { + ndr_print_NETLOGON_SAM_LOGON_RESPONSE_NT40(ndr, "data.nt4", &r->data.nt4); + } else if (r->ntver & NETLOGON_NT_VERSION_5EX) { + ndr_print_NETLOGON_SAM_LOGON_RESPONSE_EX(ndr, "data.nt5_ex", &r->data.nt5_ex); + } else if (r->ntver & NETLOGON_NT_VERSION_5) { + ndr_print_NETLOGON_SAM_LOGON_RESPONSE(ndr, "data.nt5", &r->data.nt5); + } +} diff --git a/librpc/ndr/ndr_nbt.h b/librpc/ndr/ndr_nbt.h index edb2bf7687b..7c06301d02b 100644 --- a/librpc/ndr/ndr_nbt.h +++ b/librpc/ndr/ndr_nbt.h @@ -37,5 +37,6 @@ enum ndr_err_code ndr_pull_NETLOGON_SAM_LOGON_RESPONSE_EX_with_flags(struct ndr_ uint32_t nt_version_flags); enum ndr_err_code ndr_push_netlogon_samlogon_response(struct ndr_push *ndr, int ndr_flags, const struct netlogon_samlogon_response *r); enum ndr_err_code ndr_pull_netlogon_samlogon_response(struct ndr_pull *ndr, int ndr_flags, struct netlogon_samlogon_response *r); +void ndr_print_netlogon_samlogon_response(struct ndr_print *ndr, const char *name, struct netlogon_samlogon_response *r); #endif /* _LIBRPC_NDR_NDR_NBT_H */ -- 2.47.3