rerun 'make samba3-idl'
[Samba.git] / librpc / gen_ndr / ndr_nbt.c
blob3604f1d21cc70e15bf4cc9456a598a1588a30910
1 /* parser auto-generated by pidl */
3 #include "includes.h"
4 #include "../librpc/gen_ndr/ndr_nbt.h"
6 #include "librpc/gen_ndr/ndr_misc.h"
7 #include "librpc/gen_ndr/ndr_security.h"
8 #include "librpc/gen_ndr/ndr_svcctl.h"
9 #include "librpc/gen_ndr/ndr_samr.h"
10 static enum ndr_err_code ndr_push_nbt_operation(struct ndr_push *ndr, int ndr_flags, uint16_t r)
12 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r));
13 return NDR_ERR_SUCCESS;
16 static enum ndr_err_code ndr_pull_nbt_operation(struct ndr_pull *ndr, int ndr_flags, uint16_t *r)
18 uint16_t v;
19 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v));
20 *r = v;
21 return NDR_ERR_SUCCESS;
24 _PUBLIC_ void ndr_print_nbt_operation(struct ndr_print *ndr, const char *name, uint16_t r)
26 ndr_print_uint16(ndr, name, r);
27 ndr->depth++;
28 ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NBT_RCODE", NBT_RCODE, r);
29 ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NBT_FLAG_BROADCAST", NBT_FLAG_BROADCAST, r);
30 ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NBT_FLAG_RECURSION_AVAIL", NBT_FLAG_RECURSION_AVAIL, r);
31 ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NBT_FLAG_RECURSION_DESIRED", NBT_FLAG_RECURSION_DESIRED, r);
32 ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NBT_FLAG_TRUNCATION", NBT_FLAG_TRUNCATION, r);
33 ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NBT_FLAG_AUTHORITIVE", NBT_FLAG_AUTHORITIVE, r);
34 ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NBT_OPCODE", NBT_OPCODE, r);
35 ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NBT_FLAG_REPLY", NBT_FLAG_REPLY, r);
36 ndr->depth--;
39 static enum ndr_err_code ndr_push_nbt_name_type(struct ndr_push *ndr, int ndr_flags, enum nbt_name_type r)
41 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r));
42 return NDR_ERR_SUCCESS;
45 static enum ndr_err_code ndr_pull_nbt_name_type(struct ndr_pull *ndr, int ndr_flags, enum nbt_name_type *r)
47 uint8_t v;
48 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &v));
49 *r = v;
50 return NDR_ERR_SUCCESS;
53 _PUBLIC_ void ndr_print_nbt_name_type(struct ndr_print *ndr, const char *name, enum nbt_name_type r)
55 const char *val = NULL;
57 switch (r) {
58 case NBT_NAME_CLIENT: val = "NBT_NAME_CLIENT"; break;
59 case NBT_NAME_MS: val = "NBT_NAME_MS"; break;
60 case NBT_NAME_USER: val = "NBT_NAME_USER"; break;
61 case NBT_NAME_SERVER: val = "NBT_NAME_SERVER"; break;
62 case NBT_NAME_PDC: val = "NBT_NAME_PDC"; break;
63 case NBT_NAME_LOGON: val = "NBT_NAME_LOGON"; break;
64 case NBT_NAME_MASTER: val = "NBT_NAME_MASTER"; break;
65 case NBT_NAME_BROWSER: val = "NBT_NAME_BROWSER"; break;
67 ndr_print_enum(ndr, name, "ENUM", val, r);
70 _PUBLIC_ void ndr_print_nbt_name(struct ndr_print *ndr, const char *name, const struct nbt_name *r)
72 ndr_print_struct(ndr, name, "nbt_name");
73 ndr->depth++;
74 ndr_print_string(ndr, "name", r->name);
75 ndr_print_string(ndr, "scope", r->scope);
76 ndr_print_nbt_name_type(ndr, "type", r->type);
77 ndr->depth--;
80 _PUBLIC_ enum ndr_err_code ndr_push_nbt_qclass(struct ndr_push *ndr, int ndr_flags, enum nbt_qclass r)
82 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r));
83 return NDR_ERR_SUCCESS;
86 _PUBLIC_ enum ndr_err_code ndr_pull_nbt_qclass(struct ndr_pull *ndr, int ndr_flags, enum nbt_qclass *r)
88 uint16_t v;
89 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v));
90 *r = v;
91 return NDR_ERR_SUCCESS;
94 _PUBLIC_ void ndr_print_nbt_qclass(struct ndr_print *ndr, const char *name, enum nbt_qclass r)
96 const char *val = NULL;
98 switch (r) {
99 case NBT_QCLASS_IP: val = "NBT_QCLASS_IP"; break;
101 ndr_print_enum(ndr, name, "ENUM", val, r);
104 _PUBLIC_ enum ndr_err_code ndr_push_nbt_qtype(struct ndr_push *ndr, int ndr_flags, enum nbt_qtype r)
106 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r));
107 return NDR_ERR_SUCCESS;
110 _PUBLIC_ enum ndr_err_code ndr_pull_nbt_qtype(struct ndr_pull *ndr, int ndr_flags, enum nbt_qtype *r)
112 uint16_t v;
113 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v));
114 *r = v;
115 return NDR_ERR_SUCCESS;
118 _PUBLIC_ void ndr_print_nbt_qtype(struct ndr_print *ndr, const char *name, enum nbt_qtype r)
120 const char *val = NULL;
122 switch (r) {
123 case NBT_QTYPE_ADDRESS: val = "NBT_QTYPE_ADDRESS"; break;
124 case NBT_QTYPE_NAMESERVICE: val = "NBT_QTYPE_NAMESERVICE"; break;
125 case NBT_QTYPE_NULL: val = "NBT_QTYPE_NULL"; break;
126 case NBT_QTYPE_NETBIOS: val = "NBT_QTYPE_NETBIOS"; break;
127 case NBT_QTYPE_STATUS: val = "NBT_QTYPE_STATUS"; break;
129 ndr_print_enum(ndr, name, "ENUM", val, r);
132 static enum ndr_err_code ndr_push_nbt_name_question(struct ndr_push *ndr, int ndr_flags, const struct nbt_name_question *r)
134 if (ndr_flags & NDR_SCALARS) {
135 NDR_CHECK(ndr_push_align(ndr, 4));
136 NDR_CHECK(ndr_push_nbt_name(ndr, NDR_SCALARS, &r->name));
137 NDR_CHECK(ndr_push_nbt_qtype(ndr, NDR_SCALARS, r->question_type));
138 NDR_CHECK(ndr_push_nbt_qclass(ndr, NDR_SCALARS, r->question_class));
140 if (ndr_flags & NDR_BUFFERS) {
142 return NDR_ERR_SUCCESS;
145 static enum ndr_err_code ndr_pull_nbt_name_question(struct ndr_pull *ndr, int ndr_flags, struct nbt_name_question *r)
147 if (ndr_flags & NDR_SCALARS) {
148 NDR_CHECK(ndr_pull_align(ndr, 4));
149 NDR_CHECK(ndr_pull_nbt_name(ndr, NDR_SCALARS, &r->name));
150 NDR_CHECK(ndr_pull_nbt_qtype(ndr, NDR_SCALARS, &r->question_type));
151 NDR_CHECK(ndr_pull_nbt_qclass(ndr, NDR_SCALARS, &r->question_class));
153 if (ndr_flags & NDR_BUFFERS) {
155 return NDR_ERR_SUCCESS;
158 _PUBLIC_ void ndr_print_nbt_name_question(struct ndr_print *ndr, const char *name, const struct nbt_name_question *r)
160 ndr_print_struct(ndr, name, "nbt_name_question");
161 ndr->depth++;
162 ndr_print_nbt_name(ndr, "name", &r->name);
163 ndr_print_nbt_qtype(ndr, "question_type", r->question_type);
164 ndr_print_nbt_qclass(ndr, "question_class", r->question_class);
165 ndr->depth--;
168 static enum ndr_err_code ndr_push_nb_flags(struct ndr_push *ndr, int ndr_flags, uint16_t r)
170 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r));
171 return NDR_ERR_SUCCESS;
174 static enum ndr_err_code ndr_pull_nb_flags(struct ndr_pull *ndr, int ndr_flags, uint16_t *r)
176 uint16_t v;
177 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v));
178 *r = v;
179 return NDR_ERR_SUCCESS;
182 _PUBLIC_ void ndr_print_nb_flags(struct ndr_print *ndr, const char *name, uint16_t r)
184 ndr_print_uint16(ndr, name, r);
185 ndr->depth++;
186 ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NBT_NM_PERMANENT", NBT_NM_PERMANENT, r);
187 ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NBT_NM_ACTIVE", NBT_NM_ACTIVE, r);
188 ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NBT_NM_CONFLICT", NBT_NM_CONFLICT, r);
189 ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NBT_NM_DEREGISTER", NBT_NM_DEREGISTER, r);
190 ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NBT_NM_OWNER_TYPE", NBT_NM_OWNER_TYPE, r);
191 ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NBT_NM_GROUP", NBT_NM_GROUP, r);
192 ndr->depth--;
195 static enum ndr_err_code ndr_push_nbt_rdata_address(struct ndr_push *ndr, int ndr_flags, const struct nbt_rdata_address *r)
197 if (ndr_flags & NDR_SCALARS) {
198 NDR_CHECK(ndr_push_align(ndr, 4));
199 NDR_CHECK(ndr_push_nb_flags(ndr, NDR_SCALARS, r->nb_flags));
200 NDR_CHECK(ndr_push_ipv4address(ndr, NDR_SCALARS, r->ipaddr));
202 if (ndr_flags & NDR_BUFFERS) {
204 return NDR_ERR_SUCCESS;
207 static enum ndr_err_code ndr_pull_nbt_rdata_address(struct ndr_pull *ndr, int ndr_flags, struct nbt_rdata_address *r)
209 if (ndr_flags & NDR_SCALARS) {
210 NDR_CHECK(ndr_pull_align(ndr, 4));
211 NDR_CHECK(ndr_pull_nb_flags(ndr, NDR_SCALARS, &r->nb_flags));
212 NDR_CHECK(ndr_pull_ipv4address(ndr, NDR_SCALARS, &r->ipaddr));
214 if (ndr_flags & NDR_BUFFERS) {
216 return NDR_ERR_SUCCESS;
219 _PUBLIC_ void ndr_print_nbt_rdata_address(struct ndr_print *ndr, const char *name, const struct nbt_rdata_address *r)
221 ndr_print_struct(ndr, name, "nbt_rdata_address");
222 ndr->depth++;
223 ndr_print_nb_flags(ndr, "nb_flags", r->nb_flags);
224 ndr_print_ipv4address(ndr, "ipaddr", r->ipaddr);
225 ndr->depth--;
228 static enum ndr_err_code ndr_push_nbt_rdata_netbios(struct ndr_push *ndr, int ndr_flags, const struct nbt_rdata_netbios *r)
230 uint32_t cntr_addresses_0;
231 if (ndr_flags & NDR_SCALARS) {
232 NDR_CHECK(ndr_push_align(ndr, 4));
233 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->length));
234 for (cntr_addresses_0 = 0; cntr_addresses_0 < r->length / 6; cntr_addresses_0++) {
235 NDR_CHECK(ndr_push_nbt_rdata_address(ndr, NDR_SCALARS, &r->addresses[cntr_addresses_0]));
238 if (ndr_flags & NDR_BUFFERS) {
240 return NDR_ERR_SUCCESS;
243 static enum ndr_err_code ndr_pull_nbt_rdata_netbios(struct ndr_pull *ndr, int ndr_flags, struct nbt_rdata_netbios *r)
245 uint32_t size_addresses_0 = 0;
246 uint32_t cntr_addresses_0;
247 TALLOC_CTX *_mem_save_addresses_0;
248 if (ndr_flags & NDR_SCALARS) {
249 NDR_CHECK(ndr_pull_align(ndr, 4));
250 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length));
251 size_addresses_0 = r->length / 6;
252 NDR_PULL_ALLOC_N(ndr, r->addresses, size_addresses_0);
253 _mem_save_addresses_0 = NDR_PULL_GET_MEM_CTX(ndr);
254 NDR_PULL_SET_MEM_CTX(ndr, r->addresses, 0);
255 for (cntr_addresses_0 = 0; cntr_addresses_0 < size_addresses_0; cntr_addresses_0++) {
256 NDR_CHECK(ndr_pull_nbt_rdata_address(ndr, NDR_SCALARS, &r->addresses[cntr_addresses_0]));
258 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_addresses_0, 0);
260 if (ndr_flags & NDR_BUFFERS) {
262 return NDR_ERR_SUCCESS;
265 _PUBLIC_ void ndr_print_nbt_rdata_netbios(struct ndr_print *ndr, const char *name, const struct nbt_rdata_netbios *r)
267 uint32_t cntr_addresses_0;
268 ndr_print_struct(ndr, name, "nbt_rdata_netbios");
269 ndr->depth++;
270 ndr_print_uint16(ndr, "length", r->length);
271 ndr->print(ndr, "%s: ARRAY(%d)", "addresses", (int)r->length / 6);
272 ndr->depth++;
273 for (cntr_addresses_0=0;cntr_addresses_0<r->length / 6;cntr_addresses_0++) {
274 char *idx_0=NULL;
275 if (asprintf(&idx_0, "[%d]", cntr_addresses_0) != -1) {
276 ndr_print_nbt_rdata_address(ndr, "addresses", &r->addresses[cntr_addresses_0]);
277 free(idx_0);
280 ndr->depth--;
281 ndr->depth--;
284 static enum ndr_err_code ndr_push_nbt_statistics(struct ndr_push *ndr, int ndr_flags, const struct nbt_statistics *r)
286 if (ndr_flags & NDR_SCALARS) {
287 NDR_CHECK(ndr_push_align(ndr, 4));
288 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->unit_id, 6));
289 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->jumpers));
290 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->test_result));
291 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->version_number));
292 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->period_of_statistics));
293 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->number_of_crcs));
294 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->number_alignment_errors));
295 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->number_of_collisions));
296 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->number_send_aborts));
297 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->number_good_sends));
298 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->number_good_receives));
299 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->number_retransmits));
300 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->number_no_resource_conditions));
301 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->number_free_command_blocks));
302 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->total_number_command_blocks));
303 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->max_total_number_command_blocks));
304 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->number_pending_sessions));
305 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->max_number_pending_sessions));
306 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->max_total_sessions_possible));
307 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->session_data_packet_size));
309 if (ndr_flags & NDR_BUFFERS) {
311 return NDR_ERR_SUCCESS;
314 static enum ndr_err_code ndr_pull_nbt_statistics(struct ndr_pull *ndr, int ndr_flags, struct nbt_statistics *r)
316 uint32_t size_unit_id_0 = 0;
317 if (ndr_flags & NDR_SCALARS) {
318 NDR_CHECK(ndr_pull_align(ndr, 4));
319 size_unit_id_0 = 6;
320 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->unit_id, size_unit_id_0));
321 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->jumpers));
322 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->test_result));
323 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->version_number));
324 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->period_of_statistics));
325 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->number_of_crcs));
326 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->number_alignment_errors));
327 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->number_of_collisions));
328 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->number_send_aborts));
329 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->number_good_sends));
330 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->number_good_receives));
331 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->number_retransmits));
332 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->number_no_resource_conditions));
333 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->number_free_command_blocks));
334 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->total_number_command_blocks));
335 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->max_total_number_command_blocks));
336 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->number_pending_sessions));
337 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->max_number_pending_sessions));
338 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->max_total_sessions_possible));
339 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->session_data_packet_size));
341 if (ndr_flags & NDR_BUFFERS) {
343 return NDR_ERR_SUCCESS;
346 _PUBLIC_ void ndr_print_nbt_statistics(struct ndr_print *ndr, const char *name, const struct nbt_statistics *r)
348 ndr_print_struct(ndr, name, "nbt_statistics");
349 ndr->depth++;
350 ndr_print_array_uint8(ndr, "unit_id", r->unit_id, 6);
351 ndr_print_uint8(ndr, "jumpers", r->jumpers);
352 ndr_print_uint8(ndr, "test_result", r->test_result);
353 ndr_print_uint16(ndr, "version_number", r->version_number);
354 ndr_print_uint16(ndr, "period_of_statistics", r->period_of_statistics);
355 ndr_print_uint16(ndr, "number_of_crcs", r->number_of_crcs);
356 ndr_print_uint16(ndr, "number_alignment_errors", r->number_alignment_errors);
357 ndr_print_uint16(ndr, "number_of_collisions", r->number_of_collisions);
358 ndr_print_uint16(ndr, "number_send_aborts", r->number_send_aborts);
359 ndr_print_uint32(ndr, "number_good_sends", r->number_good_sends);
360 ndr_print_uint32(ndr, "number_good_receives", r->number_good_receives);
361 ndr_print_uint16(ndr, "number_retransmits", r->number_retransmits);
362 ndr_print_uint16(ndr, "number_no_resource_conditions", r->number_no_resource_conditions);
363 ndr_print_uint16(ndr, "number_free_command_blocks", r->number_free_command_blocks);
364 ndr_print_uint16(ndr, "total_number_command_blocks", r->total_number_command_blocks);
365 ndr_print_uint16(ndr, "max_total_number_command_blocks", r->max_total_number_command_blocks);
366 ndr_print_uint16(ndr, "number_pending_sessions", r->number_pending_sessions);
367 ndr_print_uint16(ndr, "max_number_pending_sessions", r->max_number_pending_sessions);
368 ndr_print_uint16(ndr, "max_total_sessions_possible", r->max_total_sessions_possible);
369 ndr_print_uint16(ndr, "session_data_packet_size", r->session_data_packet_size);
370 ndr->depth--;
373 static enum ndr_err_code ndr_push_nbt_status_name(struct ndr_push *ndr, int ndr_flags, const struct nbt_status_name *r)
375 if (ndr_flags & NDR_SCALARS) {
376 NDR_CHECK(ndr_push_align(ndr, 2));
377 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->name, 15, sizeof(uint8_t), CH_DOS));
378 NDR_CHECK(ndr_push_nbt_name_type(ndr, NDR_SCALARS, r->type));
379 NDR_CHECK(ndr_push_nb_flags(ndr, NDR_SCALARS, r->nb_flags));
381 if (ndr_flags & NDR_BUFFERS) {
383 return NDR_ERR_SUCCESS;
386 static enum ndr_err_code ndr_pull_nbt_status_name(struct ndr_pull *ndr, int ndr_flags, struct nbt_status_name *r)
388 uint32_t size_name_0 = 0;
389 if (ndr_flags & NDR_SCALARS) {
390 NDR_CHECK(ndr_pull_align(ndr, 2));
391 size_name_0 = 15;
392 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->name, size_name_0, sizeof(uint8_t), CH_DOS));
393 NDR_CHECK(ndr_pull_nbt_name_type(ndr, NDR_SCALARS, &r->type));
394 NDR_CHECK(ndr_pull_nb_flags(ndr, NDR_SCALARS, &r->nb_flags));
396 if (ndr_flags & NDR_BUFFERS) {
398 return NDR_ERR_SUCCESS;
401 _PUBLIC_ void ndr_print_nbt_status_name(struct ndr_print *ndr, const char *name, const struct nbt_status_name *r)
403 ndr_print_struct(ndr, name, "nbt_status_name");
404 ndr->depth++;
405 ndr_print_string(ndr, "name", r->name);
406 ndr_print_nbt_name_type(ndr, "type", r->type);
407 ndr_print_nb_flags(ndr, "nb_flags", r->nb_flags);
408 ndr->depth--;
411 static enum ndr_err_code ndr_push_nbt_rdata_status(struct ndr_push *ndr, int ndr_flags, const struct nbt_rdata_status *r)
413 uint32_t cntr_names_0;
414 if (ndr_flags & NDR_SCALARS) {
415 NDR_CHECK(ndr_push_align(ndr, 4));
416 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->num_names * 18 + 47));
417 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->num_names));
418 for (cntr_names_0 = 0; cntr_names_0 < r->num_names; cntr_names_0++) {
419 NDR_CHECK(ndr_push_nbt_status_name(ndr, NDR_SCALARS, &r->names[cntr_names_0]));
421 NDR_CHECK(ndr_push_nbt_statistics(ndr, NDR_SCALARS, &r->statistics));
423 if (ndr_flags & NDR_BUFFERS) {
425 return NDR_ERR_SUCCESS;
428 static enum ndr_err_code ndr_pull_nbt_rdata_status(struct ndr_pull *ndr, int ndr_flags, struct nbt_rdata_status *r)
430 uint32_t size_names_0 = 0;
431 uint32_t cntr_names_0;
432 TALLOC_CTX *_mem_save_names_0;
433 if (ndr_flags & NDR_SCALARS) {
434 NDR_CHECK(ndr_pull_align(ndr, 4));
435 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length));
436 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->num_names));
437 size_names_0 = r->num_names;
438 NDR_PULL_ALLOC_N(ndr, r->names, size_names_0);
439 _mem_save_names_0 = NDR_PULL_GET_MEM_CTX(ndr);
440 NDR_PULL_SET_MEM_CTX(ndr, r->names, 0);
441 for (cntr_names_0 = 0; cntr_names_0 < size_names_0; cntr_names_0++) {
442 NDR_CHECK(ndr_pull_nbt_status_name(ndr, NDR_SCALARS, &r->names[cntr_names_0]));
444 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_names_0, 0);
445 NDR_CHECK(ndr_pull_nbt_statistics(ndr, NDR_SCALARS, &r->statistics));
447 if (ndr_flags & NDR_BUFFERS) {
449 return NDR_ERR_SUCCESS;
452 _PUBLIC_ void ndr_print_nbt_rdata_status(struct ndr_print *ndr, const char *name, const struct nbt_rdata_status *r)
454 uint32_t cntr_names_0;
455 ndr_print_struct(ndr, name, "nbt_rdata_status");
456 ndr->depth++;
457 ndr_print_uint16(ndr, "length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->num_names * 18 + 47:r->length);
458 ndr_print_uint8(ndr, "num_names", r->num_names);
459 ndr->print(ndr, "%s: ARRAY(%d)", "names", (int)r->num_names);
460 ndr->depth++;
461 for (cntr_names_0=0;cntr_names_0<r->num_names;cntr_names_0++) {
462 char *idx_0=NULL;
463 if (asprintf(&idx_0, "[%d]", cntr_names_0) != -1) {
464 ndr_print_nbt_status_name(ndr, "names", &r->names[cntr_names_0]);
465 free(idx_0);
468 ndr->depth--;
469 ndr_print_nbt_statistics(ndr, "statistics", &r->statistics);
470 ndr->depth--;
473 static enum ndr_err_code ndr_push_nbt_rdata_data(struct ndr_push *ndr, int ndr_flags, const struct nbt_rdata_data *r)
475 if (ndr_flags & NDR_SCALARS) {
476 NDR_CHECK(ndr_push_align(ndr, 2));
477 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->length));
478 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, r->length));
480 if (ndr_flags & NDR_BUFFERS) {
482 return NDR_ERR_SUCCESS;
485 static enum ndr_err_code ndr_pull_nbt_rdata_data(struct ndr_pull *ndr, int ndr_flags, struct nbt_rdata_data *r)
487 uint32_t size_data_0 = 0;
488 if (ndr_flags & NDR_SCALARS) {
489 NDR_CHECK(ndr_pull_align(ndr, 2));
490 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length));
491 size_data_0 = r->length;
492 NDR_PULL_ALLOC_N(ndr, r->data, size_data_0);
493 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, size_data_0));
495 if (ndr_flags & NDR_BUFFERS) {
497 return NDR_ERR_SUCCESS;
500 _PUBLIC_ void ndr_print_nbt_rdata_data(struct ndr_print *ndr, const char *name, const struct nbt_rdata_data *r)
502 ndr_print_struct(ndr, name, "nbt_rdata_data");
503 ndr->depth++;
504 ndr_print_uint16(ndr, "length", r->length);
505 ndr_print_array_uint8(ndr, "data", r->data, r->length);
506 ndr->depth--;
509 _PUBLIC_ enum ndr_err_code ndr_push_nbt_rdata(struct ndr_push *ndr, int ndr_flags, const union nbt_rdata *r)
511 if (ndr_flags & NDR_SCALARS) {
512 int level = ndr_push_get_switch_value(ndr, r);
513 switch (level) {
514 case NBT_QTYPE_NETBIOS: {
515 NDR_CHECK(ndr_push_nbt_rdata_netbios(ndr, NDR_SCALARS, &r->netbios));
516 break; }
518 case NBT_QTYPE_STATUS: {
519 NDR_CHECK(ndr_push_nbt_rdata_status(ndr, NDR_SCALARS, &r->status));
520 break; }
522 default: {
523 NDR_CHECK(ndr_push_nbt_rdata_data(ndr, NDR_SCALARS, &r->data));
524 break; }
528 if (ndr_flags & NDR_BUFFERS) {
529 int level = ndr_push_get_switch_value(ndr, r);
530 switch (level) {
531 case NBT_QTYPE_NETBIOS:
532 break;
534 case NBT_QTYPE_STATUS:
535 break;
537 default:
538 break;
542 return NDR_ERR_SUCCESS;
545 _PUBLIC_ enum ndr_err_code ndr_pull_nbt_rdata(struct ndr_pull *ndr, int ndr_flags, union nbt_rdata *r)
547 int level;
548 level = ndr_pull_get_switch_value(ndr, r);
549 if (ndr_flags & NDR_SCALARS) {
550 switch (level) {
551 case NBT_QTYPE_NETBIOS: {
552 NDR_CHECK(ndr_pull_nbt_rdata_netbios(ndr, NDR_SCALARS, &r->netbios));
553 break; }
555 case NBT_QTYPE_STATUS: {
556 NDR_CHECK(ndr_pull_nbt_rdata_status(ndr, NDR_SCALARS, &r->status));
557 break; }
559 default: {
560 NDR_CHECK(ndr_pull_nbt_rdata_data(ndr, NDR_SCALARS, &r->data));
561 break; }
565 if (ndr_flags & NDR_BUFFERS) {
566 switch (level) {
567 case NBT_QTYPE_NETBIOS:
568 break;
570 case NBT_QTYPE_STATUS:
571 break;
573 default:
574 break;
578 return NDR_ERR_SUCCESS;
581 _PUBLIC_ void ndr_print_nbt_rdata(struct ndr_print *ndr, const char *name, const union nbt_rdata *r)
583 int level;
584 level = ndr_print_get_switch_value(ndr, r);
585 ndr_print_union(ndr, name, level, "nbt_rdata");
586 switch (level) {
587 case NBT_QTYPE_NETBIOS:
588 ndr_print_nbt_rdata_netbios(ndr, "netbios", &r->netbios);
589 break;
591 case NBT_QTYPE_STATUS:
592 ndr_print_nbt_rdata_status(ndr, "status", &r->status);
593 break;
595 default:
596 ndr_print_nbt_rdata_data(ndr, "data", &r->data);
597 break;
602 static enum ndr_err_code ndr_pull_nbt_res_rec(struct ndr_pull *ndr, int ndr_flags, struct nbt_res_rec *r)
605 uint32_t _flags_save_STRUCT = ndr->flags;
606 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
607 if (ndr_flags & NDR_SCALARS) {
608 NDR_CHECK(ndr_pull_align(ndr, 4));
609 NDR_CHECK(ndr_pull_nbt_name(ndr, NDR_SCALARS, &r->name));
610 NDR_CHECK(ndr_pull_nbt_qtype(ndr, NDR_SCALARS, &r->rr_type));
611 NDR_CHECK(ndr_pull_nbt_qclass(ndr, NDR_SCALARS, &r->rr_class));
612 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->ttl));
613 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->rdata, r->rr_type));
614 NDR_CHECK(ndr_pull_nbt_rdata(ndr, NDR_SCALARS, &r->rdata));
616 if (ndr_flags & NDR_BUFFERS) {
618 ndr->flags = _flags_save_STRUCT;
620 return NDR_ERR_SUCCESS;
623 _PUBLIC_ void ndr_print_nbt_res_rec(struct ndr_print *ndr, const char *name, const struct nbt_res_rec *r)
625 ndr_print_struct(ndr, name, "nbt_res_rec");
627 uint32_t _flags_save_STRUCT = ndr->flags;
628 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
629 ndr->depth++;
630 ndr_print_nbt_name(ndr, "name", &r->name);
631 ndr_print_nbt_qtype(ndr, "rr_type", r->rr_type);
632 ndr_print_nbt_qclass(ndr, "rr_class", r->rr_class);
633 ndr_print_uint32(ndr, "ttl", r->ttl);
634 ndr_print_set_switch_value(ndr, &r->rdata, r->rr_type);
635 ndr_print_nbt_rdata(ndr, "rdata", &r->rdata);
636 ndr->depth--;
637 ndr->flags = _flags_save_STRUCT;
641 _PUBLIC_ enum ndr_err_code ndr_push_nbt_name_packet(struct ndr_push *ndr, int ndr_flags, const struct nbt_name_packet *r)
643 uint32_t cntr_questions_0;
644 uint32_t cntr_answers_0;
645 uint32_t cntr_nsrecs_0;
646 uint32_t cntr_additional_0;
648 uint32_t _flags_save_STRUCT = ndr->flags;
649 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_BIGENDIAN|LIBNDR_PRINT_ARRAY_HEX);
650 if (ndr_flags & NDR_SCALARS) {
651 NDR_CHECK(ndr_push_align(ndr, 4));
652 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->name_trn_id));
653 NDR_CHECK(ndr_push_nbt_operation(ndr, NDR_SCALARS, r->operation));
654 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->qdcount));
655 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->ancount));
656 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->nscount));
657 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->arcount));
658 for (cntr_questions_0 = 0; cntr_questions_0 < r->qdcount; cntr_questions_0++) {
659 NDR_CHECK(ndr_push_nbt_name_question(ndr, NDR_SCALARS, &r->questions[cntr_questions_0]));
661 for (cntr_answers_0 = 0; cntr_answers_0 < r->ancount; cntr_answers_0++) {
662 NDR_CHECK(ndr_push_nbt_res_rec(ndr, NDR_SCALARS, &r->answers[cntr_answers_0]));
664 for (cntr_nsrecs_0 = 0; cntr_nsrecs_0 < r->nscount; cntr_nsrecs_0++) {
665 NDR_CHECK(ndr_push_nbt_res_rec(ndr, NDR_SCALARS, &r->nsrecs[cntr_nsrecs_0]));
667 for (cntr_additional_0 = 0; cntr_additional_0 < r->arcount; cntr_additional_0++) {
668 NDR_CHECK(ndr_push_nbt_res_rec(ndr, NDR_SCALARS, &r->additional[cntr_additional_0]));
671 uint32_t _flags_save_DATA_BLOB = ndr->flags;
672 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
673 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->padding));
674 ndr->flags = _flags_save_DATA_BLOB;
677 if (ndr_flags & NDR_BUFFERS) {
679 ndr->flags = _flags_save_STRUCT;
681 return NDR_ERR_SUCCESS;
684 _PUBLIC_ enum ndr_err_code ndr_pull_nbt_name_packet(struct ndr_pull *ndr, int ndr_flags, struct nbt_name_packet *r)
686 uint32_t size_questions_0 = 0;
687 uint32_t cntr_questions_0;
688 TALLOC_CTX *_mem_save_questions_0;
689 uint32_t size_answers_0 = 0;
690 uint32_t cntr_answers_0;
691 TALLOC_CTX *_mem_save_answers_0;
692 uint32_t size_nsrecs_0 = 0;
693 uint32_t cntr_nsrecs_0;
694 TALLOC_CTX *_mem_save_nsrecs_0;
695 uint32_t size_additional_0 = 0;
696 uint32_t cntr_additional_0;
697 TALLOC_CTX *_mem_save_additional_0;
699 uint32_t _flags_save_STRUCT = ndr->flags;
700 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_BIGENDIAN|LIBNDR_PRINT_ARRAY_HEX);
701 if (ndr_flags & NDR_SCALARS) {
702 NDR_CHECK(ndr_pull_align(ndr, 4));
703 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->name_trn_id));
704 NDR_CHECK(ndr_pull_nbt_operation(ndr, NDR_SCALARS, &r->operation));
705 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->qdcount));
706 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->ancount));
707 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->nscount));
708 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->arcount));
709 size_questions_0 = r->qdcount;
710 NDR_PULL_ALLOC_N(ndr, r->questions, size_questions_0);
711 _mem_save_questions_0 = NDR_PULL_GET_MEM_CTX(ndr);
712 NDR_PULL_SET_MEM_CTX(ndr, r->questions, 0);
713 for (cntr_questions_0 = 0; cntr_questions_0 < size_questions_0; cntr_questions_0++) {
714 NDR_CHECK(ndr_pull_nbt_name_question(ndr, NDR_SCALARS, &r->questions[cntr_questions_0]));
716 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_questions_0, 0);
717 size_answers_0 = r->ancount;
718 NDR_PULL_ALLOC_N(ndr, r->answers, size_answers_0);
719 _mem_save_answers_0 = NDR_PULL_GET_MEM_CTX(ndr);
720 NDR_PULL_SET_MEM_CTX(ndr, r->answers, 0);
721 for (cntr_answers_0 = 0; cntr_answers_0 < size_answers_0; cntr_answers_0++) {
722 NDR_CHECK(ndr_pull_nbt_res_rec(ndr, NDR_SCALARS, &r->answers[cntr_answers_0]));
724 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_answers_0, 0);
725 size_nsrecs_0 = r->nscount;
726 NDR_PULL_ALLOC_N(ndr, r->nsrecs, size_nsrecs_0);
727 _mem_save_nsrecs_0 = NDR_PULL_GET_MEM_CTX(ndr);
728 NDR_PULL_SET_MEM_CTX(ndr, r->nsrecs, 0);
729 for (cntr_nsrecs_0 = 0; cntr_nsrecs_0 < size_nsrecs_0; cntr_nsrecs_0++) {
730 NDR_CHECK(ndr_pull_nbt_res_rec(ndr, NDR_SCALARS, &r->nsrecs[cntr_nsrecs_0]));
732 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_nsrecs_0, 0);
733 size_additional_0 = r->arcount;
734 NDR_PULL_ALLOC_N(ndr, r->additional, size_additional_0);
735 _mem_save_additional_0 = NDR_PULL_GET_MEM_CTX(ndr);
736 NDR_PULL_SET_MEM_CTX(ndr, r->additional, 0);
737 for (cntr_additional_0 = 0; cntr_additional_0 < size_additional_0; cntr_additional_0++) {
738 NDR_CHECK(ndr_pull_nbt_res_rec(ndr, NDR_SCALARS, &r->additional[cntr_additional_0]));
740 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_additional_0, 0);
742 uint32_t _flags_save_DATA_BLOB = ndr->flags;
743 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
744 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->padding));
745 ndr->flags = _flags_save_DATA_BLOB;
748 if (ndr_flags & NDR_BUFFERS) {
750 ndr->flags = _flags_save_STRUCT;
752 return NDR_ERR_SUCCESS;
755 _PUBLIC_ void ndr_print_nbt_name_packet(struct ndr_print *ndr, const char *name, const struct nbt_name_packet *r)
757 uint32_t cntr_questions_0;
758 uint32_t cntr_answers_0;
759 uint32_t cntr_nsrecs_0;
760 uint32_t cntr_additional_0;
761 ndr_print_struct(ndr, name, "nbt_name_packet");
763 uint32_t _flags_save_STRUCT = ndr->flags;
764 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_BIGENDIAN|LIBNDR_PRINT_ARRAY_HEX);
765 ndr->depth++;
766 ndr_print_uint16(ndr, "name_trn_id", r->name_trn_id);
767 ndr_print_nbt_operation(ndr, "operation", r->operation);
768 ndr_print_uint16(ndr, "qdcount", r->qdcount);
769 ndr_print_uint16(ndr, "ancount", r->ancount);
770 ndr_print_uint16(ndr, "nscount", r->nscount);
771 ndr_print_uint16(ndr, "arcount", r->arcount);
772 ndr->print(ndr, "%s: ARRAY(%d)", "questions", (int)r->qdcount);
773 ndr->depth++;
774 for (cntr_questions_0=0;cntr_questions_0<r->qdcount;cntr_questions_0++) {
775 char *idx_0=NULL;
776 if (asprintf(&idx_0, "[%d]", cntr_questions_0) != -1) {
777 ndr_print_nbt_name_question(ndr, "questions", &r->questions[cntr_questions_0]);
778 free(idx_0);
781 ndr->depth--;
782 ndr->print(ndr, "%s: ARRAY(%d)", "answers", (int)r->ancount);
783 ndr->depth++;
784 for (cntr_answers_0=0;cntr_answers_0<r->ancount;cntr_answers_0++) {
785 char *idx_0=NULL;
786 if (asprintf(&idx_0, "[%d]", cntr_answers_0) != -1) {
787 ndr_print_nbt_res_rec(ndr, "answers", &r->answers[cntr_answers_0]);
788 free(idx_0);
791 ndr->depth--;
792 ndr->print(ndr, "%s: ARRAY(%d)", "nsrecs", (int)r->nscount);
793 ndr->depth++;
794 for (cntr_nsrecs_0=0;cntr_nsrecs_0<r->nscount;cntr_nsrecs_0++) {
795 char *idx_0=NULL;
796 if (asprintf(&idx_0, "[%d]", cntr_nsrecs_0) != -1) {
797 ndr_print_nbt_res_rec(ndr, "nsrecs", &r->nsrecs[cntr_nsrecs_0]);
798 free(idx_0);
801 ndr->depth--;
802 ndr->print(ndr, "%s: ARRAY(%d)", "additional", (int)r->arcount);
803 ndr->depth++;
804 for (cntr_additional_0=0;cntr_additional_0<r->arcount;cntr_additional_0++) {
805 char *idx_0=NULL;
806 if (asprintf(&idx_0, "[%d]", cntr_additional_0) != -1) {
807 ndr_print_nbt_res_rec(ndr, "additional", &r->additional[cntr_additional_0]);
808 free(idx_0);
811 ndr->depth--;
812 ndr_print_DATA_BLOB(ndr, "padding", r->padding);
813 ndr->depth--;
814 ndr->flags = _flags_save_STRUCT;
818 static enum ndr_err_code ndr_push_dgram_msg_type(struct ndr_push *ndr, int ndr_flags, enum dgram_msg_type r)
820 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r));
821 return NDR_ERR_SUCCESS;
824 static enum ndr_err_code ndr_pull_dgram_msg_type(struct ndr_pull *ndr, int ndr_flags, enum dgram_msg_type *r)
826 uint8_t v;
827 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &v));
828 *r = v;
829 return NDR_ERR_SUCCESS;
832 _PUBLIC_ void ndr_print_dgram_msg_type(struct ndr_print *ndr, const char *name, enum dgram_msg_type r)
834 const char *val = NULL;
836 switch (r) {
837 case DGRAM_DIRECT_UNIQUE: val = "DGRAM_DIRECT_UNIQUE"; break;
838 case DGRAM_DIRECT_GROUP: val = "DGRAM_DIRECT_GROUP"; break;
839 case DGRAM_BCAST: val = "DGRAM_BCAST"; break;
840 case DGRAM_ERROR: val = "DGRAM_ERROR"; break;
841 case DGRAM_QUERY: val = "DGRAM_QUERY"; break;
842 case DGRAM_QUERY_POSITIVE: val = "DGRAM_QUERY_POSITIVE"; break;
843 case DGRAM_QUERY_NEGATIVE: val = "DGRAM_QUERY_NEGATIVE"; break;
845 ndr_print_enum(ndr, name, "ENUM", val, r);
848 static enum ndr_err_code ndr_push_dgram_flags(struct ndr_push *ndr, int ndr_flags, uint8_t r)
850 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r));
851 return NDR_ERR_SUCCESS;
854 static enum ndr_err_code ndr_pull_dgram_flags(struct ndr_pull *ndr, int ndr_flags, uint8_t *r)
856 uint8_t v;
857 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &v));
858 *r = v;
859 return NDR_ERR_SUCCESS;
862 _PUBLIC_ void ndr_print_dgram_flags(struct ndr_print *ndr, const char *name, uint8_t r)
864 ndr_print_uint8(ndr, name, r);
865 ndr->depth++;
866 ndr_print_bitmap_flag(ndr, sizeof(uint8_t), "DGRAM_FLAG_MORE", DGRAM_FLAG_MORE, r);
867 ndr_print_bitmap_flag(ndr, sizeof(uint8_t), "DGRAM_FLAG_FIRST", DGRAM_FLAG_FIRST, r);
868 ndr_print_bitmap_flag(ndr, sizeof(uint8_t), "DGRAM_FLAG_NODE_TYPE", DGRAM_FLAG_NODE_TYPE, r);
869 ndr->depth--;
872 static enum ndr_err_code ndr_push_smb_command(struct ndr_push *ndr, int ndr_flags, enum smb_command r)
874 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r));
875 return NDR_ERR_SUCCESS;
878 static enum ndr_err_code ndr_pull_smb_command(struct ndr_pull *ndr, int ndr_flags, enum smb_command *r)
880 uint8_t v;
881 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &v));
882 *r = v;
883 return NDR_ERR_SUCCESS;
886 _PUBLIC_ void ndr_print_smb_command(struct ndr_print *ndr, const char *name, enum smb_command r)
888 const char *val = NULL;
890 switch (r) {
891 case SMB_TRANSACTION: val = "SMB_TRANSACTION"; break;
893 ndr_print_enum(ndr, name, "ENUM", val, r);
896 static enum ndr_err_code ndr_push_smb_trans_body(struct ndr_push *ndr, int ndr_flags, const struct smb_trans_body *r)
898 if (ndr_flags & NDR_SCALARS) {
899 NDR_CHECK(ndr_push_align(ndr, 4));
900 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, 17));
901 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->total_param_count));
902 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->total_data_count));
903 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->max_param_count));
904 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->max_data_count));
905 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->max_setup_count));
906 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->pad));
907 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->trans_flags));
908 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->timeout));
909 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->reserved));
910 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->param_count));
911 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->param_offset));
912 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->data_count));
913 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->data_offset));
914 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, 3));
915 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->pad2));
916 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->opcode));
917 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->priority));
918 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->_class));
919 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, strlen(r->mailslot_name) + 1 + r->data.length));
921 uint32_t _flags_save_string = ndr->flags;
922 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
923 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->mailslot_name));
924 ndr->flags = _flags_save_string;
927 uint32_t _flags_save_DATA_BLOB = ndr->flags;
928 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
929 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->data));
930 ndr->flags = _flags_save_DATA_BLOB;
933 if (ndr_flags & NDR_BUFFERS) {
935 return NDR_ERR_SUCCESS;
938 static enum ndr_err_code ndr_pull_smb_trans_body(struct ndr_pull *ndr, int ndr_flags, struct smb_trans_body *r)
940 if (ndr_flags & NDR_SCALARS) {
941 NDR_CHECK(ndr_pull_align(ndr, 4));
942 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->wct));
943 if (r->wct < 17 || r->wct > 17) {
944 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
946 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->total_param_count));
947 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->total_data_count));
948 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->max_param_count));
949 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->max_data_count));
950 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->max_setup_count));
951 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->pad));
952 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->trans_flags));
953 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->timeout));
954 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->reserved));
955 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->param_count));
956 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->param_offset));
957 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->data_count));
958 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->data_offset));
959 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->setup_count));
960 if (r->setup_count < 3 || r->setup_count > 3) {
961 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
963 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->pad2));
964 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->opcode));
965 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->priority));
966 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->_class));
967 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->byte_count));
969 uint32_t _flags_save_string = ndr->flags;
970 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
971 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->mailslot_name));
972 ndr->flags = _flags_save_string;
975 uint32_t _flags_save_DATA_BLOB = ndr->flags;
976 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
977 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->data));
978 ndr->flags = _flags_save_DATA_BLOB;
981 if (ndr_flags & NDR_BUFFERS) {
983 return NDR_ERR_SUCCESS;
986 _PUBLIC_ void ndr_print_smb_trans_body(struct ndr_print *ndr, const char *name, const struct smb_trans_body *r)
988 ndr_print_struct(ndr, name, "smb_trans_body");
989 ndr->depth++;
990 ndr_print_uint8(ndr, "wct", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?17:r->wct);
991 ndr_print_uint16(ndr, "total_param_count", r->total_param_count);
992 ndr_print_uint16(ndr, "total_data_count", r->total_data_count);
993 ndr_print_uint16(ndr, "max_param_count", r->max_param_count);
994 ndr_print_uint16(ndr, "max_data_count", r->max_data_count);
995 ndr_print_uint8(ndr, "max_setup_count", r->max_setup_count);
996 ndr_print_uint8(ndr, "pad", r->pad);
997 ndr_print_uint16(ndr, "trans_flags", r->trans_flags);
998 ndr_print_uint32(ndr, "timeout", r->timeout);
999 ndr_print_uint16(ndr, "reserved", r->reserved);
1000 ndr_print_uint16(ndr, "param_count", r->param_count);
1001 ndr_print_uint16(ndr, "param_offset", r->param_offset);
1002 ndr_print_uint16(ndr, "data_count", r->data_count);
1003 ndr_print_uint16(ndr, "data_offset", r->data_offset);
1004 ndr_print_uint8(ndr, "setup_count", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?3:r->setup_count);
1005 ndr_print_uint8(ndr, "pad2", r->pad2);
1006 ndr_print_uint16(ndr, "opcode", r->opcode);
1007 ndr_print_uint16(ndr, "priority", r->priority);
1008 ndr_print_uint16(ndr, "_class", r->_class);
1009 ndr_print_uint16(ndr, "byte_count", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen(r->mailslot_name) + 1 + r->data.length:r->byte_count);
1010 ndr_print_string(ndr, "mailslot_name", r->mailslot_name);
1011 ndr_print_DATA_BLOB(ndr, "data", r->data);
1012 ndr->depth--;
1015 static enum ndr_err_code ndr_push_smb_body(struct ndr_push *ndr, int ndr_flags, const union smb_body *r)
1017 if (ndr_flags & NDR_SCALARS) {
1018 int level = ndr_push_get_switch_value(ndr, r);
1019 switch (level) {
1020 case SMB_TRANSACTION: {
1021 NDR_CHECK(ndr_push_smb_trans_body(ndr, NDR_SCALARS, &r->trans));
1022 break; }
1024 default:
1025 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
1028 if (ndr_flags & NDR_BUFFERS) {
1029 int level = ndr_push_get_switch_value(ndr, r);
1030 switch (level) {
1031 case SMB_TRANSACTION:
1032 break;
1034 default:
1035 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
1038 return NDR_ERR_SUCCESS;
1041 static enum ndr_err_code ndr_pull_smb_body(struct ndr_pull *ndr, int ndr_flags, union smb_body *r)
1043 int level;
1044 level = ndr_pull_get_switch_value(ndr, r);
1045 if (ndr_flags & NDR_SCALARS) {
1046 switch (level) {
1047 case SMB_TRANSACTION: {
1048 NDR_CHECK(ndr_pull_smb_trans_body(ndr, NDR_SCALARS, &r->trans));
1049 break; }
1051 default:
1052 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
1055 if (ndr_flags & NDR_BUFFERS) {
1056 switch (level) {
1057 case SMB_TRANSACTION:
1058 break;
1060 default:
1061 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
1064 return NDR_ERR_SUCCESS;
1067 _PUBLIC_ void ndr_print_smb_body(struct ndr_print *ndr, const char *name, const union smb_body *r)
1069 int level;
1070 level = ndr_print_get_switch_value(ndr, r);
1071 ndr_print_union(ndr, name, level, "smb_body");
1072 switch (level) {
1073 case SMB_TRANSACTION:
1074 ndr_print_smb_trans_body(ndr, "trans", &r->trans);
1075 break;
1077 default:
1078 ndr_print_bad_level(ndr, name, level);
1082 _PUBLIC_ enum ndr_err_code ndr_push_dgram_smb_packet(struct ndr_push *ndr, int ndr_flags, const struct dgram_smb_packet *r)
1085 uint32_t _flags_save_STRUCT = ndr->flags;
1086 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_LITTLE_ENDIAN|LIBNDR_PRINT_ARRAY_HEX);
1087 if (ndr_flags & NDR_SCALARS) {
1088 NDR_CHECK(ndr_push_align(ndr, 4));
1089 NDR_CHECK(ndr_push_smb_command(ndr, NDR_SCALARS, r->smb_command));
1090 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->err_class));
1091 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->pad));
1092 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->err_code));
1093 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->flags));
1094 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->flags2));
1095 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->pid_high));
1096 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->signature, 8));
1097 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->reserved));
1098 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->tid));
1099 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->pid));
1100 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->vuid));
1101 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->mid));
1102 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->body, r->smb_command));
1103 NDR_CHECK(ndr_push_smb_body(ndr, NDR_SCALARS, &r->body));
1105 if (ndr_flags & NDR_BUFFERS) {
1107 ndr->flags = _flags_save_STRUCT;
1109 return NDR_ERR_SUCCESS;
1112 _PUBLIC_ enum ndr_err_code ndr_pull_dgram_smb_packet(struct ndr_pull *ndr, int ndr_flags, struct dgram_smb_packet *r)
1114 uint32_t size_signature_0 = 0;
1116 uint32_t _flags_save_STRUCT = ndr->flags;
1117 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_LITTLE_ENDIAN|LIBNDR_PRINT_ARRAY_HEX);
1118 if (ndr_flags & NDR_SCALARS) {
1119 NDR_CHECK(ndr_pull_align(ndr, 4));
1120 NDR_CHECK(ndr_pull_smb_command(ndr, NDR_SCALARS, &r->smb_command));
1121 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->err_class));
1122 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->pad));
1123 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->err_code));
1124 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->flags));
1125 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->flags2));
1126 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->pid_high));
1127 size_signature_0 = 8;
1128 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->signature, size_signature_0));
1129 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->reserved));
1130 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->tid));
1131 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->pid));
1132 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->vuid));
1133 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->mid));
1134 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->body, r->smb_command));
1135 NDR_CHECK(ndr_pull_smb_body(ndr, NDR_SCALARS, &r->body));
1137 if (ndr_flags & NDR_BUFFERS) {
1139 ndr->flags = _flags_save_STRUCT;
1141 return NDR_ERR_SUCCESS;
1144 _PUBLIC_ void ndr_print_dgram_smb_packet(struct ndr_print *ndr, const char *name, const struct dgram_smb_packet *r)
1146 ndr_print_struct(ndr, name, "dgram_smb_packet");
1148 uint32_t _flags_save_STRUCT = ndr->flags;
1149 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_LITTLE_ENDIAN|LIBNDR_PRINT_ARRAY_HEX);
1150 ndr->depth++;
1151 ndr_print_smb_command(ndr, "smb_command", r->smb_command);
1152 ndr_print_uint8(ndr, "err_class", r->err_class);
1153 ndr_print_uint8(ndr, "pad", r->pad);
1154 ndr_print_uint16(ndr, "err_code", r->err_code);
1155 ndr_print_uint8(ndr, "flags", r->flags);
1156 ndr_print_uint16(ndr, "flags2", r->flags2);
1157 ndr_print_uint16(ndr, "pid_high", r->pid_high);
1158 ndr_print_array_uint8(ndr, "signature", r->signature, 8);
1159 ndr_print_uint16(ndr, "reserved", r->reserved);
1160 ndr_print_uint16(ndr, "tid", r->tid);
1161 ndr_print_uint16(ndr, "pid", r->pid);
1162 ndr_print_uint16(ndr, "vuid", r->vuid);
1163 ndr_print_uint16(ndr, "mid", r->mid);
1164 ndr_print_set_switch_value(ndr, &r->body, r->smb_command);
1165 ndr_print_smb_body(ndr, "body", &r->body);
1166 ndr->depth--;
1167 ndr->flags = _flags_save_STRUCT;
1171 static enum ndr_err_code ndr_push_dgram_message_body(struct ndr_push *ndr, int ndr_flags, const union dgram_message_body *r)
1173 if (ndr_flags & NDR_SCALARS) {
1174 int level = ndr_push_get_switch_value(ndr, r);
1175 switch (level) {
1176 case DGRAM_SMB: {
1177 NDR_CHECK(ndr_push_dgram_smb_packet(ndr, NDR_SCALARS, &r->smb));
1178 break; }
1180 default:
1181 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
1184 if (ndr_flags & NDR_BUFFERS) {
1185 int level = ndr_push_get_switch_value(ndr, r);
1186 switch (level) {
1187 case DGRAM_SMB:
1188 break;
1190 default:
1191 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
1194 return NDR_ERR_SUCCESS;
1197 static enum ndr_err_code ndr_pull_dgram_message_body(struct ndr_pull *ndr, int ndr_flags, union dgram_message_body *r)
1199 int level;
1200 level = ndr_pull_get_switch_value(ndr, r);
1201 if (ndr_flags & NDR_SCALARS) {
1202 switch (level) {
1203 case DGRAM_SMB: {
1204 NDR_CHECK(ndr_pull_dgram_smb_packet(ndr, NDR_SCALARS, &r->smb));
1205 break; }
1207 default:
1208 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
1211 if (ndr_flags & NDR_BUFFERS) {
1212 switch (level) {
1213 case DGRAM_SMB:
1214 break;
1216 default:
1217 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
1220 return NDR_ERR_SUCCESS;
1223 _PUBLIC_ void ndr_print_dgram_message_body(struct ndr_print *ndr, const char *name, const union dgram_message_body *r)
1225 int level;
1226 level = ndr_print_get_switch_value(ndr, r);
1227 ndr_print_union(ndr, name, level, "dgram_message_body");
1228 switch (level) {
1229 case DGRAM_SMB:
1230 ndr_print_dgram_smb_packet(ndr, "smb", &r->smb);
1231 break;
1233 default:
1234 ndr_print_bad_level(ndr, name, level);
1238 static enum ndr_err_code ndr_push_dgram_message(struct ndr_push *ndr, int ndr_flags, const struct dgram_message *r)
1240 if (ndr_flags & NDR_SCALARS) {
1241 NDR_CHECK(ndr_push_align(ndr, 4));
1242 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->length));
1243 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->offset));
1244 NDR_CHECK(ndr_push_nbt_name(ndr, NDR_SCALARS, &r->source_name));
1245 NDR_CHECK(ndr_push_nbt_name(ndr, NDR_SCALARS, &r->dest_name));
1246 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->dgram_body_type));
1247 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->body, r->dgram_body_type));
1248 NDR_CHECK(ndr_push_dgram_message_body(ndr, NDR_SCALARS, &r->body));
1250 if (ndr_flags & NDR_BUFFERS) {
1252 return NDR_ERR_SUCCESS;
1255 static enum ndr_err_code ndr_pull_dgram_message(struct ndr_pull *ndr, int ndr_flags, struct dgram_message *r)
1257 if (ndr_flags & NDR_SCALARS) {
1258 NDR_CHECK(ndr_pull_align(ndr, 4));
1259 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length));
1260 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->offset));
1261 NDR_CHECK(ndr_pull_nbt_name(ndr, NDR_SCALARS, &r->source_name));
1262 NDR_CHECK(ndr_pull_nbt_name(ndr, NDR_SCALARS, &r->dest_name));
1263 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->dgram_body_type));
1264 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->body, r->dgram_body_type));
1265 NDR_CHECK(ndr_pull_dgram_message_body(ndr, NDR_SCALARS, &r->body));
1267 if (ndr_flags & NDR_BUFFERS) {
1269 return NDR_ERR_SUCCESS;
1272 _PUBLIC_ void ndr_print_dgram_message(struct ndr_print *ndr, const char *name, const struct dgram_message *r)
1274 ndr_print_struct(ndr, name, "dgram_message");
1275 ndr->depth++;
1276 ndr_print_uint16(ndr, "length", r->length);
1277 ndr_print_uint16(ndr, "offset", r->offset);
1278 ndr_print_nbt_name(ndr, "source_name", &r->source_name);
1279 ndr_print_nbt_name(ndr, "dest_name", &r->dest_name);
1280 ndr_print_uint32(ndr, "dgram_body_type", r->dgram_body_type);
1281 ndr_print_set_switch_value(ndr, &r->body, r->dgram_body_type);
1282 ndr_print_dgram_message_body(ndr, "body", &r->body);
1283 ndr->depth--;
1286 static enum ndr_err_code ndr_push_dgram_err_code(struct ndr_push *ndr, int ndr_flags, enum dgram_err_code r)
1288 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r));
1289 return NDR_ERR_SUCCESS;
1292 static enum ndr_err_code ndr_pull_dgram_err_code(struct ndr_pull *ndr, int ndr_flags, enum dgram_err_code *r)
1294 uint8_t v;
1295 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &v));
1296 *r = v;
1297 return NDR_ERR_SUCCESS;
1300 _PUBLIC_ void ndr_print_dgram_err_code(struct ndr_print *ndr, const char *name, enum dgram_err_code r)
1302 const char *val = NULL;
1304 switch (r) {
1305 case DGRAM_ERROR_NAME_NOT_PRESENT: val = "DGRAM_ERROR_NAME_NOT_PRESENT"; break;
1306 case DGRAM_ERROR_INVALID_SOURCE: val = "DGRAM_ERROR_INVALID_SOURCE"; break;
1307 case DGRAM_ERROR_INVALID_DEST: val = "DGRAM_ERROR_INVALID_DEST"; break;
1309 ndr_print_enum(ndr, name, "ENUM", val, r);
1312 static enum ndr_err_code ndr_push_dgram_data(struct ndr_push *ndr, int ndr_flags, const union dgram_data *r)
1314 if (ndr_flags & NDR_SCALARS) {
1315 int level = ndr_push_get_switch_value(ndr, r);
1316 switch (level) {
1317 case DGRAM_DIRECT_UNIQUE: {
1318 NDR_CHECK(ndr_push_dgram_message(ndr, NDR_SCALARS, &r->msg));
1319 break; }
1321 case DGRAM_DIRECT_GROUP: {
1322 NDR_CHECK(ndr_push_dgram_message(ndr, NDR_SCALARS, &r->msg));
1323 break; }
1325 case DGRAM_BCAST: {
1326 NDR_CHECK(ndr_push_dgram_message(ndr, NDR_SCALARS, &r->msg));
1327 break; }
1329 case DGRAM_ERROR: {
1330 NDR_CHECK(ndr_push_dgram_err_code(ndr, NDR_SCALARS, r->error));
1331 break; }
1333 case DGRAM_QUERY: {
1334 NDR_CHECK(ndr_push_nbt_name(ndr, NDR_SCALARS, &r->dest_name));
1335 break; }
1337 case DGRAM_QUERY_POSITIVE: {
1338 NDR_CHECK(ndr_push_nbt_name(ndr, NDR_SCALARS, &r->dest_name));
1339 break; }
1341 case DGRAM_QUERY_NEGATIVE: {
1342 NDR_CHECK(ndr_push_nbt_name(ndr, NDR_SCALARS, &r->dest_name));
1343 break; }
1345 default:
1346 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
1349 if (ndr_flags & NDR_BUFFERS) {
1350 int level = ndr_push_get_switch_value(ndr, r);
1351 switch (level) {
1352 case DGRAM_DIRECT_UNIQUE:
1353 break;
1355 case DGRAM_DIRECT_GROUP:
1356 break;
1358 case DGRAM_BCAST:
1359 break;
1361 case DGRAM_ERROR:
1362 break;
1364 case DGRAM_QUERY:
1365 break;
1367 case DGRAM_QUERY_POSITIVE:
1368 break;
1370 case DGRAM_QUERY_NEGATIVE:
1371 break;
1373 default:
1374 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
1377 return NDR_ERR_SUCCESS;
1380 static enum ndr_err_code ndr_pull_dgram_data(struct ndr_pull *ndr, int ndr_flags, union dgram_data *r)
1382 int level;
1383 level = ndr_pull_get_switch_value(ndr, r);
1384 if (ndr_flags & NDR_SCALARS) {
1385 switch (level) {
1386 case DGRAM_DIRECT_UNIQUE: {
1387 NDR_CHECK(ndr_pull_dgram_message(ndr, NDR_SCALARS, &r->msg));
1388 break; }
1390 case DGRAM_DIRECT_GROUP: {
1391 NDR_CHECK(ndr_pull_dgram_message(ndr, NDR_SCALARS, &r->msg));
1392 break; }
1394 case DGRAM_BCAST: {
1395 NDR_CHECK(ndr_pull_dgram_message(ndr, NDR_SCALARS, &r->msg));
1396 break; }
1398 case DGRAM_ERROR: {
1399 NDR_CHECK(ndr_pull_dgram_err_code(ndr, NDR_SCALARS, &r->error));
1400 break; }
1402 case DGRAM_QUERY: {
1403 NDR_CHECK(ndr_pull_nbt_name(ndr, NDR_SCALARS, &r->dest_name));
1404 break; }
1406 case DGRAM_QUERY_POSITIVE: {
1407 NDR_CHECK(ndr_pull_nbt_name(ndr, NDR_SCALARS, &r->dest_name));
1408 break; }
1410 case DGRAM_QUERY_NEGATIVE: {
1411 NDR_CHECK(ndr_pull_nbt_name(ndr, NDR_SCALARS, &r->dest_name));
1412 break; }
1414 default:
1415 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
1418 if (ndr_flags & NDR_BUFFERS) {
1419 switch (level) {
1420 case DGRAM_DIRECT_UNIQUE:
1421 break;
1423 case DGRAM_DIRECT_GROUP:
1424 break;
1426 case DGRAM_BCAST:
1427 break;
1429 case DGRAM_ERROR:
1430 break;
1432 case DGRAM_QUERY:
1433 break;
1435 case DGRAM_QUERY_POSITIVE:
1436 break;
1438 case DGRAM_QUERY_NEGATIVE:
1439 break;
1441 default:
1442 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
1445 return NDR_ERR_SUCCESS;
1448 _PUBLIC_ void ndr_print_dgram_data(struct ndr_print *ndr, const char *name, const union dgram_data *r)
1450 int level;
1451 level = ndr_print_get_switch_value(ndr, r);
1452 ndr_print_union(ndr, name, level, "dgram_data");
1453 switch (level) {
1454 case DGRAM_DIRECT_UNIQUE:
1455 ndr_print_dgram_message(ndr, "msg", &r->msg);
1456 break;
1458 case DGRAM_DIRECT_GROUP:
1459 ndr_print_dgram_message(ndr, "msg", &r->msg);
1460 break;
1462 case DGRAM_BCAST:
1463 ndr_print_dgram_message(ndr, "msg", &r->msg);
1464 break;
1466 case DGRAM_ERROR:
1467 ndr_print_dgram_err_code(ndr, "error", r->error);
1468 break;
1470 case DGRAM_QUERY:
1471 ndr_print_nbt_name(ndr, "dest_name", &r->dest_name);
1472 break;
1474 case DGRAM_QUERY_POSITIVE:
1475 ndr_print_nbt_name(ndr, "dest_name", &r->dest_name);
1476 break;
1478 case DGRAM_QUERY_NEGATIVE:
1479 ndr_print_nbt_name(ndr, "dest_name", &r->dest_name);
1480 break;
1482 default:
1483 ndr_print_bad_level(ndr, name, level);
1487 _PUBLIC_ enum ndr_err_code ndr_push_nbt_dgram_packet(struct ndr_push *ndr, int ndr_flags, const struct nbt_dgram_packet *r)
1490 uint32_t _flags_save_STRUCT = ndr->flags;
1491 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_BIGENDIAN|LIBNDR_PRINT_ARRAY_HEX);
1492 if (ndr_flags & NDR_SCALARS) {
1493 NDR_CHECK(ndr_push_align(ndr, 4));
1494 NDR_CHECK(ndr_push_dgram_msg_type(ndr, NDR_SCALARS, r->msg_type));
1495 NDR_CHECK(ndr_push_dgram_flags(ndr, NDR_SCALARS, r->flags));
1496 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->dgram_id));
1497 NDR_CHECK(ndr_push_ipv4address(ndr, NDR_SCALARS, r->src_addr));
1498 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->src_port));
1499 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->data, r->msg_type));
1500 NDR_CHECK(ndr_push_dgram_data(ndr, NDR_SCALARS, &r->data));
1502 if (ndr_flags & NDR_BUFFERS) {
1504 ndr->flags = _flags_save_STRUCT;
1506 return NDR_ERR_SUCCESS;
1509 _PUBLIC_ enum ndr_err_code ndr_pull_nbt_dgram_packet(struct ndr_pull *ndr, int ndr_flags, struct nbt_dgram_packet *r)
1512 uint32_t _flags_save_STRUCT = ndr->flags;
1513 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_BIGENDIAN|LIBNDR_PRINT_ARRAY_HEX);
1514 if (ndr_flags & NDR_SCALARS) {
1515 NDR_CHECK(ndr_pull_align(ndr, 4));
1516 NDR_CHECK(ndr_pull_dgram_msg_type(ndr, NDR_SCALARS, &r->msg_type));
1517 NDR_CHECK(ndr_pull_dgram_flags(ndr, NDR_SCALARS, &r->flags));
1518 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->dgram_id));
1519 NDR_CHECK(ndr_pull_ipv4address(ndr, NDR_SCALARS, &r->src_addr));
1520 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->src_port));
1521 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->data, r->msg_type));
1522 NDR_CHECK(ndr_pull_dgram_data(ndr, NDR_SCALARS, &r->data));
1524 if (ndr_flags & NDR_BUFFERS) {
1526 ndr->flags = _flags_save_STRUCT;
1528 return NDR_ERR_SUCCESS;
1531 _PUBLIC_ void ndr_print_nbt_dgram_packet(struct ndr_print *ndr, const char *name, const struct nbt_dgram_packet *r)
1533 ndr_print_struct(ndr, name, "nbt_dgram_packet");
1535 uint32_t _flags_save_STRUCT = ndr->flags;
1536 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_BIGENDIAN|LIBNDR_PRINT_ARRAY_HEX);
1537 ndr->depth++;
1538 ndr_print_dgram_msg_type(ndr, "msg_type", r->msg_type);
1539 ndr_print_dgram_flags(ndr, "flags", r->flags);
1540 ndr_print_uint16(ndr, "dgram_id", r->dgram_id);
1541 ndr_print_ipv4address(ndr, "src_addr", r->src_addr);
1542 ndr_print_uint16(ndr, "src_port", r->src_port);
1543 ndr_print_set_switch_value(ndr, &r->data, r->msg_type);
1544 ndr_print_dgram_data(ndr, "data", &r->data);
1545 ndr->depth--;
1546 ndr->flags = _flags_save_STRUCT;
1550 _PUBLIC_ enum ndr_err_code ndr_push_nbt_sockaddr(struct ndr_push *ndr, int ndr_flags, const struct nbt_sockaddr *r)
1552 if (ndr_flags & NDR_SCALARS) {
1553 NDR_CHECK(ndr_push_align(ndr, 4));
1554 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sockaddr_family));
1556 uint32_t _flags_save_ipv4address = ndr->flags;
1557 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN);
1558 NDR_CHECK(ndr_push_ipv4address(ndr, NDR_SCALARS, r->pdc_ip));
1559 ndr->flags = _flags_save_ipv4address;
1562 uint32_t _flags_save_DATA_BLOB = ndr->flags;
1563 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
1564 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->remaining));
1565 ndr->flags = _flags_save_DATA_BLOB;
1568 if (ndr_flags & NDR_BUFFERS) {
1570 return NDR_ERR_SUCCESS;
1573 _PUBLIC_ enum ndr_err_code ndr_pull_nbt_sockaddr(struct ndr_pull *ndr, int ndr_flags, struct nbt_sockaddr *r)
1575 if (ndr_flags & NDR_SCALARS) {
1576 NDR_CHECK(ndr_pull_align(ndr, 4));
1577 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sockaddr_family));
1579 uint32_t _flags_save_ipv4address = ndr->flags;
1580 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN);
1581 NDR_CHECK(ndr_pull_ipv4address(ndr, NDR_SCALARS, &r->pdc_ip));
1582 ndr->flags = _flags_save_ipv4address;
1585 uint32_t _flags_save_DATA_BLOB = ndr->flags;
1586 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
1587 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->remaining));
1588 ndr->flags = _flags_save_DATA_BLOB;
1591 if (ndr_flags & NDR_BUFFERS) {
1593 return NDR_ERR_SUCCESS;
1596 _PUBLIC_ void ndr_print_nbt_sockaddr(struct ndr_print *ndr, const char *name, const struct nbt_sockaddr *r)
1598 ndr_print_struct(ndr, name, "nbt_sockaddr");
1599 ndr->depth++;
1600 ndr_print_uint32(ndr, "sockaddr_family", r->sockaddr_family);
1601 ndr_print_ipv4address(ndr, "pdc_ip", r->pdc_ip);
1602 ndr_print_DATA_BLOB(ndr, "remaining", r->remaining);
1603 ndr->depth--;
1606 _PUBLIC_ size_t ndr_size_nbt_sockaddr(const struct nbt_sockaddr *r, struct smb_iconv_convenience *ic, int flags)
1608 return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_nbt_sockaddr, ic);
1611 _PUBLIC_ enum ndr_err_code ndr_push_nbt_server_type(struct ndr_push *ndr, int ndr_flags, uint32_t r)
1613 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
1614 return NDR_ERR_SUCCESS;
1617 _PUBLIC_ enum ndr_err_code ndr_pull_nbt_server_type(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
1619 uint32_t v;
1620 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
1621 *r = v;
1622 return NDR_ERR_SUCCESS;
1625 _PUBLIC_ void ndr_print_nbt_server_type(struct ndr_print *ndr, const char *name, uint32_t r)
1627 ndr_print_uint32(ndr, name, r);
1628 ndr->depth++;
1629 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_PDC", NBT_SERVER_PDC, r);
1630 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_GC", NBT_SERVER_GC, r);
1631 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_LDAP", NBT_SERVER_LDAP, r);
1632 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_DS", NBT_SERVER_DS, r);
1633 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_KDC", NBT_SERVER_KDC, r);
1634 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_TIMESERV", NBT_SERVER_TIMESERV, r);
1635 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_CLOSEST", NBT_SERVER_CLOSEST, r);
1636 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_WRITABLE", NBT_SERVER_WRITABLE, r);
1637 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_GOOD_TIMESERV", NBT_SERVER_GOOD_TIMESERV, r);
1638 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_NDNC", NBT_SERVER_NDNC, r);
1639 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_SELECT_SECRET_DOMAIN_6", NBT_SERVER_SELECT_SECRET_DOMAIN_6, r);
1640 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_FULL_SECRET_DOMAIN_6", NBT_SERVER_FULL_SECRET_DOMAIN_6, r);
1641 ndr->depth--;
1644 _PUBLIC_ enum ndr_err_code ndr_push_netlogon_nt_version_flags(struct ndr_push *ndr, int ndr_flags, uint32_t r)
1646 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
1647 return NDR_ERR_SUCCESS;
1650 _PUBLIC_ enum ndr_err_code ndr_pull_netlogon_nt_version_flags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
1652 uint32_t v;
1653 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
1654 *r = v;
1655 return NDR_ERR_SUCCESS;
1658 _PUBLIC_ void ndr_print_netlogon_nt_version_flags(struct ndr_print *ndr, const char *name, uint32_t r)
1660 ndr_print_uint32(ndr, name, r);
1661 ndr->depth++;
1662 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NT_VERSION_1", NETLOGON_NT_VERSION_1, r);
1663 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NT_VERSION_5", NETLOGON_NT_VERSION_5, r);
1664 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NT_VERSION_5EX", NETLOGON_NT_VERSION_5EX, r);
1665 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NT_VERSION_5EX_WITH_IP", NETLOGON_NT_VERSION_5EX_WITH_IP, r);
1666 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NT_VERSION_WITH_CLOSEST_SITE", NETLOGON_NT_VERSION_WITH_CLOSEST_SITE, r);
1667 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NT_VERSION_AVIOD_NT4EMUL", NETLOGON_NT_VERSION_AVIOD_NT4EMUL, r);
1668 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NT_VERSION_PDC", NETLOGON_NT_VERSION_PDC, r);
1669 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NT_VERSION_IP", NETLOGON_NT_VERSION_IP, r);
1670 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NT_VERSION_LOCAL", NETLOGON_NT_VERSION_LOCAL, r);
1671 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NT_VERSION_GC", NETLOGON_NT_VERSION_GC, r);
1672 ndr->depth--;
1675 _PUBLIC_ enum ndr_err_code ndr_push_netlogon_command(struct ndr_push *ndr, int ndr_flags, enum netlogon_command r)
1677 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r));
1678 return NDR_ERR_SUCCESS;
1681 _PUBLIC_ enum ndr_err_code ndr_pull_netlogon_command(struct ndr_pull *ndr, int ndr_flags, enum netlogon_command *r)
1683 uint16_t v;
1684 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v));
1685 *r = v;
1686 return NDR_ERR_SUCCESS;
1689 _PUBLIC_ void ndr_print_netlogon_command(struct ndr_print *ndr, const char *name, enum netlogon_command r)
1691 const char *val = NULL;
1693 switch (r) {
1694 case LOGON_PRIMARY_QUERY: val = "LOGON_PRIMARY_QUERY"; break;
1695 case NETLOGON_ANNOUNCE_UAS: val = "NETLOGON_ANNOUNCE_UAS"; break;
1696 case NETLOGON_RESPONSE_FROM_PDC: val = "NETLOGON_RESPONSE_FROM_PDC"; break;
1697 case LOGON_SAM_LOGON_REQUEST: val = "LOGON_SAM_LOGON_REQUEST"; break;
1698 case LOGON_SAM_LOGON_RESPONSE: val = "LOGON_SAM_LOGON_RESPONSE"; break;
1699 case LOGON_SAM_LOGON_PAUSE_RESPONSE: val = "LOGON_SAM_LOGON_PAUSE_RESPONSE"; break;
1700 case LOGON_SAM_LOGON_USER_UNKNOWN: val = "LOGON_SAM_LOGON_USER_UNKNOWN"; break;
1701 case LOGON_SAM_LOGON_RESPONSE_EX: val = "LOGON_SAM_LOGON_RESPONSE_EX"; break;
1702 case LOGON_SAM_LOGON_PAUSE_RESPONSE_EX: val = "LOGON_SAM_LOGON_PAUSE_RESPONSE_EX"; break;
1703 case LOGON_SAM_LOGON_USER_UNKNOWN_EX: val = "LOGON_SAM_LOGON_USER_UNKNOWN_EX"; break;
1705 ndr_print_enum(ndr, name, "ENUM", val, r);
1708 _PUBLIC_ void ndr_print_NETLOGON_SAM_LOGON_REQUEST(struct ndr_print *ndr, const char *name, const struct NETLOGON_SAM_LOGON_REQUEST *r)
1710 ndr_print_struct(ndr, name, "NETLOGON_SAM_LOGON_REQUEST");
1711 ndr->depth++;
1712 ndr_print_uint16(ndr, "request_count", r->request_count);
1713 ndr_print_string(ndr, "computer_name", r->computer_name);
1714 ndr_print_string(ndr, "user_name", r->user_name);
1715 ndr_print_string(ndr, "mailslot_name", r->mailslot_name);
1716 ndr_print_samr_AcctFlags(ndr, "acct_control", r->acct_control);
1717 ndr_print_uint32(ndr, "sid_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_dom_sid0(&r->sid, ndr->flags):r->sid_size);
1718 ndr_print_DATA_BLOB(ndr, "_pad", r->_pad);
1719 ndr_print_dom_sid0(ndr, "sid", &r->sid);
1720 ndr_print_netlogon_nt_version_flags(ndr, "nt_version", r->nt_version);
1721 ndr_print_uint16(ndr, "lmnt_token", r->lmnt_token);
1722 ndr_print_uint16(ndr, "lm20_token", r->lm20_token);
1723 ndr->depth--;
1726 _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)
1729 uint32_t _flags_save_STRUCT = ndr->flags;
1730 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
1731 if (ndr_flags & NDR_SCALARS) {
1732 NDR_CHECK(ndr_push_align(ndr, 4));
1733 NDR_CHECK(ndr_push_netlogon_command(ndr, NDR_SCALARS, r->command));
1735 uint32_t _flags_save_string = ndr->flags;
1736 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1737 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->server));
1738 ndr->flags = _flags_save_string;
1741 uint32_t _flags_save_string = ndr->flags;
1742 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1743 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->user_name));
1744 ndr->flags = _flags_save_string;
1747 uint32_t _flags_save_string = ndr->flags;
1748 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1749 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->domain));
1750 ndr->flags = _flags_save_string;
1752 NDR_CHECK(ndr_push_netlogon_nt_version_flags(ndr, NDR_SCALARS, r->nt_version));
1753 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lmnt_token));
1754 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lm20_token));
1756 if (ndr_flags & NDR_BUFFERS) {
1758 ndr->flags = _flags_save_STRUCT;
1760 return NDR_ERR_SUCCESS;
1763 _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)
1766 uint32_t _flags_save_STRUCT = ndr->flags;
1767 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
1768 if (ndr_flags & NDR_SCALARS) {
1769 NDR_CHECK(ndr_pull_align(ndr, 4));
1770 NDR_CHECK(ndr_pull_netlogon_command(ndr, NDR_SCALARS, &r->command));
1772 uint32_t _flags_save_string = ndr->flags;
1773 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1774 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->server));
1775 ndr->flags = _flags_save_string;
1778 uint32_t _flags_save_string = ndr->flags;
1779 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1780 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->user_name));
1781 ndr->flags = _flags_save_string;
1784 uint32_t _flags_save_string = ndr->flags;
1785 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1786 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->domain));
1787 ndr->flags = _flags_save_string;
1789 NDR_CHECK(ndr_pull_netlogon_nt_version_flags(ndr, NDR_SCALARS, &r->nt_version));
1790 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lmnt_token));
1791 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lm20_token));
1793 if (ndr_flags & NDR_BUFFERS) {
1795 ndr->flags = _flags_save_STRUCT;
1797 return NDR_ERR_SUCCESS;
1800 _PUBLIC_ void ndr_print_NETLOGON_SAM_LOGON_RESPONSE_NT40(struct ndr_print *ndr, const char *name, const struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *r)
1802 ndr_print_struct(ndr, name, "NETLOGON_SAM_LOGON_RESPONSE_NT40");
1804 uint32_t _flags_save_STRUCT = ndr->flags;
1805 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
1806 ndr->depth++;
1807 ndr_print_netlogon_command(ndr, "command", r->command);
1808 ndr_print_string(ndr, "server", r->server);
1809 ndr_print_string(ndr, "user_name", r->user_name);
1810 ndr_print_string(ndr, "domain", r->domain);
1811 ndr_print_netlogon_nt_version_flags(ndr, "nt_version", r->nt_version);
1812 ndr_print_uint16(ndr, "lmnt_token", r->lmnt_token);
1813 ndr_print_uint16(ndr, "lm20_token", r->lm20_token);
1814 ndr->depth--;
1815 ndr->flags = _flags_save_STRUCT;
1819 _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)
1822 uint32_t _flags_save_STRUCT = ndr->flags;
1823 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
1824 if (ndr_flags & NDR_SCALARS) {
1825 NDR_CHECK(ndr_push_align(ndr, 4));
1826 NDR_CHECK(ndr_push_netlogon_command(ndr, NDR_SCALARS, r->command));
1828 uint32_t _flags_save_string = ndr->flags;
1829 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1830 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->pdc_name));
1831 ndr->flags = _flags_save_string;
1834 uint32_t _flags_save_string = ndr->flags;
1835 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1836 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->user_name));
1837 ndr->flags = _flags_save_string;
1840 uint32_t _flags_save_string = ndr->flags;
1841 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1842 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->domain_name));
1843 ndr->flags = _flags_save_string;
1845 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->domain_uuid));
1846 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->zero_uuid));
1847 NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->forest));
1848 NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->dns_domain));
1849 NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->pdc_dns_name));
1850 NDR_CHECK(ndr_push_ipv4address(ndr, NDR_SCALARS, r->pdc_ip));
1851 NDR_CHECK(ndr_push_nbt_server_type(ndr, NDR_SCALARS, r->server_type));
1852 NDR_CHECK(ndr_push_netlogon_nt_version_flags(ndr, NDR_SCALARS, r->nt_version));
1853 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lmnt_token));
1854 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lm20_token));
1856 if (ndr_flags & NDR_BUFFERS) {
1858 ndr->flags = _flags_save_STRUCT;
1860 return NDR_ERR_SUCCESS;
1863 _PUBLIC_ enum ndr_err_code ndr_pull_NETLOGON_SAM_LOGON_RESPONSE(struct ndr_pull *ndr, int ndr_flags, struct NETLOGON_SAM_LOGON_RESPONSE *r)
1866 uint32_t _flags_save_STRUCT = ndr->flags;
1867 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
1868 if (ndr_flags & NDR_SCALARS) {
1869 NDR_CHECK(ndr_pull_align(ndr, 4));
1870 NDR_CHECK(ndr_pull_netlogon_command(ndr, NDR_SCALARS, &r->command));
1872 uint32_t _flags_save_string = ndr->flags;
1873 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1874 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->pdc_name));
1875 ndr->flags = _flags_save_string;
1878 uint32_t _flags_save_string = ndr->flags;
1879 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1880 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->user_name));
1881 ndr->flags = _flags_save_string;
1884 uint32_t _flags_save_string = ndr->flags;
1885 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1886 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->domain_name));
1887 ndr->flags = _flags_save_string;
1889 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->domain_uuid));
1890 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->zero_uuid));
1891 NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->forest));
1892 NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->dns_domain));
1893 NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->pdc_dns_name));
1894 NDR_CHECK(ndr_pull_ipv4address(ndr, NDR_SCALARS, &r->pdc_ip));
1895 NDR_CHECK(ndr_pull_nbt_server_type(ndr, NDR_SCALARS, &r->server_type));
1896 NDR_CHECK(ndr_pull_netlogon_nt_version_flags(ndr, NDR_SCALARS, &r->nt_version));
1897 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lmnt_token));
1898 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lm20_token));
1900 if (ndr_flags & NDR_BUFFERS) {
1902 ndr->flags = _flags_save_STRUCT;
1904 return NDR_ERR_SUCCESS;
1907 _PUBLIC_ void ndr_print_NETLOGON_SAM_LOGON_RESPONSE(struct ndr_print *ndr, const char *name, const struct NETLOGON_SAM_LOGON_RESPONSE *r)
1909 ndr_print_struct(ndr, name, "NETLOGON_SAM_LOGON_RESPONSE");
1911 uint32_t _flags_save_STRUCT = ndr->flags;
1912 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
1913 ndr->depth++;
1914 ndr_print_netlogon_command(ndr, "command", r->command);
1915 ndr_print_string(ndr, "pdc_name", r->pdc_name);
1916 ndr_print_string(ndr, "user_name", r->user_name);
1917 ndr_print_string(ndr, "domain_name", r->domain_name);
1918 ndr_print_GUID(ndr, "domain_uuid", &r->domain_uuid);
1919 ndr_print_GUID(ndr, "zero_uuid", &r->zero_uuid);
1920 ndr_print_nbt_string(ndr, "forest", r->forest);
1921 ndr_print_nbt_string(ndr, "dns_domain", r->dns_domain);
1922 ndr_print_nbt_string(ndr, "pdc_dns_name", r->pdc_dns_name);
1923 ndr_print_ipv4address(ndr, "pdc_ip", r->pdc_ip);
1924 ndr_print_nbt_server_type(ndr, "server_type", r->server_type);
1925 ndr_print_netlogon_nt_version_flags(ndr, "nt_version", r->nt_version);
1926 ndr_print_uint16(ndr, "lmnt_token", r->lmnt_token);
1927 ndr_print_uint16(ndr, "lm20_token", r->lm20_token);
1928 ndr->depth--;
1929 ndr->flags = _flags_save_STRUCT;
1933 _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)
1936 uint32_t _flags_save_STRUCT = ndr->flags;
1937 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
1938 if (ndr_flags & NDR_SCALARS) {
1939 NDR_CHECK(ndr_push_align(ndr, 4));
1940 NDR_CHECK(ndr_push_netlogon_command(ndr, NDR_SCALARS, r->command));
1941 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->sbz));
1942 NDR_CHECK(ndr_push_nbt_server_type(ndr, NDR_SCALARS, r->server_type));
1943 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->domain_uuid));
1944 NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->forest));
1945 NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->dns_domain));
1946 NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->pdc_dns_name));
1947 NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->domain));
1948 NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->pdc_name));
1949 NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->user_name));
1950 NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->server_site));
1951 NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->client_site));
1952 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, ndr_size_nbt_sockaddr(&r->sockaddr, ndr->iconv_convenience, ndr->flags)));
1954 struct ndr_push *_ndr_sockaddr;
1955 NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_sockaddr, 0, ndr_size_nbt_sockaddr(&r->sockaddr, ndr->iconv_convenience, ndr->flags)));
1956 NDR_CHECK(ndr_push_nbt_sockaddr(_ndr_sockaddr, NDR_SCALARS, &r->sockaddr));
1957 NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_sockaddr, 0, ndr_size_nbt_sockaddr(&r->sockaddr, ndr->iconv_convenience, ndr->flags)));
1959 NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->next_closest_site));
1960 NDR_CHECK(ndr_push_netlogon_nt_version_flags(ndr, NDR_SCALARS, r->nt_version));
1961 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lmnt_token));
1962 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lm20_token));
1964 if (ndr_flags & NDR_BUFFERS) {
1966 ndr->flags = _flags_save_STRUCT;
1968 return NDR_ERR_SUCCESS;
1971 _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)
1974 uint32_t _flags_save_STRUCT = ndr->flags;
1975 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
1976 if (ndr_flags & NDR_SCALARS) {
1977 NDR_CHECK(ndr_pull_align(ndr, 4));
1978 NDR_CHECK(ndr_pull_netlogon_command(ndr, NDR_SCALARS, &r->command));
1979 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->sbz));
1980 NDR_CHECK(ndr_pull_nbt_server_type(ndr, NDR_SCALARS, &r->server_type));
1981 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->domain_uuid));
1982 NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->forest));
1983 NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->dns_domain));
1984 NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->pdc_dns_name));
1985 NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->domain));
1986 NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->pdc_name));
1987 NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->user_name));
1988 NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->server_site));
1989 NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->client_site));
1990 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->sockaddr_size));
1992 struct ndr_pull *_ndr_sockaddr;
1993 NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_sockaddr, 0, r->sockaddr_size));
1994 NDR_CHECK(ndr_pull_nbt_sockaddr(_ndr_sockaddr, NDR_SCALARS, &r->sockaddr));
1995 NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_sockaddr, 0, r->sockaddr_size));
1997 NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->next_closest_site));
1998 NDR_CHECK(ndr_pull_netlogon_nt_version_flags(ndr, NDR_SCALARS, &r->nt_version));
1999 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lmnt_token));
2000 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lm20_token));
2002 if (ndr_flags & NDR_BUFFERS) {
2004 ndr->flags = _flags_save_STRUCT;
2006 return NDR_ERR_SUCCESS;
2009 _PUBLIC_ void ndr_print_NETLOGON_SAM_LOGON_RESPONSE_EX(struct ndr_print *ndr, const char *name, const struct NETLOGON_SAM_LOGON_RESPONSE_EX *r)
2011 ndr_print_struct(ndr, name, "NETLOGON_SAM_LOGON_RESPONSE_EX");
2013 uint32_t _flags_save_STRUCT = ndr->flags;
2014 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
2015 ndr->depth++;
2016 ndr_print_netlogon_command(ndr, "command", r->command);
2017 ndr_print_uint16(ndr, "sbz", r->sbz);
2018 ndr_print_nbt_server_type(ndr, "server_type", r->server_type);
2019 ndr_print_GUID(ndr, "domain_uuid", &r->domain_uuid);
2020 ndr_print_nbt_string(ndr, "forest", r->forest);
2021 ndr_print_nbt_string(ndr, "dns_domain", r->dns_domain);
2022 ndr_print_nbt_string(ndr, "pdc_dns_name", r->pdc_dns_name);
2023 ndr_print_nbt_string(ndr, "domain", r->domain);
2024 ndr_print_nbt_string(ndr, "pdc_name", r->pdc_name);
2025 ndr_print_nbt_string(ndr, "user_name", r->user_name);
2026 ndr_print_nbt_string(ndr, "server_site", r->server_site);
2027 ndr_print_nbt_string(ndr, "client_site", r->client_site);
2028 ndr_print_uint8(ndr, "sockaddr_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_nbt_sockaddr(&r->sockaddr, ndr->iconv_convenience, ndr->flags):r->sockaddr_size);
2029 ndr_print_nbt_sockaddr(ndr, "sockaddr", &r->sockaddr);
2030 ndr_print_nbt_string(ndr, "next_closest_site", r->next_closest_site);
2031 ndr_print_netlogon_nt_version_flags(ndr, "nt_version", r->nt_version);
2032 ndr_print_uint16(ndr, "lmnt_token", r->lmnt_token);
2033 ndr_print_uint16(ndr, "lm20_token", r->lm20_token);
2034 ndr->depth--;
2035 ndr->flags = _flags_save_STRUCT;
2039 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)
2041 if (ndr_flags & NDR_SCALARS) {
2042 NDR_CHECK(ndr_push_align(ndr, 4));
2044 uint32_t _flags_save_string = ndr->flags;
2045 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
2046 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->computer_name));
2047 ndr->flags = _flags_save_string;
2050 uint32_t _flags_save_string = ndr->flags;
2051 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
2052 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->mailslot_name));
2053 ndr->flags = _flags_save_string;
2056 uint32_t _flags_save_DATA_BLOB = ndr->flags;
2057 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN2);
2058 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->_pad));
2059 ndr->flags = _flags_save_DATA_BLOB;
2062 uint32_t _flags_save_string = ndr->flags;
2063 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
2064 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->unicode_name));
2065 ndr->flags = _flags_save_string;
2067 NDR_CHECK(ndr_push_netlogon_nt_version_flags(ndr, NDR_SCALARS, r->nt_version));
2068 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lmnt_token));
2069 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lm20_token));
2071 if (ndr_flags & NDR_BUFFERS) {
2073 return NDR_ERR_SUCCESS;
2076 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)
2078 if (ndr_flags & NDR_SCALARS) {
2079 NDR_CHECK(ndr_pull_align(ndr, 4));
2081 uint32_t _flags_save_string = ndr->flags;
2082 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
2083 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->computer_name));
2084 ndr->flags = _flags_save_string;
2087 uint32_t _flags_save_string = ndr->flags;
2088 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
2089 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->mailslot_name));
2090 ndr->flags = _flags_save_string;
2093 uint32_t _flags_save_DATA_BLOB = ndr->flags;
2094 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN2);
2095 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->_pad));
2096 ndr->flags = _flags_save_DATA_BLOB;
2099 uint32_t _flags_save_string = ndr->flags;
2100 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
2101 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->unicode_name));
2102 ndr->flags = _flags_save_string;
2104 NDR_CHECK(ndr_pull_netlogon_nt_version_flags(ndr, NDR_SCALARS, &r->nt_version));
2105 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lmnt_token));
2106 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lm20_token));
2108 if (ndr_flags & NDR_BUFFERS) {
2110 return NDR_ERR_SUCCESS;
2113 _PUBLIC_ void ndr_print_nbt_netlogon_query_for_pdc(struct ndr_print *ndr, const char *name, const struct nbt_netlogon_query_for_pdc *r)
2115 ndr_print_struct(ndr, name, "nbt_netlogon_query_for_pdc");
2116 ndr->depth++;
2117 ndr_print_string(ndr, "computer_name", r->computer_name);
2118 ndr_print_string(ndr, "mailslot_name", r->mailslot_name);
2119 ndr_print_DATA_BLOB(ndr, "_pad", r->_pad);
2120 ndr_print_string(ndr, "unicode_name", r->unicode_name);
2121 ndr_print_netlogon_nt_version_flags(ndr, "nt_version", r->nt_version);
2122 ndr_print_uint16(ndr, "lmnt_token", r->lmnt_token);
2123 ndr_print_uint16(ndr, "lm20_token", r->lm20_token);
2124 ndr->depth--;
2127 _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)
2130 uint32_t _flags_save_STRUCT = ndr->flags;
2131 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
2132 if (ndr_flags & NDR_SCALARS) {
2133 NDR_CHECK(ndr_push_align(ndr, 4));
2134 NDR_CHECK(ndr_push_netlogon_command(ndr, NDR_SCALARS, r->command));
2136 uint32_t _flags_save_string = ndr->flags;
2137 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
2138 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->pdc_name));
2139 ndr->flags = _flags_save_string;
2142 uint32_t _flags_save_DATA_BLOB = ndr->flags;
2143 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN2);
2144 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->_pad));
2145 ndr->flags = _flags_save_DATA_BLOB;
2148 uint32_t _flags_save_string = ndr->flags;
2149 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
2150 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->unicode_pdc_name));
2151 ndr->flags = _flags_save_string;
2154 uint32_t _flags_save_string = ndr->flags;
2155 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
2156 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->domain_name));
2157 ndr->flags = _flags_save_string;
2159 NDR_CHECK(ndr_push_netlogon_nt_version_flags(ndr, NDR_SCALARS, r->nt_version));
2160 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lmnt_token));
2161 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lm20_token));
2163 if (ndr_flags & NDR_BUFFERS) {
2165 ndr->flags = _flags_save_STRUCT;
2167 return NDR_ERR_SUCCESS;
2170 _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)
2173 uint32_t _flags_save_STRUCT = ndr->flags;
2174 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
2175 if (ndr_flags & NDR_SCALARS) {
2176 NDR_CHECK(ndr_pull_align(ndr, 4));
2177 NDR_CHECK(ndr_pull_netlogon_command(ndr, NDR_SCALARS, &r->command));
2179 uint32_t _flags_save_string = ndr->flags;
2180 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
2181 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->pdc_name));
2182 ndr->flags = _flags_save_string;
2185 uint32_t _flags_save_DATA_BLOB = ndr->flags;
2186 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN2);
2187 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->_pad));
2188 ndr->flags = _flags_save_DATA_BLOB;
2191 uint32_t _flags_save_string = ndr->flags;
2192 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
2193 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->unicode_pdc_name));
2194 ndr->flags = _flags_save_string;
2197 uint32_t _flags_save_string = ndr->flags;
2198 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
2199 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->domain_name));
2200 ndr->flags = _flags_save_string;
2202 NDR_CHECK(ndr_pull_netlogon_nt_version_flags(ndr, NDR_SCALARS, &r->nt_version));
2203 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lmnt_token));
2204 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lm20_token));
2206 if (ndr_flags & NDR_BUFFERS) {
2208 ndr->flags = _flags_save_STRUCT;
2210 return NDR_ERR_SUCCESS;
2213 _PUBLIC_ void ndr_print_nbt_netlogon_response_from_pdc(struct ndr_print *ndr, const char *name, const struct nbt_netlogon_response_from_pdc *r)
2215 ndr_print_struct(ndr, name, "nbt_netlogon_response_from_pdc");
2217 uint32_t _flags_save_STRUCT = ndr->flags;
2218 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
2219 ndr->depth++;
2220 ndr_print_netlogon_command(ndr, "command", r->command);
2221 ndr_print_string(ndr, "pdc_name", r->pdc_name);
2222 ndr_print_DATA_BLOB(ndr, "_pad", r->_pad);
2223 ndr_print_string(ndr, "unicode_pdc_name", r->unicode_pdc_name);
2224 ndr_print_string(ndr, "domain_name", r->domain_name);
2225 ndr_print_netlogon_nt_version_flags(ndr, "nt_version", r->nt_version);
2226 ndr_print_uint16(ndr, "lmnt_token", r->lmnt_token);
2227 ndr_print_uint16(ndr, "lm20_token", r->lm20_token);
2228 ndr->depth--;
2229 ndr->flags = _flags_save_STRUCT;
2233 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)
2235 if (ndr_flags & NDR_SCALARS) {
2236 NDR_CHECK(ndr_push_align(ndr, 8));
2237 NDR_CHECK(ndr_push_netr_SamDatabaseID(ndr, NDR_SCALARS, r->db_index));
2238 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->serial));
2239 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->timestamp));
2241 if (ndr_flags & NDR_BUFFERS) {
2243 return NDR_ERR_SUCCESS;
2246 static enum ndr_err_code ndr_pull_nbt_db_change_info(struct ndr_pull *ndr, int ndr_flags, struct nbt_db_change_info *r)
2248 if (ndr_flags & NDR_SCALARS) {
2249 NDR_CHECK(ndr_pull_align(ndr, 8));
2250 NDR_CHECK(ndr_pull_netr_SamDatabaseID(ndr, NDR_SCALARS, &r->db_index));
2251 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->serial));
2252 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->timestamp));
2254 if (ndr_flags & NDR_BUFFERS) {
2256 return NDR_ERR_SUCCESS;
2259 _PUBLIC_ void ndr_print_nbt_db_change_info(struct ndr_print *ndr, const char *name, const struct nbt_db_change_info *r)
2261 ndr_print_struct(ndr, name, "nbt_db_change_info");
2262 ndr->depth++;
2263 ndr_print_netr_SamDatabaseID(ndr, "db_index", r->db_index);
2264 ndr_print_hyper(ndr, "serial", r->serial);
2265 ndr_print_NTTIME(ndr, "timestamp", r->timestamp);
2266 ndr->depth--;
2269 static enum ndr_err_code ndr_push_NETLOGON_DB_CHANGE(struct ndr_push *ndr, int ndr_flags, const struct NETLOGON_DB_CHANGE *r)
2271 uint32_t cntr_dbchange_0;
2272 if (ndr_flags & NDR_SCALARS) {
2273 NDR_CHECK(ndr_push_align(ndr, 8));
2274 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->serial_lo));
2275 NDR_CHECK(ndr_push_time_t(ndr, NDR_SCALARS, r->timestamp));
2276 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pulse));
2277 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->random));
2279 uint32_t _flags_save_string = ndr->flags;
2280 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
2281 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->pdc_name));
2282 ndr->flags = _flags_save_string;
2285 uint32_t _flags_save_string = ndr->flags;
2286 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
2287 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->domain));
2288 ndr->flags = _flags_save_string;
2291 uint32_t _flags_save_DATA_BLOB = ndr->flags;
2292 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN2);
2293 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->_pad));
2294 ndr->flags = _flags_save_DATA_BLOB;
2297 uint32_t _flags_save_string = ndr->flags;
2298 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
2299 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->unicode_pdc_name));
2300 ndr->flags = _flags_save_string;
2303 uint32_t _flags_save_string = ndr->flags;
2304 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
2305 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->unicode_domain));
2306 ndr->flags = _flags_save_string;
2308 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->db_count));
2309 for (cntr_dbchange_0 = 0; cntr_dbchange_0 < r->db_count; cntr_dbchange_0++) {
2310 NDR_CHECK(ndr_push_nbt_db_change_info(ndr, NDR_SCALARS, &r->dbchange[cntr_dbchange_0]));
2312 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_dom_sid0(&r->sid, ndr->flags)));
2314 struct ndr_push *_ndr_sid;
2315 NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_sid, 0, ndr_size_dom_sid0(&r->sid, ndr->flags)));
2316 NDR_CHECK(ndr_push_dom_sid0(_ndr_sid, NDR_SCALARS|NDR_BUFFERS, &r->sid));
2317 NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_sid, 0, ndr_size_dom_sid0(&r->sid, ndr->flags)));
2319 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->message_format_version));
2320 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->message_token));
2322 if (ndr_flags & NDR_BUFFERS) {
2324 return NDR_ERR_SUCCESS;
2327 static enum ndr_err_code ndr_pull_NETLOGON_DB_CHANGE(struct ndr_pull *ndr, int ndr_flags, struct NETLOGON_DB_CHANGE *r)
2329 uint32_t size_dbchange_0 = 0;
2330 uint32_t cntr_dbchange_0;
2331 TALLOC_CTX *_mem_save_dbchange_0;
2332 if (ndr_flags & NDR_SCALARS) {
2333 NDR_CHECK(ndr_pull_align(ndr, 8));
2334 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->serial_lo));
2335 NDR_CHECK(ndr_pull_time_t(ndr, NDR_SCALARS, &r->timestamp));
2336 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pulse));
2337 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->random));
2339 uint32_t _flags_save_string = ndr->flags;
2340 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
2341 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->pdc_name));
2342 ndr->flags = _flags_save_string;
2345 uint32_t _flags_save_string = ndr->flags;
2346 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
2347 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->domain));
2348 ndr->flags = _flags_save_string;
2351 uint32_t _flags_save_DATA_BLOB = ndr->flags;
2352 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN2);
2353 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->_pad));
2354 ndr->flags = _flags_save_DATA_BLOB;
2357 uint32_t _flags_save_string = ndr->flags;
2358 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
2359 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->unicode_pdc_name));
2360 ndr->flags = _flags_save_string;
2363 uint32_t _flags_save_string = ndr->flags;
2364 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
2365 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->unicode_domain));
2366 ndr->flags = _flags_save_string;
2368 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->db_count));
2369 size_dbchange_0 = r->db_count;
2370 NDR_PULL_ALLOC_N(ndr, r->dbchange, size_dbchange_0);
2371 _mem_save_dbchange_0 = NDR_PULL_GET_MEM_CTX(ndr);
2372 NDR_PULL_SET_MEM_CTX(ndr, r->dbchange, 0);
2373 for (cntr_dbchange_0 = 0; cntr_dbchange_0 < size_dbchange_0; cntr_dbchange_0++) {
2374 NDR_CHECK(ndr_pull_nbt_db_change_info(ndr, NDR_SCALARS, &r->dbchange[cntr_dbchange_0]));
2376 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dbchange_0, 0);
2377 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sid_size));
2379 struct ndr_pull *_ndr_sid;
2380 NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_sid, 0, r->sid_size));
2381 NDR_CHECK(ndr_pull_dom_sid0(_ndr_sid, NDR_SCALARS|NDR_BUFFERS, &r->sid));
2382 NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_sid, 0, r->sid_size));
2384 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->message_format_version));
2385 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->message_token));
2387 if (ndr_flags & NDR_BUFFERS) {
2389 return NDR_ERR_SUCCESS;
2392 _PUBLIC_ void ndr_print_NETLOGON_DB_CHANGE(struct ndr_print *ndr, const char *name, const struct NETLOGON_DB_CHANGE *r)
2394 uint32_t cntr_dbchange_0;
2395 ndr_print_struct(ndr, name, "NETLOGON_DB_CHANGE");
2396 ndr->depth++;
2397 ndr_print_uint32(ndr, "serial_lo", r->serial_lo);
2398 ndr_print_time_t(ndr, "timestamp", r->timestamp);
2399 ndr_print_uint32(ndr, "pulse", r->pulse);
2400 ndr_print_uint32(ndr, "random", r->random);
2401 ndr_print_string(ndr, "pdc_name", r->pdc_name);
2402 ndr_print_string(ndr, "domain", r->domain);
2403 ndr_print_DATA_BLOB(ndr, "_pad", r->_pad);
2404 ndr_print_string(ndr, "unicode_pdc_name", r->unicode_pdc_name);
2405 ndr_print_string(ndr, "unicode_domain", r->unicode_domain);
2406 ndr_print_uint32(ndr, "db_count", r->db_count);
2407 ndr->print(ndr, "%s: ARRAY(%d)", "dbchange", (int)r->db_count);
2408 ndr->depth++;
2409 for (cntr_dbchange_0=0;cntr_dbchange_0<r->db_count;cntr_dbchange_0++) {
2410 char *idx_0=NULL;
2411 if (asprintf(&idx_0, "[%d]", cntr_dbchange_0) != -1) {
2412 ndr_print_nbt_db_change_info(ndr, "dbchange", &r->dbchange[cntr_dbchange_0]);
2413 free(idx_0);
2416 ndr->depth--;
2417 ndr_print_uint32(ndr, "sid_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_dom_sid0(&r->sid, ndr->flags):r->sid_size);
2418 ndr_print_dom_sid0(ndr, "sid", &r->sid);
2419 ndr_print_uint32(ndr, "message_format_version", r->message_format_version);
2420 ndr_print_uint32(ndr, "message_token", r->message_token);
2421 ndr->depth--;
2424 static enum ndr_err_code ndr_push_nbt_netlogon_request(struct ndr_push *ndr, int ndr_flags, const union nbt_netlogon_request *r)
2426 if (ndr_flags & NDR_SCALARS) {
2427 int level = ndr_push_get_switch_value(ndr, r);
2428 switch (level) {
2429 case LOGON_SAM_LOGON_REQUEST: {
2430 NDR_CHECK(ndr_push_NETLOGON_SAM_LOGON_REQUEST(ndr, NDR_SCALARS, &r->logon));
2431 break; }
2433 case LOGON_PRIMARY_QUERY: {
2434 NDR_CHECK(ndr_push_nbt_netlogon_query_for_pdc(ndr, NDR_SCALARS, &r->pdc));
2435 break; }
2437 case NETLOGON_ANNOUNCE_UAS: {
2438 NDR_CHECK(ndr_push_NETLOGON_DB_CHANGE(ndr, NDR_SCALARS, &r->uas));
2439 break; }
2441 default:
2442 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
2445 if (ndr_flags & NDR_BUFFERS) {
2446 int level = ndr_push_get_switch_value(ndr, r);
2447 switch (level) {
2448 case LOGON_SAM_LOGON_REQUEST:
2449 NDR_CHECK(ndr_push_NETLOGON_SAM_LOGON_REQUEST(ndr, NDR_BUFFERS, &r->logon));
2450 break;
2452 case LOGON_PRIMARY_QUERY:
2453 break;
2455 case NETLOGON_ANNOUNCE_UAS:
2456 NDR_CHECK(ndr_push_NETLOGON_DB_CHANGE(ndr, NDR_BUFFERS, &r->uas));
2457 break;
2459 default:
2460 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
2463 return NDR_ERR_SUCCESS;
2466 static enum ndr_err_code ndr_pull_nbt_netlogon_request(struct ndr_pull *ndr, int ndr_flags, union nbt_netlogon_request *r)
2468 int level;
2469 level = ndr_pull_get_switch_value(ndr, r);
2470 if (ndr_flags & NDR_SCALARS) {
2471 switch (level) {
2472 case LOGON_SAM_LOGON_REQUEST: {
2473 NDR_CHECK(ndr_pull_NETLOGON_SAM_LOGON_REQUEST(ndr, NDR_SCALARS, &r->logon));
2474 break; }
2476 case LOGON_PRIMARY_QUERY: {
2477 NDR_CHECK(ndr_pull_nbt_netlogon_query_for_pdc(ndr, NDR_SCALARS, &r->pdc));
2478 break; }
2480 case NETLOGON_ANNOUNCE_UAS: {
2481 NDR_CHECK(ndr_pull_NETLOGON_DB_CHANGE(ndr, NDR_SCALARS, &r->uas));
2482 break; }
2484 default:
2485 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
2488 if (ndr_flags & NDR_BUFFERS) {
2489 switch (level) {
2490 case LOGON_SAM_LOGON_REQUEST:
2491 NDR_CHECK(ndr_pull_NETLOGON_SAM_LOGON_REQUEST(ndr, NDR_BUFFERS, &r->logon));
2492 break;
2494 case LOGON_PRIMARY_QUERY:
2495 break;
2497 case NETLOGON_ANNOUNCE_UAS:
2498 NDR_CHECK(ndr_pull_NETLOGON_DB_CHANGE(ndr, NDR_BUFFERS, &r->uas));
2499 break;
2501 default:
2502 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
2505 return NDR_ERR_SUCCESS;
2508 _PUBLIC_ void ndr_print_nbt_netlogon_request(struct ndr_print *ndr, const char *name, const union nbt_netlogon_request *r)
2510 int level;
2511 level = ndr_print_get_switch_value(ndr, r);
2512 ndr_print_union(ndr, name, level, "nbt_netlogon_request");
2513 switch (level) {
2514 case LOGON_SAM_LOGON_REQUEST:
2515 ndr_print_NETLOGON_SAM_LOGON_REQUEST(ndr, "logon", &r->logon);
2516 break;
2518 case LOGON_PRIMARY_QUERY:
2519 ndr_print_nbt_netlogon_query_for_pdc(ndr, "pdc", &r->pdc);
2520 break;
2522 case NETLOGON_ANNOUNCE_UAS:
2523 ndr_print_NETLOGON_DB_CHANGE(ndr, "uas", &r->uas);
2524 break;
2526 default:
2527 ndr_print_bad_level(ndr, name, level);
2531 _PUBLIC_ enum ndr_err_code ndr_push_nbt_netlogon_packet(struct ndr_push *ndr, int ndr_flags, const struct nbt_netlogon_packet *r)
2534 uint32_t _flags_save_STRUCT = ndr->flags;
2535 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
2536 if (ndr_flags & NDR_SCALARS) {
2537 NDR_CHECK(ndr_push_align(ndr, 8));
2538 NDR_CHECK(ndr_push_netlogon_command(ndr, NDR_SCALARS, r->command));
2539 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->req, r->command));
2540 NDR_CHECK(ndr_push_nbt_netlogon_request(ndr, NDR_SCALARS, &r->req));
2542 if (ndr_flags & NDR_BUFFERS) {
2543 NDR_CHECK(ndr_push_nbt_netlogon_request(ndr, NDR_BUFFERS, &r->req));
2545 ndr->flags = _flags_save_STRUCT;
2547 return NDR_ERR_SUCCESS;
2550 _PUBLIC_ enum ndr_err_code ndr_pull_nbt_netlogon_packet(struct ndr_pull *ndr, int ndr_flags, struct nbt_netlogon_packet *r)
2553 uint32_t _flags_save_STRUCT = ndr->flags;
2554 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
2555 if (ndr_flags & NDR_SCALARS) {
2556 NDR_CHECK(ndr_pull_align(ndr, 8));
2557 NDR_CHECK(ndr_pull_netlogon_command(ndr, NDR_SCALARS, &r->command));
2558 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->req, r->command));
2559 NDR_CHECK(ndr_pull_nbt_netlogon_request(ndr, NDR_SCALARS, &r->req));
2561 if (ndr_flags & NDR_BUFFERS) {
2562 NDR_CHECK(ndr_pull_nbt_netlogon_request(ndr, NDR_BUFFERS, &r->req));
2564 ndr->flags = _flags_save_STRUCT;
2566 return NDR_ERR_SUCCESS;
2569 _PUBLIC_ void ndr_print_nbt_netlogon_packet(struct ndr_print *ndr, const char *name, const struct nbt_netlogon_packet *r)
2571 ndr_print_struct(ndr, name, "nbt_netlogon_packet");
2573 uint32_t _flags_save_STRUCT = ndr->flags;
2574 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
2575 ndr->depth++;
2576 ndr_print_netlogon_command(ndr, "command", r->command);
2577 ndr_print_set_switch_value(ndr, &r->req, r->command);
2578 ndr_print_nbt_netlogon_request(ndr, "req", &r->req);
2579 ndr->depth--;
2580 ndr->flags = _flags_save_STRUCT;
2584 static enum ndr_err_code ndr_push_nbt_browse_opcode(struct ndr_push *ndr, int ndr_flags, enum nbt_browse_opcode r)
2586 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r));
2587 return NDR_ERR_SUCCESS;
2590 static enum ndr_err_code ndr_pull_nbt_browse_opcode(struct ndr_pull *ndr, int ndr_flags, enum nbt_browse_opcode *r)
2592 uint8_t v;
2593 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &v));
2594 *r = v;
2595 return NDR_ERR_SUCCESS;
2598 _PUBLIC_ void ndr_print_nbt_browse_opcode(struct ndr_print *ndr, const char *name, enum nbt_browse_opcode r)
2600 const char *val = NULL;
2602 switch (r) {
2603 case HostAnnouncement: val = "HostAnnouncement"; break;
2604 case AnnouncementRequest: val = "AnnouncementRequest"; break;
2605 case Election: val = "Election"; break;
2606 case GetBackupListReq: val = "GetBackupListReq"; break;
2607 case GetBackupListResp: val = "GetBackupListResp"; break;
2608 case BecomeBackup: val = "BecomeBackup"; break;
2609 case DomainAnnouncement: val = "DomainAnnouncement"; break;
2610 case MasterAnnouncement: val = "MasterAnnouncement"; break;
2611 case ResetBrowserState: val = "ResetBrowserState"; break;
2612 case LocalMasterAnnouncement: val = "LocalMasterAnnouncement"; break;
2614 ndr_print_enum(ndr, name, "ENUM", val, r);
2617 static enum ndr_err_code ndr_push_nbt_browse_host_announcement(struct ndr_push *ndr, int ndr_flags, const struct nbt_browse_host_announcement *r)
2619 if (ndr_flags & NDR_SCALARS) {
2620 NDR_CHECK(ndr_push_align(ndr, 4));
2621 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->UpdateCount));
2622 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->Periodicity));
2623 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->ServerName, 16, sizeof(uint8_t), CH_DOS));
2624 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->OSMajor));
2625 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->OSMinor));
2626 NDR_CHECK(ndr_push_svcctl_ServerType(ndr, NDR_SCALARS, r->ServerType));
2627 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->BroMajorVer));
2628 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->BroMinorVer));
2629 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->Signature));
2631 uint32_t _flags_save_string = ndr->flags;
2632 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
2633 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->Comment));
2634 ndr->flags = _flags_save_string;
2637 if (ndr_flags & NDR_BUFFERS) {
2639 return NDR_ERR_SUCCESS;
2642 static enum ndr_err_code ndr_pull_nbt_browse_host_announcement(struct ndr_pull *ndr, int ndr_flags, struct nbt_browse_host_announcement *r)
2644 uint32_t size_ServerName_0 = 0;
2645 if (ndr_flags & NDR_SCALARS) {
2646 NDR_CHECK(ndr_pull_align(ndr, 4));
2647 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->UpdateCount));
2648 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->Periodicity));
2649 size_ServerName_0 = 16;
2650 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->ServerName, size_ServerName_0, sizeof(uint8_t), CH_DOS));
2651 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->OSMajor));
2652 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->OSMinor));
2653 NDR_CHECK(ndr_pull_svcctl_ServerType(ndr, NDR_SCALARS, &r->ServerType));
2654 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->BroMajorVer));
2655 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->BroMinorVer));
2656 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->Signature));
2658 uint32_t _flags_save_string = ndr->flags;
2659 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
2660 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->Comment));
2661 ndr->flags = _flags_save_string;
2664 if (ndr_flags & NDR_BUFFERS) {
2666 return NDR_ERR_SUCCESS;
2669 _PUBLIC_ void ndr_print_nbt_browse_host_announcement(struct ndr_print *ndr, const char *name, const struct nbt_browse_host_announcement *r)
2671 ndr_print_struct(ndr, name, "nbt_browse_host_announcement");
2672 ndr->depth++;
2673 ndr_print_uint8(ndr, "UpdateCount", r->UpdateCount);
2674 ndr_print_uint32(ndr, "Periodicity", r->Periodicity);
2675 ndr_print_string(ndr, "ServerName", r->ServerName);
2676 ndr_print_uint8(ndr, "OSMajor", r->OSMajor);
2677 ndr_print_uint8(ndr, "OSMinor", r->OSMinor);
2678 ndr_print_svcctl_ServerType(ndr, "ServerType", r->ServerType);
2679 ndr_print_uint8(ndr, "BroMajorVer", r->BroMajorVer);
2680 ndr_print_uint8(ndr, "BroMinorVer", r->BroMinorVer);
2681 ndr_print_uint16(ndr, "Signature", r->Signature);
2682 ndr_print_string(ndr, "Comment", r->Comment);
2683 ndr->depth--;
2686 static enum ndr_err_code ndr_push_nbt_browse_announcement_request(struct ndr_push *ndr, int ndr_flags, const struct nbt_browse_announcement_request *r)
2688 if (ndr_flags & NDR_SCALARS) {
2689 NDR_CHECK(ndr_push_align(ndr, 4));
2690 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->Unused));
2692 uint32_t _flags_save_string = ndr->flags;
2693 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
2694 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->ResponseName));
2695 ndr->flags = _flags_save_string;
2698 if (ndr_flags & NDR_BUFFERS) {
2700 return NDR_ERR_SUCCESS;
2703 static enum ndr_err_code ndr_pull_nbt_browse_announcement_request(struct ndr_pull *ndr, int ndr_flags, struct nbt_browse_announcement_request *r)
2705 if (ndr_flags & NDR_SCALARS) {
2706 NDR_CHECK(ndr_pull_align(ndr, 4));
2707 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->Unused));
2709 uint32_t _flags_save_string = ndr->flags;
2710 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
2711 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->ResponseName));
2712 ndr->flags = _flags_save_string;
2715 if (ndr_flags & NDR_BUFFERS) {
2717 return NDR_ERR_SUCCESS;
2720 _PUBLIC_ void ndr_print_nbt_browse_announcement_request(struct ndr_print *ndr, const char *name, const struct nbt_browse_announcement_request *r)
2722 ndr_print_struct(ndr, name, "nbt_browse_announcement_request");
2723 ndr->depth++;
2724 ndr_print_uint8(ndr, "Unused", r->Unused);
2725 ndr_print_string(ndr, "ResponseName", r->ResponseName);
2726 ndr->depth--;
2729 static enum ndr_err_code ndr_push_nbt_browse_election_request(struct ndr_push *ndr, int ndr_flags, const struct nbt_browse_election_request *r)
2731 if (ndr_flags & NDR_SCALARS) {
2732 NDR_CHECK(ndr_push_align(ndr, 4));
2733 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->Version));
2734 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->Criteria));
2735 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->UpTime));
2736 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->Reserved));
2738 uint32_t _flags_save_string = ndr->flags;
2739 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
2740 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->ServerName));
2741 ndr->flags = _flags_save_string;
2744 if (ndr_flags & NDR_BUFFERS) {
2746 return NDR_ERR_SUCCESS;
2749 static enum ndr_err_code ndr_pull_nbt_browse_election_request(struct ndr_pull *ndr, int ndr_flags, struct nbt_browse_election_request *r)
2751 if (ndr_flags & NDR_SCALARS) {
2752 NDR_CHECK(ndr_pull_align(ndr, 4));
2753 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->Version));
2754 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->Criteria));
2755 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->UpTime));
2756 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->Reserved));
2758 uint32_t _flags_save_string = ndr->flags;
2759 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
2760 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->ServerName));
2761 ndr->flags = _flags_save_string;
2764 if (ndr_flags & NDR_BUFFERS) {
2766 return NDR_ERR_SUCCESS;
2769 _PUBLIC_ void ndr_print_nbt_browse_election_request(struct ndr_print *ndr, const char *name, const struct nbt_browse_election_request *r)
2771 ndr_print_struct(ndr, name, "nbt_browse_election_request");
2772 ndr->depth++;
2773 ndr_print_uint8(ndr, "Version", r->Version);
2774 ndr_print_uint32(ndr, "Criteria", r->Criteria);
2775 ndr_print_uint32(ndr, "UpTime", r->UpTime);
2776 ndr_print_uint32(ndr, "Reserved", r->Reserved);
2777 ndr_print_string(ndr, "ServerName", r->ServerName);
2778 ndr->depth--;
2781 static enum ndr_err_code ndr_push_nbt_browse_backup_list_request(struct ndr_push *ndr, int ndr_flags, const struct nbt_browse_backup_list_request *r)
2783 if (ndr_flags & NDR_SCALARS) {
2784 NDR_CHECK(ndr_push_align(ndr, 4));
2785 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->ReqCount));
2786 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->Token));
2788 if (ndr_flags & NDR_BUFFERS) {
2790 return NDR_ERR_SUCCESS;
2793 static enum ndr_err_code ndr_pull_nbt_browse_backup_list_request(struct ndr_pull *ndr, int ndr_flags, struct nbt_browse_backup_list_request *r)
2795 if (ndr_flags & NDR_SCALARS) {
2796 NDR_CHECK(ndr_pull_align(ndr, 4));
2797 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->ReqCount));
2798 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->Token));
2800 if (ndr_flags & NDR_BUFFERS) {
2802 return NDR_ERR_SUCCESS;
2805 _PUBLIC_ void ndr_print_nbt_browse_backup_list_request(struct ndr_print *ndr, const char *name, const struct nbt_browse_backup_list_request *r)
2807 ndr_print_struct(ndr, name, "nbt_browse_backup_list_request");
2808 ndr->depth++;
2809 ndr_print_uint8(ndr, "ReqCount", r->ReqCount);
2810 ndr_print_uint32(ndr, "Token", r->Token);
2811 ndr->depth--;
2814 static enum ndr_err_code ndr_push_nbt_browse_backup_list_response(struct ndr_push *ndr, int ndr_flags, const struct nbt_browse_backup_list_response *r)
2816 uint32_t cntr_BackupServerList_0;
2817 if (ndr_flags & NDR_SCALARS) {
2818 NDR_CHECK(ndr_push_align(ndr, 4));
2819 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->BackupCount));
2820 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->Token));
2821 for (cntr_BackupServerList_0 = 0; cntr_BackupServerList_0 < r->BackupCount; cntr_BackupServerList_0++) {
2822 NDR_CHECK(ndr_push_nbt_name(ndr, NDR_SCALARS, &r->BackupServerList[cntr_BackupServerList_0]));
2825 if (ndr_flags & NDR_BUFFERS) {
2827 return NDR_ERR_SUCCESS;
2830 static enum ndr_err_code ndr_pull_nbt_browse_backup_list_response(struct ndr_pull *ndr, int ndr_flags, struct nbt_browse_backup_list_response *r)
2832 uint32_t size_BackupServerList_0 = 0;
2833 uint32_t cntr_BackupServerList_0;
2834 TALLOC_CTX *_mem_save_BackupServerList_0;
2835 if (ndr_flags & NDR_SCALARS) {
2836 NDR_CHECK(ndr_pull_align(ndr, 4));
2837 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->BackupCount));
2838 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->Token));
2839 size_BackupServerList_0 = r->BackupCount;
2840 NDR_PULL_ALLOC_N(ndr, r->BackupServerList, size_BackupServerList_0);
2841 _mem_save_BackupServerList_0 = NDR_PULL_GET_MEM_CTX(ndr);
2842 NDR_PULL_SET_MEM_CTX(ndr, r->BackupServerList, 0);
2843 for (cntr_BackupServerList_0 = 0; cntr_BackupServerList_0 < size_BackupServerList_0; cntr_BackupServerList_0++) {
2844 NDR_CHECK(ndr_pull_nbt_name(ndr, NDR_SCALARS, &r->BackupServerList[cntr_BackupServerList_0]));
2846 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_BackupServerList_0, 0);
2848 if (ndr_flags & NDR_BUFFERS) {
2850 return NDR_ERR_SUCCESS;
2853 _PUBLIC_ void ndr_print_nbt_browse_backup_list_response(struct ndr_print *ndr, const char *name, const struct nbt_browse_backup_list_response *r)
2855 uint32_t cntr_BackupServerList_0;
2856 ndr_print_struct(ndr, name, "nbt_browse_backup_list_response");
2857 ndr->depth++;
2858 ndr_print_uint8(ndr, "BackupCount", r->BackupCount);
2859 ndr_print_uint32(ndr, "Token", r->Token);
2860 ndr->print(ndr, "%s: ARRAY(%d)", "BackupServerList", (int)r->BackupCount);
2861 ndr->depth++;
2862 for (cntr_BackupServerList_0=0;cntr_BackupServerList_0<r->BackupCount;cntr_BackupServerList_0++) {
2863 char *idx_0=NULL;
2864 if (asprintf(&idx_0, "[%d]", cntr_BackupServerList_0) != -1) {
2865 ndr_print_nbt_name(ndr, "BackupServerList", &r->BackupServerList[cntr_BackupServerList_0]);
2866 free(idx_0);
2869 ndr->depth--;
2870 ndr->depth--;
2873 static enum ndr_err_code ndr_push_nbt_browse_become_backup(struct ndr_push *ndr, int ndr_flags, const struct nbt_browse_become_backup *r)
2875 if (ndr_flags & NDR_SCALARS) {
2876 NDR_CHECK(ndr_push_align(ndr, 4));
2878 uint32_t _flags_save_string = ndr->flags;
2879 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
2880 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->BrowserName));
2881 ndr->flags = _flags_save_string;
2884 if (ndr_flags & NDR_BUFFERS) {
2886 return NDR_ERR_SUCCESS;
2889 static enum ndr_err_code ndr_pull_nbt_browse_become_backup(struct ndr_pull *ndr, int ndr_flags, struct nbt_browse_become_backup *r)
2891 if (ndr_flags & NDR_SCALARS) {
2892 NDR_CHECK(ndr_pull_align(ndr, 4));
2894 uint32_t _flags_save_string = ndr->flags;
2895 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
2896 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->BrowserName));
2897 ndr->flags = _flags_save_string;
2900 if (ndr_flags & NDR_BUFFERS) {
2902 return NDR_ERR_SUCCESS;
2905 _PUBLIC_ void ndr_print_nbt_browse_become_backup(struct ndr_print *ndr, const char *name, const struct nbt_browse_become_backup *r)
2907 ndr_print_struct(ndr, name, "nbt_browse_become_backup");
2908 ndr->depth++;
2909 ndr_print_string(ndr, "BrowserName", r->BrowserName);
2910 ndr->depth--;
2913 static enum ndr_err_code ndr_push_nbt_browse_domain_announcement(struct ndr_push *ndr, int ndr_flags, const struct nbt_browse_domain_announcement *r)
2915 if (ndr_flags & NDR_SCALARS) {
2916 NDR_CHECK(ndr_push_align(ndr, 4));
2917 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->UpdateCount));
2918 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->Periodicity));
2919 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->ServerName, 16, sizeof(uint8_t), CH_DOS));
2920 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->OSMajor));
2921 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->OSMinor));
2922 NDR_CHECK(ndr_push_svcctl_ServerType(ndr, NDR_SCALARS, r->ServerType));
2923 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->MysteriousField));
2925 uint32_t _flags_save_string = ndr->flags;
2926 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
2927 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->Comment));
2928 ndr->flags = _flags_save_string;
2931 if (ndr_flags & NDR_BUFFERS) {
2933 return NDR_ERR_SUCCESS;
2936 static enum ndr_err_code ndr_pull_nbt_browse_domain_announcement(struct ndr_pull *ndr, int ndr_flags, struct nbt_browse_domain_announcement *r)
2938 uint32_t size_ServerName_0 = 0;
2939 if (ndr_flags & NDR_SCALARS) {
2940 NDR_CHECK(ndr_pull_align(ndr, 4));
2941 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->UpdateCount));
2942 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->Periodicity));
2943 size_ServerName_0 = 16;
2944 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->ServerName, size_ServerName_0, sizeof(uint8_t), CH_DOS));
2945 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->OSMajor));
2946 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->OSMinor));
2947 NDR_CHECK(ndr_pull_svcctl_ServerType(ndr, NDR_SCALARS, &r->ServerType));
2948 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->MysteriousField));
2950 uint32_t _flags_save_string = ndr->flags;
2951 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
2952 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->Comment));
2953 ndr->flags = _flags_save_string;
2956 if (ndr_flags & NDR_BUFFERS) {
2958 return NDR_ERR_SUCCESS;
2961 _PUBLIC_ void ndr_print_nbt_browse_domain_announcement(struct ndr_print *ndr, const char *name, const struct nbt_browse_domain_announcement *r)
2963 ndr_print_struct(ndr, name, "nbt_browse_domain_announcement");
2964 ndr->depth++;
2965 ndr_print_uint8(ndr, "UpdateCount", r->UpdateCount);
2966 ndr_print_uint32(ndr, "Periodicity", r->Periodicity);
2967 ndr_print_string(ndr, "ServerName", r->ServerName);
2968 ndr_print_uint8(ndr, "OSMajor", r->OSMajor);
2969 ndr_print_uint8(ndr, "OSMinor", r->OSMinor);
2970 ndr_print_svcctl_ServerType(ndr, "ServerType", r->ServerType);
2971 ndr_print_uint32(ndr, "MysteriousField", r->MysteriousField);
2972 ndr_print_string(ndr, "Comment", r->Comment);
2973 ndr->depth--;
2976 static enum ndr_err_code ndr_push_nbt_browse_master_announcement(struct ndr_push *ndr, int ndr_flags, const struct nbt_browse_master_announcement *r)
2978 if (ndr_flags & NDR_SCALARS) {
2979 NDR_CHECK(ndr_push_align(ndr, 4));
2981 uint32_t _flags_save_string = ndr->flags;
2982 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
2983 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->ServerName));
2984 ndr->flags = _flags_save_string;
2987 if (ndr_flags & NDR_BUFFERS) {
2989 return NDR_ERR_SUCCESS;
2992 static enum ndr_err_code ndr_pull_nbt_browse_master_announcement(struct ndr_pull *ndr, int ndr_flags, struct nbt_browse_master_announcement *r)
2994 if (ndr_flags & NDR_SCALARS) {
2995 NDR_CHECK(ndr_pull_align(ndr, 4));
2997 uint32_t _flags_save_string = ndr->flags;
2998 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
2999 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->ServerName));
3000 ndr->flags = _flags_save_string;
3003 if (ndr_flags & NDR_BUFFERS) {
3005 return NDR_ERR_SUCCESS;
3008 _PUBLIC_ void ndr_print_nbt_browse_master_announcement(struct ndr_print *ndr, const char *name, const struct nbt_browse_master_announcement *r)
3010 ndr_print_struct(ndr, name, "nbt_browse_master_announcement");
3011 ndr->depth++;
3012 ndr_print_string(ndr, "ServerName", r->ServerName);
3013 ndr->depth--;
3016 static enum ndr_err_code ndr_push_nbt_browse_reset_state(struct ndr_push *ndr, int ndr_flags, const struct nbt_browse_reset_state *r)
3018 if (ndr_flags & NDR_SCALARS) {
3019 NDR_CHECK(ndr_push_align(ndr, 1));
3020 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->Command));
3022 if (ndr_flags & NDR_BUFFERS) {
3024 return NDR_ERR_SUCCESS;
3027 static enum ndr_err_code ndr_pull_nbt_browse_reset_state(struct ndr_pull *ndr, int ndr_flags, struct nbt_browse_reset_state *r)
3029 if (ndr_flags & NDR_SCALARS) {
3030 NDR_CHECK(ndr_pull_align(ndr, 1));
3031 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->Command));
3033 if (ndr_flags & NDR_BUFFERS) {
3035 return NDR_ERR_SUCCESS;
3038 _PUBLIC_ void ndr_print_nbt_browse_reset_state(struct ndr_print *ndr, const char *name, const struct nbt_browse_reset_state *r)
3040 ndr_print_struct(ndr, name, "nbt_browse_reset_state");
3041 ndr->depth++;
3042 ndr_print_uint8(ndr, "Command", r->Command);
3043 ndr->depth--;
3046 static enum ndr_err_code ndr_push_nbt_browse_local_master_announcement(struct ndr_push *ndr, int ndr_flags, const struct nbt_browse_local_master_announcement *r)
3048 if (ndr_flags & NDR_SCALARS) {
3049 NDR_CHECK(ndr_push_align(ndr, 4));
3050 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->UpdateCount));
3051 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->Periodicity));
3052 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->ServerName, 16, sizeof(uint8_t), CH_DOS));
3053 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->OSMajor));
3054 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->OSMinor));
3055 NDR_CHECK(ndr_push_svcctl_ServerType(ndr, NDR_SCALARS, r->ServerType));
3056 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->BroMajorVer));
3057 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->BroMinorVer));
3058 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->Signature));
3060 uint32_t _flags_save_string = ndr->flags;
3061 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
3062 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->Comment));
3063 ndr->flags = _flags_save_string;
3066 if (ndr_flags & NDR_BUFFERS) {
3068 return NDR_ERR_SUCCESS;
3071 static enum ndr_err_code ndr_pull_nbt_browse_local_master_announcement(struct ndr_pull *ndr, int ndr_flags, struct nbt_browse_local_master_announcement *r)
3073 uint32_t size_ServerName_0 = 0;
3074 if (ndr_flags & NDR_SCALARS) {
3075 NDR_CHECK(ndr_pull_align(ndr, 4));
3076 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->UpdateCount));
3077 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->Periodicity));
3078 size_ServerName_0 = 16;
3079 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->ServerName, size_ServerName_0, sizeof(uint8_t), CH_DOS));
3080 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->OSMajor));
3081 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->OSMinor));
3082 NDR_CHECK(ndr_pull_svcctl_ServerType(ndr, NDR_SCALARS, &r->ServerType));
3083 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->BroMajorVer));
3084 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->BroMinorVer));
3085 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->Signature));
3087 uint32_t _flags_save_string = ndr->flags;
3088 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
3089 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->Comment));
3090 ndr->flags = _flags_save_string;
3093 if (ndr_flags & NDR_BUFFERS) {
3095 return NDR_ERR_SUCCESS;
3098 _PUBLIC_ void ndr_print_nbt_browse_local_master_announcement(struct ndr_print *ndr, const char *name, const struct nbt_browse_local_master_announcement *r)
3100 ndr_print_struct(ndr, name, "nbt_browse_local_master_announcement");
3101 ndr->depth++;
3102 ndr_print_uint8(ndr, "UpdateCount", r->UpdateCount);
3103 ndr_print_uint32(ndr, "Periodicity", r->Periodicity);
3104 ndr_print_string(ndr, "ServerName", r->ServerName);
3105 ndr_print_uint8(ndr, "OSMajor", r->OSMajor);
3106 ndr_print_uint8(ndr, "OSMinor", r->OSMinor);
3107 ndr_print_svcctl_ServerType(ndr, "ServerType", r->ServerType);
3108 ndr_print_uint8(ndr, "BroMajorVer", r->BroMajorVer);
3109 ndr_print_uint8(ndr, "BroMinorVer", r->BroMinorVer);
3110 ndr_print_uint16(ndr, "Signature", r->Signature);
3111 ndr_print_string(ndr, "Comment", r->Comment);
3112 ndr->depth--;
3115 static enum ndr_err_code ndr_push_nbt_browse_payload(struct ndr_push *ndr, int ndr_flags, const union nbt_browse_payload *r)
3117 if (ndr_flags & NDR_SCALARS) {
3118 int level = ndr_push_get_switch_value(ndr, r);
3119 switch (level) {
3120 case HostAnnouncement: {
3121 NDR_CHECK(ndr_push_nbt_browse_host_announcement(ndr, NDR_SCALARS, &r->host_annoucement));
3122 break; }
3124 case AnnouncementRequest: {
3125 NDR_CHECK(ndr_push_nbt_browse_announcement_request(ndr, NDR_SCALARS, &r->announcement_request));
3126 break; }
3128 case Election: {
3129 NDR_CHECK(ndr_push_nbt_browse_election_request(ndr, NDR_SCALARS, &r->election_request));
3130 break; }
3132 case GetBackupListReq: {
3133 NDR_CHECK(ndr_push_nbt_browse_backup_list_request(ndr, NDR_SCALARS, &r->backup_list_request));
3134 break; }
3136 case GetBackupListResp: {
3137 NDR_CHECK(ndr_push_nbt_browse_backup_list_response(ndr, NDR_SCALARS, &r->backup_list_response));
3138 break; }
3140 case BecomeBackup: {
3141 NDR_CHECK(ndr_push_nbt_browse_become_backup(ndr, NDR_SCALARS, &r->become_backup));
3142 break; }
3144 case DomainAnnouncement: {
3145 NDR_CHECK(ndr_push_nbt_browse_domain_announcement(ndr, NDR_SCALARS, &r->domain_announcement));
3146 break; }
3148 case MasterAnnouncement: {
3149 NDR_CHECK(ndr_push_nbt_browse_master_announcement(ndr, NDR_SCALARS, &r->master_announcement));
3150 break; }
3152 case ResetBrowserState: {
3153 NDR_CHECK(ndr_push_nbt_browse_reset_state(ndr, NDR_SCALARS, &r->reset_browser_state));
3154 break; }
3156 case LocalMasterAnnouncement: {
3157 NDR_CHECK(ndr_push_nbt_browse_local_master_announcement(ndr, NDR_SCALARS, &r->local_master_announcement));
3158 break; }
3160 default:
3161 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
3164 if (ndr_flags & NDR_BUFFERS) {
3165 int level = ndr_push_get_switch_value(ndr, r);
3166 switch (level) {
3167 case HostAnnouncement:
3168 break;
3170 case AnnouncementRequest:
3171 break;
3173 case Election:
3174 break;
3176 case GetBackupListReq:
3177 break;
3179 case GetBackupListResp:
3180 break;
3182 case BecomeBackup:
3183 break;
3185 case DomainAnnouncement:
3186 break;
3188 case MasterAnnouncement:
3189 break;
3191 case ResetBrowserState:
3192 break;
3194 case LocalMasterAnnouncement:
3195 break;
3197 default:
3198 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
3201 return NDR_ERR_SUCCESS;
3204 static enum ndr_err_code ndr_pull_nbt_browse_payload(struct ndr_pull *ndr, int ndr_flags, union nbt_browse_payload *r)
3206 int level;
3207 level = ndr_pull_get_switch_value(ndr, r);
3208 if (ndr_flags & NDR_SCALARS) {
3209 switch (level) {
3210 case HostAnnouncement: {
3211 NDR_CHECK(ndr_pull_nbt_browse_host_announcement(ndr, NDR_SCALARS, &r->host_annoucement));
3212 break; }
3214 case AnnouncementRequest: {
3215 NDR_CHECK(ndr_pull_nbt_browse_announcement_request(ndr, NDR_SCALARS, &r->announcement_request));
3216 break; }
3218 case Election: {
3219 NDR_CHECK(ndr_pull_nbt_browse_election_request(ndr, NDR_SCALARS, &r->election_request));
3220 break; }
3222 case GetBackupListReq: {
3223 NDR_CHECK(ndr_pull_nbt_browse_backup_list_request(ndr, NDR_SCALARS, &r->backup_list_request));
3224 break; }
3226 case GetBackupListResp: {
3227 NDR_CHECK(ndr_pull_nbt_browse_backup_list_response(ndr, NDR_SCALARS, &r->backup_list_response));
3228 break; }
3230 case BecomeBackup: {
3231 NDR_CHECK(ndr_pull_nbt_browse_become_backup(ndr, NDR_SCALARS, &r->become_backup));
3232 break; }
3234 case DomainAnnouncement: {
3235 NDR_CHECK(ndr_pull_nbt_browse_domain_announcement(ndr, NDR_SCALARS, &r->domain_announcement));
3236 break; }
3238 case MasterAnnouncement: {
3239 NDR_CHECK(ndr_pull_nbt_browse_master_announcement(ndr, NDR_SCALARS, &r->master_announcement));
3240 break; }
3242 case ResetBrowserState: {
3243 NDR_CHECK(ndr_pull_nbt_browse_reset_state(ndr, NDR_SCALARS, &r->reset_browser_state));
3244 break; }
3246 case LocalMasterAnnouncement: {
3247 NDR_CHECK(ndr_pull_nbt_browse_local_master_announcement(ndr, NDR_SCALARS, &r->local_master_announcement));
3248 break; }
3250 default:
3251 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
3254 if (ndr_flags & NDR_BUFFERS) {
3255 switch (level) {
3256 case HostAnnouncement:
3257 break;
3259 case AnnouncementRequest:
3260 break;
3262 case Election:
3263 break;
3265 case GetBackupListReq:
3266 break;
3268 case GetBackupListResp:
3269 break;
3271 case BecomeBackup:
3272 break;
3274 case DomainAnnouncement:
3275 break;
3277 case MasterAnnouncement:
3278 break;
3280 case ResetBrowserState:
3281 break;
3283 case LocalMasterAnnouncement:
3284 break;
3286 default:
3287 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
3290 return NDR_ERR_SUCCESS;
3293 _PUBLIC_ void ndr_print_nbt_browse_payload(struct ndr_print *ndr, const char *name, const union nbt_browse_payload *r)
3295 int level;
3296 level = ndr_print_get_switch_value(ndr, r);
3297 ndr_print_union(ndr, name, level, "nbt_browse_payload");
3298 switch (level) {
3299 case HostAnnouncement:
3300 ndr_print_nbt_browse_host_announcement(ndr, "host_annoucement", &r->host_annoucement);
3301 break;
3303 case AnnouncementRequest:
3304 ndr_print_nbt_browse_announcement_request(ndr, "announcement_request", &r->announcement_request);
3305 break;
3307 case Election:
3308 ndr_print_nbt_browse_election_request(ndr, "election_request", &r->election_request);
3309 break;
3311 case GetBackupListReq:
3312 ndr_print_nbt_browse_backup_list_request(ndr, "backup_list_request", &r->backup_list_request);
3313 break;
3315 case GetBackupListResp:
3316 ndr_print_nbt_browse_backup_list_response(ndr, "backup_list_response", &r->backup_list_response);
3317 break;
3319 case BecomeBackup:
3320 ndr_print_nbt_browse_become_backup(ndr, "become_backup", &r->become_backup);
3321 break;
3323 case DomainAnnouncement:
3324 ndr_print_nbt_browse_domain_announcement(ndr, "domain_announcement", &r->domain_announcement);
3325 break;
3327 case MasterAnnouncement:
3328 ndr_print_nbt_browse_master_announcement(ndr, "master_announcement", &r->master_announcement);
3329 break;
3331 case ResetBrowserState:
3332 ndr_print_nbt_browse_reset_state(ndr, "reset_browser_state", &r->reset_browser_state);
3333 break;
3335 case LocalMasterAnnouncement:
3336 ndr_print_nbt_browse_local_master_announcement(ndr, "local_master_announcement", &r->local_master_announcement);
3337 break;
3339 default:
3340 ndr_print_bad_level(ndr, name, level);
3344 _PUBLIC_ enum ndr_err_code ndr_push_nbt_browse_packet(struct ndr_push *ndr, int ndr_flags, const struct nbt_browse_packet *r)
3347 uint32_t _flags_save_STRUCT = ndr->flags;
3348 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
3349 if (ndr_flags & NDR_SCALARS) {
3350 NDR_CHECK(ndr_push_align(ndr, 4));
3351 NDR_CHECK(ndr_push_nbt_browse_opcode(ndr, NDR_SCALARS, r->opcode));
3352 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->payload, r->opcode));
3353 NDR_CHECK(ndr_push_nbt_browse_payload(ndr, NDR_SCALARS, &r->payload));
3355 if (ndr_flags & NDR_BUFFERS) {
3357 ndr->flags = _flags_save_STRUCT;
3359 return NDR_ERR_SUCCESS;
3362 _PUBLIC_ enum ndr_err_code ndr_pull_nbt_browse_packet(struct ndr_pull *ndr, int ndr_flags, struct nbt_browse_packet *r)
3365 uint32_t _flags_save_STRUCT = ndr->flags;
3366 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
3367 if (ndr_flags & NDR_SCALARS) {
3368 NDR_CHECK(ndr_pull_align(ndr, 4));
3369 NDR_CHECK(ndr_pull_nbt_browse_opcode(ndr, NDR_SCALARS, &r->opcode));
3370 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->payload, r->opcode));
3371 NDR_CHECK(ndr_pull_nbt_browse_payload(ndr, NDR_SCALARS, &r->payload));
3373 if (ndr_flags & NDR_BUFFERS) {
3375 ndr->flags = _flags_save_STRUCT;
3377 return NDR_ERR_SUCCESS;
3380 _PUBLIC_ void ndr_print_nbt_browse_packet(struct ndr_print *ndr, const char *name, const struct nbt_browse_packet *r)
3382 ndr_print_struct(ndr, name, "nbt_browse_packet");
3384 uint32_t _flags_save_STRUCT = ndr->flags;
3385 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
3386 ndr->depth++;
3387 ndr_print_nbt_browse_opcode(ndr, "opcode", r->opcode);
3388 ndr_print_set_switch_value(ndr, &r->payload, r->opcode);
3389 ndr_print_nbt_browse_payload(ndr, "payload", &r->payload);
3390 ndr->depth--;
3391 ndr->flags = _flags_save_STRUCT;