use unsigned instead of uint32_t for LDB counters.
[Samba/cd1.git] / librpc / gen_ndr / ndr_schannel.c
blob9a2396f04ec230214cf13c7dd6922ab6862a367b
1 /* parser auto-generated by pidl */
3 #include "includes.h"
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) {
34 if (r->sid) {
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)
45 uint32_t _ptr_sid;
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));
74 if (_ptr_sid) {
75 NDR_PULL_ALLOC(ndr, r->sid);
76 } else {
77 r->sid = NULL;
79 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
81 if (ndr_flags & NDR_BUFFERS) {
82 if (r->sid) {
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);
100 ndr->depth++;
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);
111 ndr->depth++;
112 if (r->sid) {
113 ndr_print_dom_sid(ndr, "sid", r->sid);
115 ndr->depth--;
116 ndr->depth--;
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)
129 uint32_t v;
130 NDR_CHECK(ndr_pull_enum_uint32(ndr, NDR_SCALARS, &v));
131 *r = 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;
139 switch (r) {
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)
154 uint32_t v;
155 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
156 *r = 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);
163 ndr->depth++;
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);
169 ndr->depth--;
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));
177 switch (level) {
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;
185 break; }
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;
194 break; }
196 case NL_FLAG_UTF8_DNS_DOMAIN_NAME: {
197 NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->u));
198 break; }
200 case NL_FLAG_UTF8_DNS_HOST_NAME: {
201 NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->u));
202 break; }
204 case NL_FLAG_UTF8_NETBIOS_COMPUTER_NAME: {
205 NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->u));
206 break; }
208 default: {
209 break; }
213 if (ndr_flags & NDR_BUFFERS) {
214 int level = ndr_push_get_switch_value(ndr, r);
215 switch (level) {
216 case NL_FLAG_OEM_NETBIOS_DOMAIN_NAME:
217 break;
219 case NL_FLAG_OEM_NETBIOS_COMPUTER_NAME:
220 break;
222 case NL_FLAG_UTF8_DNS_DOMAIN_NAME:
223 break;
225 case NL_FLAG_UTF8_DNS_HOST_NAME:
226 break;
228 case NL_FLAG_UTF8_NETBIOS_COMPUTER_NAME:
229 break;
231 default:
232 break;
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)
241 int level;
242 level = ndr_pull_get_switch_value(ndr, r);
243 if (ndr_flags & NDR_SCALARS) {
244 NDR_CHECK(ndr_pull_union_align(ndr, 4));
245 switch (level) {
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;
253 break; }
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;
262 break; }
264 case NL_FLAG_UTF8_DNS_DOMAIN_NAME: {
265 NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->u));
266 break; }
268 case NL_FLAG_UTF8_DNS_HOST_NAME: {
269 NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->u));
270 break; }
272 case NL_FLAG_UTF8_NETBIOS_COMPUTER_NAME: {
273 NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->u));
274 break; }
276 default: {
277 break; }
281 if (ndr_flags & NDR_BUFFERS) {
282 switch (level) {
283 case NL_FLAG_OEM_NETBIOS_DOMAIN_NAME:
284 break;
286 case NL_FLAG_OEM_NETBIOS_COMPUTER_NAME:
287 break;
289 case NL_FLAG_UTF8_DNS_DOMAIN_NAME:
290 break;
292 case NL_FLAG_UTF8_DNS_HOST_NAME:
293 break;
295 case NL_FLAG_UTF8_NETBIOS_COMPUTER_NAME:
296 break;
298 default:
299 break;
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));
311 switch (level) {
312 case NL_NEGOTIATE_RESPONSE: {
313 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->dummy));
314 break; }
316 default: {
317 break; }
321 if (ndr_flags & NDR_BUFFERS) {
322 int level = ndr_push_get_switch_value(ndr, r);
323 switch (level) {
324 case NL_NEGOTIATE_RESPONSE:
325 break;
327 default:
328 break;
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)
337 int level;
338 level = ndr_pull_get_switch_value(ndr, r);
339 if (ndr_flags & NDR_SCALARS) {
340 NDR_CHECK(ndr_pull_union_align(ndr, 4));
341 switch (level) {
342 case NL_NEGOTIATE_RESPONSE: {
343 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->dummy));
344 break; }
346 default: {
347 break; }
351 if (ndr_flags & NDR_BUFFERS) {
352 switch (level) {
353 case NL_NEGOTIATE_RESPONSE:
354 break;
356 default:
357 break;
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);
442 ndr->depth++;
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);
457 ndr->depth--;
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)
470 uint16_t v;
471 NDR_CHECK(ndr_pull_enum_uint1632(ndr, NDR_SCALARS, &v));
472 *r = 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;
480 switch (r) {
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)
495 uint16_t v;
496 NDR_CHECK(ndr_pull_enum_uint1632(ndr, NDR_SCALARS, &v));
497 *r = 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;
505 switch (r) {
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);
565 ndr->depth++;
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);
573 ndr->depth--;
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);
630 ndr->depth++;
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);
638 ndr->depth--;
639 ndr->flags = _flags_save_STRUCT;