librpc/ndr: add ndr_print_netlogon_samlogon_response()
authorGünther Deschner <gd@samba.org>
Tue, 24 Sep 2019 21:10:50 +0000 (23:10 +0200)
committerJeremy Allison <jra@samba.org>
Thu, 26 Sep 2019 18:41:26 +0000 (18:41 +0000)
Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
librpc/ndr/ndr_nbt.c
librpc/ndr/ndr_nbt.h

index 838f947a16858a29aa1a3ffc1dc681f23b1b728d..b15dc5c06e5229f4f9d66c5cf43caac7ba3a2141 100644 (file)
@@ -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);
+       }
+}
index edb2bf7687b1299fec2625fae7312fa75e55a250..7c06301d02bf97ceed765df6e75cb61edbb7aa53 100644 (file)
@@ -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 */