schannel: remove unused schannel structs.
[ira/wip.git] / librpc / gen_ndr / ndr_schannel.c
1 /* parser auto-generated by pidl */
2
3 #include "includes.h"
4 #include "../librpc/gen_ndr/ndr_schannel.h"
5
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)
9 {
10         {
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, 4));
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_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->computer_name, CH_UTF8)));
23                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
24                         NDR_CHECK(ndr_push_uint32(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_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->account_name, CH_UTF8)));
27                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
28                         NDR_CHECK(ndr_push_uint32(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                 }
32                 if (ndr_flags & NDR_BUFFERS) {
33                         if (r->sid) {
34                                 NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->sid));
35                         }
36                 }
37                 ndr->flags = _flags_save_STRUCT;
38         }
39         return NDR_ERR_SUCCESS;
40 }
41
42 _PUBLIC_ enum ndr_err_code ndr_pull_netlogon_creds_CredentialState(struct ndr_pull *ndr, int ndr_flags, struct netlogon_creds_CredentialState *r)
43 {
44         uint32_t _ptr_sid;
45         TALLOC_CTX *_mem_save_sid_0;
46         {
47                 uint32_t _flags_save_STRUCT = ndr->flags;
48                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
49                 if (ndr_flags & NDR_SCALARS) {
50                         NDR_CHECK(ndr_pull_align(ndr, 4));
51                         NDR_CHECK(ndr_pull_netr_NegotiateFlags(ndr, NDR_SCALARS, &r->negotiate_flags));
52                         NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->session_key, 16));
53                         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sequence));
54                         NDR_CHECK(ndr_pull_netr_Credential(ndr, NDR_SCALARS, &r->seed));
55                         NDR_CHECK(ndr_pull_netr_Credential(ndr, NDR_SCALARS, &r->client));
56                         NDR_CHECK(ndr_pull_netr_Credential(ndr, NDR_SCALARS, &r->server));
57                         NDR_CHECK(ndr_pull_netr_SchannelType(ndr, NDR_SCALARS, &r->secure_channel_type));
58                         NDR_CHECK(ndr_pull_array_size(ndr, &r->computer_name));
59                         NDR_CHECK(ndr_pull_array_length(ndr, &r->computer_name));
60                         if (ndr_get_array_length(ndr, &r->computer_name) > ndr_get_array_size(ndr, &r->computer_name)) {
61                                 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));
62                         }
63                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->computer_name), sizeof(uint8_t)));
64                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->computer_name, ndr_get_array_length(ndr, &r->computer_name), sizeof(uint8_t), CH_UTF8));
65                         NDR_CHECK(ndr_pull_array_size(ndr, &r->account_name));
66                         NDR_CHECK(ndr_pull_array_length(ndr, &r->account_name));
67                         if (ndr_get_array_length(ndr, &r->account_name) > ndr_get_array_size(ndr, &r->account_name)) {
68                                 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));
69                         }
70                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->account_name), sizeof(uint8_t)));
71                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->account_name, ndr_get_array_length(ndr, &r->account_name), sizeof(uint8_t), CH_UTF8));
72                         NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sid));
73                         if (_ptr_sid) {
74                                 NDR_PULL_ALLOC(ndr, r->sid);
75                         } else {
76                                 r->sid = NULL;
77                         }
78                 }
79                 if (ndr_flags & NDR_BUFFERS) {
80                         if (r->sid) {
81                                 _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
82                                 NDR_PULL_SET_MEM_CTX(ndr, r->sid, 0);
83                                 NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->sid));
84                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, 0);
85                         }
86                 }
87                 ndr->flags = _flags_save_STRUCT;
88         }
89         return NDR_ERR_SUCCESS;
90 }
91
92 _PUBLIC_ void ndr_print_netlogon_creds_CredentialState(struct ndr_print *ndr, const char *name, const struct netlogon_creds_CredentialState *r)
93 {
94         ndr_print_struct(ndr, name, "netlogon_creds_CredentialState");
95         {
96                 uint32_t _flags_save_STRUCT = ndr->flags;
97                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
98                 ndr->depth++;
99                 ndr_print_netr_NegotiateFlags(ndr, "negotiate_flags", r->negotiate_flags);
100                 ndr_print_array_uint8(ndr, "session_key", r->session_key, 16);
101                 ndr_print_uint32(ndr, "sequence", r->sequence);
102                 ndr_print_netr_Credential(ndr, "seed", &r->seed);
103                 ndr_print_netr_Credential(ndr, "client", &r->client);
104                 ndr_print_netr_Credential(ndr, "server", &r->server);
105                 ndr_print_netr_SchannelType(ndr, "secure_channel_type", r->secure_channel_type);
106                 ndr_print_string(ndr, "computer_name", r->computer_name);
107                 ndr_print_string(ndr, "account_name", r->account_name);
108                 ndr_print_ptr(ndr, "sid", r->sid);
109                 ndr->depth++;
110                 if (r->sid) {
111                         ndr_print_dom_sid(ndr, "sid", r->sid);
112                 }
113                 ndr->depth--;
114                 ndr->depth--;
115                 ndr->flags = _flags_save_STRUCT;
116         }
117 }
118
119 static enum ndr_err_code ndr_push_NL_AUTH_MESSAGE_TYPE(struct ndr_push *ndr, int ndr_flags, enum NL_AUTH_MESSAGE_TYPE r)
120 {
121         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
122         return NDR_ERR_SUCCESS;
123 }
124
125 static enum ndr_err_code ndr_pull_NL_AUTH_MESSAGE_TYPE(struct ndr_pull *ndr, int ndr_flags, enum NL_AUTH_MESSAGE_TYPE *r)
126 {
127         uint32_t v;
128         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
129         *r = v;
130         return NDR_ERR_SUCCESS;
131 }
132
133 _PUBLIC_ void ndr_print_NL_AUTH_MESSAGE_TYPE(struct ndr_print *ndr, const char *name, enum NL_AUTH_MESSAGE_TYPE r)
134 {
135         const char *val = NULL;
136
137         switch (r) {
138                 case NL_NEGOTIATE_REQUEST: val = "NL_NEGOTIATE_REQUEST"; break;
139                 case NL_NEGOTIATE_RESPONSE: val = "NL_NEGOTIATE_RESPONSE"; break;
140         }
141         ndr_print_enum(ndr, name, "ENUM", val, r);
142 }
143
144 static enum ndr_err_code ndr_push_NL_AUTH_MESSAGE_FLAGS(struct ndr_push *ndr, int ndr_flags, uint32_t r)
145 {
146         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
147         return NDR_ERR_SUCCESS;
148 }
149
150 static enum ndr_err_code ndr_pull_NL_AUTH_MESSAGE_FLAGS(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
151 {
152         uint32_t v;
153         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
154         *r = v;
155         return NDR_ERR_SUCCESS;
156 }
157
158 _PUBLIC_ void ndr_print_NL_AUTH_MESSAGE_FLAGS(struct ndr_print *ndr, const char *name, uint32_t r)
159 {
160         ndr_print_uint32(ndr, name, r);
161         ndr->depth++;
162         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NL_FLAG_OEM_NETBIOS_DOMAIN_NAME", NL_FLAG_OEM_NETBIOS_DOMAIN_NAME, r);
163         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NL_FLAG_OEM_NETBIOS_COMPUTER_NAME", NL_FLAG_OEM_NETBIOS_COMPUTER_NAME, r);
164         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NL_FLAG_UTF8_DNS_DOMAIN_NAME", NL_FLAG_UTF8_DNS_DOMAIN_NAME, r);
165         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NL_FLAG_UTF8_DNS_HOST_NAME", NL_FLAG_UTF8_DNS_HOST_NAME, r);
166         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NL_FLAG_UTF8_NETBIOS_COMPUTER_NAME", NL_FLAG_UTF8_NETBIOS_COMPUTER_NAME, r);
167         ndr->depth--;
168 }
169
170 _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)
171 {
172         if (ndr_flags & NDR_SCALARS) {
173                 int level = ndr_push_get_switch_value(ndr, r);
174                 switch (level) {
175                         case NL_FLAG_OEM_NETBIOS_DOMAIN_NAME: {
176                                 {
177                                         uint32_t _flags_save_string = ndr->flags;
178                                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
179                                         NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->a));
180                                         ndr->flags = _flags_save_string;
181                                 }
182                         break; }
183
184                         case NL_FLAG_OEM_NETBIOS_COMPUTER_NAME: {
185                                 {
186                                         uint32_t _flags_save_string = ndr->flags;
187                                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
188                                         NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->a));
189                                         ndr->flags = _flags_save_string;
190                                 }
191                         break; }
192
193                         case NL_FLAG_UTF8_DNS_DOMAIN_NAME: {
194                                 NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->u));
195                         break; }
196
197                         case NL_FLAG_UTF8_DNS_HOST_NAME: {
198                                 NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->u));
199                         break; }
200
201                         case NL_FLAG_UTF8_NETBIOS_COMPUTER_NAME: {
202                                 NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->u));
203                         break; }
204
205                         default: {
206                         break; }
207
208                 }
209         }
210         if (ndr_flags & NDR_BUFFERS) {
211                 int level = ndr_push_get_switch_value(ndr, r);
212                 switch (level) {
213                         case NL_FLAG_OEM_NETBIOS_DOMAIN_NAME:
214                         break;
215
216                         case NL_FLAG_OEM_NETBIOS_COMPUTER_NAME:
217                         break;
218
219                         case NL_FLAG_UTF8_DNS_DOMAIN_NAME:
220                         break;
221
222                         case NL_FLAG_UTF8_DNS_HOST_NAME:
223                         break;
224
225                         case NL_FLAG_UTF8_NETBIOS_COMPUTER_NAME:
226                         break;
227
228                         default:
229                         break;
230
231                 }
232         }
233         return NDR_ERR_SUCCESS;
234 }
235
236 _PUBLIC_ enum ndr_err_code ndr_pull_NL_AUTH_MESSAGE_BUFFER(struct ndr_pull *ndr, int ndr_flags, union NL_AUTH_MESSAGE_BUFFER *r)
237 {
238         int level;
239         level = ndr_pull_get_switch_value(ndr, r);
240         if (ndr_flags & NDR_SCALARS) {
241                 switch (level) {
242                         case NL_FLAG_OEM_NETBIOS_DOMAIN_NAME: {
243                                 {
244                                         uint32_t _flags_save_string = ndr->flags;
245                                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
246                                         NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->a));
247                                         ndr->flags = _flags_save_string;
248                                 }
249                         break; }
250
251                         case NL_FLAG_OEM_NETBIOS_COMPUTER_NAME: {
252                                 {
253                                         uint32_t _flags_save_string = ndr->flags;
254                                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
255                                         NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->a));
256                                         ndr->flags = _flags_save_string;
257                                 }
258                         break; }
259
260                         case NL_FLAG_UTF8_DNS_DOMAIN_NAME: {
261                                 NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->u));
262                         break; }
263
264                         case NL_FLAG_UTF8_DNS_HOST_NAME: {
265                                 NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->u));
266                         break; }
267
268                         case NL_FLAG_UTF8_NETBIOS_COMPUTER_NAME: {
269                                 NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->u));
270                         break; }
271
272                         default: {
273                         break; }
274
275                 }
276         }
277         if (ndr_flags & NDR_BUFFERS) {
278                 switch (level) {
279                         case NL_FLAG_OEM_NETBIOS_DOMAIN_NAME:
280                         break;
281
282                         case NL_FLAG_OEM_NETBIOS_COMPUTER_NAME:
283                         break;
284
285                         case NL_FLAG_UTF8_DNS_DOMAIN_NAME:
286                         break;
287
288                         case NL_FLAG_UTF8_DNS_HOST_NAME:
289                         break;
290
291                         case NL_FLAG_UTF8_NETBIOS_COMPUTER_NAME:
292                         break;
293
294                         default:
295                         break;
296
297                 }
298         }
299         return NDR_ERR_SUCCESS;
300 }
301
302 _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)
303 {
304         if (ndr_flags & NDR_SCALARS) {
305                 int level = ndr_push_get_switch_value(ndr, r);
306                 switch (level) {
307                         case NL_NEGOTIATE_RESPONSE: {
308                                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->dummy));
309                         break; }
310
311                         default: {
312                         break; }
313
314                 }
315         }
316         if (ndr_flags & NDR_BUFFERS) {
317                 int level = ndr_push_get_switch_value(ndr, r);
318                 switch (level) {
319                         case NL_NEGOTIATE_RESPONSE:
320                         break;
321
322                         default:
323                         break;
324
325                 }
326         }
327         return NDR_ERR_SUCCESS;
328 }
329
330 _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)
331 {
332         int level;
333         level = ndr_pull_get_switch_value(ndr, r);
334         if (ndr_flags & NDR_SCALARS) {
335                 switch (level) {
336                         case NL_NEGOTIATE_RESPONSE: {
337                                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->dummy));
338                         break; }
339
340                         default: {
341                         break; }
342
343                 }
344         }
345         if (ndr_flags & NDR_BUFFERS) {
346                 switch (level) {
347                         case NL_NEGOTIATE_RESPONSE:
348                         break;
349
350                         default:
351                         break;
352
353                 }
354         }
355         return NDR_ERR_SUCCESS;
356 }
357
358 _PUBLIC_ enum ndr_err_code ndr_push_NL_AUTH_MESSAGE(struct ndr_push *ndr, int ndr_flags, const struct NL_AUTH_MESSAGE *r)
359 {
360         {
361                 uint32_t _flags_save_STRUCT = ndr->flags;
362                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
363                 if (ndr_flags & NDR_SCALARS) {
364                         NDR_CHECK(ndr_push_align(ndr, 4));
365                         NDR_CHECK(ndr_push_NL_AUTH_MESSAGE_TYPE(ndr, NDR_SCALARS, r->MessageType));
366                         NDR_CHECK(ndr_push_NL_AUTH_MESSAGE_FLAGS(ndr, NDR_SCALARS, r->Flags));
367                         NDR_CHECK(ndr_push_set_switch_value(ndr, &r->oem_netbios_domain, r->Flags & NL_FLAG_OEM_NETBIOS_DOMAIN_NAME));
368                         NDR_CHECK(ndr_push_NL_AUTH_MESSAGE_BUFFER(ndr, NDR_SCALARS, &r->oem_netbios_domain));
369                         NDR_CHECK(ndr_push_set_switch_value(ndr, &r->oem_netbios_computer, r->Flags & NL_FLAG_OEM_NETBIOS_COMPUTER_NAME));
370                         NDR_CHECK(ndr_push_NL_AUTH_MESSAGE_BUFFER(ndr, NDR_SCALARS, &r->oem_netbios_computer));
371                         NDR_CHECK(ndr_push_set_switch_value(ndr, &r->utf8_dns_domain, r->Flags & NL_FLAG_UTF8_DNS_DOMAIN_NAME));
372                         NDR_CHECK(ndr_push_NL_AUTH_MESSAGE_BUFFER(ndr, NDR_SCALARS, &r->utf8_dns_domain));
373                         NDR_CHECK(ndr_push_set_switch_value(ndr, &r->utf8_dns_host, r->Flags & NL_FLAG_UTF8_DNS_HOST_NAME));
374                         NDR_CHECK(ndr_push_NL_AUTH_MESSAGE_BUFFER(ndr, NDR_SCALARS, &r->utf8_dns_host));
375                         NDR_CHECK(ndr_push_set_switch_value(ndr, &r->utf8_netbios_computer, r->Flags & NL_FLAG_UTF8_NETBIOS_COMPUTER_NAME));
376                         NDR_CHECK(ndr_push_NL_AUTH_MESSAGE_BUFFER(ndr, NDR_SCALARS, &r->utf8_netbios_computer));
377                         NDR_CHECK(ndr_push_set_switch_value(ndr, &r->Buffer, r->MessageType & NL_NEGOTIATE_RESPONSE));
378                         NDR_CHECK(ndr_push_NL_AUTH_MESSAGE_BUFFER_REPLY(ndr, NDR_SCALARS, &r->Buffer));
379                 }
380                 if (ndr_flags & NDR_BUFFERS) {
381                         NDR_CHECK(ndr_push_NL_AUTH_MESSAGE_BUFFER(ndr, NDR_BUFFERS, &r->oem_netbios_domain));
382                         NDR_CHECK(ndr_push_NL_AUTH_MESSAGE_BUFFER(ndr, NDR_BUFFERS, &r->oem_netbios_computer));
383                         NDR_CHECK(ndr_push_NL_AUTH_MESSAGE_BUFFER(ndr, NDR_BUFFERS, &r->utf8_dns_domain));
384                         NDR_CHECK(ndr_push_NL_AUTH_MESSAGE_BUFFER(ndr, NDR_BUFFERS, &r->utf8_dns_host));
385                         NDR_CHECK(ndr_push_NL_AUTH_MESSAGE_BUFFER(ndr, NDR_BUFFERS, &r->utf8_netbios_computer));
386                         NDR_CHECK(ndr_push_NL_AUTH_MESSAGE_BUFFER_REPLY(ndr, NDR_BUFFERS, &r->Buffer));
387                 }
388                 ndr->flags = _flags_save_STRUCT;
389         }
390         return NDR_ERR_SUCCESS;
391 }
392
393 _PUBLIC_ enum ndr_err_code ndr_pull_NL_AUTH_MESSAGE(struct ndr_pull *ndr, int ndr_flags, struct NL_AUTH_MESSAGE *r)
394 {
395         {
396                 uint32_t _flags_save_STRUCT = ndr->flags;
397                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
398                 if (ndr_flags & NDR_SCALARS) {
399                         NDR_CHECK(ndr_pull_align(ndr, 4));
400                         NDR_CHECK(ndr_pull_NL_AUTH_MESSAGE_TYPE(ndr, NDR_SCALARS, &r->MessageType));
401                         NDR_CHECK(ndr_pull_NL_AUTH_MESSAGE_FLAGS(ndr, NDR_SCALARS, &r->Flags));
402                         NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->oem_netbios_domain, r->Flags & NL_FLAG_OEM_NETBIOS_DOMAIN_NAME));
403                         NDR_CHECK(ndr_pull_NL_AUTH_MESSAGE_BUFFER(ndr, NDR_SCALARS, &r->oem_netbios_domain));
404                         NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->oem_netbios_computer, r->Flags & NL_FLAG_OEM_NETBIOS_COMPUTER_NAME));
405                         NDR_CHECK(ndr_pull_NL_AUTH_MESSAGE_BUFFER(ndr, NDR_SCALARS, &r->oem_netbios_computer));
406                         NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->utf8_dns_domain, r->Flags & NL_FLAG_UTF8_DNS_DOMAIN_NAME));
407                         NDR_CHECK(ndr_pull_NL_AUTH_MESSAGE_BUFFER(ndr, NDR_SCALARS, &r->utf8_dns_domain));
408                         NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->utf8_dns_host, r->Flags & NL_FLAG_UTF8_DNS_HOST_NAME));
409                         NDR_CHECK(ndr_pull_NL_AUTH_MESSAGE_BUFFER(ndr, NDR_SCALARS, &r->utf8_dns_host));
410                         NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->utf8_netbios_computer, r->Flags & NL_FLAG_UTF8_NETBIOS_COMPUTER_NAME));
411                         NDR_CHECK(ndr_pull_NL_AUTH_MESSAGE_BUFFER(ndr, NDR_SCALARS, &r->utf8_netbios_computer));
412                         NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->Buffer, r->MessageType & NL_NEGOTIATE_RESPONSE));
413                         NDR_CHECK(ndr_pull_NL_AUTH_MESSAGE_BUFFER_REPLY(ndr, NDR_SCALARS, &r->Buffer));
414                 }
415                 if (ndr_flags & NDR_BUFFERS) {
416                         NDR_CHECK(ndr_pull_NL_AUTH_MESSAGE_BUFFER(ndr, NDR_BUFFERS, &r->oem_netbios_domain));
417                         NDR_CHECK(ndr_pull_NL_AUTH_MESSAGE_BUFFER(ndr, NDR_BUFFERS, &r->oem_netbios_computer));
418                         NDR_CHECK(ndr_pull_NL_AUTH_MESSAGE_BUFFER(ndr, NDR_BUFFERS, &r->utf8_dns_domain));
419                         NDR_CHECK(ndr_pull_NL_AUTH_MESSAGE_BUFFER(ndr, NDR_BUFFERS, &r->utf8_dns_host));
420                         NDR_CHECK(ndr_pull_NL_AUTH_MESSAGE_BUFFER(ndr, NDR_BUFFERS, &r->utf8_netbios_computer));
421                         NDR_CHECK(ndr_pull_NL_AUTH_MESSAGE_BUFFER_REPLY(ndr, NDR_BUFFERS, &r->Buffer));
422                 }
423                 ndr->flags = _flags_save_STRUCT;
424         }
425         return NDR_ERR_SUCCESS;
426 }
427
428 _PUBLIC_ void ndr_print_NL_AUTH_MESSAGE(struct ndr_print *ndr, const char *name, const struct NL_AUTH_MESSAGE *r)
429 {
430         ndr_print_struct(ndr, name, "NL_AUTH_MESSAGE");
431         {
432                 uint32_t _flags_save_STRUCT = ndr->flags;
433                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
434                 ndr->depth++;
435                 ndr_print_NL_AUTH_MESSAGE_TYPE(ndr, "MessageType", r->MessageType);
436                 ndr_print_NL_AUTH_MESSAGE_FLAGS(ndr, "Flags", r->Flags);
437                 ndr_print_set_switch_value(ndr, &r->oem_netbios_domain, r->Flags & NL_FLAG_OEM_NETBIOS_DOMAIN_NAME);
438                 ndr_print_NL_AUTH_MESSAGE_BUFFER(ndr, "oem_netbios_domain", &r->oem_netbios_domain);
439                 ndr_print_set_switch_value(ndr, &r->oem_netbios_computer, r->Flags & NL_FLAG_OEM_NETBIOS_COMPUTER_NAME);
440                 ndr_print_NL_AUTH_MESSAGE_BUFFER(ndr, "oem_netbios_computer", &r->oem_netbios_computer);
441                 ndr_print_set_switch_value(ndr, &r->utf8_dns_domain, r->Flags & NL_FLAG_UTF8_DNS_DOMAIN_NAME);
442                 ndr_print_NL_AUTH_MESSAGE_BUFFER(ndr, "utf8_dns_domain", &r->utf8_dns_domain);
443                 ndr_print_set_switch_value(ndr, &r->utf8_dns_host, r->Flags & NL_FLAG_UTF8_DNS_HOST_NAME);
444                 ndr_print_NL_AUTH_MESSAGE_BUFFER(ndr, "utf8_dns_host", &r->utf8_dns_host);
445                 ndr_print_set_switch_value(ndr, &r->utf8_netbios_computer, r->Flags & NL_FLAG_UTF8_NETBIOS_COMPUTER_NAME);
446                 ndr_print_NL_AUTH_MESSAGE_BUFFER(ndr, "utf8_netbios_computer", &r->utf8_netbios_computer);
447                 ndr_print_set_switch_value(ndr, &r->Buffer, r->MessageType & NL_NEGOTIATE_RESPONSE);
448                 ndr_print_NL_AUTH_MESSAGE_BUFFER_REPLY(ndr, "Buffer", &r->Buffer);
449                 ndr->depth--;
450                 ndr->flags = _flags_save_STRUCT;
451         }
452 }
453
454 static enum ndr_err_code ndr_push_NL_SIGNATURE_ALGORITHM(struct ndr_push *ndr, int ndr_flags, enum NL_SIGNATURE_ALGORITHM r)
455 {
456         NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r));
457         return NDR_ERR_SUCCESS;
458 }
459
460 static enum ndr_err_code ndr_pull_NL_SIGNATURE_ALGORITHM(struct ndr_pull *ndr, int ndr_flags, enum NL_SIGNATURE_ALGORITHM *r)
461 {
462         uint16_t v;
463         NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v));
464         *r = v;
465         return NDR_ERR_SUCCESS;
466 }
467
468 _PUBLIC_ void ndr_print_NL_SIGNATURE_ALGORITHM(struct ndr_print *ndr, const char *name, enum NL_SIGNATURE_ALGORITHM r)
469 {
470         const char *val = NULL;
471
472         switch (r) {
473                 case NL_SIGN_HMAC_SHA256: val = "NL_SIGN_HMAC_SHA256"; break;
474                 case NL_SIGN_HMAC_MD5: val = "NL_SIGN_HMAC_MD5"; break;
475         }
476         ndr_print_enum(ndr, name, "ENUM", val, r);
477 }
478
479 static enum ndr_err_code ndr_push_NL_SEAL_ALGORITHM(struct ndr_push *ndr, int ndr_flags, enum NL_SEAL_ALGORITHM r)
480 {
481         NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r));
482         return NDR_ERR_SUCCESS;
483 }
484
485 static enum ndr_err_code ndr_pull_NL_SEAL_ALGORITHM(struct ndr_pull *ndr, int ndr_flags, enum NL_SEAL_ALGORITHM *r)
486 {
487         uint16_t v;
488         NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v));
489         *r = v;
490         return NDR_ERR_SUCCESS;
491 }
492
493 _PUBLIC_ void ndr_print_NL_SEAL_ALGORITHM(struct ndr_print *ndr, const char *name, enum NL_SEAL_ALGORITHM r)
494 {
495         const char *val = NULL;
496
497         switch (r) {
498                 case NL_SEAL_AES128: val = "NL_SEAL_AES128"; break;
499                 case NL_SEAL_RC4: val = "NL_SEAL_RC4"; break;
500                 case NL_SEAL_NONE: val = "NL_SEAL_NONE"; break;
501         }
502         ndr_print_enum(ndr, name, "ENUM", val, r);
503 }
504
505 _PUBLIC_ enum ndr_err_code ndr_push_NL_AUTH_SIGNATURE(struct ndr_push *ndr, int ndr_flags, const struct NL_AUTH_SIGNATURE *r)
506 {
507         {
508                 uint32_t _flags_save_STRUCT = ndr->flags;
509                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
510                 if (ndr_flags & NDR_SCALARS) {
511                         NDR_CHECK(ndr_push_align(ndr, 2));
512                         NDR_CHECK(ndr_push_NL_SIGNATURE_ALGORITHM(ndr, NDR_SCALARS, NL_SIGN_HMAC_MD5));
513                         NDR_CHECK(ndr_push_NL_SEAL_ALGORITHM(ndr, NDR_SCALARS, r->SealAlgorithm));
514                         NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->Pad));
515                         NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->Flags));
516                         NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->SequenceNumber, 8));
517                         NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->Checksum, 8));
518                         NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->Confounder, 8));
519                 }
520                 if (ndr_flags & NDR_BUFFERS) {
521                 }
522                 ndr->flags = _flags_save_STRUCT;
523         }
524         return NDR_ERR_SUCCESS;
525 }
526
527 _PUBLIC_ enum ndr_err_code ndr_pull_NL_AUTH_SIGNATURE(struct ndr_pull *ndr, int ndr_flags, struct NL_AUTH_SIGNATURE *r)
528 {
529         {
530                 uint32_t _flags_save_STRUCT = ndr->flags;
531                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
532                 if (ndr_flags & NDR_SCALARS) {
533                         NDR_CHECK(ndr_pull_align(ndr, 2));
534                         NDR_CHECK(ndr_pull_NL_SIGNATURE_ALGORITHM(ndr, NDR_SCALARS, &r->SignatureAlgorithm));
535                         NDR_CHECK(ndr_pull_NL_SEAL_ALGORITHM(ndr, NDR_SCALARS, &r->SealAlgorithm));
536                         NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->Pad));
537                         NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->Flags));
538                         NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->SequenceNumber, 8));
539                         NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->Checksum, 8));
540                         NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->Confounder, 8));
541                 }
542                 if (ndr_flags & NDR_BUFFERS) {
543                 }
544                 ndr->flags = _flags_save_STRUCT;
545         }
546         return NDR_ERR_SUCCESS;
547 }
548
549 _PUBLIC_ void ndr_print_NL_AUTH_SIGNATURE(struct ndr_print *ndr, const char *name, const struct NL_AUTH_SIGNATURE *r)
550 {
551         ndr_print_struct(ndr, name, "NL_AUTH_SIGNATURE");
552         {
553                 uint32_t _flags_save_STRUCT = ndr->flags;
554                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
555                 ndr->depth++;
556                 ndr_print_NL_SIGNATURE_ALGORITHM(ndr, "SignatureAlgorithm", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?NL_SIGN_HMAC_MD5:r->SignatureAlgorithm);
557                 ndr_print_NL_SEAL_ALGORITHM(ndr, "SealAlgorithm", r->SealAlgorithm);
558                 ndr_print_uint16(ndr, "Pad", r->Pad);
559                 ndr_print_uint16(ndr, "Flags", r->Flags);
560                 ndr_print_array_uint8(ndr, "SequenceNumber", r->SequenceNumber, 8);
561                 ndr_print_array_uint8(ndr, "Checksum", r->Checksum, 8);
562                 ndr_print_array_uint8(ndr, "Confounder", r->Confounder, 8);
563                 ndr->depth--;
564                 ndr->flags = _flags_save_STRUCT;
565         }
566 }
567
568 _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)
569 {
570         {
571                 uint32_t _flags_save_STRUCT = ndr->flags;
572                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
573                 if (ndr_flags & NDR_SCALARS) {
574                         NDR_CHECK(ndr_push_align(ndr, 2));
575                         NDR_CHECK(ndr_push_NL_SIGNATURE_ALGORITHM(ndr, NDR_SCALARS, NL_SIGN_HMAC_SHA256));
576                         NDR_CHECK(ndr_push_NL_SEAL_ALGORITHM(ndr, NDR_SCALARS, r->SealAlgorithm));
577                         NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->Pad));
578                         NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->Flags));
579                         NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->SequenceNumber, 8));
580                         NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->Checksum, 32));
581                         NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->Confounder, 8));
582                 }
583                 if (ndr_flags & NDR_BUFFERS) {
584                 }
585                 ndr->flags = _flags_save_STRUCT;
586         }
587         return NDR_ERR_SUCCESS;
588 }
589
590 _PUBLIC_ enum ndr_err_code ndr_pull_NL_AUTH_SHA2_SIGNATURE(struct ndr_pull *ndr, int ndr_flags, struct NL_AUTH_SHA2_SIGNATURE *r)
591 {
592         {
593                 uint32_t _flags_save_STRUCT = ndr->flags;
594                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
595                 if (ndr_flags & NDR_SCALARS) {
596                         NDR_CHECK(ndr_pull_align(ndr, 2));
597                         NDR_CHECK(ndr_pull_NL_SIGNATURE_ALGORITHM(ndr, NDR_SCALARS, &r->SignatureAlgorithm));
598                         NDR_CHECK(ndr_pull_NL_SEAL_ALGORITHM(ndr, NDR_SCALARS, &r->SealAlgorithm));
599                         NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->Pad));
600                         NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->Flags));
601                         NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->SequenceNumber, 8));
602                         NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->Checksum, 32));
603                         NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->Confounder, 8));
604                 }
605                 if (ndr_flags & NDR_BUFFERS) {
606                 }
607                 ndr->flags = _flags_save_STRUCT;
608         }
609         return NDR_ERR_SUCCESS;
610 }
611
612 _PUBLIC_ void ndr_print_NL_AUTH_SHA2_SIGNATURE(struct ndr_print *ndr, const char *name, const struct NL_AUTH_SHA2_SIGNATURE *r)
613 {
614         ndr_print_struct(ndr, name, "NL_AUTH_SHA2_SIGNATURE");
615         {
616                 uint32_t _flags_save_STRUCT = ndr->flags;
617                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
618                 ndr->depth++;
619                 ndr_print_NL_SIGNATURE_ALGORITHM(ndr, "SignatureAlgorithm", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?NL_SIGN_HMAC_SHA256:r->SignatureAlgorithm);
620                 ndr_print_NL_SEAL_ALGORITHM(ndr, "SealAlgorithm", r->SealAlgorithm);
621                 ndr_print_uint16(ndr, "Pad", r->Pad);
622                 ndr_print_uint16(ndr, "Flags", r->Flags);
623                 ndr_print_array_uint8(ndr, "SequenceNumber", r->SequenceNumber, 8);
624                 ndr_print_array_uint8(ndr, "Checksum", r->Checksum, 32);
625                 ndr_print_array_uint8(ndr, "Confounder", r->Confounder, 8);
626                 ndr->depth--;
627                 ndr->flags = _flags_save_STRUCT;
628         }
629 }
630