diff options
-rw-r--r-- | libcli/nbt/nbt_proto.h | 43 | ||||
-rw-r--r-- | libcli/netlogon.c | 11 | ||||
-rw-r--r-- | source3/Makefile.in | 2 | ||||
-rw-r--r-- | source3/include/includes.h | 1 | ||||
-rw-r--r-- | source3/include/proto.h | 100 | ||||
-rw-r--r-- | source3/libads/cldap.c | 117 | ||||
-rw-r--r-- | source3/libads/ldap.c | 2 | ||||
-rw-r--r-- | source3/librpc/gen_ndr/nbt.h | 352 | ||||
-rw-r--r-- | source3/librpc/gen_ndr/ndr_nbt.c | 2587 | ||||
-rw-r--r-- | source3/librpc/gen_ndr/ndr_nbt.h | 61 | ||||
-rw-r--r-- | source3/librpc/idl/nbt.idl | 417 | ||||
-rw-r--r-- | source3/libsmb/clidgram.c | 91 | ||||
-rw-r--r-- | source3/libsmb/dsgetdcname.c | 322 | ||||
-rw-r--r-- | source3/samba4.mk | 1 | ||||
-rw-r--r-- | source3/utils/net_ads.c | 8 | ||||
-rw-r--r-- | source3/winbindd/idmap_adex/gc_util.c | 2 | ||||
-rw-r--r-- | source3/winbindd/idmap_adex/idmap_adex.c | 2 | ||||
-rw-r--r-- | source3/winbindd/idmap_adex/idmap_adex.h | 2 | ||||
-rw-r--r-- | source4/Makefile | 1 | ||||
-rw-r--r-- | source4/libcli/config.mk | 12 | ||||
-rw-r--r-- | source4/libcli/smb_composite/sesssetup.c | 9 |
21 files changed, 1084 insertions, 3059 deletions
diff --git a/libcli/nbt/nbt_proto.h b/libcli/nbt/nbt_proto.h new file mode 100644 index 0000000000..b2e8d8525a --- /dev/null +++ b/libcli/nbt/nbt_proto.h @@ -0,0 +1,43 @@ +#ifndef _____LIBCLI_NBT_NBT_PROTO_H__ +#define _____LIBCLI_NBT_NBT_PROTO_H__ + +#undef _PRINTF_ATTRIBUTE +#define _PRINTF_ATTRIBUTE(a1, a2) PRINTF_ATTRIBUTE(a1, a2) +/* This file was automatically generated by mkproto.pl. DO NOT EDIT */ + +/* this file contains prototypes for functions that are private + * to this subsystem or library. These functions should not be + * used outside this particular subsystem! */ + + +/* The following definitions come from ../libcli/nbt/nbtsocket.c */ + +struct nbt_name_request *nbt_name_request_send(struct nbt_name_socket *nbtsock, + struct socket_address *dest, + struct nbt_name_packet *request, + int timeout, int retries, + bool allow_multiple_replies); +NTSTATUS nbt_name_request_recv(struct nbt_name_request *req); + +/* The following definitions come from ../libcli/nbt/namequery.c */ + + +/* The following definitions come from ../libcli/nbt/nameregister.c */ + +struct nbt_name_request *nbt_name_register_send(struct nbt_name_socket *nbtsock, + struct nbt_name_register *io); +NTSTATUS nbt_name_register_bcast(struct nbt_name_socket *nbtsock, + struct nbt_name_register_bcast *io); + +/* The following definitions come from ../libcli/nbt/namerefresh.c */ + +struct nbt_name_request *nbt_name_refresh_send(struct nbt_name_socket *nbtsock, + struct nbt_name_refresh *io); + +/* The following definitions come from ../libcli/nbt/namerelease.c */ + +#undef _PRINTF_ATTRIBUTE +#define _PRINTF_ATTRIBUTE(a1, a2) + +#endif /* _____LIBCLI_NBT_NBT_PROTO_H__ */ + diff --git a/libcli/netlogon.c b/libcli/netlogon.c index 47d665cfa1..ab5d9af8aa 100644 --- a/libcli/netlogon.c +++ b/libcli/netlogon.c @@ -82,6 +82,10 @@ NTSTATUS pull_netlogon_samlogon_response(DATA_BLOB *data, TALLOC_CTX *mem_ctx, &response->nt4, (ndr_pull_flags_fn_t)ndr_pull_NETLOGON_SAM_LOGON_RESPONSE_NT40); response->ntver = NETLOGON_NT_VERSION_1; + if (NDR_ERR_CODE_IS_SUCCESS(ndr_err) && DEBUGLEVEL >= 10) { + NDR_PRINT_DEBUG(NETLOGON_SAM_LOGON_RESPONSE_NT40, &response->nt4); + } + } else if (ntver & NETLOGON_NT_VERSION_5EX) { struct ndr_pull *ndr; ndr = ndr_pull_init_blob(data, mem_ctx, iconv_convenience); @@ -95,6 +99,9 @@ NTSTATUS pull_netlogon_samlogon_response(DATA_BLOB *data, TALLOC_CTX *mem_ctx, ndr->offset, ndr->data_size); } response->ntver = NETLOGON_NT_VERSION_5EX; + if (NDR_ERR_CODE_IS_SUCCESS(ndr_err) && DEBUGLEVEL >= 10) { + NDR_PRINT_DEBUG(NETLOGON_SAM_LOGON_RESPONSE_EX, &response->nt5_ex); + } } else if (ntver & NETLOGON_NT_VERSION_5) { ndr_err = ndr_pull_struct_blob_all(data, mem_ctx, @@ -102,6 +109,9 @@ NTSTATUS pull_netlogon_samlogon_response(DATA_BLOB *data, TALLOC_CTX *mem_ctx, &response->nt5, (ndr_pull_flags_fn_t)ndr_pull_NETLOGON_SAM_LOGON_RESPONSE); response->ntver = NETLOGON_NT_VERSION_5; + if (NDR_ERR_CODE_IS_SUCCESS(ndr_err) && DEBUGLEVEL >= 10) { + NDR_PRINT_DEBUG(NETLOGON_SAM_LOGON_RESPONSE, &response->nt5); + } } else { DEBUG(2,("failed to parse netlogon response of type 0x%02x - unknown response type\n", ntver)); @@ -115,6 +125,7 @@ NTSTATUS pull_netlogon_samlogon_response(DATA_BLOB *data, TALLOC_CTX *mem_ctx, dump_data(10, data->data, data->length); return ndr_map_error2ntstatus(ndr_err); } + return NT_STATUS_OK; } diff --git a/source3/Makefile.in b/source3/Makefile.in index 97095fcadd..333c5f3001 100644 --- a/source3/Makefile.in +++ b/source3/Makefile.in @@ -377,6 +377,8 @@ LIBADS_SERVER_OBJ = libads/kerberos_verify.o libads/authdata.o \ SECRETS_OBJ = passdb/secrets.o passdb/machine_sid.o LIBNBT_OBJ = ../libcli/nbt/nbtname.o \ + ../libcli/netlogon.o \ + ../libcli/ndr_netlogon.o \ librpc/gen_ndr/ndr_nbt.o \ librpc/gen_ndr/ndr_svcctl.o diff --git a/source3/include/includes.h b/source3/include/includes.h index ccdc6d3fd3..fbf5ca6cd0 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -703,6 +703,7 @@ typedef char fstring[FSTRING_LEN]; #include "librpc/gen_ndr/notify.h" #include "librpc/gen_ndr/xattr.h" #include "librpc/gen_ndr/messaging.h" +#include "librpc/gen_ndr/ndr_nbt.h" #include "librpc/rpc/dcerpc.h" #include "nt_printing.h" #include "idmap.h" diff --git a/source3/include/proto.h b/source3/include/proto.h index 6eac9d1129..4a51835f3d 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1927,20 +1927,15 @@ NTSTATUS kerberos_return_info3_from_pac(TALLOC_CTX *mem_ctx, struct netr_SamInfo3 **info3); /* The following definitions come from libads/cldap.c */ - bool ads_cldap_netlogon(TALLOC_CTX *mem_ctx, const char *server, const char *realm, - uint32_t *nt_version, - union nbt_cldap_netlogon **reply); + uint32_t nt_version, + struct netlogon_samlogon_response **reply); bool ads_cldap_netlogon_5(TALLOC_CTX *mem_ctx, const char *server, const char *realm, - struct nbt_cldap_netlogon_5 *reply5); -bool pull_mailslot_cldap_reply(TALLOC_CTX *mem_ctx, - const DATA_BLOB *blob, - union nbt_cldap_netlogon *r, - uint32_t *nt_version); + struct NETLOGON_SAM_LOGON_RESPONSE_EX *reply5); /* The following definitions come from libads/disp_sec.c */ @@ -2854,93 +2849,6 @@ _PUBLIC_ enum ndr_err_code ndr_push_samr_RejectReason(struct ndr_push *ndr, int _PUBLIC_ enum ndr_err_code ndr_pull_samr_RejectReason(struct ndr_pull *ndr, int ndr_flags, enum samr_RejectReason *r); _PUBLIC_ void ndr_print_samr_RejectReason(struct ndr_print *ndr, const char *name, enum samr_RejectReason r); -/* The following definitions come from librpc/gen_ndr/ndr_nbt.c */ - -_PUBLIC_ void ndr_print_nbt_operation(struct ndr_print *ndr, const char *name, uint16_t r); -_PUBLIC_ void ndr_print_nbt_name_type(struct ndr_print *ndr, const char *name, enum nbt_name_type r); -_PUBLIC_ void ndr_print_nbt_name(struct ndr_print *ndr, const char *name, const struct nbt_name *r); -_PUBLIC_ void ndr_print_nbt_qclass(struct ndr_print *ndr, const char *name, enum nbt_qclass r); -_PUBLIC_ void ndr_print_nbt_qtype(struct ndr_print *ndr, const char *name, enum nbt_qtype r); -_PUBLIC_ void ndr_print_nbt_name_question(struct ndr_print *ndr, const char *name, const struct nbt_name_question *r); -_PUBLIC_ void ndr_print_nb_flags(struct ndr_print *ndr, const char *name, uint16_t r); -_PUBLIC_ void ndr_print_nbt_rdata_address(struct ndr_print *ndr, const char *name, const struct nbt_rdata_address *r); -_PUBLIC_ void ndr_print_nbt_rdata_netbios(struct ndr_print *ndr, const char *name, const struct nbt_rdata_netbios *r); -_PUBLIC_ void ndr_print_nbt_statistics(struct ndr_print *ndr, const char *name, const struct nbt_statistics *r); -_PUBLIC_ void ndr_print_nbt_status_name(struct ndr_print *ndr, const char *name, const struct nbt_status_name *r); -_PUBLIC_ void ndr_print_nbt_rdata_status(struct ndr_print *ndr, const char *name, const struct nbt_rdata_status *r); -_PUBLIC_ void ndr_print_nbt_rdata_data(struct ndr_print *ndr, const char *name, const struct nbt_rdata_data *r); -_PUBLIC_ void ndr_print_nbt_rdata(struct ndr_print *ndr, const char *name, const union nbt_rdata *r); -_PUBLIC_ void ndr_print_nbt_res_rec(struct ndr_print *ndr, const char *name, const struct nbt_res_rec *r); -_PUBLIC_ enum ndr_err_code ndr_push_nbt_name_packet(struct ndr_push *ndr, int ndr_flags, const struct nbt_name_packet *r); -_PUBLIC_ enum ndr_err_code ndr_pull_nbt_name_packet(struct ndr_pull *ndr, int ndr_flags, struct nbt_name_packet *r); -_PUBLIC_ void ndr_print_nbt_name_packet(struct ndr_print *ndr, const char *name, const struct nbt_name_packet *r); -_PUBLIC_ void ndr_print_dgram_msg_type(struct ndr_print *ndr, const char *name, enum dgram_msg_type r); -_PUBLIC_ void ndr_print_dgram_flags(struct ndr_print *ndr, const char *name, uint8_t r); -_PUBLIC_ void ndr_print_smb_command(struct ndr_print *ndr, const char *name, enum smb_command r); -_PUBLIC_ void ndr_print_smb_trans_body(struct ndr_print *ndr, const char *name, const struct smb_trans_body *r); -_PUBLIC_ void ndr_print_smb_body(struct ndr_print *ndr, const char *name, const union smb_body *r); -_PUBLIC_ enum ndr_err_code ndr_push_dgram_smb_packet(struct ndr_push *ndr, int ndr_flags, const struct dgram_smb_packet *r); -_PUBLIC_ enum ndr_err_code ndr_pull_dgram_smb_packet(struct ndr_pull *ndr, int ndr_flags, struct dgram_smb_packet *r); -_PUBLIC_ void ndr_print_dgram_smb_packet(struct ndr_print *ndr, const char *name, const struct dgram_smb_packet *r); -_PUBLIC_ void ndr_print_dgram_message_body(struct ndr_print *ndr, const char *name, const union dgram_message_body *r); -_PUBLIC_ void ndr_print_dgram_message(struct ndr_print *ndr, const char *name, const struct dgram_message *r); -_PUBLIC_ void ndr_print_dgram_err_code(struct ndr_print *ndr, const char *name, enum dgram_err_code r); -_PUBLIC_ void ndr_print_dgram_data(struct ndr_print *ndr, const char *name, const union dgram_data *r); -_PUBLIC_ enum ndr_err_code ndr_push_nbt_dgram_packet(struct ndr_push *ndr, int ndr_flags, const struct nbt_dgram_packet *r); -_PUBLIC_ enum ndr_err_code ndr_pull_nbt_dgram_packet(struct ndr_pull *ndr, int ndr_flags, struct nbt_dgram_packet *r); -_PUBLIC_ void ndr_print_nbt_dgram_packet(struct ndr_print *ndr, const char *name, const struct nbt_dgram_packet *r); -_PUBLIC_ void ndr_print_nbt_netlogon_command(struct ndr_print *ndr, const char *name, enum nbt_netlogon_command r); -_PUBLIC_ void ndr_print_nbt_netlogon_version(struct ndr_print *ndr, const char *name, uint32_t r); -_PUBLIC_ void ndr_print_nbt_netlogon_query_for_pdc(struct ndr_print *ndr, const char *name, const struct nbt_netlogon_query_for_pdc *r); -_PUBLIC_ void ndr_print_nbt_netlogon_query_for_pdc2(struct ndr_print *ndr, const char *name, const struct nbt_netlogon_query_for_pdc2 *r); -_PUBLIC_ void ndr_print_nbt_netlogon_response_from_pdc(struct ndr_print *ndr, const char *name, const struct nbt_netlogon_response_from_pdc *r); -_PUBLIC_ void ndr_print_nbt_server_type(struct ndr_print *ndr, const char *name, uint32_t r); -_PUBLIC_ void ndr_print_nbt_dc_sock_addr(struct ndr_print *ndr, const char *name, const struct nbt_dc_sock_addr *r); -_PUBLIC_ void ndr_print_nbt_netlogon_response_from_pdc2(struct ndr_print *ndr, const char *name, const struct nbt_netlogon_response_from_pdc2 *r); -_PUBLIC_ void ndr_print_nbt_db_change(struct ndr_print *ndr, const char *name, const struct nbt_db_change *r); -_PUBLIC_ void ndr_print_nbt_netlogon_announce_uas(struct ndr_print *ndr, const char *name, const struct nbt_netlogon_announce_uas *r); -_PUBLIC_ void ndr_print_nbt_netlogon_request(struct ndr_print *ndr, const char *name, const union nbt_netlogon_request *r); -_PUBLIC_ enum ndr_err_code ndr_push_nbt_netlogon_packet(struct ndr_push *ndr, int ndr_flags, const struct nbt_netlogon_packet *r); -_PUBLIC_ enum ndr_err_code ndr_pull_nbt_netlogon_packet(struct ndr_pull *ndr, int ndr_flags, struct nbt_netlogon_packet *r); -_PUBLIC_ void ndr_print_nbt_netlogon_packet(struct ndr_print *ndr, const char *name, const struct nbt_netlogon_packet *r); -_PUBLIC_ void ndr_print_nbt_cldap_netlogon_1(struct ndr_print *ndr, const char *name, const struct nbt_cldap_netlogon_1 *r); -_PUBLIC_ void ndr_print_nbt_cldap_netlogon_3(struct ndr_print *ndr, const char *name, const struct nbt_cldap_netlogon_3 *r); -_PUBLIC_ enum ndr_err_code ndr_push_nbt_cldap_netlogon_5(struct ndr_push *ndr, int ndr_flags, const struct nbt_cldap_netlogon_5 *r); -_PUBLIC_ enum ndr_err_code ndr_pull_nbt_cldap_netlogon_5(struct ndr_pull *ndr, int ndr_flags, struct nbt_cldap_netlogon_5 *r); -_PUBLIC_ void ndr_print_nbt_cldap_netlogon_5(struct ndr_print *ndr, const char *name, const struct nbt_cldap_netlogon_5 *r); -_PUBLIC_ void ndr_print_nbt_cldap_netlogon_13(struct ndr_print *ndr, const char *name, const struct nbt_cldap_netlogon_13 *r); -_PUBLIC_ enum ndr_err_code ndr_push_nbt_cldap_netlogon_15(struct ndr_push *ndr, int ndr_flags, const struct nbt_cldap_netlogon_15 *r); -_PUBLIC_ enum ndr_err_code ndr_pull_nbt_cldap_netlogon_15(struct ndr_pull *ndr, int ndr_flags, struct nbt_cldap_netlogon_15 *r); -_PUBLIC_ void ndr_print_nbt_cldap_netlogon_15(struct ndr_print *ndr, const char *name, const struct nbt_cldap_netlogon_15 *r); -_PUBLIC_ enum ndr_err_code ndr_push_nbt_cldap_netlogon_29(struct ndr_push *ndr, int ndr_flags, const struct nbt_cldap_netlogon_29 *r); -_PUBLIC_ enum ndr_err_code ndr_pull_nbt_cldap_netlogon_29(struct ndr_pull *ndr, int ndr_flags, struct nbt_cldap_netlogon_29 *r); -_PUBLIC_ void ndr_print_nbt_cldap_netlogon_29(struct ndr_print *ndr, const char *name, const struct nbt_cldap_netlogon_29 *r); -_PUBLIC_ enum ndr_err_code ndr_push_nbt_cldap_netlogon(struct ndr_push *ndr, int ndr_flags, const union nbt_cldap_netlogon *r); -_PUBLIC_ enum ndr_err_code ndr_pull_nbt_cldap_netlogon(struct ndr_pull *ndr, int ndr_flags, union nbt_cldap_netlogon *r); -_PUBLIC_ void ndr_print_nbt_cldap_netlogon(struct ndr_print *ndr, const char *name, const union nbt_cldap_netlogon *r); -_PUBLIC_ void ndr_print_nbt_ntlogon_command(struct ndr_print *ndr, const char *name, enum nbt_ntlogon_command r); -_PUBLIC_ void ndr_print_nbt_ntlogon_sam_logon(struct ndr_print *ndr, const char *name, const struct nbt_ntlogon_sam_logon *r); -_PUBLIC_ void ndr_print_nbt_ntlogon_sam_logon_reply(struct ndr_print *ndr, const char *name, const struct nbt_ntlogon_sam_logon_reply *r); -_PUBLIC_ void ndr_print_nbt_ntlogon_request(struct ndr_print *ndr, const char *name, const union nbt_ntlogon_request *r); -_PUBLIC_ enum ndr_err_code ndr_push_nbt_ntlogon_packet(struct ndr_push *ndr, int ndr_flags, const struct nbt_ntlogon_packet *r); -_PUBLIC_ enum ndr_err_code ndr_pull_nbt_ntlogon_packet(struct ndr_pull *ndr, int ndr_flags, struct nbt_ntlogon_packet *r); -_PUBLIC_ void ndr_print_nbt_ntlogon_packet(struct ndr_print *ndr, const char *name, const struct nbt_ntlogon_packet *r); -_PUBLIC_ void ndr_print_nbt_browse_opcode(struct ndr_print *ndr, const char *name, enum nbt_browse_opcode r); -_PUBLIC_ void ndr_print_nbt_browse_host_announcement(struct ndr_print *ndr, const char *name, const struct nbt_browse_host_announcement *r); -_PUBLIC_ void ndr_print_nbt_browse_announcement_request(struct ndr_print *ndr, const char *name, const struct nbt_browse_announcement_request *r); -_PUBLIC_ void ndr_print_nbt_browse_election_request(struct ndr_print *ndr, const char *name, const struct nbt_browse_election_request *r); -_PUBLIC_ void ndr_print_nbt_browse_backup_list_request(struct ndr_print *ndr, const char *name, const struct nbt_browse_backup_list_request *r); -_PUBLIC_ void ndr_print_nbt_browse_backup_list_response(struct ndr_print *ndr, const char *name, const struct nbt_browse_backup_list_response *r); -_PUBLIC_ void ndr_print_nbt_browse_become_backup(struct ndr_print *ndr, const char *name, const struct nbt_browse_become_backup *r); -_PUBLIC_ void ndr_print_nbt_browse_domain_announcement(struct ndr_print *ndr, const char *name, const struct nbt_browse_domain_announcement *r); -_PUBLIC_ void ndr_print_nbt_browse_master_announcement(struct ndr_print *ndr, const char *name, const struct nbt_browse_master_announcement *r); -_PUBLIC_ void ndr_print_nbt_browse_reset_state(struct ndr_print *ndr, const char *name, const struct nbt_browse_reset_state *r); -_PUBLIC_ void ndr_print_nbt_browse_local_master_announcement(struct ndr_print *ndr, const char *name, const struct nbt_browse_local_master_announcement *r); -_PUBLIC_ void ndr_print_nbt_browse_payload(struct ndr_print *ndr, const char *name, const union nbt_browse_payload *r); -_PUBLIC_ enum ndr_err_code ndr_push_nbt_browse_packet(struct ndr_push *ndr, int ndr_flags, const struct nbt_browse_packet *r); -_PUBLIC_ enum ndr_err_code ndr_pull_nbt_browse_packet(struct ndr_pull *ndr, int ndr_flags, struct nbt_browse_packet *r); -_PUBLIC_ void ndr_print_nbt_browse_packet(struct ndr_print *ndr, const char *name, const struct nbt_browse_packet *r); - /* The following definitions come from librpc/gen_ndr/ndr_netlogon.c */ _PUBLIC_ void ndr_print_netr_UasInfo(struct ndr_print *ndr, const char *name, const struct netr_UasInfo *r); @@ -4295,7 +4203,7 @@ bool receive_getdc_response(TALLOC_CTX *mem_ctx, const char *domain_name, uint32_t *nt_version, const char **dc_name, - union nbt_cldap_netlogon **reply); + struct netlogon_samlogon_response **reply); /* The following definitions come from libsmb/clientgen.c */ diff --git a/source3/libads/cldap.c b/source3/libads/cldap.c index b89d285e8c..edabbed0e9 100644 --- a/source3/libads/cldap.c +++ b/source3/libads/cldap.c @@ -119,8 +119,8 @@ static void gotalarm_sig(void) */ static int recv_cldap_netlogon(TALLOC_CTX *mem_ctx, int sock, - uint32_t *nt_version, - union nbt_cldap_netlogon **reply) + uint32_t nt_version, + struct netlogon_samlogon_response **reply) { int ret; ASN1_DATA data; @@ -131,7 +131,8 @@ static int recv_cldap_netlogon(TALLOC_CTX *mem_ctx, int i1; /* half the time of a regular ldap timeout, not less than 3 seconds. */ unsigned int al_secs = MAX(3,lp_ldap_timeout()/2); - union nbt_cldap_netlogon *r = NULL; + struct netlogon_samlogon_response *r = NULL; + NTSTATUS status; blob = data_blob(NULL, 8192); if (blob.data == NULL) { @@ -185,7 +186,7 @@ static int recv_cldap_netlogon(TALLOC_CTX *mem_ctx, return -1; } - r = TALLOC_ZERO_P(mem_ctx, union nbt_cldap_netlogon); + r = TALLOC_ZERO_P(mem_ctx, struct netlogon_samlogon_response); if (!r) { errno = ENOMEM; data_blob_free(&os1); @@ -195,7 +196,8 @@ static int recv_cldap_netlogon(TALLOC_CTX *mem_ctx, return -1; } - if (!pull_mailslot_cldap_reply(mem_ctx, &os3, r, nt_version)) { + status = pull_netlogon_samlogon_response(&os3, mem_ctx, NULL, r); + if (!NT_STATUS_IS_OK(status)) { data_blob_free(&os1); data_blob_free(&os2); data_blob_free(&os3); @@ -204,6 +206,8 @@ static int recv_cldap_netlogon(TALLOC_CTX *mem_ctx, return -1; } + map_netlogon_samlogon_response(r); + data_blob_free(&os1); data_blob_free(&os2); data_blob_free(&os3); @@ -227,8 +231,8 @@ static int recv_cldap_netlogon(TALLOC_CTX *mem_ctx, bool ads_cldap_netlogon(TALLOC_CTX *mem_ctx, const char *server, const char *realm, - uint32_t *nt_version, - union nbt_cldap_netlogon **reply) + uint32_t nt_version, + struct netlogon_samlogon_response **reply) { int sock; int ret; @@ -240,7 +244,7 @@ bool ads_cldap_netlogon(TALLOC_CTX *mem_ctx, return False; } - ret = send_cldap_netlogon(sock, realm, global_myname(), *nt_version); + ret = send_cldap_netlogon(sock, realm, global_myname(), nt_version); if (ret != 0) { close(sock); return False; @@ -262,107 +266,24 @@ bool ads_cldap_netlogon(TALLOC_CTX *mem_ctx, bool ads_cldap_netlogon_5(TALLOC_CTX *mem_ctx, const char *server, const char *realm, - struct nbt_cldap_netlogon_5 *reply5) + struct NETLOGON_SAM_LOGON_RESPONSE_EX *reply5) { uint32_t nt_version = NETLOGON_NT_VERSION_5 | NETLOGON_NT_VERSION_5EX; - union nbt_cldap_netlogon *reply = NULL; + struct netlogon_samlogon_response *reply = NULL; bool ret; - ret = ads_cldap_netlogon(mem_ctx, server, realm, &nt_version, &reply); + ret = ads_cldap_netlogon(mem_ctx, server, realm, nt_version, &reply); if (!ret) { return false; } - if (nt_version != (NETLOGON_NT_VERSION_5 | NETLOGON_NT_VERSION_5EX)) { + if (reply->ntver != NETLOGON_NT_VERSION_5EX) { + DEBUG(0,("ads_cldap_netlogon_5: nt_version mismatch: 0x%08x\n", + reply->ntver)); return false; } - *reply5 = reply->logon5; - - return true; -} - -/**************************************************************** -****************************************************************/ - -bool pull_mailslot_cldap_reply(TALLOC_CTX *mem_ctx, - const DATA_BLOB *blob, - union nbt_cldap_netlogon *r, - uint32_t *nt_version) -{ - enum ndr_err_code ndr_err; - uint32_t nt_version_query = ((*nt_version) & 0x0000001f); - uint16_t command = 0; - - ndr_err = ndr_pull_struct_blob(blob, mem_ctx, NULL, &command, - (ndr_pull_flags_fn_t)ndr_pull_uint16); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - return false; - } - - switch (command) { - case 0x13: /* 19 */ - case 0x15: /* 21 */ - case 0x17: /* 23 */ - case 0x19: /* 25 */ - break; - default: - DEBUG(1,("got unexpected command: %d (0x%08x)\n", - command, command)); - return false; - } - - ndr_err = ndr_pull_union_blob_all(blob, mem_ctx, r, nt_version_query, - (ndr_pull_flags_fn_t)ndr_pull_nbt_cldap_netlogon); - if (NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - goto done; - } - - /* when the caller requested just those nt_version bits that the server - * was able to reply to, we are fine and all done. otherwise we need to - * assume downgraded replies which are painfully parsed here - gd */ - - if (nt_version_query & NETLOGON_NT_VERSION_WITH_CLOSEST_SITE) { - nt_version_query &= ~NETLOGON_NT_VERSION_WITH_CLOSEST_SITE; - } - ndr_err = ndr_pull_union_blob_all(blob, mem_ctx, r, nt_version_query, - (ndr_pull_flags_fn_t)ndr_pull_nbt_cldap_netlogon); - if (NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - goto done; - } - if (nt_version_query & NETLOGON_NT_VERSION_5EX_WITH_IP) { - nt_version_query &= ~NETLOGON_NT_VERSION_5EX_WITH_IP; - } - ndr_err = ndr_pull_union_blob_all(blob, mem_ctx, r, nt_version_query, - (ndr_pull_flags_fn_t)ndr_pull_nbt_cldap_netlogon); - if (NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - goto done; - } - if (nt_version_query & NETLOGON_NT_VERSION_5EX) { - nt_version_query &= ~NETLOGON_NT_VERSION_5EX; - } - ndr_err = ndr_pull_union_blob_all(blob, mem_ctx, r, nt_version_query, - (ndr_pull_flags_fn_t)ndr_pull_nbt_cldap_netlogon); - if (NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - goto done; - } - if (nt_version_query & NETLOGON_NT_VERSION_5) { - nt_version_query &= ~NETLOGON_NT_VERSION_5; - } - ndr_err = ndr_pull_union_blob_all(blob, mem_ctx, r, nt_version_query, - (ndr_pull_flags_fn_t)ndr_pull_nbt_cldap_netlogon); - if (NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - goto done; - } - - return false; - - done: - if (DEBUGLEVEL >= 10) { - NDR_PRINT_UNION_DEBUG(nbt_cldap_netlogon, nt_version_query, r); - } - - *nt_version = nt_version_query; + *reply5 = reply->nt5_ex; return true; } diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c index eb45e3a0dd..bfcfcf30b9 100644 --- a/source3/libads/ldap.c +++ b/source3/libads/ldap.c @@ -176,7 +176,7 @@ bool ads_closest_dc(ADS_STRUCT *ads) static bool ads_try_connect(ADS_STRUCT *ads, const char *server, bool gc) { char *srv; - struct nbt_cldap_netlogon_5 cldap_reply; + struct NETLOGON_SAM_LOGON_RESPONSE_EX cldap_reply; TALLOC_CTX *mem_ctx = NULL; bool ret = false; diff --git a/source3/librpc/gen_ndr/nbt.h b/source3/librpc/gen_ndr/nbt.h index 847f63b9b8..264b00b84f 100644 --- a/source3/librpc/gen_ndr/nbt.h +++ b/source3/librpc/gen_ndr/nbt.h @@ -228,8 +228,8 @@ struct nbt_res_rec { enum nbt_qtype rr_type; enum nbt_qclass rr_class; uint32_t ttl; - union nbt_rdata rdata;/* [switch_is(((((rr_type)==NBT_QTYPE_NETBIOS)&&talloc_check_name(ndr,"struct ndr_push")&&((rdata).data.length==2))?0:rr_type))] */ -}/* [flag(LIBNDR_PRINT_ARRAY_HEX)] */; + union nbt_rdata rdata;/* [switch_is(rr_type)] */ +}/* [nopush,flag(LIBNDR_PRINT_ARRAY_HEX)] */; struct nbt_name_packet { uint16_t name_trn_id; @@ -390,28 +390,27 @@ struct nbt_dgram_packet { union dgram_data data;/* [switch_is(msg_type)] */ }/* [public,flag(LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_BIGENDIAN|LIBNDR_PRINT_ARRAY_HEX)] */; -enum nbt_netlogon_command -#ifndef USE_UINT_ENUMS - { - NETLOGON_QUERY_FOR_PDC=0x7, - NETLOGON_ANNOUNCE_UAS=0xa, - NETLOGON_RESPONSE_FROM_PDC=0xc, - NETLOGON_QUERY_FOR_PDC2=0x12, - NETLOGON_RESPONSE_FROM_PDC2=0x17, - NETLOGON_RESPONSE_FROM_PDC_USER=0x19 -} -#else - { __donnot_use_enum_nbt_netlogon_command=0x7FFFFFFF} -#define NETLOGON_QUERY_FOR_PDC ( 0x7 ) -#define NETLOGON_ANNOUNCE_UAS ( 0xa ) -#define NETLOGON_RESPONSE_FROM_PDC ( 0xc ) -#define NETLOGON_QUERY_FOR_PDC2 ( 0x12 ) -#define NETLOGON_RESPONSE_FROM_PDC2 ( 0x17 ) -#define NETLOGON_RESPONSE_FROM_PDC_USER ( 0x19 ) -#endif -; +struct nbt_sockaddr { + uint32_t sa_family; + const char * pdc_ip;/* [flag(LIBNDR_FLAG_BIGENDIAN)] */ + DATA_BLOB remaining;/* [flag(LIBNDR_FLAG_REMAINING)] */ +}/* [gensize,public] */; -/* bitmap nbt_netlogon_version */ +/* bitmap nbt_server_type */ +#define NBT_SERVER_PDC ( 0x00000001 ) +#define NBT_SERVER_GC ( 0x00000004 ) +#define NBT_SERVER_LDAP ( 0x00000008 ) +#define NBT_SERVER_DS ( 0x00000010 ) +#define NBT_SERVER_KDC ( 0x00000020 ) +#define NBT_SERVER_TIMESERV ( 0x00000040 ) +#define NBT_SERVER_CLOSEST ( 0x00000080 ) +#define NBT_SERVER_WRITABLE ( 0x00000100 ) +#define NBT_SERVER_GOOD_TIMESERV ( 0x00000200 ) +#define NBT_SERVER_NDNC ( 0x00000400 ) +#define NBT_SERVER_SELECT_SECRET_DOMAIN_6 ( 0x00000800 ) +#define NBT_SERVER_FULL_SECRET_DOMAIN_6 ( 0x00001000 ) + +/* bitmap netlogon_nt_version_flags */ #define NETLOGON_NT_VERSION_1 ( 0x00000001 ) #define NETLOGON_NT_VERSION_5 ( 0x00000002 ) #define NETLOGON_NT_VERSION_5EX ( 0x00000004 ) @@ -423,59 +422,79 @@ enum nbt_netlogon_command #define NETLOGON_NT_VERSION_LOCAL ( 0x40000000 ) #define NETLOGON_NT_VERSION_GC ( 0x80000000 ) -struct nbt_netlogon_query_for_pdc { - const char * computer_name;/* [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] */ +enum netlogon_command +#ifndef USE_UINT_ENUMS + { + LOGON_PRIMARY_QUERY=7, + NETLOGON_ANNOUNCE_UAS=10, + NETLOGON_RESPONSE_FROM_PDC=12, + LOGON_SAM_LOGON_REQUEST=18, + LOGON_SAM_LOGON_RESPONSE=19, + LOGON_SAM_LOGON_PAUSE_RESPONSE=20, + LOGON_SAM_LOGON_USER_UNKNOWN=21, + LOGON_SAM_LOGON_RESPONSE_EX=23, + LOGON_SAM_LOGON_PAUSE_RESPONSE_EX=24, + LOGON_SAM_LOGON_USER_UNKNOWN_EX=25 +} +#else + { __donnot_use_enum_netlogon_command=0x7FFFFFFF} +#define LOGON_PRIMARY_QUERY ( 7 ) +#define NETLOGON_ANNOUNCE_UAS ( 10 ) +#define NETLOGON_RESPONSE_FROM_PDC ( 12 ) +#define LOGON_SAM_LOGON_REQUEST ( 18 ) +#define LOGON_SAM_LOGON_RESPONSE ( 19 ) +#define LOGON_SAM_LOGON_PAUSE_RESPONSE ( 20 ) +#define LOGON_SAM_LOGON_USER_UNKNOWN ( 21 ) +#define LOGON_SAM_LOGON_RESPONSE_EX ( 23 ) +#define LOGON_SAM_LOGON_PAUSE_RESPONSE_EX ( 24 ) +#define LOGON_SAM_LOGON_USER_UNKNOWN_EX ( 25 ) +#endif +; + +struct NETLOGON_SAM_LOGON_REQUEST { + uint16_t request_count; + const char * computer_name;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */ + const char * user_name;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */ const char * mailslot_name;/* [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] */ - DATA_BLOB _pad;/* [flag(LIBNDR_FLAG_ALIGN2)] */ - const char * unicode_name;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */ + uint32_t acct_control; + uint32_t sid_size;/* [value(ndr_size_dom_sid0(&sid,ndr->flags))] */ + DATA_BLOB _pad;/* [flag(LIBNDR_FLAG_ALIGN4)] */ + struct dom_sid0 sid;/* [subcontext_size(sid_size),subcontext(0)] */ uint32_t nt_version; uint16_t lmnt_token; uint16_t lm20_token; -}; +}/* [nopull,nopush] */; -struct nbt_netlogon_query_for_pdc2 { - uint16_t request_count; - const char * computer_name;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */ +struct NETLOGON_SAM_LOGON_RESPONSE_NT40 { + enum netlogon_command command; + const char * server;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */ const char * user_name;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */ - const char * mailslot_name;/* [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] */ - uint32_t unknown[2]; + const char * domain;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */ uint32_t nt_version; uint16_t lmnt_token; uint16_t lm20_token; -}; +}/* [public,flag(LIBNDR_FLAG_NOALIGN)] */; -struct nbt_netlogon_response_from_pdc { - const char * pdc_name;/* [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] */ - DATA_BLOB _pad;/* [flag(LIBNDR_FLAG_ALIGN2)] */ - const char * unicode_pdc_name;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */ +struct NETLOGON_SAM_LOGON_RESPONSE { + enum netlogon_command command; + const char * pdc_name;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */ + const char * user_name;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */ const char * domain_name;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */ + struct GUID domain_uuid; + struct GUID zero_uuid; + const char * forest; + const char * dns_domain; + const char * pdc_dns_name; + const char * pdc_ip; + uint32_t server_type; uint32_t nt_version; uint16_t lmnt_token; uint16_t lm20_token; -}; - -/* bitmap nbt_server_type */ -#define NBT_SERVER_PDC ( 0x00000001 ) -#define NBT_SERVER_GC ( 0x00000004 ) -#define NBT_SERVER_LDAP ( 0x00000008 ) -#define NBT_SERVER_DS ( 0x00000010 ) -#define NBT_SERVER_KDC ( 0x00000020 ) -#define NBT_SERVER_TIMESERV ( 0x00000040 ) -#define NBT_SERVER_CLOSEST ( 0x00000080 ) -#define NBT_SERVER_WRITABLE ( 0x00000100 ) -#define NBT_SERVER_GOOD_TIMESERV ( 0x00000200 ) -#define NBT_SERVER_NDNC ( 0x00000400 ) -#define NBT_SERVER_SELECT_SECRET_DOMAIN_6 ( 0x00000800 ) -#define NBT_SERVER_FULL_SECRET_DOMAIN_6 ( 0x00001000 ) - -struct nbt_dc_sock_addr { - uint32_t family; - const char * pdc_ip;/* [flag(LIBNDR_FLAG_BIGENDIAN)] */ - DATA_BLOB remaining;/* [flag(LIBNDR_FLAG_REMAINING)] */ -}; +}/* [public,flag(LIBNDR_FLAG_NOALIGN)] */; -struct nbt_netlogon_response_from_pdc2 { - DATA_BLOB _pad;/* [flag(LIBNDR_FLAG_ALIGN4)] */ +struct NETLOGON_SAM_LOGON_RESPONSE_EX { + enum netlogon_command command; + uint16_t sbz; uint32_t server_type; struct GUID domain_uuid; const char * forest; @@ -486,22 +505,44 @@ struct nbt_netlogon_response_from_pdc2 { const char * user_name; const char * server_site; const char * client_site; - uint8_t dc_sock_addr_size; - struct nbt_dc_sock_addr dc_sock_addr;/* [subcontext_size(dc_sock_addr_size),subcontext(0)] */ + uint8_t sockaddr_size;/* [value(ndr_size_nbt_sockaddr(&sockaddr,ndr->flags))] */ + struct nbt_sockaddr sockaddr;/* [subcontext_size(sockaddr_size),subcontext(0)] */ + const char * next_closest_site; + uint32_t nt_version; + uint16_t lmnt_token; + uint16_t lm20_token; +}/* [public,flag(LIBNDR_FLAG_NOALIGN)] */; + +struct nbt_netlogon_query_for_pdc { + const char * computer_name;/* [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] */ + const char * mailslot_name;/* [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] */ + DATA_BLOB _pad;/* [flag(LIBNDR_FLAG_ALIGN2)] */ + const char * unicode_name;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */ uint32_t nt_version; uint16_t lmnt_token; uint16_t lm20_token; }; +struct nbt_netlogon_response_from_pdc { + enum netlogon_command command; + const char * pdc_name;/* [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] */ + DATA_BLOB _pad;/* [flag(LIBNDR_FLAG_ALIGN2)] */ + const char * unicode_pdc_name;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */ + const char * domain_name;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */ + uint32_t nt_version; + uint16_t lmnt_token; + uint16_t lm20_token; +}/* [public,flag(LIBNDR_FLAG_NOALIGN)] */; + enum netr_SamDatabaseID; -struct nbt_db_change { +struct nbt_db_change_info { enum netr_SamDatabaseID db_index; uint64_t serial; NTTIME timestamp; }; -struct nbt_netlogon_announce_uas { +struct NETLOGON_DB_CHANGE { uint32_t serial_lo; time_t timestamp; uint32_t pulse; @@ -512,191 +553,24 @@ struct nbt_netlogon_announce_uas { const char * unicode_pdc_name;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */ const char * unicode_domain;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */ uint32_t db_count; - struct nbt_db_change *dbchange; + struct nbt_db_change_info *dbchange; uint32_t sid_size;/* [value(ndr_size_dom_sid0(&sid,ndr->flags))] */ struct dom_sid0 sid;/* [subcontext_size(sid_size),subcontext(0)] */ - uint32_t nt_version; - uint16_t lmnt_token; - uint16_t lm20_token; + uint32_t message_format_version; + uint32_t message_token; }; union nbt_netlogon_request { - struct nbt_netlogon_query_for_pdc pdc;/* [case(NETLOGON_QUERY_FOR_PDC)] */ - struct nbt_netlogon_query_for_pdc2 pdc2;/* [case(NETLOGON_QUERY_FOR_PDC2)] */ - struct nbt_netlogon_announce_uas uas;/* [case(NETLOGON_ANNOUNCE_UAS)] */ - struct nbt_netlogon_response_from_pdc response;/* [case(NETLOGON_RESPONSE_FROM_PDC)] */ - struct nbt_netlogon_response_from_pdc2 response2;/* [case(NETLOGON_RESPONSE_FROM_PDC2)] */ + struct NETLOGON_SAM_LOGON_REQUEST logon;/* [case(LOGON_SAM_LOGON_REQUEST)] */ + struct nbt_netlogon_query_for_pdc pdc;/* [case(LOGON_PRIMARY_QUERY)] */ + struct NETLOGON_DB_CHANGE uas;/* [case(NETLOGON_ANNOUNCE_UAS)] */ }/* [nodiscriminant] */; struct nbt_netlogon_packet { - enum nbt_netlogon_command command; + enum netlogon_command command; union nbt_netlogon_request req;/* [switch_is(command)] */ }/* [public,flag(LIBNDR_FLAG_NOALIGN)] */; -struct nbt_cldap_netlogon_1 { - enum nbt_netlogon_command type; - const char * pdc_name;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */ - const char * user_name;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */ - const char * domain_name;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */ - uint32_t nt_version;/* [value] */ - uint16_t lmnt_token; - uint16_t lm20_token; -}; - -struct nbt_cldap_netlogon_3 { - enum nbt_netlogon_command type; - const char * pdc_name;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */ - const char * user_name;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */ - const char * domain_name;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */ - struct GUID domain_uuid; - struct GUID unknown_uuid; - const char * forest; - const char * dns_domain; - const char * pdc_dns_name; - const char * pdc_ip; - uint32_t server_type; - uint32_t nt_version;/* [value(3)] */ - uint16_t lmnt_token; - uint16_t lm20_token; -}; - -struct nbt_cldap_netlogon_5 { - enum nbt_netlogon_command type; - uint16_t sbz; - uint32_t server_type; - struct GUID domain_uuid; - const char * forest; - const char * dns_domain; - const char * pdc_dns_name; - const char * domain; - const char * pdc_name; - const char * user_name; - const char * server_site; - const char * client_site; - uint32_t nt_version;/* [value(5)] */ - uint16_t lmnt_token; - uint16_t lm20_token; -}/* [public] */; - -struct nbt_cldap_netlogon_13 { - enum nbt_netlogon_command type; - uint16_t sbz; - uint32_t server_type; - struct GUID domain_uuid; - const char * forest; - const char * dns_domain; - const char * pdc_dns_name; - const char * domain; - const char * pdc_name; - const char * user_name; - const char * server_site; - const char * client_site; - uint8_t dc_sock_addr_size; - struct nbt_dc_sock_addr dc_sock_addr;/* [subcontext_size(dc_sock_addr_size),subcontext(0)] */ - uint32_t nt_version;/* [value(13)] */ - uint16_t lmnt_token; - uint16_t lm20_token; -}; - -struct nbt_cldap_netlogon_15 { - enum nbt_netlogon_command type; - uint16_t sbz; - uint32_t server_type; - struct GUID domain_uuid; - const char * forest; - const char * dns_domain; - const char * pdc_dns_name; - const char * domain; - const char * pdc_name; - const char * user_name; - const char * server_site; - const char * client_site; - const char * next_closest_site; - uint32_t nt_version;/* [value(15)] */ - uint16_t lmnt_token; - uint16_t lm20_token; -}/* [public] */; - -struct nbt_cldap_netlogon_29 { - enum nbt_netlogon_command type; - uint16_t sbz; - uint32_t server_type; - struct GUID domain_uuid; - const char * forest; - const char * dns_domain; - const char * pdc_dns_name; - const char * domain; - const char * pdc_name; - const char * user_name; - const char * server_site; - const char * client_site; - uint8_t dc_sock_addr_size; - struct nbt_dc_sock_addr dc_sock_addr;/* [subcontext_size(dc_sock_addr_size),subcontext(0)] */ - const char * next_closest_site; - uint32_t nt_version;/* [value(29)] */ - uint16_t lmnt_token; - uint16_t lm20_token; -}/* [public] */; - -union nbt_cldap_netlogon { - struct nbt_cldap_netlogon_1 logon1;/* [case(0)] */ - struct nbt_cldap_netlogon_3 logon3;/* [case(2)] */ - struct nbt_cldap_netlogon_5 logon5;/* [case(4)] */ - struct nbt_cldap_netlogon_13 logon13;/* [case(8)] */ - struct nbt_cldap_netlogon_15 logon15;/* [case(20)] */ - struct nbt_cldap_netlogon_29 logon29;/* [case(29)] */ -}/* [public,nodiscriminant,flag(LIBNDR_FLAG_NOALIGN)] */; - -enum nbt_ntlogon_command -#ifndef USE_UINT_ENUMS - { - NTLOGON_SAM_LOGON=0x12, - NTLOGON_SAM_LOGON_REPLY=0x13, - NTLOGON_SAM_LOGON_REPLY15=0x15, - NTLOGON_RESPONSE_FROM_PDC2=0x17 -} -#else - { __donnot_use_enum_nbt_ntlogon_command=0x7FFFFFFF} -#define NTLOGON_SAM_LOGON ( 0x12 ) -#define NTLOGON_SAM_LOGON_REPLY ( 0x13 ) -#define NTLOGON_SAM_LOGON_REPLY15 ( 0x15 ) -#define NTLOGON_RESPONSE_FROM_PDC2 ( 0x17 ) -#endif -; - -struct nbt_ntlogon_sam_logon { - uint16_t request_count; - const char * computer_name;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */ - const char * user_name;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */ - const char * mailslot_name;/* [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] */ - uint32_t acct_control; - uint32_t sid_size;/* [value(ndr_size_dom_sid0(&sid,ndr->flags))] */ - struct dom_sid0 sid;/* [subcontext_size(sid_size),subcontext(0)] */ - uint32_t nt_version; - uint16_t lmnt_token; - uint16_t lm20_token; -}; - -struct nbt_ntlogon_sam_logon_reply { - const char * server;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */ - const char * user_name;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */ - const char * domain;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */ - uint32_t nt_version; - uint16_t lmnt_token; - uint16_t lm20_token; -}; - -union nbt_ntlogon_request { - struct nbt_ntlogon_sam_logon logon;/* [case(NTLOGON_SAM_LOGON)] */ - struct nbt_ntlogon_sam_logon_reply reply;/* [case(NTLOGON_SAM_LOGON_REPLY)] */ - struct nbt_netlogon_response_from_pdc2 reply2;/* [case(NTLOGON_RESPONSE_FROM_PDC2)] */ -}/* [nodiscriminant] */; - -struct nbt_ntlogon_packet { - enum nbt_ntlogon_command command; - union nbt_ntlogon_request req;/* [switch_is(command)] */ -}/* [public,flag(LIBNDR_FLAG_NOALIGN)] */; - enum nbt_browse_opcode #ifndef USE_UINT_ENUMS { diff --git a/source3/librpc/gen_ndr/ndr_nbt.c b/source3/librpc/gen_ndr/ndr_nbt.c index d165e65329..84cfabda57 100644 --- a/source3/librpc/gen_ndr/ndr_nbt.c +++ b/source3/librpc/gen_ndr/ndr_nbt.c @@ -589,27 +589,6 @@ _PUBLIC_ void ndr_print_nbt_rdata(struct ndr_print *ndr, const char *name, const } } -static enum ndr_err_code ndr_push_nbt_res_rec(struct ndr_push *ndr, int ndr_flags, const struct nbt_res_rec *r) -{ - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_nbt_name(ndr, NDR_SCALARS, &r->name)); - NDR_CHECK(ndr_push_nbt_qtype(ndr, NDR_SCALARS, r->rr_type)); - NDR_CHECK(ndr_push_nbt_qclass(ndr, NDR_SCALARS, r->rr_class)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->ttl)); - NDR_CHECK(ndr_push_set_switch_value(ndr, &r->rdata, ((((r->rr_type) == NBT_QTYPE_NETBIOS) && talloc_check_name(ndr, "struct ndr_push") && ((r->rdata).data.length == 2))?0:r->rr_type))); - NDR_CHECK(ndr_push_nbt_rdata(ndr, NDR_SCALARS, &r->rdata)); - } - if (ndr_flags & NDR_BUFFERS) { - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - static enum ndr_err_code ndr_pull_nbt_res_rec(struct ndr_pull *ndr, int ndr_flags, struct nbt_res_rec *r) { { @@ -621,7 +600,7 @@ static enum ndr_err_code ndr_pull_nbt_res_rec(struct ndr_pull *ndr, int ndr_flag NDR_CHECK(ndr_pull_nbt_qtype(ndr, NDR_SCALARS, &r->rr_type)); NDR_CHECK(ndr_pull_nbt_qclass(ndr, NDR_SCALARS, &r->rr_class)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->ttl)); - NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->rdata, ((((r->rr_type) == NBT_QTYPE_NETBIOS) && talloc_check_name(ndr, "struct ndr_push") && ((r->rdata).data.length == 2))?0:r->rr_type))); + NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->rdata, r->rr_type)); NDR_CHECK(ndr_pull_nbt_rdata(ndr, NDR_SCALARS, &r->rdata)); } if (ndr_flags & NDR_BUFFERS) { @@ -642,7 +621,7 @@ _PUBLIC_ void ndr_print_nbt_res_rec(struct ndr_print *ndr, const char *name, con ndr_print_nbt_qtype(ndr, "rr_type", r->rr_type); ndr_print_nbt_qclass(ndr, "rr_class", r->rr_class); ndr_print_uint32(ndr, "ttl", r->ttl); - ndr_print_set_switch_value(ndr, &r->rdata, ((((r->rr_type) == NBT_QTYPE_NETBIOS) && talloc_check_name(ndr, "struct ndr_push") && ((r->rdata).data.length == 2))?0:r->rr_type)); + ndr_print_set_switch_value(ndr, &r->rdata, r->rr_type); ndr_print_nbt_rdata(ndr, "rdata", &r->rdata); ndr->depth--; ndr->flags = _flags_save_STRUCT; @@ -1548,13 +1527,138 @@ _PUBLIC_ void ndr_print_nbt_dgram_packet(struct ndr_print *ndr, const char *name } } -static enum ndr_err_code ndr_push_nbt_netlogon_command(struct ndr_push *ndr, int ndr_flags, enum nbt_netlogon_command r) +_PUBLIC_ enum ndr_err_code ndr_push_nbt_sockaddr(struct ndr_push *ndr, int ndr_flags, const struct nbt_sockaddr *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sa_family)); + { + uint32_t _flags_save_ipv4address = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN); + NDR_CHECK(ndr_push_ipv4address(ndr, NDR_SCALARS, r->pdc_ip)); + ndr->flags = _flags_save_ipv4address; + } + { + uint32_t _flags_save_DATA_BLOB = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); + NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->remaining)); + ndr->flags = _flags_save_DATA_BLOB; + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_nbt_sockaddr(struct ndr_pull *ndr, int ndr_flags, struct nbt_sockaddr *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sa_family)); + { + uint32_t _flags_save_ipv4address = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN); + NDR_CHECK(ndr_pull_ipv4address(ndr, NDR_SCALARS, &r->pdc_ip)); + ndr->flags = _flags_save_ipv4address; + } + { + uint32_t _flags_save_DATA_BLOB = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); + NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->remaining)); + ndr->flags = _flags_save_DATA_BLOB; + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_nbt_sockaddr(struct ndr_print *ndr, const char *name, const struct nbt_sockaddr *r) +{ + ndr_print_struct(ndr, name, "nbt_sockaddr"); + ndr->depth++; + ndr_print_uint32(ndr, "sa_family", r->sa_family); + ndr_print_ipv4address(ndr, "pdc_ip", r->pdc_ip); + ndr_print_DATA_BLOB(ndr, "remaining", r->remaining); + ndr->depth--; +} + +_PUBLIC_ size_t ndr_size_nbt_sockaddr(const struct nbt_sockaddr *r, int flags) +{ + return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_nbt_sockaddr); +} + +_PUBLIC_ enum ndr_err_code ndr_push_nbt_server_type(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_nbt_server_type(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_nbt_server_type(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_PDC", NBT_SERVER_PDC, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_GC", NBT_SERVER_GC, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_LDAP", NBT_SERVER_LDAP, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_DS", NBT_SERVER_DS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_KDC", NBT_SERVER_KDC, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_TIMESERV", NBT_SERVER_TIMESERV, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_CLOSEST", NBT_SERVER_CLOSEST, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_WRITABLE", NBT_SERVER_WRITABLE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_GOOD_TIMESERV", NBT_SERVER_GOOD_TIMESERV, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_NDNC", NBT_SERVER_NDNC, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_SELECT_SECRET_DOMAIN_6", NBT_SERVER_SELECT_SECRET_DOMAIN_6, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_FULL_SECRET_DOMAIN_6", NBT_SERVER_FULL_SECRET_DOMAIN_6, r); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_netlogon_nt_version_flags(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_netlogon_nt_version_flags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netlogon_nt_version_flags(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NT_VERSION_1", NETLOGON_NT_VERSION_1, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NT_VERSION_5", NETLOGON_NT_VERSION_5, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NT_VERSION_5EX", NETLOGON_NT_VERSION_5EX, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NT_VERSION_5EX_WITH_IP", NETLOGON_NT_VERSION_5EX_WITH_IP, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NT_VERSION_WITH_CLOSEST_SITE", NETLOGON_NT_VERSION_WITH_CLOSEST_SITE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NT_VERSION_AVIOD_NT4EMUL", NETLOGON_NT_VERSION_AVIOD_NT4EMUL, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NT_VERSION_PDC", NETLOGON_NT_VERSION_PDC, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NT_VERSION_IP", NETLOGON_NT_VERSION_IP, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NT_VERSION_LOCAL", NETLOGON_NT_VERSION_LOCAL, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NT_VERSION_GC", NETLOGON_NT_VERSION_GC, r); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_netlogon_command(struct ndr_push *ndr, int ndr_flags, enum netlogon_command r) { NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_nbt_netlogon_command(struct ndr_pull *ndr, int ndr_flags, enum nbt_netlogon_command *r) +_PUBLIC_ enum ndr_err_code ndr_pull_netlogon_command(struct ndr_pull *ndr, int ndr_flags, enum netlogon_command *r) { uint16_t v; NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); @@ -1562,260 +1666,370 @@ static enum ndr_err_code ndr_pull_nbt_netlogon_command(struct ndr_pull *ndr, int return NDR_ERR_SUCCESS; } -_PUBLIC_ void ndr_print_nbt_netlogon_command(struct ndr_print *ndr, const char *name, enum nbt_netlogon_command r) +_PUBLIC_ void ndr_print_netlogon_command(struct ndr_print *ndr, const char *name, enum netlogon_command r) { const char *val = NULL; switch (r) { - case NETLOGON_QUERY_FOR_PDC: val = "NETLOGON_QUERY_FOR_PDC"; break; + case LOGON_PRIMARY_QUERY: val = "LOGON_PRIMARY_QUERY"; break; case NETLOGON_ANNOUNCE_UAS: val = "NETLOGON_ANNOUNCE_UAS"; break; case NETLOGON_RESPONSE_FROM_PDC: val = "NETLOGON_RESPONSE_FROM_PDC"; break; - case NETLOGON_QUERY_FOR_PDC2: val = "NETLOGON_QUERY_FOR_PDC2"; break; - case NETLOGON_RESPONSE_FROM_PDC2: val = "NETLOGON_RESPONSE_FROM_PDC2"; break; - case NETLOGON_RESPONSE_FROM_PDC_USER: val = "NETLOGON_RESPONSE_FROM_PDC_USER"; break; + case LOGON_SAM_LOGON_REQUEST: val = "LOGON_SAM_LOGON_REQUEST"; break; + case LOGON_SAM_LOGON_RESPONSE: val = "LOGON_SAM_LOGON_RESPONSE"; break; + case LOGON_SAM_LOGON_PAUSE_RESPONSE: val = "LOGON_SAM_LOGON_PAUSE_RESPONSE"; break; + case LOGON_SAM_LOGON_USER_UNKNOWN: val = "LOGON_SAM_LOGON_USER_UNKNOWN"; break; + case LOGON_SAM_LOGON_RESPONSE_EX: val = "LOGON_SAM_LOGON_RESPONSE_EX"; break; + case LOGON_SAM_LOGON_PAUSE_RESPONSE_EX: val = "LOGON_SAM_LOGON_PAUSE_RESPONSE_EX"; break; + case LOGON_SAM_LOGON_USER_UNKNOWN_EX: val = "LOGON_SAM_LOGON_USER_UNKNOWN_EX"; break; } ndr_print_enum(ndr, name, "ENUM", val, r); } -static enum ndr_err_code ndr_push_nbt_netlogon_version(struct ndr_push *ndr, int ndr_flags, uint32_t r) +_PUBLIC_ void ndr_print_NETLOGON_SAM_LOGON_REQUEST(struct ndr_print *ndr, const char *name, const struct NETLOGON_SAM_LOGON_REQUEST *r) +{ + ndr_print_struct(ndr, name, "NETLOGON_SAM_LOGON_REQUEST"); + ndr->depth++; + ndr_print_uint16(ndr, "request_count", r->request_count); + ndr_print_string(ndr, "computer_name", r->computer_name); + ndr_print_string(ndr, "user_name", r->user_name); + ndr_print_string(ndr, "mailslot_name", r->mailslot_name); + ndr_print_samr_AcctFlags(ndr, "acct_control", r->acct_control); + ndr_print_uint32(ndr, "sid_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_dom_sid0(&r->sid, ndr->flags):r->sid_size); + ndr_print_DATA_BLOB(ndr, "_pad", r->_pad); + ndr_print_dom_sid0(ndr, "sid", &r->sid); + ndr_print_netlogon_nt_version_flags(ndr, "nt_version", r->nt_version); + ndr_print_uint16(ndr, "lmnt_token", r->lmnt_token); + ndr_print_uint16(ndr, "lm20_token", r->lm20_token); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_NETLOGON_SAM_LOGON_RESPONSE_NT40(struct ndr_push *ndr, int ndr_flags, const struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *r) { { - uint32_t _flags_save_BITMAP = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_LITTLE_ENDIAN); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - ndr->flags = _flags_save_BITMAP; + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_netlogon_command(ndr, NDR_SCALARS, r->command)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->server)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->user_name)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->domain)); + ndr->flags = _flags_save_string; + } + NDR_CHECK(ndr_push_netlogon_nt_version_flags(ndr, NDR_SCALARS, r->nt_version)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lmnt_token)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lm20_token)); + } + if (ndr_flags & NDR_BUFFERS) { + } + ndr->flags = _flags_save_STRUCT; } return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_nbt_netlogon_version(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +_PUBLIC_ enum ndr_err_code ndr_pull_NETLOGON_SAM_LOGON_RESPONSE_NT40(struct ndr_pull *ndr, int ndr_flags, struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *r) { - uint32_t v; { - uint32_t _flags_save_BITMAP = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_LITTLE_ENDIAN); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - ndr->flags = _flags_save_BITMAP; + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_netlogon_command(ndr, NDR_SCALARS, &r->command)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->server)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->user_name)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->domain)); + ndr->flags = _flags_save_string; + } + NDR_CHECK(ndr_pull_netlogon_nt_version_flags(ndr, NDR_SCALARS, &r->nt_version)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lmnt_token)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lm20_token)); + } + if (ndr_flags & NDR_BUFFERS) { + } + ndr->flags = _flags_save_STRUCT; } return NDR_ERR_SUCCESS; } -_PUBLIC_ void ndr_print_nbt_netlogon_version(struct ndr_print *ndr, const char *name, uint32_t r) +_PUBLIC_ void ndr_print_NETLOGON_SAM_LOGON_RESPONSE_NT40(struct ndr_print *ndr, const char *name, const struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *r) { + ndr_print_struct(ndr, name, "NETLOGON_SAM_LOGON_RESPONSE_NT40"); { - uint32_t _flags_save_BITMAP = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_LITTLE_ENDIAN); - ndr_print_uint32(ndr, name, r); + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); ndr->depth++; - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NT_VERSION_1", NETLOGON_NT_VERSION_1, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NT_VERSION_5", NETLOGON_NT_VERSION_5, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NT_VERSION_5EX", NETLOGON_NT_VERSION_5EX, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NT_VERSION_5EX_WITH_IP", NETLOGON_NT_VERSION_5EX_WITH_IP, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NT_VERSION_WITH_CLOSEST_SITE", NETLOGON_NT_VERSION_WITH_CLOSEST_SITE, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NT_VERSION_AVIOD_NT4EMUL", NETLOGON_NT_VERSION_AVIOD_NT4EMUL, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NT_VERSION_PDC", NETLOGON_NT_VERSION_PDC, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NT_VERSION_IP", NETLOGON_NT_VERSION_IP, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NT_VERSION_LOCAL", NETLOGON_NT_VERSION_LOCAL, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NT_VERSION_GC", NETLOGON_NT_VERSION_GC, r); + ndr_print_netlogon_command(ndr, "command", r->command); + ndr_print_string(ndr, "server", r->server); + ndr_print_string(ndr, "user_name", r->user_name); + ndr_print_string(ndr, "domain", r->domain); + ndr_print_netlogon_nt_version_flags(ndr, "nt_version", r->nt_version); + ndr_print_uint16(ndr, "lmnt_token", r->lmnt_token); + ndr_print_uint16(ndr, "lm20_token", r->lm20_token); ndr->depth--; - ndr->flags = _flags_save_BITMAP; + ndr->flags = _flags_save_STRUCT; } } -static enum ndr_err_code ndr_push_nbt_netlogon_query_for_pdc(struct ndr_push *ndr, int ndr_flags, const struct nbt_netlogon_query_for_pdc *r) +_PUBLIC_ enum ndr_err_code ndr_push_NETLOGON_SAM_LOGON_RESPONSE(struct ndr_push *ndr, int ndr_flags, const struct NETLOGON_SAM_LOGON_RESPONSE *r) { - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->computer_name)); - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->mailslot_name)); - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_DATA_BLOB = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN2); - NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->_pad)); - ndr->flags = _flags_save_DATA_BLOB; + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_netlogon_command(ndr, NDR_SCALARS, r->command)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->pdc_name)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->user_name)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->domain_name)); + ndr->flags = _flags_save_string; + } + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->domain_uuid)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->zero_uuid)); + NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->forest)); + NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->dns_domain)); + NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->pdc_dns_name)); + NDR_CHECK(ndr_push_ipv4address(ndr, NDR_SCALARS, r->pdc_ip)); + NDR_CHECK(ndr_push_nbt_server_type(ndr, NDR_SCALARS, r->server_type)); + NDR_CHECK(ndr_push_netlogon_nt_version_flags(ndr, NDR_SCALARS, r->nt_version)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lmnt_token)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lm20_token)); } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->unicode_name)); - ndr->flags = _flags_save_string; + if (ndr_flags & NDR_BUFFERS) { } - NDR_CHECK(ndr_push_nbt_netlogon_version(ndr, NDR_SCALARS, r->nt_version)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lmnt_token)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lm20_token)); - } - if (ndr_flags & NDR_BUFFERS) { + ndr->flags = _flags_save_STRUCT; } return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_nbt_netlogon_query_for_pdc(struct ndr_pull *ndr, int ndr_flags, struct nbt_netlogon_query_for_pdc *r) +_PUBLIC_ enum ndr_err_code ndr_pull_NETLOGON_SAM_LOGON_RESPONSE(struct ndr_pull *ndr, int ndr_flags, struct NETLOGON_SAM_LOGON_RESPONSE *r) { - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->computer_name)); - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->mailslot_name)); - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_DATA_BLOB = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN2); - NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->_pad)); - ndr->flags = _flags_save_DATA_BLOB; + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_netlogon_command(ndr, NDR_SCALARS, &r->command)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->pdc_name)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->user_name)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->domain_name)); + ndr->flags = _flags_save_string; + } + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->domain_uuid)); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->zero_uuid)); + NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->forest)); + NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->dns_domain)); + NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->pdc_dns_name)); + NDR_CHECK(ndr_pull_ipv4address(ndr, NDR_SCALARS, &r->pdc_ip)); + NDR_CHECK(ndr_pull_nbt_server_type(ndr, NDR_SCALARS, &r->server_type)); + NDR_CHECK(ndr_pull_netlogon_nt_version_flags(ndr, NDR_SCALARS, &r->nt_version)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lmnt_token)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lm20_token)); } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->unicode_name)); - ndr->flags = _flags_save_string; + if (ndr_flags & NDR_BUFFERS) { } - NDR_CHECK(ndr_pull_nbt_netlogon_version(ndr, NDR_SCALARS, &r->nt_version)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lmnt_token)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lm20_token)); - } - if (ndr_flags & NDR_BUFFERS) { + ndr->flags = _flags_save_STRUCT; } return NDR_ERR_SUCCESS; } -_PUBLIC_ void ndr_print_nbt_netlogon_query_for_pdc(struct ndr_print *ndr, const char *name, const struct nbt_netlogon_query_for_pdc *r) +_PUBLIC_ void ndr_print_NETLOGON_SAM_LOGON_RESPONSE(struct ndr_print *ndr, const char *name, const struct NETLOGON_SAM_LOGON_RESPONSE *r) { - ndr_print_struct(ndr, name, "nbt_netlogon_query_for_pdc"); - ndr->depth++; - ndr_print_string(ndr, "computer_name", r->computer_name); - ndr_print_string(ndr, "mailslot_name", r->mailslot_name); - ndr_print_DATA_BLOB(ndr, "_pad", r->_pad); - ndr_print_string(ndr, "unicode_name", r->unicode_name); - ndr_print_nbt_netlogon_version(ndr, "nt_version", r->nt_version); - ndr_print_uint16(ndr, "lmnt_token", r->lmnt_token); - ndr_print_uint16(ndr, "lm20_token", r->lm20_token); - ndr->depth--; + ndr_print_struct(ndr, name, "NETLOGON_SAM_LOGON_RESPONSE"); + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); + ndr->depth++; + ndr_print_netlogon_command(ndr, "command", r->command); + ndr_print_string(ndr, "pdc_name", r->pdc_name); + ndr_print_string(ndr, "user_name", r->user_name); + ndr_print_string(ndr, "domain_name", r->domain_name); + ndr_print_GUID(ndr, "domain_uuid", &r->domain_uuid); + ndr_print_GUID(ndr, "zero_uuid", &r->zero_uuid); + ndr_print_nbt_string(ndr, "forest", r->forest); + ndr_print_nbt_string(ndr, "dns_domain", r->dns_domain); + ndr_print_nbt_string(ndr, "pdc_dns_name", r->pdc_dns_name); + ndr_print_ipv4address(ndr, "pdc_ip", r->pdc_ip); + ndr_print_nbt_server_type(ndr, "server_type", r->server_type); + ndr_print_netlogon_nt_version_flags(ndr, "nt_version", r->nt_version); + ndr_print_uint16(ndr, "lmnt_token", r->lmnt_token); + ndr_print_uint16(ndr, "lm20_token", r->lm20_token); + ndr->depth--; + ndr->flags = _flags_save_STRUCT; + } } -static enum ndr_err_code ndr_push_nbt_netlogon_query_for_pdc2(struct ndr_push *ndr, int ndr_flags, const struct nbt_netlogon_query_for_pdc2 *r) +_PUBLIC_ enum ndr_err_code ndr_push_NETLOGON_SAM_LOGON_RESPONSE_EX(struct ndr_push *ndr, int ndr_flags, const struct NETLOGON_SAM_LOGON_RESPONSE_EX *r) { - uint32_t cntr_unknown_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->request_count)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->computer_name)); - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->user_name)); - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->mailslot_name)); - ndr->flags = _flags_save_string; + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_netlogon_command(ndr, NDR_SCALARS, r->command)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->sbz)); + NDR_CHECK(ndr_push_nbt_server_type(ndr, NDR_SCALARS, r->server_type)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->domain_uuid)); + NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->forest)); + NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->dns_domain)); + NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->pdc_dns_name)); + NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->domain)); + NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->pdc_name)); + NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->user_name)); + NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->server_site)); + NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->client_site)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, ndr_size_nbt_sockaddr(&r->sockaddr, ndr->flags))); + { + struct ndr_push *_ndr_sockaddr; + NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_sockaddr, 0, ndr_size_nbt_sockaddr(&r->sockaddr, ndr->flags))); + NDR_CHECK(ndr_push_nbt_sockaddr(_ndr_sockaddr, NDR_SCALARS, &r->sockaddr)); + NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_sockaddr, 0, ndr_size_nbt_sockaddr(&r->sockaddr, ndr->flags))); + } + NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->next_closest_site)); + NDR_CHECK(ndr_push_netlogon_nt_version_flags(ndr, NDR_SCALARS, r->nt_version)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lmnt_token)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lm20_token)); } - for (cntr_unknown_0 = 0; cntr_unknown_0 < 2; cntr_unknown_0++) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown[cntr_unknown_0])); + if (ndr_flags & NDR_BUFFERS) { } - NDR_CHECK(ndr_push_nbt_netlogon_version(ndr, NDR_SCALARS, r->nt_version)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lmnt_token)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lm20_token)); - } - if (ndr_flags & NDR_BUFFERS) { + ndr->flags = _flags_save_STRUCT; } return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_nbt_netlogon_query_for_pdc2(struct ndr_pull *ndr, int ndr_flags, struct nbt_netlogon_query_for_pdc2 *r) +_PUBLIC_ enum ndr_err_code ndr_pull_NETLOGON_SAM_LOGON_RESPONSE_EX(struct ndr_pull *ndr, int ndr_flags, struct NETLOGON_SAM_LOGON_RESPONSE_EX *r) { - uint32_t cntr_unknown_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->request_count)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->computer_name)); - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->user_name)); - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->mailslot_name)); - ndr->flags = _flags_save_string; + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_netlogon_command(ndr, NDR_SCALARS, &r->command)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->sbz)); + NDR_CHECK(ndr_pull_nbt_server_type(ndr, NDR_SCALARS, &r->server_type)); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->domain_uuid)); + NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->forest)); + NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->dns_domain)); + NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->pdc_dns_name)); + NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->domain)); + NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->pdc_name)); + NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->user_name)); + NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->server_site)); + NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->client_site)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->sockaddr_size)); + { + struct ndr_pull *_ndr_sockaddr; + NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_sockaddr, 0, r->sockaddr_size)); + NDR_CHECK(ndr_pull_nbt_sockaddr(_ndr_sockaddr, NDR_SCALARS, &r->sockaddr)); + NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_sockaddr, 0, r->sockaddr_size)); + } + NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->next_closest_site)); + NDR_CHECK(ndr_pull_netlogon_nt_version_flags(ndr, NDR_SCALARS, &r->nt_version)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lmnt_token)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lm20_token)); } - for (cntr_unknown_0 = 0; cntr_unknown_0 < 2; cntr_unknown_0++) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown[cntr_unknown_0])); + if (ndr_flags & NDR_BUFFERS) { } - NDR_CHECK(ndr_pull_nbt_netlogon_version(ndr, NDR_SCALARS, &r->nt_version)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lmnt_token)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lm20_token)); - } - if (ndr_flags & NDR_BUFFERS) { + ndr->flags = _flags_save_STRUCT; } return NDR_ERR_SUCCESS; } -_PUBLIC_ void ndr_print_nbt_netlogon_query_for_pdc2(struct ndr_print *ndr, const char *name, const struct nbt_netlogon_query_for_pdc2 *r) +_PUBLIC_ void ndr_print_NETLOGON_SAM_LOGON_RESPONSE_EX(struct ndr_print *ndr, const char *name, const struct NETLOGON_SAM_LOGON_RESPONSE_EX *r) { - uint32_t cntr_unknown_0; - ndr_print_struct(ndr, name, "nbt_netlogon_query_for_pdc2"); - ndr->depth++; - ndr_print_uint16(ndr, "request_count", r->request_count); - ndr_print_string(ndr, "computer_name", r->computer_name); - ndr_print_string(ndr, "user_name", r->user_name); - ndr_print_string(ndr, "mailslot_name", r->mailslot_name); - ndr->print(ndr, "%s: ARRAY(%d)", "unknown", (int)2); - ndr->depth++; - for (cntr_unknown_0=0;cntr_unknown_0<2;cntr_unknown_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_unknown_0) != -1) { - ndr_print_uint32(ndr, "unknown", r->unknown[cntr_unknown_0]); - free(idx_0); - } + ndr_print_struct(ndr, name, "NETLOGON_SAM_LOGON_RESPONSE_EX"); + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); + ndr->depth++; + ndr_print_netlogon_command(ndr, "command", r->command); + ndr_print_uint16(ndr, "sbz", r->sbz); + ndr_print_nbt_server_type(ndr, "server_type", r->server_type); + ndr_print_GUID(ndr, "domain_uuid", &r->domain_uuid); + ndr_print_nbt_string(ndr, "forest", r->forest); + ndr_print_nbt_string(ndr, "dns_domain", r->dns_domain); + ndr_print_nbt_string(ndr, "pdc_dns_name", r->pdc_dns_name); + ndr_print_nbt_string(ndr, "domain", r->domain); + ndr_print_nbt_string(ndr, "pdc_name", r->pdc_name); + ndr_print_nbt_string(ndr, "user_name", r->user_name); + ndr_print_nbt_string(ndr, "server_site", r->server_site); + ndr_print_nbt_string(ndr, "client_site", r->client_site); + ndr_print_uint8(ndr, "sockaddr_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_nbt_sockaddr(&r->sockaddr, ndr->flags):r->sockaddr_size); + ndr_print_nbt_sockaddr(ndr, "sockaddr", &r->sockaddr); + ndr_print_nbt_string(ndr, "next_closest_site", r->next_closest_site); + ndr_print_netlogon_nt_version_flags(ndr, "nt_version", r->nt_version); + ndr_print_uint16(ndr, "lmnt_token", r->lmnt_token); + ndr_print_uint16(ndr, "lm20_token", r->lm20_token); + ndr->depth--; + ndr->flags = _flags_save_STRUCT; } - ndr->depth--; - ndr_print_nbt_netlogon_version(ndr, "nt_version", r->nt_version); - ndr_print_uint16(ndr, "lmnt_token", r->lmnt_token); - ndr_print_uint16(ndr, "lm20_token", r->lm20_token); - ndr->depth--; } -static enum ndr_err_code ndr_push_nbt_netlogon_response_from_pdc(struct ndr_push *ndr, int ndr_flags, const struct nbt_netlogon_response_from_pdc *r) +static enum ndr_err_code ndr_push_nbt_netlogon_query_for_pdc(struct ndr_push *ndr, int ndr_flags, const struct nbt_netlogon_query_for_pdc *r) { if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_push_align(ndr, 4)); { uint32_t _flags_save_string = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->pdc_name)); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->computer_name)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->mailslot_name)); ndr->flags = _flags_save_string; } { @@ -1827,16 +2041,10 @@ static enum ndr_err_code ndr_push_nbt_netlogon_response_from_pdc(struct ndr_push { uint32_t _flags_save_string = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->unicode_pdc_name)); - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->domain_name)); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->unicode_name)); ndr->flags = _flags_save_string; } - NDR_CHECK(ndr_push_nbt_netlogon_version(ndr, NDR_SCALARS, r->nt_version)); + NDR_CHECK(ndr_push_netlogon_nt_version_flags(ndr, NDR_SCALARS, r->nt_version)); NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lmnt_token)); NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lm20_token)); } @@ -1845,14 +2053,20 @@ static enum ndr_err_code ndr_push_nbt_netlogon_response_from_pdc(struct ndr_push return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_nbt_netlogon_response_from_pdc(struct ndr_pull *ndr, int ndr_flags, struct nbt_netlogon_response_from_pdc *r) +static enum ndr_err_code ndr_pull_nbt_netlogon_query_for_pdc(struct ndr_pull *ndr, int ndr_flags, struct nbt_netlogon_query_for_pdc *r) { if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_pull_align(ndr, 4)); { uint32_t _flags_save_string = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->pdc_name)); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->computer_name)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->mailslot_name)); ndr->flags = _flags_save_string; } { @@ -1864,16 +2078,10 @@ static enum ndr_err_code ndr_pull_nbt_netlogon_response_from_pdc(struct ndr_pull { uint32_t _flags_save_string = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->unicode_pdc_name)); - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->domain_name)); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->unicode_name)); ndr->flags = _flags_save_string; } - NDR_CHECK(ndr_pull_nbt_netlogon_version(ndr, NDR_SCALARS, &r->nt_version)); + NDR_CHECK(ndr_pull_netlogon_nt_version_flags(ndr, NDR_SCALARS, &r->nt_version)); NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lmnt_token)); NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lm20_token)); } @@ -1882,205 +2090,127 @@ static enum ndr_err_code ndr_pull_nbt_netlogon_response_from_pdc(struct ndr_pull return NDR_ERR_SUCCESS; } -_PUBLIC_ void ndr_print_nbt_netlogon_response_from_pdc(struct ndr_print *ndr, const char *name, const struct nbt_netlogon_response_from_pdc *r) +_PUBLIC_ void ndr_print_nbt_netlogon_query_for_pdc(struct ndr_print *ndr, const char *name, const struct nbt_netlogon_query_for_pdc *r) { - ndr_print_struct(ndr, name, "nbt_netlogon_response_from_pdc"); + ndr_print_struct(ndr, name, "nbt_netlogon_query_for_pdc"); ndr->depth++; - ndr_print_string(ndr, "pdc_name", r->pdc_name); + ndr_print_string(ndr, "computer_name", r->computer_name); + ndr_print_string(ndr, "mailslot_name", r->mailslot_name); ndr_print_DATA_BLOB(ndr, "_pad", r->_pad); - ndr_print_string(ndr, "unicode_pdc_name", r->unicode_pdc_name); - ndr_print_string(ndr, "domain_name", r->domain_name); - ndr_print_nbt_netlogon_version(ndr, "nt_version", r->nt_version); + ndr_print_string(ndr, "unicode_name", r->unicode_name); + ndr_print_netlogon_nt_version_flags(ndr, "nt_version", r->nt_version); ndr_print_uint16(ndr, "lmnt_token", r->lmnt_token); ndr_print_uint16(ndr, "lm20_token", r->lm20_token); ndr->depth--; } -static enum ndr_err_code ndr_push_nbt_server_type(struct ndr_push *ndr, int ndr_flags, uint32_t r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_nbt_server_type(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_nbt_server_type(struct ndr_print *ndr, const char *name, uint32_t r) -{ - ndr_print_uint32(ndr, name, r); - ndr->depth++; - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_PDC", NBT_SERVER_PDC, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_GC", NBT_SERVER_GC, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_LDAP", NBT_SERVER_LDAP, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_DS", NBT_SERVER_DS, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_KDC", NBT_SERVER_KDC, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_TIMESERV", NBT_SERVER_TIMESERV, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_CLOSEST", NBT_SERVER_CLOSEST, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_WRITABLE", NBT_SERVER_WRITABLE, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_GOOD_TIMESERV", NBT_SERVER_GOOD_TIMESERV, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_NDNC", NBT_SERVER_NDNC, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_SELECT_SECRET_DOMAIN_6", NBT_SERVER_SELECT_SECRET_DOMAIN_6, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_FULL_SECRET_DOMAIN_6", NBT_SERVER_FULL_SECRET_DOMAIN_6, r); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_nbt_dc_sock_addr(struct ndr_push *ndr, int ndr_flags, const struct nbt_dc_sock_addr *r) +_PUBLIC_ enum ndr_err_code ndr_push_nbt_netlogon_response_from_pdc(struct ndr_push *ndr, int ndr_flags, const struct nbt_netlogon_response_from_pdc *r) { - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->family)); - { - uint32_t _flags_save_ipv4address = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN); - NDR_CHECK(ndr_push_ipv4address(ndr, NDR_SCALARS, r->pdc_ip)); - ndr->flags = _flags_save_ipv4address; - } - { - uint32_t _flags_save_DATA_BLOB = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); - NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->remaining)); - ndr->flags = _flags_save_DATA_BLOB; - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_nbt_dc_sock_addr(struct ndr_pull *ndr, int ndr_flags, struct nbt_dc_sock_addr *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->family)); - { - uint32_t _flags_save_ipv4address = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN); - NDR_CHECK(ndr_pull_ipv4address(ndr, NDR_SCALARS, &r->pdc_ip)); - ndr->flags = _flags_save_ipv4address; + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_netlogon_command(ndr, NDR_SCALARS, r->command)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->pdc_name)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_DATA_BLOB = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN2); + NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->_pad)); + ndr->flags = _flags_save_DATA_BLOB; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->unicode_pdc_name)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->domain_name)); + ndr->flags = _flags_save_string; + } + NDR_CHECK(ndr_push_netlogon_nt_version_flags(ndr, NDR_SCALARS, r->nt_version)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lmnt_token)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lm20_token)); } - { - uint32_t _flags_save_DATA_BLOB = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); - NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->remaining)); - ndr->flags = _flags_save_DATA_BLOB; + if (ndr_flags & NDR_BUFFERS) { } - } - if (ndr_flags & NDR_BUFFERS) { + ndr->flags = _flags_save_STRUCT; } return NDR_ERR_SUCCESS; } -_PUBLIC_ void ndr_print_nbt_dc_sock_addr(struct ndr_print *ndr, const char *name, const struct nbt_dc_sock_addr *r) +_PUBLIC_ enum ndr_err_code ndr_pull_nbt_netlogon_response_from_pdc(struct ndr_pull *ndr, int ndr_flags, struct nbt_netlogon_response_from_pdc *r) { - ndr_print_struct(ndr, name, "nbt_dc_sock_addr"); - ndr->depth++; - ndr_print_uint32(ndr, "family", r->family); - ndr_print_ipv4address(ndr, "pdc_ip", r->pdc_ip); - ndr_print_DATA_BLOB(ndr, "remaining", r->remaining); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_nbt_netlogon_response_from_pdc2(struct ndr_push *ndr, int ndr_flags, const struct nbt_netlogon_response_from_pdc2 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - { - uint32_t _flags_save_DATA_BLOB = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4); - NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->_pad)); - ndr->flags = _flags_save_DATA_BLOB; + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_netlogon_command(ndr, NDR_SCALARS, &r->command)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->pdc_name)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_DATA_BLOB = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN2); + NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->_pad)); + ndr->flags = _flags_save_DATA_BLOB; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->unicode_pdc_name)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->domain_name)); + ndr->flags = _flags_save_string; + } + NDR_CHECK(ndr_pull_netlogon_nt_version_flags(ndr, NDR_SCALARS, &r->nt_version)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lmnt_token)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lm20_token)); } - NDR_CHECK(ndr_push_nbt_server_type(ndr, NDR_SCALARS, r->server_type)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->domain_uuid)); - NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->forest)); - NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->dns_domain)); - NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->pdc_dns_name)); - NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->domain)); - NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->pdc_name)); - NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->user_name)); - NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->server_site)); - NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->client_site)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->dc_sock_addr_size)); - { - struct ndr_push *_ndr_dc_sock_addr; - NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_dc_sock_addr, 0, r->dc_sock_addr_size)); - NDR_CHECK(ndr_push_nbt_dc_sock_addr(_ndr_dc_sock_addr, NDR_SCALARS, &r->dc_sock_addr)); - NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_dc_sock_addr, 0, r->dc_sock_addr_size)); + if (ndr_flags & NDR_BUFFERS) { } - NDR_CHECK(ndr_push_nbt_netlogon_version(ndr, NDR_SCALARS, r->nt_version)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lmnt_token)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lm20_token)); - } - if (ndr_flags & NDR_BUFFERS) { + ndr->flags = _flags_save_STRUCT; } return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_nbt_netlogon_response_from_pdc2(struct ndr_pull *ndr, int ndr_flags, struct nbt_netlogon_response_from_pdc2 *r) +_PUBLIC_ void ndr_print_nbt_netlogon_response_from_pdc(struct ndr_print *ndr, const char *name, const struct nbt_netlogon_response_from_pdc *r) { - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - { - uint32_t _flags_save_DATA_BLOB = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4); - NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->_pad)); - ndr->flags = _flags_save_DATA_BLOB; - } - NDR_CHECK(ndr_pull_nbt_server_type(ndr, NDR_SCALARS, &r->server_type)); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->domain_uuid)); - NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->forest)); - NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->dns_domain)); - NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->pdc_dns_name)); - NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->domain)); - NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->pdc_name)); - NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->user_name)); - NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->server_site)); - NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->client_site)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->dc_sock_addr_size)); - { - struct ndr_pull *_ndr_dc_sock_addr; - NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_dc_sock_addr, 0, r->dc_sock_addr_size)); - NDR_CHECK(ndr_pull_nbt_dc_sock_addr(_ndr_dc_sock_addr, NDR_SCALARS, &r->dc_sock_addr)); - NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_dc_sock_addr, 0, r->dc_sock_addr_size)); - } - NDR_CHECK(ndr_pull_nbt_netlogon_version(ndr, NDR_SCALARS, &r->nt_version)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lmnt_token)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lm20_token)); - } - if (ndr_flags & NDR_BUFFERS) { + ndr_print_struct(ndr, name, "nbt_netlogon_response_from_pdc"); + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); + ndr->depth++; + ndr_print_netlogon_command(ndr, "command", r->command); + ndr_print_string(ndr, "pdc_name", r->pdc_name); + ndr_print_DATA_BLOB(ndr, "_pad", r->_pad); + ndr_print_string(ndr, "unicode_pdc_name", r->unicode_pdc_name); + ndr_print_string(ndr, "domain_name", r->domain_name); + ndr_print_netlogon_nt_version_flags(ndr, "nt_version", r->nt_version); + ndr_print_uint16(ndr, "lmnt_token", r->lmnt_token); + ndr_print_uint16(ndr, "lm20_token", r->lm20_token); + ndr->depth--; + ndr->flags = _flags_save_STRUCT; } - return NDR_ERR_SUCCESS; } -_PUBLIC_ void ndr_print_nbt_netlogon_response_from_pdc2(struct ndr_print *ndr, const char *name, const struct nbt_netlogon_response_from_pdc2 *r) -{ - ndr_print_struct(ndr, name, "nbt_netlogon_response_from_pdc2"); - ndr->depth++; - ndr_print_DATA_BLOB(ndr, "_pad", r->_pad); - ndr_print_nbt_server_type(ndr, "server_type", r->server_type); - ndr_print_GUID(ndr, "domain_uuid", &r->domain_uuid); - ndr_print_nbt_string(ndr, "forest", r->forest); - ndr_print_nbt_string(ndr, "dns_domain", r->dns_domain); - ndr_print_nbt_string(ndr, "pdc_dns_name", r->pdc_dns_name); - ndr_print_nbt_string(ndr, "domain", r->domain); - ndr_print_nbt_string(ndr, "pdc_name", r->pdc_name); - ndr_print_nbt_string(ndr, "user_name", r->user_name); - ndr_print_nbt_string(ndr, "server_site", r->server_site); - ndr_print_nbt_string(ndr, "client_site", r->client_site); - ndr_print_uint8(ndr, "dc_sock_addr_size", r->dc_sock_addr_size); - ndr_print_nbt_dc_sock_addr(ndr, "dc_sock_addr", &r->dc_sock_addr); - ndr_print_nbt_netlogon_version(ndr, "nt_version", r->nt_version); - ndr_print_uint16(ndr, "lmnt_token", r->lmnt_token); - ndr_print_uint16(ndr, "lm20_token", r->lm20_token); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_nbt_db_change(struct ndr_push *ndr, int ndr_flags, const struct nbt_db_change *r) +static enum ndr_err_code ndr_push_nbt_db_change_info(struct ndr_push *ndr, int ndr_flags, const struct nbt_db_change_info *r) { if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_push_align(ndr, 8)); @@ -2093,7 +2223,7 @@ static enum ndr_err_code ndr_push_nbt_db_change(struct ndr_push *ndr, int ndr_fl return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_nbt_db_change(struct ndr_pull *ndr, int ndr_flags, struct nbt_db_change *r) +static enum ndr_err_code ndr_pull_nbt_db_change_info(struct ndr_pull *ndr, int ndr_flags, struct nbt_db_change_info *r) { if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_pull_align(ndr, 8)); @@ -2106,9 +2236,9 @@ static enum ndr_err_code ndr_pull_nbt_db_change(struct ndr_pull *ndr, int ndr_fl return NDR_ERR_SUCCESS; } -_PUBLIC_ void ndr_print_nbt_db_change(struct ndr_print *ndr, const char *name, const struct nbt_db_change *r) +_PUBLIC_ void ndr_print_nbt_db_change_info(struct ndr_print *ndr, const char *name, const struct nbt_db_change_info *r) { - ndr_print_struct(ndr, name, "nbt_db_change"); + ndr_print_struct(ndr, name, "nbt_db_change_info"); ndr->depth++; ndr_print_netr_SamDatabaseID(ndr, "db_index", r->db_index); ndr_print_hyper(ndr, "serial", r->serial); @@ -2116,7 +2246,7 @@ _PUBLIC_ void ndr_print_nbt_db_change(struct ndr_print *ndr, const char *name, c ndr->depth--; } -static enum ndr_err_code ndr_push_nbt_netlogon_announce_uas(struct ndr_push *ndr, int ndr_flags, const struct nbt_netlogon_announce_uas *r) +static enum ndr_err_code ndr_push_NETLOGON_DB_CHANGE(struct ndr_push *ndr, int ndr_flags, const struct NETLOGON_DB_CHANGE *r) { uint32_t cntr_dbchange_0; if (ndr_flags & NDR_SCALARS) { @@ -2157,7 +2287,7 @@ static enum ndr_err_code ndr_push_nbt_netlogon_announce_uas(struct ndr_push *ndr } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->db_count)); for (cntr_dbchange_0 = 0; cntr_dbchange_0 < r->db_count; cntr_dbchange_0++) { - NDR_CHECK(ndr_push_nbt_db_change(ndr, NDR_SCALARS, &r->dbchange[cntr_dbchange_0])); + NDR_CHECK(ndr_push_nbt_db_change_info(ndr, NDR_SCALARS, &r->dbchange[cntr_dbchange_0])); } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_dom_sid0(&r->sid, ndr->flags))); { @@ -2166,16 +2296,15 @@ static enum ndr_err_code ndr_push_nbt_netlogon_announce_uas(struct ndr_push *ndr NDR_CHECK(ndr_push_dom_sid0(_ndr_sid, NDR_SCALARS|NDR_BUFFERS, &r->sid)); NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_sid, 0, ndr_size_dom_sid0(&r->sid, ndr->flags))); } - NDR_CHECK(ndr_push_nbt_netlogon_version(ndr, NDR_SCALARS, r->nt_version)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lmnt_token)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lm20_token)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->message_format_version)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->message_token)); } if (ndr_flags & NDR_BUFFERS) { } return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_nbt_netlogon_announce_uas(struct ndr_pull *ndr, int ndr_flags, struct nbt_netlogon_announce_uas *r) +static enum ndr_err_code ndr_pull_NETLOGON_DB_CHANGE(struct ndr_pull *ndr, int ndr_flags, struct NETLOGON_DB_CHANGE *r) { uint32_t cntr_dbchange_0; TALLOC_CTX *_mem_save_dbchange_0; @@ -2220,7 +2349,7 @@ static enum ndr_err_code ndr_pull_nbt_netlogon_announce_uas(struct ndr_pull *ndr _mem_save_dbchange_0 = NDR_PULL_GET_MEM_CTX(ndr); NDR_PULL_SET_MEM_CTX(ndr, r->dbchange, 0); for (cntr_dbchange_0 = 0; cntr_dbchange_0 < r->db_count; cntr_dbchange_0++) { - NDR_CHECK(ndr_pull_nbt_db_change(ndr, NDR_SCALARS, &r->dbchange[cntr_dbchange_0])); + NDR_CHECK(ndr_pull_nbt_db_change_info(ndr, NDR_SCALARS, &r->dbchange[cntr_dbchange_0])); } NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dbchange_0, 0); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sid_size)); @@ -2230,19 +2359,18 @@ static enum ndr_err_code ndr_pull_nbt_netlogon_announce_uas(struct ndr_pull *ndr NDR_CHECK(ndr_pull_dom_sid0(_ndr_sid, NDR_SCALARS|NDR_BUFFERS, &r->sid)); NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_sid, 0, r->sid_size)); } - NDR_CHECK(ndr_pull_nbt_netlogon_version(ndr, NDR_SCALARS, &r->nt_version)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lmnt_token)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lm20_token)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->message_format_version)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->message_token)); } if (ndr_flags & NDR_BUFFERS) { } return NDR_ERR_SUCCESS; } -_PUBLIC_ void ndr_print_nbt_netlogon_announce_uas(struct ndr_print *ndr, const char *name, const struct nbt_netlogon_announce_uas *r) +_PUBLIC_ void ndr_print_NETLOGON_DB_CHANGE(struct ndr_print *ndr, const char *name, const struct NETLOGON_DB_CHANGE *r) { uint32_t cntr_dbchange_0; - ndr_print_struct(ndr, name, "nbt_netlogon_announce_uas"); + ndr_print_struct(ndr, name, "NETLOGON_DB_CHANGE"); ndr->depth++; ndr_print_uint32(ndr, "serial_lo", r->serial_lo); ndr_print_time_t(ndr, "timestamp", r->timestamp); @@ -2259,16 +2387,15 @@ _PUBLIC_ void ndr_print_nbt_netlogon_announce_uas(struct ndr_print *ndr, const c for (cntr_dbchange_0=0;cntr_dbchange_0<r->db_count;cntr_dbchange_0++) { char *idx_0=NULL; if (asprintf(&idx_0, "[%d]", cntr_dbchange_0) != -1) { - ndr_print_nbt_db_change(ndr, "dbchange", &r->dbchange[cntr_dbchange_0]); + ndr_print_nbt_db_change_info(ndr, "dbchange", &r->dbchange[cntr_dbchange_0]); free(idx_0); } } ndr->depth--; ndr_print_uint32(ndr, "sid_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_dom_sid0(&r->sid, ndr->flags):r->sid_size); ndr_print_dom_sid0(ndr, "sid", &r->sid); - ndr_print_nbt_netlogon_version(ndr, "nt_version", r->nt_version); - ndr_print_uint16(ndr, "lmnt_token", r->lmnt_token); - ndr_print_uint16(ndr, "lm20_token", r->lm20_token); + ndr_print_uint32(ndr, "message_format_version", r->message_format_version); + ndr_print_uint32(ndr, "message_token", r->message_token); ndr->depth--; } @@ -2277,28 +2404,16 @@ static enum ndr_err_code ndr_push_nbt_netlogon_request(struct ndr_push *ndr, int if (ndr_flags & NDR_SCALARS) { int level = ndr_push_get_switch_value(ndr, r); switch (level) { - case NETLOGON_QUERY_FOR_PDC: { - NDR_CHECK(ndr_push_nbt_netlogon_query_for_pdc(ndr, NDR_SCALARS, &r->pdc)); + case LOGON_SAM_LOGON_REQUEST: { + NDR_CHECK(ndr_push_NETLOGON_SAM_LOGON_REQUEST(ndr, NDR_SCALARS, &r->logon)); break; } - case NETLOGON_QUERY_FOR_PDC2: { - NDR_CHECK(ndr_push_nbt_netlogon_query_for_pdc2(ndr, NDR_SCALARS, &r->pdc2)); + case LOGON_PRIMARY_QUERY: { + NDR_CHECK(ndr_push_nbt_netlogon_query_for_pdc(ndr, NDR_SCALARS, &r->pdc)); break; } case NETLOGON_ANNOUNCE_UAS: { - NDR_CHECK(ndr_push_nbt_netlogon_announce_uas(ndr, NDR_SCALARS, &r->uas)); - break; } - - case NETLOGON_RESPONSE_FROM_PDC: { - NDR_CHECK(ndr_push_nbt_netlogon_response_from_pdc(ndr, NDR_SCALARS, &r->response)); - break; } - - case NETLOGON_RESPONSE_FROM_PDC2: { - NDR_CHECK(ndr_push_nbt_netlogon_response_from_pdc2(ndr, NDR_SCALARS, &r->response2)); - break; } - - case NETLOGON_RESPONSE_FROM_PDC_USER: { - NDR_CHECK(ndr_push_nbt_netlogon_response_from_pdc2(ndr, NDR_SCALARS, &r->response2)); + NDR_CHECK(ndr_push_NETLOGON_DB_CHANGE(ndr, NDR_SCALARS, &r->uas)); break; } default: @@ -2308,23 +2423,15 @@ static enum ndr_err_code ndr_push_nbt_netlogon_request(struct ndr_push *ndr, int if (ndr_flags & NDR_BUFFERS) { int level = ndr_push_get_switch_value(ndr, r); switch (level) { - case NETLOGON_QUERY_FOR_PDC: + case LOGON_SAM_LOGON_REQUEST: + NDR_CHECK(ndr_push_NETLOGON_SAM_LOGON_REQUEST(ndr, NDR_BUFFERS, &r->logon)); break; - case NETLOGON_QUERY_FOR_PDC2: + case LOGON_PRIMARY_QUERY: break; case NETLOGON_ANNOUNCE_UAS: - NDR_CHECK(ndr_push_nbt_netlogon_announce_uas(ndr, NDR_BUFFERS, &r->uas)); - break; - - case NETLOGON_RESPONSE_FROM_PDC: - break; - - case NETLOGON_RESPONSE_FROM_PDC2: - break; - - case NETLOGON_RESPONSE_FROM_PDC_USER: + NDR_CHECK(ndr_push_NETLOGON_DB_CHANGE(ndr, NDR_BUFFERS, &r->uas)); break; default: @@ -2340,28 +2447,16 @@ static enum ndr_err_code ndr_pull_nbt_netlogon_request(struct ndr_pull *ndr, int level = ndr_pull_get_switch_value(ndr, r); if (ndr_flags & NDR_SCALARS) { switch (level) { - case NETLOGON_QUERY_FOR_PDC: { - NDR_CHECK(ndr_pull_nbt_netlogon_query_for_pdc(ndr, NDR_SCALARS, &r->pdc)); + case LOGON_SAM_LOGON_REQUEST: { + NDR_CHECK(ndr_pull_NETLOGON_SAM_LOGON_REQUEST(ndr, NDR_SCALARS, &r->logon)); break; } - case NETLOGON_QUERY_FOR_PDC2: { - NDR_CHECK(ndr_pull_nbt_netlogon_query_for_pdc2(ndr, NDR_SCALARS, &r->pdc2)); + case LOGON_PRIMARY_QUERY: { + NDR_CHECK(ndr_pull_nbt_netlogon_query_for_pdc(ndr, NDR_SCALARS, &r->pdc)); break; } case NETLOGON_ANNOUNCE_UAS: { - NDR_CHECK(ndr_pull_nbt_netlogon_announce_uas(ndr, NDR_SCALARS, &r->uas)); - break; } - - case NETLOGON_RESPONSE_FROM_PDC: { - NDR_CHECK(ndr_pull_nbt_netlogon_response_from_pdc(ndr, NDR_SCALARS, &r->response)); - break; } - - case NETLOGON_RESPONSE_FROM_PDC2: { - NDR_CHECK(ndr_pull_nbt_netlogon_response_from_pdc2(ndr, NDR_SCALARS, &r->response2)); - break; } - - case NETLOGON_RESPONSE_FROM_PDC_USER: { - NDR_CHECK(ndr_pull_nbt_netlogon_response_from_pdc2(ndr, NDR_SCALARS, &r->response2)); + NDR_CHECK(ndr_pull_NETLOGON_DB_CHANGE(ndr, NDR_SCALARS, &r->uas)); break; } default: @@ -2370,23 +2465,15 @@ static enum ndr_err_code ndr_pull_nbt_netlogon_request(struct ndr_pull *ndr, int } if (ndr_flags & NDR_BUFFERS) { switch (level) { - case NETLOGON_QUERY_FOR_PDC: + case LOGON_SAM_LOGON_REQUEST: + NDR_CHECK(ndr_pull_NETLOGON_SAM_LOGON_REQUEST(ndr, NDR_BUFFERS, &r->logon)); break; - case NETLOGON_QUERY_FOR_PDC2: + case LOGON_PRIMARY_QUERY: break; case NETLOGON_ANNOUNCE_UAS: - NDR_CHECK(ndr_pull_nbt_netlogon_announce_uas(ndr, NDR_BUFFERS, &r->uas)); - break; - - case NETLOGON_RESPONSE_FROM_PDC: - break; - - case NETLOGON_RESPONSE_FROM_PDC2: - break; - - case NETLOGON_RESPONSE_FROM_PDC_USER: + NDR_CHECK(ndr_pull_NETLOGON_DB_CHANGE(ndr, NDR_BUFFERS, &r->uas)); break; default: @@ -2402,28 +2489,16 @@ _PUBLIC_ void ndr_print_nbt_netlogon_request(struct ndr_print *ndr, const char * level = ndr_print_get_switch_value(ndr, r); ndr_print_union(ndr, name, level, "nbt_netlogon_request"); switch (level) { - case NETLOGON_QUERY_FOR_PDC: - ndr_print_nbt_netlogon_query_for_pdc(ndr, "pdc", &r->pdc); + case LOGON_SAM_LOGON_REQUEST: + ndr_print_NETLOGON_SAM_LOGON_REQUEST(ndr, "logon", &r->logon); break; - case NETLOGON_QUERY_FOR_PDC2: - ndr_print_nbt_netlogon_query_for_pdc2(ndr, "pdc2", &r->pdc2); + case LOGON_PRIMARY_QUERY: + ndr_print_nbt_netlogon_query_for_pdc(ndr, "pdc", &r->pdc); break; case NETLOGON_ANNOUNCE_UAS: - ndr_print_nbt_netlogon_announce_uas(ndr, "uas", &r->uas); - break; - - case NETLOGON_RESPONSE_FROM_PDC: - ndr_print_nbt_netlogon_response_from_pdc(ndr, "response", &r->response); - break; - - case NETLOGON_RESPONSE_FROM_PDC2: - ndr_print_nbt_netlogon_response_from_pdc2(ndr, "response2", &r->response2); - break; - - case NETLOGON_RESPONSE_FROM_PDC_USER: - ndr_print_nbt_netlogon_response_from_pdc2(ndr, "response2", &r->response2); + ndr_print_NETLOGON_DB_CHANGE(ndr, "uas", &r->uas); break; default: @@ -2438,7 +2513,7 @@ _PUBLIC_ enum ndr_err_code ndr_push_nbt_netlogon_packet(struct ndr_push *ndr, in ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_nbt_netlogon_command(ndr, NDR_SCALARS, r->command)); + NDR_CHECK(ndr_push_netlogon_command(ndr, NDR_SCALARS, r->command)); NDR_CHECK(ndr_push_set_switch_value(ndr, &r->req, r->command)); NDR_CHECK(ndr_push_nbt_netlogon_request(ndr, NDR_SCALARS, &r->req)); } @@ -2457,7 +2532,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_nbt_netlogon_packet(struct ndr_pull *ndr, in ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_nbt_netlogon_command(ndr, NDR_SCALARS, &r->command)); + NDR_CHECK(ndr_pull_netlogon_command(ndr, NDR_SCALARS, &r->command)); NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->req, r->command)); NDR_CHECK(ndr_pull_nbt_netlogon_request(ndr, NDR_SCALARS, &r->req)); } @@ -2476,7 +2551,7 @@ _PUBLIC_ void ndr_print_nbt_netlogon_packet(struct ndr_print *ndr, const char *n uint32_t _flags_save_STRUCT = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); ndr->depth++; - ndr_print_nbt_netlogon_command(ndr, "command", r->command); + ndr_print_netlogon_command(ndr, "command", r->command); ndr_print_set_switch_value(ndr, &r->req, r->command); ndr_print_nbt_netlogon_request(ndr, "req", &r->req); ndr->depth--; @@ -2484,1524 +2559,6 @@ _PUBLIC_ void ndr_print_nbt_netlogon_packet(struct ndr_print *ndr, const char *n } } -static enum ndr_err_code ndr_push_nbt_cldap_netlogon_1(struct ndr_push *ndr, int ndr_flags, const struct nbt_cldap_netlogon_1 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_nbt_netlogon_command(ndr, NDR_SCALARS, r->type)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->pdc_name)); - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->user_name)); - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->domain_name)); - ndr->flags = _flags_save_string; - } - NDR_CHECK(ndr_push_nbt_netlogon_version(ndr, NDR_SCALARS, 1)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lmnt_token)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lm20_token)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_nbt_cldap_netlogon_1(struct ndr_pull *ndr, int ndr_flags, struct nbt_cldap_netlogon_1 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_nbt_netlogon_command(ndr, NDR_SCALARS, &r->type)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->pdc_name)); - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->user_name)); - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->domain_name)); - ndr->flags = _flags_save_string; - } - NDR_CHECK(ndr_pull_nbt_netlogon_version(ndr, NDR_SCALARS, &r->nt_version)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lmnt_token)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lm20_token)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_nbt_cldap_netlogon_1(struct ndr_print *ndr, const char *name, const struct nbt_cldap_netlogon_1 *r) -{ - ndr_print_struct(ndr, name, "nbt_cldap_netlogon_1"); - ndr->depth++; - ndr_print_nbt_netlogon_command(ndr, "type", r->type); - ndr_print_string(ndr, "pdc_name", r->pdc_name); - ndr_print_string(ndr, "user_name", r->user_name); - ndr_print_string(ndr, "domain_name", r->domain_name); - ndr_print_nbt_netlogon_version(ndr, "nt_version", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?1:r->nt_version); - ndr_print_uint16(ndr, "lmnt_token", r->lmnt_token); - ndr_print_uint16(ndr, "lm20_token", r->lm20_token); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_nbt_cldap_netlogon_3(struct ndr_push *ndr, int ndr_flags, const struct nbt_cldap_netlogon_3 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_nbt_netlogon_command(ndr, NDR_SCALARS, r->type)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->pdc_name)); - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->user_name)); - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->domain_name)); - ndr->flags = _flags_save_string; - } - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->domain_uuid)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->unknown_uuid)); - NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->forest)); - NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->dns_domain)); - NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->pdc_dns_name)); - NDR_CHECK(ndr_push_ipv4address(ndr, NDR_SCALARS, r->pdc_ip)); - NDR_CHECK(ndr_push_nbt_server_type(ndr, NDR_SCALARS, r->server_type)); - NDR_CHECK(ndr_push_nbt_netlogon_version(ndr, NDR_SCALARS, 3)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lmnt_token)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lm20_token)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_nbt_cldap_netlogon_3(struct ndr_pull *ndr, int ndr_flags, struct nbt_cldap_netlogon_3 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_nbt_netlogon_command(ndr, NDR_SCALARS, &r->type)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->pdc_name)); - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->user_name)); - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->domain_name)); - ndr->flags = _flags_save_string; - } - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->domain_uuid)); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->unknown_uuid)); - NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->forest)); - NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->dns_domain)); - NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->pdc_dns_name)); - NDR_CHECK(ndr_pull_ipv4address(ndr, NDR_SCALARS, &r->pdc_ip)); - NDR_CHECK(ndr_pull_nbt_server_type(ndr, NDR_SCALARS, &r->server_type)); - NDR_CHECK(ndr_pull_nbt_netlogon_version(ndr, NDR_SCALARS, &r->nt_version)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lmnt_token)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lm20_token)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_nbt_cldap_netlogon_3(struct ndr_print *ndr, const char *name, const struct nbt_cldap_netlogon_3 *r) -{ - ndr_print_struct(ndr, name, "nbt_cldap_netlogon_3"); - ndr->depth++; - ndr_print_nbt_netlogon_command(ndr, "type", r->type); - ndr_print_string(ndr, "pdc_name", r->pdc_name); - ndr_print_string(ndr, "user_name", r->user_name); - ndr_print_string(ndr, "domain_name", r->domain_name); - ndr_print_GUID(ndr, "domain_uuid", &r->domain_uuid); - ndr_print_GUID(ndr, "unknown_uuid", &r->unknown_uuid); - ndr_print_nbt_string(ndr, "forest", r->forest); - ndr_print_nbt_string(ndr, "dns_domain", r->dns_domain); - ndr_print_nbt_string(ndr, "pdc_dns_name", r->pdc_dns_name); - ndr_print_ipv4address(ndr, "pdc_ip", r->pdc_ip); - ndr_print_nbt_server_type(ndr, "server_type", r->server_type); - ndr_print_nbt_netlogon_version(ndr, "nt_version", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?3:r->nt_version); - ndr_print_uint16(ndr, "lmnt_token", r->lmnt_token); - ndr_print_uint16(ndr, "lm20_token", r->lm20_token); - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_nbt_cldap_netlogon_5(struct ndr_push *ndr, int ndr_flags, const struct nbt_cldap_netlogon_5 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_nbt_netlogon_command(ndr, NDR_SCALARS, r->type)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->sbz)); - NDR_CHECK(ndr_push_nbt_server_type(ndr, NDR_SCALARS, r->server_type)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->domain_uuid)); - NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->forest)); - NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->dns_domain)); - NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->pdc_dns_name)); - NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->domain)); - NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->pdc_name)); - NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->user_name)); - NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->server_site)); - NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->client_site)); - NDR_CHECK(ndr_push_nbt_netlogon_version(ndr, NDR_SCALARS, 5)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lmnt_token)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lm20_token)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_nbt_cldap_netlogon_5(struct ndr_pull *ndr, int ndr_flags, struct nbt_cldap_netlogon_5 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_nbt_netlogon_command(ndr, NDR_SCALARS, &r->type)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->sbz)); - NDR_CHECK(ndr_pull_nbt_server_type(ndr, NDR_SCALARS, &r->server_type)); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->domain_uuid)); - NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->forest)); - NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->dns_domain)); - NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->pdc_dns_name)); - NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->domain)); - NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->pdc_name)); - NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->user_name)); - NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->server_site)); - NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->client_site)); - NDR_CHECK(ndr_pull_nbt_netlogon_version(ndr, NDR_SCALARS, &r->nt_version)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lmnt_token)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lm20_token)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_nbt_cldap_netlogon_5(struct ndr_print *ndr, const char *name, const struct nbt_cldap_netlogon_5 *r) -{ - ndr_print_struct(ndr, name, "nbt_cldap_netlogon_5"); - ndr->depth++; - ndr_print_nbt_netlogon_command(ndr, "type", r->type); - ndr_print_uint16(ndr, "sbz", r->sbz); - ndr_print_nbt_server_type(ndr, "server_type", r->server_type); - ndr_print_GUID(ndr, "domain_uuid", &r->domain_uuid); - ndr_print_nbt_string(ndr, "forest", r->forest); - ndr_print_nbt_string(ndr, "dns_domain", r->dns_domain); - ndr_print_nbt_string(ndr, "pdc_dns_name", r->pdc_dns_name); - ndr_print_nbt_string(ndr, "domain", r->domain); - ndr_print_nbt_string(ndr, "pdc_name", r->pdc_name); - ndr_print_nbt_string(ndr, "user_name", r->user_name); - ndr_print_nbt_string(ndr, "server_site", r->server_site); - ndr_print_nbt_string(ndr, "client_site", r->client_site); - ndr_print_nbt_netlogon_version(ndr, "nt_version", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?5:r->nt_version); - ndr_print_uint16(ndr, "lmnt_token", r->lmnt_token); - ndr_print_uint16(ndr, "lm20_token", r->lm20_token); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_nbt_cldap_netlogon_13(struct ndr_push *ndr, int ndr_flags, const struct nbt_cldap_netlogon_13 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_nbt_netlogon_command(ndr, NDR_SCALARS, r->type)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->sbz)); - NDR_CHECK(ndr_push_nbt_server_type(ndr, NDR_SCALARS, r->server_type)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->domain_uuid)); - NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->forest)); - NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->dns_domain)); - NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->pdc_dns_name)); - NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->domain)); - NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->pdc_name)); - NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->user_name)); - NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->server_site)); - NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->client_site)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->dc_sock_addr_size)); - { - struct ndr_push *_ndr_dc_sock_addr; - NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_dc_sock_addr, 0, r->dc_sock_addr_size)); - NDR_CHECK(ndr_push_nbt_dc_sock_addr(_ndr_dc_sock_addr, NDR_SCALARS, &r->dc_sock_addr)); - NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_dc_sock_addr, 0, r->dc_sock_addr_size)); - } - NDR_CHECK(ndr_push_nbt_netlogon_version(ndr, NDR_SCALARS, 13)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lmnt_token)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lm20_token)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_nbt_cldap_netlogon_13(struct ndr_pull *ndr, int ndr_flags, struct nbt_cldap_netlogon_13 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_nbt_netlogon_command(ndr, NDR_SCALARS, &r->type)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->sbz)); - NDR_CHECK(ndr_pull_nbt_server_type(ndr, NDR_SCALARS, &r->server_type)); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->domain_uuid)); - NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->forest)); - NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->dns_domain)); - NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->pdc_dns_name)); - NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->domain)); - NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->pdc_name)); - NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->user_name)); - NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->server_site)); - NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->client_site)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->dc_sock_addr_size)); - { - struct ndr_pull *_ndr_dc_sock_addr; - NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_dc_sock_addr, 0, r->dc_sock_addr_size)); - NDR_CHECK(ndr_pull_nbt_dc_sock_addr(_ndr_dc_sock_addr, NDR_SCALARS, &r->dc_sock_addr)); - NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_dc_sock_addr, 0, r->dc_sock_addr_size)); - } - NDR_CHECK(ndr_pull_nbt_netlogon_version(ndr, NDR_SCALARS, &r->nt_version)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lmnt_token)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lm20_token)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_nbt_cldap_netlogon_13(struct ndr_print *ndr, const char *name, const struct nbt_cldap_netlogon_13 *r) -{ - ndr_print_struct(ndr, name, "nbt_cldap_netlogon_13"); - ndr->depth++; - ndr_print_nbt_netlogon_command(ndr, "type", r->type); - ndr_print_uint16(ndr, "sbz", r->sbz); - ndr_print_nbt_server_type(ndr, "server_type", r->server_type); - ndr_print_GUID(ndr, "domain_uuid", &r->domain_uuid); - ndr_print_nbt_string(ndr, "forest", r->forest); - ndr_print_nbt_string(ndr, "dns_domain", r->dns_domain); - ndr_print_nbt_string(ndr, "pdc_dns_name", r->pdc_dns_name); - ndr_print_nbt_string(ndr, "domain", r->domain); - ndr_print_nbt_string(ndr, "pdc_name", r->pdc_name); - ndr_print_nbt_string(ndr, "user_name", r->user_name); - ndr_print_nbt_string(ndr, "server_site", r->server_site); - ndr_print_nbt_string(ndr, "client_site", r->client_site); - ndr_print_uint8(ndr, "dc_sock_addr_size", r->dc_sock_addr_size); - ndr_print_nbt_dc_sock_addr(ndr, "dc_sock_addr", &r->dc_sock_addr); - ndr_print_nbt_netlogon_version(ndr, "nt_version", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?13:r->nt_version); - ndr_print_uint16(ndr, "lmnt_token", r->lmnt_token); - ndr_print_uint16(ndr, "lm20_token", r->lm20_token); - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_nbt_cldap_netlogon_15(struct ndr_push *ndr, int ndr_flags, const struct nbt_cldap_netlogon_15 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_nbt_netlogon_command(ndr, NDR_SCALARS, r->type)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->sbz)); - NDR_CHECK(ndr_push_nbt_server_type(ndr, NDR_SCALARS, r->server_type)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->domain_uuid)); - NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->forest)); - NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->dns_domain)); - NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->pdc_dns_name)); - NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->domain)); - NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->pdc_name)); - NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->user_name)); - NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->server_site)); - NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->client_site)); - NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->next_closest_site)); - NDR_CHECK(ndr_push_nbt_netlogon_version(ndr, NDR_SCALARS, 15)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lmnt_token)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lm20_token)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_nbt_cldap_netlogon_15(struct ndr_pull *ndr, int ndr_flags, struct nbt_cldap_netlogon_15 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_nbt_netlogon_command(ndr, NDR_SCALARS, &r->type)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->sbz)); - NDR_CHECK(ndr_pull_nbt_server_type(ndr, NDR_SCALARS, &r->server_type)); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->domain_uuid)); - NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->forest)); - NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->dns_domain)); - NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->pdc_dns_name)); - NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->domain)); - NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->pdc_name)); - NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->user_name)); - NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->server_site)); - NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->client_site)); - NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->next_closest_site)); - NDR_CHECK(ndr_pull_nbt_netlogon_version(ndr, NDR_SCALARS, &r->nt_version)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lmnt_token)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lm20_token)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_nbt_cldap_netlogon_15(struct ndr_print *ndr, const char *name, const struct nbt_cldap_netlogon_15 *r) -{ - ndr_print_struct(ndr, name, "nbt_cldap_netlogon_15"); - ndr->depth++; - ndr_print_nbt_netlogon_command(ndr, "type", r->type); - ndr_print_uint16(ndr, "sbz", r->sbz); - ndr_print_nbt_server_type(ndr, "server_type", r->server_type); - ndr_print_GUID(ndr, "domain_uuid", &r->domain_uuid); - ndr_print_nbt_string(ndr, "forest", r->forest); - ndr_print_nbt_string(ndr, "dns_domain", r->dns_domain); - ndr_print_nbt_string(ndr, "pdc_dns_name", r->pdc_dns_name); - ndr_print_nbt_string(ndr, "domain", r->domain); - ndr_print_nbt_string(ndr, "pdc_name", r->pdc_name); - ndr_print_nbt_string(ndr, "user_name", r->user_name); - ndr_print_nbt_string(ndr, "server_site", r->server_site); - ndr_print_nbt_string(ndr, "client_site", r->client_site); - ndr_print_nbt_string(ndr, "next_closest_site", r->next_closest_site); - ndr_print_nbt_netlogon_version(ndr, "nt_version", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?15:r->nt_version); - ndr_print_uint16(ndr, "lmnt_token", r->lmnt_token); - ndr_print_uint16(ndr, "lm20_token", r->lm20_token); - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_nbt_cldap_netlogon_29(struct ndr_push *ndr, int ndr_flags, const struct nbt_cldap_netlogon_29 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_nbt_netlogon_command(ndr, NDR_SCALARS, r->type)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->sbz)); - NDR_CHECK(ndr_push_nbt_server_type(ndr, NDR_SCALARS, r->server_type)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->domain_uuid)); - NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->forest)); - NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->dns_domain)); - NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->pdc_dns_name)); - NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->domain)); - NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->pdc_name)); - NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->user_name)); - NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->server_site)); - NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->client_site)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->dc_sock_addr_size)); - { - struct ndr_push *_ndr_dc_sock_addr; - NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_dc_sock_addr, 0, r->dc_sock_addr_size)); - NDR_CHECK(ndr_push_nbt_dc_sock_addr(_ndr_dc_sock_addr, NDR_SCALARS, &r->dc_sock_addr)); - NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_dc_sock_addr, 0, r->dc_sock_addr_size)); - } - NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->next_closest_site)); - NDR_CHECK(ndr_push_nbt_netlogon_version(ndr, NDR_SCALARS, 29)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lmnt_token)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lm20_token)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_nbt_cldap_netlogon_29(struct ndr_pull *ndr, int ndr_flags, struct nbt_cldap_netlogon_29 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_nbt_netlogon_command(ndr, NDR_SCALARS, &r->type)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->sbz)); - NDR_CHECK(ndr_pull_nbt_server_type(ndr, NDR_SCALARS, &r->server_type)); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->domain_uuid)); - NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->forest)); - NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->dns_domain)); - NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->pdc_dns_name)); - NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->domain)); - NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->pdc_name)); - NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->user_name)); - NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->server_site)); - NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->client_site)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->dc_sock_addr_size)); - { - struct ndr_pull *_ndr_dc_sock_addr; - NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_dc_sock_addr, 0, r->dc_sock_addr_size)); - NDR_CHECK(ndr_pull_nbt_dc_sock_addr(_ndr_dc_sock_addr, NDR_SCALARS, &r->dc_sock_addr)); - NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_dc_sock_addr, 0, r->dc_sock_addr_size)); - } - NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->next_closest_site)); - NDR_CHECK(ndr_pull_nbt_netlogon_version(ndr, NDR_SCALARS, &r->nt_version)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lmnt_token)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lm20_token)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_nbt_cldap_netlogon_29(struct ndr_print *ndr, const char *name, const struct nbt_cldap_netlogon_29 *r) -{ - ndr_print_struct(ndr, name, "nbt_cldap_netlogon_29"); - ndr->depth++; - ndr_print_nbt_netlogon_command(ndr, "type", r->type); - ndr_print_uint16(ndr, "sbz", r->sbz); - ndr_print_nbt_server_type(ndr, "server_type", r->server_type); - ndr_print_GUID(ndr, "domain_uuid", &r->domain_uuid); - ndr_print_nbt_string(ndr, "forest", r->forest); - ndr_print_nbt_string(ndr, "dns_domain", r->dns_domain); - ndr_print_nbt_string(ndr, "pdc_dns_name", r->pdc_dns_name); - ndr_print_nbt_string(ndr, "domain", r->domain); - ndr_print_nbt_string(ndr, "pdc_name", r->pdc_name); - ndr_print_nbt_string(ndr, "user_name", r->user_name); - ndr_print_nbt_string(ndr, "server_site", r->server_site); - ndr_print_nbt_string(ndr, "client_site", r->client_site); - ndr_print_uint8(ndr, "dc_sock_addr_size", r->dc_sock_addr_size); - ndr_print_nbt_dc_sock_addr(ndr, "dc_sock_addr", &r->dc_sock_addr); - ndr_print_nbt_string(ndr, "next_closest_site", r->next_closest_site); - ndr_print_nbt_netlogon_version(ndr, "nt_version", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?29:r->nt_version); - ndr_print_uint16(ndr, "lmnt_token", r->lmnt_token); - ndr_print_uint16(ndr, "lm20_token", r->lm20_token); - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_nbt_cldap_netlogon(struct ndr_push *ndr, int ndr_flags, const union nbt_cldap_netlogon *r) -{ - { - uint32_t _flags_save_UNION = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 0: { - NDR_CHECK(ndr_push_nbt_cldap_netlogon_1(ndr, NDR_SCALARS, &r->logon1)); - break; } - - case 1: { - NDR_CHECK(ndr_push_nbt_cldap_netlogon_1(ndr, NDR_SCALARS, &r->logon1)); - break; } - - case 2: { - NDR_CHECK(ndr_push_nbt_cldap_netlogon_3(ndr, NDR_SCALARS, &r->logon3)); - break; } - - case 3: { - NDR_CHECK(ndr_push_nbt_cldap_netlogon_3(ndr, NDR_SCALARS, &r->logon3)); - break; } - - case 4: { - NDR_CHECK(ndr_push_nbt_cldap_netlogon_5(ndr, NDR_SCALARS, &r->logon5)); - break; } - - case 5: { - NDR_CHECK(ndr_push_nbt_cldap_netlogon_5(ndr, NDR_SCALARS, &r->logon5)); - break; } - - case 6: { - NDR_CHECK(ndr_push_nbt_cldap_netlogon_5(ndr, NDR_SCALARS, &r->logon5)); - break; } - - case 7: { - NDR_CHECK(ndr_push_nbt_cldap_netlogon_5(ndr, NDR_SCALARS, &r->logon5)); - break; } - - case 8: { - NDR_CHECK(ndr_push_nbt_cldap_netlogon_13(ndr, NDR_SCALARS, &r->logon13)); - break; } - - case 9: { - NDR_CHECK(ndr_push_nbt_cldap_netlogon_13(ndr, NDR_SCALARS, &r->logon13)); - break; } - - case 10: { - NDR_CHECK(ndr_push_nbt_cldap_netlogon_13(ndr, NDR_SCALARS, &r->logon13)); - break; } - - case 11: { - NDR_CHECK(ndr_push_nbt_cldap_netlogon_13(ndr, NDR_SCALARS, &r->logon13)); - break; } - - case 12: { - NDR_CHECK(ndr_push_nbt_cldap_netlogon_13(ndr, NDR_SCALARS, &r->logon13)); - break; } - - case 13: { - NDR_CHECK(ndr_push_nbt_cldap_netlogon_13(ndr, NDR_SCALARS, &r->logon13)); - break; } - - case 14: { - NDR_CHECK(ndr_push_nbt_cldap_netlogon_13(ndr, NDR_SCALARS, &r->logon13)); - break; } - - case 15: { - NDR_CHECK(ndr_push_nbt_cldap_netlogon_13(ndr, NDR_SCALARS, &r->logon13)); - break; } - - case 16: { - NDR_CHECK(ndr_push_nbt_cldap_netlogon_1(ndr, NDR_SCALARS, &r->logon1)); - break; } - - case 17: { - NDR_CHECK(ndr_push_nbt_cldap_netlogon_1(ndr, NDR_SCALARS, &r->logon1)); - break; } - - case 18: { - NDR_CHECK(ndr_push_nbt_cldap_netlogon_3(ndr, NDR_SCALARS, &r->logon3)); - break; } - - case 19: { - NDR_CHECK(ndr_push_nbt_cldap_netlogon_3(ndr, NDR_SCALARS, &r->logon3)); - break; } - - case 20: { - NDR_CHECK(ndr_push_nbt_cldap_netlogon_15(ndr, NDR_SCALARS, &r->logon15)); - break; } - - case 21: { - NDR_CHECK(ndr_push_nbt_cldap_netlogon_15(ndr, NDR_SCALARS, &r->logon15)); - break; } - - case 22: { - NDR_CHECK(ndr_push_nbt_cldap_netlogon_15(ndr, NDR_SCALARS, &r->logon15)); - break; } - - case 23: { - NDR_CHECK(ndr_push_nbt_cldap_netlogon_15(ndr, NDR_SCALARS, &r->logon15)); - break; } - - case 24: { - NDR_CHECK(ndr_push_nbt_cldap_netlogon_15(ndr, NDR_SCALARS, &r->logon15)); - break; } - - case 25: { - NDR_CHECK(ndr_push_nbt_cldap_netlogon_15(ndr, NDR_SCALARS, &r->logon15)); - break; } - - case 26: { - NDR_CHECK(ndr_push_nbt_cldap_netlogon_15(ndr, NDR_SCALARS, &r->logon15)); - break; } - - case 27: { - NDR_CHECK(ndr_push_nbt_cldap_netlogon_15(ndr, NDR_SCALARS, &r->logon15)); - break; } - - case 28: { - NDR_CHECK(ndr_push_nbt_cldap_netlogon_15(ndr, NDR_SCALARS, &r->logon15)); - break; } - - case 29: { - NDR_CHECK(ndr_push_nbt_cldap_netlogon_29(ndr, NDR_SCALARS, &r->logon29)); - break; } - - case 30: { - NDR_CHECK(ndr_push_nbt_cldap_netlogon_29(ndr, NDR_SCALARS, &r->logon29)); - break; } - - case 31: { - NDR_CHECK(ndr_push_nbt_cldap_netlogon_29(ndr, NDR_SCALARS, &r->logon29)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 0: - break; - - case 1: - break; - - case 2: - break; - - case 3: - break; - - case 4: - break; - - case 5: - break; - - case 6: - break; - - case 7: - break; - - case 8: - break; - - case 9: - break; - - case 10: - break; - - case 11: - break; - - case 12: - break; - - case 13: - break; - - case 14: - break; - - case 15: - break; - - case 16: - break; - - case 17: - break; - - case 18: - break; - - case 19: - break; - - case 20: - break; - - case 21: - break; - - case 22: - break; - - case 23: - break; - - case 24: - break; - - case 25: - break; - - case 26: - break; - - case 27: - break; - - case 28: - break; - - case 29: - break; - - case 30: - break; - - case 31: - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - ndr->flags = _flags_save_UNION; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_nbt_cldap_netlogon(struct ndr_pull *ndr, int ndr_flags, union nbt_cldap_netlogon *r) -{ - int level; - { - uint32_t _flags_save_UNION = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - switch (level) { - case 0: { - NDR_CHECK(ndr_pull_nbt_cldap_netlogon_1(ndr, NDR_SCALARS, &r->logon1)); - break; } - - case 1: { - NDR_CHECK(ndr_pull_nbt_cldap_netlogon_1(ndr, NDR_SCALARS, &r->logon1)); - break; } - - case 2: { - NDR_CHECK(ndr_pull_nbt_cldap_netlogon_3(ndr, NDR_SCALARS, &r->logon3)); - break; } - - case 3: { - NDR_CHECK(ndr_pull_nbt_cldap_netlogon_3(ndr, NDR_SCALARS, &r->logon3)); - break; } - - case 4: { - NDR_CHECK(ndr_pull_nbt_cldap_netlogon_5(ndr, NDR_SCALARS, &r->logon5)); - break; } - - case 5: { - NDR_CHECK(ndr_pull_nbt_cldap_netlogon_5(ndr, NDR_SCALARS, &r->logon5)); - break; } - - case 6: { - NDR_CHECK(ndr_pull_nbt_cldap_netlogon_5(ndr, NDR_SCALARS, &r->logon5)); - break; } - - case 7: { - NDR_CHECK(ndr_pull_nbt_cldap_netlogon_5(ndr, NDR_SCALARS, &r->logon5)); - break; } - - case 8: { - NDR_CHECK(ndr_pull_nbt_cldap_netlogon_13(ndr, NDR_SCALARS, &r->logon13)); - break; } - - case 9: { - NDR_CHECK(ndr_pull_nbt_cldap_netlogon_13(ndr, NDR_SCALARS, &r->logon13)); - break; } - - case 10: { - NDR_CHECK(ndr_pull_nbt_cldap_netlogon_13(ndr, NDR_SCALARS, &r->logon13)); - break; } - - case 11: { - NDR_CHECK(ndr_pull_nbt_cldap_netlogon_13(ndr, NDR_SCALARS, &r->logon13)); - break; } - - case 12: { - NDR_CHECK(ndr_pull_nbt_cldap_netlogon_13(ndr, NDR_SCALARS, &r->logon13)); - break; } - - case 13: { - NDR_CHECK(ndr_pull_nbt_cldap_netlogon_13(ndr, NDR_SCALARS, &r->logon13)); - break; } - - case 14: { - NDR_CHECK(ndr_pull_nbt_cldap_netlogon_13(ndr, NDR_SCALARS, &r->logon13)); - break; } - - case 15: { - NDR_CHECK(ndr_pull_nbt_cldap_netlogon_13(ndr, NDR_SCALARS, &r->logon13)); - break; } - - case 16: { - NDR_CHECK(ndr_pull_nbt_cldap_netlogon_1(ndr, NDR_SCALARS, &r->logon1)); - break; } - - case 17: { - NDR_CHECK(ndr_pull_nbt_cldap_netlogon_1(ndr, NDR_SCALARS, &r->logon1)); - break; } - - case 18: { - NDR_CHECK(ndr_pull_nbt_cldap_netlogon_3(ndr, NDR_SCALARS, &r->logon3)); - break; } - - case 19: { - NDR_CHECK(ndr_pull_nbt_cldap_netlogon_3(ndr, NDR_SCALARS, &r->logon3)); - break; } - - case 20: { - NDR_CHECK(ndr_pull_nbt_cldap_netlogon_15(ndr, NDR_SCALARS, &r->logon15)); - break; } - - case 21: { - NDR_CHECK(ndr_pull_nbt_cldap_netlogon_15(ndr, NDR_SCALARS, &r->logon15)); - break; } - - case 22: { - NDR_CHECK(ndr_pull_nbt_cldap_netlogon_15(ndr, NDR_SCALARS, &r->logon15)); - break; } - - case 23: { - NDR_CHECK(ndr_pull_nbt_cldap_netlogon_15(ndr, NDR_SCALARS, &r->logon15)); - break; } - - case 24: { - NDR_CHECK(ndr_pull_nbt_cldap_netlogon_15(ndr, NDR_SCALARS, &r->logon15)); - break; } - - case 25: { - NDR_CHECK(ndr_pull_nbt_cldap_netlogon_15(ndr, NDR_SCALARS, &r->logon15)); - break; } - - case 26: { - NDR_CHECK(ndr_pull_nbt_cldap_netlogon_15(ndr, NDR_SCALARS, &r->logon15)); - break; } - - case 27: { - NDR_CHECK(ndr_pull_nbt_cldap_netlogon_15(ndr, NDR_SCALARS, &r->logon15)); - break; } - - case 28: { - NDR_CHECK(ndr_pull_nbt_cldap_netlogon_15(ndr, NDR_SCALARS, &r->logon15)); - break; } - - case 29: { - NDR_CHECK(ndr_pull_nbt_cldap_netlogon_29(ndr, NDR_SCALARS, &r->logon29)); - break; } - - case 30: { - NDR_CHECK(ndr_pull_nbt_cldap_netlogon_29(ndr, NDR_SCALARS, &r->logon29)); - break; } - - case 31: { - NDR_CHECK(ndr_pull_nbt_cldap_netlogon_29(ndr, NDR_SCALARS, &r->logon29)); - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 0: - break; - - case 1: - break; - - case 2: - break; - - case 3: - break; - - case 4: - break; - - case 5: - break; - - case 6: - break; - - case 7: - break; - - case 8: - break; - - case 9: - break; - - case 10: - break; - - case 11: - break; - - case 12: - break; - - case 13: - break; - - case 14: - break; - - case 15: - break; - - case 16: - break; - - case 17: - break; - - case 18: - break; - - case 19: - break; - - case 20: - break; - - case 21: - break; - - case 22: - break; - - case 23: - break; - - case 24: - break; - - case 25: - break; - - case 26: - break; - - case 27: - break; - - case 28: - break; - - case 29: - break; - - case 30: - break; - - case 31: - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - ndr->flags = _flags_save_UNION; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_nbt_cldap_netlogon(struct ndr_print *ndr, const char *name, const union nbt_cldap_netlogon *r) -{ - int level; - { - uint32_t _flags_save_UNION = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "nbt_cldap_netlogon"); - switch (level) { - case 0: - ndr_print_nbt_cldap_netlogon_1(ndr, "logon1", &r->logon1); - break; - - case 1: - ndr_print_nbt_cldap_netlogon_1(ndr, "logon1", &r->logon1); - break; - - case 2: - ndr_print_nbt_cldap_netlogon_3(ndr, "logon3", &r->logon3); - break; - - case 3: - ndr_print_nbt_cldap_netlogon_3(ndr, "logon3", &r->logon3); - break; - - case 4: - ndr_print_nbt_cldap_netlogon_5(ndr, "logon5", &r->logon5); - break; - - case 5: - ndr_print_nbt_cldap_netlogon_5(ndr, "logon5", &r->logon5); - break; - - case 6: - ndr_print_nbt_cldap_netlogon_5(ndr, "logon5", &r->logon5); - break; - - case 7: - ndr_print_nbt_cldap_netlogon_5(ndr, "logon5", &r->logon5); - break; - - case 8: - ndr_print_nbt_cldap_netlogon_13(ndr, "logon13", &r->logon13); - break; - - case 9: - ndr_print_nbt_cldap_netlogon_13(ndr, "logon13", &r->logon13); - break; - - case 10: - ndr_print_nbt_cldap_netlogon_13(ndr, "logon13", &r->logon13); - break; - - case 11: - ndr_print_nbt_cldap_netlogon_13(ndr, "logon13", &r->logon13); - break; - - case 12: - ndr_print_nbt_cldap_netlogon_13(ndr, "logon13", &r->logon13); - break; - - case 13: - ndr_print_nbt_cldap_netlogon_13(ndr, "logon13", &r->logon13); - break; - - case 14: - ndr_print_nbt_cldap_netlogon_13(ndr, "logon13", &r->logon13); - break; - - case 15: - ndr_print_nbt_cldap_netlogon_13(ndr, "logon13", &r->logon13); - break; - - case 16: - ndr_print_nbt_cldap_netlogon_1(ndr, "logon1", &r->logon1); - break; - - case 17: - ndr_print_nbt_cldap_netlogon_1(ndr, "logon1", &r->logon1); - break; - - case 18: - ndr_print_nbt_cldap_netlogon_3(ndr, "logon3", &r->logon3); - break; - - case 19: - ndr_print_nbt_cldap_netlogon_3(ndr, "logon3", &r->logon3); - break; - - case 20: - ndr_print_nbt_cldap_netlogon_15(ndr, "logon15", &r->logon15); - break; - - case 21: - ndr_print_nbt_cldap_netlogon_15(ndr, "logon15", &r->logon15); - break; - - case 22: - ndr_print_nbt_cldap_netlogon_15(ndr, "logon15", &r->logon15); - break; - - case 23: - ndr_print_nbt_cldap_netlogon_15(ndr, "logon15", &r->logon15); - break; - - case 24: - ndr_print_nbt_cldap_netlogon_15(ndr, "logon15", &r->logon15); - break; - - case 25: - ndr_print_nbt_cldap_netlogon_15(ndr, "logon15", &r->logon15); - break; - - case 26: - ndr_print_nbt_cldap_netlogon_15(ndr, "logon15", &r->logon15); - break; - - case 27: - ndr_print_nbt_cldap_netlogon_15(ndr, "logon15", &r->logon15); - break; - - case 28: - ndr_print_nbt_cldap_netlogon_15(ndr, "logon15", &r->logon15); - break; - - case 29: - ndr_print_nbt_cldap_netlogon_29(ndr, "logon29", &r->logon29); - break; - - case 30: - ndr_print_nbt_cldap_netlogon_29(ndr, "logon29", &r->logon29); - break; - - case 31: - ndr_print_nbt_cldap_netlogon_29(ndr, "logon29", &r->logon29); - break; - - default: - ndr_print_bad_level(ndr, name, level); - } - ndr->flags = _flags_save_UNION; - } -} - -static enum ndr_err_code ndr_push_nbt_ntlogon_command(struct ndr_push *ndr, int ndr_flags, enum nbt_ntlogon_command r) -{ - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_nbt_ntlogon_command(struct ndr_pull *ndr, int ndr_flags, enum nbt_ntlogon_command *r) -{ - uint16_t v; - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_nbt_ntlogon_command(struct ndr_print *ndr, const char *name, enum nbt_ntlogon_command r) -{ - const char *val = NULL; - - switch (r) { - case NTLOGON_SAM_LOGON: val = "NTLOGON_SAM_LOGON"; break; - case NTLOGON_SAM_LOGON_REPLY: val = "NTLOGON_SAM_LOGON_REPLY"; break; - case NTLOGON_SAM_LOGON_REPLY15: val = "NTLOGON_SAM_LOGON_REPLY15"; break; - case NTLOGON_RESPONSE_FROM_PDC2: val = "NTLOGON_RESPONSE_FROM_PDC2"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -static enum ndr_err_code ndr_push_nbt_ntlogon_sam_logon(struct ndr_push *ndr, int ndr_flags, const struct nbt_ntlogon_sam_logon *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->request_count)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->computer_name)); - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->user_name)); - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->mailslot_name)); - ndr->flags = _flags_save_string; - } - NDR_CHECK(ndr_push_samr_AcctFlags(ndr, NDR_SCALARS, r->acct_control)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_dom_sid0(&r->sid, ndr->flags))); - { - struct ndr_push *_ndr_sid; - NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_sid, 0, ndr_size_dom_sid0(&r->sid, ndr->flags))); - NDR_CHECK(ndr_push_dom_sid0(_ndr_sid, NDR_SCALARS|NDR_BUFFERS, &r->sid)); - NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_sid, 0, ndr_size_dom_sid0(&r->sid, ndr->flags))); - } - NDR_CHECK(ndr_push_nbt_netlogon_version(ndr, NDR_SCALARS, r->nt_version)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lmnt_token)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lm20_token)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_nbt_ntlogon_sam_logon(struct ndr_pull *ndr, int ndr_flags, struct nbt_ntlogon_sam_logon *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->request_count)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->computer_name)); - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->user_name)); - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->mailslot_name)); - ndr->flags = _flags_save_string; - } - NDR_CHECK(ndr_pull_samr_AcctFlags(ndr, NDR_SCALARS, &r->acct_control)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sid_size)); - { - struct ndr_pull *_ndr_sid; - NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_sid, 0, r->sid_size)); - NDR_CHECK(ndr_pull_dom_sid0(_ndr_sid, NDR_SCALARS|NDR_BUFFERS, &r->sid)); - NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_sid, 0, r->sid_size)); - } - NDR_CHECK(ndr_pull_nbt_netlogon_version(ndr, NDR_SCALARS, &r->nt_version)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lmnt_token)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lm20_token)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_nbt_ntlogon_sam_logon(struct ndr_print *ndr, const char *name, const struct nbt_ntlogon_sam_logon *r) -{ - ndr_print_struct(ndr, name, "nbt_ntlogon_sam_logon"); - ndr->depth++; - ndr_print_uint16(ndr, "request_count", r->request_count); - ndr_print_string(ndr, "computer_name", r->computer_name); - ndr_print_string(ndr, "user_name", r->user_name); - ndr_print_string(ndr, "mailslot_name", r->mailslot_name); - ndr_print_samr_AcctFlags(ndr, "acct_control", r->acct_control); - ndr_print_uint32(ndr, "sid_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_dom_sid0(&r->sid, ndr->flags):r->sid_size); - ndr_print_dom_sid0(ndr, "sid", &r->sid); - ndr_print_nbt_netlogon_version(ndr, "nt_version", r->nt_version); - ndr_print_uint16(ndr, "lmnt_token", r->lmnt_token); - ndr_print_uint16(ndr, "lm20_token", r->lm20_token); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_nbt_ntlogon_sam_logon_reply(struct ndr_push *ndr, int ndr_flags, const struct nbt_ntlogon_sam_logon_reply *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->server)); - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->user_name)); - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->domain)); - ndr->flags = _flags_save_string; - } - NDR_CHECK(ndr_push_nbt_netlogon_version(ndr, NDR_SCALARS, r->nt_version)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lmnt_token)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lm20_token)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_nbt_ntlogon_sam_logon_reply(struct ndr_pull *ndr, int ndr_flags, struct nbt_ntlogon_sam_logon_reply *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->server)); - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->user_name)); - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->domain)); - ndr->flags = _flags_save_string; - } - NDR_CHECK(ndr_pull_nbt_netlogon_version(ndr, NDR_SCALARS, &r->nt_version)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lmnt_token)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lm20_token)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_nbt_ntlogon_sam_logon_reply(struct ndr_print *ndr, const char *name, const struct nbt_ntlogon_sam_logon_reply *r) -{ - ndr_print_struct(ndr, name, "nbt_ntlogon_sam_logon_reply"); - ndr->depth++; - ndr_print_string(ndr, "server", r->server); - ndr_print_string(ndr, "user_name", r->user_name); - ndr_print_string(ndr, "domain", r->domain); - ndr_print_nbt_netlogon_version(ndr, "nt_version", r->nt_version); - ndr_print_uint16(ndr, "lmnt_token", r->lmnt_token); - ndr_print_uint16(ndr, "lm20_token", r->lm20_token); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_nbt_ntlogon_request(struct ndr_push *ndr, int ndr_flags, const union nbt_ntlogon_request *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case NTLOGON_SAM_LOGON: { - NDR_CHECK(ndr_push_nbt_ntlogon_sam_logon(ndr, NDR_SCALARS, &r->logon)); - break; } - - case NTLOGON_SAM_LOGON_REPLY: { - NDR_CHECK(ndr_push_nbt_ntlogon_sam_logon_reply(ndr, NDR_SCALARS, &r->reply)); - break; } - - case NTLOGON_SAM_LOGON_REPLY15: { - NDR_CHECK(ndr_push_nbt_ntlogon_sam_logon_reply(ndr, NDR_SCALARS, &r->reply)); - break; } - - case NTLOGON_RESPONSE_FROM_PDC2: { - NDR_CHECK(ndr_push_nbt_netlogon_response_from_pdc2(ndr, NDR_SCALARS, &r->reply2)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case NTLOGON_SAM_LOGON: - NDR_CHECK(ndr_push_nbt_ntlogon_sam_logon(ndr, NDR_BUFFERS, &r->logon)); - break; - - case NTLOGON_SAM_LOGON_REPLY: - break; - - case NTLOGON_SAM_LOGON_REPLY15: - break; - - case NTLOGON_RESPONSE_FROM_PDC2: - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_nbt_ntlogon_request(struct ndr_pull *ndr, int ndr_flags, union nbt_ntlogon_request *r) -{ - int level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - switch (level) { - case NTLOGON_SAM_LOGON: { - NDR_CHECK(ndr_pull_nbt_ntlogon_sam_logon(ndr, NDR_SCALARS, &r->logon)); - break; } - - case NTLOGON_SAM_LOGON_REPLY: { - NDR_CHECK(ndr_pull_nbt_ntlogon_sam_logon_reply(ndr, NDR_SCALARS, &r->reply)); - break; } - - case NTLOGON_SAM_LOGON_REPLY15: { - NDR_CHECK(ndr_pull_nbt_ntlogon_sam_logon_reply(ndr, NDR_SCALARS, &r->reply)); - break; } - - case NTLOGON_RESPONSE_FROM_PDC2: { - NDR_CHECK(ndr_pull_nbt_netlogon_response_from_pdc2(ndr, NDR_SCALARS, &r->reply2)); - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case NTLOGON_SAM_LOGON: - NDR_CHECK(ndr_pull_nbt_ntlogon_sam_logon(ndr, NDR_BUFFERS, &r->logon)); - break; - - case NTLOGON_SAM_LOGON_REPLY: - break; - - case NTLOGON_SAM_LOGON_REPLY15: - break; - - case NTLOGON_RESPONSE_FROM_PDC2: - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_nbt_ntlogon_request(struct ndr_print *ndr, const char *name, const union nbt_ntlogon_request *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "nbt_ntlogon_request"); - switch (level) { - case NTLOGON_SAM_LOGON: - ndr_print_nbt_ntlogon_sam_logon(ndr, "logon", &r->logon); - break; - - case NTLOGON_SAM_LOGON_REPLY: - ndr_print_nbt_ntlogon_sam_logon_reply(ndr, "reply", &r->reply); - break; - - case NTLOGON_SAM_LOGON_REPLY15: - ndr_print_nbt_ntlogon_sam_logon_reply(ndr, "reply", &r->reply); - break; - - case NTLOGON_RESPONSE_FROM_PDC2: - ndr_print_nbt_netlogon_response_from_pdc2(ndr, "reply2", &r->reply2); - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -_PUBLIC_ enum ndr_err_code ndr_push_nbt_ntlogon_packet(struct ndr_push *ndr, int ndr_flags, const struct nbt_ntlogon_packet *r) -{ - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_nbt_ntlogon_command(ndr, NDR_SCALARS, r->command)); - NDR_CHECK(ndr_push_set_switch_value(ndr, &r->req, r->command)); - NDR_CHECK(ndr_push_nbt_ntlogon_request(ndr, NDR_SCALARS, &r->req)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_nbt_ntlogon_request(ndr, NDR_BUFFERS, &r->req)); - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_nbt_ntlogon_packet(struct ndr_pull *ndr, int ndr_flags, struct nbt_ntlogon_packet *r) -{ - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_nbt_ntlogon_command(ndr, NDR_SCALARS, &r->command)); - NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->req, r->command)); - NDR_CHECK(ndr_pull_nbt_ntlogon_request(ndr, NDR_SCALARS, &r->req)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_nbt_ntlogon_request(ndr, NDR_BUFFERS, &r->req)); - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_nbt_ntlogon_packet(struct ndr_print *ndr, const char *name, const struct nbt_ntlogon_packet *r) -{ - ndr_print_struct(ndr, name, "nbt_ntlogon_packet"); - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); - ndr->depth++; - ndr_print_nbt_ntlogon_command(ndr, "command", r->command); - ndr_print_set_switch_value(ndr, &r->req, r->command); - ndr_print_nbt_ntlogon_request(ndr, "req", &r->req); - ndr->depth--; - ndr->flags = _flags_save_STRUCT; - } -} - static enum ndr_err_code ndr_push_nbt_browse_opcode(struct ndr_push *ndr, int ndr_flags, enum nbt_browse_opcode r) { NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r)); diff --git a/source3/librpc/gen_ndr/ndr_nbt.h b/source3/librpc/gen_ndr/ndr_nbt.h index f70d1ba8df..1a0ca0c302 100644 --- a/source3/librpc/gen_ndr/ndr_nbt.h +++ b/source3/librpc/gen_ndr/ndr_nbt.h @@ -6,6 +6,7 @@ #ifndef _HEADER_NDR_nbt #define _HEADER_NDR_nbt +#include "../libcli/netlogon.h" #include "../libcli/nbt/libnbt.h" #define NDR_NBT_CALL_COUNT (0) void ndr_print_nbt_operation(struct ndr_print *ndr, const char *name, uint16_t r); @@ -30,6 +31,7 @@ void ndr_print_nbt_rdata_data(struct ndr_print *ndr, const char *name, const str enum ndr_err_code ndr_push_nbt_rdata(struct ndr_push *ndr, int ndr_flags, const union nbt_rdata *r); enum ndr_err_code ndr_pull_nbt_rdata(struct ndr_pull *ndr, int ndr_flags, union nbt_rdata *r); void ndr_print_nbt_rdata(struct ndr_print *ndr, const char *name, const union nbt_rdata *r); +enum ndr_err_code ndr_push_nbt_res_rec(struct ndr_push *ndr, int ndr_flags, const struct nbt_res_rec *r); void ndr_print_nbt_res_rec(struct ndr_print *ndr, const char *name, const struct nbt_res_rec *r); enum ndr_err_code ndr_push_nbt_name_packet(struct ndr_push *ndr, int ndr_flags, const struct nbt_name_packet *r); enum ndr_err_code ndr_pull_nbt_name_packet(struct ndr_pull *ndr, int ndr_flags, struct nbt_name_packet *r); @@ -49,42 +51,41 @@ void ndr_print_dgram_data(struct ndr_print *ndr, const char *name, const union d enum ndr_err_code ndr_push_nbt_dgram_packet(struct ndr_push *ndr, int ndr_flags, const struct nbt_dgram_packet *r); enum ndr_err_code ndr_pull_nbt_dgram_packet(struct ndr_pull *ndr, int ndr_flags, struct nbt_dgram_packet *r); void ndr_print_nbt_dgram_packet(struct ndr_print *ndr, const char *name, const struct nbt_dgram_packet *r); -void ndr_print_nbt_netlogon_command(struct ndr_print *ndr, const char *name, enum nbt_netlogon_command r); -void ndr_print_nbt_netlogon_version(struct ndr_print *ndr, const char *name, uint32_t r); +enum ndr_err_code ndr_push_nbt_sockaddr(struct ndr_push *ndr, int ndr_flags, const struct nbt_sockaddr *r); +enum ndr_err_code ndr_pull_nbt_sockaddr(struct ndr_pull *ndr, int ndr_flags, struct nbt_sockaddr *r); +void ndr_print_nbt_sockaddr(struct ndr_print *ndr, const char *name, const struct nbt_sockaddr *r); +size_t ndr_size_nbt_sockaddr(const struct nbt_sockaddr *r, int flags); +enum ndr_err_code ndr_push_nbt_server_type(struct ndr_push *ndr, int ndr_flags, uint32_t r); +enum ndr_err_code ndr_pull_nbt_server_type(struct ndr_pull *ndr, int ndr_flags, uint32_t *r); +void ndr_print_nbt_server_type(struct ndr_print *ndr, const char *name, uint32_t r); +enum ndr_err_code ndr_push_netlogon_nt_version_flags(struct ndr_push *ndr, int ndr_flags, uint32_t r); +enum ndr_err_code ndr_pull_netlogon_nt_version_flags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r); +void ndr_print_netlogon_nt_version_flags(struct ndr_print *ndr, const char *name, uint32_t r); +enum ndr_err_code ndr_push_netlogon_command(struct ndr_push *ndr, int ndr_flags, enum netlogon_command r); +enum ndr_err_code ndr_pull_netlogon_command(struct ndr_pull *ndr, int ndr_flags, enum netlogon_command *r); +void ndr_print_netlogon_command(struct ndr_print *ndr, const char *name, enum netlogon_command r); +enum ndr_err_code ndr_push_NETLOGON_SAM_LOGON_REQUEST(struct ndr_push *ndr, int ndr_flags, const struct NETLOGON_SAM_LOGON_REQUEST *r); +enum ndr_err_code ndr_pull_NETLOGON_SAM_LOGON_REQUEST(struct ndr_pull *ndr, int ndr_flags, struct NETLOGON_SAM_LOGON_REQUEST *r); +void ndr_print_NETLOGON_SAM_LOGON_REQUEST(struct ndr_print *ndr, const char *name, const struct NETLOGON_SAM_LOGON_REQUEST *r); +enum ndr_err_code ndr_push_NETLOGON_SAM_LOGON_RESPONSE_NT40(struct ndr_push *ndr, int ndr_flags, const struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *r); +enum ndr_err_code ndr_pull_NETLOGON_SAM_LOGON_RESPONSE_NT40(struct ndr_pull *ndr, int ndr_flags, struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *r); +void ndr_print_NETLOGON_SAM_LOGON_RESPONSE_NT40(struct ndr_print *ndr, const char *name, const struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *r); +enum ndr_err_code ndr_push_NETLOGON_SAM_LOGON_RESPONSE(struct ndr_push *ndr, int ndr_flags, const struct NETLOGON_SAM_LOGON_RESPONSE *r); +enum ndr_err_code ndr_pull_NETLOGON_SAM_LOGON_RESPONSE(struct ndr_pull *ndr, int ndr_flags, struct NETLOGON_SAM_LOGON_RESPONSE *r); +void ndr_print_NETLOGON_SAM_LOGON_RESPONSE(struct ndr_print *ndr, const char *name, const struct NETLOGON_SAM_LOGON_RESPONSE *r); +enum ndr_err_code ndr_push_NETLOGON_SAM_LOGON_RESPONSE_EX(struct ndr_push *ndr, int ndr_flags, const struct NETLOGON_SAM_LOGON_RESPONSE_EX *r); +enum ndr_err_code ndr_pull_NETLOGON_SAM_LOGON_RESPONSE_EX(struct ndr_pull *ndr, int ndr_flags, struct NETLOGON_SAM_LOGON_RESPONSE_EX *r); +void ndr_print_NETLOGON_SAM_LOGON_RESPONSE_EX(struct ndr_print *ndr, const char *name, const struct NETLOGON_SAM_LOGON_RESPONSE_EX *r); void ndr_print_nbt_netlogon_query_for_pdc(struct ndr_print *ndr, const char *name, const struct nbt_netlogon_query_for_pdc *r); -void ndr_print_nbt_netlogon_query_for_pdc2(struct ndr_print *ndr, const char *name, const struct nbt_netlogon_query_for_pdc2 *r); +enum ndr_err_code ndr_push_nbt_netlogon_response_from_pdc(struct ndr_push *ndr, int ndr_flags, const struct nbt_netlogon_response_from_pdc *r); +enum ndr_err_code ndr_pull_nbt_netlogon_response_from_pdc(struct ndr_pull *ndr, int ndr_flags, struct nbt_netlogon_response_from_pdc *r); void ndr_print_nbt_netlogon_response_from_pdc(struct ndr_print *ndr, const char *name, const struct nbt_netlogon_response_from_pdc *r); -void ndr_print_nbt_server_type(struct ndr_print *ndr, const char *name, uint32_t r); -void ndr_print_nbt_dc_sock_addr(struct ndr_print *ndr, const char *name, const struct nbt_dc_sock_addr *r); -void ndr_print_nbt_netlogon_response_from_pdc2(struct ndr_print *ndr, const char *name, const struct nbt_netlogon_response_from_pdc2 *r); -void ndr_print_nbt_db_change(struct ndr_print *ndr, const char *name, const struct nbt_db_change *r); -void ndr_print_nbt_netlogon_announce_uas(struct ndr_print *ndr, const char *name, const struct nbt_netlogon_announce_uas *r); +void ndr_print_nbt_db_change_info(struct ndr_print *ndr, const char *name, const struct nbt_db_change_info *r); +void ndr_print_NETLOGON_DB_CHANGE(struct ndr_print *ndr, const char *name, const struct NETLOGON_DB_CHANGE *r); void ndr_print_nbt_netlogon_request(struct ndr_print *ndr, const char *name, const union nbt_netlogon_request *r); enum ndr_err_code ndr_push_nbt_netlogon_packet(struct ndr_push *ndr, int ndr_flags, const struct nbt_netlogon_packet *r); enum ndr_err_code ndr_pull_nbt_netlogon_packet(struct ndr_pull *ndr, int ndr_flags, struct nbt_netlogon_packet *r); void ndr_print_nbt_netlogon_packet(struct ndr_print *ndr, const char *name, const struct nbt_netlogon_packet *r); -void ndr_print_nbt_cldap_netlogon_1(struct ndr_print *ndr, const char *name, const struct nbt_cldap_netlogon_1 *r); -void ndr_print_nbt_cldap_netlogon_3(struct ndr_print *ndr, const char *name, const struct nbt_cldap_netlogon_3 *r); -enum ndr_err_code ndr_push_nbt_cldap_netlogon_5(struct ndr_push *ndr, int ndr_flags, const struct nbt_cldap_netlogon_5 *r); -enum ndr_err_code ndr_pull_nbt_cldap_netlogon_5(struct ndr_pull *ndr, int ndr_flags, struct nbt_cldap_netlogon_5 *r); -void ndr_print_nbt_cldap_netlogon_5(struct ndr_print *ndr, const char *name, const struct nbt_cldap_netlogon_5 *r); -void ndr_print_nbt_cldap_netlogon_13(struct ndr_print *ndr, const char *name, const struct nbt_cldap_netlogon_13 *r); -enum ndr_err_code ndr_push_nbt_cldap_netlogon_15(struct ndr_push *ndr, int ndr_flags, const struct nbt_cldap_netlogon_15 *r); -enum ndr_err_code ndr_pull_nbt_cldap_netlogon_15(struct ndr_pull *ndr, int ndr_flags, struct nbt_cldap_netlogon_15 *r); -void ndr_print_nbt_cldap_netlogon_15(struct ndr_print *ndr, const char *name, const struct nbt_cldap_netlogon_15 *r); -enum ndr_err_code ndr_push_nbt_cldap_netlogon_29(struct ndr_push *ndr, int ndr_flags, const struct nbt_cldap_netlogon_29 *r); -enum ndr_err_code ndr_pull_nbt_cldap_netlogon_29(struct ndr_pull *ndr, int ndr_flags, struct nbt_cldap_netlogon_29 *r); -void ndr_print_nbt_cldap_netlogon_29(struct ndr_print *ndr, const char *name, const struct nbt_cldap_netlogon_29 *r); -enum ndr_err_code ndr_push_nbt_cldap_netlogon(struct ndr_push *ndr, int ndr_flags, const union nbt_cldap_netlogon *r); -enum ndr_err_code ndr_pull_nbt_cldap_netlogon(struct ndr_pull *ndr, int ndr_flags, union nbt_cldap_netlogon *r); -void ndr_print_nbt_cldap_netlogon(struct ndr_print *ndr, const char *name, const union nbt_cldap_netlogon *r); -void ndr_print_nbt_ntlogon_command(struct ndr_print *ndr, const char *name, enum nbt_ntlogon_command r); -void ndr_print_nbt_ntlogon_sam_logon(struct ndr_print *ndr, const char *name, const struct nbt_ntlogon_sam_logon *r); -void ndr_print_nbt_ntlogon_sam_logon_reply(struct ndr_print *ndr, const char *name, const struct nbt_ntlogon_sam_logon_reply *r); -void ndr_print_nbt_ntlogon_request(struct ndr_print *ndr, const char *name, const union nbt_ntlogon_request *r); -enum ndr_err_code ndr_push_nbt_ntlogon_packet(struct ndr_push *ndr, int ndr_flags, const struct nbt_ntlogon_packet *r); -enum ndr_err_code ndr_pull_nbt_ntlogon_packet(struct ndr_pull *ndr, int ndr_flags, struct nbt_ntlogon_packet *r); -void ndr_print_nbt_ntlogon_packet(struct ndr_print *ndr, const char *name, const struct nbt_ntlogon_packet *r); void ndr_print_nbt_browse_opcode(struct ndr_print *ndr, const char *name, enum nbt_browse_opcode r); void ndr_print_nbt_browse_host_announcement(struct ndr_print *ndr, const char *name, const struct nbt_browse_host_announcement *r); void ndr_print_nbt_browse_announcement_request(struct ndr_print *ndr, const char *name, const struct nbt_browse_announcement_request *r); diff --git a/source3/librpc/idl/nbt.idl b/source3/librpc/idl/nbt.idl index f743109594..82571d96e6 100644 --- a/source3/librpc/idl/nbt.idl +++ b/source3/librpc/idl/nbt.idl @@ -10,7 +10,7 @@ import "misc.idl", "security.idl", "svcctl.idl", "samr.idl"; [ -helper("../libcli/nbt/libnbt.h") + helper("../libcli/netlogon.h", "../libcli/nbt/libnbt.h") ] interface nbt { @@ -172,18 +172,12 @@ interface nbt * together with NBT_QTYPE_NETBIOS * for WACK replies */ -#define NBT_RES_REC_LEVEL(rr_type, rdata) (\ - (((rr_type) == NBT_QTYPE_NETBIOS) && \ - talloc_check_name(ndr, "struct ndr_push") && \ - ((rdata).data.length == 2)) \ - ? 0 : rr_type) - - typedef [flag(LIBNDR_PRINT_ARRAY_HEX)] struct { + typedef [flag(LIBNDR_PRINT_ARRAY_HEX),nopush] struct { nbt_name name; nbt_qtype rr_type; nbt_qclass rr_class; uint32 ttl; - [switch_is(NBT_RES_REC_LEVEL(rr_type, rdata))] nbt_rdata rdata; + [switch_is(rr_type)] nbt_rdata rdata; } nbt_res_rec; typedef [flag(NDR_NOALIGN|NDR_BIG_ENDIAN|NDR_PAHEX),public] struct { @@ -338,65 +332,19 @@ interface nbt } nbt_dgram_packet; - /*******************************************/ - /* \MAILSLOT\NET\NETLOGON mailslot requests */ - typedef enum { - NETLOGON_QUERY_FOR_PDC = 0x7, - NETLOGON_ANNOUNCE_UAS = 0xa, - NETLOGON_RESPONSE_FROM_PDC = 0xc, - NETLOGON_QUERY_FOR_PDC2 = 0x12, - NETLOGON_RESPONSE_FROM_PDC2 = 0x17, - NETLOGON_RESPONSE_FROM_PDC_USER = 0x19 - } nbt_netlogon_command; - - typedef [flag(NDR_LITTLE_ENDIAN),bitmap32bit] bitmap { - NETLOGON_NT_VERSION_1 = 0x00000001, - NETLOGON_NT_VERSION_5 = 0x00000002, - NETLOGON_NT_VERSION_5EX = 0x00000004, - NETLOGON_NT_VERSION_5EX_WITH_IP = 0x00000008, - NETLOGON_NT_VERSION_WITH_CLOSEST_SITE = 0x00000010, - NETLOGON_NT_VERSION_AVIOD_NT4EMUL = 0x01000000, - NETLOGON_NT_VERSION_PDC = 0x10000000, - NETLOGON_NT_VERSION_IP = 0x20000000, - NETLOGON_NT_VERSION_LOCAL = 0x40000000, - NETLOGON_NT_VERSION_GC = 0x80000000 - } nbt_netlogon_version; - - /* query for pdc request */ - typedef struct { - astring computer_name; - astring mailslot_name; - [flag(NDR_ALIGN2)] DATA_BLOB _pad; - nstring unicode_name; - nbt_netlogon_version nt_version; - uint16 lmnt_token; - uint16 lm20_token; - } nbt_netlogon_query_for_pdc; + /****************************************** + * \MAILSLOT\NET\NETLOGON mailslot requests + * and + * \MAILSLOT\NET\NTLOGON mailslot requests + */ - /* query for pdc request - new style */ - typedef struct { - uint16 request_count; - nstring computer_name; - nstring user_name; - astring mailslot_name; - uint32 unknown[2]; - nbt_netlogon_version nt_version; - uint16 lmnt_token; - uint16 lm20_token; - } nbt_netlogon_query_for_pdc2; - - /* response from pdc */ - typedef struct { - astring pdc_name; - [flag(NDR_ALIGN2)] DATA_BLOB _pad; - nstring unicode_pdc_name; - nstring domain_name; - nbt_netlogon_version nt_version; - uint16 lmnt_token; - uint16 lm20_token; - } nbt_netlogon_response_from_pdc; + typedef [public,gensize] struct { + uint32 sa_family; + [flag(NDR_BIG_ENDIAN)] ipv4address pdc_ip; + [flag(NDR_REMAINING)] DATA_BLOB remaining; + } nbt_sockaddr; - typedef [bitmap32bit] bitmap { + typedef [bitmap32bit,public] bitmap { NBT_SERVER_PDC = 0x00000001, NBT_SERVER_GC = 0x00000004, NBT_SERVER_LDAP = 0x00000008, @@ -411,111 +359,89 @@ interface nbt NBT_SERVER_FULL_SECRET_DOMAIN_6 = 0x00001000 } nbt_server_type; - typedef struct { - uint32 family; - [flag(NDR_BIG_ENDIAN)] ipv4address pdc_ip; - [flag(NDR_REMAINING)] DATA_BLOB remaining; - } nbt_dc_sock_addr; - - /* response from pdc - type2 */ - typedef struct { + typedef [bitmap32bit,public] bitmap { + NETLOGON_NT_VERSION_1 = 0x00000001, + NETLOGON_NT_VERSION_5 = 0x00000002, + NETLOGON_NT_VERSION_5EX = 0x00000004, + NETLOGON_NT_VERSION_5EX_WITH_IP = 0x00000008, + NETLOGON_NT_VERSION_WITH_CLOSEST_SITE = 0x00000010, + NETLOGON_NT_VERSION_AVIOD_NT4EMUL = 0x01000000, + NETLOGON_NT_VERSION_PDC = 0x10000000, + NETLOGON_NT_VERSION_IP = 0x20000000, + NETLOGON_NT_VERSION_LOCAL = 0x40000000, + NETLOGON_NT_VERSION_GC = 0x80000000 + } netlogon_nt_version_flags; + + typedef [enum16bit,public] enum { + LOGON_PRIMARY_QUERY = 7, /* Was also NETLOGON_QUERY_FOR_PDC */ + NETLOGON_ANNOUNCE_UAS = 10, + NETLOGON_RESPONSE_FROM_PDC = 12, + LOGON_SAM_LOGON_REQUEST = 18, /* Was also NETLOGON_QUERY_FOR_PDC2, NTLOGON_SAM_LOGON */ + LOGON_SAM_LOGON_RESPONSE = 19, /* Was also NTLOGON_SAM_LOGON_REPLY */ + LOGON_SAM_LOGON_PAUSE_RESPONSE = 20, + LOGON_SAM_LOGON_USER_UNKNOWN = 21, /* Was also NTLOGON_SAM_LOGON_REPLY15 */ + LOGON_SAM_LOGON_RESPONSE_EX = 23, /* was NETLOGON_RESPONSE_FROM_PDC2 */ + LOGON_SAM_LOGON_PAUSE_RESPONSE_EX = 24, + LOGON_SAM_LOGON_USER_UNKNOWN_EX = 25 /* was NETLOGON_RESPONSE_FROM_PDC_USER */ + } netlogon_command; + + typedef bitmap samr_AcctFlags samr_AcctFlags; + + /* query to dc hand marshaled, as it has 'optional' + * parts */ + typedef [nopull,nopush] struct { + uint16 request_count; + nstring computer_name; + nstring user_name; + astring mailslot_name; + samr_AcctFlags acct_control; + [value(ndr_size_dom_sid0(&sid, ndr->flags))] uint32 sid_size; + /* The manual alignment is required because this + * structure is marked flag(NDR_NOALIGN) via the + * nbt_netlogon_packet below. + * + * However, both MUST only be present if sid_size > 0 + */ [flag(NDR_ALIGN4)] DATA_BLOB _pad; - nbt_server_type server_type; - GUID domain_uuid; - nbt_string forest; - nbt_string dns_domain; - nbt_string pdc_dns_name; - nbt_string domain; - nbt_string pdc_name; - nbt_string user_name; - nbt_string server_site; - nbt_string client_site; - uint8 dc_sock_addr_size; - [subcontext(0),subcontext_size(dc_sock_addr_size)] nbt_dc_sock_addr dc_sock_addr; - nbt_netlogon_version nt_version; + [subcontext(0),subcontext_size(sid_size)] dom_sid0 sid; + netlogon_nt_version_flags nt_version; uint16 lmnt_token; uint16 lm20_token; - } nbt_netlogon_response_from_pdc2; - - typedef enum netr_SamDatabaseID netr_SamDatabaseID; - - /* announce change to UAS or SAM */ - typedef struct { - netr_SamDatabaseID db_index; - hyper serial; - NTTIME timestamp; - } nbt_db_change; - - /* used to announce SAM changes */ - typedef struct { - uint32 serial_lo; - time_t timestamp; - uint32 pulse; - uint32 random; - astring pdc_name; - astring domain; - [flag(NDR_ALIGN2)] DATA_BLOB _pad; - nstring unicode_pdc_name; - nstring unicode_domain; - uint32 db_count; - nbt_db_change dbchange[db_count]; - [value(ndr_size_dom_sid0(&sid, ndr->flags))] uint32 sid_size; - [subcontext(0),subcontext_size(sid_size)] dom_sid0 sid; - nbt_netlogon_version nt_version; - uint16 lmnt_token; - uint16 lm20_token; - } nbt_netlogon_announce_uas; - - typedef [nodiscriminant] union { - [case(NETLOGON_QUERY_FOR_PDC)] nbt_netlogon_query_for_pdc pdc; - [case(NETLOGON_QUERY_FOR_PDC2)] nbt_netlogon_query_for_pdc2 pdc2; - [case(NETLOGON_ANNOUNCE_UAS)] nbt_netlogon_announce_uas uas; - [case(NETLOGON_RESPONSE_FROM_PDC)] nbt_netlogon_response_from_pdc response; - [case(NETLOGON_RESPONSE_FROM_PDC2)] nbt_netlogon_response_from_pdc2 response2; - [case(NETLOGON_RESPONSE_FROM_PDC_USER)] nbt_netlogon_response_from_pdc2 response2; - } nbt_netlogon_request; + } NETLOGON_SAM_LOGON_REQUEST; typedef [flag(NDR_NOALIGN),public] struct { - nbt_netlogon_command command; - [switch_is(command)] nbt_netlogon_request req; - } nbt_netlogon_packet; - - /*******************************************/ - /* CLDAP netlogon response */ - - /* note that these structures are very similar to, but not - quite identical to, the netlogon structures above */ - - typedef struct { - nbt_netlogon_command type; - nstring pdc_name; + netlogon_command command; + nstring server; nstring user_name; - nstring domain_name; - [value(1)] nbt_netlogon_version nt_version; + nstring domain; + netlogon_nt_version_flags nt_version; uint16 lmnt_token; uint16 lm20_token; - } nbt_cldap_netlogon_1; + } NETLOGON_SAM_LOGON_RESPONSE_NT40; - typedef struct { - nbt_netlogon_command type; + typedef [flag(NDR_NOALIGN),public] struct { + netlogon_command command; nstring pdc_name; nstring user_name; nstring domain_name; GUID domain_uuid; - GUID unknown_uuid; + GUID zero_uuid; nbt_string forest; nbt_string dns_domain; nbt_string pdc_dns_name; ipv4address pdc_ip; nbt_server_type server_type; - [value(3)] nbt_netlogon_version nt_version; + netlogon_nt_version_flags nt_version; uint16 lmnt_token; uint16 lm20_token; - } nbt_cldap_netlogon_3; + } NETLOGON_SAM_LOGON_RESPONSE; - typedef [public] struct { - nbt_netlogon_command type; - uint16 sbz; + /* response from pdc hand marshaled (we have an additional + * function that uses this structure), as it has 'optional' + * parts */ + typedef [flag(NDR_NOALIGN),public] struct { + netlogon_command command; + uint16 sbz; /* From the docs */ nbt_server_type server_type; GUID domain_uuid; nbt_string forest; @@ -526,148 +452,91 @@ interface nbt nbt_string user_name; nbt_string server_site; nbt_string client_site; - [value(5)] nbt_netlogon_version nt_version; - uint16 lmnt_token; - uint16 lm20_token; - } nbt_cldap_netlogon_5; - typedef struct { - nbt_netlogon_command type; - uint16 sbz; - nbt_server_type server_type; - GUID domain_uuid; - nbt_string forest; - nbt_string dns_domain; - nbt_string pdc_dns_name; - nbt_string domain; - nbt_string pdc_name; - nbt_string user_name; - nbt_string server_site; - nbt_string client_site; - uint8 dc_sock_addr_size; - [subcontext(0),subcontext_size(dc_sock_addr_size)] nbt_dc_sock_addr dc_sock_addr; - [value(13)] nbt_netlogon_version nt_version; - uint16 lmnt_token; - uint16 lm20_token; - } nbt_cldap_netlogon_13; + /* Optional on NETLOGON_NT_VERSION_5EX_WITH_IP */ + [value(ndr_size_nbt_sockaddr(&sockaddr, ndr->flags))] uint8 sockaddr_size; + [subcontext(0),subcontext_size(sockaddr_size)] nbt_sockaddr sockaddr; - typedef [public] struct { - nbt_netlogon_command type; - uint16 sbz; - nbt_server_type server_type; - GUID domain_uuid; - nbt_string forest; - nbt_string dns_domain; - nbt_string pdc_dns_name; - nbt_string domain; - nbt_string pdc_name; - nbt_string user_name; - nbt_string server_site; - nbt_string client_site; + /* Optional on NETLOGON_NT_VERSION_WITH_CLOSEST_SITE */ nbt_string next_closest_site; - [value(15)] nbt_netlogon_version nt_version; - uint16 lmnt_token; - uint16 lm20_token; - } nbt_cldap_netlogon_15; - typedef [public] struct { - nbt_netlogon_command type; - uint16 sbz; - nbt_server_type server_type; - GUID domain_uuid; - nbt_string forest; - nbt_string dns_domain; - nbt_string pdc_dns_name; - nbt_string domain; - nbt_string pdc_name; - nbt_string user_name; - nbt_string server_site; - nbt_string client_site; - uint8 dc_sock_addr_size; - [subcontext(0),subcontext_size(dc_sock_addr_size)] nbt_dc_sock_addr dc_sock_addr; - nbt_string next_closest_site; - [value(29)] nbt_netlogon_version nt_version; + netlogon_nt_version_flags nt_version; uint16 lmnt_token; uint16 lm20_token; - } nbt_cldap_netlogon_29; - - typedef [flag(NDR_NOALIGN),public,nodiscriminant] union { - [case(0)] nbt_cldap_netlogon_1 logon1; - [case(1)] nbt_cldap_netlogon_1 logon1; - [case(2)] nbt_cldap_netlogon_3 logon3; - [case(3)] nbt_cldap_netlogon_3 logon3; - [case(4)] nbt_cldap_netlogon_5 logon5; - [case(5)] nbt_cldap_netlogon_5 logon5; - [case(6)] nbt_cldap_netlogon_5 logon5; - [case(7)] nbt_cldap_netlogon_5 logon5; - [case(8)] nbt_cldap_netlogon_13 logon13; - [case(9)] nbt_cldap_netlogon_13 logon13; - [case(10)] nbt_cldap_netlogon_13 logon13; - [case(11)] nbt_cldap_netlogon_13 logon13; - [case(12)] nbt_cldap_netlogon_13 logon13; - [case(13)] nbt_cldap_netlogon_13 logon13; - [case(14)] nbt_cldap_netlogon_13 logon13; - [case(15)] nbt_cldap_netlogon_13 logon13; - [case(16)] nbt_cldap_netlogon_1 logon1; - [case(17)] nbt_cldap_netlogon_1 logon1; - [case(18)] nbt_cldap_netlogon_3 logon3; - [case(19)] nbt_cldap_netlogon_3 logon3; - [case(20)] nbt_cldap_netlogon_15 logon15; - [case(21)] nbt_cldap_netlogon_15 logon15; - [case(22)] nbt_cldap_netlogon_15 logon15; - [case(23)] nbt_cldap_netlogon_15 logon15; - [case(24)] nbt_cldap_netlogon_15 logon15; - [case(25)] nbt_cldap_netlogon_15 logon15; - [case(26)] nbt_cldap_netlogon_15 logon15; - [case(27)] nbt_cldap_netlogon_15 logon15; - [case(28)] nbt_cldap_netlogon_15 logon15; - [case(29)] nbt_cldap_netlogon_29 logon29; - [case(30)] nbt_cldap_netlogon_29 logon29; - [case(31)] nbt_cldap_netlogon_29 logon29; - } nbt_cldap_netlogon; - - /*******************************************/ - /* \MAILSLOT\NET\NTLOGON mailslot requests */ - typedef enum { - NTLOGON_SAM_LOGON = 0x12, - NTLOGON_SAM_LOGON_REPLY = 0x13, - NTLOGON_SAM_LOGON_REPLY15 = 0x15, - NTLOGON_RESPONSE_FROM_PDC2 = 0x17 - } nbt_ntlogon_command; + } NETLOGON_SAM_LOGON_RESPONSE_EX; + /* query for pdc request */ typedef struct { - uint16 request_count; - nstring computer_name; - nstring user_name; + astring computer_name; astring mailslot_name; - samr_AcctFlags acct_control; - [value(ndr_size_dom_sid0(&sid, ndr->flags))] uint32 sid_size; - [subcontext(0),subcontext_size(sid_size)] dom_sid0 sid; - nbt_netlogon_version nt_version; + [flag(NDR_ALIGN2)] DATA_BLOB _pad; + nstring unicode_name; + netlogon_nt_version_flags nt_version; uint16 lmnt_token; uint16 lm20_token; - } nbt_ntlogon_sam_logon; + } nbt_netlogon_query_for_pdc; - typedef struct { - nstring server; - nstring user_name; - nstring domain; - nbt_netlogon_version nt_version; + /* response from pdc */ + typedef [flag(NDR_NOALIGN),public] struct { + netlogon_command command; + astring pdc_name; + [flag(NDR_ALIGN2)] DATA_BLOB _pad; + nstring unicode_pdc_name; + nstring domain_name; + netlogon_nt_version_flags nt_version; uint16 lmnt_token; uint16 lm20_token; - } nbt_ntlogon_sam_logon_reply; + } nbt_netlogon_response_from_pdc; + + typedef enum netr_SamDatabaseID netr_SamDatabaseID; + + /* used to announce SAM changes - MS-NRPC 2.2.1.5.1 */ + typedef struct { + netr_SamDatabaseID db_index; + hyper serial; + NTTIME timestamp; + } nbt_db_change_info; + + typedef struct { + uint32 serial_lo; + time_t timestamp; + uint32 pulse; + uint32 random; + astring pdc_name; + astring domain; + [flag(NDR_ALIGN2)] DATA_BLOB _pad; + nstring unicode_pdc_name; + nstring unicode_domain; + uint32 db_count; + nbt_db_change_info dbchange[db_count]; + [value(ndr_size_dom_sid0(&sid, ndr->flags))] uint32 sid_size; + [subcontext(0),subcontext_size(sid_size)] dom_sid0 sid; + uint32 message_format_version; + uint32 message_token; + } NETLOGON_DB_CHANGE; typedef [nodiscriminant] union { - [case(NTLOGON_SAM_LOGON)] nbt_ntlogon_sam_logon logon; - [case(NTLOGON_SAM_LOGON_REPLY)] nbt_ntlogon_sam_logon_reply reply; - [case(NTLOGON_SAM_LOGON_REPLY15)] nbt_ntlogon_sam_logon_reply reply; - [case(NTLOGON_RESPONSE_FROM_PDC2)] nbt_netlogon_response_from_pdc2 reply2; - } nbt_ntlogon_request; + [case(LOGON_SAM_LOGON_REQUEST)] NETLOGON_SAM_LOGON_REQUEST logon; + [case(LOGON_PRIMARY_QUERY)] nbt_netlogon_query_for_pdc pdc; + [case(NETLOGON_ANNOUNCE_UAS)] NETLOGON_DB_CHANGE uas; + } nbt_netlogon_request; + +#if 0 + [case(NETLOGON_RESPONSE_FROM_PDC)] nbt_netlogon_response_from_pdc response; + [case(NETLOGON_RESPONSE_FROM_PDC_USER)] nbt_netlogon_response_from_pdc2 response2; + + [case(LOGON_SAM_LOGON_PAUSE_RESPONSE)] NETLOGON_SAM_LOGON_RESPONSE reply; + [case(LOGON_SAM_LOGON_RESPONSE)] NETLOGON_SAM_LOGON_RESPONSE reply; + [case(LOGON_SAM_LOGON_USER_UNKNOWN)] NETLOGON_SAM_LOGON_RESPONSE reply; + [case(LOGON_SAM_LOGON_RESPONSE_EX)] NETLOGON_SAM_LOGON_RESPONSE_EX reply_ex; + [case(LOGON_SAM_LOGON_PAUSE_RESPONSE_EX)] NETLOGON_SAM_LOGON_RESPONSE_EX reply_ex; + [case(LOGON_SAM_LOGON_USER_UNKNOWN_EX)] NETLOGON_SAM_LOGON_RESPONSE_EX reply_ex; +#endif typedef [flag(NDR_NOALIGN),public] struct { - nbt_ntlogon_command command; - [switch_is(command)] nbt_ntlogon_request req; - } nbt_ntlogon_packet; + netlogon_command command; + [switch_is(command)] nbt_netlogon_request req; + } nbt_netlogon_packet; /********************************************************/ /* \MAILSLOT\BROWSE mailslot requests */ diff --git a/source3/libsmb/clidgram.c b/source3/libsmb/clidgram.c index 8ee3507a04..e8799bce47 100644 --- a/source3/libsmb/clidgram.c +++ b/source3/libsmb/clidgram.c @@ -136,8 +136,8 @@ bool send_getdc_request(TALLOC_CTX *mem_ctx, struct in_addr dc_ip; const char *my_acct_name = NULL; const char *my_mailslot = NULL; - struct nbt_ntlogon_packet packet; - struct nbt_ntlogon_sam_logon *s; + struct nbt_netlogon_packet packet; + struct NETLOGON_SAM_LOGON_REQUEST *s; enum ndr_err_code ndr_err; DATA_BLOB blob; struct dom_sid my_sid; @@ -164,7 +164,7 @@ bool send_getdc_request(TALLOC_CTX *mem_ctx, return false; } - packet.command = NTLOGON_SAM_LOGON; + packet.command = LOGON_SAM_LOGON_REQUEST; s = &packet.req.logon; s->request_count = 0; @@ -178,11 +178,11 @@ bool send_getdc_request(TALLOC_CTX *mem_ctx, s->lm20_token = 0xffff; if (DEBUGLEVEL >= 10) { - NDR_PRINT_DEBUG(nbt_ntlogon_packet, &packet); + NDR_PRINT_DEBUG(nbt_netlogon_packet, &packet); } ndr_err = ndr_push_struct_blob(&blob, mem_ctx, NULL, &packet, - (ndr_push_flags_fn_t)ndr_push_nbt_ntlogon_packet); + (ndr_push_flags_fn_t)ndr_push_nbt_netlogon_packet); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { return false; } @@ -199,15 +199,16 @@ bool receive_getdc_response(TALLOC_CTX *mem_ctx, const char *domain_name, uint32_t *nt_version, const char **dc_name, - union nbt_cldap_netlogon **reply) + struct netlogon_samlogon_response **_r) { struct packet_struct *packet; const char *my_mailslot = NULL; struct in_addr dc_ip; DATA_BLOB blob; - union nbt_cldap_netlogon r; + struct netlogon_samlogon_response r; union dgram_message_body p; enum ndr_err_code ndr_err; + NTSTATUS status; const char *returned_dc = NULL; const char *returned_domain = NULL; @@ -266,66 +267,20 @@ bool receive_getdc_response(TALLOC_CTX *mem_ctx, blob = p.smb.body.trans.data; - if (!pull_mailslot_cldap_reply(mem_ctx, &blob, - &r, nt_version)) - { + ZERO_STRUCT(r); + + status = pull_netlogon_samlogon_response(&blob, mem_ctx, NULL, &r); + if (!NT_STATUS_IS_OK(status)) { return false; } - switch (*nt_version) { - case 1: - case 16: - case 17: - - returned_domain = r.logon1.domain_name; - returned_dc = r.logon1.pdc_name; - break; - case 2: - case 3: - case 18: - case 19: - returned_domain = r.logon3.domain_name; - returned_dc = r.logon3.pdc_name; - break; - case 4: - case 5: - case 6: - case 7: - returned_domain = r.logon5.domain; - returned_dc = r.logon5.pdc_name; - break; - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - returned_domain = r.logon13.domain; - returned_dc = r.logon13.pdc_name; - break; - case 20: - case 21: - case 22: - case 23: - case 24: - case 25: - case 26: - case 27: - case 28: - returned_domain = r.logon15.domain; - returned_dc = r.logon15.pdc_name; - break; - case 29: - case 30: - case 31: - returned_domain = r.logon29.domain; - returned_dc = r.logon29.pdc_name; - break; - default: - return false; - } + map_netlogon_samlogon_response(&r); + + /* do we still need this ? */ + *nt_version = r.ntver; + + returned_domain = r.nt5_ex.domain; + returned_dc = r.nt5_ex.pdc_name; if (!strequal(returned_domain, domain_name)) { DEBUG(3, ("GetDC: Expected domain %s, got %s\n", @@ -341,10 +296,10 @@ bool receive_getdc_response(TALLOC_CTX *mem_ctx, if (**dc_name == '\\') *dc_name += 1; if (**dc_name == '\\') *dc_name += 1; - if (reply) { - *reply = (union nbt_cldap_netlogon *)talloc_memdup( - mem_ctx, &r, sizeof(union nbt_cldap_netlogon)); - if (!*reply) { + if (_r) { + *_r = (struct netlogon_samlogon_response *)talloc_memdup( + mem_ctx, &r, sizeof(struct netlogon_samlogon_response)); + if (!*_r) { return false; } } diff --git a/source3/libsmb/dsgetdcname.c b/source3/libsmb/dsgetdcname.c index 4cc587c58d..a543e073bc 100644 --- a/source3/libsmb/dsgetdcname.c +++ b/source3/libsmb/dsgetdcname.c @@ -35,8 +35,7 @@ struct ip_service_name { static NTSTATUS make_dc_info_from_cldap_reply(TALLOC_CTX *mem_ctx, uint32_t flags, struct sockaddr_storage *ss, - uint32_t nt_version, - union nbt_cldap_netlogon *r, + struct netlogon_samlogon_response *r, struct netr_DsRGetDCNameInfo **info); /**************************************************************** @@ -186,173 +185,46 @@ static NTSTATUS dsgetdcname_cache_store(TALLOC_CTX *mem_ctx, /**************************************************************** ****************************************************************/ -#define SET_STRING(x) \ - talloc_strdup(mem_ctx, x); \ - NT_STATUS_HAVE_NO_MEMORY(x); - -static NTSTATUS map_logon29_from_cldap_reply(TALLOC_CTX *mem_ctx, - uint32_t flags, - struct sockaddr_storage *ss, - uint32_t nt_version, - union nbt_cldap_netlogon *r, - struct nbt_cldap_netlogon_29 *p) -{ - char addr[INET6_ADDRSTRLEN]; - - ZERO_STRUCTP(p); - - print_sockaddr(addr, sizeof(addr), ss); - - /* FIXME */ - p->dc_sock_addr_size = 0x10; /* the w32 winsock addr size */ - p->dc_sock_addr.family = 2; /* AF_INET */ - p->dc_sock_addr.pdc_ip = talloc_strdup(mem_ctx, addr); - - switch (nt_version & 0x0000001f) { - case 0: - return NT_STATUS_INVALID_PARAMETER; - case 1: - case 16: - case 17: - p->pdc_name = SET_STRING(r->logon1.pdc_name); - p->domain = SET_STRING(r->logon1.domain_name); - - if (flags & DS_PDC_REQUIRED) { - p->server_type = NBT_SERVER_WRITABLE | - NBT_SERVER_PDC; - } - break; - case 2: - case 3: - case 18: - case 19: - p->pdc_name = SET_STRING(r->logon3.pdc_name); - p->domain = SET_STRING(r->logon3.domain_name); - p->pdc_dns_name = SET_STRING(r->logon3.pdc_dns_name); - p->dns_domain = SET_STRING(r->logon3.dns_domain); - p->server_type = r->logon3.server_type; - p->forest = SET_STRING(r->logon3.forest); - p->domain_uuid = r->logon3.domain_uuid; - - break; - case 4: - case 5: - case 6: - case 7: - p->pdc_name = SET_STRING(r->logon5.pdc_name); - p->domain = SET_STRING(r->logon5.domain); - p->pdc_dns_name = SET_STRING(r->logon5.pdc_dns_name); - p->dns_domain = SET_STRING(r->logon5.dns_domain); - p->server_type = r->logon5.server_type; - p->forest = SET_STRING(r->logon5.forest); - p->domain_uuid = r->logon5.domain_uuid; - p->server_site = SET_STRING(r->logon5.server_site); - p->client_site = SET_STRING(r->logon5.client_site); - - break; - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - p->pdc_name = SET_STRING(r->logon13.pdc_name); - p->domain = SET_STRING(r->logon13.domain); - p->pdc_dns_name = SET_STRING(r->logon13.pdc_dns_name); - p->dns_domain = SET_STRING(r->logon13.dns_domain); - p->server_type = r->logon13.server_type; - p->forest = SET_STRING(r->logon13.forest); - p->domain_uuid = r->logon13.domain_uuid; - p->server_site = SET_STRING(r->logon13.server_site); - p->client_site = SET_STRING(r->logon13.client_site); - - break; - case 20: - case 21: - case 22: - case 23: - case 24: - case 25: - case 26: - case 27: - case 28: - p->pdc_name = SET_STRING(r->logon15.pdc_name); - p->domain = SET_STRING(r->logon15.domain); - p->pdc_dns_name = SET_STRING(r->logon15.pdc_dns_name); - p->dns_domain = SET_STRING(r->logon15.dns_domain); - p->server_type = r->logon15.server_type; - p->forest = SET_STRING(r->logon15.forest); - p->domain_uuid = r->logon15.domain_uuid; - p->server_site = SET_STRING(r->logon15.server_site); - p->client_site = SET_STRING(r->logon15.client_site); - - break; - case 29: - case 30: - case 31: - p->pdc_name = SET_STRING(r->logon29.pdc_name); - p->domain = SET_STRING(r->logon29.domain); - p->pdc_dns_name = SET_STRING(r->logon29.pdc_dns_name); - p->dns_domain = SET_STRING(r->logon29.dns_domain); - p->server_type = r->logon29.server_type; - p->forest = SET_STRING(r->logon29.forest); - p->domain_uuid = r->logon29.domain_uuid; - p->server_site = SET_STRING(r->logon29.server_site); - p->client_site = SET_STRING(r->logon29.client_site); - p->next_closest_site = SET_STRING(r->logon29.next_closest_site); - - break; - default: - return NT_STATUS_INVALID_PARAMETER; - } - - return NT_STATUS_OK; -} - -/**************************************************************** -****************************************************************/ - static NTSTATUS store_cldap_reply(TALLOC_CTX *mem_ctx, uint32_t flags, struct sockaddr_storage *ss, uint32_t nt_version, - union nbt_cldap_netlogon *r) + struct NETLOGON_SAM_LOGON_RESPONSE_EX *r) { DATA_BLOB blob; enum ndr_err_code ndr_err; NTSTATUS status; - struct nbt_cldap_netlogon_29 logon29; + char addr[INET6_ADDRSTRLEN]; - status = map_logon29_from_cldap_reply(mem_ctx, flags, ss, - nt_version, r, &logon29); - if (!NT_STATUS_IS_OK(status)) { - return status; - } + print_sockaddr(addr, sizeof(addr), ss); + + /* FIXME */ + r->sockaddr_size = 0x10; /* the w32 winsock addr size */ + r->sockaddr.sa_family = 2; /* AF_INET */ + r->sockaddr.pdc_ip = talloc_strdup(mem_ctx, addr); - ndr_err = ndr_push_struct_blob(&blob, mem_ctx, NULL, &logon29, - (ndr_push_flags_fn_t)ndr_push_nbt_cldap_netlogon_29); + ndr_err = ndr_push_struct_blob(&blob, mem_ctx, NULL, r, + (ndr_push_flags_fn_t)ndr_push_NETLOGON_SAM_LOGON_RESPONSE_EX); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { return ndr_map_error2ntstatus(ndr_err); } - if (logon29.domain) { - status = dsgetdcname_cache_store(mem_ctx, logon29.domain, &blob); + if (r->domain) { + status = dsgetdcname_cache_store(mem_ctx, r->domain, &blob); if (!NT_STATUS_IS_OK(status)) { goto done; } - if (logon29.client_site) { - sitename_store(logon29.domain, logon29.client_site); + if (r->client_site) { + sitename_store(r->domain, r->client_site); } } - if (logon29.dns_domain) { - status = dsgetdcname_cache_store(mem_ctx, logon29.dns_domain, &blob); + if (r->dns_domain) { + status = dsgetdcname_cache_store(mem_ctx, r->dns_domain, &blob); if (!NT_STATUS_IS_OK(status)) { goto done; } - if (logon29.client_site) { - sitename_store(logon29.dns_domain, logon29.client_site); + if (r->client_site) { + sitename_store(r->dns_domain, r->client_site); } } @@ -387,7 +259,7 @@ static NTSTATUS dsgetdcname_cache_refresh(TALLOC_CTX *mem_ctx, /**************************************************************** ****************************************************************/ -static uint32_t get_cldap_reply_server_flags(union nbt_cldap_netlogon *r, +static uint32_t get_cldap_reply_server_flags(struct netlogon_samlogon_response *r, uint32_t nt_version) { switch (nt_version & 0x0000001f) { @@ -400,12 +272,12 @@ static uint32_t get_cldap_reply_server_flags(union nbt_cldap_netlogon *r, case 3: case 18: case 19: - return r->logon3.server_type; + return r->nt5.server_type; case 4: case 5: case 6: case 7: - return r->logon5.server_type; + return r->nt5_ex.server_type; case 8: case 9: case 10: @@ -414,7 +286,7 @@ static uint32_t get_cldap_reply_server_flags(union nbt_cldap_netlogon *r, case 13: case 14: case 15: - return r->logon13.server_type; + return r->nt5_ex.server_type; case 20: case 21: case 22: @@ -424,11 +296,11 @@ static uint32_t get_cldap_reply_server_flags(union nbt_cldap_netlogon *r, case 26: case 27: case 28: - return r->logon15.server_type; + return r->nt5_ex.server_type; case 29: case 30: case 31: - return r->logon29.server_type; + return r->nt5_ex.server_type; default: return 0; } @@ -486,8 +358,8 @@ static NTSTATUS dsgetdcname_cache_fetch(TALLOC_CTX *mem_ctx, DATA_BLOB blob; enum ndr_err_code ndr_err; struct netr_DsRGetDCNameInfo *info; - union nbt_cldap_netlogon p; - struct nbt_cldap_netlogon_29 r; + struct netlogon_samlogon_response p; + struct NETLOGON_SAM_LOGON_RESPONSE_EX r; NTSTATUS status; if (!gencache_init()) { @@ -509,7 +381,7 @@ static NTSTATUS dsgetdcname_cache_fetch(TALLOC_CTX *mem_ctx, } ndr_err = ndr_pull_struct_blob(&blob, mem_ctx, NULL, &r, - (ndr_pull_flags_fn_t)ndr_pull_nbt_cldap_netlogon_29); + (ndr_pull_flags_fn_t)ndr_pull_NETLOGON_SAM_LOGON_RESPONSE_EX); data_blob_free(&blob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -517,10 +389,9 @@ static NTSTATUS dsgetdcname_cache_fetch(TALLOC_CTX *mem_ctx, return ndr_map_error2ntstatus(ndr_err); } - p.logon29 = r; + p.nt5_ex = r; status = make_dc_info_from_cldap_reply(mem_ctx, flags, NULL, - 29, &p, &info); if (!NT_STATUS_IS_OK(status)) { return status; @@ -916,8 +787,7 @@ static void map_dc_and_domain_names(uint32_t flags, static NTSTATUS make_dc_info_from_cldap_reply(TALLOC_CTX *mem_ctx, uint32_t flags, struct sockaddr_storage *ss, - uint32_t nt_version, - union nbt_cldap_netlogon *r, + struct netlogon_samlogon_response *r, struct netr_DsRGetDCNameInfo **info) { const char *dc_hostname = NULL; @@ -938,19 +808,19 @@ static NTSTATUS make_dc_info_from_cldap_reply(TALLOC_CTX *mem_ctx, dc_address_type = DS_ADDRESS_TYPE_INET; } - switch (nt_version & 0x0000001f) { + switch (r->ntver & 0x0000001f) { case 0: case 1: case 16: case 17: if (!ss) { - dc_address = r->logon1.pdc_name; + dc_address = r->nt4.server; dc_address_type = DS_ADDRESS_TYPE_NETBIOS; } map_dc_and_domain_names(flags, - r->logon1.pdc_name, - r->logon1.domain_name, + r->nt4.server, + r->nt4.domain, NULL, NULL, &dc_flags, @@ -966,22 +836,22 @@ static NTSTATUS make_dc_info_from_cldap_reply(TALLOC_CTX *mem_ctx, case 18: case 19: if (!ss) { - dc_address = r->logon3.pdc_ip; + dc_address = r->nt5.pdc_ip; dc_address_type = DS_ADDRESS_TYPE_INET; } map_dc_and_domain_names(flags, - r->logon3.pdc_name, - r->logon3.domain_name, - r->logon3.pdc_dns_name, - r->logon3.dns_domain, + r->nt5.pdc_name, + r->nt5.domain_name, + r->nt5.pdc_dns_name, + r->nt5.dns_domain, &dc_flags, &dc_hostname, &dc_domain_name); - dc_flags |= r->logon3.server_type; - dc_forest = r->logon3.forest; - dc_domain_guid = &r->logon3.domain_uuid; + dc_flags |= r->nt5.server_type; + dc_forest = r->nt5.forest; + dc_domain_guid = &r->nt5.domain_uuid; break; case 4: @@ -989,24 +859,24 @@ static NTSTATUS make_dc_info_from_cldap_reply(TALLOC_CTX *mem_ctx, case 6: case 7: if (!ss) { - dc_address = r->logon5.pdc_name; + dc_address = r->nt5_ex.pdc_name; dc_address_type = DS_ADDRESS_TYPE_NETBIOS; } map_dc_and_domain_names(flags, - r->logon5.pdc_name, - r->logon5.domain, - r->logon5.pdc_dns_name, - r->logon5.dns_domain, + r->nt5_ex.pdc_name, + r->nt5_ex.domain, + r->nt5_ex.pdc_dns_name, + r->nt5_ex.dns_domain, &dc_flags, &dc_hostname, &dc_domain_name); - dc_flags |= r->logon5.server_type; - dc_forest = r->logon5.forest; - dc_domain_guid = &r->logon5.domain_uuid; - dc_server_site = r->logon5.server_site; - dc_client_site = r->logon5.client_site; + dc_flags |= r->nt5_ex.server_type; + dc_forest = r->nt5_ex.forest; + dc_domain_guid = &r->nt5_ex.domain_uuid; + dc_server_site = r->nt5_ex.server_site; + dc_client_site = r->nt5_ex.client_site; break; case 8: @@ -1018,24 +888,24 @@ static NTSTATUS make_dc_info_from_cldap_reply(TALLOC_CTX *mem_ctx, case 14: case 15: if (!ss) { - dc_address = r->logon13.dc_sock_addr.pdc_ip; + dc_address = r->nt5_ex.sockaddr.pdc_ip; dc_address_type = DS_ADDRESS_TYPE_INET; } map_dc_and_domain_names(flags, - r->logon13.pdc_name, - r->logon13.domain, - r->logon13.pdc_dns_name, - r->logon13.dns_domain, + r->nt5_ex.pdc_name, + r->nt5_ex.domain, + r->nt5_ex.pdc_dns_name, + r->nt5_ex.dns_domain, &dc_flags, &dc_hostname, &dc_domain_name); - dc_flags |= r->logon13.server_type; - dc_forest = r->logon13.forest; - dc_domain_guid = &r->logon13.domain_uuid; - dc_server_site = r->logon13.server_site; - dc_client_site = r->logon13.client_site; + dc_flags |= r->nt5_ex.server_type; + dc_forest = r->nt5_ex.forest; + dc_domain_guid = &r->nt5_ex.domain_uuid; + dc_server_site = r->nt5_ex.server_site; + dc_client_site = r->nt5_ex.client_site; break; case 20: @@ -1048,48 +918,48 @@ static NTSTATUS make_dc_info_from_cldap_reply(TALLOC_CTX *mem_ctx, case 27: case 28: if (!ss) { - dc_address = r->logon15.pdc_name; + dc_address = r->nt5_ex.pdc_name; dc_address_type = DS_ADDRESS_TYPE_NETBIOS; } map_dc_and_domain_names(flags, - r->logon15.pdc_name, - r->logon15.domain, - r->logon15.pdc_dns_name, - r->logon15.dns_domain, + r->nt5_ex.pdc_name, + r->nt5_ex.domain, + r->nt5_ex.pdc_dns_name, + r->nt5_ex.dns_domain, &dc_flags, &dc_hostname, &dc_domain_name); - dc_flags |= r->logon15.server_type; - dc_forest = r->logon15.forest; - dc_domain_guid = &r->logon15.domain_uuid; - dc_server_site = r->logon15.server_site; - dc_client_site = r->logon15.client_site; + dc_flags |= r->nt5_ex.server_type; + dc_forest = r->nt5_ex.forest; + dc_domain_guid = &r->nt5_ex.domain_uuid; + dc_server_site = r->nt5_ex.server_site; + dc_client_site = r->nt5_ex.client_site; break; case 29: case 30: case 31: if (!ss) { - dc_address = r->logon29.dc_sock_addr.pdc_ip; + dc_address = r->nt5_ex.sockaddr.pdc_ip; dc_address_type = DS_ADDRESS_TYPE_INET; } map_dc_and_domain_names(flags, - r->logon29.pdc_name, - r->logon29.domain, - r->logon29.pdc_dns_name, - r->logon29.dns_domain, + r->nt5_ex.pdc_name, + r->nt5_ex.domain, + r->nt5_ex.pdc_dns_name, + r->nt5_ex.dns_domain, &dc_flags, &dc_hostname, &dc_domain_name); - dc_flags |= r->logon29.server_type; - dc_forest = r->logon29.forest; - dc_domain_guid = &r->logon29.domain_uuid; - dc_server_site = r->logon29.server_site; - dc_client_site = r->logon29.client_site; + dc_flags |= r->nt5_ex.server_type; + dc_forest = r->nt5_ex.forest; + dc_domain_guid = &r->nt5_ex.domain_uuid; + dc_server_site = r->nt5_ex.server_site; + dc_client_site = r->nt5_ex.client_site; break; default: @@ -1147,7 +1017,7 @@ static NTSTATUS process_dc_dns(TALLOC_CTX *mem_ctx, { int i = 0; bool valid_dc = false; - union nbt_cldap_netlogon *r = NULL; + struct netlogon_samlogon_response *r = NULL; uint32_t nt_version = NETLOGON_NT_VERSION_5 | NETLOGON_NT_VERSION_5EX; uint32_t ret_flags = 0; @@ -1161,9 +1031,10 @@ static NTSTATUS process_dc_dns(TALLOC_CTX *mem_ctx, if (ads_cldap_netlogon(mem_ctx, dclist[i].hostname, domain_name, - &nt_version, + nt_version, &r)) { + nt_version = r->ntver; ret_flags = get_cldap_reply_server_flags(r, nt_version); if (check_cldap_reply_required_flags(ret_flags, flags)) { @@ -1180,10 +1051,10 @@ static NTSTATUS process_dc_dns(TALLOC_CTX *mem_ctx, } status = make_dc_info_from_cldap_reply(mem_ctx, flags, &dclist[i].ss, - nt_version, r, info); + r, info); if (NT_STATUS_IS_OK(status)) { return store_cldap_reply(mem_ctx, flags, &dclist[i].ss, - nt_version, r); + nt_version, &r->nt5_ex); } return status; @@ -1234,7 +1105,7 @@ static NTSTATUS process_dc_netbios(TALLOC_CTX *mem_ctx, int i; const char *dc_name = NULL; fstring tmp_dc_name; - union nbt_cldap_netlogon *r = NULL; + struct netlogon_samlogon_response *r = NULL; bool store_cache = false; uint32_t nt_version = NETLOGON_NT_VERSION_1 | NETLOGON_NT_VERSION_5 | @@ -1288,9 +1159,9 @@ static NTSTATUS process_dc_netbios(TALLOC_CTX *mem_ctx, &dclist[i].ss, tmp_dc_name)) { - struct nbt_cldap_netlogon_1 logon1; + struct NETLOGON_SAM_LOGON_RESPONSE_NT40 logon1; - r = TALLOC_ZERO_P(mem_ctx, union nbt_cldap_netlogon); + r = TALLOC_ZERO_P(mem_ctx, struct netlogon_samlogon_response); NT_STATUS_HAVE_NO_MEMORY(r); ZERO_STRUCT(logon1); @@ -1298,11 +1169,12 @@ static NTSTATUS process_dc_netbios(TALLOC_CTX *mem_ctx, nt_version = NETLOGON_NT_VERSION_1; logon1.nt_version = nt_version; - logon1.pdc_name = tmp_dc_name; - logon1.domain_name = talloc_strdup_upper(mem_ctx, domain_name); - NT_STATUS_HAVE_NO_MEMORY(logon1.domain_name); + logon1.server = tmp_dc_name; + logon1.domain = talloc_strdup_upper(mem_ctx, domain_name); + NT_STATUS_HAVE_NO_MEMORY(logon1.domain); - r->logon1 = logon1; + r->nt4 = logon1; + r->ntver = nt_version; namecache_store(tmp_dc_name, NBT_NAME_SERVER, 1, &ip_list); @@ -1315,10 +1187,10 @@ static NTSTATUS process_dc_netbios(TALLOC_CTX *mem_ctx, make_reply: status = make_dc_info_from_cldap_reply(mem_ctx, flags, &dclist[i].ss, - nt_version, r, info); + r, info); if (NT_STATUS_IS_OK(status) && store_cache) { return store_cldap_reply(mem_ctx, flags, &dclist[i].ss, - nt_version, r); + nt_version, &r->nt5_ex); } return status; diff --git a/source3/samba4.mk b/source3/samba4.mk index 2646b12a0d..28bdf029f8 100644 --- a/source3/samba4.mk +++ b/source3/samba4.mk @@ -107,6 +107,7 @@ ntvfssrcdir := $(samba4srcdir)/ntvfs ntptrsrcdir := $(samba4srcdir)/ntptr clientsrcdir := $(samba4srcdir)/client libclisrcdir := $(samba4srcdir)/libcli +libclinbtsrcdir := $(samba4srcdir)/../libcli pyscriptsrcdir := $(samba4srcdir)/scripting/python kdcsrcdir := $(samba4srcdir)/kdc smbreadlinesrcdir := $(samba4srcdir)/lib/smbreadline diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c index 7dbe518c3d..1ef4c152a3 100644 --- a/source3/utils/net_ads.c +++ b/source3/utils/net_ads.c @@ -43,7 +43,7 @@ static const char *assume_own_realm(struct net_context *c) static int net_ads_cldap_netlogon(struct net_context *c, ADS_STRUCT *ads) { char addr[INET6_ADDRSTRLEN]; - struct nbt_cldap_netlogon_5 reply; + struct NETLOGON_SAM_LOGON_RESPONSE_EX reply; print_sockaddr(addr, sizeof(addr), &ads->ldap.ss); if ( !ads_cldap_netlogon_5(talloc_tos(), addr, ads->server.realm, &reply ) ) { @@ -55,7 +55,7 @@ static int net_ads_cldap_netlogon(struct net_context *c, ADS_STRUCT *ads) addr); d_printf("Response Type: "); - switch (reply.type) { + switch (reply.command) { case SAMLOGON_AD_UNK_R: d_printf("SAMLOGON\n"); break; @@ -63,7 +63,7 @@ static int net_ads_cldap_netlogon(struct net_context *c, ADS_STRUCT *ads) d_printf("SAMLOGON_USER\n"); break; default: - d_printf("0x%x\n", reply.type); + d_printf("0x%x\n", reply.command); break; } @@ -359,7 +359,7 @@ static int net_ads_workgroup(struct net_context *c, int argc, const char **argv) { ADS_STRUCT *ads; char addr[INET6_ADDRSTRLEN]; - struct nbt_cldap_netlogon_5 reply; + struct NETLOGON_SAM_LOGON_RESPONSE_EX reply; if (c->display_usage) { d_printf("Usage:\n" diff --git a/source3/winbindd/idmap_adex/gc_util.c b/source3/winbindd/idmap_adex/gc_util.c index 87dd3c058d..6dc02336d5 100644 --- a/source3/winbindd/idmap_adex/gc_util.c +++ b/source3/winbindd/idmap_adex/gc_util.c @@ -101,7 +101,7 @@ done: ADS_STRUCT *ads = NULL; ADS_STATUS ads_status; NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL; - struct nbt_cldap_netlogon_5 cldap_reply; + struct NETLOGON_SAM_LOGON_RESPONSE_EX cldap_reply; TALLOC_CTX *frame = talloc_stackframe(); if (!gc || !domain) { diff --git a/source3/winbindd/idmap_adex/idmap_adex.c b/source3/winbindd/idmap_adex/idmap_adex.c index 23ab843e95..7596b1cbd8 100644 --- a/source3/winbindd/idmap_adex/idmap_adex.c +++ b/source3/winbindd/idmap_adex/idmap_adex.c @@ -454,7 +454,7 @@ NTSTATUS idmap_adex_init(void) return NT_STATUS_OK; } -NTSTATUS nss_info_adex_init(void) +static NTSTATUS nss_info_adex_init(void) { return idmap_adex_init(); } diff --git a/source3/winbindd/idmap_adex/idmap_adex.h b/source3/winbindd/idmap_adex/idmap_adex.h index f91bba8d07..e068d5c340 100644 --- a/source3/winbindd/idmap_adex/idmap_adex.h +++ b/source3/winbindd/idmap_adex/idmap_adex.h @@ -167,7 +167,7 @@ struct likewise_cell *cell_list_head(void); bool cell_list_add(struct likewise_cell *cell); bool cell_list_remove(struct likewise_cell * cell); -void cell_list_destroy(); +void cell_list_destroy(void); void cell_destroy(struct likewise_cell *c); void cell_set_forest_searches(struct likewise_cell *c, bool search); diff --git a/source4/Makefile b/source4/Makefile index 2a267c3e7b..11057ae5f3 100644 --- a/source4/Makefile +++ b/source4/Makefile @@ -97,6 +97,7 @@ ntvfssrcdir := ntvfs ntptrsrcdir := ntptr librpcsrcdir := librpc libclisrcdir := libcli +libclinbtsrcdir := ../libcli pyscriptsrcdir := $(srcdir)/scripting/python kdcsrcdir := kdc ntp_signdsrcdir := ntp_signd diff --git a/source4/libcli/config.mk b/source4/libcli/config.mk index 1a7dcdeec1..2f81d7cff0 100644 --- a/source4/libcli/config.mk +++ b/source4/libcli/config.mk @@ -40,15 +40,15 @@ $(eval $(call proto_header_template,$(libclisrcdir)/smb_composite/proto.h,$(LIBC [SUBSYSTEM::NDR_NBT_BUF] -NDR_NBT_BUF_OBJ_FILES = ../$(libclisrcdir)/nbt/nbtname.o +NDR_NBT_BUF_OBJ_FILES = $(libclinbtsrcdir)/nbt/nbtname.o -$(eval $(call proto_header_template,../$(libclisrcdir)/nbt/nbtname.h,$(NDR_NBT_BUF_OBJ_FILES:.o=.c))) +$(eval $(call proto_header_template,$(libclinbtsrcdir)/nbt/nbtname.h,$(NDR_NBT_BUF_OBJ_FILES:.o=.c))) [SUBSYSTEM::LIBCLI_NBT] PUBLIC_DEPENDENCIES = LIBNDR NDR_NBT LIBCLI_COMPOSITE LIBEVENTS \ NDR_SECURITY samba-socket LIBSAMBA-UTIL -LIBCLI_NBT_OBJ_FILES = $(addprefix ../$(libclisrcdir)/nbt/, \ +LIBCLI_NBT_OBJ_FILES = $(addprefix $(libclinbtsrcdir)/nbt/, \ nbtsocket.o \ namequery.o \ nameregister.o \ @@ -59,12 +59,12 @@ LIBCLI_NBT_OBJ_FILES = $(addprefix ../$(libclisrcdir)/nbt/, \ PUBLIC_DEPENDENCIES = LIBNDR \ NDR_SECURITY -LIBCLI_NDR_NETLOGON_OBJ_FILES = $(addprefix ../$(libclisrcdir)/, ndr_netlogon.o) +LIBCLI_NDR_NETLOGON_OBJ_FILES = $(addprefix $(libclinbtsrcdir)/, ndr_netlogon.o) [SUBSYSTEM::LIBCLI_NETLOGON] PUBLIC_DEPENDENCIES = LIBSAMBA-UTIL LIBCLI_NDR_NETLOGON -LIBCLI_NETLOGON_OBJ_FILES = $(addprefix ../$(libclisrcdir)/, \ +LIBCLI_NETLOGON_OBJ_FILES = $(addprefix $(libclinbtsrcdir)/, \ netlogon.o) [SUBSYSTEM::LIBCLI_DRSBLOBS] @@ -79,7 +79,7 @@ $(eval $(call proto_header_template,$(libclisrcdir)/drsblobs_proto.h,$(LIBCLI_DR LIBRARY_REALNAME = samba/netbios.$(SHLIBEXT) PUBLIC_DEPENDENCIES = LIBCLI_NBT DYNCONFIG LIBSAMBA-HOSTCONFIG -python_netbios_OBJ_FILES = ../$(libclisrcdir)/nbt/pynbt.o +python_netbios_OBJ_FILES = $(libclinbtsrcdir)/nbt/pynbt.o $(python_libcli_nbt_OBJ_FILES): CFLAGS+=$(CFLAG_NO_UNUSED_MACROS) $(CFLAG_NO_CAST_QUAL) diff --git a/source4/libcli/smb_composite/sesssetup.c b/source4/libcli/smb_composite/sesssetup.c index 92b49dc3d4..645f5362ac 100644 --- a/source4/libcli/smb_composite/sesssetup.c +++ b/source4/libcli/smb_composite/sesssetup.c @@ -97,6 +97,15 @@ static void request_handler(struct smbcli_request *req) c->status = state->remote_status; state->req = NULL; + /* + * we only need to check the signature if the + * NT_STATUS_OK is returned + */ + if (!NT_STATUS_IS_OK(state->remote_status)) { + talloc_free(check_req); + check_req = NULL; + } + switch (state->setup.old.level) { case RAW_SESSSETUP_OLD: state->io->out.vuid = state->setup.old.out.vuid; |