s3-utils: Use ads_do_search_retry in net ads search
[Samba.git] / librpc / gen_ndr / ndr_dcerpc.c
blobbf0ae29b5d9865fb47a9de518f14acd40c1f9200
1 /* parser auto-generated by pidl */
3 #include "includes.h"
4 #include "../librpc/gen_ndr/ndr_dcerpc.h"
6 #include "librpc/gen_ndr/ndr_misc.h"
7 static enum ndr_err_code ndr_push_dcerpc_ctx_list(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_ctx_list *r)
9 uint32_t cntr_transfer_syntaxes_0;
10 if (ndr_flags & NDR_SCALARS) {
11 NDR_CHECK(ndr_push_align(ndr, 4));
12 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->context_id));
13 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->num_transfer_syntaxes));
14 NDR_CHECK(ndr_push_ndr_syntax_id(ndr, NDR_SCALARS, &r->abstract_syntax));
15 for (cntr_transfer_syntaxes_0 = 0; cntr_transfer_syntaxes_0 < r->num_transfer_syntaxes; cntr_transfer_syntaxes_0++) {
16 NDR_CHECK(ndr_push_ndr_syntax_id(ndr, NDR_SCALARS, &r->transfer_syntaxes[cntr_transfer_syntaxes_0]));
18 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
20 if (ndr_flags & NDR_BUFFERS) {
22 return NDR_ERR_SUCCESS;
25 static enum ndr_err_code ndr_pull_dcerpc_ctx_list(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_ctx_list *r)
27 uint32_t size_transfer_syntaxes_0 = 0;
28 uint32_t cntr_transfer_syntaxes_0;
29 TALLOC_CTX *_mem_save_transfer_syntaxes_0;
30 if (ndr_flags & NDR_SCALARS) {
31 NDR_CHECK(ndr_pull_align(ndr, 4));
32 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->context_id));
33 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->num_transfer_syntaxes));
34 NDR_CHECK(ndr_pull_ndr_syntax_id(ndr, NDR_SCALARS, &r->abstract_syntax));
35 size_transfer_syntaxes_0 = r->num_transfer_syntaxes;
36 NDR_PULL_ALLOC_N(ndr, r->transfer_syntaxes, size_transfer_syntaxes_0);
37 _mem_save_transfer_syntaxes_0 = NDR_PULL_GET_MEM_CTX(ndr);
38 NDR_PULL_SET_MEM_CTX(ndr, r->transfer_syntaxes, 0);
39 for (cntr_transfer_syntaxes_0 = 0; cntr_transfer_syntaxes_0 < size_transfer_syntaxes_0; cntr_transfer_syntaxes_0++) {
40 NDR_CHECK(ndr_pull_ndr_syntax_id(ndr, NDR_SCALARS, &r->transfer_syntaxes[cntr_transfer_syntaxes_0]));
42 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_transfer_syntaxes_0, 0);
43 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
45 if (ndr_flags & NDR_BUFFERS) {
47 return NDR_ERR_SUCCESS;
50 _PUBLIC_ void ndr_print_dcerpc_ctx_list(struct ndr_print *ndr, const char *name, const struct dcerpc_ctx_list *r)
52 uint32_t cntr_transfer_syntaxes_0;
53 ndr_print_struct(ndr, name, "dcerpc_ctx_list");
54 ndr->depth++;
55 ndr_print_uint16(ndr, "context_id", r->context_id);
56 ndr_print_uint8(ndr, "num_transfer_syntaxes", r->num_transfer_syntaxes);
57 ndr_print_ndr_syntax_id(ndr, "abstract_syntax", &r->abstract_syntax);
58 ndr->print(ndr, "%s: ARRAY(%d)", "transfer_syntaxes", (int)r->num_transfer_syntaxes);
59 ndr->depth++;
60 for (cntr_transfer_syntaxes_0=0;cntr_transfer_syntaxes_0<r->num_transfer_syntaxes;cntr_transfer_syntaxes_0++) {
61 char *idx_0=NULL;
62 if (asprintf(&idx_0, "[%d]", cntr_transfer_syntaxes_0) != -1) {
63 ndr_print_ndr_syntax_id(ndr, "transfer_syntaxes", &r->transfer_syntaxes[cntr_transfer_syntaxes_0]);
64 free(idx_0);
67 ndr->depth--;
68 ndr->depth--;
71 static enum ndr_err_code ndr_push_dcerpc_bind(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_bind *r)
73 uint32_t cntr_ctx_list_0;
74 if (ndr_flags & NDR_SCALARS) {
75 NDR_CHECK(ndr_push_align(ndr, 4));
76 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->max_xmit_frag));
77 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->max_recv_frag));
78 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->assoc_group_id));
79 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->num_contexts));
80 for (cntr_ctx_list_0 = 0; cntr_ctx_list_0 < r->num_contexts; cntr_ctx_list_0++) {
81 NDR_CHECK(ndr_push_dcerpc_ctx_list(ndr, NDR_SCALARS, &r->ctx_list[cntr_ctx_list_0]));
84 uint32_t _flags_save_DATA_BLOB = ndr->flags;
85 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4);
86 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->_pad));
87 ndr->flags = _flags_save_DATA_BLOB;
90 uint32_t _flags_save_DATA_BLOB = ndr->flags;
91 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
92 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->auth_info));
93 ndr->flags = _flags_save_DATA_BLOB;
95 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
97 if (ndr_flags & NDR_BUFFERS) {
99 return NDR_ERR_SUCCESS;
102 static enum ndr_err_code ndr_pull_dcerpc_bind(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_bind *r)
104 uint32_t size_ctx_list_0 = 0;
105 uint32_t cntr_ctx_list_0;
106 TALLOC_CTX *_mem_save_ctx_list_0;
107 if (ndr_flags & NDR_SCALARS) {
108 NDR_CHECK(ndr_pull_align(ndr, 4));
109 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->max_xmit_frag));
110 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->max_recv_frag));
111 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->assoc_group_id));
112 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->num_contexts));
113 size_ctx_list_0 = r->num_contexts;
114 NDR_PULL_ALLOC_N(ndr, r->ctx_list, size_ctx_list_0);
115 _mem_save_ctx_list_0 = NDR_PULL_GET_MEM_CTX(ndr);
116 NDR_PULL_SET_MEM_CTX(ndr, r->ctx_list, 0);
117 for (cntr_ctx_list_0 = 0; cntr_ctx_list_0 < size_ctx_list_0; cntr_ctx_list_0++) {
118 NDR_CHECK(ndr_pull_dcerpc_ctx_list(ndr, NDR_SCALARS, &r->ctx_list[cntr_ctx_list_0]));
120 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctx_list_0, 0);
122 uint32_t _flags_save_DATA_BLOB = ndr->flags;
123 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4);
124 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->_pad));
125 ndr->flags = _flags_save_DATA_BLOB;
128 uint32_t _flags_save_DATA_BLOB = ndr->flags;
129 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
130 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->auth_info));
131 ndr->flags = _flags_save_DATA_BLOB;
133 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
135 if (ndr_flags & NDR_BUFFERS) {
137 return NDR_ERR_SUCCESS;
140 _PUBLIC_ void ndr_print_dcerpc_bind(struct ndr_print *ndr, const char *name, const struct dcerpc_bind *r)
142 uint32_t cntr_ctx_list_0;
143 ndr_print_struct(ndr, name, "dcerpc_bind");
144 ndr->depth++;
145 ndr_print_uint16(ndr, "max_xmit_frag", r->max_xmit_frag);
146 ndr_print_uint16(ndr, "max_recv_frag", r->max_recv_frag);
147 ndr_print_uint32(ndr, "assoc_group_id", r->assoc_group_id);
148 ndr_print_uint8(ndr, "num_contexts", r->num_contexts);
149 ndr->print(ndr, "%s: ARRAY(%d)", "ctx_list", (int)r->num_contexts);
150 ndr->depth++;
151 for (cntr_ctx_list_0=0;cntr_ctx_list_0<r->num_contexts;cntr_ctx_list_0++) {
152 char *idx_0=NULL;
153 if (asprintf(&idx_0, "[%d]", cntr_ctx_list_0) != -1) {
154 ndr_print_dcerpc_ctx_list(ndr, "ctx_list", &r->ctx_list[cntr_ctx_list_0]);
155 free(idx_0);
158 ndr->depth--;
159 ndr_print_DATA_BLOB(ndr, "_pad", r->_pad);
160 ndr_print_DATA_BLOB(ndr, "auth_info", r->auth_info);
161 ndr->depth--;
164 static enum ndr_err_code ndr_push_dcerpc_empty(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_empty *r)
166 if (ndr_flags & NDR_SCALARS) {
167 NDR_CHECK(ndr_push_align(ndr, 1));
168 NDR_CHECK(ndr_push_trailer_align(ndr, 1));
170 if (ndr_flags & NDR_BUFFERS) {
172 return NDR_ERR_SUCCESS;
175 static enum ndr_err_code ndr_pull_dcerpc_empty(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_empty *r)
177 if (ndr_flags & NDR_SCALARS) {
178 NDR_CHECK(ndr_pull_align(ndr, 1));
179 NDR_CHECK(ndr_pull_trailer_align(ndr, 1));
181 if (ndr_flags & NDR_BUFFERS) {
183 return NDR_ERR_SUCCESS;
186 _PUBLIC_ void ndr_print_dcerpc_empty(struct ndr_print *ndr, const char *name, const struct dcerpc_empty *r)
188 ndr_print_struct(ndr, name, "dcerpc_empty");
189 ndr->depth++;
190 ndr->depth--;
193 static enum ndr_err_code ndr_push_dcerpc_object(struct ndr_push *ndr, int ndr_flags, const union dcerpc_object *r)
195 if (ndr_flags & NDR_SCALARS) {
196 int level = ndr_push_get_switch_value(ndr, r);
197 NDR_CHECK(ndr_push_union_align(ndr, 4));
198 switch (level) {
199 default: {
200 NDR_CHECK(ndr_push_dcerpc_empty(ndr, NDR_SCALARS, &r->empty));
201 break; }
203 case LIBNDR_FLAG_OBJECT_PRESENT: {
204 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->object));
205 break; }
209 if (ndr_flags & NDR_BUFFERS) {
210 int level = ndr_push_get_switch_value(ndr, r);
211 switch (level) {
212 default:
213 break;
215 case LIBNDR_FLAG_OBJECT_PRESENT:
216 break;
220 return NDR_ERR_SUCCESS;
223 static enum ndr_err_code ndr_pull_dcerpc_object(struct ndr_pull *ndr, int ndr_flags, union dcerpc_object *r)
225 int level;
226 level = ndr_pull_get_switch_value(ndr, r);
227 if (ndr_flags & NDR_SCALARS) {
228 NDR_CHECK(ndr_pull_union_align(ndr, 4));
229 switch (level) {
230 default: {
231 NDR_CHECK(ndr_pull_dcerpc_empty(ndr, NDR_SCALARS, &r->empty));
232 break; }
234 case LIBNDR_FLAG_OBJECT_PRESENT: {
235 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->object));
236 break; }
240 if (ndr_flags & NDR_BUFFERS) {
241 switch (level) {
242 default:
243 break;
245 case LIBNDR_FLAG_OBJECT_PRESENT:
246 break;
250 return NDR_ERR_SUCCESS;
253 _PUBLIC_ void ndr_print_dcerpc_object(struct ndr_print *ndr, const char *name, const union dcerpc_object *r)
255 int level;
256 level = ndr_print_get_switch_value(ndr, r);
257 ndr_print_union(ndr, name, level, "dcerpc_object");
258 switch (level) {
259 default:
260 ndr_print_dcerpc_empty(ndr, "empty", &r->empty);
261 break;
263 case LIBNDR_FLAG_OBJECT_PRESENT:
264 ndr_print_GUID(ndr, "object", &r->object);
265 break;
270 static enum ndr_err_code ndr_push_dcerpc_request(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_request *r)
272 if (ndr_flags & NDR_SCALARS) {
273 NDR_CHECK(ndr_push_align(ndr, 4));
274 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->alloc_hint));
275 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->context_id));
276 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->opnum));
277 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->object, ndr->flags & LIBNDR_FLAG_OBJECT_PRESENT));
278 NDR_CHECK(ndr_push_dcerpc_object(ndr, NDR_SCALARS, &r->object));
280 uint32_t _flags_save_DATA_BLOB = ndr->flags;
281 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN8);
282 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->_pad));
283 ndr->flags = _flags_save_DATA_BLOB;
286 uint32_t _flags_save_DATA_BLOB = ndr->flags;
287 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
288 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->stub_and_verifier));
289 ndr->flags = _flags_save_DATA_BLOB;
291 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
293 if (ndr_flags & NDR_BUFFERS) {
295 return NDR_ERR_SUCCESS;
298 static enum ndr_err_code ndr_pull_dcerpc_request(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_request *r)
300 if (ndr_flags & NDR_SCALARS) {
301 NDR_CHECK(ndr_pull_align(ndr, 4));
302 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->alloc_hint));
303 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->context_id));
304 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->opnum));
305 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->object, ndr->flags & LIBNDR_FLAG_OBJECT_PRESENT));
306 NDR_CHECK(ndr_pull_dcerpc_object(ndr, NDR_SCALARS, &r->object));
308 uint32_t _flags_save_DATA_BLOB = ndr->flags;
309 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN8);
310 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->_pad));
311 ndr->flags = _flags_save_DATA_BLOB;
314 uint32_t _flags_save_DATA_BLOB = ndr->flags;
315 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
316 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->stub_and_verifier));
317 ndr->flags = _flags_save_DATA_BLOB;
319 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
321 if (ndr_flags & NDR_BUFFERS) {
323 return NDR_ERR_SUCCESS;
326 _PUBLIC_ void ndr_print_dcerpc_request(struct ndr_print *ndr, const char *name, const struct dcerpc_request *r)
328 ndr_print_struct(ndr, name, "dcerpc_request");
329 ndr->depth++;
330 ndr_print_uint32(ndr, "alloc_hint", r->alloc_hint);
331 ndr_print_uint16(ndr, "context_id", r->context_id);
332 ndr_print_uint16(ndr, "opnum", r->opnum);
333 ndr_print_set_switch_value(ndr, &r->object, ndr->flags & LIBNDR_FLAG_OBJECT_PRESENT);
334 ndr_print_dcerpc_object(ndr, "object", &r->object);
335 ndr_print_DATA_BLOB(ndr, "_pad", r->_pad);
336 ndr_print_DATA_BLOB(ndr, "stub_and_verifier", r->stub_and_verifier);
337 ndr->depth--;
340 static enum ndr_err_code ndr_push_dcerpc_ack_ctx(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_ack_ctx *r)
342 if (ndr_flags & NDR_SCALARS) {
343 NDR_CHECK(ndr_push_align(ndr, 4));
344 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->result));
345 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->reason));
346 NDR_CHECK(ndr_push_ndr_syntax_id(ndr, NDR_SCALARS, &r->syntax));
347 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
349 if (ndr_flags & NDR_BUFFERS) {
351 return NDR_ERR_SUCCESS;
354 static enum ndr_err_code ndr_pull_dcerpc_ack_ctx(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_ack_ctx *r)
356 if (ndr_flags & NDR_SCALARS) {
357 NDR_CHECK(ndr_pull_align(ndr, 4));
358 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->result));
359 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->reason));
360 NDR_CHECK(ndr_pull_ndr_syntax_id(ndr, NDR_SCALARS, &r->syntax));
361 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
363 if (ndr_flags & NDR_BUFFERS) {
365 return NDR_ERR_SUCCESS;
368 _PUBLIC_ void ndr_print_dcerpc_ack_ctx(struct ndr_print *ndr, const char *name, const struct dcerpc_ack_ctx *r)
370 ndr_print_struct(ndr, name, "dcerpc_ack_ctx");
371 ndr->depth++;
372 ndr_print_uint16(ndr, "result", r->result);
373 ndr_print_uint16(ndr, "reason", r->reason);
374 ndr_print_ndr_syntax_id(ndr, "syntax", &r->syntax);
375 ndr->depth--;
378 static enum ndr_err_code ndr_push_dcerpc_bind_ack(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_bind_ack *r)
380 uint32_t cntr_ctx_list_0;
381 if (ndr_flags & NDR_SCALARS) {
382 NDR_CHECK(ndr_push_align(ndr, 4));
383 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->max_xmit_frag));
384 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->max_recv_frag));
385 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->assoc_group_id));
386 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, strlen(r->secondary_address) + 1));
387 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->secondary_address, strlen(r->secondary_address) + 1, sizeof(uint8_t), CH_DOS));
389 uint32_t _flags_save_DATA_BLOB = ndr->flags;
390 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4);
391 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->_pad1));
392 ndr->flags = _flags_save_DATA_BLOB;
394 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->num_results));
395 for (cntr_ctx_list_0 = 0; cntr_ctx_list_0 < r->num_results; cntr_ctx_list_0++) {
396 NDR_CHECK(ndr_push_dcerpc_ack_ctx(ndr, NDR_SCALARS, &r->ctx_list[cntr_ctx_list_0]));
399 uint32_t _flags_save_DATA_BLOB = ndr->flags;
400 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
401 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->auth_info));
402 ndr->flags = _flags_save_DATA_BLOB;
404 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
406 if (ndr_flags & NDR_BUFFERS) {
408 return NDR_ERR_SUCCESS;
411 static enum ndr_err_code ndr_pull_dcerpc_bind_ack(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_bind_ack *r)
413 uint32_t size_secondary_address_0 = 0;
414 uint32_t size_ctx_list_0 = 0;
415 uint32_t cntr_ctx_list_0;
416 TALLOC_CTX *_mem_save_ctx_list_0;
417 if (ndr_flags & NDR_SCALARS) {
418 NDR_CHECK(ndr_pull_align(ndr, 4));
419 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->max_xmit_frag));
420 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->max_recv_frag));
421 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->assoc_group_id));
422 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->secondary_address_size));
423 size_secondary_address_0 = r->secondary_address_size;
424 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->secondary_address, size_secondary_address_0, sizeof(uint8_t), CH_DOS));
426 uint32_t _flags_save_DATA_BLOB = ndr->flags;
427 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4);
428 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->_pad1));
429 ndr->flags = _flags_save_DATA_BLOB;
431 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->num_results));
432 size_ctx_list_0 = r->num_results;
433 NDR_PULL_ALLOC_N(ndr, r->ctx_list, size_ctx_list_0);
434 _mem_save_ctx_list_0 = NDR_PULL_GET_MEM_CTX(ndr);
435 NDR_PULL_SET_MEM_CTX(ndr, r->ctx_list, 0);
436 for (cntr_ctx_list_0 = 0; cntr_ctx_list_0 < size_ctx_list_0; cntr_ctx_list_0++) {
437 NDR_CHECK(ndr_pull_dcerpc_ack_ctx(ndr, NDR_SCALARS, &r->ctx_list[cntr_ctx_list_0]));
439 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctx_list_0, 0);
441 uint32_t _flags_save_DATA_BLOB = ndr->flags;
442 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
443 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->auth_info));
444 ndr->flags = _flags_save_DATA_BLOB;
446 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
448 if (ndr_flags & NDR_BUFFERS) {
450 return NDR_ERR_SUCCESS;
453 _PUBLIC_ void ndr_print_dcerpc_bind_ack(struct ndr_print *ndr, const char *name, const struct dcerpc_bind_ack *r)
455 uint32_t cntr_ctx_list_0;
456 ndr_print_struct(ndr, name, "dcerpc_bind_ack");
457 ndr->depth++;
458 ndr_print_uint16(ndr, "max_xmit_frag", r->max_xmit_frag);
459 ndr_print_uint16(ndr, "max_recv_frag", r->max_recv_frag);
460 ndr_print_uint32(ndr, "assoc_group_id", r->assoc_group_id);
461 ndr_print_uint16(ndr, "secondary_address_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen(r->secondary_address) + 1:r->secondary_address_size);
462 ndr_print_string(ndr, "secondary_address", r->secondary_address);
463 ndr_print_DATA_BLOB(ndr, "_pad1", r->_pad1);
464 ndr_print_uint8(ndr, "num_results", r->num_results);
465 ndr->print(ndr, "%s: ARRAY(%d)", "ctx_list", (int)r->num_results);
466 ndr->depth++;
467 for (cntr_ctx_list_0=0;cntr_ctx_list_0<r->num_results;cntr_ctx_list_0++) {
468 char *idx_0=NULL;
469 if (asprintf(&idx_0, "[%d]", cntr_ctx_list_0) != -1) {
470 ndr_print_dcerpc_ack_ctx(ndr, "ctx_list", &r->ctx_list[cntr_ctx_list_0]);
471 free(idx_0);
474 ndr->depth--;
475 ndr_print_DATA_BLOB(ndr, "auth_info", r->auth_info);
476 ndr->depth--;
479 static enum ndr_err_code ndr_push_dcerpc_bind_nak_versions(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_bind_nak_versions *r)
481 uint32_t cntr_versions_0;
482 if (ndr_flags & NDR_SCALARS) {
483 NDR_CHECK(ndr_push_align(ndr, 4));
484 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_versions));
485 for (cntr_versions_0 = 0; cntr_versions_0 < r->num_versions; cntr_versions_0++) {
486 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->versions[cntr_versions_0]));
488 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
490 if (ndr_flags & NDR_BUFFERS) {
492 return NDR_ERR_SUCCESS;
495 static enum ndr_err_code ndr_pull_dcerpc_bind_nak_versions(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_bind_nak_versions *r)
497 uint32_t size_versions_0 = 0;
498 uint32_t cntr_versions_0;
499 TALLOC_CTX *_mem_save_versions_0;
500 if (ndr_flags & NDR_SCALARS) {
501 NDR_CHECK(ndr_pull_align(ndr, 4));
502 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_versions));
503 size_versions_0 = r->num_versions;
504 NDR_PULL_ALLOC_N(ndr, r->versions, size_versions_0);
505 _mem_save_versions_0 = NDR_PULL_GET_MEM_CTX(ndr);
506 NDR_PULL_SET_MEM_CTX(ndr, r->versions, 0);
507 for (cntr_versions_0 = 0; cntr_versions_0 < size_versions_0; cntr_versions_0++) {
508 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->versions[cntr_versions_0]));
510 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_versions_0, 0);
511 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
513 if (ndr_flags & NDR_BUFFERS) {
515 return NDR_ERR_SUCCESS;
518 _PUBLIC_ void ndr_print_dcerpc_bind_nak_versions(struct ndr_print *ndr, const char *name, const struct dcerpc_bind_nak_versions *r)
520 uint32_t cntr_versions_0;
521 ndr_print_struct(ndr, name, "dcerpc_bind_nak_versions");
522 ndr->depth++;
523 ndr_print_uint32(ndr, "num_versions", r->num_versions);
524 ndr->print(ndr, "%s: ARRAY(%d)", "versions", (int)r->num_versions);
525 ndr->depth++;
526 for (cntr_versions_0=0;cntr_versions_0<r->num_versions;cntr_versions_0++) {
527 char *idx_0=NULL;
528 if (asprintf(&idx_0, "[%d]", cntr_versions_0) != -1) {
529 ndr_print_uint32(ndr, "versions", r->versions[cntr_versions_0]);
530 free(idx_0);
533 ndr->depth--;
534 ndr->depth--;
537 static enum ndr_err_code ndr_push_dcerpc_bind_nak_versions_ctr(struct ndr_push *ndr, int ndr_flags, const union dcerpc_bind_nak_versions_ctr *r)
539 if (ndr_flags & NDR_SCALARS) {
540 int level = ndr_push_get_switch_value(ndr, r);
541 NDR_CHECK(ndr_push_union_align(ndr, 4));
542 switch (level) {
543 case DECRPC_BIND_PROTOCOL_VERSION_NOT_SUPPORTED: {
544 NDR_CHECK(ndr_push_dcerpc_bind_nak_versions(ndr, NDR_SCALARS, &r->v));
545 break; }
547 default: {
548 break; }
552 if (ndr_flags & NDR_BUFFERS) {
553 int level = ndr_push_get_switch_value(ndr, r);
554 switch (level) {
555 case DECRPC_BIND_PROTOCOL_VERSION_NOT_SUPPORTED:
556 break;
558 default:
559 break;
563 return NDR_ERR_SUCCESS;
566 static enum ndr_err_code ndr_pull_dcerpc_bind_nak_versions_ctr(struct ndr_pull *ndr, int ndr_flags, union dcerpc_bind_nak_versions_ctr *r)
568 int level;
569 level = ndr_pull_get_switch_value(ndr, r);
570 if (ndr_flags & NDR_SCALARS) {
571 NDR_CHECK(ndr_pull_union_align(ndr, 4));
572 switch (level) {
573 case DECRPC_BIND_PROTOCOL_VERSION_NOT_SUPPORTED: {
574 NDR_CHECK(ndr_pull_dcerpc_bind_nak_versions(ndr, NDR_SCALARS, &r->v));
575 break; }
577 default: {
578 break; }
582 if (ndr_flags & NDR_BUFFERS) {
583 switch (level) {
584 case DECRPC_BIND_PROTOCOL_VERSION_NOT_SUPPORTED:
585 break;
587 default:
588 break;
592 return NDR_ERR_SUCCESS;
595 _PUBLIC_ void ndr_print_dcerpc_bind_nak_versions_ctr(struct ndr_print *ndr, const char *name, const union dcerpc_bind_nak_versions_ctr *r)
597 int level;
598 level = ndr_print_get_switch_value(ndr, r);
599 ndr_print_union(ndr, name, level, "dcerpc_bind_nak_versions_ctr");
600 switch (level) {
601 case DECRPC_BIND_PROTOCOL_VERSION_NOT_SUPPORTED:
602 ndr_print_dcerpc_bind_nak_versions(ndr, "v", &r->v);
603 break;
605 default:
606 break;
611 static enum ndr_err_code ndr_push_dcerpc_bind_nak(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_bind_nak *r)
613 if (ndr_flags & NDR_SCALARS) {
614 NDR_CHECK(ndr_push_align(ndr, 4));
615 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->reject_reason));
616 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->versions, r->reject_reason));
617 NDR_CHECK(ndr_push_dcerpc_bind_nak_versions_ctr(ndr, NDR_SCALARS, &r->versions));
618 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
620 if (ndr_flags & NDR_BUFFERS) {
621 NDR_CHECK(ndr_push_dcerpc_bind_nak_versions_ctr(ndr, NDR_BUFFERS, &r->versions));
623 return NDR_ERR_SUCCESS;
626 static enum ndr_err_code ndr_pull_dcerpc_bind_nak(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_bind_nak *r)
628 if (ndr_flags & NDR_SCALARS) {
629 NDR_CHECK(ndr_pull_align(ndr, 4));
630 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->reject_reason));
631 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->versions, r->reject_reason));
632 NDR_CHECK(ndr_pull_dcerpc_bind_nak_versions_ctr(ndr, NDR_SCALARS, &r->versions));
633 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
635 if (ndr_flags & NDR_BUFFERS) {
636 NDR_CHECK(ndr_pull_dcerpc_bind_nak_versions_ctr(ndr, NDR_BUFFERS, &r->versions));
638 return NDR_ERR_SUCCESS;
641 _PUBLIC_ void ndr_print_dcerpc_bind_nak(struct ndr_print *ndr, const char *name, const struct dcerpc_bind_nak *r)
643 ndr_print_struct(ndr, name, "dcerpc_bind_nak");
644 ndr->depth++;
645 ndr_print_uint16(ndr, "reject_reason", r->reject_reason);
646 ndr_print_set_switch_value(ndr, &r->versions, r->reject_reason);
647 ndr_print_dcerpc_bind_nak_versions_ctr(ndr, "versions", &r->versions);
648 ndr->depth--;
651 static enum ndr_err_code ndr_push_dcerpc_response(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_response *r)
653 if (ndr_flags & NDR_SCALARS) {
654 NDR_CHECK(ndr_push_align(ndr, 4));
655 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->alloc_hint));
656 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->context_id));
657 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->cancel_count));
659 uint32_t _flags_save_DATA_BLOB = ndr->flags;
660 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN8);
661 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->_pad));
662 ndr->flags = _flags_save_DATA_BLOB;
665 uint32_t _flags_save_DATA_BLOB = ndr->flags;
666 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
667 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->stub_and_verifier));
668 ndr->flags = _flags_save_DATA_BLOB;
670 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
672 if (ndr_flags & NDR_BUFFERS) {
674 return NDR_ERR_SUCCESS;
677 static enum ndr_err_code ndr_pull_dcerpc_response(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_response *r)
679 if (ndr_flags & NDR_SCALARS) {
680 NDR_CHECK(ndr_pull_align(ndr, 4));
681 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->alloc_hint));
682 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->context_id));
683 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->cancel_count));
685 uint32_t _flags_save_DATA_BLOB = ndr->flags;
686 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN8);
687 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->_pad));
688 ndr->flags = _flags_save_DATA_BLOB;
691 uint32_t _flags_save_DATA_BLOB = ndr->flags;
692 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
693 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->stub_and_verifier));
694 ndr->flags = _flags_save_DATA_BLOB;
696 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
698 if (ndr_flags & NDR_BUFFERS) {
700 return NDR_ERR_SUCCESS;
703 _PUBLIC_ void ndr_print_dcerpc_response(struct ndr_print *ndr, const char *name, const struct dcerpc_response *r)
705 ndr_print_struct(ndr, name, "dcerpc_response");
706 ndr->depth++;
707 ndr_print_uint32(ndr, "alloc_hint", r->alloc_hint);
708 ndr_print_uint16(ndr, "context_id", r->context_id);
709 ndr_print_uint8(ndr, "cancel_count", r->cancel_count);
710 ndr_print_DATA_BLOB(ndr, "_pad", r->_pad);
711 ndr_print_DATA_BLOB(ndr, "stub_and_verifier", r->stub_and_verifier);
712 ndr->depth--;
715 static enum ndr_err_code ndr_push_dcerpc_fault(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_fault *r)
717 if (ndr_flags & NDR_SCALARS) {
718 NDR_CHECK(ndr_push_align(ndr, 4));
719 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->alloc_hint));
720 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->context_id));
721 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->cancel_count));
722 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->status));
724 uint32_t _flags_save_DATA_BLOB = ndr->flags;
725 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
726 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->_pad));
727 ndr->flags = _flags_save_DATA_BLOB;
729 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
731 if (ndr_flags & NDR_BUFFERS) {
733 return NDR_ERR_SUCCESS;
736 static enum ndr_err_code ndr_pull_dcerpc_fault(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_fault *r)
738 if (ndr_flags & NDR_SCALARS) {
739 NDR_CHECK(ndr_pull_align(ndr, 4));
740 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->alloc_hint));
741 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->context_id));
742 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->cancel_count));
743 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->status));
745 uint32_t _flags_save_DATA_BLOB = ndr->flags;
746 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
747 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->_pad));
748 ndr->flags = _flags_save_DATA_BLOB;
750 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
752 if (ndr_flags & NDR_BUFFERS) {
754 return NDR_ERR_SUCCESS;
757 _PUBLIC_ void ndr_print_dcerpc_fault(struct ndr_print *ndr, const char *name, const struct dcerpc_fault *r)
759 ndr_print_struct(ndr, name, "dcerpc_fault");
760 ndr->depth++;
761 ndr_print_uint32(ndr, "alloc_hint", r->alloc_hint);
762 ndr_print_uint16(ndr, "context_id", r->context_id);
763 ndr_print_uint8(ndr, "cancel_count", r->cancel_count);
764 ndr_print_uint32(ndr, "status", r->status);
765 ndr_print_DATA_BLOB(ndr, "_pad", r->_pad);
766 ndr->depth--;
769 static enum ndr_err_code ndr_push_dcerpc_AuthType(struct ndr_push *ndr, int ndr_flags, enum dcerpc_AuthType r)
771 NDR_CHECK(ndr_push_enum_uint8(ndr, NDR_SCALARS, r));
772 return NDR_ERR_SUCCESS;
775 static enum ndr_err_code ndr_pull_dcerpc_AuthType(struct ndr_pull *ndr, int ndr_flags, enum dcerpc_AuthType *r)
777 uint8_t v;
778 NDR_CHECK(ndr_pull_enum_uint8(ndr, NDR_SCALARS, &v));
779 *r = v;
780 return NDR_ERR_SUCCESS;
783 _PUBLIC_ void ndr_print_dcerpc_AuthType(struct ndr_print *ndr, const char *name, enum dcerpc_AuthType r)
785 const char *val = NULL;
787 switch (r) {
788 case DCERPC_AUTH_TYPE_NONE: val = "DCERPC_AUTH_TYPE_NONE"; break;
789 case DCERPC_AUTH_TYPE_KRB5_1: val = "DCERPC_AUTH_TYPE_KRB5_1"; break;
790 case DCERPC_AUTH_TYPE_SPNEGO: val = "DCERPC_AUTH_TYPE_SPNEGO"; break;
791 case DCERPC_AUTH_TYPE_NTLMSSP: val = "DCERPC_AUTH_TYPE_NTLMSSP"; break;
792 case DCERPC_AUTH_TYPE_KRB5: val = "DCERPC_AUTH_TYPE_KRB5"; break;
793 case DCERPC_AUTH_TYPE_DPA: val = "DCERPC_AUTH_TYPE_DPA"; break;
794 case DCERPC_AUTH_TYPE_MSN: val = "DCERPC_AUTH_TYPE_MSN"; break;
795 case DCERPC_AUTH_TYPE_DIGEST: val = "DCERPC_AUTH_TYPE_DIGEST"; break;
796 case DCERPC_AUTH_TYPE_SCHANNEL: val = "DCERPC_AUTH_TYPE_SCHANNEL"; break;
797 case DCERPC_AUTH_TYPE_MSMQ: val = "DCERPC_AUTH_TYPE_MSMQ"; break;
799 ndr_print_enum(ndr, name, "ENUM", val, r);
802 static enum ndr_err_code ndr_push_dcerpc_AuthLevel(struct ndr_push *ndr, int ndr_flags, enum dcerpc_AuthLevel r)
804 NDR_CHECK(ndr_push_enum_uint8(ndr, NDR_SCALARS, r));
805 return NDR_ERR_SUCCESS;
808 static enum ndr_err_code ndr_pull_dcerpc_AuthLevel(struct ndr_pull *ndr, int ndr_flags, enum dcerpc_AuthLevel *r)
810 uint8_t v;
811 NDR_CHECK(ndr_pull_enum_uint8(ndr, NDR_SCALARS, &v));
812 *r = v;
813 return NDR_ERR_SUCCESS;
816 _PUBLIC_ void ndr_print_dcerpc_AuthLevel(struct ndr_print *ndr, const char *name, enum dcerpc_AuthLevel r)
818 const char *val = NULL;
820 switch (r) {
821 case DCERPC_AUTH_LEVEL_NONE: val = "DCERPC_AUTH_LEVEL_NONE"; break;
822 case DCERPC_AUTH_LEVEL_CONNECT: val = "DCERPC_AUTH_LEVEL_CONNECT"; break;
823 case DCERPC_AUTH_LEVEL_CALL: val = "DCERPC_AUTH_LEVEL_CALL"; break;
824 case DCERPC_AUTH_LEVEL_PACKET: val = "DCERPC_AUTH_LEVEL_PACKET"; break;
825 case DCERPC_AUTH_LEVEL_INTEGRITY: val = "DCERPC_AUTH_LEVEL_INTEGRITY"; break;
826 case DCERPC_AUTH_LEVEL_PRIVACY: val = "DCERPC_AUTH_LEVEL_PRIVACY"; break;
828 ndr_print_enum(ndr, name, "ENUM", val, r);
831 _PUBLIC_ enum ndr_err_code ndr_push_dcerpc_auth(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_auth *r)
833 if (ndr_flags & NDR_SCALARS) {
834 NDR_CHECK(ndr_push_align(ndr, 4));
835 NDR_CHECK(ndr_push_dcerpc_AuthType(ndr, NDR_SCALARS, r->auth_type));
836 NDR_CHECK(ndr_push_dcerpc_AuthLevel(ndr, NDR_SCALARS, r->auth_level));
837 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->auth_pad_length));
838 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->auth_reserved));
839 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->auth_context_id));
841 uint32_t _flags_save_DATA_BLOB = ndr->flags;
842 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
843 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->credentials));
844 ndr->flags = _flags_save_DATA_BLOB;
846 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
848 if (ndr_flags & NDR_BUFFERS) {
850 return NDR_ERR_SUCCESS;
853 _PUBLIC_ enum ndr_err_code ndr_pull_dcerpc_auth(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_auth *r)
855 if (ndr_flags & NDR_SCALARS) {
856 NDR_CHECK(ndr_pull_align(ndr, 4));
857 NDR_CHECK(ndr_pull_dcerpc_AuthType(ndr, NDR_SCALARS, &r->auth_type));
858 NDR_CHECK(ndr_pull_dcerpc_AuthLevel(ndr, NDR_SCALARS, &r->auth_level));
859 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->auth_pad_length));
860 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->auth_reserved));
861 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->auth_context_id));
863 uint32_t _flags_save_DATA_BLOB = ndr->flags;
864 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
865 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->credentials));
866 ndr->flags = _flags_save_DATA_BLOB;
868 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
870 if (ndr_flags & NDR_BUFFERS) {
872 return NDR_ERR_SUCCESS;
875 _PUBLIC_ void ndr_print_dcerpc_auth(struct ndr_print *ndr, const char *name, const struct dcerpc_auth *r)
877 ndr_print_struct(ndr, name, "dcerpc_auth");
878 ndr->depth++;
879 ndr_print_dcerpc_AuthType(ndr, "auth_type", r->auth_type);
880 ndr_print_dcerpc_AuthLevel(ndr, "auth_level", r->auth_level);
881 ndr_print_uint8(ndr, "auth_pad_length", r->auth_pad_length);
882 ndr_print_uint8(ndr, "auth_reserved", r->auth_reserved);
883 ndr_print_uint32(ndr, "auth_context_id", r->auth_context_id);
884 ndr_print_DATA_BLOB(ndr, "credentials", r->credentials);
885 ndr->depth--;
888 _PUBLIC_ enum ndr_err_code ndr_push_dcerpc_auth3(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_auth3 *r)
890 if (ndr_flags & NDR_SCALARS) {
891 NDR_CHECK(ndr_push_align(ndr, 4));
892 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->_pad));
894 uint32_t _flags_save_DATA_BLOB = ndr->flags;
895 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
896 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->auth_info));
897 ndr->flags = _flags_save_DATA_BLOB;
899 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
901 if (ndr_flags & NDR_BUFFERS) {
903 return NDR_ERR_SUCCESS;
906 _PUBLIC_ enum ndr_err_code ndr_pull_dcerpc_auth3(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_auth3 *r)
908 if (ndr_flags & NDR_SCALARS) {
909 NDR_CHECK(ndr_pull_align(ndr, 4));
910 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->_pad));
912 uint32_t _flags_save_DATA_BLOB = ndr->flags;
913 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
914 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->auth_info));
915 ndr->flags = _flags_save_DATA_BLOB;
917 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
919 if (ndr_flags & NDR_BUFFERS) {
921 return NDR_ERR_SUCCESS;
924 _PUBLIC_ void ndr_print_dcerpc_auth3(struct ndr_print *ndr, const char *name, const struct dcerpc_auth3 *r)
926 ndr_print_struct(ndr, name, "dcerpc_auth3");
927 ndr->depth++;
928 ndr_print_uint32(ndr, "_pad", r->_pad);
929 ndr_print_DATA_BLOB(ndr, "auth_info", r->auth_info);
930 ndr->depth--;
933 _PUBLIC_ enum ndr_err_code ndr_push_dcerpc_orphaned(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_orphaned *r)
935 if (ndr_flags & NDR_SCALARS) {
936 NDR_CHECK(ndr_push_align(ndr, 4));
937 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->_pad));
939 uint32_t _flags_save_DATA_BLOB = ndr->flags;
940 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
941 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->auth_info));
942 ndr->flags = _flags_save_DATA_BLOB;
944 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
946 if (ndr_flags & NDR_BUFFERS) {
948 return NDR_ERR_SUCCESS;
951 _PUBLIC_ enum ndr_err_code ndr_pull_dcerpc_orphaned(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_orphaned *r)
953 if (ndr_flags & NDR_SCALARS) {
954 NDR_CHECK(ndr_pull_align(ndr, 4));
955 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->_pad));
957 uint32_t _flags_save_DATA_BLOB = ndr->flags;
958 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
959 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->auth_info));
960 ndr->flags = _flags_save_DATA_BLOB;
962 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
964 if (ndr_flags & NDR_BUFFERS) {
966 return NDR_ERR_SUCCESS;
969 _PUBLIC_ void ndr_print_dcerpc_orphaned(struct ndr_print *ndr, const char *name, const struct dcerpc_orphaned *r)
971 ndr_print_struct(ndr, name, "dcerpc_orphaned");
972 ndr->depth++;
973 ndr_print_uint32(ndr, "_pad", r->_pad);
974 ndr_print_DATA_BLOB(ndr, "auth_info", r->auth_info);
975 ndr->depth--;
978 _PUBLIC_ enum ndr_err_code ndr_push_dcerpc_co_cancel(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_co_cancel *r)
980 if (ndr_flags & NDR_SCALARS) {
981 NDR_CHECK(ndr_push_align(ndr, 4));
982 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->_pad));
984 uint32_t _flags_save_DATA_BLOB = ndr->flags;
985 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
986 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->auth_info));
987 ndr->flags = _flags_save_DATA_BLOB;
989 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
991 if (ndr_flags & NDR_BUFFERS) {
993 return NDR_ERR_SUCCESS;
996 _PUBLIC_ enum ndr_err_code ndr_pull_dcerpc_co_cancel(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_co_cancel *r)
998 if (ndr_flags & NDR_SCALARS) {
999 NDR_CHECK(ndr_pull_align(ndr, 4));
1000 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->_pad));
1002 uint32_t _flags_save_DATA_BLOB = ndr->flags;
1003 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
1004 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->auth_info));
1005 ndr->flags = _flags_save_DATA_BLOB;
1007 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
1009 if (ndr_flags & NDR_BUFFERS) {
1011 return NDR_ERR_SUCCESS;
1014 _PUBLIC_ void ndr_print_dcerpc_co_cancel(struct ndr_print *ndr, const char *name, const struct dcerpc_co_cancel *r)
1016 ndr_print_struct(ndr, name, "dcerpc_co_cancel");
1017 ndr->depth++;
1018 ndr_print_uint32(ndr, "_pad", r->_pad);
1019 ndr_print_DATA_BLOB(ndr, "auth_info", r->auth_info);
1020 ndr->depth--;
1023 _PUBLIC_ enum ndr_err_code ndr_push_dcerpc_cl_cancel(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_cl_cancel *r)
1025 if (ndr_flags & NDR_SCALARS) {
1026 NDR_CHECK(ndr_push_align(ndr, 4));
1027 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version));
1028 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->id));
1029 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
1031 if (ndr_flags & NDR_BUFFERS) {
1033 return NDR_ERR_SUCCESS;
1036 _PUBLIC_ enum ndr_err_code ndr_pull_dcerpc_cl_cancel(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_cl_cancel *r)
1038 if (ndr_flags & NDR_SCALARS) {
1039 NDR_CHECK(ndr_pull_align(ndr, 4));
1040 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version));
1041 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->id));
1042 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
1044 if (ndr_flags & NDR_BUFFERS) {
1046 return NDR_ERR_SUCCESS;
1049 _PUBLIC_ void ndr_print_dcerpc_cl_cancel(struct ndr_print *ndr, const char *name, const struct dcerpc_cl_cancel *r)
1051 ndr_print_struct(ndr, name, "dcerpc_cl_cancel");
1052 ndr->depth++;
1053 ndr_print_uint32(ndr, "version", r->version);
1054 ndr_print_uint32(ndr, "id", r->id);
1055 ndr->depth--;
1058 _PUBLIC_ enum ndr_err_code ndr_push_dcerpc_cancel_ack(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_cancel_ack *r)
1060 if (ndr_flags & NDR_SCALARS) {
1061 NDR_CHECK(ndr_push_align(ndr, 4));
1062 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version));
1063 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->id));
1064 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->server_is_accepting));
1065 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
1067 if (ndr_flags & NDR_BUFFERS) {
1069 return NDR_ERR_SUCCESS;
1072 _PUBLIC_ enum ndr_err_code ndr_pull_dcerpc_cancel_ack(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_cancel_ack *r)
1074 if (ndr_flags & NDR_SCALARS) {
1075 NDR_CHECK(ndr_pull_align(ndr, 4));
1076 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version));
1077 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->id));
1078 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->server_is_accepting));
1079 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
1081 if (ndr_flags & NDR_BUFFERS) {
1083 return NDR_ERR_SUCCESS;
1086 _PUBLIC_ void ndr_print_dcerpc_cancel_ack(struct ndr_print *ndr, const char *name, const struct dcerpc_cancel_ack *r)
1088 ndr_print_struct(ndr, name, "dcerpc_cancel_ack");
1089 ndr->depth++;
1090 ndr_print_uint32(ndr, "version", r->version);
1091 ndr_print_uint32(ndr, "id", r->id);
1092 ndr_print_uint32(ndr, "server_is_accepting", r->server_is_accepting);
1093 ndr->depth--;
1096 _PUBLIC_ enum ndr_err_code ndr_push_dcerpc_fack(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_fack *r)
1098 uint32_t cntr_selack_0;
1099 if (ndr_flags & NDR_SCALARS) {
1100 NDR_CHECK(ndr_push_align(ndr, 4));
1101 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version));
1102 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->_pad1));
1103 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->window_size));
1104 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->max_tdsu));
1105 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->max_frag_size));
1106 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->serial_no));
1107 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->selack_size));
1108 for (cntr_selack_0 = 0; cntr_selack_0 < r->selack_size; cntr_selack_0++) {
1109 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->selack[cntr_selack_0]));
1111 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
1113 if (ndr_flags & NDR_BUFFERS) {
1115 return NDR_ERR_SUCCESS;
1118 _PUBLIC_ enum ndr_err_code ndr_pull_dcerpc_fack(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_fack *r)
1120 uint32_t size_selack_0 = 0;
1121 uint32_t cntr_selack_0;
1122 TALLOC_CTX *_mem_save_selack_0;
1123 if (ndr_flags & NDR_SCALARS) {
1124 NDR_CHECK(ndr_pull_align(ndr, 4));
1125 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version));
1126 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->_pad1));
1127 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->window_size));
1128 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->max_tdsu));
1129 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->max_frag_size));
1130 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->serial_no));
1131 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->selack_size));
1132 size_selack_0 = r->selack_size;
1133 NDR_PULL_ALLOC_N(ndr, r->selack, size_selack_0);
1134 _mem_save_selack_0 = NDR_PULL_GET_MEM_CTX(ndr);
1135 NDR_PULL_SET_MEM_CTX(ndr, r->selack, 0);
1136 for (cntr_selack_0 = 0; cntr_selack_0 < size_selack_0; cntr_selack_0++) {
1137 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->selack[cntr_selack_0]));
1139 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_selack_0, 0);
1140 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
1142 if (ndr_flags & NDR_BUFFERS) {
1144 return NDR_ERR_SUCCESS;
1147 _PUBLIC_ void ndr_print_dcerpc_fack(struct ndr_print *ndr, const char *name, const struct dcerpc_fack *r)
1149 uint32_t cntr_selack_0;
1150 ndr_print_struct(ndr, name, "dcerpc_fack");
1151 ndr->depth++;
1152 ndr_print_uint32(ndr, "version", r->version);
1153 ndr_print_uint8(ndr, "_pad1", r->_pad1);
1154 ndr_print_uint16(ndr, "window_size", r->window_size);
1155 ndr_print_uint32(ndr, "max_tdsu", r->max_tdsu);
1156 ndr_print_uint32(ndr, "max_frag_size", r->max_frag_size);
1157 ndr_print_uint16(ndr, "serial_no", r->serial_no);
1158 ndr_print_uint16(ndr, "selack_size", r->selack_size);
1159 ndr->print(ndr, "%s: ARRAY(%d)", "selack", (int)r->selack_size);
1160 ndr->depth++;
1161 for (cntr_selack_0=0;cntr_selack_0<r->selack_size;cntr_selack_0++) {
1162 char *idx_0=NULL;
1163 if (asprintf(&idx_0, "[%d]", cntr_selack_0) != -1) {
1164 ndr_print_uint32(ndr, "selack", r->selack[cntr_selack_0]);
1165 free(idx_0);
1168 ndr->depth--;
1169 ndr->depth--;
1172 _PUBLIC_ enum ndr_err_code ndr_push_dcerpc_ack(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_ack *r)
1174 if (ndr_flags & NDR_SCALARS) {
1175 NDR_CHECK(ndr_push_align(ndr, 1));
1176 NDR_CHECK(ndr_push_trailer_align(ndr, 1));
1178 if (ndr_flags & NDR_BUFFERS) {
1180 return NDR_ERR_SUCCESS;
1183 _PUBLIC_ enum ndr_err_code ndr_pull_dcerpc_ack(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_ack *r)
1185 if (ndr_flags & NDR_SCALARS) {
1186 NDR_CHECK(ndr_pull_align(ndr, 1));
1187 NDR_CHECK(ndr_pull_trailer_align(ndr, 1));
1189 if (ndr_flags & NDR_BUFFERS) {
1191 return NDR_ERR_SUCCESS;
1194 _PUBLIC_ void ndr_print_dcerpc_ack(struct ndr_print *ndr, const char *name, const struct dcerpc_ack *r)
1196 ndr_print_struct(ndr, name, "dcerpc_ack");
1197 ndr->depth++;
1198 ndr->depth--;
1201 _PUBLIC_ enum ndr_err_code ndr_push_dcerpc_ping(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_ping *r)
1203 if (ndr_flags & NDR_SCALARS) {
1204 NDR_CHECK(ndr_push_align(ndr, 1));
1205 NDR_CHECK(ndr_push_trailer_align(ndr, 1));
1207 if (ndr_flags & NDR_BUFFERS) {
1209 return NDR_ERR_SUCCESS;
1212 _PUBLIC_ enum ndr_err_code ndr_pull_dcerpc_ping(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_ping *r)
1214 if (ndr_flags & NDR_SCALARS) {
1215 NDR_CHECK(ndr_pull_align(ndr, 1));
1216 NDR_CHECK(ndr_pull_trailer_align(ndr, 1));
1218 if (ndr_flags & NDR_BUFFERS) {
1220 return NDR_ERR_SUCCESS;
1223 _PUBLIC_ void ndr_print_dcerpc_ping(struct ndr_print *ndr, const char *name, const struct dcerpc_ping *r)
1225 ndr_print_struct(ndr, name, "dcerpc_ping");
1226 ndr->depth++;
1227 ndr->depth--;
1230 _PUBLIC_ enum ndr_err_code ndr_push_dcerpc_shutdown(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_shutdown *r)
1232 if (ndr_flags & NDR_SCALARS) {
1233 NDR_CHECK(ndr_push_align(ndr, 1));
1234 NDR_CHECK(ndr_push_trailer_align(ndr, 1));
1236 if (ndr_flags & NDR_BUFFERS) {
1238 return NDR_ERR_SUCCESS;
1241 _PUBLIC_ enum ndr_err_code ndr_pull_dcerpc_shutdown(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_shutdown *r)
1243 if (ndr_flags & NDR_SCALARS) {
1244 NDR_CHECK(ndr_pull_align(ndr, 1));
1245 NDR_CHECK(ndr_pull_trailer_align(ndr, 1));
1247 if (ndr_flags & NDR_BUFFERS) {
1249 return NDR_ERR_SUCCESS;
1252 _PUBLIC_ void ndr_print_dcerpc_shutdown(struct ndr_print *ndr, const char *name, const struct dcerpc_shutdown *r)
1254 ndr_print_struct(ndr, name, "dcerpc_shutdown");
1255 ndr->depth++;
1256 ndr->depth--;
1259 _PUBLIC_ enum ndr_err_code ndr_push_dcerpc_working(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_working *r)
1261 if (ndr_flags & NDR_SCALARS) {
1262 NDR_CHECK(ndr_push_align(ndr, 1));
1263 NDR_CHECK(ndr_push_trailer_align(ndr, 1));
1265 if (ndr_flags & NDR_BUFFERS) {
1267 return NDR_ERR_SUCCESS;
1270 _PUBLIC_ enum ndr_err_code ndr_pull_dcerpc_working(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_working *r)
1272 if (ndr_flags & NDR_SCALARS) {
1273 NDR_CHECK(ndr_pull_align(ndr, 1));
1274 NDR_CHECK(ndr_pull_trailer_align(ndr, 1));
1276 if (ndr_flags & NDR_BUFFERS) {
1278 return NDR_ERR_SUCCESS;
1281 _PUBLIC_ void ndr_print_dcerpc_working(struct ndr_print *ndr, const char *name, const struct dcerpc_working *r)
1283 ndr_print_struct(ndr, name, "dcerpc_working");
1284 ndr->depth++;
1285 ndr->depth--;
1288 static enum ndr_err_code ndr_push_dcerpc_pkt_type(struct ndr_push *ndr, int ndr_flags, enum dcerpc_pkt_type r)
1290 NDR_CHECK(ndr_push_enum_uint8(ndr, NDR_SCALARS, r));
1291 return NDR_ERR_SUCCESS;
1294 static enum ndr_err_code ndr_pull_dcerpc_pkt_type(struct ndr_pull *ndr, int ndr_flags, enum dcerpc_pkt_type *r)
1296 uint8_t v;
1297 NDR_CHECK(ndr_pull_enum_uint8(ndr, NDR_SCALARS, &v));
1298 *r = v;
1299 return NDR_ERR_SUCCESS;
1302 _PUBLIC_ void ndr_print_dcerpc_pkt_type(struct ndr_print *ndr, const char *name, enum dcerpc_pkt_type r)
1304 const char *val = NULL;
1306 switch (r) {
1307 case DCERPC_PKT_REQUEST: val = "DCERPC_PKT_REQUEST"; break;
1308 case DCERPC_PKT_PING: val = "DCERPC_PKT_PING"; break;
1309 case DCERPC_PKT_RESPONSE: val = "DCERPC_PKT_RESPONSE"; break;
1310 case DCERPC_PKT_FAULT: val = "DCERPC_PKT_FAULT"; break;
1311 case DCERPC_PKT_WORKING: val = "DCERPC_PKT_WORKING"; break;
1312 case DCERPC_PKT_NOCALL: val = "DCERPC_PKT_NOCALL"; break;
1313 case DCERPC_PKT_REJECT: val = "DCERPC_PKT_REJECT"; break;
1314 case DCERPC_PKT_ACK: val = "DCERPC_PKT_ACK"; break;
1315 case DCERPC_PKT_CL_CANCEL: val = "DCERPC_PKT_CL_CANCEL"; break;
1316 case DCERPC_PKT_FACK: val = "DCERPC_PKT_FACK"; break;
1317 case DCERPC_PKT_CANCEL_ACK: val = "DCERPC_PKT_CANCEL_ACK"; break;
1318 case DCERPC_PKT_BIND: val = "DCERPC_PKT_BIND"; break;
1319 case DCERPC_PKT_BIND_ACK: val = "DCERPC_PKT_BIND_ACK"; break;
1320 case DCERPC_PKT_BIND_NAK: val = "DCERPC_PKT_BIND_NAK"; break;
1321 case DCERPC_PKT_ALTER: val = "DCERPC_PKT_ALTER"; break;
1322 case DCERPC_PKT_ALTER_RESP: val = "DCERPC_PKT_ALTER_RESP"; break;
1323 case DCERPC_PKT_AUTH3: val = "DCERPC_PKT_AUTH3"; break;
1324 case DCERPC_PKT_SHUTDOWN: val = "DCERPC_PKT_SHUTDOWN"; break;
1325 case DCERPC_PKT_CO_CANCEL: val = "DCERPC_PKT_CO_CANCEL"; break;
1326 case DCERPC_PKT_ORPHANED: val = "DCERPC_PKT_ORPHANED"; break;
1328 ndr_print_enum(ndr, name, "ENUM", val, r);
1331 static enum ndr_err_code ndr_push_dcerpc_payload(struct ndr_push *ndr, int ndr_flags, const union dcerpc_payload *r)
1333 if (ndr_flags & NDR_SCALARS) {
1334 int level = ndr_push_get_switch_value(ndr, r);
1335 NDR_CHECK(ndr_push_union_align(ndr, 4));
1336 switch (level) {
1337 case DCERPC_PKT_REQUEST: {
1338 NDR_CHECK(ndr_push_dcerpc_request(ndr, NDR_SCALARS, &r->request));
1339 break; }
1341 case DCERPC_PKT_PING: {
1342 NDR_CHECK(ndr_push_dcerpc_ping(ndr, NDR_SCALARS, &r->ping));
1343 break; }
1345 case DCERPC_PKT_RESPONSE: {
1346 NDR_CHECK(ndr_push_dcerpc_response(ndr, NDR_SCALARS, &r->response));
1347 break; }
1349 case DCERPC_PKT_FAULT: {
1350 NDR_CHECK(ndr_push_dcerpc_fault(ndr, NDR_SCALARS, &r->fault));
1351 break; }
1353 case DCERPC_PKT_WORKING: {
1354 NDR_CHECK(ndr_push_dcerpc_working(ndr, NDR_SCALARS, &r->working));
1355 break; }
1357 case DCERPC_PKT_NOCALL: {
1358 NDR_CHECK(ndr_push_dcerpc_fack(ndr, NDR_SCALARS, &r->nocall));
1359 break; }
1361 case DCERPC_PKT_REJECT: {
1362 NDR_CHECK(ndr_push_dcerpc_fault(ndr, NDR_SCALARS, &r->reject));
1363 break; }
1365 case DCERPC_PKT_ACK: {
1366 NDR_CHECK(ndr_push_dcerpc_ack(ndr, NDR_SCALARS, &r->ack));
1367 break; }
1369 case DCERPC_PKT_CL_CANCEL: {
1370 NDR_CHECK(ndr_push_dcerpc_cl_cancel(ndr, NDR_SCALARS, &r->cl_cancel));
1371 break; }
1373 case DCERPC_PKT_FACK: {
1374 NDR_CHECK(ndr_push_dcerpc_fack(ndr, NDR_SCALARS, &r->fack));
1375 break; }
1377 case DCERPC_PKT_CANCEL_ACK: {
1378 NDR_CHECK(ndr_push_dcerpc_cancel_ack(ndr, NDR_SCALARS, &r->cancel_ack));
1379 break; }
1381 case DCERPC_PKT_BIND: {
1382 NDR_CHECK(ndr_push_dcerpc_bind(ndr, NDR_SCALARS, &r->bind));
1383 break; }
1385 case DCERPC_PKT_BIND_ACK: {
1386 NDR_CHECK(ndr_push_dcerpc_bind_ack(ndr, NDR_SCALARS, &r->bind_ack));
1387 break; }
1389 case DCERPC_PKT_BIND_NAK: {
1390 NDR_CHECK(ndr_push_dcerpc_bind_nak(ndr, NDR_SCALARS, &r->bind_nak));
1391 break; }
1393 case DCERPC_PKT_ALTER: {
1394 NDR_CHECK(ndr_push_dcerpc_bind(ndr, NDR_SCALARS, &r->alter));
1395 break; }
1397 case DCERPC_PKT_ALTER_RESP: {
1398 NDR_CHECK(ndr_push_dcerpc_bind_ack(ndr, NDR_SCALARS, &r->alter_resp));
1399 break; }
1401 case DCERPC_PKT_SHUTDOWN: {
1402 NDR_CHECK(ndr_push_dcerpc_shutdown(ndr, NDR_SCALARS, &r->shutdown));
1403 break; }
1405 case DCERPC_PKT_CO_CANCEL: {
1406 NDR_CHECK(ndr_push_dcerpc_co_cancel(ndr, NDR_SCALARS, &r->co_cancel));
1407 break; }
1409 case DCERPC_PKT_ORPHANED: {
1410 NDR_CHECK(ndr_push_dcerpc_orphaned(ndr, NDR_SCALARS, &r->orphaned));
1411 break; }
1413 case DCERPC_PKT_AUTH3: {
1414 NDR_CHECK(ndr_push_dcerpc_auth3(ndr, NDR_SCALARS, &r->auth3));
1415 break; }
1417 default:
1418 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
1421 if (ndr_flags & NDR_BUFFERS) {
1422 int level = ndr_push_get_switch_value(ndr, r);
1423 switch (level) {
1424 case DCERPC_PKT_REQUEST:
1425 break;
1427 case DCERPC_PKT_PING:
1428 break;
1430 case DCERPC_PKT_RESPONSE:
1431 break;
1433 case DCERPC_PKT_FAULT:
1434 break;
1436 case DCERPC_PKT_WORKING:
1437 break;
1439 case DCERPC_PKT_NOCALL:
1440 break;
1442 case DCERPC_PKT_REJECT:
1443 break;
1445 case DCERPC_PKT_ACK:
1446 break;
1448 case DCERPC_PKT_CL_CANCEL:
1449 break;
1451 case DCERPC_PKT_FACK:
1452 break;
1454 case DCERPC_PKT_CANCEL_ACK:
1455 break;
1457 case DCERPC_PKT_BIND:
1458 break;
1460 case DCERPC_PKT_BIND_ACK:
1461 break;
1463 case DCERPC_PKT_BIND_NAK:
1464 NDR_CHECK(ndr_push_dcerpc_bind_nak(ndr, NDR_BUFFERS, &r->bind_nak));
1465 break;
1467 case DCERPC_PKT_ALTER:
1468 break;
1470 case DCERPC_PKT_ALTER_RESP:
1471 break;
1473 case DCERPC_PKT_SHUTDOWN:
1474 break;
1476 case DCERPC_PKT_CO_CANCEL:
1477 break;
1479 case DCERPC_PKT_ORPHANED:
1480 break;
1482 case DCERPC_PKT_AUTH3:
1483 break;
1485 default:
1486 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
1489 return NDR_ERR_SUCCESS;
1492 static enum ndr_err_code ndr_pull_dcerpc_payload(struct ndr_pull *ndr, int ndr_flags, union dcerpc_payload *r)
1494 int level;
1495 level = ndr_pull_get_switch_value(ndr, r);
1496 if (ndr_flags & NDR_SCALARS) {
1497 NDR_CHECK(ndr_pull_union_align(ndr, 4));
1498 switch (level) {
1499 case DCERPC_PKT_REQUEST: {
1500 NDR_CHECK(ndr_pull_dcerpc_request(ndr, NDR_SCALARS, &r->request));
1501 break; }
1503 case DCERPC_PKT_PING: {
1504 NDR_CHECK(ndr_pull_dcerpc_ping(ndr, NDR_SCALARS, &r->ping));
1505 break; }
1507 case DCERPC_PKT_RESPONSE: {
1508 NDR_CHECK(ndr_pull_dcerpc_response(ndr, NDR_SCALARS, &r->response));
1509 break; }
1511 case DCERPC_PKT_FAULT: {
1512 NDR_CHECK(ndr_pull_dcerpc_fault(ndr, NDR_SCALARS, &r->fault));
1513 break; }
1515 case DCERPC_PKT_WORKING: {
1516 NDR_CHECK(ndr_pull_dcerpc_working(ndr, NDR_SCALARS, &r->working));
1517 break; }
1519 case DCERPC_PKT_NOCALL: {
1520 NDR_CHECK(ndr_pull_dcerpc_fack(ndr, NDR_SCALARS, &r->nocall));
1521 break; }
1523 case DCERPC_PKT_REJECT: {
1524 NDR_CHECK(ndr_pull_dcerpc_fault(ndr, NDR_SCALARS, &r->reject));
1525 break; }
1527 case DCERPC_PKT_ACK: {
1528 NDR_CHECK(ndr_pull_dcerpc_ack(ndr, NDR_SCALARS, &r->ack));
1529 break; }
1531 case DCERPC_PKT_CL_CANCEL: {
1532 NDR_CHECK(ndr_pull_dcerpc_cl_cancel(ndr, NDR_SCALARS, &r->cl_cancel));
1533 break; }
1535 case DCERPC_PKT_FACK: {
1536 NDR_CHECK(ndr_pull_dcerpc_fack(ndr, NDR_SCALARS, &r->fack));
1537 break; }
1539 case DCERPC_PKT_CANCEL_ACK: {
1540 NDR_CHECK(ndr_pull_dcerpc_cancel_ack(ndr, NDR_SCALARS, &r->cancel_ack));
1541 break; }
1543 case DCERPC_PKT_BIND: {
1544 NDR_CHECK(ndr_pull_dcerpc_bind(ndr, NDR_SCALARS, &r->bind));
1545 break; }
1547 case DCERPC_PKT_BIND_ACK: {
1548 NDR_CHECK(ndr_pull_dcerpc_bind_ack(ndr, NDR_SCALARS, &r->bind_ack));
1549 break; }
1551 case DCERPC_PKT_BIND_NAK: {
1552 NDR_CHECK(ndr_pull_dcerpc_bind_nak(ndr, NDR_SCALARS, &r->bind_nak));
1553 break; }
1555 case DCERPC_PKT_ALTER: {
1556 NDR_CHECK(ndr_pull_dcerpc_bind(ndr, NDR_SCALARS, &r->alter));
1557 break; }
1559 case DCERPC_PKT_ALTER_RESP: {
1560 NDR_CHECK(ndr_pull_dcerpc_bind_ack(ndr, NDR_SCALARS, &r->alter_resp));
1561 break; }
1563 case DCERPC_PKT_SHUTDOWN: {
1564 NDR_CHECK(ndr_pull_dcerpc_shutdown(ndr, NDR_SCALARS, &r->shutdown));
1565 break; }
1567 case DCERPC_PKT_CO_CANCEL: {
1568 NDR_CHECK(ndr_pull_dcerpc_co_cancel(ndr, NDR_SCALARS, &r->co_cancel));
1569 break; }
1571 case DCERPC_PKT_ORPHANED: {
1572 NDR_CHECK(ndr_pull_dcerpc_orphaned(ndr, NDR_SCALARS, &r->orphaned));
1573 break; }
1575 case DCERPC_PKT_AUTH3: {
1576 NDR_CHECK(ndr_pull_dcerpc_auth3(ndr, NDR_SCALARS, &r->auth3));
1577 break; }
1579 default:
1580 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
1583 if (ndr_flags & NDR_BUFFERS) {
1584 switch (level) {
1585 case DCERPC_PKT_REQUEST:
1586 break;
1588 case DCERPC_PKT_PING:
1589 break;
1591 case DCERPC_PKT_RESPONSE:
1592 break;
1594 case DCERPC_PKT_FAULT:
1595 break;
1597 case DCERPC_PKT_WORKING:
1598 break;
1600 case DCERPC_PKT_NOCALL:
1601 break;
1603 case DCERPC_PKT_REJECT:
1604 break;
1606 case DCERPC_PKT_ACK:
1607 break;
1609 case DCERPC_PKT_CL_CANCEL:
1610 break;
1612 case DCERPC_PKT_FACK:
1613 break;
1615 case DCERPC_PKT_CANCEL_ACK:
1616 break;
1618 case DCERPC_PKT_BIND:
1619 break;
1621 case DCERPC_PKT_BIND_ACK:
1622 break;
1624 case DCERPC_PKT_BIND_NAK:
1625 NDR_CHECK(ndr_pull_dcerpc_bind_nak(ndr, NDR_BUFFERS, &r->bind_nak));
1626 break;
1628 case DCERPC_PKT_ALTER:
1629 break;
1631 case DCERPC_PKT_ALTER_RESP:
1632 break;
1634 case DCERPC_PKT_SHUTDOWN:
1635 break;
1637 case DCERPC_PKT_CO_CANCEL:
1638 break;
1640 case DCERPC_PKT_ORPHANED:
1641 break;
1643 case DCERPC_PKT_AUTH3:
1644 break;
1646 default:
1647 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
1650 return NDR_ERR_SUCCESS;
1653 _PUBLIC_ void ndr_print_dcerpc_payload(struct ndr_print *ndr, const char *name, const union dcerpc_payload *r)
1655 int level;
1656 level = ndr_print_get_switch_value(ndr, r);
1657 ndr_print_union(ndr, name, level, "dcerpc_payload");
1658 switch (level) {
1659 case DCERPC_PKT_REQUEST:
1660 ndr_print_dcerpc_request(ndr, "request", &r->request);
1661 break;
1663 case DCERPC_PKT_PING:
1664 ndr_print_dcerpc_ping(ndr, "ping", &r->ping);
1665 break;
1667 case DCERPC_PKT_RESPONSE:
1668 ndr_print_dcerpc_response(ndr, "response", &r->response);
1669 break;
1671 case DCERPC_PKT_FAULT:
1672 ndr_print_dcerpc_fault(ndr, "fault", &r->fault);
1673 break;
1675 case DCERPC_PKT_WORKING:
1676 ndr_print_dcerpc_working(ndr, "working", &r->working);
1677 break;
1679 case DCERPC_PKT_NOCALL:
1680 ndr_print_dcerpc_fack(ndr, "nocall", &r->nocall);
1681 break;
1683 case DCERPC_PKT_REJECT:
1684 ndr_print_dcerpc_fault(ndr, "reject", &r->reject);
1685 break;
1687 case DCERPC_PKT_ACK:
1688 ndr_print_dcerpc_ack(ndr, "ack", &r->ack);
1689 break;
1691 case DCERPC_PKT_CL_CANCEL:
1692 ndr_print_dcerpc_cl_cancel(ndr, "cl_cancel", &r->cl_cancel);
1693 break;
1695 case DCERPC_PKT_FACK:
1696 ndr_print_dcerpc_fack(ndr, "fack", &r->fack);
1697 break;
1699 case DCERPC_PKT_CANCEL_ACK:
1700 ndr_print_dcerpc_cancel_ack(ndr, "cancel_ack", &r->cancel_ack);
1701 break;
1703 case DCERPC_PKT_BIND:
1704 ndr_print_dcerpc_bind(ndr, "bind", &r->bind);
1705 break;
1707 case DCERPC_PKT_BIND_ACK:
1708 ndr_print_dcerpc_bind_ack(ndr, "bind_ack", &r->bind_ack);
1709 break;
1711 case DCERPC_PKT_BIND_NAK:
1712 ndr_print_dcerpc_bind_nak(ndr, "bind_nak", &r->bind_nak);
1713 break;
1715 case DCERPC_PKT_ALTER:
1716 ndr_print_dcerpc_bind(ndr, "alter", &r->alter);
1717 break;
1719 case DCERPC_PKT_ALTER_RESP:
1720 ndr_print_dcerpc_bind_ack(ndr, "alter_resp", &r->alter_resp);
1721 break;
1723 case DCERPC_PKT_SHUTDOWN:
1724 ndr_print_dcerpc_shutdown(ndr, "shutdown", &r->shutdown);
1725 break;
1727 case DCERPC_PKT_CO_CANCEL:
1728 ndr_print_dcerpc_co_cancel(ndr, "co_cancel", &r->co_cancel);
1729 break;
1731 case DCERPC_PKT_ORPHANED:
1732 ndr_print_dcerpc_orphaned(ndr, "orphaned", &r->orphaned);
1733 break;
1735 case DCERPC_PKT_AUTH3:
1736 ndr_print_dcerpc_auth3(ndr, "auth3", &r->auth3);
1737 break;
1739 default:
1740 ndr_print_bad_level(ndr, name, level);
1744 _PUBLIC_ enum ndr_err_code ndr_push_ncacn_packet(struct ndr_push *ndr, int ndr_flags, const struct ncacn_packet *r)
1746 if (ndr_flags & NDR_SCALARS) {
1747 NDR_CHECK(ndr_push_align(ndr, 4));
1748 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->rpc_vers));
1749 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->rpc_vers_minor));
1750 NDR_CHECK(ndr_push_dcerpc_pkt_type(ndr, NDR_SCALARS, r->ptype));
1751 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->pfc_flags));
1752 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->drep, 4));
1753 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->frag_length));
1754 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->auth_length));
1755 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->call_id));
1756 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->u, r->ptype));
1757 NDR_CHECK(ndr_push_dcerpc_payload(ndr, NDR_SCALARS, &r->u));
1758 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
1760 if (ndr_flags & NDR_BUFFERS) {
1761 NDR_CHECK(ndr_push_dcerpc_payload(ndr, NDR_BUFFERS, &r->u));
1763 return NDR_ERR_SUCCESS;
1766 _PUBLIC_ enum ndr_err_code ndr_pull_ncacn_packet(struct ndr_pull *ndr, int ndr_flags, struct ncacn_packet *r)
1768 uint32_t size_drep_0 = 0;
1769 if (ndr_flags & NDR_SCALARS) {
1770 NDR_CHECK(ndr_pull_align(ndr, 4));
1771 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->rpc_vers));
1772 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->rpc_vers_minor));
1773 NDR_CHECK(ndr_pull_dcerpc_pkt_type(ndr, NDR_SCALARS, &r->ptype));
1774 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->pfc_flags));
1775 size_drep_0 = 4;
1776 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->drep, size_drep_0));
1777 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->frag_length));
1778 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->auth_length));
1779 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->call_id));
1780 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->u, r->ptype));
1781 NDR_CHECK(ndr_pull_dcerpc_payload(ndr, NDR_SCALARS, &r->u));
1782 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
1784 if (ndr_flags & NDR_BUFFERS) {
1785 NDR_CHECK(ndr_pull_dcerpc_payload(ndr, NDR_BUFFERS, &r->u));
1787 return NDR_ERR_SUCCESS;
1790 _PUBLIC_ void ndr_print_ncacn_packet(struct ndr_print *ndr, const char *name, const struct ncacn_packet *r)
1792 ndr_print_struct(ndr, name, "ncacn_packet");
1793 ndr->depth++;
1794 ndr_print_uint8(ndr, "rpc_vers", r->rpc_vers);
1795 ndr_print_uint8(ndr, "rpc_vers_minor", r->rpc_vers_minor);
1796 ndr_print_dcerpc_pkt_type(ndr, "ptype", r->ptype);
1797 ndr_print_uint8(ndr, "pfc_flags", r->pfc_flags);
1798 ndr_print_array_uint8(ndr, "drep", r->drep, 4);
1799 ndr_print_uint16(ndr, "frag_length", r->frag_length);
1800 ndr_print_uint16(ndr, "auth_length", r->auth_length);
1801 ndr_print_uint32(ndr, "call_id", r->call_id);
1802 ndr_print_set_switch_value(ndr, &r->u, r->ptype);
1803 ndr_print_dcerpc_payload(ndr, "u", &r->u);
1804 ndr->depth--;
1807 _PUBLIC_ enum ndr_err_code ndr_push_ncadg_packet(struct ndr_push *ndr, int ndr_flags, const struct ncadg_packet *r)
1809 if (ndr_flags & NDR_SCALARS) {
1810 NDR_CHECK(ndr_push_align(ndr, 4));
1811 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->rpc_vers));
1812 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->ptype));
1813 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->pfc_flags));
1814 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->ncadg_flags));
1815 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->drep, 3));
1816 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->serial_high));
1817 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->object));
1818 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->iface));
1819 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->activity));
1820 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->server_boot));
1821 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->iface_version));
1822 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->seq_num));
1823 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->opnum));
1824 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->ihint));
1825 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->ahint));
1826 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->len));
1827 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->fragnum));
1828 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->auth_proto));
1829 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->serial_low));
1830 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->u, r->ptype));
1831 NDR_CHECK(ndr_push_dcerpc_payload(ndr, NDR_SCALARS, &r->u));
1832 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
1834 if (ndr_flags & NDR_BUFFERS) {
1835 NDR_CHECK(ndr_push_dcerpc_payload(ndr, NDR_BUFFERS, &r->u));
1837 return NDR_ERR_SUCCESS;
1840 _PUBLIC_ enum ndr_err_code ndr_pull_ncadg_packet(struct ndr_pull *ndr, int ndr_flags, struct ncadg_packet *r)
1842 uint32_t size_drep_0 = 0;
1843 if (ndr_flags & NDR_SCALARS) {
1844 NDR_CHECK(ndr_pull_align(ndr, 4));
1845 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->rpc_vers));
1846 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->ptype));
1847 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->pfc_flags));
1848 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->ncadg_flags));
1849 size_drep_0 = 3;
1850 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->drep, size_drep_0));
1851 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->serial_high));
1852 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->object));
1853 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->iface));
1854 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->activity));
1855 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->server_boot));
1856 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->iface_version));
1857 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->seq_num));
1858 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->opnum));
1859 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->ihint));
1860 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->ahint));
1861 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->len));
1862 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->fragnum));
1863 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->auth_proto));
1864 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->serial_low));
1865 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->u, r->ptype));
1866 NDR_CHECK(ndr_pull_dcerpc_payload(ndr, NDR_SCALARS, &r->u));
1867 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
1869 if (ndr_flags & NDR_BUFFERS) {
1870 NDR_CHECK(ndr_pull_dcerpc_payload(ndr, NDR_BUFFERS, &r->u));
1872 return NDR_ERR_SUCCESS;
1875 _PUBLIC_ void ndr_print_ncadg_packet(struct ndr_print *ndr, const char *name, const struct ncadg_packet *r)
1877 ndr_print_struct(ndr, name, "ncadg_packet");
1878 ndr->depth++;
1879 ndr_print_uint8(ndr, "rpc_vers", r->rpc_vers);
1880 ndr_print_uint8(ndr, "ptype", r->ptype);
1881 ndr_print_uint8(ndr, "pfc_flags", r->pfc_flags);
1882 ndr_print_uint8(ndr, "ncadg_flags", r->ncadg_flags);
1883 ndr_print_array_uint8(ndr, "drep", r->drep, 3);
1884 ndr_print_uint8(ndr, "serial_high", r->serial_high);
1885 ndr_print_GUID(ndr, "object", &r->object);
1886 ndr_print_GUID(ndr, "iface", &r->iface);
1887 ndr_print_GUID(ndr, "activity", &r->activity);
1888 ndr_print_uint32(ndr, "server_boot", r->server_boot);
1889 ndr_print_uint32(ndr, "iface_version", r->iface_version);
1890 ndr_print_uint32(ndr, "seq_num", r->seq_num);
1891 ndr_print_uint16(ndr, "opnum", r->opnum);
1892 ndr_print_uint16(ndr, "ihint", r->ihint);
1893 ndr_print_uint16(ndr, "ahint", r->ahint);
1894 ndr_print_uint16(ndr, "len", r->len);
1895 ndr_print_uint16(ndr, "fragnum", r->fragnum);
1896 ndr_print_uint8(ndr, "auth_proto", r->auth_proto);
1897 ndr_print_uint8(ndr, "serial_low", r->serial_low);
1898 ndr_print_set_switch_value(ndr, &r->u, r->ptype);
1899 ndr_print_dcerpc_payload(ndr, "u", &r->u);
1900 ndr->depth--;