1 /* parser auto-generated by pidl */
4 #include "../librpc/gen_ndr/ndr_schannel.h"
6 #include "librpc/gen_ndr/ndr_netlogon.h"
7 #include "librpc/gen_ndr/ndr_nbt.h"
8 _PUBLIC_
enum ndr_err_code
ndr_push_netlogon_creds_CredentialState(struct ndr_push
*ndr
, int ndr_flags
, const struct netlogon_creds_CredentialState
*r
)
11 uint32_t _flags_save_STRUCT
= ndr
->flags
;
12 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
13 if (ndr_flags
& NDR_SCALARS
) {
14 NDR_CHECK(ndr_push_align(ndr
, 5));
15 NDR_CHECK(ndr_push_netr_NegotiateFlags(ndr
, NDR_SCALARS
, r
->negotiate_flags
));
16 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->session_key
, 16));
17 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->sequence
));
18 NDR_CHECK(ndr_push_netr_Credential(ndr
, NDR_SCALARS
, &r
->seed
));
19 NDR_CHECK(ndr_push_netr_Credential(ndr
, NDR_SCALARS
, &r
->client
));
20 NDR_CHECK(ndr_push_netr_Credential(ndr
, NDR_SCALARS
, &r
->server
));
21 NDR_CHECK(ndr_push_netr_SchannelType(ndr
, NDR_SCALARS
, r
->secure_channel_type
));
22 NDR_CHECK(ndr_push_uint3264(ndr
, NDR_SCALARS
, ndr_charset_length(r
->computer_name
, CH_UTF8
)));
23 NDR_CHECK(ndr_push_uint3264(ndr
, NDR_SCALARS
, 0));
24 NDR_CHECK(ndr_push_uint3264(ndr
, NDR_SCALARS
, ndr_charset_length(r
->computer_name
, CH_UTF8
)));
25 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->computer_name
, ndr_charset_length(r
->computer_name
, CH_UTF8
), sizeof(uint8_t), CH_UTF8
));
26 NDR_CHECK(ndr_push_uint3264(ndr
, NDR_SCALARS
, ndr_charset_length(r
->account_name
, CH_UTF8
)));
27 NDR_CHECK(ndr_push_uint3264(ndr
, NDR_SCALARS
, 0));
28 NDR_CHECK(ndr_push_uint3264(ndr
, NDR_SCALARS
, ndr_charset_length(r
->account_name
, CH_UTF8
)));
29 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, r
->account_name
, ndr_charset_length(r
->account_name
, CH_UTF8
), sizeof(uint8_t), CH_UTF8
));
30 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->sid
));
31 NDR_CHECK(ndr_push_trailer_align(ndr
, 5));
33 if (ndr_flags
& NDR_BUFFERS
) {
35 NDR_CHECK(ndr_push_dom_sid(ndr
, NDR_SCALARS
, r
->sid
));
38 ndr
->flags
= _flags_save_STRUCT
;
40 return NDR_ERR_SUCCESS
;
43 _PUBLIC_
enum ndr_err_code
ndr_pull_netlogon_creds_CredentialState(struct ndr_pull
*ndr
, int ndr_flags
, struct netlogon_creds_CredentialState
*r
)
46 TALLOC_CTX
*_mem_save_sid_0
;
48 uint32_t _flags_save_STRUCT
= ndr
->flags
;
49 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
50 if (ndr_flags
& NDR_SCALARS
) {
51 NDR_CHECK(ndr_pull_align(ndr
, 5));
52 NDR_CHECK(ndr_pull_netr_NegotiateFlags(ndr
, NDR_SCALARS
, &r
->negotiate_flags
));
53 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->session_key
, 16));
54 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->sequence
));
55 NDR_CHECK(ndr_pull_netr_Credential(ndr
, NDR_SCALARS
, &r
->seed
));
56 NDR_CHECK(ndr_pull_netr_Credential(ndr
, NDR_SCALARS
, &r
->client
));
57 NDR_CHECK(ndr_pull_netr_Credential(ndr
, NDR_SCALARS
, &r
->server
));
58 NDR_CHECK(ndr_pull_netr_SchannelType(ndr
, NDR_SCALARS
, &r
->secure_channel_type
));
59 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->computer_name
));
60 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->computer_name
));
61 if (ndr_get_array_length(ndr
, &r
->computer_name
) > ndr_get_array_size(ndr
, &r
->computer_name
)) {
62 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->computer_name
), ndr_get_array_length(ndr
, &r
->computer_name
));
64 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->computer_name
), sizeof(uint8_t)));
65 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->computer_name
, ndr_get_array_length(ndr
, &r
->computer_name
), sizeof(uint8_t), CH_UTF8
));
66 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->account_name
));
67 NDR_CHECK(ndr_pull_array_length(ndr
, &r
->account_name
));
68 if (ndr_get_array_length(ndr
, &r
->account_name
) > ndr_get_array_size(ndr
, &r
->account_name
)) {
69 return ndr_pull_error(ndr
, NDR_ERR_ARRAY_SIZE
, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr
, &r
->account_name
), ndr_get_array_length(ndr
, &r
->account_name
));
71 NDR_CHECK(ndr_check_string_terminator(ndr
, ndr_get_array_length(ndr
, &r
->account_name
), sizeof(uint8_t)));
72 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->account_name
, ndr_get_array_length(ndr
, &r
->account_name
), sizeof(uint8_t), CH_UTF8
));
73 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_sid
));
75 NDR_PULL_ALLOC(ndr
, r
->sid
);
79 NDR_CHECK(ndr_pull_trailer_align(ndr
, 5));
81 if (ndr_flags
& NDR_BUFFERS
) {
83 _mem_save_sid_0
= NDR_PULL_GET_MEM_CTX(ndr
);
84 NDR_PULL_SET_MEM_CTX(ndr
, r
->sid
, 0);
85 NDR_CHECK(ndr_pull_dom_sid(ndr
, NDR_SCALARS
, r
->sid
));
86 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sid_0
, 0);
89 ndr
->flags
= _flags_save_STRUCT
;
91 return NDR_ERR_SUCCESS
;
94 _PUBLIC_
void ndr_print_netlogon_creds_CredentialState(struct ndr_print
*ndr
, const char *name
, const struct netlogon_creds_CredentialState
*r
)
96 ndr_print_struct(ndr
, name
, "netlogon_creds_CredentialState");
98 uint32_t _flags_save_STRUCT
= ndr
->flags
;
99 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
101 ndr_print_netr_NegotiateFlags(ndr
, "negotiate_flags", r
->negotiate_flags
);
102 ndr_print_array_uint8(ndr
, "session_key", r
->session_key
, 16);
103 ndr_print_uint32(ndr
, "sequence", r
->sequence
);
104 ndr_print_netr_Credential(ndr
, "seed", &r
->seed
);
105 ndr_print_netr_Credential(ndr
, "client", &r
->client
);
106 ndr_print_netr_Credential(ndr
, "server", &r
->server
);
107 ndr_print_netr_SchannelType(ndr
, "secure_channel_type", r
->secure_channel_type
);
108 ndr_print_string(ndr
, "computer_name", r
->computer_name
);
109 ndr_print_string(ndr
, "account_name", r
->account_name
);
110 ndr_print_ptr(ndr
, "sid", r
->sid
);
113 ndr_print_dom_sid(ndr
, "sid", r
->sid
);
117 ndr
->flags
= _flags_save_STRUCT
;
121 static enum ndr_err_code
ndr_push_NL_AUTH_MESSAGE_TYPE(struct ndr_push
*ndr
, int ndr_flags
, enum NL_AUTH_MESSAGE_TYPE r
)
123 NDR_CHECK(ndr_push_enum_uint32(ndr
, NDR_SCALARS
, r
));
124 return NDR_ERR_SUCCESS
;
127 static enum ndr_err_code
ndr_pull_NL_AUTH_MESSAGE_TYPE(struct ndr_pull
*ndr
, int ndr_flags
, enum NL_AUTH_MESSAGE_TYPE
*r
)
130 NDR_CHECK(ndr_pull_enum_uint32(ndr
, NDR_SCALARS
, &v
));
132 return NDR_ERR_SUCCESS
;
135 _PUBLIC_
void ndr_print_NL_AUTH_MESSAGE_TYPE(struct ndr_print
*ndr
, const char *name
, enum NL_AUTH_MESSAGE_TYPE r
)
137 const char *val
= NULL
;
140 case NL_NEGOTIATE_REQUEST
: val
= "NL_NEGOTIATE_REQUEST"; break;
141 case NL_NEGOTIATE_RESPONSE
: val
= "NL_NEGOTIATE_RESPONSE"; break;
143 ndr_print_enum(ndr
, name
, "ENUM", val
, r
);
146 static enum ndr_err_code
ndr_push_NL_AUTH_MESSAGE_FLAGS(struct ndr_push
*ndr
, int ndr_flags
, uint32_t r
)
148 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
));
149 return NDR_ERR_SUCCESS
;
152 static enum ndr_err_code
ndr_pull_NL_AUTH_MESSAGE_FLAGS(struct ndr_pull
*ndr
, int ndr_flags
, uint32_t *r
)
155 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &v
));
157 return NDR_ERR_SUCCESS
;
160 _PUBLIC_
void ndr_print_NL_AUTH_MESSAGE_FLAGS(struct ndr_print
*ndr
, const char *name
, uint32_t r
)
162 ndr_print_uint32(ndr
, name
, r
);
164 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NL_FLAG_OEM_NETBIOS_DOMAIN_NAME", NL_FLAG_OEM_NETBIOS_DOMAIN_NAME
, r
);
165 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NL_FLAG_OEM_NETBIOS_COMPUTER_NAME", NL_FLAG_OEM_NETBIOS_COMPUTER_NAME
, r
);
166 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NL_FLAG_UTF8_DNS_DOMAIN_NAME", NL_FLAG_UTF8_DNS_DOMAIN_NAME
, r
);
167 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NL_FLAG_UTF8_DNS_HOST_NAME", NL_FLAG_UTF8_DNS_HOST_NAME
, r
);
168 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NL_FLAG_UTF8_NETBIOS_COMPUTER_NAME", NL_FLAG_UTF8_NETBIOS_COMPUTER_NAME
, r
);
172 _PUBLIC_
enum ndr_err_code
ndr_push_NL_AUTH_MESSAGE_BUFFER(struct ndr_push
*ndr
, int ndr_flags
, const union NL_AUTH_MESSAGE_BUFFER
*r
)
174 if (ndr_flags
& NDR_SCALARS
) {
175 int level
= ndr_push_get_switch_value(ndr
, r
);
176 NDR_CHECK(ndr_push_union_align(ndr
, 4));
178 case NL_FLAG_OEM_NETBIOS_DOMAIN_NAME
: {
180 uint32_t _flags_save_string
= ndr
->flags
;
181 ndr_set_flags(&ndr
->flags
, LIBNDR_FLAG_STR_ASCII
|LIBNDR_FLAG_STR_NULLTERM
);
182 NDR_CHECK(ndr_push_string(ndr
, NDR_SCALARS
, r
->a
));
183 ndr
->flags
= _flags_save_string
;
187 case NL_FLAG_OEM_NETBIOS_COMPUTER_NAME
: {
189 uint32_t _flags_save_string
= ndr
->flags
;
190 ndr_set_flags(&ndr
->flags
, LIBNDR_FLAG_STR_ASCII
|LIBNDR_FLAG_STR_NULLTERM
);
191 NDR_CHECK(ndr_push_string(ndr
, NDR_SCALARS
, r
->a
));
192 ndr
->flags
= _flags_save_string
;
196 case NL_FLAG_UTF8_DNS_DOMAIN_NAME
: {
197 NDR_CHECK(ndr_push_nbt_string(ndr
, NDR_SCALARS
, r
->u
));
200 case NL_FLAG_UTF8_DNS_HOST_NAME
: {
201 NDR_CHECK(ndr_push_nbt_string(ndr
, NDR_SCALARS
, r
->u
));
204 case NL_FLAG_UTF8_NETBIOS_COMPUTER_NAME
: {
205 NDR_CHECK(ndr_push_nbt_string(ndr
, NDR_SCALARS
, r
->u
));
213 if (ndr_flags
& NDR_BUFFERS
) {
214 int level
= ndr_push_get_switch_value(ndr
, r
);
216 case NL_FLAG_OEM_NETBIOS_DOMAIN_NAME
:
219 case NL_FLAG_OEM_NETBIOS_COMPUTER_NAME
:
222 case NL_FLAG_UTF8_DNS_DOMAIN_NAME
:
225 case NL_FLAG_UTF8_DNS_HOST_NAME
:
228 case NL_FLAG_UTF8_NETBIOS_COMPUTER_NAME
:
236 return NDR_ERR_SUCCESS
;
239 _PUBLIC_
enum ndr_err_code
ndr_pull_NL_AUTH_MESSAGE_BUFFER(struct ndr_pull
*ndr
, int ndr_flags
, union NL_AUTH_MESSAGE_BUFFER
*r
)
242 level
= ndr_pull_get_switch_value(ndr
, r
);
243 if (ndr_flags
& NDR_SCALARS
) {
244 NDR_CHECK(ndr_pull_union_align(ndr
, 4));
246 case NL_FLAG_OEM_NETBIOS_DOMAIN_NAME
: {
248 uint32_t _flags_save_string
= ndr
->flags
;
249 ndr_set_flags(&ndr
->flags
, LIBNDR_FLAG_STR_ASCII
|LIBNDR_FLAG_STR_NULLTERM
);
250 NDR_CHECK(ndr_pull_string(ndr
, NDR_SCALARS
, &r
->a
));
251 ndr
->flags
= _flags_save_string
;
255 case NL_FLAG_OEM_NETBIOS_COMPUTER_NAME
: {
257 uint32_t _flags_save_string
= ndr
->flags
;
258 ndr_set_flags(&ndr
->flags
, LIBNDR_FLAG_STR_ASCII
|LIBNDR_FLAG_STR_NULLTERM
);
259 NDR_CHECK(ndr_pull_string(ndr
, NDR_SCALARS
, &r
->a
));
260 ndr
->flags
= _flags_save_string
;
264 case NL_FLAG_UTF8_DNS_DOMAIN_NAME
: {
265 NDR_CHECK(ndr_pull_nbt_string(ndr
, NDR_SCALARS
, &r
->u
));
268 case NL_FLAG_UTF8_DNS_HOST_NAME
: {
269 NDR_CHECK(ndr_pull_nbt_string(ndr
, NDR_SCALARS
, &r
->u
));
272 case NL_FLAG_UTF8_NETBIOS_COMPUTER_NAME
: {
273 NDR_CHECK(ndr_pull_nbt_string(ndr
, NDR_SCALARS
, &r
->u
));
281 if (ndr_flags
& NDR_BUFFERS
) {
283 case NL_FLAG_OEM_NETBIOS_DOMAIN_NAME
:
286 case NL_FLAG_OEM_NETBIOS_COMPUTER_NAME
:
289 case NL_FLAG_UTF8_DNS_DOMAIN_NAME
:
292 case NL_FLAG_UTF8_DNS_HOST_NAME
:
295 case NL_FLAG_UTF8_NETBIOS_COMPUTER_NAME
:
303 return NDR_ERR_SUCCESS
;
306 _PUBLIC_
enum ndr_err_code
ndr_push_NL_AUTH_MESSAGE_BUFFER_REPLY(struct ndr_push
*ndr
, int ndr_flags
, const union NL_AUTH_MESSAGE_BUFFER_REPLY
*r
)
308 if (ndr_flags
& NDR_SCALARS
) {
309 int level
= ndr_push_get_switch_value(ndr
, r
);
310 NDR_CHECK(ndr_push_union_align(ndr
, 4));
312 case NL_NEGOTIATE_RESPONSE
: {
313 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->dummy
));
321 if (ndr_flags
& NDR_BUFFERS
) {
322 int level
= ndr_push_get_switch_value(ndr
, r
);
324 case NL_NEGOTIATE_RESPONSE
:
332 return NDR_ERR_SUCCESS
;
335 _PUBLIC_
enum ndr_err_code
ndr_pull_NL_AUTH_MESSAGE_BUFFER_REPLY(struct ndr_pull
*ndr
, int ndr_flags
, union NL_AUTH_MESSAGE_BUFFER_REPLY
*r
)
338 level
= ndr_pull_get_switch_value(ndr
, r
);
339 if (ndr_flags
& NDR_SCALARS
) {
340 NDR_CHECK(ndr_pull_union_align(ndr
, 4));
342 case NL_NEGOTIATE_RESPONSE
: {
343 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->dummy
));
351 if (ndr_flags
& NDR_BUFFERS
) {
353 case NL_NEGOTIATE_RESPONSE
:
361 return NDR_ERR_SUCCESS
;
364 _PUBLIC_
enum ndr_err_code
ndr_push_NL_AUTH_MESSAGE(struct ndr_push
*ndr
, int ndr_flags
, const struct NL_AUTH_MESSAGE
*r
)
367 uint32_t _flags_save_STRUCT
= ndr
->flags
;
368 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
369 if (ndr_flags
& NDR_SCALARS
) {
370 NDR_CHECK(ndr_push_align(ndr
, 4));
371 NDR_CHECK(ndr_push_NL_AUTH_MESSAGE_TYPE(ndr
, NDR_SCALARS
, r
->MessageType
));
372 NDR_CHECK(ndr_push_NL_AUTH_MESSAGE_FLAGS(ndr
, NDR_SCALARS
, r
->Flags
));
373 NDR_CHECK(ndr_push_set_switch_value(ndr
, &r
->oem_netbios_domain
, r
->Flags
& NL_FLAG_OEM_NETBIOS_DOMAIN_NAME
));
374 NDR_CHECK(ndr_push_NL_AUTH_MESSAGE_BUFFER(ndr
, NDR_SCALARS
, &r
->oem_netbios_domain
));
375 NDR_CHECK(ndr_push_set_switch_value(ndr
, &r
->oem_netbios_computer
, r
->Flags
& NL_FLAG_OEM_NETBIOS_COMPUTER_NAME
));
376 NDR_CHECK(ndr_push_NL_AUTH_MESSAGE_BUFFER(ndr
, NDR_SCALARS
, &r
->oem_netbios_computer
));
377 NDR_CHECK(ndr_push_set_switch_value(ndr
, &r
->utf8_dns_domain
, r
->Flags
& NL_FLAG_UTF8_DNS_DOMAIN_NAME
));
378 NDR_CHECK(ndr_push_NL_AUTH_MESSAGE_BUFFER(ndr
, NDR_SCALARS
, &r
->utf8_dns_domain
));
379 NDR_CHECK(ndr_push_set_switch_value(ndr
, &r
->utf8_dns_host
, r
->Flags
& NL_FLAG_UTF8_DNS_HOST_NAME
));
380 NDR_CHECK(ndr_push_NL_AUTH_MESSAGE_BUFFER(ndr
, NDR_SCALARS
, &r
->utf8_dns_host
));
381 NDR_CHECK(ndr_push_set_switch_value(ndr
, &r
->utf8_netbios_computer
, r
->Flags
& NL_FLAG_UTF8_NETBIOS_COMPUTER_NAME
));
382 NDR_CHECK(ndr_push_NL_AUTH_MESSAGE_BUFFER(ndr
, NDR_SCALARS
, &r
->utf8_netbios_computer
));
383 NDR_CHECK(ndr_push_set_switch_value(ndr
, &r
->Buffer
, r
->MessageType
& NL_NEGOTIATE_RESPONSE
));
384 NDR_CHECK(ndr_push_NL_AUTH_MESSAGE_BUFFER_REPLY(ndr
, NDR_SCALARS
, &r
->Buffer
));
385 NDR_CHECK(ndr_push_trailer_align(ndr
, 4));
387 if (ndr_flags
& NDR_BUFFERS
) {
388 NDR_CHECK(ndr_push_NL_AUTH_MESSAGE_BUFFER(ndr
, NDR_BUFFERS
, &r
->oem_netbios_domain
));
389 NDR_CHECK(ndr_push_NL_AUTH_MESSAGE_BUFFER(ndr
, NDR_BUFFERS
, &r
->oem_netbios_computer
));
390 NDR_CHECK(ndr_push_NL_AUTH_MESSAGE_BUFFER(ndr
, NDR_BUFFERS
, &r
->utf8_dns_domain
));
391 NDR_CHECK(ndr_push_NL_AUTH_MESSAGE_BUFFER(ndr
, NDR_BUFFERS
, &r
->utf8_dns_host
));
392 NDR_CHECK(ndr_push_NL_AUTH_MESSAGE_BUFFER(ndr
, NDR_BUFFERS
, &r
->utf8_netbios_computer
));
393 NDR_CHECK(ndr_push_NL_AUTH_MESSAGE_BUFFER_REPLY(ndr
, NDR_BUFFERS
, &r
->Buffer
));
395 ndr
->flags
= _flags_save_STRUCT
;
397 return NDR_ERR_SUCCESS
;
400 _PUBLIC_
enum ndr_err_code
ndr_pull_NL_AUTH_MESSAGE(struct ndr_pull
*ndr
, int ndr_flags
, struct NL_AUTH_MESSAGE
*r
)
403 uint32_t _flags_save_STRUCT
= ndr
->flags
;
404 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
405 if (ndr_flags
& NDR_SCALARS
) {
406 NDR_CHECK(ndr_pull_align(ndr
, 4));
407 NDR_CHECK(ndr_pull_NL_AUTH_MESSAGE_TYPE(ndr
, NDR_SCALARS
, &r
->MessageType
));
408 NDR_CHECK(ndr_pull_NL_AUTH_MESSAGE_FLAGS(ndr
, NDR_SCALARS
, &r
->Flags
));
409 NDR_CHECK(ndr_pull_set_switch_value(ndr
, &r
->oem_netbios_domain
, r
->Flags
& NL_FLAG_OEM_NETBIOS_DOMAIN_NAME
));
410 NDR_CHECK(ndr_pull_NL_AUTH_MESSAGE_BUFFER(ndr
, NDR_SCALARS
, &r
->oem_netbios_domain
));
411 NDR_CHECK(ndr_pull_set_switch_value(ndr
, &r
->oem_netbios_computer
, r
->Flags
& NL_FLAG_OEM_NETBIOS_COMPUTER_NAME
));
412 NDR_CHECK(ndr_pull_NL_AUTH_MESSAGE_BUFFER(ndr
, NDR_SCALARS
, &r
->oem_netbios_computer
));
413 NDR_CHECK(ndr_pull_set_switch_value(ndr
, &r
->utf8_dns_domain
, r
->Flags
& NL_FLAG_UTF8_DNS_DOMAIN_NAME
));
414 NDR_CHECK(ndr_pull_NL_AUTH_MESSAGE_BUFFER(ndr
, NDR_SCALARS
, &r
->utf8_dns_domain
));
415 NDR_CHECK(ndr_pull_set_switch_value(ndr
, &r
->utf8_dns_host
, r
->Flags
& NL_FLAG_UTF8_DNS_HOST_NAME
));
416 NDR_CHECK(ndr_pull_NL_AUTH_MESSAGE_BUFFER(ndr
, NDR_SCALARS
, &r
->utf8_dns_host
));
417 NDR_CHECK(ndr_pull_set_switch_value(ndr
, &r
->utf8_netbios_computer
, r
->Flags
& NL_FLAG_UTF8_NETBIOS_COMPUTER_NAME
));
418 NDR_CHECK(ndr_pull_NL_AUTH_MESSAGE_BUFFER(ndr
, NDR_SCALARS
, &r
->utf8_netbios_computer
));
419 NDR_CHECK(ndr_pull_set_switch_value(ndr
, &r
->Buffer
, r
->MessageType
& NL_NEGOTIATE_RESPONSE
));
420 NDR_CHECK(ndr_pull_NL_AUTH_MESSAGE_BUFFER_REPLY(ndr
, NDR_SCALARS
, &r
->Buffer
));
421 NDR_CHECK(ndr_pull_trailer_align(ndr
, 4));
423 if (ndr_flags
& NDR_BUFFERS
) {
424 NDR_CHECK(ndr_pull_NL_AUTH_MESSAGE_BUFFER(ndr
, NDR_BUFFERS
, &r
->oem_netbios_domain
));
425 NDR_CHECK(ndr_pull_NL_AUTH_MESSAGE_BUFFER(ndr
, NDR_BUFFERS
, &r
->oem_netbios_computer
));
426 NDR_CHECK(ndr_pull_NL_AUTH_MESSAGE_BUFFER(ndr
, NDR_BUFFERS
, &r
->utf8_dns_domain
));
427 NDR_CHECK(ndr_pull_NL_AUTH_MESSAGE_BUFFER(ndr
, NDR_BUFFERS
, &r
->utf8_dns_host
));
428 NDR_CHECK(ndr_pull_NL_AUTH_MESSAGE_BUFFER(ndr
, NDR_BUFFERS
, &r
->utf8_netbios_computer
));
429 NDR_CHECK(ndr_pull_NL_AUTH_MESSAGE_BUFFER_REPLY(ndr
, NDR_BUFFERS
, &r
->Buffer
));
431 ndr
->flags
= _flags_save_STRUCT
;
433 return NDR_ERR_SUCCESS
;
436 _PUBLIC_
void ndr_print_NL_AUTH_MESSAGE(struct ndr_print
*ndr
, const char *name
, const struct NL_AUTH_MESSAGE
*r
)
438 ndr_print_struct(ndr
, name
, "NL_AUTH_MESSAGE");
440 uint32_t _flags_save_STRUCT
= ndr
->flags
;
441 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
443 ndr_print_NL_AUTH_MESSAGE_TYPE(ndr
, "MessageType", r
->MessageType
);
444 ndr_print_NL_AUTH_MESSAGE_FLAGS(ndr
, "Flags", r
->Flags
);
445 ndr_print_set_switch_value(ndr
, &r
->oem_netbios_domain
, r
->Flags
& NL_FLAG_OEM_NETBIOS_DOMAIN_NAME
);
446 ndr_print_NL_AUTH_MESSAGE_BUFFER(ndr
, "oem_netbios_domain", &r
->oem_netbios_domain
);
447 ndr_print_set_switch_value(ndr
, &r
->oem_netbios_computer
, r
->Flags
& NL_FLAG_OEM_NETBIOS_COMPUTER_NAME
);
448 ndr_print_NL_AUTH_MESSAGE_BUFFER(ndr
, "oem_netbios_computer", &r
->oem_netbios_computer
);
449 ndr_print_set_switch_value(ndr
, &r
->utf8_dns_domain
, r
->Flags
& NL_FLAG_UTF8_DNS_DOMAIN_NAME
);
450 ndr_print_NL_AUTH_MESSAGE_BUFFER(ndr
, "utf8_dns_domain", &r
->utf8_dns_domain
);
451 ndr_print_set_switch_value(ndr
, &r
->utf8_dns_host
, r
->Flags
& NL_FLAG_UTF8_DNS_HOST_NAME
);
452 ndr_print_NL_AUTH_MESSAGE_BUFFER(ndr
, "utf8_dns_host", &r
->utf8_dns_host
);
453 ndr_print_set_switch_value(ndr
, &r
->utf8_netbios_computer
, r
->Flags
& NL_FLAG_UTF8_NETBIOS_COMPUTER_NAME
);
454 ndr_print_NL_AUTH_MESSAGE_BUFFER(ndr
, "utf8_netbios_computer", &r
->utf8_netbios_computer
);
455 ndr_print_set_switch_value(ndr
, &r
->Buffer
, r
->MessageType
& NL_NEGOTIATE_RESPONSE
);
456 ndr_print_NL_AUTH_MESSAGE_BUFFER_REPLY(ndr
, "Buffer", &r
->Buffer
);
458 ndr
->flags
= _flags_save_STRUCT
;
462 static enum ndr_err_code
ndr_push_NL_SIGNATURE_ALGORITHM(struct ndr_push
*ndr
, int ndr_flags
, enum NL_SIGNATURE_ALGORITHM r
)
464 NDR_CHECK(ndr_push_enum_uint1632(ndr
, NDR_SCALARS
, r
));
465 return NDR_ERR_SUCCESS
;
468 static enum ndr_err_code
ndr_pull_NL_SIGNATURE_ALGORITHM(struct ndr_pull
*ndr
, int ndr_flags
, enum NL_SIGNATURE_ALGORITHM
*r
)
471 NDR_CHECK(ndr_pull_enum_uint1632(ndr
, NDR_SCALARS
, &v
));
473 return NDR_ERR_SUCCESS
;
476 _PUBLIC_
void ndr_print_NL_SIGNATURE_ALGORITHM(struct ndr_print
*ndr
, const char *name
, enum NL_SIGNATURE_ALGORITHM r
)
478 const char *val
= NULL
;
481 case NL_SIGN_HMAC_SHA256
: val
= "NL_SIGN_HMAC_SHA256"; break;
482 case NL_SIGN_HMAC_MD5
: val
= "NL_SIGN_HMAC_MD5"; break;
484 ndr_print_enum(ndr
, name
, "ENUM", val
, r
);
487 static enum ndr_err_code
ndr_push_NL_SEAL_ALGORITHM(struct ndr_push
*ndr
, int ndr_flags
, enum NL_SEAL_ALGORITHM r
)
489 NDR_CHECK(ndr_push_enum_uint1632(ndr
, NDR_SCALARS
, r
));
490 return NDR_ERR_SUCCESS
;
493 static enum ndr_err_code
ndr_pull_NL_SEAL_ALGORITHM(struct ndr_pull
*ndr
, int ndr_flags
, enum NL_SEAL_ALGORITHM
*r
)
496 NDR_CHECK(ndr_pull_enum_uint1632(ndr
, NDR_SCALARS
, &v
));
498 return NDR_ERR_SUCCESS
;
501 _PUBLIC_
void ndr_print_NL_SEAL_ALGORITHM(struct ndr_print
*ndr
, const char *name
, enum NL_SEAL_ALGORITHM r
)
503 const char *val
= NULL
;
506 case NL_SEAL_AES128
: val
= "NL_SEAL_AES128"; break;
507 case NL_SEAL_RC4
: val
= "NL_SEAL_RC4"; break;
508 case NL_SEAL_NONE
: val
= "NL_SEAL_NONE"; break;
510 ndr_print_enum(ndr
, name
, "ENUM", val
, r
);
513 _PUBLIC_
enum ndr_err_code
ndr_push_NL_AUTH_SIGNATURE(struct ndr_push
*ndr
, int ndr_flags
, const struct NL_AUTH_SIGNATURE
*r
)
516 uint32_t _flags_save_STRUCT
= ndr
->flags
;
517 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
518 if (ndr_flags
& NDR_SCALARS
) {
519 NDR_CHECK(ndr_push_align(ndr
, 3));
520 NDR_CHECK(ndr_push_NL_SIGNATURE_ALGORITHM(ndr
, NDR_SCALARS
, NL_SIGN_HMAC_MD5
));
521 NDR_CHECK(ndr_push_NL_SEAL_ALGORITHM(ndr
, NDR_SCALARS
, r
->SealAlgorithm
));
522 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->Pad
));
523 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->Flags
));
524 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->SequenceNumber
, 8));
525 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->Checksum
, 8));
526 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->Confounder
, 8));
527 NDR_CHECK(ndr_push_trailer_align(ndr
, 3));
529 if (ndr_flags
& NDR_BUFFERS
) {
531 ndr
->flags
= _flags_save_STRUCT
;
533 return NDR_ERR_SUCCESS
;
536 _PUBLIC_
enum ndr_err_code
ndr_pull_NL_AUTH_SIGNATURE(struct ndr_pull
*ndr
, int ndr_flags
, struct NL_AUTH_SIGNATURE
*r
)
539 uint32_t _flags_save_STRUCT
= ndr
->flags
;
540 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
541 if (ndr_flags
& NDR_SCALARS
) {
542 NDR_CHECK(ndr_pull_align(ndr
, 3));
543 NDR_CHECK(ndr_pull_NL_SIGNATURE_ALGORITHM(ndr
, NDR_SCALARS
, &r
->SignatureAlgorithm
));
544 NDR_CHECK(ndr_pull_NL_SEAL_ALGORITHM(ndr
, NDR_SCALARS
, &r
->SealAlgorithm
));
545 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->Pad
));
546 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->Flags
));
547 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->SequenceNumber
, 8));
548 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->Checksum
, 8));
549 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->Confounder
, 8));
550 NDR_CHECK(ndr_pull_trailer_align(ndr
, 3));
552 if (ndr_flags
& NDR_BUFFERS
) {
554 ndr
->flags
= _flags_save_STRUCT
;
556 return NDR_ERR_SUCCESS
;
559 _PUBLIC_
void ndr_print_NL_AUTH_SIGNATURE(struct ndr_print
*ndr
, const char *name
, const struct NL_AUTH_SIGNATURE
*r
)
561 ndr_print_struct(ndr
, name
, "NL_AUTH_SIGNATURE");
563 uint32_t _flags_save_STRUCT
= ndr
->flags
;
564 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
566 ndr_print_NL_SIGNATURE_ALGORITHM(ndr
, "SignatureAlgorithm", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?NL_SIGN_HMAC_MD5
:r
->SignatureAlgorithm
);
567 ndr_print_NL_SEAL_ALGORITHM(ndr
, "SealAlgorithm", r
->SealAlgorithm
);
568 ndr_print_uint16(ndr
, "Pad", r
->Pad
);
569 ndr_print_uint16(ndr
, "Flags", r
->Flags
);
570 ndr_print_array_uint8(ndr
, "SequenceNumber", r
->SequenceNumber
, 8);
571 ndr_print_array_uint8(ndr
, "Checksum", r
->Checksum
, 8);
572 ndr_print_array_uint8(ndr
, "Confounder", r
->Confounder
, 8);
574 ndr
->flags
= _flags_save_STRUCT
;
578 _PUBLIC_
enum ndr_err_code
ndr_push_NL_AUTH_SHA2_SIGNATURE(struct ndr_push
*ndr
, int ndr_flags
, const struct NL_AUTH_SHA2_SIGNATURE
*r
)
581 uint32_t _flags_save_STRUCT
= ndr
->flags
;
582 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
583 if (ndr_flags
& NDR_SCALARS
) {
584 NDR_CHECK(ndr_push_align(ndr
, 3));
585 NDR_CHECK(ndr_push_NL_SIGNATURE_ALGORITHM(ndr
, NDR_SCALARS
, NL_SIGN_HMAC_SHA256
));
586 NDR_CHECK(ndr_push_NL_SEAL_ALGORITHM(ndr
, NDR_SCALARS
, r
->SealAlgorithm
));
587 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->Pad
));
588 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->Flags
));
589 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->SequenceNumber
, 8));
590 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->Checksum
, 32));
591 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->Confounder
, 8));
592 NDR_CHECK(ndr_push_trailer_align(ndr
, 3));
594 if (ndr_flags
& NDR_BUFFERS
) {
596 ndr
->flags
= _flags_save_STRUCT
;
598 return NDR_ERR_SUCCESS
;
601 _PUBLIC_
enum ndr_err_code
ndr_pull_NL_AUTH_SHA2_SIGNATURE(struct ndr_pull
*ndr
, int ndr_flags
, struct NL_AUTH_SHA2_SIGNATURE
*r
)
604 uint32_t _flags_save_STRUCT
= ndr
->flags
;
605 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
606 if (ndr_flags
& NDR_SCALARS
) {
607 NDR_CHECK(ndr_pull_align(ndr
, 3));
608 NDR_CHECK(ndr_pull_NL_SIGNATURE_ALGORITHM(ndr
, NDR_SCALARS
, &r
->SignatureAlgorithm
));
609 NDR_CHECK(ndr_pull_NL_SEAL_ALGORITHM(ndr
, NDR_SCALARS
, &r
->SealAlgorithm
));
610 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->Pad
));
611 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->Flags
));
612 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->SequenceNumber
, 8));
613 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->Checksum
, 32));
614 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->Confounder
, 8));
615 NDR_CHECK(ndr_pull_trailer_align(ndr
, 3));
617 if (ndr_flags
& NDR_BUFFERS
) {
619 ndr
->flags
= _flags_save_STRUCT
;
621 return NDR_ERR_SUCCESS
;
624 _PUBLIC_
void ndr_print_NL_AUTH_SHA2_SIGNATURE(struct ndr_print
*ndr
, const char *name
, const struct NL_AUTH_SHA2_SIGNATURE
*r
)
626 ndr_print_struct(ndr
, name
, "NL_AUTH_SHA2_SIGNATURE");
628 uint32_t _flags_save_STRUCT
= ndr
->flags
;
629 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
631 ndr_print_NL_SIGNATURE_ALGORITHM(ndr
, "SignatureAlgorithm", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?NL_SIGN_HMAC_SHA256
:r
->SignatureAlgorithm
);
632 ndr_print_NL_SEAL_ALGORITHM(ndr
, "SealAlgorithm", r
->SealAlgorithm
);
633 ndr_print_uint16(ndr
, "Pad", r
->Pad
);
634 ndr_print_uint16(ndr
, "Flags", r
->Flags
);
635 ndr_print_array_uint8(ndr
, "SequenceNumber", r
->SequenceNumber
, 8);
636 ndr_print_array_uint8(ndr
, "Checksum", r
->Checksum
, 32);
637 ndr_print_array_uint8(ndr
, "Confounder", r
->Confounder
, 8);
639 ndr
->flags
= _flags_save_STRUCT
;