librpc: rerun "make idl"
[Samba/cd1.git] / librpc / gen_ndr / ndr_nbt.c
blobdc9e8cb8d36e5a9c59110a41d4b36564a5dd0fa4
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_enum_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_enum_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_enum_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_enum_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_enum_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_enum_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));
139 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
141 if (ndr_flags & NDR_BUFFERS) {
143 return NDR_ERR_SUCCESS;
146 static enum ndr_err_code ndr_pull_nbt_name_question(struct ndr_pull *ndr, int ndr_flags, struct nbt_name_question *r)
148 if (ndr_flags & NDR_SCALARS) {
149 NDR_CHECK(ndr_pull_align(ndr, 4));
150 NDR_CHECK(ndr_pull_nbt_name(ndr, NDR_SCALARS, &r->name));
151 NDR_CHECK(ndr_pull_nbt_qtype(ndr, NDR_SCALARS, &r->question_type));
152 NDR_CHECK(ndr_pull_nbt_qclass(ndr, NDR_SCALARS, &r->question_class));
153 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
155 if (ndr_flags & NDR_BUFFERS) {
157 return NDR_ERR_SUCCESS;
160 _PUBLIC_ void ndr_print_nbt_name_question(struct ndr_print *ndr, const char *name, const struct nbt_name_question *r)
162 ndr_print_struct(ndr, name, "nbt_name_question");
163 ndr->depth++;
164 ndr_print_nbt_name(ndr, "name", &r->name);
165 ndr_print_nbt_qtype(ndr, "question_type", r->question_type);
166 ndr_print_nbt_qclass(ndr, "question_class", r->question_class);
167 ndr->depth--;
170 static enum ndr_err_code ndr_push_nb_flags(struct ndr_push *ndr, int ndr_flags, uint16_t r)
172 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r));
173 return NDR_ERR_SUCCESS;
176 static enum ndr_err_code ndr_pull_nb_flags(struct ndr_pull *ndr, int ndr_flags, uint16_t *r)
178 uint16_t v;
179 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v));
180 *r = v;
181 return NDR_ERR_SUCCESS;
184 _PUBLIC_ void ndr_print_nb_flags(struct ndr_print *ndr, const char *name, uint16_t r)
186 ndr_print_uint16(ndr, name, r);
187 ndr->depth++;
188 ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NBT_NM_PERMANENT", NBT_NM_PERMANENT, r);
189 ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NBT_NM_ACTIVE", NBT_NM_ACTIVE, r);
190 ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NBT_NM_CONFLICT", NBT_NM_CONFLICT, r);
191 ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NBT_NM_DEREGISTER", NBT_NM_DEREGISTER, r);
192 ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NBT_NM_OWNER_TYPE", NBT_NM_OWNER_TYPE, r);
193 ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NBT_NM_GROUP", NBT_NM_GROUP, r);
194 ndr->depth--;
197 static enum ndr_err_code ndr_push_nbt_rdata_address(struct ndr_push *ndr, int ndr_flags, const struct nbt_rdata_address *r)
199 if (ndr_flags & NDR_SCALARS) {
200 NDR_CHECK(ndr_push_align(ndr, 4));
201 NDR_CHECK(ndr_push_nb_flags(ndr, NDR_SCALARS, r->nb_flags));
202 NDR_CHECK(ndr_push_ipv4address(ndr, NDR_SCALARS, r->ipaddr));
203 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
205 if (ndr_flags & NDR_BUFFERS) {
207 return NDR_ERR_SUCCESS;
210 static enum ndr_err_code ndr_pull_nbt_rdata_address(struct ndr_pull *ndr, int ndr_flags, struct nbt_rdata_address *r)
212 if (ndr_flags & NDR_SCALARS) {
213 NDR_CHECK(ndr_pull_align(ndr, 4));
214 NDR_CHECK(ndr_pull_nb_flags(ndr, NDR_SCALARS, &r->nb_flags));
215 NDR_CHECK(ndr_pull_ipv4address(ndr, NDR_SCALARS, &r->ipaddr));
216 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
218 if (ndr_flags & NDR_BUFFERS) {
220 return NDR_ERR_SUCCESS;
223 _PUBLIC_ void ndr_print_nbt_rdata_address(struct ndr_print *ndr, const char *name, const struct nbt_rdata_address *r)
225 ndr_print_struct(ndr, name, "nbt_rdata_address");
226 ndr->depth++;
227 ndr_print_nb_flags(ndr, "nb_flags", r->nb_flags);
228 ndr_print_ipv4address(ndr, "ipaddr", r->ipaddr);
229 ndr->depth--;
232 static enum ndr_err_code ndr_push_nbt_rdata_netbios(struct ndr_push *ndr, int ndr_flags, const struct nbt_rdata_netbios *r)
234 uint32_t cntr_addresses_0;
235 if (ndr_flags & NDR_SCALARS) {
236 NDR_CHECK(ndr_push_align(ndr, 4));
237 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->length));
238 for (cntr_addresses_0 = 0; cntr_addresses_0 < r->length / 6; cntr_addresses_0++) {
239 NDR_CHECK(ndr_push_nbt_rdata_address(ndr, NDR_SCALARS, &r->addresses[cntr_addresses_0]));
241 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
243 if (ndr_flags & NDR_BUFFERS) {
245 return NDR_ERR_SUCCESS;
248 static enum ndr_err_code ndr_pull_nbt_rdata_netbios(struct ndr_pull *ndr, int ndr_flags, struct nbt_rdata_netbios *r)
250 uint32_t cntr_addresses_0;
251 TALLOC_CTX *_mem_save_addresses_0;
252 if (ndr_flags & NDR_SCALARS) {
253 NDR_CHECK(ndr_pull_align(ndr, 4));
254 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length));
255 NDR_PULL_ALLOC_N(ndr, r->addresses, r->length / 6);
256 _mem_save_addresses_0 = NDR_PULL_GET_MEM_CTX(ndr);
257 NDR_PULL_SET_MEM_CTX(ndr, r->addresses, 0);
258 for (cntr_addresses_0 = 0; cntr_addresses_0 < r->length / 6; cntr_addresses_0++) {
259 NDR_CHECK(ndr_pull_nbt_rdata_address(ndr, NDR_SCALARS, &r->addresses[cntr_addresses_0]));
261 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_addresses_0, 0);
262 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
264 if (ndr_flags & NDR_BUFFERS) {
266 return NDR_ERR_SUCCESS;
269 _PUBLIC_ void ndr_print_nbt_rdata_netbios(struct ndr_print *ndr, const char *name, const struct nbt_rdata_netbios *r)
271 uint32_t cntr_addresses_0;
272 ndr_print_struct(ndr, name, "nbt_rdata_netbios");
273 ndr->depth++;
274 ndr_print_uint16(ndr, "length", r->length);
275 ndr->print(ndr, "%s: ARRAY(%d)", "addresses", (int)r->length / 6);
276 ndr->depth++;
277 for (cntr_addresses_0=0;cntr_addresses_0<r->length / 6;cntr_addresses_0++) {
278 char *idx_0=NULL;
279 if (asprintf(&idx_0, "[%d]", cntr_addresses_0) != -1) {
280 ndr_print_nbt_rdata_address(ndr, "addresses", &r->addresses[cntr_addresses_0]);
281 free(idx_0);
284 ndr->depth--;
285 ndr->depth--;
288 static enum ndr_err_code ndr_push_nbt_statistics(struct ndr_push *ndr, int ndr_flags, const struct nbt_statistics *r)
290 if (ndr_flags & NDR_SCALARS) {
291 NDR_CHECK(ndr_push_align(ndr, 4));
292 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->unit_id, 6));
293 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->jumpers));
294 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->test_result));
295 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->version_number));
296 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->period_of_statistics));
297 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->number_of_crcs));
298 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->number_alignment_errors));
299 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->number_of_collisions));
300 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->number_send_aborts));
301 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->number_good_sends));
302 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->number_good_receives));
303 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->number_retransmits));
304 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->number_no_resource_conditions));
305 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->number_free_command_blocks));
306 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->total_number_command_blocks));
307 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->max_total_number_command_blocks));
308 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->number_pending_sessions));
309 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->max_number_pending_sessions));
310 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->max_total_sessions_possible));
311 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->session_data_packet_size));
312 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
314 if (ndr_flags & NDR_BUFFERS) {
316 return NDR_ERR_SUCCESS;
319 static enum ndr_err_code ndr_pull_nbt_statistics(struct ndr_pull *ndr, int ndr_flags, struct nbt_statistics *r)
321 if (ndr_flags & NDR_SCALARS) {
322 NDR_CHECK(ndr_pull_align(ndr, 4));
323 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->unit_id, 6));
324 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->jumpers));
325 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->test_result));
326 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->version_number));
327 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->period_of_statistics));
328 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->number_of_crcs));
329 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->number_alignment_errors));
330 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->number_of_collisions));
331 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->number_send_aborts));
332 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->number_good_sends));
333 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->number_good_receives));
334 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->number_retransmits));
335 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->number_no_resource_conditions));
336 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->number_free_command_blocks));
337 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->total_number_command_blocks));
338 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->max_total_number_command_blocks));
339 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->number_pending_sessions));
340 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->max_number_pending_sessions));
341 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->max_total_sessions_possible));
342 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->session_data_packet_size));
343 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
345 if (ndr_flags & NDR_BUFFERS) {
347 return NDR_ERR_SUCCESS;
350 _PUBLIC_ void ndr_print_nbt_statistics(struct ndr_print *ndr, const char *name, const struct nbt_statistics *r)
352 ndr_print_struct(ndr, name, "nbt_statistics");
353 ndr->depth++;
354 ndr_print_array_uint8(ndr, "unit_id", r->unit_id, 6);
355 ndr_print_uint8(ndr, "jumpers", r->jumpers);
356 ndr_print_uint8(ndr, "test_result", r->test_result);
357 ndr_print_uint16(ndr, "version_number", r->version_number);
358 ndr_print_uint16(ndr, "period_of_statistics", r->period_of_statistics);
359 ndr_print_uint16(ndr, "number_of_crcs", r->number_of_crcs);
360 ndr_print_uint16(ndr, "number_alignment_errors", r->number_alignment_errors);
361 ndr_print_uint16(ndr, "number_of_collisions", r->number_of_collisions);
362 ndr_print_uint16(ndr, "number_send_aborts", r->number_send_aborts);
363 ndr_print_uint32(ndr, "number_good_sends", r->number_good_sends);
364 ndr_print_uint32(ndr, "number_good_receives", r->number_good_receives);
365 ndr_print_uint16(ndr, "number_retransmits", r->number_retransmits);
366 ndr_print_uint16(ndr, "number_no_resource_conditions", r->number_no_resource_conditions);
367 ndr_print_uint16(ndr, "number_free_command_blocks", r->number_free_command_blocks);
368 ndr_print_uint16(ndr, "total_number_command_blocks", r->total_number_command_blocks);
369 ndr_print_uint16(ndr, "max_total_number_command_blocks", r->max_total_number_command_blocks);
370 ndr_print_uint16(ndr, "number_pending_sessions", r->number_pending_sessions);
371 ndr_print_uint16(ndr, "max_number_pending_sessions", r->max_number_pending_sessions);
372 ndr_print_uint16(ndr, "max_total_sessions_possible", r->max_total_sessions_possible);
373 ndr_print_uint16(ndr, "session_data_packet_size", r->session_data_packet_size);
374 ndr->depth--;
377 static enum ndr_err_code ndr_push_nbt_status_name(struct ndr_push *ndr, int ndr_flags, const struct nbt_status_name *r)
379 if (ndr_flags & NDR_SCALARS) {
380 NDR_CHECK(ndr_push_align(ndr, 2));
381 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->name, 15, sizeof(uint8_t), CH_DOS));
382 NDR_CHECK(ndr_push_nbt_name_type(ndr, NDR_SCALARS, r->type));
383 NDR_CHECK(ndr_push_nb_flags(ndr, NDR_SCALARS, r->nb_flags));
384 NDR_CHECK(ndr_push_trailer_align(ndr, 2));
386 if (ndr_flags & NDR_BUFFERS) {
388 return NDR_ERR_SUCCESS;
391 static enum ndr_err_code ndr_pull_nbt_status_name(struct ndr_pull *ndr, int ndr_flags, struct nbt_status_name *r)
393 if (ndr_flags & NDR_SCALARS) {
394 NDR_CHECK(ndr_pull_align(ndr, 2));
395 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->name, 15, sizeof(uint8_t), CH_DOS));
396 NDR_CHECK(ndr_pull_nbt_name_type(ndr, NDR_SCALARS, &r->type));
397 NDR_CHECK(ndr_pull_nb_flags(ndr, NDR_SCALARS, &r->nb_flags));
398 NDR_CHECK(ndr_pull_trailer_align(ndr, 2));
400 if (ndr_flags & NDR_BUFFERS) {
402 return NDR_ERR_SUCCESS;
405 _PUBLIC_ void ndr_print_nbt_status_name(struct ndr_print *ndr, const char *name, const struct nbt_status_name *r)
407 ndr_print_struct(ndr, name, "nbt_status_name");
408 ndr->depth++;
409 ndr_print_string(ndr, "name", r->name);
410 ndr_print_nbt_name_type(ndr, "type", r->type);
411 ndr_print_nb_flags(ndr, "nb_flags", r->nb_flags);
412 ndr->depth--;
415 static enum ndr_err_code ndr_push_nbt_rdata_status(struct ndr_push *ndr, int ndr_flags, const struct nbt_rdata_status *r)
417 uint32_t cntr_names_0;
418 if (ndr_flags & NDR_SCALARS) {
419 NDR_CHECK(ndr_push_align(ndr, 4));
420 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->num_names * 18 + 47));
421 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->num_names));
422 for (cntr_names_0 = 0; cntr_names_0 < r->num_names; cntr_names_0++) {
423 NDR_CHECK(ndr_push_nbt_status_name(ndr, NDR_SCALARS, &r->names[cntr_names_0]));
425 NDR_CHECK(ndr_push_nbt_statistics(ndr, NDR_SCALARS, &r->statistics));
426 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
428 if (ndr_flags & NDR_BUFFERS) {
430 return NDR_ERR_SUCCESS;
433 static enum ndr_err_code ndr_pull_nbt_rdata_status(struct ndr_pull *ndr, int ndr_flags, struct nbt_rdata_status *r)
435 uint32_t cntr_names_0;
436 TALLOC_CTX *_mem_save_names_0;
437 if (ndr_flags & NDR_SCALARS) {
438 NDR_CHECK(ndr_pull_align(ndr, 4));
439 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length));
440 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->num_names));
441 NDR_PULL_ALLOC_N(ndr, r->names, r->num_names);
442 _mem_save_names_0 = NDR_PULL_GET_MEM_CTX(ndr);
443 NDR_PULL_SET_MEM_CTX(ndr, r->names, 0);
444 for (cntr_names_0 = 0; cntr_names_0 < r->num_names; cntr_names_0++) {
445 NDR_CHECK(ndr_pull_nbt_status_name(ndr, NDR_SCALARS, &r->names[cntr_names_0]));
447 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_names_0, 0);
448 NDR_CHECK(ndr_pull_nbt_statistics(ndr, NDR_SCALARS, &r->statistics));
449 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
451 if (ndr_flags & NDR_BUFFERS) {
453 return NDR_ERR_SUCCESS;
456 _PUBLIC_ void ndr_print_nbt_rdata_status(struct ndr_print *ndr, const char *name, const struct nbt_rdata_status *r)
458 uint32_t cntr_names_0;
459 ndr_print_struct(ndr, name, "nbt_rdata_status");
460 ndr->depth++;
461 ndr_print_uint16(ndr, "length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->num_names * 18 + 47:r->length);
462 ndr_print_uint8(ndr, "num_names", r->num_names);
463 ndr->print(ndr, "%s: ARRAY(%d)", "names", (int)r->num_names);
464 ndr->depth++;
465 for (cntr_names_0=0;cntr_names_0<r->num_names;cntr_names_0++) {
466 char *idx_0=NULL;
467 if (asprintf(&idx_0, "[%d]", cntr_names_0) != -1) {
468 ndr_print_nbt_status_name(ndr, "names", &r->names[cntr_names_0]);
469 free(idx_0);
472 ndr->depth--;
473 ndr_print_nbt_statistics(ndr, "statistics", &r->statistics);
474 ndr->depth--;
477 static enum ndr_err_code ndr_push_nbt_rdata_data(struct ndr_push *ndr, int ndr_flags, const struct nbt_rdata_data *r)
479 if (ndr_flags & NDR_SCALARS) {
480 NDR_CHECK(ndr_push_align(ndr, 2));
481 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->length));
482 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, r->length));
483 NDR_CHECK(ndr_push_trailer_align(ndr, 2));
485 if (ndr_flags & NDR_BUFFERS) {
487 return NDR_ERR_SUCCESS;
490 static enum ndr_err_code ndr_pull_nbt_rdata_data(struct ndr_pull *ndr, int ndr_flags, struct nbt_rdata_data *r)
492 if (ndr_flags & NDR_SCALARS) {
493 NDR_CHECK(ndr_pull_align(ndr, 2));
494 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length));
495 NDR_PULL_ALLOC_N(ndr, r->data, r->length);
496 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, r->length));
497 NDR_CHECK(ndr_pull_trailer_align(ndr, 2));
499 if (ndr_flags & NDR_BUFFERS) {
501 return NDR_ERR_SUCCESS;
504 _PUBLIC_ void ndr_print_nbt_rdata_data(struct ndr_print *ndr, const char *name, const struct nbt_rdata_data *r)
506 ndr_print_struct(ndr, name, "nbt_rdata_data");
507 ndr->depth++;
508 ndr_print_uint16(ndr, "length", r->length);
509 ndr_print_array_uint8(ndr, "data", r->data, r->length);
510 ndr->depth--;
513 _PUBLIC_ enum ndr_err_code ndr_push_nbt_rdata(struct ndr_push *ndr, int ndr_flags, const union nbt_rdata *r)
515 if (ndr_flags & NDR_SCALARS) {
516 int level = ndr_push_get_switch_value(ndr, r);
517 NDR_CHECK(ndr_push_union_align(ndr, 4));
518 switch (level) {
519 case NBT_QTYPE_NETBIOS: {
520 NDR_CHECK(ndr_push_nbt_rdata_netbios(ndr, NDR_SCALARS, &r->netbios));
521 break; }
523 case NBT_QTYPE_STATUS: {
524 NDR_CHECK(ndr_push_nbt_rdata_status(ndr, NDR_SCALARS, &r->status));
525 break; }
527 default: {
528 NDR_CHECK(ndr_push_nbt_rdata_data(ndr, NDR_SCALARS, &r->data));
529 break; }
533 if (ndr_flags & NDR_BUFFERS) {
534 int level = ndr_push_get_switch_value(ndr, r);
535 switch (level) {
536 case NBT_QTYPE_NETBIOS:
537 break;
539 case NBT_QTYPE_STATUS:
540 break;
542 default:
543 break;
547 return NDR_ERR_SUCCESS;
550 _PUBLIC_ enum ndr_err_code ndr_pull_nbt_rdata(struct ndr_pull *ndr, int ndr_flags, union nbt_rdata *r)
552 int level;
553 level = ndr_pull_get_switch_value(ndr, r);
554 if (ndr_flags & NDR_SCALARS) {
555 NDR_CHECK(ndr_pull_union_align(ndr, 4));
556 switch (level) {
557 case NBT_QTYPE_NETBIOS: {
558 NDR_CHECK(ndr_pull_nbt_rdata_netbios(ndr, NDR_SCALARS, &r->netbios));
559 break; }
561 case NBT_QTYPE_STATUS: {
562 NDR_CHECK(ndr_pull_nbt_rdata_status(ndr, NDR_SCALARS, &r->status));
563 break; }
565 default: {
566 NDR_CHECK(ndr_pull_nbt_rdata_data(ndr, NDR_SCALARS, &r->data));
567 break; }
571 if (ndr_flags & NDR_BUFFERS) {
572 switch (level) {
573 case NBT_QTYPE_NETBIOS:
574 break;
576 case NBT_QTYPE_STATUS:
577 break;
579 default:
580 break;
584 return NDR_ERR_SUCCESS;
587 _PUBLIC_ void ndr_print_nbt_rdata(struct ndr_print *ndr, const char *name, const union nbt_rdata *r)
589 int level;
590 level = ndr_print_get_switch_value(ndr, r);
591 ndr_print_union(ndr, name, level, "nbt_rdata");
592 switch (level) {
593 case NBT_QTYPE_NETBIOS:
594 ndr_print_nbt_rdata_netbios(ndr, "netbios", &r->netbios);
595 break;
597 case NBT_QTYPE_STATUS:
598 ndr_print_nbt_rdata_status(ndr, "status", &r->status);
599 break;
601 default:
602 ndr_print_nbt_rdata_data(ndr, "data", &r->data);
603 break;
608 static enum ndr_err_code ndr_pull_nbt_res_rec(struct ndr_pull *ndr, int ndr_flags, struct nbt_res_rec *r)
611 uint32_t _flags_save_STRUCT = ndr->flags;
612 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
613 if (ndr_flags & NDR_SCALARS) {
614 NDR_CHECK(ndr_pull_align(ndr, 4));
615 NDR_CHECK(ndr_pull_nbt_name(ndr, NDR_SCALARS, &r->name));
616 NDR_CHECK(ndr_pull_nbt_qtype(ndr, NDR_SCALARS, &r->rr_type));
617 NDR_CHECK(ndr_pull_nbt_qclass(ndr, NDR_SCALARS, &r->rr_class));
618 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->ttl));
619 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->rdata, r->rr_type));
620 NDR_CHECK(ndr_pull_nbt_rdata(ndr, NDR_SCALARS, &r->rdata));
621 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
623 if (ndr_flags & NDR_BUFFERS) {
625 ndr->flags = _flags_save_STRUCT;
627 return NDR_ERR_SUCCESS;
630 _PUBLIC_ void ndr_print_nbt_res_rec(struct ndr_print *ndr, const char *name, const struct nbt_res_rec *r)
632 ndr_print_struct(ndr, name, "nbt_res_rec");
634 uint32_t _flags_save_STRUCT = ndr->flags;
635 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
636 ndr->depth++;
637 ndr_print_nbt_name(ndr, "name", &r->name);
638 ndr_print_nbt_qtype(ndr, "rr_type", r->rr_type);
639 ndr_print_nbt_qclass(ndr, "rr_class", r->rr_class);
640 ndr_print_uint32(ndr, "ttl", r->ttl);
641 ndr_print_set_switch_value(ndr, &r->rdata, r->rr_type);
642 ndr_print_nbt_rdata(ndr, "rdata", &r->rdata);
643 ndr->depth--;
644 ndr->flags = _flags_save_STRUCT;
648 _PUBLIC_ enum ndr_err_code ndr_push_nbt_name_packet(struct ndr_push *ndr, int ndr_flags, const struct nbt_name_packet *r)
650 uint32_t cntr_questions_0;
651 uint32_t cntr_answers_0;
652 uint32_t cntr_nsrecs_0;
653 uint32_t cntr_additional_0;
655 uint32_t _flags_save_STRUCT = ndr->flags;
656 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_BIGENDIAN|LIBNDR_PRINT_ARRAY_HEX);
657 if (ndr_flags & NDR_SCALARS) {
658 NDR_CHECK(ndr_push_align(ndr, 4));
659 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->name_trn_id));
660 NDR_CHECK(ndr_push_nbt_operation(ndr, NDR_SCALARS, r->operation));
661 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->qdcount));
662 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->ancount));
663 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->nscount));
664 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->arcount));
665 for (cntr_questions_0 = 0; cntr_questions_0 < r->qdcount; cntr_questions_0++) {
666 NDR_CHECK(ndr_push_nbt_name_question(ndr, NDR_SCALARS, &r->questions[cntr_questions_0]));
668 for (cntr_answers_0 = 0; cntr_answers_0 < r->ancount; cntr_answers_0++) {
669 NDR_CHECK(ndr_push_nbt_res_rec(ndr, NDR_SCALARS, &r->answers[cntr_answers_0]));
671 for (cntr_nsrecs_0 = 0; cntr_nsrecs_0 < r->nscount; cntr_nsrecs_0++) {
672 NDR_CHECK(ndr_push_nbt_res_rec(ndr, NDR_SCALARS, &r->nsrecs[cntr_nsrecs_0]));
674 for (cntr_additional_0 = 0; cntr_additional_0 < r->arcount; cntr_additional_0++) {
675 NDR_CHECK(ndr_push_nbt_res_rec(ndr, NDR_SCALARS, &r->additional[cntr_additional_0]));
678 uint32_t _flags_save_DATA_BLOB = ndr->flags;
679 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
680 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->padding));
681 ndr->flags = _flags_save_DATA_BLOB;
683 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
685 if (ndr_flags & NDR_BUFFERS) {
687 ndr->flags = _flags_save_STRUCT;
689 return NDR_ERR_SUCCESS;
692 _PUBLIC_ enum ndr_err_code ndr_pull_nbt_name_packet(struct ndr_pull *ndr, int ndr_flags, struct nbt_name_packet *r)
694 uint32_t cntr_questions_0;
695 TALLOC_CTX *_mem_save_questions_0;
696 uint32_t cntr_answers_0;
697 TALLOC_CTX *_mem_save_answers_0;
698 uint32_t cntr_nsrecs_0;
699 TALLOC_CTX *_mem_save_nsrecs_0;
700 uint32_t cntr_additional_0;
701 TALLOC_CTX *_mem_save_additional_0;
703 uint32_t _flags_save_STRUCT = ndr->flags;
704 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_BIGENDIAN|LIBNDR_PRINT_ARRAY_HEX);
705 if (ndr_flags & NDR_SCALARS) {
706 NDR_CHECK(ndr_pull_align(ndr, 4));
707 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->name_trn_id));
708 NDR_CHECK(ndr_pull_nbt_operation(ndr, NDR_SCALARS, &r->operation));
709 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->qdcount));
710 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->ancount));
711 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->nscount));
712 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->arcount));
713 NDR_PULL_ALLOC_N(ndr, r->questions, r->qdcount);
714 _mem_save_questions_0 = NDR_PULL_GET_MEM_CTX(ndr);
715 NDR_PULL_SET_MEM_CTX(ndr, r->questions, 0);
716 for (cntr_questions_0 = 0; cntr_questions_0 < r->qdcount; cntr_questions_0++) {
717 NDR_CHECK(ndr_pull_nbt_name_question(ndr, NDR_SCALARS, &r->questions[cntr_questions_0]));
719 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_questions_0, 0);
720 NDR_PULL_ALLOC_N(ndr, r->answers, r->ancount);
721 _mem_save_answers_0 = NDR_PULL_GET_MEM_CTX(ndr);
722 NDR_PULL_SET_MEM_CTX(ndr, r->answers, 0);
723 for (cntr_answers_0 = 0; cntr_answers_0 < r->ancount; cntr_answers_0++) {
724 NDR_CHECK(ndr_pull_nbt_res_rec(ndr, NDR_SCALARS, &r->answers[cntr_answers_0]));
726 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_answers_0, 0);
727 NDR_PULL_ALLOC_N(ndr, r->nsrecs, r->nscount);
728 _mem_save_nsrecs_0 = NDR_PULL_GET_MEM_CTX(ndr);
729 NDR_PULL_SET_MEM_CTX(ndr, r->nsrecs, 0);
730 for (cntr_nsrecs_0 = 0; cntr_nsrecs_0 < r->nscount; cntr_nsrecs_0++) {
731 NDR_CHECK(ndr_pull_nbt_res_rec(ndr, NDR_SCALARS, &r->nsrecs[cntr_nsrecs_0]));
733 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_nsrecs_0, 0);
734 NDR_PULL_ALLOC_N(ndr, r->additional, r->arcount);
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 < r->arcount; 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;
747 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
749 if (ndr_flags & NDR_BUFFERS) {
751 ndr->flags = _flags_save_STRUCT;
753 return NDR_ERR_SUCCESS;
756 _PUBLIC_ void ndr_print_nbt_name_packet(struct ndr_print *ndr, const char *name, const struct nbt_name_packet *r)
758 uint32_t cntr_questions_0;
759 uint32_t cntr_answers_0;
760 uint32_t cntr_nsrecs_0;
761 uint32_t cntr_additional_0;
762 ndr_print_struct(ndr, name, "nbt_name_packet");
764 uint32_t _flags_save_STRUCT = ndr->flags;
765 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_BIGENDIAN|LIBNDR_PRINT_ARRAY_HEX);
766 ndr->depth++;
767 ndr_print_uint16(ndr, "name_trn_id", r->name_trn_id);
768 ndr_print_nbt_operation(ndr, "operation", r->operation);
769 ndr_print_uint16(ndr, "qdcount", r->qdcount);
770 ndr_print_uint16(ndr, "ancount", r->ancount);
771 ndr_print_uint16(ndr, "nscount", r->nscount);
772 ndr_print_uint16(ndr, "arcount", r->arcount);
773 ndr->print(ndr, "%s: ARRAY(%d)", "questions", (int)r->qdcount);
774 ndr->depth++;
775 for (cntr_questions_0=0;cntr_questions_0<r->qdcount;cntr_questions_0++) {
776 char *idx_0=NULL;
777 if (asprintf(&idx_0, "[%d]", cntr_questions_0) != -1) {
778 ndr_print_nbt_name_question(ndr, "questions", &r->questions[cntr_questions_0]);
779 free(idx_0);
782 ndr->depth--;
783 ndr->print(ndr, "%s: ARRAY(%d)", "answers", (int)r->ancount);
784 ndr->depth++;
785 for (cntr_answers_0=0;cntr_answers_0<r->ancount;cntr_answers_0++) {
786 char *idx_0=NULL;
787 if (asprintf(&idx_0, "[%d]", cntr_answers_0) != -1) {
788 ndr_print_nbt_res_rec(ndr, "answers", &r->answers[cntr_answers_0]);
789 free(idx_0);
792 ndr->depth--;
793 ndr->print(ndr, "%s: ARRAY(%d)", "nsrecs", (int)r->nscount);
794 ndr->depth++;
795 for (cntr_nsrecs_0=0;cntr_nsrecs_0<r->nscount;cntr_nsrecs_0++) {
796 char *idx_0=NULL;
797 if (asprintf(&idx_0, "[%d]", cntr_nsrecs_0) != -1) {
798 ndr_print_nbt_res_rec(ndr, "nsrecs", &r->nsrecs[cntr_nsrecs_0]);
799 free(idx_0);
802 ndr->depth--;
803 ndr->print(ndr, "%s: ARRAY(%d)", "additional", (int)r->arcount);
804 ndr->depth++;
805 for (cntr_additional_0=0;cntr_additional_0<r->arcount;cntr_additional_0++) {
806 char *idx_0=NULL;
807 if (asprintf(&idx_0, "[%d]", cntr_additional_0) != -1) {
808 ndr_print_nbt_res_rec(ndr, "additional", &r->additional[cntr_additional_0]);
809 free(idx_0);
812 ndr->depth--;
813 ndr_print_DATA_BLOB(ndr, "padding", r->padding);
814 ndr->depth--;
815 ndr->flags = _flags_save_STRUCT;
819 static enum ndr_err_code ndr_push_dgram_msg_type(struct ndr_push *ndr, int ndr_flags, enum dgram_msg_type r)
821 NDR_CHECK(ndr_push_enum_uint8(ndr, NDR_SCALARS, r));
822 return NDR_ERR_SUCCESS;
825 static enum ndr_err_code ndr_pull_dgram_msg_type(struct ndr_pull *ndr, int ndr_flags, enum dgram_msg_type *r)
827 uint8_t v;
828 NDR_CHECK(ndr_pull_enum_uint8(ndr, NDR_SCALARS, &v));
829 *r = v;
830 return NDR_ERR_SUCCESS;
833 _PUBLIC_ void ndr_print_dgram_msg_type(struct ndr_print *ndr, const char *name, enum dgram_msg_type r)
835 const char *val = NULL;
837 switch (r) {
838 case DGRAM_DIRECT_UNIQUE: val = "DGRAM_DIRECT_UNIQUE"; break;
839 case DGRAM_DIRECT_GROUP: val = "DGRAM_DIRECT_GROUP"; break;
840 case DGRAM_BCAST: val = "DGRAM_BCAST"; break;
841 case DGRAM_ERROR: val = "DGRAM_ERROR"; break;
842 case DGRAM_QUERY: val = "DGRAM_QUERY"; break;
843 case DGRAM_QUERY_POSITIVE: val = "DGRAM_QUERY_POSITIVE"; break;
844 case DGRAM_QUERY_NEGATIVE: val = "DGRAM_QUERY_NEGATIVE"; break;
846 ndr_print_enum(ndr, name, "ENUM", val, r);
849 static enum ndr_err_code ndr_push_dgram_flags(struct ndr_push *ndr, int ndr_flags, uint8_t r)
851 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r));
852 return NDR_ERR_SUCCESS;
855 static enum ndr_err_code ndr_pull_dgram_flags(struct ndr_pull *ndr, int ndr_flags, uint8_t *r)
857 uint8_t v;
858 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &v));
859 *r = v;
860 return NDR_ERR_SUCCESS;
863 _PUBLIC_ void ndr_print_dgram_flags(struct ndr_print *ndr, const char *name, uint8_t r)
865 ndr_print_uint8(ndr, name, r);
866 ndr->depth++;
867 ndr_print_bitmap_flag(ndr, sizeof(uint8_t), "DGRAM_FLAG_MORE", DGRAM_FLAG_MORE, r);
868 ndr_print_bitmap_flag(ndr, sizeof(uint8_t), "DGRAM_FLAG_FIRST", DGRAM_FLAG_FIRST, r);
869 ndr_print_bitmap_flag(ndr, sizeof(uint8_t), "DGRAM_FLAG_NODE_TYPE", DGRAM_FLAG_NODE_TYPE, r);
870 ndr->depth--;
873 static enum ndr_err_code ndr_push_smb_command(struct ndr_push *ndr, int ndr_flags, enum smb_command r)
875 NDR_CHECK(ndr_push_enum_uint8(ndr, NDR_SCALARS, r));
876 return NDR_ERR_SUCCESS;
879 static enum ndr_err_code ndr_pull_smb_command(struct ndr_pull *ndr, int ndr_flags, enum smb_command *r)
881 uint8_t v;
882 NDR_CHECK(ndr_pull_enum_uint8(ndr, NDR_SCALARS, &v));
883 *r = v;
884 return NDR_ERR_SUCCESS;
887 _PUBLIC_ void ndr_print_smb_command(struct ndr_print *ndr, const char *name, enum smb_command r)
889 const char *val = NULL;
891 switch (r) {
892 case SMB_TRANSACTION: val = "SMB_TRANSACTION"; break;
894 ndr_print_enum(ndr, name, "ENUM", val, r);
897 static enum ndr_err_code ndr_push_smb_trans_body(struct ndr_push *ndr, int ndr_flags, const struct smb_trans_body *r)
899 if (ndr_flags & NDR_SCALARS) {
900 NDR_CHECK(ndr_push_align(ndr, 4));
901 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, 17));
902 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->total_param_count));
903 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->total_data_count));
904 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->max_param_count));
905 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->max_data_count));
906 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->max_setup_count));
907 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->pad));
908 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->trans_flags));
909 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->timeout));
910 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->reserved));
911 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->param_count));
912 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->param_offset));
913 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->data_count));
914 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->data_offset));
915 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, 3));
916 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->pad2));
917 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->opcode));
918 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->priority));
919 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->_class));
920 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, strlen(r->mailslot_name) + 1 + r->data.length));
922 uint32_t _flags_save_string = ndr->flags;
923 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
924 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->mailslot_name));
925 ndr->flags = _flags_save_string;
928 uint32_t _flags_save_DATA_BLOB = ndr->flags;
929 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
930 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->data));
931 ndr->flags = _flags_save_DATA_BLOB;
933 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
935 if (ndr_flags & NDR_BUFFERS) {
937 return NDR_ERR_SUCCESS;
940 static enum ndr_err_code ndr_pull_smb_trans_body(struct ndr_pull *ndr, int ndr_flags, struct smb_trans_body *r)
942 if (ndr_flags & NDR_SCALARS) {
943 NDR_CHECK(ndr_pull_align(ndr, 4));
944 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->wct));
945 if (r->wct < 17 || r->wct > 17) {
946 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
948 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->total_param_count));
949 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->total_data_count));
950 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->max_param_count));
951 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->max_data_count));
952 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->max_setup_count));
953 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->pad));
954 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->trans_flags));
955 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->timeout));
956 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->reserved));
957 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->param_count));
958 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->param_offset));
959 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->data_count));
960 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->data_offset));
961 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->setup_count));
962 if (r->setup_count < 3 || r->setup_count > 3) {
963 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
965 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->pad2));
966 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->opcode));
967 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->priority));
968 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->_class));
969 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->byte_count));
971 uint32_t _flags_save_string = ndr->flags;
972 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
973 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->mailslot_name));
974 ndr->flags = _flags_save_string;
977 uint32_t _flags_save_DATA_BLOB = ndr->flags;
978 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
979 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->data));
980 ndr->flags = _flags_save_DATA_BLOB;
982 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
984 if (ndr_flags & NDR_BUFFERS) {
986 return NDR_ERR_SUCCESS;
989 _PUBLIC_ void ndr_print_smb_trans_body(struct ndr_print *ndr, const char *name, const struct smb_trans_body *r)
991 ndr_print_struct(ndr, name, "smb_trans_body");
992 ndr->depth++;
993 ndr_print_uint8(ndr, "wct", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?17:r->wct);
994 ndr_print_uint16(ndr, "total_param_count", r->total_param_count);
995 ndr_print_uint16(ndr, "total_data_count", r->total_data_count);
996 ndr_print_uint16(ndr, "max_param_count", r->max_param_count);
997 ndr_print_uint16(ndr, "max_data_count", r->max_data_count);
998 ndr_print_uint8(ndr, "max_setup_count", r->max_setup_count);
999 ndr_print_uint8(ndr, "pad", r->pad);
1000 ndr_print_uint16(ndr, "trans_flags", r->trans_flags);
1001 ndr_print_uint32(ndr, "timeout", r->timeout);
1002 ndr_print_uint16(ndr, "reserved", r->reserved);
1003 ndr_print_uint16(ndr, "param_count", r->param_count);
1004 ndr_print_uint16(ndr, "param_offset", r->param_offset);
1005 ndr_print_uint16(ndr, "data_count", r->data_count);
1006 ndr_print_uint16(ndr, "data_offset", r->data_offset);
1007 ndr_print_uint8(ndr, "setup_count", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?3:r->setup_count);
1008 ndr_print_uint8(ndr, "pad2", r->pad2);
1009 ndr_print_uint16(ndr, "opcode", r->opcode);
1010 ndr_print_uint16(ndr, "priority", r->priority);
1011 ndr_print_uint16(ndr, "_class", r->_class);
1012 ndr_print_uint16(ndr, "byte_count", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen(r->mailslot_name) + 1 + r->data.length:r->byte_count);
1013 ndr_print_string(ndr, "mailslot_name", r->mailslot_name);
1014 ndr_print_DATA_BLOB(ndr, "data", r->data);
1015 ndr->depth--;
1018 static enum ndr_err_code ndr_push_smb_body(struct ndr_push *ndr, int ndr_flags, const union smb_body *r)
1020 if (ndr_flags & NDR_SCALARS) {
1021 int level = ndr_push_get_switch_value(ndr, r);
1022 NDR_CHECK(ndr_push_union_align(ndr, 4));
1023 switch (level) {
1024 case SMB_TRANSACTION: {
1025 NDR_CHECK(ndr_push_smb_trans_body(ndr, NDR_SCALARS, &r->trans));
1026 break; }
1028 default:
1029 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
1032 if (ndr_flags & NDR_BUFFERS) {
1033 int level = ndr_push_get_switch_value(ndr, r);
1034 switch (level) {
1035 case SMB_TRANSACTION:
1036 break;
1038 default:
1039 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
1042 return NDR_ERR_SUCCESS;
1045 static enum ndr_err_code ndr_pull_smb_body(struct ndr_pull *ndr, int ndr_flags, union smb_body *r)
1047 int level;
1048 level = ndr_pull_get_switch_value(ndr, r);
1049 if (ndr_flags & NDR_SCALARS) {
1050 NDR_CHECK(ndr_pull_union_align(ndr, 4));
1051 switch (level) {
1052 case SMB_TRANSACTION: {
1053 NDR_CHECK(ndr_pull_smb_trans_body(ndr, NDR_SCALARS, &r->trans));
1054 break; }
1056 default:
1057 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
1060 if (ndr_flags & NDR_BUFFERS) {
1061 switch (level) {
1062 case SMB_TRANSACTION:
1063 break;
1065 default:
1066 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
1069 return NDR_ERR_SUCCESS;
1072 _PUBLIC_ void ndr_print_smb_body(struct ndr_print *ndr, const char *name, const union smb_body *r)
1074 int level;
1075 level = ndr_print_get_switch_value(ndr, r);
1076 ndr_print_union(ndr, name, level, "smb_body");
1077 switch (level) {
1078 case SMB_TRANSACTION:
1079 ndr_print_smb_trans_body(ndr, "trans", &r->trans);
1080 break;
1082 default:
1083 ndr_print_bad_level(ndr, name, level);
1087 _PUBLIC_ enum ndr_err_code ndr_push_dgram_smb_packet(struct ndr_push *ndr, int ndr_flags, const struct dgram_smb_packet *r)
1090 uint32_t _flags_save_STRUCT = ndr->flags;
1091 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_LITTLE_ENDIAN|LIBNDR_PRINT_ARRAY_HEX);
1092 if (ndr_flags & NDR_SCALARS) {
1093 NDR_CHECK(ndr_push_align(ndr, 4));
1094 NDR_CHECK(ndr_push_smb_command(ndr, NDR_SCALARS, r->smb_command));
1095 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->err_class));
1096 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->pad));
1097 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->err_code));
1098 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->flags));
1099 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->flags2));
1100 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->pid_high));
1101 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->signature, 8));
1102 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->reserved));
1103 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->tid));
1104 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->pid));
1105 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->vuid));
1106 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->mid));
1107 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->body, r->smb_command));
1108 NDR_CHECK(ndr_push_smb_body(ndr, NDR_SCALARS, &r->body));
1109 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
1111 if (ndr_flags & NDR_BUFFERS) {
1113 ndr->flags = _flags_save_STRUCT;
1115 return NDR_ERR_SUCCESS;
1118 _PUBLIC_ enum ndr_err_code ndr_pull_dgram_smb_packet(struct ndr_pull *ndr, int ndr_flags, struct dgram_smb_packet *r)
1121 uint32_t _flags_save_STRUCT = ndr->flags;
1122 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_LITTLE_ENDIAN|LIBNDR_PRINT_ARRAY_HEX);
1123 if (ndr_flags & NDR_SCALARS) {
1124 NDR_CHECK(ndr_pull_align(ndr, 4));
1125 NDR_CHECK(ndr_pull_smb_command(ndr, NDR_SCALARS, &r->smb_command));
1126 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->err_class));
1127 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->pad));
1128 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->err_code));
1129 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->flags));
1130 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->flags2));
1131 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->pid_high));
1132 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->signature, 8));
1133 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->reserved));
1134 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->tid));
1135 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->pid));
1136 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->vuid));
1137 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->mid));
1138 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->body, r->smb_command));
1139 NDR_CHECK(ndr_pull_smb_body(ndr, NDR_SCALARS, &r->body));
1140 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
1142 if (ndr_flags & NDR_BUFFERS) {
1144 ndr->flags = _flags_save_STRUCT;
1146 return NDR_ERR_SUCCESS;
1149 _PUBLIC_ void ndr_print_dgram_smb_packet(struct ndr_print *ndr, const char *name, const struct dgram_smb_packet *r)
1151 ndr_print_struct(ndr, name, "dgram_smb_packet");
1153 uint32_t _flags_save_STRUCT = ndr->flags;
1154 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_LITTLE_ENDIAN|LIBNDR_PRINT_ARRAY_HEX);
1155 ndr->depth++;
1156 ndr_print_smb_command(ndr, "smb_command", r->smb_command);
1157 ndr_print_uint8(ndr, "err_class", r->err_class);
1158 ndr_print_uint8(ndr, "pad", r->pad);
1159 ndr_print_uint16(ndr, "err_code", r->err_code);
1160 ndr_print_uint8(ndr, "flags", r->flags);
1161 ndr_print_uint16(ndr, "flags2", r->flags2);
1162 ndr_print_uint16(ndr, "pid_high", r->pid_high);
1163 ndr_print_array_uint8(ndr, "signature", r->signature, 8);
1164 ndr_print_uint16(ndr, "reserved", r->reserved);
1165 ndr_print_uint16(ndr, "tid", r->tid);
1166 ndr_print_uint16(ndr, "pid", r->pid);
1167 ndr_print_uint16(ndr, "vuid", r->vuid);
1168 ndr_print_uint16(ndr, "mid", r->mid);
1169 ndr_print_set_switch_value(ndr, &r->body, r->smb_command);
1170 ndr_print_smb_body(ndr, "body", &r->body);
1171 ndr->depth--;
1172 ndr->flags = _flags_save_STRUCT;
1176 static enum ndr_err_code ndr_push_dgram_message_body(struct ndr_push *ndr, int ndr_flags, const union dgram_message_body *r)
1178 if (ndr_flags & NDR_SCALARS) {
1179 int level = ndr_push_get_switch_value(ndr, r);
1180 NDR_CHECK(ndr_push_union_align(ndr, 4));
1181 switch (level) {
1182 case DGRAM_SMB: {
1183 NDR_CHECK(ndr_push_dgram_smb_packet(ndr, NDR_SCALARS, &r->smb));
1184 break; }
1186 default:
1187 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
1190 if (ndr_flags & NDR_BUFFERS) {
1191 int level = ndr_push_get_switch_value(ndr, r);
1192 switch (level) {
1193 case DGRAM_SMB:
1194 break;
1196 default:
1197 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
1200 return NDR_ERR_SUCCESS;
1203 static enum ndr_err_code ndr_pull_dgram_message_body(struct ndr_pull *ndr, int ndr_flags, union dgram_message_body *r)
1205 int level;
1206 level = ndr_pull_get_switch_value(ndr, r);
1207 if (ndr_flags & NDR_SCALARS) {
1208 NDR_CHECK(ndr_pull_union_align(ndr, 4));
1209 switch (level) {
1210 case DGRAM_SMB: {
1211 NDR_CHECK(ndr_pull_dgram_smb_packet(ndr, NDR_SCALARS, &r->smb));
1212 break; }
1214 default:
1215 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
1218 if (ndr_flags & NDR_BUFFERS) {
1219 switch (level) {
1220 case DGRAM_SMB:
1221 break;
1223 default:
1224 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
1227 return NDR_ERR_SUCCESS;
1230 _PUBLIC_ void ndr_print_dgram_message_body(struct ndr_print *ndr, const char *name, const union dgram_message_body *r)
1232 int level;
1233 level = ndr_print_get_switch_value(ndr, r);
1234 ndr_print_union(ndr, name, level, "dgram_message_body");
1235 switch (level) {
1236 case DGRAM_SMB:
1237 ndr_print_dgram_smb_packet(ndr, "smb", &r->smb);
1238 break;
1240 default:
1241 ndr_print_bad_level(ndr, name, level);
1245 static enum ndr_err_code ndr_push_dgram_message(struct ndr_push *ndr, int ndr_flags, const struct dgram_message *r)
1247 if (ndr_flags & NDR_SCALARS) {
1248 NDR_CHECK(ndr_push_align(ndr, 4));
1249 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->length));
1250 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->offset));
1251 NDR_CHECK(ndr_push_nbt_name(ndr, NDR_SCALARS, &r->source_name));
1252 NDR_CHECK(ndr_push_nbt_name(ndr, NDR_SCALARS, &r->dest_name));
1253 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->dgram_body_type));
1254 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->body, r->dgram_body_type));
1255 NDR_CHECK(ndr_push_dgram_message_body(ndr, NDR_SCALARS, &r->body));
1256 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
1258 if (ndr_flags & NDR_BUFFERS) {
1260 return NDR_ERR_SUCCESS;
1263 static enum ndr_err_code ndr_pull_dgram_message(struct ndr_pull *ndr, int ndr_flags, struct dgram_message *r)
1265 if (ndr_flags & NDR_SCALARS) {
1266 NDR_CHECK(ndr_pull_align(ndr, 4));
1267 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length));
1268 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->offset));
1269 NDR_CHECK(ndr_pull_nbt_name(ndr, NDR_SCALARS, &r->source_name));
1270 NDR_CHECK(ndr_pull_nbt_name(ndr, NDR_SCALARS, &r->dest_name));
1271 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->dgram_body_type));
1272 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->body, r->dgram_body_type));
1273 NDR_CHECK(ndr_pull_dgram_message_body(ndr, NDR_SCALARS, &r->body));
1274 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
1276 if (ndr_flags & NDR_BUFFERS) {
1278 return NDR_ERR_SUCCESS;
1281 _PUBLIC_ void ndr_print_dgram_message(struct ndr_print *ndr, const char *name, const struct dgram_message *r)
1283 ndr_print_struct(ndr, name, "dgram_message");
1284 ndr->depth++;
1285 ndr_print_uint16(ndr, "length", r->length);
1286 ndr_print_uint16(ndr, "offset", r->offset);
1287 ndr_print_nbt_name(ndr, "source_name", &r->source_name);
1288 ndr_print_nbt_name(ndr, "dest_name", &r->dest_name);
1289 ndr_print_uint32(ndr, "dgram_body_type", r->dgram_body_type);
1290 ndr_print_set_switch_value(ndr, &r->body, r->dgram_body_type);
1291 ndr_print_dgram_message_body(ndr, "body", &r->body);
1292 ndr->depth--;
1295 static enum ndr_err_code ndr_push_dgram_err_code(struct ndr_push *ndr, int ndr_flags, enum dgram_err_code r)
1297 NDR_CHECK(ndr_push_enum_uint8(ndr, NDR_SCALARS, r));
1298 return NDR_ERR_SUCCESS;
1301 static enum ndr_err_code ndr_pull_dgram_err_code(struct ndr_pull *ndr, int ndr_flags, enum dgram_err_code *r)
1303 uint8_t v;
1304 NDR_CHECK(ndr_pull_enum_uint8(ndr, NDR_SCALARS, &v));
1305 *r = v;
1306 return NDR_ERR_SUCCESS;
1309 _PUBLIC_ void ndr_print_dgram_err_code(struct ndr_print *ndr, const char *name, enum dgram_err_code r)
1311 const char *val = NULL;
1313 switch (r) {
1314 case DGRAM_ERROR_NAME_NOT_PRESENT: val = "DGRAM_ERROR_NAME_NOT_PRESENT"; break;
1315 case DGRAM_ERROR_INVALID_SOURCE: val = "DGRAM_ERROR_INVALID_SOURCE"; break;
1316 case DGRAM_ERROR_INVALID_DEST: val = "DGRAM_ERROR_INVALID_DEST"; break;
1318 ndr_print_enum(ndr, name, "ENUM", val, r);
1321 static enum ndr_err_code ndr_push_dgram_data(struct ndr_push *ndr, int ndr_flags, const union dgram_data *r)
1323 if (ndr_flags & NDR_SCALARS) {
1324 int level = ndr_push_get_switch_value(ndr, r);
1325 NDR_CHECK(ndr_push_union_align(ndr, 4));
1326 switch (level) {
1327 case DGRAM_DIRECT_UNIQUE: {
1328 NDR_CHECK(ndr_push_dgram_message(ndr, NDR_SCALARS, &r->msg));
1329 break; }
1331 case DGRAM_DIRECT_GROUP: {
1332 NDR_CHECK(ndr_push_dgram_message(ndr, NDR_SCALARS, &r->msg));
1333 break; }
1335 case DGRAM_BCAST: {
1336 NDR_CHECK(ndr_push_dgram_message(ndr, NDR_SCALARS, &r->msg));
1337 break; }
1339 case DGRAM_ERROR: {
1340 NDR_CHECK(ndr_push_dgram_err_code(ndr, NDR_SCALARS, r->error));
1341 break; }
1343 case DGRAM_QUERY: {
1344 NDR_CHECK(ndr_push_nbt_name(ndr, NDR_SCALARS, &r->dest_name));
1345 break; }
1347 case DGRAM_QUERY_POSITIVE: {
1348 NDR_CHECK(ndr_push_nbt_name(ndr, NDR_SCALARS, &r->dest_name));
1349 break; }
1351 case DGRAM_QUERY_NEGATIVE: {
1352 NDR_CHECK(ndr_push_nbt_name(ndr, NDR_SCALARS, &r->dest_name));
1353 break; }
1355 default:
1356 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
1359 if (ndr_flags & NDR_BUFFERS) {
1360 int level = ndr_push_get_switch_value(ndr, r);
1361 switch (level) {
1362 case DGRAM_DIRECT_UNIQUE:
1363 break;
1365 case DGRAM_DIRECT_GROUP:
1366 break;
1368 case DGRAM_BCAST:
1369 break;
1371 case DGRAM_ERROR:
1372 break;
1374 case DGRAM_QUERY:
1375 break;
1377 case DGRAM_QUERY_POSITIVE:
1378 break;
1380 case DGRAM_QUERY_NEGATIVE:
1381 break;
1383 default:
1384 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
1387 return NDR_ERR_SUCCESS;
1390 static enum ndr_err_code ndr_pull_dgram_data(struct ndr_pull *ndr, int ndr_flags, union dgram_data *r)
1392 int level;
1393 level = ndr_pull_get_switch_value(ndr, r);
1394 if (ndr_flags & NDR_SCALARS) {
1395 NDR_CHECK(ndr_pull_union_align(ndr, 4));
1396 switch (level) {
1397 case DGRAM_DIRECT_UNIQUE: {
1398 NDR_CHECK(ndr_pull_dgram_message(ndr, NDR_SCALARS, &r->msg));
1399 break; }
1401 case DGRAM_DIRECT_GROUP: {
1402 NDR_CHECK(ndr_pull_dgram_message(ndr, NDR_SCALARS, &r->msg));
1403 break; }
1405 case DGRAM_BCAST: {
1406 NDR_CHECK(ndr_pull_dgram_message(ndr, NDR_SCALARS, &r->msg));
1407 break; }
1409 case DGRAM_ERROR: {
1410 NDR_CHECK(ndr_pull_dgram_err_code(ndr, NDR_SCALARS, &r->error));
1411 break; }
1413 case DGRAM_QUERY: {
1414 NDR_CHECK(ndr_pull_nbt_name(ndr, NDR_SCALARS, &r->dest_name));
1415 break; }
1417 case DGRAM_QUERY_POSITIVE: {
1418 NDR_CHECK(ndr_pull_nbt_name(ndr, NDR_SCALARS, &r->dest_name));
1419 break; }
1421 case DGRAM_QUERY_NEGATIVE: {
1422 NDR_CHECK(ndr_pull_nbt_name(ndr, NDR_SCALARS, &r->dest_name));
1423 break; }
1425 default:
1426 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
1429 if (ndr_flags & NDR_BUFFERS) {
1430 switch (level) {
1431 case DGRAM_DIRECT_UNIQUE:
1432 break;
1434 case DGRAM_DIRECT_GROUP:
1435 break;
1437 case DGRAM_BCAST:
1438 break;
1440 case DGRAM_ERROR:
1441 break;
1443 case DGRAM_QUERY:
1444 break;
1446 case DGRAM_QUERY_POSITIVE:
1447 break;
1449 case DGRAM_QUERY_NEGATIVE:
1450 break;
1452 default:
1453 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
1456 return NDR_ERR_SUCCESS;
1459 _PUBLIC_ void ndr_print_dgram_data(struct ndr_print *ndr, const char *name, const union dgram_data *r)
1461 int level;
1462 level = ndr_print_get_switch_value(ndr, r);
1463 ndr_print_union(ndr, name, level, "dgram_data");
1464 switch (level) {
1465 case DGRAM_DIRECT_UNIQUE:
1466 ndr_print_dgram_message(ndr, "msg", &r->msg);
1467 break;
1469 case DGRAM_DIRECT_GROUP:
1470 ndr_print_dgram_message(ndr, "msg", &r->msg);
1471 break;
1473 case DGRAM_BCAST:
1474 ndr_print_dgram_message(ndr, "msg", &r->msg);
1475 break;
1477 case DGRAM_ERROR:
1478 ndr_print_dgram_err_code(ndr, "error", r->error);
1479 break;
1481 case DGRAM_QUERY:
1482 ndr_print_nbt_name(ndr, "dest_name", &r->dest_name);
1483 break;
1485 case DGRAM_QUERY_POSITIVE:
1486 ndr_print_nbt_name(ndr, "dest_name", &r->dest_name);
1487 break;
1489 case DGRAM_QUERY_NEGATIVE:
1490 ndr_print_nbt_name(ndr, "dest_name", &r->dest_name);
1491 break;
1493 default:
1494 ndr_print_bad_level(ndr, name, level);
1498 _PUBLIC_ enum ndr_err_code ndr_push_nbt_dgram_packet(struct ndr_push *ndr, int ndr_flags, const struct nbt_dgram_packet *r)
1501 uint32_t _flags_save_STRUCT = ndr->flags;
1502 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_BIGENDIAN|LIBNDR_PRINT_ARRAY_HEX);
1503 if (ndr_flags & NDR_SCALARS) {
1504 NDR_CHECK(ndr_push_align(ndr, 4));
1505 NDR_CHECK(ndr_push_dgram_msg_type(ndr, NDR_SCALARS, r->msg_type));
1506 NDR_CHECK(ndr_push_dgram_flags(ndr, NDR_SCALARS, r->flags));
1507 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->dgram_id));
1508 NDR_CHECK(ndr_push_ipv4address(ndr, NDR_SCALARS, r->src_addr));
1509 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->src_port));
1510 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->data, r->msg_type));
1511 NDR_CHECK(ndr_push_dgram_data(ndr, NDR_SCALARS, &r->data));
1512 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
1514 if (ndr_flags & NDR_BUFFERS) {
1516 ndr->flags = _flags_save_STRUCT;
1518 return NDR_ERR_SUCCESS;
1521 _PUBLIC_ enum ndr_err_code ndr_pull_nbt_dgram_packet(struct ndr_pull *ndr, int ndr_flags, struct nbt_dgram_packet *r)
1524 uint32_t _flags_save_STRUCT = ndr->flags;
1525 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_BIGENDIAN|LIBNDR_PRINT_ARRAY_HEX);
1526 if (ndr_flags & NDR_SCALARS) {
1527 NDR_CHECK(ndr_pull_align(ndr, 4));
1528 NDR_CHECK(ndr_pull_dgram_msg_type(ndr, NDR_SCALARS, &r->msg_type));
1529 NDR_CHECK(ndr_pull_dgram_flags(ndr, NDR_SCALARS, &r->flags));
1530 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->dgram_id));
1531 NDR_CHECK(ndr_pull_ipv4address(ndr, NDR_SCALARS, &r->src_addr));
1532 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->src_port));
1533 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->data, r->msg_type));
1534 NDR_CHECK(ndr_pull_dgram_data(ndr, NDR_SCALARS, &r->data));
1535 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
1537 if (ndr_flags & NDR_BUFFERS) {
1539 ndr->flags = _flags_save_STRUCT;
1541 return NDR_ERR_SUCCESS;
1544 _PUBLIC_ void ndr_print_nbt_dgram_packet(struct ndr_print *ndr, const char *name, const struct nbt_dgram_packet *r)
1546 ndr_print_struct(ndr, name, "nbt_dgram_packet");
1548 uint32_t _flags_save_STRUCT = ndr->flags;
1549 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_BIGENDIAN|LIBNDR_PRINT_ARRAY_HEX);
1550 ndr->depth++;
1551 ndr_print_dgram_msg_type(ndr, "msg_type", r->msg_type);
1552 ndr_print_dgram_flags(ndr, "flags", r->flags);
1553 ndr_print_uint16(ndr, "dgram_id", r->dgram_id);
1554 ndr_print_ipv4address(ndr, "src_addr", r->src_addr);
1555 ndr_print_uint16(ndr, "src_port", r->src_port);
1556 ndr_print_set_switch_value(ndr, &r->data, r->msg_type);
1557 ndr_print_dgram_data(ndr, "data", &r->data);
1558 ndr->depth--;
1559 ndr->flags = _flags_save_STRUCT;
1563 _PUBLIC_ enum ndr_err_code ndr_push_nbt_sockaddr(struct ndr_push *ndr, int ndr_flags, const struct nbt_sockaddr *r)
1565 if (ndr_flags & NDR_SCALARS) {
1566 NDR_CHECK(ndr_push_align(ndr, 4));
1567 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sockaddr_family));
1569 uint32_t _flags_save_ipv4address = ndr->flags;
1570 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN);
1571 NDR_CHECK(ndr_push_ipv4address(ndr, NDR_SCALARS, r->pdc_ip));
1572 ndr->flags = _flags_save_ipv4address;
1575 uint32_t _flags_save_DATA_BLOB = ndr->flags;
1576 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
1577 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->remaining));
1578 ndr->flags = _flags_save_DATA_BLOB;
1580 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
1582 if (ndr_flags & NDR_BUFFERS) {
1584 return NDR_ERR_SUCCESS;
1587 _PUBLIC_ enum ndr_err_code ndr_pull_nbt_sockaddr(struct ndr_pull *ndr, int ndr_flags, struct nbt_sockaddr *r)
1589 if (ndr_flags & NDR_SCALARS) {
1590 NDR_CHECK(ndr_pull_align(ndr, 4));
1591 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sockaddr_family));
1593 uint32_t _flags_save_ipv4address = ndr->flags;
1594 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN);
1595 NDR_CHECK(ndr_pull_ipv4address(ndr, NDR_SCALARS, &r->pdc_ip));
1596 ndr->flags = _flags_save_ipv4address;
1599 uint32_t _flags_save_DATA_BLOB = ndr->flags;
1600 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
1601 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->remaining));
1602 ndr->flags = _flags_save_DATA_BLOB;
1604 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
1606 if (ndr_flags & NDR_BUFFERS) {
1608 return NDR_ERR_SUCCESS;
1611 _PUBLIC_ void ndr_print_nbt_sockaddr(struct ndr_print *ndr, const char *name, const struct nbt_sockaddr *r)
1613 ndr_print_struct(ndr, name, "nbt_sockaddr");
1614 ndr->depth++;
1615 ndr_print_uint32(ndr, "sockaddr_family", r->sockaddr_family);
1616 ndr_print_ipv4address(ndr, "pdc_ip", r->pdc_ip);
1617 ndr_print_DATA_BLOB(ndr, "remaining", r->remaining);
1618 ndr->depth--;
1621 _PUBLIC_ size_t ndr_size_nbt_sockaddr(const struct nbt_sockaddr *r, struct smb_iconv_convenience *ic, int flags)
1623 return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_nbt_sockaddr, ic);
1626 _PUBLIC_ enum ndr_err_code ndr_push_nbt_server_type(struct ndr_push *ndr, int ndr_flags, uint32_t r)
1628 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
1629 return NDR_ERR_SUCCESS;
1632 _PUBLIC_ enum ndr_err_code ndr_pull_nbt_server_type(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
1634 uint32_t v;
1635 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
1636 *r = v;
1637 return NDR_ERR_SUCCESS;
1640 _PUBLIC_ void ndr_print_nbt_server_type(struct ndr_print *ndr, const char *name, uint32_t r)
1642 ndr_print_uint32(ndr, name, r);
1643 ndr->depth++;
1644 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_PDC", NBT_SERVER_PDC, r);
1645 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_GC", NBT_SERVER_GC, r);
1646 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_LDAP", NBT_SERVER_LDAP, r);
1647 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_DS", NBT_SERVER_DS, r);
1648 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_KDC", NBT_SERVER_KDC, r);
1649 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_TIMESERV", NBT_SERVER_TIMESERV, r);
1650 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_CLOSEST", NBT_SERVER_CLOSEST, r);
1651 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_WRITABLE", NBT_SERVER_WRITABLE, r);
1652 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_GOOD_TIMESERV", NBT_SERVER_GOOD_TIMESERV, r);
1653 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_NDNC", NBT_SERVER_NDNC, r);
1654 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_SELECT_SECRET_DOMAIN_6", NBT_SERVER_SELECT_SECRET_DOMAIN_6, r);
1655 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_FULL_SECRET_DOMAIN_6", NBT_SERVER_FULL_SECRET_DOMAIN_6, r);
1656 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_ADS_WEB_SERVICE", NBT_SERVER_ADS_WEB_SERVICE, r);
1657 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_HAS_DNS_NAME", NBT_SERVER_HAS_DNS_NAME, r);
1658 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_IS_DEFAULT_NC", NBT_SERVER_IS_DEFAULT_NC, r);
1659 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_FOREST_ROOT", NBT_SERVER_FOREST_ROOT, r);
1660 ndr->depth--;
1663 _PUBLIC_ enum ndr_err_code ndr_push_netlogon_nt_version_flags(struct ndr_push *ndr, int ndr_flags, uint32_t r)
1665 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
1666 return NDR_ERR_SUCCESS;
1669 _PUBLIC_ enum ndr_err_code ndr_pull_netlogon_nt_version_flags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
1671 uint32_t v;
1672 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
1673 *r = v;
1674 return NDR_ERR_SUCCESS;
1677 _PUBLIC_ void ndr_print_netlogon_nt_version_flags(struct ndr_print *ndr, const char *name, uint32_t r)
1679 ndr_print_uint32(ndr, name, r);
1680 ndr->depth++;
1681 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NT_VERSION_1", NETLOGON_NT_VERSION_1, r);
1682 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NT_VERSION_5", NETLOGON_NT_VERSION_5, r);
1683 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NT_VERSION_5EX", NETLOGON_NT_VERSION_5EX, r);
1684 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NT_VERSION_5EX_WITH_IP", NETLOGON_NT_VERSION_5EX_WITH_IP, r);
1685 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NT_VERSION_WITH_CLOSEST_SITE", NETLOGON_NT_VERSION_WITH_CLOSEST_SITE, r);
1686 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NT_VERSION_AVIOD_NT4EMUL", NETLOGON_NT_VERSION_AVIOD_NT4EMUL, r);
1687 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NT_VERSION_PDC", NETLOGON_NT_VERSION_PDC, r);
1688 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NT_VERSION_IP", NETLOGON_NT_VERSION_IP, r);
1689 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NT_VERSION_LOCAL", NETLOGON_NT_VERSION_LOCAL, r);
1690 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NT_VERSION_GC", NETLOGON_NT_VERSION_GC, r);
1691 ndr->depth--;
1694 _PUBLIC_ enum ndr_err_code ndr_push_netlogon_command(struct ndr_push *ndr, int ndr_flags, enum netlogon_command r)
1696 NDR_CHECK(ndr_push_enum_uint16(ndr, NDR_SCALARS, r));
1697 return NDR_ERR_SUCCESS;
1700 _PUBLIC_ enum ndr_err_code ndr_pull_netlogon_command(struct ndr_pull *ndr, int ndr_flags, enum netlogon_command *r)
1702 uint16_t v;
1703 NDR_CHECK(ndr_pull_enum_uint16(ndr, NDR_SCALARS, &v));
1704 *r = v;
1705 return NDR_ERR_SUCCESS;
1708 _PUBLIC_ void ndr_print_netlogon_command(struct ndr_print *ndr, const char *name, enum netlogon_command r)
1710 const char *val = NULL;
1712 switch (r) {
1713 case LOGON_PRIMARY_QUERY: val = "LOGON_PRIMARY_QUERY"; break;
1714 case NETLOGON_ANNOUNCE_UAS: val = "NETLOGON_ANNOUNCE_UAS"; break;
1715 case NETLOGON_RESPONSE_FROM_PDC: val = "NETLOGON_RESPONSE_FROM_PDC"; break;
1716 case LOGON_SAM_LOGON_REQUEST: val = "LOGON_SAM_LOGON_REQUEST"; break;
1717 case LOGON_SAM_LOGON_RESPONSE: val = "LOGON_SAM_LOGON_RESPONSE"; break;
1718 case LOGON_SAM_LOGON_PAUSE_RESPONSE: val = "LOGON_SAM_LOGON_PAUSE_RESPONSE"; break;
1719 case LOGON_SAM_LOGON_USER_UNKNOWN: val = "LOGON_SAM_LOGON_USER_UNKNOWN"; break;
1720 case LOGON_SAM_LOGON_RESPONSE_EX: val = "LOGON_SAM_LOGON_RESPONSE_EX"; break;
1721 case LOGON_SAM_LOGON_PAUSE_RESPONSE_EX: val = "LOGON_SAM_LOGON_PAUSE_RESPONSE_EX"; break;
1722 case LOGON_SAM_LOGON_USER_UNKNOWN_EX: val = "LOGON_SAM_LOGON_USER_UNKNOWN_EX"; break;
1724 ndr_print_enum(ndr, name, "ENUM", val, r);
1727 _PUBLIC_ void ndr_print_NETLOGON_SAM_LOGON_REQUEST(struct ndr_print *ndr, const char *name, const struct NETLOGON_SAM_LOGON_REQUEST *r)
1729 ndr_print_struct(ndr, name, "NETLOGON_SAM_LOGON_REQUEST");
1730 ndr->depth++;
1731 ndr_print_uint16(ndr, "request_count", r->request_count);
1732 ndr_print_string(ndr, "computer_name", r->computer_name);
1733 ndr_print_string(ndr, "user_name", r->user_name);
1734 ndr_print_string(ndr, "mailslot_name", r->mailslot_name);
1735 ndr_print_samr_AcctFlags(ndr, "acct_control", r->acct_control);
1736 ndr_print_uint32(ndr, "sid_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_dom_sid0(&r->sid, ndr->flags):r->sid_size);
1737 ndr_print_DATA_BLOB(ndr, "_pad", r->_pad);
1738 ndr_print_dom_sid0(ndr, "sid", &r->sid);
1739 ndr_print_netlogon_nt_version_flags(ndr, "nt_version", r->nt_version);
1740 ndr_print_uint16(ndr, "lmnt_token", r->lmnt_token);
1741 ndr_print_uint16(ndr, "lm20_token", r->lm20_token);
1742 ndr->depth--;
1745 _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)
1748 uint32_t _flags_save_STRUCT = ndr->flags;
1749 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
1750 if (ndr_flags & NDR_SCALARS) {
1751 NDR_CHECK(ndr_push_align(ndr, 4));
1752 NDR_CHECK(ndr_push_netlogon_command(ndr, NDR_SCALARS, r->command));
1754 uint32_t _flags_save_string = ndr->flags;
1755 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1756 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->server));
1757 ndr->flags = _flags_save_string;
1760 uint32_t _flags_save_string = ndr->flags;
1761 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1762 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->user_name));
1763 ndr->flags = _flags_save_string;
1766 uint32_t _flags_save_string = ndr->flags;
1767 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1768 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->domain));
1769 ndr->flags = _flags_save_string;
1771 NDR_CHECK(ndr_push_netlogon_nt_version_flags(ndr, NDR_SCALARS, r->nt_version));
1772 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lmnt_token));
1773 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lm20_token));
1774 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
1776 if (ndr_flags & NDR_BUFFERS) {
1778 ndr->flags = _flags_save_STRUCT;
1780 return NDR_ERR_SUCCESS;
1783 _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)
1786 uint32_t _flags_save_STRUCT = ndr->flags;
1787 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
1788 if (ndr_flags & NDR_SCALARS) {
1789 NDR_CHECK(ndr_pull_align(ndr, 4));
1790 NDR_CHECK(ndr_pull_netlogon_command(ndr, NDR_SCALARS, &r->command));
1792 uint32_t _flags_save_string = ndr->flags;
1793 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1794 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->server));
1795 ndr->flags = _flags_save_string;
1798 uint32_t _flags_save_string = ndr->flags;
1799 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1800 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->user_name));
1801 ndr->flags = _flags_save_string;
1804 uint32_t _flags_save_string = ndr->flags;
1805 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1806 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->domain));
1807 ndr->flags = _flags_save_string;
1809 NDR_CHECK(ndr_pull_netlogon_nt_version_flags(ndr, NDR_SCALARS, &r->nt_version));
1810 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lmnt_token));
1811 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lm20_token));
1812 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
1814 if (ndr_flags & NDR_BUFFERS) {
1816 ndr->flags = _flags_save_STRUCT;
1818 return NDR_ERR_SUCCESS;
1821 _PUBLIC_ void ndr_print_NETLOGON_SAM_LOGON_RESPONSE_NT40(struct ndr_print *ndr, const char *name, const struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *r)
1823 ndr_print_struct(ndr, name, "NETLOGON_SAM_LOGON_RESPONSE_NT40");
1825 uint32_t _flags_save_STRUCT = ndr->flags;
1826 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
1827 ndr->depth++;
1828 ndr_print_netlogon_command(ndr, "command", r->command);
1829 ndr_print_string(ndr, "server", r->server);
1830 ndr_print_string(ndr, "user_name", r->user_name);
1831 ndr_print_string(ndr, "domain", r->domain);
1832 ndr_print_netlogon_nt_version_flags(ndr, "nt_version", r->nt_version);
1833 ndr_print_uint16(ndr, "lmnt_token", r->lmnt_token);
1834 ndr_print_uint16(ndr, "lm20_token", r->lm20_token);
1835 ndr->depth--;
1836 ndr->flags = _flags_save_STRUCT;
1840 _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)
1843 uint32_t _flags_save_STRUCT = ndr->flags;
1844 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
1845 if (ndr_flags & NDR_SCALARS) {
1846 NDR_CHECK(ndr_push_align(ndr, 4));
1847 NDR_CHECK(ndr_push_netlogon_command(ndr, NDR_SCALARS, r->command));
1849 uint32_t _flags_save_string = ndr->flags;
1850 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1851 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->pdc_name));
1852 ndr->flags = _flags_save_string;
1855 uint32_t _flags_save_string = ndr->flags;
1856 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1857 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->user_name));
1858 ndr->flags = _flags_save_string;
1861 uint32_t _flags_save_string = ndr->flags;
1862 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1863 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->domain_name));
1864 ndr->flags = _flags_save_string;
1866 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->domain_uuid));
1867 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->zero_uuid));
1868 NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->forest));
1869 NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->dns_domain));
1870 NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->pdc_dns_name));
1871 NDR_CHECK(ndr_push_ipv4address(ndr, NDR_SCALARS, r->pdc_ip));
1872 NDR_CHECK(ndr_push_nbt_server_type(ndr, NDR_SCALARS, r->server_type));
1873 NDR_CHECK(ndr_push_netlogon_nt_version_flags(ndr, NDR_SCALARS, r->nt_version));
1874 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lmnt_token));
1875 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lm20_token));
1876 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
1878 if (ndr_flags & NDR_BUFFERS) {
1880 ndr->flags = _flags_save_STRUCT;
1882 return NDR_ERR_SUCCESS;
1885 _PUBLIC_ enum ndr_err_code ndr_pull_NETLOGON_SAM_LOGON_RESPONSE(struct ndr_pull *ndr, int ndr_flags, struct NETLOGON_SAM_LOGON_RESPONSE *r)
1888 uint32_t _flags_save_STRUCT = ndr->flags;
1889 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
1890 if (ndr_flags & NDR_SCALARS) {
1891 NDR_CHECK(ndr_pull_align(ndr, 4));
1892 NDR_CHECK(ndr_pull_netlogon_command(ndr, NDR_SCALARS, &r->command));
1894 uint32_t _flags_save_string = ndr->flags;
1895 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1896 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->pdc_name));
1897 ndr->flags = _flags_save_string;
1900 uint32_t _flags_save_string = ndr->flags;
1901 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1902 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->user_name));
1903 ndr->flags = _flags_save_string;
1906 uint32_t _flags_save_string = ndr->flags;
1907 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1908 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->domain_name));
1909 ndr->flags = _flags_save_string;
1911 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->domain_uuid));
1912 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->zero_uuid));
1913 NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->forest));
1914 NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->dns_domain));
1915 NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->pdc_dns_name));
1916 NDR_CHECK(ndr_pull_ipv4address(ndr, NDR_SCALARS, &r->pdc_ip));
1917 NDR_CHECK(ndr_pull_nbt_server_type(ndr, NDR_SCALARS, &r->server_type));
1918 NDR_CHECK(ndr_pull_netlogon_nt_version_flags(ndr, NDR_SCALARS, &r->nt_version));
1919 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lmnt_token));
1920 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lm20_token));
1921 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
1923 if (ndr_flags & NDR_BUFFERS) {
1925 ndr->flags = _flags_save_STRUCT;
1927 return NDR_ERR_SUCCESS;
1930 _PUBLIC_ void ndr_print_NETLOGON_SAM_LOGON_RESPONSE(struct ndr_print *ndr, const char *name, const struct NETLOGON_SAM_LOGON_RESPONSE *r)
1932 ndr_print_struct(ndr, name, "NETLOGON_SAM_LOGON_RESPONSE");
1934 uint32_t _flags_save_STRUCT = ndr->flags;
1935 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
1936 ndr->depth++;
1937 ndr_print_netlogon_command(ndr, "command", r->command);
1938 ndr_print_string(ndr, "pdc_name", r->pdc_name);
1939 ndr_print_string(ndr, "user_name", r->user_name);
1940 ndr_print_string(ndr, "domain_name", r->domain_name);
1941 ndr_print_GUID(ndr, "domain_uuid", &r->domain_uuid);
1942 ndr_print_GUID(ndr, "zero_uuid", &r->zero_uuid);
1943 ndr_print_nbt_string(ndr, "forest", r->forest);
1944 ndr_print_nbt_string(ndr, "dns_domain", r->dns_domain);
1945 ndr_print_nbt_string(ndr, "pdc_dns_name", r->pdc_dns_name);
1946 ndr_print_ipv4address(ndr, "pdc_ip", r->pdc_ip);
1947 ndr_print_nbt_server_type(ndr, "server_type", r->server_type);
1948 ndr_print_netlogon_nt_version_flags(ndr, "nt_version", r->nt_version);
1949 ndr_print_uint16(ndr, "lmnt_token", r->lmnt_token);
1950 ndr_print_uint16(ndr, "lm20_token", r->lm20_token);
1951 ndr->depth--;
1952 ndr->flags = _flags_save_STRUCT;
1956 _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)
1959 uint32_t _flags_save_STRUCT = ndr->flags;
1960 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
1961 if (ndr_flags & NDR_SCALARS) {
1962 NDR_CHECK(ndr_push_align(ndr, 4));
1963 NDR_CHECK(ndr_push_netlogon_command(ndr, NDR_SCALARS, r->command));
1964 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->sbz));
1965 NDR_CHECK(ndr_push_nbt_server_type(ndr, NDR_SCALARS, r->server_type));
1966 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->domain_uuid));
1967 NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->forest));
1968 NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->dns_domain));
1969 NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->pdc_dns_name));
1970 NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->domain));
1971 NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->pdc_name));
1972 NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->user_name));
1973 NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->server_site));
1974 NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->client_site));
1975 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, ndr_size_nbt_sockaddr(&r->sockaddr, ndr->iconv_convenience, ndr->flags)));
1977 struct ndr_push *_ndr_sockaddr;
1978 NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_sockaddr, 0, ndr_size_nbt_sockaddr(&r->sockaddr, ndr->iconv_convenience, ndr->flags)));
1979 NDR_CHECK(ndr_push_nbt_sockaddr(_ndr_sockaddr, NDR_SCALARS, &r->sockaddr));
1980 NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_sockaddr, 0, ndr_size_nbt_sockaddr(&r->sockaddr, ndr->iconv_convenience, ndr->flags)));
1982 NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->next_closest_site));
1983 NDR_CHECK(ndr_push_netlogon_nt_version_flags(ndr, NDR_SCALARS, r->nt_version));
1984 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lmnt_token));
1985 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lm20_token));
1986 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
1988 if (ndr_flags & NDR_BUFFERS) {
1990 ndr->flags = _flags_save_STRUCT;
1992 return NDR_ERR_SUCCESS;
1995 _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)
1998 uint32_t _flags_save_STRUCT = ndr->flags;
1999 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
2000 if (ndr_flags & NDR_SCALARS) {
2001 NDR_CHECK(ndr_pull_align(ndr, 4));
2002 NDR_CHECK(ndr_pull_netlogon_command(ndr, NDR_SCALARS, &r->command));
2003 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->sbz));
2004 NDR_CHECK(ndr_pull_nbt_server_type(ndr, NDR_SCALARS, &r->server_type));
2005 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->domain_uuid));
2006 NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->forest));
2007 NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->dns_domain));
2008 NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->pdc_dns_name));
2009 NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->domain));
2010 NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->pdc_name));
2011 NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->user_name));
2012 NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->server_site));
2013 NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->client_site));
2014 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->sockaddr_size));
2016 struct ndr_pull *_ndr_sockaddr;
2017 NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_sockaddr, 0, r->sockaddr_size));
2018 NDR_CHECK(ndr_pull_nbt_sockaddr(_ndr_sockaddr, NDR_SCALARS, &r->sockaddr));
2019 NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_sockaddr, 0, r->sockaddr_size));
2021 NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->next_closest_site));
2022 NDR_CHECK(ndr_pull_netlogon_nt_version_flags(ndr, NDR_SCALARS, &r->nt_version));
2023 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lmnt_token));
2024 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lm20_token));
2025 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
2027 if (ndr_flags & NDR_BUFFERS) {
2029 ndr->flags = _flags_save_STRUCT;
2031 return NDR_ERR_SUCCESS;
2034 _PUBLIC_ void ndr_print_NETLOGON_SAM_LOGON_RESPONSE_EX(struct ndr_print *ndr, const char *name, const struct NETLOGON_SAM_LOGON_RESPONSE_EX *r)
2036 ndr_print_struct(ndr, name, "NETLOGON_SAM_LOGON_RESPONSE_EX");
2038 uint32_t _flags_save_STRUCT = ndr->flags;
2039 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
2040 ndr->depth++;
2041 ndr_print_netlogon_command(ndr, "command", r->command);
2042 ndr_print_uint16(ndr, "sbz", r->sbz);
2043 ndr_print_nbt_server_type(ndr, "server_type", r->server_type);
2044 ndr_print_GUID(ndr, "domain_uuid", &r->domain_uuid);
2045 ndr_print_nbt_string(ndr, "forest", r->forest);
2046 ndr_print_nbt_string(ndr, "dns_domain", r->dns_domain);
2047 ndr_print_nbt_string(ndr, "pdc_dns_name", r->pdc_dns_name);
2048 ndr_print_nbt_string(ndr, "domain", r->domain);
2049 ndr_print_nbt_string(ndr, "pdc_name", r->pdc_name);
2050 ndr_print_nbt_string(ndr, "user_name", r->user_name);
2051 ndr_print_nbt_string(ndr, "server_site", r->server_site);
2052 ndr_print_nbt_string(ndr, "client_site", r->client_site);
2053 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);
2054 ndr_print_nbt_sockaddr(ndr, "sockaddr", &r->sockaddr);
2055 ndr_print_nbt_string(ndr, "next_closest_site", r->next_closest_site);
2056 ndr_print_netlogon_nt_version_flags(ndr, "nt_version", r->nt_version);
2057 ndr_print_uint16(ndr, "lmnt_token", r->lmnt_token);
2058 ndr_print_uint16(ndr, "lm20_token", r->lm20_token);
2059 ndr->depth--;
2060 ndr->flags = _flags_save_STRUCT;
2064 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)
2066 if (ndr_flags & NDR_SCALARS) {
2067 NDR_CHECK(ndr_push_align(ndr, 4));
2069 uint32_t _flags_save_string = ndr->flags;
2070 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
2071 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->computer_name));
2072 ndr->flags = _flags_save_string;
2075 uint32_t _flags_save_string = ndr->flags;
2076 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
2077 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->mailslot_name));
2078 ndr->flags = _flags_save_string;
2081 uint32_t _flags_save_DATA_BLOB = ndr->flags;
2082 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN2);
2083 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->_pad));
2084 ndr->flags = _flags_save_DATA_BLOB;
2087 uint32_t _flags_save_string = ndr->flags;
2088 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
2089 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->unicode_name));
2090 ndr->flags = _flags_save_string;
2092 NDR_CHECK(ndr_push_netlogon_nt_version_flags(ndr, NDR_SCALARS, r->nt_version));
2093 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lmnt_token));
2094 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lm20_token));
2095 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
2097 if (ndr_flags & NDR_BUFFERS) {
2099 return NDR_ERR_SUCCESS;
2102 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)
2104 if (ndr_flags & NDR_SCALARS) {
2105 NDR_CHECK(ndr_pull_align(ndr, 4));
2107 uint32_t _flags_save_string = ndr->flags;
2108 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
2109 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->computer_name));
2110 ndr->flags = _flags_save_string;
2113 uint32_t _flags_save_string = ndr->flags;
2114 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
2115 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->mailslot_name));
2116 ndr->flags = _flags_save_string;
2119 uint32_t _flags_save_DATA_BLOB = ndr->flags;
2120 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN2);
2121 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->_pad));
2122 ndr->flags = _flags_save_DATA_BLOB;
2125 uint32_t _flags_save_string = ndr->flags;
2126 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
2127 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->unicode_name));
2128 ndr->flags = _flags_save_string;
2130 NDR_CHECK(ndr_pull_netlogon_nt_version_flags(ndr, NDR_SCALARS, &r->nt_version));
2131 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lmnt_token));
2132 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lm20_token));
2133 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
2135 if (ndr_flags & NDR_BUFFERS) {
2137 return NDR_ERR_SUCCESS;
2140 _PUBLIC_ void ndr_print_nbt_netlogon_query_for_pdc(struct ndr_print *ndr, const char *name, const struct nbt_netlogon_query_for_pdc *r)
2142 ndr_print_struct(ndr, name, "nbt_netlogon_query_for_pdc");
2143 ndr->depth++;
2144 ndr_print_string(ndr, "computer_name", r->computer_name);
2145 ndr_print_string(ndr, "mailslot_name", r->mailslot_name);
2146 ndr_print_DATA_BLOB(ndr, "_pad", r->_pad);
2147 ndr_print_string(ndr, "unicode_name", r->unicode_name);
2148 ndr_print_netlogon_nt_version_flags(ndr, "nt_version", r->nt_version);
2149 ndr_print_uint16(ndr, "lmnt_token", r->lmnt_token);
2150 ndr_print_uint16(ndr, "lm20_token", r->lm20_token);
2151 ndr->depth--;
2154 _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)
2157 uint32_t _flags_save_STRUCT = ndr->flags;
2158 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
2159 if (ndr_flags & NDR_SCALARS) {
2160 NDR_CHECK(ndr_push_align(ndr, 4));
2161 NDR_CHECK(ndr_push_netlogon_command(ndr, NDR_SCALARS, r->command));
2163 uint32_t _flags_save_string = ndr->flags;
2164 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
2165 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->pdc_name));
2166 ndr->flags = _flags_save_string;
2169 uint32_t _flags_save_DATA_BLOB = ndr->flags;
2170 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN2);
2171 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->_pad));
2172 ndr->flags = _flags_save_DATA_BLOB;
2175 uint32_t _flags_save_string = ndr->flags;
2176 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
2177 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->unicode_pdc_name));
2178 ndr->flags = _flags_save_string;
2181 uint32_t _flags_save_string = ndr->flags;
2182 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
2183 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->domain_name));
2184 ndr->flags = _flags_save_string;
2186 NDR_CHECK(ndr_push_netlogon_nt_version_flags(ndr, NDR_SCALARS, r->nt_version));
2187 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lmnt_token));
2188 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lm20_token));
2189 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
2191 if (ndr_flags & NDR_BUFFERS) {
2193 ndr->flags = _flags_save_STRUCT;
2195 return NDR_ERR_SUCCESS;
2198 _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)
2201 uint32_t _flags_save_STRUCT = ndr->flags;
2202 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
2203 if (ndr_flags & NDR_SCALARS) {
2204 NDR_CHECK(ndr_pull_align(ndr, 4));
2205 NDR_CHECK(ndr_pull_netlogon_command(ndr, NDR_SCALARS, &r->command));
2207 uint32_t _flags_save_string = ndr->flags;
2208 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
2209 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->pdc_name));
2210 ndr->flags = _flags_save_string;
2213 uint32_t _flags_save_DATA_BLOB = ndr->flags;
2214 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN2);
2215 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->_pad));
2216 ndr->flags = _flags_save_DATA_BLOB;
2219 uint32_t _flags_save_string = ndr->flags;
2220 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
2221 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->unicode_pdc_name));
2222 ndr->flags = _flags_save_string;
2225 uint32_t _flags_save_string = ndr->flags;
2226 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
2227 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->domain_name));
2228 ndr->flags = _flags_save_string;
2230 NDR_CHECK(ndr_pull_netlogon_nt_version_flags(ndr, NDR_SCALARS, &r->nt_version));
2231 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lmnt_token));
2232 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lm20_token));
2233 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
2235 if (ndr_flags & NDR_BUFFERS) {
2237 ndr->flags = _flags_save_STRUCT;
2239 return NDR_ERR_SUCCESS;
2242 _PUBLIC_ void ndr_print_nbt_netlogon_response_from_pdc(struct ndr_print *ndr, const char *name, const struct nbt_netlogon_response_from_pdc *r)
2244 ndr_print_struct(ndr, name, "nbt_netlogon_response_from_pdc");
2246 uint32_t _flags_save_STRUCT = ndr->flags;
2247 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
2248 ndr->depth++;
2249 ndr_print_netlogon_command(ndr, "command", r->command);
2250 ndr_print_string(ndr, "pdc_name", r->pdc_name);
2251 ndr_print_DATA_BLOB(ndr, "_pad", r->_pad);
2252 ndr_print_string(ndr, "unicode_pdc_name", r->unicode_pdc_name);
2253 ndr_print_string(ndr, "domain_name", r->domain_name);
2254 ndr_print_netlogon_nt_version_flags(ndr, "nt_version", r->nt_version);
2255 ndr_print_uint16(ndr, "lmnt_token", r->lmnt_token);
2256 ndr_print_uint16(ndr, "lm20_token", r->lm20_token);
2257 ndr->depth--;
2258 ndr->flags = _flags_save_STRUCT;
2262 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)
2264 if (ndr_flags & NDR_SCALARS) {
2265 NDR_CHECK(ndr_push_align(ndr, 8));
2266 NDR_CHECK(ndr_push_netr_SamDatabaseID(ndr, NDR_SCALARS, r->db_index));
2267 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->serial));
2268 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->timestamp));
2269 NDR_CHECK(ndr_push_trailer_align(ndr, 8));
2271 if (ndr_flags & NDR_BUFFERS) {
2273 return NDR_ERR_SUCCESS;
2276 static enum ndr_err_code ndr_pull_nbt_db_change_info(struct ndr_pull *ndr, int ndr_flags, struct nbt_db_change_info *r)
2278 if (ndr_flags & NDR_SCALARS) {
2279 NDR_CHECK(ndr_pull_align(ndr, 8));
2280 NDR_CHECK(ndr_pull_netr_SamDatabaseID(ndr, NDR_SCALARS, &r->db_index));
2281 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->serial));
2282 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->timestamp));
2283 NDR_CHECK(ndr_pull_trailer_align(ndr, 8));
2285 if (ndr_flags & NDR_BUFFERS) {
2287 return NDR_ERR_SUCCESS;
2290 _PUBLIC_ void ndr_print_nbt_db_change_info(struct ndr_print *ndr, const char *name, const struct nbt_db_change_info *r)
2292 ndr_print_struct(ndr, name, "nbt_db_change_info");
2293 ndr->depth++;
2294 ndr_print_netr_SamDatabaseID(ndr, "db_index", r->db_index);
2295 ndr_print_hyper(ndr, "serial", r->serial);
2296 ndr_print_NTTIME(ndr, "timestamp", r->timestamp);
2297 ndr->depth--;
2300 static enum ndr_err_code ndr_push_NETLOGON_DB_CHANGE(struct ndr_push *ndr, int ndr_flags, const struct NETLOGON_DB_CHANGE *r)
2302 uint32_t cntr_dbchange_0;
2303 if (ndr_flags & NDR_SCALARS) {
2304 NDR_CHECK(ndr_push_align(ndr, 8));
2305 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->serial_lo));
2306 NDR_CHECK(ndr_push_time_t(ndr, NDR_SCALARS, r->timestamp));
2307 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pulse));
2308 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->random));
2310 uint32_t _flags_save_string = ndr->flags;
2311 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
2312 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->pdc_name));
2313 ndr->flags = _flags_save_string;
2316 uint32_t _flags_save_string = ndr->flags;
2317 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
2318 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->domain));
2319 ndr->flags = _flags_save_string;
2322 uint32_t _flags_save_DATA_BLOB = ndr->flags;
2323 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN2);
2324 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->_pad));
2325 ndr->flags = _flags_save_DATA_BLOB;
2328 uint32_t _flags_save_string = ndr->flags;
2329 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
2330 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->unicode_pdc_name));
2331 ndr->flags = _flags_save_string;
2334 uint32_t _flags_save_string = ndr->flags;
2335 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
2336 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->unicode_domain));
2337 ndr->flags = _flags_save_string;
2339 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->db_count));
2340 for (cntr_dbchange_0 = 0; cntr_dbchange_0 < r->db_count; cntr_dbchange_0++) {
2341 NDR_CHECK(ndr_push_nbt_db_change_info(ndr, NDR_SCALARS, &r->dbchange[cntr_dbchange_0]));
2343 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_dom_sid0(&r->sid, ndr->flags)));
2345 struct ndr_push *_ndr_sid;
2346 NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_sid, 0, ndr_size_dom_sid0(&r->sid, ndr->flags)));
2347 NDR_CHECK(ndr_push_dom_sid0(_ndr_sid, NDR_SCALARS|NDR_BUFFERS, &r->sid));
2348 NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_sid, 0, ndr_size_dom_sid0(&r->sid, ndr->flags)));
2350 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->message_format_version));
2351 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->message_token));
2352 NDR_CHECK(ndr_push_trailer_align(ndr, 8));
2354 if (ndr_flags & NDR_BUFFERS) {
2356 return NDR_ERR_SUCCESS;
2359 static enum ndr_err_code ndr_pull_NETLOGON_DB_CHANGE(struct ndr_pull *ndr, int ndr_flags, struct NETLOGON_DB_CHANGE *r)
2361 uint32_t cntr_dbchange_0;
2362 TALLOC_CTX *_mem_save_dbchange_0;
2363 if (ndr_flags & NDR_SCALARS) {
2364 NDR_CHECK(ndr_pull_align(ndr, 8));
2365 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->serial_lo));
2366 NDR_CHECK(ndr_pull_time_t(ndr, NDR_SCALARS, &r->timestamp));
2367 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pulse));
2368 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->random));
2370 uint32_t _flags_save_string = ndr->flags;
2371 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
2372 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->pdc_name));
2373 ndr->flags = _flags_save_string;
2376 uint32_t _flags_save_string = ndr->flags;
2377 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
2378 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->domain));
2379 ndr->flags = _flags_save_string;
2382 uint32_t _flags_save_DATA_BLOB = ndr->flags;
2383 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN2);
2384 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->_pad));
2385 ndr->flags = _flags_save_DATA_BLOB;
2388 uint32_t _flags_save_string = ndr->flags;
2389 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
2390 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->unicode_pdc_name));
2391 ndr->flags = _flags_save_string;
2394 uint32_t _flags_save_string = ndr->flags;
2395 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
2396 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->unicode_domain));
2397 ndr->flags = _flags_save_string;
2399 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->db_count));
2400 NDR_PULL_ALLOC_N(ndr, r->dbchange, r->db_count);
2401 _mem_save_dbchange_0 = NDR_PULL_GET_MEM_CTX(ndr);
2402 NDR_PULL_SET_MEM_CTX(ndr, r->dbchange, 0);
2403 for (cntr_dbchange_0 = 0; cntr_dbchange_0 < r->db_count; cntr_dbchange_0++) {
2404 NDR_CHECK(ndr_pull_nbt_db_change_info(ndr, NDR_SCALARS, &r->dbchange[cntr_dbchange_0]));
2406 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dbchange_0, 0);
2407 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sid_size));
2409 struct ndr_pull *_ndr_sid;
2410 NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_sid, 0, r->sid_size));
2411 NDR_CHECK(ndr_pull_dom_sid0(_ndr_sid, NDR_SCALARS|NDR_BUFFERS, &r->sid));
2412 NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_sid, 0, r->sid_size));
2414 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->message_format_version));
2415 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->message_token));
2416 NDR_CHECK(ndr_pull_trailer_align(ndr, 8));
2418 if (ndr_flags & NDR_BUFFERS) {
2420 return NDR_ERR_SUCCESS;
2423 _PUBLIC_ void ndr_print_NETLOGON_DB_CHANGE(struct ndr_print *ndr, const char *name, const struct NETLOGON_DB_CHANGE *r)
2425 uint32_t cntr_dbchange_0;
2426 ndr_print_struct(ndr, name, "NETLOGON_DB_CHANGE");
2427 ndr->depth++;
2428 ndr_print_uint32(ndr, "serial_lo", r->serial_lo);
2429 ndr_print_time_t(ndr, "timestamp", r->timestamp);
2430 ndr_print_uint32(ndr, "pulse", r->pulse);
2431 ndr_print_uint32(ndr, "random", r->random);
2432 ndr_print_string(ndr, "pdc_name", r->pdc_name);
2433 ndr_print_string(ndr, "domain", r->domain);
2434 ndr_print_DATA_BLOB(ndr, "_pad", r->_pad);
2435 ndr_print_string(ndr, "unicode_pdc_name", r->unicode_pdc_name);
2436 ndr_print_string(ndr, "unicode_domain", r->unicode_domain);
2437 ndr_print_uint32(ndr, "db_count", r->db_count);
2438 ndr->print(ndr, "%s: ARRAY(%d)", "dbchange", (int)r->db_count);
2439 ndr->depth++;
2440 for (cntr_dbchange_0=0;cntr_dbchange_0<r->db_count;cntr_dbchange_0++) {
2441 char *idx_0=NULL;
2442 if (asprintf(&idx_0, "[%d]", cntr_dbchange_0) != -1) {
2443 ndr_print_nbt_db_change_info(ndr, "dbchange", &r->dbchange[cntr_dbchange_0]);
2444 free(idx_0);
2447 ndr->depth--;
2448 ndr_print_uint32(ndr, "sid_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_dom_sid0(&r->sid, ndr->flags):r->sid_size);
2449 ndr_print_dom_sid0(ndr, "sid", &r->sid);
2450 ndr_print_uint32(ndr, "message_format_version", r->message_format_version);
2451 ndr_print_uint32(ndr, "message_token", r->message_token);
2452 ndr->depth--;
2455 static enum ndr_err_code ndr_push_nbt_netlogon_request(struct ndr_push *ndr, int ndr_flags, const union nbt_netlogon_request *r)
2457 if (ndr_flags & NDR_SCALARS) {
2458 int level = ndr_push_get_switch_value(ndr, r);
2459 NDR_CHECK(ndr_push_union_align(ndr, 8));
2460 switch (level) {
2461 case LOGON_SAM_LOGON_REQUEST: {
2462 NDR_CHECK(ndr_push_NETLOGON_SAM_LOGON_REQUEST(ndr, NDR_SCALARS, &r->logon));
2463 break; }
2465 case LOGON_PRIMARY_QUERY: {
2466 NDR_CHECK(ndr_push_nbt_netlogon_query_for_pdc(ndr, NDR_SCALARS, &r->pdc));
2467 break; }
2469 case NETLOGON_ANNOUNCE_UAS: {
2470 NDR_CHECK(ndr_push_NETLOGON_DB_CHANGE(ndr, NDR_SCALARS, &r->uas));
2471 break; }
2473 default:
2474 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
2477 if (ndr_flags & NDR_BUFFERS) {
2478 int level = ndr_push_get_switch_value(ndr, r);
2479 switch (level) {
2480 case LOGON_SAM_LOGON_REQUEST:
2481 NDR_CHECK(ndr_push_NETLOGON_SAM_LOGON_REQUEST(ndr, NDR_BUFFERS, &r->logon));
2482 break;
2484 case LOGON_PRIMARY_QUERY:
2485 break;
2487 case NETLOGON_ANNOUNCE_UAS:
2488 NDR_CHECK(ndr_push_NETLOGON_DB_CHANGE(ndr, NDR_BUFFERS, &r->uas));
2489 break;
2491 default:
2492 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
2495 return NDR_ERR_SUCCESS;
2498 static enum ndr_err_code ndr_pull_nbt_netlogon_request(struct ndr_pull *ndr, int ndr_flags, union nbt_netlogon_request *r)
2500 int level;
2501 level = ndr_pull_get_switch_value(ndr, r);
2502 if (ndr_flags & NDR_SCALARS) {
2503 NDR_CHECK(ndr_pull_union_align(ndr, 8));
2504 switch (level) {
2505 case LOGON_SAM_LOGON_REQUEST: {
2506 NDR_CHECK(ndr_pull_NETLOGON_SAM_LOGON_REQUEST(ndr, NDR_SCALARS, &r->logon));
2507 break; }
2509 case LOGON_PRIMARY_QUERY: {
2510 NDR_CHECK(ndr_pull_nbt_netlogon_query_for_pdc(ndr, NDR_SCALARS, &r->pdc));
2511 break; }
2513 case NETLOGON_ANNOUNCE_UAS: {
2514 NDR_CHECK(ndr_pull_NETLOGON_DB_CHANGE(ndr, NDR_SCALARS, &r->uas));
2515 break; }
2517 default:
2518 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
2521 if (ndr_flags & NDR_BUFFERS) {
2522 switch (level) {
2523 case LOGON_SAM_LOGON_REQUEST:
2524 NDR_CHECK(ndr_pull_NETLOGON_SAM_LOGON_REQUEST(ndr, NDR_BUFFERS, &r->logon));
2525 break;
2527 case LOGON_PRIMARY_QUERY:
2528 break;
2530 case NETLOGON_ANNOUNCE_UAS:
2531 NDR_CHECK(ndr_pull_NETLOGON_DB_CHANGE(ndr, NDR_BUFFERS, &r->uas));
2532 break;
2534 default:
2535 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
2538 return NDR_ERR_SUCCESS;
2541 _PUBLIC_ void ndr_print_nbt_netlogon_request(struct ndr_print *ndr, const char *name, const union nbt_netlogon_request *r)
2543 int level;
2544 level = ndr_print_get_switch_value(ndr, r);
2545 ndr_print_union(ndr, name, level, "nbt_netlogon_request");
2546 switch (level) {
2547 case LOGON_SAM_LOGON_REQUEST:
2548 ndr_print_NETLOGON_SAM_LOGON_REQUEST(ndr, "logon", &r->logon);
2549 break;
2551 case LOGON_PRIMARY_QUERY:
2552 ndr_print_nbt_netlogon_query_for_pdc(ndr, "pdc", &r->pdc);
2553 break;
2555 case NETLOGON_ANNOUNCE_UAS:
2556 ndr_print_NETLOGON_DB_CHANGE(ndr, "uas", &r->uas);
2557 break;
2559 default:
2560 ndr_print_bad_level(ndr, name, level);
2564 _PUBLIC_ enum ndr_err_code ndr_push_nbt_netlogon_packet(struct ndr_push *ndr, int ndr_flags, const struct nbt_netlogon_packet *r)
2567 uint32_t _flags_save_STRUCT = ndr->flags;
2568 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
2569 if (ndr_flags & NDR_SCALARS) {
2570 NDR_CHECK(ndr_push_align(ndr, 8));
2571 NDR_CHECK(ndr_push_netlogon_command(ndr, NDR_SCALARS, r->command));
2572 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->req, r->command));
2573 NDR_CHECK(ndr_push_nbt_netlogon_request(ndr, NDR_SCALARS, &r->req));
2574 NDR_CHECK(ndr_push_trailer_align(ndr, 8));
2576 if (ndr_flags & NDR_BUFFERS) {
2577 NDR_CHECK(ndr_push_nbt_netlogon_request(ndr, NDR_BUFFERS, &r->req));
2579 ndr->flags = _flags_save_STRUCT;
2581 return NDR_ERR_SUCCESS;
2584 _PUBLIC_ enum ndr_err_code ndr_pull_nbt_netlogon_packet(struct ndr_pull *ndr, int ndr_flags, struct nbt_netlogon_packet *r)
2587 uint32_t _flags_save_STRUCT = ndr->flags;
2588 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
2589 if (ndr_flags & NDR_SCALARS) {
2590 NDR_CHECK(ndr_pull_align(ndr, 8));
2591 NDR_CHECK(ndr_pull_netlogon_command(ndr, NDR_SCALARS, &r->command));
2592 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->req, r->command));
2593 NDR_CHECK(ndr_pull_nbt_netlogon_request(ndr, NDR_SCALARS, &r->req));
2594 NDR_CHECK(ndr_pull_trailer_align(ndr, 8));
2596 if (ndr_flags & NDR_BUFFERS) {
2597 NDR_CHECK(ndr_pull_nbt_netlogon_request(ndr, NDR_BUFFERS, &r->req));
2599 ndr->flags = _flags_save_STRUCT;
2601 return NDR_ERR_SUCCESS;
2604 _PUBLIC_ void ndr_print_nbt_netlogon_packet(struct ndr_print *ndr, const char *name, const struct nbt_netlogon_packet *r)
2606 ndr_print_struct(ndr, name, "nbt_netlogon_packet");
2608 uint32_t _flags_save_STRUCT = ndr->flags;
2609 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
2610 ndr->depth++;
2611 ndr_print_netlogon_command(ndr, "command", r->command);
2612 ndr_print_set_switch_value(ndr, &r->req, r->command);
2613 ndr_print_nbt_netlogon_request(ndr, "req", &r->req);
2614 ndr->depth--;
2615 ndr->flags = _flags_save_STRUCT;
2619 static enum ndr_err_code ndr_push_nbt_browse_opcode(struct ndr_push *ndr, int ndr_flags, enum nbt_browse_opcode r)
2621 NDR_CHECK(ndr_push_enum_uint8(ndr, NDR_SCALARS, r));
2622 return NDR_ERR_SUCCESS;
2625 static enum ndr_err_code ndr_pull_nbt_browse_opcode(struct ndr_pull *ndr, int ndr_flags, enum nbt_browse_opcode *r)
2627 uint8_t v;
2628 NDR_CHECK(ndr_pull_enum_uint8(ndr, NDR_SCALARS, &v));
2629 *r = v;
2630 return NDR_ERR_SUCCESS;
2633 _PUBLIC_ void ndr_print_nbt_browse_opcode(struct ndr_print *ndr, const char *name, enum nbt_browse_opcode r)
2635 const char *val = NULL;
2637 switch (r) {
2638 case HostAnnouncement: val = "HostAnnouncement"; break;
2639 case AnnouncementRequest: val = "AnnouncementRequest"; break;
2640 case Election: val = "Election"; break;
2641 case GetBackupListReq: val = "GetBackupListReq"; break;
2642 case GetBackupListResp: val = "GetBackupListResp"; break;
2643 case BecomeBackup: val = "BecomeBackup"; break;
2644 case DomainAnnouncement: val = "DomainAnnouncement"; break;
2645 case MasterAnnouncement: val = "MasterAnnouncement"; break;
2646 case ResetBrowserState: val = "ResetBrowserState"; break;
2647 case LocalMasterAnnouncement: val = "LocalMasterAnnouncement"; break;
2649 ndr_print_enum(ndr, name, "ENUM", val, r);
2652 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)
2654 if (ndr_flags & NDR_SCALARS) {
2655 NDR_CHECK(ndr_push_align(ndr, 4));
2656 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->UpdateCount));
2657 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->Periodicity));
2658 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->ServerName, 16, sizeof(uint8_t), CH_DOS));
2659 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->OSMajor));
2660 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->OSMinor));
2661 NDR_CHECK(ndr_push_svcctl_ServerType(ndr, NDR_SCALARS, r->ServerType));
2662 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->BroMajorVer));
2663 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->BroMinorVer));
2664 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->Signature));
2666 uint32_t _flags_save_string = ndr->flags;
2667 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
2668 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->Comment));
2669 ndr->flags = _flags_save_string;
2671 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
2673 if (ndr_flags & NDR_BUFFERS) {
2675 return NDR_ERR_SUCCESS;
2678 static enum ndr_err_code ndr_pull_nbt_browse_host_announcement(struct ndr_pull *ndr, int ndr_flags, struct nbt_browse_host_announcement *r)
2680 if (ndr_flags & NDR_SCALARS) {
2681 NDR_CHECK(ndr_pull_align(ndr, 4));
2682 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->UpdateCount));
2683 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->Periodicity));
2684 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->ServerName, 16, sizeof(uint8_t), CH_DOS));
2685 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->OSMajor));
2686 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->OSMinor));
2687 NDR_CHECK(ndr_pull_svcctl_ServerType(ndr, NDR_SCALARS, &r->ServerType));
2688 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->BroMajorVer));
2689 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->BroMinorVer));
2690 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->Signature));
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_pull_string(ndr, NDR_SCALARS, &r->Comment));
2695 ndr->flags = _flags_save_string;
2697 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
2699 if (ndr_flags & NDR_BUFFERS) {
2701 return NDR_ERR_SUCCESS;
2704 _PUBLIC_ void ndr_print_nbt_browse_host_announcement(struct ndr_print *ndr, const char *name, const struct nbt_browse_host_announcement *r)
2706 ndr_print_struct(ndr, name, "nbt_browse_host_announcement");
2707 ndr->depth++;
2708 ndr_print_uint8(ndr, "UpdateCount", r->UpdateCount);
2709 ndr_print_uint32(ndr, "Periodicity", r->Periodicity);
2710 ndr_print_string(ndr, "ServerName", r->ServerName);
2711 ndr_print_uint8(ndr, "OSMajor", r->OSMajor);
2712 ndr_print_uint8(ndr, "OSMinor", r->OSMinor);
2713 ndr_print_svcctl_ServerType(ndr, "ServerType", r->ServerType);
2714 ndr_print_uint8(ndr, "BroMajorVer", r->BroMajorVer);
2715 ndr_print_uint8(ndr, "BroMinorVer", r->BroMinorVer);
2716 ndr_print_uint16(ndr, "Signature", r->Signature);
2717 ndr_print_string(ndr, "Comment", r->Comment);
2718 ndr->depth--;
2721 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)
2723 if (ndr_flags & NDR_SCALARS) {
2724 NDR_CHECK(ndr_push_align(ndr, 4));
2725 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->Unused));
2727 uint32_t _flags_save_string = ndr->flags;
2728 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
2729 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->ResponseName));
2730 ndr->flags = _flags_save_string;
2732 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
2734 if (ndr_flags & NDR_BUFFERS) {
2736 return NDR_ERR_SUCCESS;
2739 static enum ndr_err_code ndr_pull_nbt_browse_announcement_request(struct ndr_pull *ndr, int ndr_flags, struct nbt_browse_announcement_request *r)
2741 if (ndr_flags & NDR_SCALARS) {
2742 NDR_CHECK(ndr_pull_align(ndr, 4));
2743 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->Unused));
2745 uint32_t _flags_save_string = ndr->flags;
2746 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
2747 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->ResponseName));
2748 ndr->flags = _flags_save_string;
2750 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
2752 if (ndr_flags & NDR_BUFFERS) {
2754 return NDR_ERR_SUCCESS;
2757 _PUBLIC_ void ndr_print_nbt_browse_announcement_request(struct ndr_print *ndr, const char *name, const struct nbt_browse_announcement_request *r)
2759 ndr_print_struct(ndr, name, "nbt_browse_announcement_request");
2760 ndr->depth++;
2761 ndr_print_uint8(ndr, "Unused", r->Unused);
2762 ndr_print_string(ndr, "ResponseName", r->ResponseName);
2763 ndr->depth--;
2766 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)
2768 if (ndr_flags & NDR_SCALARS) {
2769 NDR_CHECK(ndr_push_align(ndr, 4));
2770 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->Version));
2771 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->Criteria));
2772 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->UpTime));
2773 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->Reserved));
2775 uint32_t _flags_save_string = ndr->flags;
2776 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
2777 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->ServerName));
2778 ndr->flags = _flags_save_string;
2780 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
2782 if (ndr_flags & NDR_BUFFERS) {
2784 return NDR_ERR_SUCCESS;
2787 static enum ndr_err_code ndr_pull_nbt_browse_election_request(struct ndr_pull *ndr, int ndr_flags, struct nbt_browse_election_request *r)
2789 if (ndr_flags & NDR_SCALARS) {
2790 NDR_CHECK(ndr_pull_align(ndr, 4));
2791 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->Version));
2792 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->Criteria));
2793 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->UpTime));
2794 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->Reserved));
2796 uint32_t _flags_save_string = ndr->flags;
2797 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
2798 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->ServerName));
2799 ndr->flags = _flags_save_string;
2801 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
2803 if (ndr_flags & NDR_BUFFERS) {
2805 return NDR_ERR_SUCCESS;
2808 _PUBLIC_ void ndr_print_nbt_browse_election_request(struct ndr_print *ndr, const char *name, const struct nbt_browse_election_request *r)
2810 ndr_print_struct(ndr, name, "nbt_browse_election_request");
2811 ndr->depth++;
2812 ndr_print_uint8(ndr, "Version", r->Version);
2813 ndr_print_uint32(ndr, "Criteria", r->Criteria);
2814 ndr_print_uint32(ndr, "UpTime", r->UpTime);
2815 ndr_print_uint32(ndr, "Reserved", r->Reserved);
2816 ndr_print_string(ndr, "ServerName", r->ServerName);
2817 ndr->depth--;
2820 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)
2822 if (ndr_flags & NDR_SCALARS) {
2823 NDR_CHECK(ndr_push_align(ndr, 4));
2824 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->ReqCount));
2825 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->Token));
2826 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
2828 if (ndr_flags & NDR_BUFFERS) {
2830 return NDR_ERR_SUCCESS;
2833 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)
2835 if (ndr_flags & NDR_SCALARS) {
2836 NDR_CHECK(ndr_pull_align(ndr, 4));
2837 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->ReqCount));
2838 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->Token));
2839 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
2841 if (ndr_flags & NDR_BUFFERS) {
2843 return NDR_ERR_SUCCESS;
2846 _PUBLIC_ void ndr_print_nbt_browse_backup_list_request(struct ndr_print *ndr, const char *name, const struct nbt_browse_backup_list_request *r)
2848 ndr_print_struct(ndr, name, "nbt_browse_backup_list_request");
2849 ndr->depth++;
2850 ndr_print_uint8(ndr, "ReqCount", r->ReqCount);
2851 ndr_print_uint32(ndr, "Token", r->Token);
2852 ndr->depth--;
2855 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)
2857 uint32_t cntr_BackupServerList_0;
2858 if (ndr_flags & NDR_SCALARS) {
2859 NDR_CHECK(ndr_push_align(ndr, 4));
2860 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->BackupCount));
2861 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->Token));
2862 for (cntr_BackupServerList_0 = 0; cntr_BackupServerList_0 < r->BackupCount; cntr_BackupServerList_0++) {
2863 NDR_CHECK(ndr_push_nbt_name(ndr, NDR_SCALARS, &r->BackupServerList[cntr_BackupServerList_0]));
2865 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
2867 if (ndr_flags & NDR_BUFFERS) {
2869 return NDR_ERR_SUCCESS;
2872 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)
2874 uint32_t cntr_BackupServerList_0;
2875 TALLOC_CTX *_mem_save_BackupServerList_0;
2876 if (ndr_flags & NDR_SCALARS) {
2877 NDR_CHECK(ndr_pull_align(ndr, 4));
2878 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->BackupCount));
2879 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->Token));
2880 NDR_PULL_ALLOC_N(ndr, r->BackupServerList, r->BackupCount);
2881 _mem_save_BackupServerList_0 = NDR_PULL_GET_MEM_CTX(ndr);
2882 NDR_PULL_SET_MEM_CTX(ndr, r->BackupServerList, 0);
2883 for (cntr_BackupServerList_0 = 0; cntr_BackupServerList_0 < r->BackupCount; cntr_BackupServerList_0++) {
2884 NDR_CHECK(ndr_pull_nbt_name(ndr, NDR_SCALARS, &r->BackupServerList[cntr_BackupServerList_0]));
2886 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_BackupServerList_0, 0);
2887 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
2889 if (ndr_flags & NDR_BUFFERS) {
2891 return NDR_ERR_SUCCESS;
2894 _PUBLIC_ void ndr_print_nbt_browse_backup_list_response(struct ndr_print *ndr, const char *name, const struct nbt_browse_backup_list_response *r)
2896 uint32_t cntr_BackupServerList_0;
2897 ndr_print_struct(ndr, name, "nbt_browse_backup_list_response");
2898 ndr->depth++;
2899 ndr_print_uint8(ndr, "BackupCount", r->BackupCount);
2900 ndr_print_uint32(ndr, "Token", r->Token);
2901 ndr->print(ndr, "%s: ARRAY(%d)", "BackupServerList", (int)r->BackupCount);
2902 ndr->depth++;
2903 for (cntr_BackupServerList_0=0;cntr_BackupServerList_0<r->BackupCount;cntr_BackupServerList_0++) {
2904 char *idx_0=NULL;
2905 if (asprintf(&idx_0, "[%d]", cntr_BackupServerList_0) != -1) {
2906 ndr_print_nbt_name(ndr, "BackupServerList", &r->BackupServerList[cntr_BackupServerList_0]);
2907 free(idx_0);
2910 ndr->depth--;
2911 ndr->depth--;
2914 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)
2916 if (ndr_flags & NDR_SCALARS) {
2917 NDR_CHECK(ndr_push_align(ndr, 4));
2919 uint32_t _flags_save_string = ndr->flags;
2920 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
2921 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->BrowserName));
2922 ndr->flags = _flags_save_string;
2924 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
2926 if (ndr_flags & NDR_BUFFERS) {
2928 return NDR_ERR_SUCCESS;
2931 static enum ndr_err_code ndr_pull_nbt_browse_become_backup(struct ndr_pull *ndr, int ndr_flags, struct nbt_browse_become_backup *r)
2933 if (ndr_flags & NDR_SCALARS) {
2934 NDR_CHECK(ndr_pull_align(ndr, 4));
2936 uint32_t _flags_save_string = ndr->flags;
2937 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
2938 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->BrowserName));
2939 ndr->flags = _flags_save_string;
2941 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
2943 if (ndr_flags & NDR_BUFFERS) {
2945 return NDR_ERR_SUCCESS;
2948 _PUBLIC_ void ndr_print_nbt_browse_become_backup(struct ndr_print *ndr, const char *name, const struct nbt_browse_become_backup *r)
2950 ndr_print_struct(ndr, name, "nbt_browse_become_backup");
2951 ndr->depth++;
2952 ndr_print_string(ndr, "BrowserName", r->BrowserName);
2953 ndr->depth--;
2956 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)
2958 if (ndr_flags & NDR_SCALARS) {
2959 NDR_CHECK(ndr_push_align(ndr, 4));
2960 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->UpdateCount));
2961 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->Periodicity));
2962 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->ServerName, 16, sizeof(uint8_t), CH_DOS));
2963 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->OSMajor));
2964 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->OSMinor));
2965 NDR_CHECK(ndr_push_svcctl_ServerType(ndr, NDR_SCALARS, r->ServerType));
2966 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->MysteriousField));
2968 uint32_t _flags_save_string = ndr->flags;
2969 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
2970 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->Comment));
2971 ndr->flags = _flags_save_string;
2973 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
2975 if (ndr_flags & NDR_BUFFERS) {
2977 return NDR_ERR_SUCCESS;
2980 static enum ndr_err_code ndr_pull_nbt_browse_domain_announcement(struct ndr_pull *ndr, int ndr_flags, struct nbt_browse_domain_announcement *r)
2982 if (ndr_flags & NDR_SCALARS) {
2983 NDR_CHECK(ndr_pull_align(ndr, 4));
2984 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->UpdateCount));
2985 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->Periodicity));
2986 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->ServerName, 16, sizeof(uint8_t), CH_DOS));
2987 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->OSMajor));
2988 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->OSMinor));
2989 NDR_CHECK(ndr_pull_svcctl_ServerType(ndr, NDR_SCALARS, &r->ServerType));
2990 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->MysteriousField));
2992 uint32_t _flags_save_string = ndr->flags;
2993 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
2994 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->Comment));
2995 ndr->flags = _flags_save_string;
2997 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
2999 if (ndr_flags & NDR_BUFFERS) {
3001 return NDR_ERR_SUCCESS;
3004 _PUBLIC_ void ndr_print_nbt_browse_domain_announcement(struct ndr_print *ndr, const char *name, const struct nbt_browse_domain_announcement *r)
3006 ndr_print_struct(ndr, name, "nbt_browse_domain_announcement");
3007 ndr->depth++;
3008 ndr_print_uint8(ndr, "UpdateCount", r->UpdateCount);
3009 ndr_print_uint32(ndr, "Periodicity", r->Periodicity);
3010 ndr_print_string(ndr, "ServerName", r->ServerName);
3011 ndr_print_uint8(ndr, "OSMajor", r->OSMajor);
3012 ndr_print_uint8(ndr, "OSMinor", r->OSMinor);
3013 ndr_print_svcctl_ServerType(ndr, "ServerType", r->ServerType);
3014 ndr_print_uint32(ndr, "MysteriousField", r->MysteriousField);
3015 ndr_print_string(ndr, "Comment", r->Comment);
3016 ndr->depth--;
3019 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)
3021 if (ndr_flags & NDR_SCALARS) {
3022 NDR_CHECK(ndr_push_align(ndr, 4));
3024 uint32_t _flags_save_string = ndr->flags;
3025 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
3026 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->ServerName));
3027 ndr->flags = _flags_save_string;
3029 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
3031 if (ndr_flags & NDR_BUFFERS) {
3033 return NDR_ERR_SUCCESS;
3036 static enum ndr_err_code ndr_pull_nbt_browse_master_announcement(struct ndr_pull *ndr, int ndr_flags, struct nbt_browse_master_announcement *r)
3038 if (ndr_flags & NDR_SCALARS) {
3039 NDR_CHECK(ndr_pull_align(ndr, 4));
3041 uint32_t _flags_save_string = ndr->flags;
3042 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
3043 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->ServerName));
3044 ndr->flags = _flags_save_string;
3046 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
3048 if (ndr_flags & NDR_BUFFERS) {
3050 return NDR_ERR_SUCCESS;
3053 _PUBLIC_ void ndr_print_nbt_browse_master_announcement(struct ndr_print *ndr, const char *name, const struct nbt_browse_master_announcement *r)
3055 ndr_print_struct(ndr, name, "nbt_browse_master_announcement");
3056 ndr->depth++;
3057 ndr_print_string(ndr, "ServerName", r->ServerName);
3058 ndr->depth--;
3061 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)
3063 if (ndr_flags & NDR_SCALARS) {
3064 NDR_CHECK(ndr_push_align(ndr, 1));
3065 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->Command));
3066 NDR_CHECK(ndr_push_trailer_align(ndr, 1));
3068 if (ndr_flags & NDR_BUFFERS) {
3070 return NDR_ERR_SUCCESS;
3073 static enum ndr_err_code ndr_pull_nbt_browse_reset_state(struct ndr_pull *ndr, int ndr_flags, struct nbt_browse_reset_state *r)
3075 if (ndr_flags & NDR_SCALARS) {
3076 NDR_CHECK(ndr_pull_align(ndr, 1));
3077 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->Command));
3078 NDR_CHECK(ndr_pull_trailer_align(ndr, 1));
3080 if (ndr_flags & NDR_BUFFERS) {
3082 return NDR_ERR_SUCCESS;
3085 _PUBLIC_ void ndr_print_nbt_browse_reset_state(struct ndr_print *ndr, const char *name, const struct nbt_browse_reset_state *r)
3087 ndr_print_struct(ndr, name, "nbt_browse_reset_state");
3088 ndr->depth++;
3089 ndr_print_uint8(ndr, "Command", r->Command);
3090 ndr->depth--;
3093 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)
3095 if (ndr_flags & NDR_SCALARS) {
3096 NDR_CHECK(ndr_push_align(ndr, 4));
3097 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->UpdateCount));
3098 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->Periodicity));
3099 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->ServerName, 16, sizeof(uint8_t), CH_DOS));
3100 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->OSMajor));
3101 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->OSMinor));
3102 NDR_CHECK(ndr_push_svcctl_ServerType(ndr, NDR_SCALARS, r->ServerType));
3103 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->BroMajorVer));
3104 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->BroMinorVer));
3105 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->Signature));
3107 uint32_t _flags_save_string = ndr->flags;
3108 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
3109 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->Comment));
3110 ndr->flags = _flags_save_string;
3112 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
3114 if (ndr_flags & NDR_BUFFERS) {
3116 return NDR_ERR_SUCCESS;
3119 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)
3121 if (ndr_flags & NDR_SCALARS) {
3122 NDR_CHECK(ndr_pull_align(ndr, 4));
3123 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->UpdateCount));
3124 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->Periodicity));
3125 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->ServerName, 16, sizeof(uint8_t), CH_DOS));
3126 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->OSMajor));
3127 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->OSMinor));
3128 NDR_CHECK(ndr_pull_svcctl_ServerType(ndr, NDR_SCALARS, &r->ServerType));
3129 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->BroMajorVer));
3130 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->BroMinorVer));
3131 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->Signature));
3133 uint32_t _flags_save_string = ndr->flags;
3134 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
3135 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->Comment));
3136 ndr->flags = _flags_save_string;
3138 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
3140 if (ndr_flags & NDR_BUFFERS) {
3142 return NDR_ERR_SUCCESS;
3145 _PUBLIC_ void ndr_print_nbt_browse_local_master_announcement(struct ndr_print *ndr, const char *name, const struct nbt_browse_local_master_announcement *r)
3147 ndr_print_struct(ndr, name, "nbt_browse_local_master_announcement");
3148 ndr->depth++;
3149 ndr_print_uint8(ndr, "UpdateCount", r->UpdateCount);
3150 ndr_print_uint32(ndr, "Periodicity", r->Periodicity);
3151 ndr_print_string(ndr, "ServerName", r->ServerName);
3152 ndr_print_uint8(ndr, "OSMajor", r->OSMajor);
3153 ndr_print_uint8(ndr, "OSMinor", r->OSMinor);
3154 ndr_print_svcctl_ServerType(ndr, "ServerType", r->ServerType);
3155 ndr_print_uint8(ndr, "BroMajorVer", r->BroMajorVer);
3156 ndr_print_uint8(ndr, "BroMinorVer", r->BroMinorVer);
3157 ndr_print_uint16(ndr, "Signature", r->Signature);
3158 ndr_print_string(ndr, "Comment", r->Comment);
3159 ndr->depth--;
3162 static enum ndr_err_code ndr_push_nbt_browse_payload(struct ndr_push *ndr, int ndr_flags, const union nbt_browse_payload *r)
3164 if (ndr_flags & NDR_SCALARS) {
3165 int level = ndr_push_get_switch_value(ndr, r);
3166 NDR_CHECK(ndr_push_union_align(ndr, 4));
3167 switch (level) {
3168 case HostAnnouncement: {
3169 NDR_CHECK(ndr_push_nbt_browse_host_announcement(ndr, NDR_SCALARS, &r->host_annoucement));
3170 break; }
3172 case AnnouncementRequest: {
3173 NDR_CHECK(ndr_push_nbt_browse_announcement_request(ndr, NDR_SCALARS, &r->announcement_request));
3174 break; }
3176 case Election: {
3177 NDR_CHECK(ndr_push_nbt_browse_election_request(ndr, NDR_SCALARS, &r->election_request));
3178 break; }
3180 case GetBackupListReq: {
3181 NDR_CHECK(ndr_push_nbt_browse_backup_list_request(ndr, NDR_SCALARS, &r->backup_list_request));
3182 break; }
3184 case GetBackupListResp: {
3185 NDR_CHECK(ndr_push_nbt_browse_backup_list_response(ndr, NDR_SCALARS, &r->backup_list_response));
3186 break; }
3188 case BecomeBackup: {
3189 NDR_CHECK(ndr_push_nbt_browse_become_backup(ndr, NDR_SCALARS, &r->become_backup));
3190 break; }
3192 case DomainAnnouncement: {
3193 NDR_CHECK(ndr_push_nbt_browse_domain_announcement(ndr, NDR_SCALARS, &r->domain_announcement));
3194 break; }
3196 case MasterAnnouncement: {
3197 NDR_CHECK(ndr_push_nbt_browse_master_announcement(ndr, NDR_SCALARS, &r->master_announcement));
3198 break; }
3200 case ResetBrowserState: {
3201 NDR_CHECK(ndr_push_nbt_browse_reset_state(ndr, NDR_SCALARS, &r->reset_browser_state));
3202 break; }
3204 case LocalMasterAnnouncement: {
3205 NDR_CHECK(ndr_push_nbt_browse_local_master_announcement(ndr, NDR_SCALARS, &r->local_master_announcement));
3206 break; }
3208 default:
3209 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
3212 if (ndr_flags & NDR_BUFFERS) {
3213 int level = ndr_push_get_switch_value(ndr, r);
3214 switch (level) {
3215 case HostAnnouncement:
3216 break;
3218 case AnnouncementRequest:
3219 break;
3221 case Election:
3222 break;
3224 case GetBackupListReq:
3225 break;
3227 case GetBackupListResp:
3228 break;
3230 case BecomeBackup:
3231 break;
3233 case DomainAnnouncement:
3234 break;
3236 case MasterAnnouncement:
3237 break;
3239 case ResetBrowserState:
3240 break;
3242 case LocalMasterAnnouncement:
3243 break;
3245 default:
3246 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
3249 return NDR_ERR_SUCCESS;
3252 static enum ndr_err_code ndr_pull_nbt_browse_payload(struct ndr_pull *ndr, int ndr_flags, union nbt_browse_payload *r)
3254 int level;
3255 level = ndr_pull_get_switch_value(ndr, r);
3256 if (ndr_flags & NDR_SCALARS) {
3257 NDR_CHECK(ndr_pull_union_align(ndr, 4));
3258 switch (level) {
3259 case HostAnnouncement: {
3260 NDR_CHECK(ndr_pull_nbt_browse_host_announcement(ndr, NDR_SCALARS, &r->host_annoucement));
3261 break; }
3263 case AnnouncementRequest: {
3264 NDR_CHECK(ndr_pull_nbt_browse_announcement_request(ndr, NDR_SCALARS, &r->announcement_request));
3265 break; }
3267 case Election: {
3268 NDR_CHECK(ndr_pull_nbt_browse_election_request(ndr, NDR_SCALARS, &r->election_request));
3269 break; }
3271 case GetBackupListReq: {
3272 NDR_CHECK(ndr_pull_nbt_browse_backup_list_request(ndr, NDR_SCALARS, &r->backup_list_request));
3273 break; }
3275 case GetBackupListResp: {
3276 NDR_CHECK(ndr_pull_nbt_browse_backup_list_response(ndr, NDR_SCALARS, &r->backup_list_response));
3277 break; }
3279 case BecomeBackup: {
3280 NDR_CHECK(ndr_pull_nbt_browse_become_backup(ndr, NDR_SCALARS, &r->become_backup));
3281 break; }
3283 case DomainAnnouncement: {
3284 NDR_CHECK(ndr_pull_nbt_browse_domain_announcement(ndr, NDR_SCALARS, &r->domain_announcement));
3285 break; }
3287 case MasterAnnouncement: {
3288 NDR_CHECK(ndr_pull_nbt_browse_master_announcement(ndr, NDR_SCALARS, &r->master_announcement));
3289 break; }
3291 case ResetBrowserState: {
3292 NDR_CHECK(ndr_pull_nbt_browse_reset_state(ndr, NDR_SCALARS, &r->reset_browser_state));
3293 break; }
3295 case LocalMasterAnnouncement: {
3296 NDR_CHECK(ndr_pull_nbt_browse_local_master_announcement(ndr, NDR_SCALARS, &r->local_master_announcement));
3297 break; }
3299 default:
3300 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
3303 if (ndr_flags & NDR_BUFFERS) {
3304 switch (level) {
3305 case HostAnnouncement:
3306 break;
3308 case AnnouncementRequest:
3309 break;
3311 case Election:
3312 break;
3314 case GetBackupListReq:
3315 break;
3317 case GetBackupListResp:
3318 break;
3320 case BecomeBackup:
3321 break;
3323 case DomainAnnouncement:
3324 break;
3326 case MasterAnnouncement:
3327 break;
3329 case ResetBrowserState:
3330 break;
3332 case LocalMasterAnnouncement:
3333 break;
3335 default:
3336 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
3339 return NDR_ERR_SUCCESS;
3342 _PUBLIC_ void ndr_print_nbt_browse_payload(struct ndr_print *ndr, const char *name, const union nbt_browse_payload *r)
3344 int level;
3345 level = ndr_print_get_switch_value(ndr, r);
3346 ndr_print_union(ndr, name, level, "nbt_browse_payload");
3347 switch (level) {
3348 case HostAnnouncement:
3349 ndr_print_nbt_browse_host_announcement(ndr, "host_annoucement", &r->host_annoucement);
3350 break;
3352 case AnnouncementRequest:
3353 ndr_print_nbt_browse_announcement_request(ndr, "announcement_request", &r->announcement_request);
3354 break;
3356 case Election:
3357 ndr_print_nbt_browse_election_request(ndr, "election_request", &r->election_request);
3358 break;
3360 case GetBackupListReq:
3361 ndr_print_nbt_browse_backup_list_request(ndr, "backup_list_request", &r->backup_list_request);
3362 break;
3364 case GetBackupListResp:
3365 ndr_print_nbt_browse_backup_list_response(ndr, "backup_list_response", &r->backup_list_response);
3366 break;
3368 case BecomeBackup:
3369 ndr_print_nbt_browse_become_backup(ndr, "become_backup", &r->become_backup);
3370 break;
3372 case DomainAnnouncement:
3373 ndr_print_nbt_browse_domain_announcement(ndr, "domain_announcement", &r->domain_announcement);
3374 break;
3376 case MasterAnnouncement:
3377 ndr_print_nbt_browse_master_announcement(ndr, "master_announcement", &r->master_announcement);
3378 break;
3380 case ResetBrowserState:
3381 ndr_print_nbt_browse_reset_state(ndr, "reset_browser_state", &r->reset_browser_state);
3382 break;
3384 case LocalMasterAnnouncement:
3385 ndr_print_nbt_browse_local_master_announcement(ndr, "local_master_announcement", &r->local_master_announcement);
3386 break;
3388 default:
3389 ndr_print_bad_level(ndr, name, level);
3393 _PUBLIC_ enum ndr_err_code ndr_push_nbt_browse_packet(struct ndr_push *ndr, int ndr_flags, const struct nbt_browse_packet *r)
3396 uint32_t _flags_save_STRUCT = ndr->flags;
3397 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
3398 if (ndr_flags & NDR_SCALARS) {
3399 NDR_CHECK(ndr_push_align(ndr, 4));
3400 NDR_CHECK(ndr_push_nbt_browse_opcode(ndr, NDR_SCALARS, r->opcode));
3401 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->payload, r->opcode));
3402 NDR_CHECK(ndr_push_nbt_browse_payload(ndr, NDR_SCALARS, &r->payload));
3403 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
3405 if (ndr_flags & NDR_BUFFERS) {
3407 ndr->flags = _flags_save_STRUCT;
3409 return NDR_ERR_SUCCESS;
3412 _PUBLIC_ enum ndr_err_code ndr_pull_nbt_browse_packet(struct ndr_pull *ndr, int ndr_flags, struct nbt_browse_packet *r)
3415 uint32_t _flags_save_STRUCT = ndr->flags;
3416 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
3417 if (ndr_flags & NDR_SCALARS) {
3418 NDR_CHECK(ndr_pull_align(ndr, 4));
3419 NDR_CHECK(ndr_pull_nbt_browse_opcode(ndr, NDR_SCALARS, &r->opcode));
3420 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->payload, r->opcode));
3421 NDR_CHECK(ndr_pull_nbt_browse_payload(ndr, NDR_SCALARS, &r->payload));
3422 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
3424 if (ndr_flags & NDR_BUFFERS) {
3426 ndr->flags = _flags_save_STRUCT;
3428 return NDR_ERR_SUCCESS;
3431 _PUBLIC_ void ndr_print_nbt_browse_packet(struct ndr_print *ndr, const char *name, const struct nbt_browse_packet *r)
3433 ndr_print_struct(ndr, name, "nbt_browse_packet");
3435 uint32_t _flags_save_STRUCT = ndr->flags;
3436 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
3437 ndr->depth++;
3438 ndr_print_nbt_browse_opcode(ndr, "opcode", r->opcode);
3439 ndr_print_set_switch_value(ndr, &r->payload, r->opcode);
3440 ndr_print_nbt_browse_payload(ndr, "payload", &r->payload);
3441 ndr->depth--;
3442 ndr->flags = _flags_save_STRUCT;