s4:librpc/rpc/pyrpc.h: librpc/rpc/dcerpc.h isn't needed anymore
[Samba/ekacnet.git] / librpc / gen_ndr / ndr_dcerpc.c
blob2a32e9a78dcf69e6787063a9f7f9071285fd8fcb
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 cntr_transfer_syntaxes_0;
28 TALLOC_CTX *_mem_save_transfer_syntaxes_0;
29 if (ndr_flags & NDR_SCALARS) {
30 NDR_CHECK(ndr_pull_align(ndr, 4));
31 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->context_id));
32 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->num_transfer_syntaxes));
33 NDR_CHECK(ndr_pull_ndr_syntax_id(ndr, NDR_SCALARS, &r->abstract_syntax));
34 NDR_PULL_ALLOC_N(ndr, r->transfer_syntaxes, r->num_transfer_syntaxes);
35 _mem_save_transfer_syntaxes_0 = NDR_PULL_GET_MEM_CTX(ndr);
36 NDR_PULL_SET_MEM_CTX(ndr, r->transfer_syntaxes, 0);
37 for (cntr_transfer_syntaxes_0 = 0; cntr_transfer_syntaxes_0 < r->num_transfer_syntaxes; cntr_transfer_syntaxes_0++) {
38 NDR_CHECK(ndr_pull_ndr_syntax_id(ndr, NDR_SCALARS, &r->transfer_syntaxes[cntr_transfer_syntaxes_0]));
40 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_transfer_syntaxes_0, 0);
41 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
43 if (ndr_flags & NDR_BUFFERS) {
45 return NDR_ERR_SUCCESS;
48 _PUBLIC_ void ndr_print_dcerpc_ctx_list(struct ndr_print *ndr, const char *name, const struct dcerpc_ctx_list *r)
50 uint32_t cntr_transfer_syntaxes_0;
51 ndr_print_struct(ndr, name, "dcerpc_ctx_list");
52 ndr->depth++;
53 ndr_print_uint16(ndr, "context_id", r->context_id);
54 ndr_print_uint8(ndr, "num_transfer_syntaxes", r->num_transfer_syntaxes);
55 ndr_print_ndr_syntax_id(ndr, "abstract_syntax", &r->abstract_syntax);
56 ndr->print(ndr, "%s: ARRAY(%d)", "transfer_syntaxes", (int)r->num_transfer_syntaxes);
57 ndr->depth++;
58 for (cntr_transfer_syntaxes_0=0;cntr_transfer_syntaxes_0<r->num_transfer_syntaxes;cntr_transfer_syntaxes_0++) {
59 char *idx_0=NULL;
60 if (asprintf(&idx_0, "[%d]", cntr_transfer_syntaxes_0) != -1) {
61 ndr_print_ndr_syntax_id(ndr, "transfer_syntaxes", &r->transfer_syntaxes[cntr_transfer_syntaxes_0]);
62 free(idx_0);
65 ndr->depth--;
66 ndr->depth--;
69 static enum ndr_err_code ndr_push_dcerpc_bind(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_bind *r)
71 uint32_t cntr_ctx_list_0;
72 if (ndr_flags & NDR_SCALARS) {
73 NDR_CHECK(ndr_push_align(ndr, 4));
74 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->max_xmit_frag));
75 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->max_recv_frag));
76 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->assoc_group_id));
77 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->num_contexts));
78 for (cntr_ctx_list_0 = 0; cntr_ctx_list_0 < r->num_contexts; cntr_ctx_list_0++) {
79 NDR_CHECK(ndr_push_dcerpc_ctx_list(ndr, NDR_SCALARS, &r->ctx_list[cntr_ctx_list_0]));
82 uint32_t _flags_save_DATA_BLOB = ndr->flags;
83 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
84 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->auth_info));
85 ndr->flags = _flags_save_DATA_BLOB;
87 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
89 if (ndr_flags & NDR_BUFFERS) {
91 return NDR_ERR_SUCCESS;
94 static enum ndr_err_code ndr_pull_dcerpc_bind(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_bind *r)
96 uint32_t cntr_ctx_list_0;
97 TALLOC_CTX *_mem_save_ctx_list_0;
98 if (ndr_flags & NDR_SCALARS) {
99 NDR_CHECK(ndr_pull_align(ndr, 4));
100 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->max_xmit_frag));
101 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->max_recv_frag));
102 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->assoc_group_id));
103 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->num_contexts));
104 NDR_PULL_ALLOC_N(ndr, r->ctx_list, r->num_contexts);
105 _mem_save_ctx_list_0 = NDR_PULL_GET_MEM_CTX(ndr);
106 NDR_PULL_SET_MEM_CTX(ndr, r->ctx_list, 0);
107 for (cntr_ctx_list_0 = 0; cntr_ctx_list_0 < r->num_contexts; cntr_ctx_list_0++) {
108 NDR_CHECK(ndr_pull_dcerpc_ctx_list(ndr, NDR_SCALARS, &r->ctx_list[cntr_ctx_list_0]));
110 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctx_list_0, 0);
112 uint32_t _flags_save_DATA_BLOB = ndr->flags;
113 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
114 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->auth_info));
115 ndr->flags = _flags_save_DATA_BLOB;
117 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
119 if (ndr_flags & NDR_BUFFERS) {
121 return NDR_ERR_SUCCESS;
124 _PUBLIC_ void ndr_print_dcerpc_bind(struct ndr_print *ndr, const char *name, const struct dcerpc_bind *r)
126 uint32_t cntr_ctx_list_0;
127 ndr_print_struct(ndr, name, "dcerpc_bind");
128 ndr->depth++;
129 ndr_print_uint16(ndr, "max_xmit_frag", r->max_xmit_frag);
130 ndr_print_uint16(ndr, "max_recv_frag", r->max_recv_frag);
131 ndr_print_uint32(ndr, "assoc_group_id", r->assoc_group_id);
132 ndr_print_uint8(ndr, "num_contexts", r->num_contexts);
133 ndr->print(ndr, "%s: ARRAY(%d)", "ctx_list", (int)r->num_contexts);
134 ndr->depth++;
135 for (cntr_ctx_list_0=0;cntr_ctx_list_0<r->num_contexts;cntr_ctx_list_0++) {
136 char *idx_0=NULL;
137 if (asprintf(&idx_0, "[%d]", cntr_ctx_list_0) != -1) {
138 ndr_print_dcerpc_ctx_list(ndr, "ctx_list", &r->ctx_list[cntr_ctx_list_0]);
139 free(idx_0);
142 ndr->depth--;
143 ndr_print_DATA_BLOB(ndr, "auth_info", r->auth_info);
144 ndr->depth--;
147 static enum ndr_err_code ndr_push_dcerpc_empty(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_empty *r)
149 if (ndr_flags & NDR_SCALARS) {
150 NDR_CHECK(ndr_push_align(ndr, 1));
151 NDR_CHECK(ndr_push_trailer_align(ndr, 1));
153 if (ndr_flags & NDR_BUFFERS) {
155 return NDR_ERR_SUCCESS;
158 static enum ndr_err_code ndr_pull_dcerpc_empty(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_empty *r)
160 if (ndr_flags & NDR_SCALARS) {
161 NDR_CHECK(ndr_pull_align(ndr, 1));
162 NDR_CHECK(ndr_pull_trailer_align(ndr, 1));
164 if (ndr_flags & NDR_BUFFERS) {
166 return NDR_ERR_SUCCESS;
169 _PUBLIC_ void ndr_print_dcerpc_empty(struct ndr_print *ndr, const char *name, const struct dcerpc_empty *r)
171 ndr_print_struct(ndr, name, "dcerpc_empty");
172 ndr->depth++;
173 ndr->depth--;
176 static enum ndr_err_code ndr_push_dcerpc_object(struct ndr_push *ndr, int ndr_flags, const union dcerpc_object *r)
178 if (ndr_flags & NDR_SCALARS) {
179 int level = ndr_push_get_switch_value(ndr, r);
180 NDR_CHECK(ndr_push_union_align(ndr, 4));
181 switch (level) {
182 default: {
183 NDR_CHECK(ndr_push_dcerpc_empty(ndr, NDR_SCALARS, &r->empty));
184 break; }
186 case LIBNDR_FLAG_OBJECT_PRESENT: {
187 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->object));
188 break; }
192 if (ndr_flags & NDR_BUFFERS) {
193 int level = ndr_push_get_switch_value(ndr, r);
194 switch (level) {
195 default:
196 break;
198 case LIBNDR_FLAG_OBJECT_PRESENT:
199 break;
203 return NDR_ERR_SUCCESS;
206 static enum ndr_err_code ndr_pull_dcerpc_object(struct ndr_pull *ndr, int ndr_flags, union dcerpc_object *r)
208 int level;
209 level = ndr_pull_get_switch_value(ndr, r);
210 if (ndr_flags & NDR_SCALARS) {
211 NDR_CHECK(ndr_pull_union_align(ndr, 4));
212 switch (level) {
213 default: {
214 NDR_CHECK(ndr_pull_dcerpc_empty(ndr, NDR_SCALARS, &r->empty));
215 break; }
217 case LIBNDR_FLAG_OBJECT_PRESENT: {
218 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->object));
219 break; }
223 if (ndr_flags & NDR_BUFFERS) {
224 switch (level) {
225 default:
226 break;
228 case LIBNDR_FLAG_OBJECT_PRESENT:
229 break;
233 return NDR_ERR_SUCCESS;
236 _PUBLIC_ void ndr_print_dcerpc_object(struct ndr_print *ndr, const char *name, const union dcerpc_object *r)
238 int level;
239 level = ndr_print_get_switch_value(ndr, r);
240 ndr_print_union(ndr, name, level, "dcerpc_object");
241 switch (level) {
242 default:
243 ndr_print_dcerpc_empty(ndr, "empty", &r->empty);
244 break;
246 case LIBNDR_FLAG_OBJECT_PRESENT:
247 ndr_print_GUID(ndr, "object", &r->object);
248 break;
253 static enum ndr_err_code ndr_push_dcerpc_request(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_request *r)
255 if (ndr_flags & NDR_SCALARS) {
256 NDR_CHECK(ndr_push_align(ndr, 4));
257 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->alloc_hint));
258 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->context_id));
259 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->opnum));
260 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->object, ndr->flags & LIBNDR_FLAG_OBJECT_PRESENT));
261 NDR_CHECK(ndr_push_dcerpc_object(ndr, NDR_SCALARS, &r->object));
263 uint32_t _flags_save_DATA_BLOB = ndr->flags;
264 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN8);
265 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->_pad));
266 ndr->flags = _flags_save_DATA_BLOB;
269 uint32_t _flags_save_DATA_BLOB = ndr->flags;
270 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
271 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->stub_and_verifier));
272 ndr->flags = _flags_save_DATA_BLOB;
274 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
276 if (ndr_flags & NDR_BUFFERS) {
278 return NDR_ERR_SUCCESS;
281 static enum ndr_err_code ndr_pull_dcerpc_request(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_request *r)
283 if (ndr_flags & NDR_SCALARS) {
284 NDR_CHECK(ndr_pull_align(ndr, 4));
285 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->alloc_hint));
286 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->context_id));
287 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->opnum));
288 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->object, ndr->flags & LIBNDR_FLAG_OBJECT_PRESENT));
289 NDR_CHECK(ndr_pull_dcerpc_object(ndr, NDR_SCALARS, &r->object));
291 uint32_t _flags_save_DATA_BLOB = ndr->flags;
292 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN8);
293 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->_pad));
294 ndr->flags = _flags_save_DATA_BLOB;
297 uint32_t _flags_save_DATA_BLOB = ndr->flags;
298 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
299 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->stub_and_verifier));
300 ndr->flags = _flags_save_DATA_BLOB;
302 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
304 if (ndr_flags & NDR_BUFFERS) {
306 return NDR_ERR_SUCCESS;
309 _PUBLIC_ void ndr_print_dcerpc_request(struct ndr_print *ndr, const char *name, const struct dcerpc_request *r)
311 ndr_print_struct(ndr, name, "dcerpc_request");
312 ndr->depth++;
313 ndr_print_uint32(ndr, "alloc_hint", r->alloc_hint);
314 ndr_print_uint16(ndr, "context_id", r->context_id);
315 ndr_print_uint16(ndr, "opnum", r->opnum);
316 ndr_print_set_switch_value(ndr, &r->object, ndr->flags & LIBNDR_FLAG_OBJECT_PRESENT);
317 ndr_print_dcerpc_object(ndr, "object", &r->object);
318 ndr_print_DATA_BLOB(ndr, "_pad", r->_pad);
319 ndr_print_DATA_BLOB(ndr, "stub_and_verifier", r->stub_and_verifier);
320 ndr->depth--;
323 static enum ndr_err_code ndr_push_dcerpc_ack_ctx(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_ack_ctx *r)
325 if (ndr_flags & NDR_SCALARS) {
326 NDR_CHECK(ndr_push_align(ndr, 4));
327 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->result));
328 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->reason));
329 NDR_CHECK(ndr_push_ndr_syntax_id(ndr, NDR_SCALARS, &r->syntax));
330 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
332 if (ndr_flags & NDR_BUFFERS) {
334 return NDR_ERR_SUCCESS;
337 static enum ndr_err_code ndr_pull_dcerpc_ack_ctx(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_ack_ctx *r)
339 if (ndr_flags & NDR_SCALARS) {
340 NDR_CHECK(ndr_pull_align(ndr, 4));
341 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->result));
342 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->reason));
343 NDR_CHECK(ndr_pull_ndr_syntax_id(ndr, NDR_SCALARS, &r->syntax));
344 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
346 if (ndr_flags & NDR_BUFFERS) {
348 return NDR_ERR_SUCCESS;
351 _PUBLIC_ void ndr_print_dcerpc_ack_ctx(struct ndr_print *ndr, const char *name, const struct dcerpc_ack_ctx *r)
353 ndr_print_struct(ndr, name, "dcerpc_ack_ctx");
354 ndr->depth++;
355 ndr_print_uint16(ndr, "result", r->result);
356 ndr_print_uint16(ndr, "reason", r->reason);
357 ndr_print_ndr_syntax_id(ndr, "syntax", &r->syntax);
358 ndr->depth--;
361 static enum ndr_err_code ndr_push_dcerpc_bind_ack(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_bind_ack *r)
363 uint32_t cntr_ctx_list_0;
364 if (ndr_flags & NDR_SCALARS) {
365 NDR_CHECK(ndr_push_align(ndr, 4));
366 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->max_xmit_frag));
367 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->max_recv_frag));
368 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->assoc_group_id));
369 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, strlen(r->secondary_address) + 1));
370 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->secondary_address, strlen(r->secondary_address) + 1, sizeof(uint8_t), CH_DOS));
372 uint32_t _flags_save_DATA_BLOB = ndr->flags;
373 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4);
374 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->_pad1));
375 ndr->flags = _flags_save_DATA_BLOB;
377 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->num_results));
378 for (cntr_ctx_list_0 = 0; cntr_ctx_list_0 < r->num_results; cntr_ctx_list_0++) {
379 NDR_CHECK(ndr_push_dcerpc_ack_ctx(ndr, NDR_SCALARS, &r->ctx_list[cntr_ctx_list_0]));
382 uint32_t _flags_save_DATA_BLOB = ndr->flags;
383 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
384 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->auth_info));
385 ndr->flags = _flags_save_DATA_BLOB;
387 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
389 if (ndr_flags & NDR_BUFFERS) {
391 return NDR_ERR_SUCCESS;
394 static enum ndr_err_code ndr_pull_dcerpc_bind_ack(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_bind_ack *r)
396 uint32_t cntr_ctx_list_0;
397 TALLOC_CTX *_mem_save_ctx_list_0;
398 if (ndr_flags & NDR_SCALARS) {
399 NDR_CHECK(ndr_pull_align(ndr, 4));
400 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->max_xmit_frag));
401 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->max_recv_frag));
402 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->assoc_group_id));
403 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->secondary_address_size));
404 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->secondary_address, r->secondary_address_size, sizeof(uint8_t), CH_DOS));
406 uint32_t _flags_save_DATA_BLOB = ndr->flags;
407 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4);
408 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->_pad1));
409 ndr->flags = _flags_save_DATA_BLOB;
411 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->num_results));
412 NDR_PULL_ALLOC_N(ndr, r->ctx_list, r->num_results);
413 _mem_save_ctx_list_0 = NDR_PULL_GET_MEM_CTX(ndr);
414 NDR_PULL_SET_MEM_CTX(ndr, r->ctx_list, 0);
415 for (cntr_ctx_list_0 = 0; cntr_ctx_list_0 < r->num_results; cntr_ctx_list_0++) {
416 NDR_CHECK(ndr_pull_dcerpc_ack_ctx(ndr, NDR_SCALARS, &r->ctx_list[cntr_ctx_list_0]));
418 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctx_list_0, 0);
420 uint32_t _flags_save_DATA_BLOB = ndr->flags;
421 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
422 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->auth_info));
423 ndr->flags = _flags_save_DATA_BLOB;
425 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
427 if (ndr_flags & NDR_BUFFERS) {
429 return NDR_ERR_SUCCESS;
432 _PUBLIC_ void ndr_print_dcerpc_bind_ack(struct ndr_print *ndr, const char *name, const struct dcerpc_bind_ack *r)
434 uint32_t cntr_ctx_list_0;
435 ndr_print_struct(ndr, name, "dcerpc_bind_ack");
436 ndr->depth++;
437 ndr_print_uint16(ndr, "max_xmit_frag", r->max_xmit_frag);
438 ndr_print_uint16(ndr, "max_recv_frag", r->max_recv_frag);
439 ndr_print_uint32(ndr, "assoc_group_id", r->assoc_group_id);
440 ndr_print_uint16(ndr, "secondary_address_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen(r->secondary_address) + 1:r->secondary_address_size);
441 ndr_print_string(ndr, "secondary_address", r->secondary_address);
442 ndr_print_DATA_BLOB(ndr, "_pad1", r->_pad1);
443 ndr_print_uint8(ndr, "num_results", r->num_results);
444 ndr->print(ndr, "%s: ARRAY(%d)", "ctx_list", (int)r->num_results);
445 ndr->depth++;
446 for (cntr_ctx_list_0=0;cntr_ctx_list_0<r->num_results;cntr_ctx_list_0++) {
447 char *idx_0=NULL;
448 if (asprintf(&idx_0, "[%d]", cntr_ctx_list_0) != -1) {
449 ndr_print_dcerpc_ack_ctx(ndr, "ctx_list", &r->ctx_list[cntr_ctx_list_0]);
450 free(idx_0);
453 ndr->depth--;
454 ndr_print_DATA_BLOB(ndr, "auth_info", r->auth_info);
455 ndr->depth--;
458 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)
460 uint32_t cntr_versions_0;
461 if (ndr_flags & NDR_SCALARS) {
462 NDR_CHECK(ndr_push_align(ndr, 4));
463 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_versions));
464 for (cntr_versions_0 = 0; cntr_versions_0 < r->num_versions; cntr_versions_0++) {
465 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->versions[cntr_versions_0]));
467 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
469 if (ndr_flags & NDR_BUFFERS) {
471 return NDR_ERR_SUCCESS;
474 static enum ndr_err_code ndr_pull_dcerpc_bind_nak_versions(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_bind_nak_versions *r)
476 uint32_t cntr_versions_0;
477 TALLOC_CTX *_mem_save_versions_0;
478 if (ndr_flags & NDR_SCALARS) {
479 NDR_CHECK(ndr_pull_align(ndr, 4));
480 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_versions));
481 NDR_PULL_ALLOC_N(ndr, r->versions, r->num_versions);
482 _mem_save_versions_0 = NDR_PULL_GET_MEM_CTX(ndr);
483 NDR_PULL_SET_MEM_CTX(ndr, r->versions, 0);
484 for (cntr_versions_0 = 0; cntr_versions_0 < r->num_versions; cntr_versions_0++) {
485 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->versions[cntr_versions_0]));
487 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_versions_0, 0);
488 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
490 if (ndr_flags & NDR_BUFFERS) {
492 return NDR_ERR_SUCCESS;
495 _PUBLIC_ void ndr_print_dcerpc_bind_nak_versions(struct ndr_print *ndr, const char *name, const struct dcerpc_bind_nak_versions *r)
497 uint32_t cntr_versions_0;
498 ndr_print_struct(ndr, name, "dcerpc_bind_nak_versions");
499 ndr->depth++;
500 ndr_print_uint32(ndr, "num_versions", r->num_versions);
501 ndr->print(ndr, "%s: ARRAY(%d)", "versions", (int)r->num_versions);
502 ndr->depth++;
503 for (cntr_versions_0=0;cntr_versions_0<r->num_versions;cntr_versions_0++) {
504 char *idx_0=NULL;
505 if (asprintf(&idx_0, "[%d]", cntr_versions_0) != -1) {
506 ndr_print_uint32(ndr, "versions", r->versions[cntr_versions_0]);
507 free(idx_0);
510 ndr->depth--;
511 ndr->depth--;
514 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)
516 if (ndr_flags & NDR_SCALARS) {
517 int level = ndr_push_get_switch_value(ndr, r);
518 NDR_CHECK(ndr_push_union_align(ndr, 4));
519 switch (level) {
520 case DECRPC_BIND_PROTOCOL_VERSION_NOT_SUPPORTED: {
521 NDR_CHECK(ndr_push_dcerpc_bind_nak_versions(ndr, NDR_SCALARS, &r->v));
522 break; }
524 default: {
525 break; }
529 if (ndr_flags & NDR_BUFFERS) {
530 int level = ndr_push_get_switch_value(ndr, r);
531 switch (level) {
532 case DECRPC_BIND_PROTOCOL_VERSION_NOT_SUPPORTED:
533 break;
535 default:
536 break;
540 return NDR_ERR_SUCCESS;
543 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)
545 int level;
546 level = ndr_pull_get_switch_value(ndr, r);
547 if (ndr_flags & NDR_SCALARS) {
548 NDR_CHECK(ndr_pull_union_align(ndr, 4));
549 switch (level) {
550 case DECRPC_BIND_PROTOCOL_VERSION_NOT_SUPPORTED: {
551 NDR_CHECK(ndr_pull_dcerpc_bind_nak_versions(ndr, NDR_SCALARS, &r->v));
552 break; }
554 default: {
555 break; }
559 if (ndr_flags & NDR_BUFFERS) {
560 switch (level) {
561 case DECRPC_BIND_PROTOCOL_VERSION_NOT_SUPPORTED:
562 break;
564 default:
565 break;
569 return NDR_ERR_SUCCESS;
572 _PUBLIC_ void ndr_print_dcerpc_bind_nak_versions_ctr(struct ndr_print *ndr, const char *name, const union dcerpc_bind_nak_versions_ctr *r)
574 int level;
575 level = ndr_print_get_switch_value(ndr, r);
576 ndr_print_union(ndr, name, level, "dcerpc_bind_nak_versions_ctr");
577 switch (level) {
578 case DECRPC_BIND_PROTOCOL_VERSION_NOT_SUPPORTED:
579 ndr_print_dcerpc_bind_nak_versions(ndr, "v", &r->v);
580 break;
582 default:
583 break;
588 static enum ndr_err_code ndr_push_dcerpc_bind_nak(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_bind_nak *r)
590 if (ndr_flags & NDR_SCALARS) {
591 NDR_CHECK(ndr_push_align(ndr, 4));
592 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->reject_reason));
593 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->versions, r->reject_reason));
594 NDR_CHECK(ndr_push_dcerpc_bind_nak_versions_ctr(ndr, NDR_SCALARS, &r->versions));
595 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
597 if (ndr_flags & NDR_BUFFERS) {
598 NDR_CHECK(ndr_push_dcerpc_bind_nak_versions_ctr(ndr, NDR_BUFFERS, &r->versions));
600 return NDR_ERR_SUCCESS;
603 static enum ndr_err_code ndr_pull_dcerpc_bind_nak(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_bind_nak *r)
605 if (ndr_flags & NDR_SCALARS) {
606 NDR_CHECK(ndr_pull_align(ndr, 4));
607 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->reject_reason));
608 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->versions, r->reject_reason));
609 NDR_CHECK(ndr_pull_dcerpc_bind_nak_versions_ctr(ndr, NDR_SCALARS, &r->versions));
610 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
612 if (ndr_flags & NDR_BUFFERS) {
613 NDR_CHECK(ndr_pull_dcerpc_bind_nak_versions_ctr(ndr, NDR_BUFFERS, &r->versions));
615 return NDR_ERR_SUCCESS;
618 _PUBLIC_ void ndr_print_dcerpc_bind_nak(struct ndr_print *ndr, const char *name, const struct dcerpc_bind_nak *r)
620 ndr_print_struct(ndr, name, "dcerpc_bind_nak");
621 ndr->depth++;
622 ndr_print_uint16(ndr, "reject_reason", r->reject_reason);
623 ndr_print_set_switch_value(ndr, &r->versions, r->reject_reason);
624 ndr_print_dcerpc_bind_nak_versions_ctr(ndr, "versions", &r->versions);
625 ndr->depth--;
628 static enum ndr_err_code ndr_push_dcerpc_response(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_response *r)
630 if (ndr_flags & NDR_SCALARS) {
631 NDR_CHECK(ndr_push_align(ndr, 4));
632 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->alloc_hint));
633 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->context_id));
634 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->cancel_count));
636 uint32_t _flags_save_DATA_BLOB = ndr->flags;
637 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN8);
638 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->_pad));
639 ndr->flags = _flags_save_DATA_BLOB;
642 uint32_t _flags_save_DATA_BLOB = ndr->flags;
643 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
644 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->stub_and_verifier));
645 ndr->flags = _flags_save_DATA_BLOB;
647 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
649 if (ndr_flags & NDR_BUFFERS) {
651 return NDR_ERR_SUCCESS;
654 static enum ndr_err_code ndr_pull_dcerpc_response(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_response *r)
656 if (ndr_flags & NDR_SCALARS) {
657 NDR_CHECK(ndr_pull_align(ndr, 4));
658 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->alloc_hint));
659 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->context_id));
660 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->cancel_count));
662 uint32_t _flags_save_DATA_BLOB = ndr->flags;
663 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN8);
664 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->_pad));
665 ndr->flags = _flags_save_DATA_BLOB;
668 uint32_t _flags_save_DATA_BLOB = ndr->flags;
669 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
670 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->stub_and_verifier));
671 ndr->flags = _flags_save_DATA_BLOB;
673 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
675 if (ndr_flags & NDR_BUFFERS) {
677 return NDR_ERR_SUCCESS;
680 _PUBLIC_ void ndr_print_dcerpc_response(struct ndr_print *ndr, const char *name, const struct dcerpc_response *r)
682 ndr_print_struct(ndr, name, "dcerpc_response");
683 ndr->depth++;
684 ndr_print_uint32(ndr, "alloc_hint", r->alloc_hint);
685 ndr_print_uint16(ndr, "context_id", r->context_id);
686 ndr_print_uint8(ndr, "cancel_count", r->cancel_count);
687 ndr_print_DATA_BLOB(ndr, "_pad", r->_pad);
688 ndr_print_DATA_BLOB(ndr, "stub_and_verifier", r->stub_and_verifier);
689 ndr->depth--;
692 static enum ndr_err_code ndr_push_dcerpc_nca_status(struct ndr_push *ndr, int ndr_flags, enum dcerpc_nca_status r)
694 NDR_CHECK(ndr_push_enum_uint32(ndr, NDR_SCALARS, r));
695 return NDR_ERR_SUCCESS;
698 static enum ndr_err_code ndr_pull_dcerpc_nca_status(struct ndr_pull *ndr, int ndr_flags, enum dcerpc_nca_status *r)
700 uint32_t v;
701 NDR_CHECK(ndr_pull_enum_uint32(ndr, NDR_SCALARS, &v));
702 *r = v;
703 return NDR_ERR_SUCCESS;
706 _PUBLIC_ void ndr_print_dcerpc_nca_status(struct ndr_print *ndr, const char *name, enum dcerpc_nca_status r)
708 const char *val = NULL;
710 switch (r) {
711 case DERPC_NCA_S_COMM_FAILURE: val = "DERPC_NCA_S_COMM_FAILURE"; break;
712 case DERPC_NCA_S_OP_RNG_ERROR: val = "DERPC_NCA_S_OP_RNG_ERROR"; break;
713 case DERPC_NCA_S_UNKNOWN_IF: val = "DERPC_NCA_S_UNKNOWN_IF"; break;
714 case DERPC_NCA_S_WRONG_BOOT_TIME: val = "DERPC_NCA_S_WRONG_BOOT_TIME"; break;
715 case DERPC_NCA_S_YOU_CRASHED: val = "DERPC_NCA_S_YOU_CRASHED"; break;
716 case DERPC_NCA_S_PROTO_ERROR: val = "DERPC_NCA_S_PROTO_ERROR"; break;
717 case DERPC_NCA_S_OUT_ARGS_TOO_BIG: val = "DERPC_NCA_S_OUT_ARGS_TOO_BIG"; break;
718 case DERPC_NCA_S_SERVER_TOO_BUSY: val = "DERPC_NCA_S_SERVER_TOO_BUSY"; break;
719 case DERPC_NCA_S_FAULT_STRING_TOO_LARGE: val = "DERPC_NCA_S_FAULT_STRING_TOO_LARGE"; break;
720 case DERPC_NCA_S_UNSUPPORTED_TYPE: val = "DERPC_NCA_S_UNSUPPORTED_TYPE"; break;
721 case DERPC_NCA_S_FAULT_INT_DIV_BY_ZERO: val = "DERPC_NCA_S_FAULT_INT_DIV_BY_ZERO"; break;
722 case DERPC_NCA_S_FAULT_ADDR_ERROR: val = "DERPC_NCA_S_FAULT_ADDR_ERROR"; break;
723 case DERPC_NCA_S_FAULT_FP_DIV_BY_ZERO: val = "DERPC_NCA_S_FAULT_FP_DIV_BY_ZERO"; break;
724 case DERPC_NCA_S_FAULT_FP_UNDERFLOW: val = "DERPC_NCA_S_FAULT_FP_UNDERFLOW"; break;
725 case DERPC_NCA_S_FAULT_FP_OVERRFLOW: val = "DERPC_NCA_S_FAULT_FP_OVERRFLOW"; break;
726 case DERPC_NCA_S_FAULT_INVALID_TAG: val = "DERPC_NCA_S_FAULT_INVALID_TAG"; break;
727 case DERPC_NCA_S_FAULT_INVALID_BOUND: val = "DERPC_NCA_S_FAULT_INVALID_BOUND"; break;
728 case DERPC_NCA_S_FAULT_RPC_VERSION_MISMATCH: val = "DERPC_NCA_S_FAULT_RPC_VERSION_MISMATCH"; break;
729 case DERPC_NCA_S_FAULT_UNSPEC_REJECT: val = "DERPC_NCA_S_FAULT_UNSPEC_REJECT"; break;
730 case DERPC_NCA_S_FAULT_BAD_ACTID: val = "DERPC_NCA_S_FAULT_BAD_ACTID"; break;
731 case DERPC_NCA_S_FAULT_WHO_ARE_YOU_FAILED: val = "DERPC_NCA_S_FAULT_WHO_ARE_YOU_FAILED"; break;
732 case DERPC_NCA_S_FAULT_MANAGER_NOT_ENTERED: val = "DERPC_NCA_S_FAULT_MANAGER_NOT_ENTERED"; break;
733 case DERPC_NCA_S_FAULT_CANCEL: val = "DERPC_NCA_S_FAULT_CANCEL"; break;
734 case DERPC_NCA_S_FAULT_ILL_INST: val = "DERPC_NCA_S_FAULT_ILL_INST"; break;
735 case DERPC_NCA_S_FAULT_FP_ERROR: val = "DERPC_NCA_S_FAULT_FP_ERROR"; break;
736 case DERPC_NCA_S_FAULT_INT_OVERFLOW: val = "DERPC_NCA_S_FAULT_INT_OVERFLOW"; break;
737 case DERPC_NCA_S_UNUSED_1C000011: val = "DERPC_NCA_S_UNUSED_1C000011"; break;
738 case DERPC_NCA_S_FAULT_UNSPEC: val = "DERPC_NCA_S_FAULT_UNSPEC"; break;
739 case DERPC_NCA_S_FAULT_REMOTE_COMM_FAILURE: val = "DERPC_NCA_S_FAULT_REMOTE_COMM_FAILURE"; break;
740 case DERPC_NCA_S_FAULT_PIPE_EMPTY: val = "DERPC_NCA_S_FAULT_PIPE_EMPTY"; break;
741 case DERPC_NCA_S_FAULT_PIPE_CLOSED: val = "DERPC_NCA_S_FAULT_PIPE_CLOSED"; break;
742 case DERPC_NCA_S_FAULT_PIPE_ORDER: val = "DERPC_NCA_S_FAULT_PIPE_ORDER"; break;
743 case DERPC_NCA_S_FAULT_PIPE_DISCIPLINE: val = "DERPC_NCA_S_FAULT_PIPE_DISCIPLINE"; break;
744 case DERPC_NCA_S_FAULT_PIPE_COMM_ERROR: val = "DERPC_NCA_S_FAULT_PIPE_COMM_ERROR"; break;
745 case DERPC_NCA_S_FAULT_PIPE_MEMORY: val = "DERPC_NCA_S_FAULT_PIPE_MEMORY"; break;
746 case DERPC_NCA_S_FAULT_CONTEXT_MISMATCH: val = "DERPC_NCA_S_FAULT_CONTEXT_MISMATCH"; break;
747 case DERPC_NCA_S_FAULT_REMOTE_NO_MEMORY: val = "DERPC_NCA_S_FAULT_REMOTE_NO_MEMORY"; break;
748 case DERPC_NCA_S_INVALID_PRES_CONTEXT_ID: val = "DERPC_NCA_S_INVALID_PRES_CONTEXT_ID"; break;
749 case DERPC_NCA_S_UNSUPPORTED_AUTHN_LEVEL: val = "DERPC_NCA_S_UNSUPPORTED_AUTHN_LEVEL"; break;
750 case DERPC_NCA_S_UNUSED_1C00001E: val = "DERPC_NCA_S_UNUSED_1C00001E"; break;
751 case DERPC_NCA_S_INVALID_CHECKSUM: val = "DERPC_NCA_S_INVALID_CHECKSUM"; break;
752 case DERPC_NCA_S_INVALID_CRC: val = "DERPC_NCA_S_INVALID_CRC"; break;
753 case DERPC_NCA_S_FAULT_USER_DEFINED: val = "DERPC_NCA_S_FAULT_USER_DEFINED"; break;
754 case DERPC_NCA_S_FAULT_TX_OPEN_FAILED: val = "DERPC_NCA_S_FAULT_TX_OPEN_FAILED"; break;
755 case DERPC_NCA_S_FAULT_CODESET_CONV_ERROR: val = "DERPC_NCA_S_FAULT_CODESET_CONV_ERROR"; break;
756 case DERPC_NCA_S_FAULT_OBJECT_NOT_FOUND: val = "DERPC_NCA_S_FAULT_OBJECT_NOT_FOUND"; break;
757 case DERPC_NCA_S_FAULT_NO_CLIENT_STUB: val = "DERPC_NCA_S_FAULT_NO_CLIENT_STUB"; break;
759 ndr_print_enum(ndr, name, "ENUM", val, r);
762 static enum ndr_err_code ndr_push_dcerpc_fault(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_fault *r)
764 if (ndr_flags & NDR_SCALARS) {
765 NDR_CHECK(ndr_push_align(ndr, 4));
766 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->alloc_hint));
767 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->context_id));
768 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->cancel_count));
769 NDR_CHECK(ndr_push_dcerpc_nca_status(ndr, NDR_SCALARS, r->status));
771 uint32_t _flags_save_DATA_BLOB = ndr->flags;
772 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
773 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->_pad));
774 ndr->flags = _flags_save_DATA_BLOB;
776 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
778 if (ndr_flags & NDR_BUFFERS) {
780 return NDR_ERR_SUCCESS;
783 static enum ndr_err_code ndr_pull_dcerpc_fault(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_fault *r)
785 if (ndr_flags & NDR_SCALARS) {
786 NDR_CHECK(ndr_pull_align(ndr, 4));
787 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->alloc_hint));
788 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->context_id));
789 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->cancel_count));
790 NDR_CHECK(ndr_pull_dcerpc_nca_status(ndr, NDR_SCALARS, &r->status));
792 uint32_t _flags_save_DATA_BLOB = ndr->flags;
793 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
794 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->_pad));
795 ndr->flags = _flags_save_DATA_BLOB;
797 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
799 if (ndr_flags & NDR_BUFFERS) {
801 return NDR_ERR_SUCCESS;
804 _PUBLIC_ void ndr_print_dcerpc_fault(struct ndr_print *ndr, const char *name, const struct dcerpc_fault *r)
806 ndr_print_struct(ndr, name, "dcerpc_fault");
807 ndr->depth++;
808 ndr_print_uint32(ndr, "alloc_hint", r->alloc_hint);
809 ndr_print_uint16(ndr, "context_id", r->context_id);
810 ndr_print_uint8(ndr, "cancel_count", r->cancel_count);
811 ndr_print_dcerpc_nca_status(ndr, "status", r->status);
812 ndr_print_DATA_BLOB(ndr, "_pad", r->_pad);
813 ndr->depth--;
816 static enum ndr_err_code ndr_push_dcerpc_AuthType(struct ndr_push *ndr, int ndr_flags, enum dcerpc_AuthType r)
818 NDR_CHECK(ndr_push_enum_uint8(ndr, NDR_SCALARS, r));
819 return NDR_ERR_SUCCESS;
822 static enum ndr_err_code ndr_pull_dcerpc_AuthType(struct ndr_pull *ndr, int ndr_flags, enum dcerpc_AuthType *r)
824 uint8_t v;
825 NDR_CHECK(ndr_pull_enum_uint8(ndr, NDR_SCALARS, &v));
826 *r = v;
827 return NDR_ERR_SUCCESS;
830 _PUBLIC_ void ndr_print_dcerpc_AuthType(struct ndr_print *ndr, const char *name, enum dcerpc_AuthType r)
832 const char *val = NULL;
834 switch (r) {
835 case DCERPC_AUTH_TYPE_NONE: val = "DCERPC_AUTH_TYPE_NONE"; break;
836 case DCERPC_AUTH_TYPE_KRB5_1: val = "DCERPC_AUTH_TYPE_KRB5_1"; break;
837 case DCERPC_AUTH_TYPE_SPNEGO: val = "DCERPC_AUTH_TYPE_SPNEGO"; break;
838 case DCERPC_AUTH_TYPE_NTLMSSP: val = "DCERPC_AUTH_TYPE_NTLMSSP"; break;
839 case DCERPC_AUTH_TYPE_KRB5: val = "DCERPC_AUTH_TYPE_KRB5"; break;
840 case DCERPC_AUTH_TYPE_DPA: val = "DCERPC_AUTH_TYPE_DPA"; break;
841 case DCERPC_AUTH_TYPE_MSN: val = "DCERPC_AUTH_TYPE_MSN"; break;
842 case DCERPC_AUTH_TYPE_DIGEST: val = "DCERPC_AUTH_TYPE_DIGEST"; break;
843 case DCERPC_AUTH_TYPE_SCHANNEL: val = "DCERPC_AUTH_TYPE_SCHANNEL"; break;
844 case DCERPC_AUTH_TYPE_MSMQ: val = "DCERPC_AUTH_TYPE_MSMQ"; break;
846 ndr_print_enum(ndr, name, "ENUM", val, r);
849 static enum ndr_err_code ndr_push_dcerpc_AuthLevel(struct ndr_push *ndr, int ndr_flags, enum dcerpc_AuthLevel r)
851 NDR_CHECK(ndr_push_enum_uint8(ndr, NDR_SCALARS, r));
852 return NDR_ERR_SUCCESS;
855 static enum ndr_err_code ndr_pull_dcerpc_AuthLevel(struct ndr_pull *ndr, int ndr_flags, enum dcerpc_AuthLevel *r)
857 uint8_t v;
858 NDR_CHECK(ndr_pull_enum_uint8(ndr, NDR_SCALARS, &v));
859 *r = v;
860 return NDR_ERR_SUCCESS;
863 _PUBLIC_ void ndr_print_dcerpc_AuthLevel(struct ndr_print *ndr, const char *name, enum dcerpc_AuthLevel r)
865 const char *val = NULL;
867 switch (r) {
868 case DCERPC_AUTH_LEVEL_NONE: val = "DCERPC_AUTH_LEVEL_NONE"; break;
869 case DCERPC_AUTH_LEVEL_CONNECT: val = "DCERPC_AUTH_LEVEL_CONNECT"; break;
870 case DCERPC_AUTH_LEVEL_CALL: val = "DCERPC_AUTH_LEVEL_CALL"; break;
871 case DCERPC_AUTH_LEVEL_PACKET: val = "DCERPC_AUTH_LEVEL_PACKET"; break;
872 case DCERPC_AUTH_LEVEL_INTEGRITY: val = "DCERPC_AUTH_LEVEL_INTEGRITY"; break;
873 case DCERPC_AUTH_LEVEL_PRIVACY: val = "DCERPC_AUTH_LEVEL_PRIVACY"; break;
875 ndr_print_enum(ndr, name, "ENUM", val, r);
878 _PUBLIC_ enum ndr_err_code ndr_push_dcerpc_auth(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_auth *r)
880 if (ndr_flags & NDR_SCALARS) {
881 NDR_CHECK(ndr_push_align(ndr, 4));
882 NDR_CHECK(ndr_push_dcerpc_AuthType(ndr, NDR_SCALARS, r->auth_type));
883 NDR_CHECK(ndr_push_dcerpc_AuthLevel(ndr, NDR_SCALARS, r->auth_level));
884 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->auth_pad_length));
885 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->auth_reserved));
886 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->auth_context_id));
888 uint32_t _flags_save_DATA_BLOB = ndr->flags;
889 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
890 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->credentials));
891 ndr->flags = _flags_save_DATA_BLOB;
893 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
895 if (ndr_flags & NDR_BUFFERS) {
897 return NDR_ERR_SUCCESS;
900 _PUBLIC_ enum ndr_err_code ndr_pull_dcerpc_auth(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_auth *r)
902 if (ndr_flags & NDR_SCALARS) {
903 NDR_CHECK(ndr_pull_align(ndr, 4));
904 NDR_CHECK(ndr_pull_dcerpc_AuthType(ndr, NDR_SCALARS, &r->auth_type));
905 NDR_CHECK(ndr_pull_dcerpc_AuthLevel(ndr, NDR_SCALARS, &r->auth_level));
906 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->auth_pad_length));
907 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->auth_reserved));
908 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->auth_context_id));
910 uint32_t _flags_save_DATA_BLOB = ndr->flags;
911 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
912 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->credentials));
913 ndr->flags = _flags_save_DATA_BLOB;
915 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
917 if (ndr_flags & NDR_BUFFERS) {
919 return NDR_ERR_SUCCESS;
922 _PUBLIC_ void ndr_print_dcerpc_auth(struct ndr_print *ndr, const char *name, const struct dcerpc_auth *r)
924 ndr_print_struct(ndr, name, "dcerpc_auth");
925 ndr->depth++;
926 ndr_print_dcerpc_AuthType(ndr, "auth_type", r->auth_type);
927 ndr_print_dcerpc_AuthLevel(ndr, "auth_level", r->auth_level);
928 ndr_print_uint8(ndr, "auth_pad_length", r->auth_pad_length);
929 ndr_print_uint8(ndr, "auth_reserved", r->auth_reserved);
930 ndr_print_uint32(ndr, "auth_context_id", r->auth_context_id);
931 ndr_print_DATA_BLOB(ndr, "credentials", r->credentials);
932 ndr->depth--;
935 _PUBLIC_ enum ndr_err_code ndr_push_dcerpc_auth3(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_auth3 *r)
937 if (ndr_flags & NDR_SCALARS) {
938 NDR_CHECK(ndr_push_align(ndr, 4));
939 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
941 uint32_t _flags_save_DATA_BLOB = ndr->flags;
942 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
943 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->auth_info));
944 ndr->flags = _flags_save_DATA_BLOB;
946 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
948 if (ndr_flags & NDR_BUFFERS) {
950 return NDR_ERR_SUCCESS;
953 _PUBLIC_ enum ndr_err_code ndr_pull_dcerpc_auth3(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_auth3 *r)
955 if (ndr_flags & NDR_SCALARS) {
956 NDR_CHECK(ndr_pull_align(ndr, 4));
957 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->_pad));
959 uint32_t _flags_save_DATA_BLOB = ndr->flags;
960 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
961 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->auth_info));
962 ndr->flags = _flags_save_DATA_BLOB;
964 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
966 if (ndr_flags & NDR_BUFFERS) {
968 return NDR_ERR_SUCCESS;
971 _PUBLIC_ void ndr_print_dcerpc_auth3(struct ndr_print *ndr, const char *name, const struct dcerpc_auth3 *r)
973 ndr_print_struct(ndr, name, "dcerpc_auth3");
974 ndr->depth++;
975 ndr_print_uint32(ndr, "_pad", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->_pad);
976 ndr_print_DATA_BLOB(ndr, "auth_info", r->auth_info);
977 ndr->depth--;
980 _PUBLIC_ enum ndr_err_code ndr_push_dcerpc_orphaned(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_orphaned *r)
982 if (ndr_flags & NDR_SCALARS) {
983 NDR_CHECK(ndr_push_align(ndr, 4));
984 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
986 uint32_t _flags_save_DATA_BLOB = ndr->flags;
987 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
988 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->auth_info));
989 ndr->flags = _flags_save_DATA_BLOB;
991 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
993 if (ndr_flags & NDR_BUFFERS) {
995 return NDR_ERR_SUCCESS;
998 _PUBLIC_ enum ndr_err_code ndr_pull_dcerpc_orphaned(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_orphaned *r)
1000 if (ndr_flags & NDR_SCALARS) {
1001 NDR_CHECK(ndr_pull_align(ndr, 4));
1002 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->_pad));
1004 uint32_t _flags_save_DATA_BLOB = ndr->flags;
1005 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
1006 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->auth_info));
1007 ndr->flags = _flags_save_DATA_BLOB;
1009 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
1011 if (ndr_flags & NDR_BUFFERS) {
1013 return NDR_ERR_SUCCESS;
1016 _PUBLIC_ void ndr_print_dcerpc_orphaned(struct ndr_print *ndr, const char *name, const struct dcerpc_orphaned *r)
1018 ndr_print_struct(ndr, name, "dcerpc_orphaned");
1019 ndr->depth++;
1020 ndr_print_uint32(ndr, "_pad", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->_pad);
1021 ndr_print_DATA_BLOB(ndr, "auth_info", r->auth_info);
1022 ndr->depth--;
1025 _PUBLIC_ enum ndr_err_code ndr_push_dcerpc_co_cancel(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_co_cancel *r)
1027 if (ndr_flags & NDR_SCALARS) {
1028 NDR_CHECK(ndr_push_align(ndr, 4));
1029 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
1031 uint32_t _flags_save_DATA_BLOB = ndr->flags;
1032 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
1033 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->auth_info));
1034 ndr->flags = _flags_save_DATA_BLOB;
1036 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
1038 if (ndr_flags & NDR_BUFFERS) {
1040 return NDR_ERR_SUCCESS;
1043 _PUBLIC_ enum ndr_err_code ndr_pull_dcerpc_co_cancel(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_co_cancel *r)
1045 if (ndr_flags & NDR_SCALARS) {
1046 NDR_CHECK(ndr_pull_align(ndr, 4));
1047 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->_pad));
1049 uint32_t _flags_save_DATA_BLOB = ndr->flags;
1050 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
1051 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->auth_info));
1052 ndr->flags = _flags_save_DATA_BLOB;
1054 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
1056 if (ndr_flags & NDR_BUFFERS) {
1058 return NDR_ERR_SUCCESS;
1061 _PUBLIC_ void ndr_print_dcerpc_co_cancel(struct ndr_print *ndr, const char *name, const struct dcerpc_co_cancel *r)
1063 ndr_print_struct(ndr, name, "dcerpc_co_cancel");
1064 ndr->depth++;
1065 ndr_print_uint32(ndr, "_pad", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->_pad);
1066 ndr_print_DATA_BLOB(ndr, "auth_info", r->auth_info);
1067 ndr->depth--;
1070 _PUBLIC_ enum ndr_err_code ndr_push_dcerpc_cl_cancel(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_cl_cancel *r)
1072 if (ndr_flags & NDR_SCALARS) {
1073 NDR_CHECK(ndr_push_align(ndr, 4));
1074 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version));
1075 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->id));
1076 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
1078 if (ndr_flags & NDR_BUFFERS) {
1080 return NDR_ERR_SUCCESS;
1083 _PUBLIC_ enum ndr_err_code ndr_pull_dcerpc_cl_cancel(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_cl_cancel *r)
1085 if (ndr_flags & NDR_SCALARS) {
1086 NDR_CHECK(ndr_pull_align(ndr, 4));
1087 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version));
1088 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->id));
1089 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
1091 if (ndr_flags & NDR_BUFFERS) {
1093 return NDR_ERR_SUCCESS;
1096 _PUBLIC_ void ndr_print_dcerpc_cl_cancel(struct ndr_print *ndr, const char *name, const struct dcerpc_cl_cancel *r)
1098 ndr_print_struct(ndr, name, "dcerpc_cl_cancel");
1099 ndr->depth++;
1100 ndr_print_uint32(ndr, "version", r->version);
1101 ndr_print_uint32(ndr, "id", r->id);
1102 ndr->depth--;
1105 _PUBLIC_ enum ndr_err_code ndr_push_dcerpc_cancel_ack(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_cancel_ack *r)
1107 if (ndr_flags & NDR_SCALARS) {
1108 NDR_CHECK(ndr_push_align(ndr, 4));
1109 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version));
1110 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->id));
1111 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->server_is_accepting));
1112 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
1114 if (ndr_flags & NDR_BUFFERS) {
1116 return NDR_ERR_SUCCESS;
1119 _PUBLIC_ enum ndr_err_code ndr_pull_dcerpc_cancel_ack(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_cancel_ack *r)
1121 if (ndr_flags & NDR_SCALARS) {
1122 NDR_CHECK(ndr_pull_align(ndr, 4));
1123 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version));
1124 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->id));
1125 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->server_is_accepting));
1126 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
1128 if (ndr_flags & NDR_BUFFERS) {
1130 return NDR_ERR_SUCCESS;
1133 _PUBLIC_ void ndr_print_dcerpc_cancel_ack(struct ndr_print *ndr, const char *name, const struct dcerpc_cancel_ack *r)
1135 ndr_print_struct(ndr, name, "dcerpc_cancel_ack");
1136 ndr->depth++;
1137 ndr_print_uint32(ndr, "version", r->version);
1138 ndr_print_uint32(ndr, "id", r->id);
1139 ndr_print_uint32(ndr, "server_is_accepting", r->server_is_accepting);
1140 ndr->depth--;
1143 _PUBLIC_ enum ndr_err_code ndr_push_dcerpc_fack(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_fack *r)
1145 uint32_t cntr_selack_0;
1146 if (ndr_flags & NDR_SCALARS) {
1147 NDR_CHECK(ndr_push_align(ndr, 4));
1148 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version));
1149 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->_pad1));
1150 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->window_size));
1151 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->max_tdsu));
1152 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->max_frag_size));
1153 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->serial_no));
1154 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->selack_size));
1155 for (cntr_selack_0 = 0; cntr_selack_0 < r->selack_size; cntr_selack_0++) {
1156 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->selack[cntr_selack_0]));
1158 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
1160 if (ndr_flags & NDR_BUFFERS) {
1162 return NDR_ERR_SUCCESS;
1165 _PUBLIC_ enum ndr_err_code ndr_pull_dcerpc_fack(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_fack *r)
1167 uint32_t cntr_selack_0;
1168 TALLOC_CTX *_mem_save_selack_0;
1169 if (ndr_flags & NDR_SCALARS) {
1170 NDR_CHECK(ndr_pull_align(ndr, 4));
1171 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version));
1172 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->_pad1));
1173 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->window_size));
1174 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->max_tdsu));
1175 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->max_frag_size));
1176 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->serial_no));
1177 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->selack_size));
1178 NDR_PULL_ALLOC_N(ndr, r->selack, r->selack_size);
1179 _mem_save_selack_0 = NDR_PULL_GET_MEM_CTX(ndr);
1180 NDR_PULL_SET_MEM_CTX(ndr, r->selack, 0);
1181 for (cntr_selack_0 = 0; cntr_selack_0 < r->selack_size; cntr_selack_0++) {
1182 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->selack[cntr_selack_0]));
1184 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_selack_0, 0);
1185 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
1187 if (ndr_flags & NDR_BUFFERS) {
1189 return NDR_ERR_SUCCESS;
1192 _PUBLIC_ void ndr_print_dcerpc_fack(struct ndr_print *ndr, const char *name, const struct dcerpc_fack *r)
1194 uint32_t cntr_selack_0;
1195 ndr_print_struct(ndr, name, "dcerpc_fack");
1196 ndr->depth++;
1197 ndr_print_uint32(ndr, "version", r->version);
1198 ndr_print_uint8(ndr, "_pad1", r->_pad1);
1199 ndr_print_uint16(ndr, "window_size", r->window_size);
1200 ndr_print_uint32(ndr, "max_tdsu", r->max_tdsu);
1201 ndr_print_uint32(ndr, "max_frag_size", r->max_frag_size);
1202 ndr_print_uint16(ndr, "serial_no", r->serial_no);
1203 ndr_print_uint16(ndr, "selack_size", r->selack_size);
1204 ndr->print(ndr, "%s: ARRAY(%d)", "selack", (int)r->selack_size);
1205 ndr->depth++;
1206 for (cntr_selack_0=0;cntr_selack_0<r->selack_size;cntr_selack_0++) {
1207 char *idx_0=NULL;
1208 if (asprintf(&idx_0, "[%d]", cntr_selack_0) != -1) {
1209 ndr_print_uint32(ndr, "selack", r->selack[cntr_selack_0]);
1210 free(idx_0);
1213 ndr->depth--;
1214 ndr->depth--;
1217 _PUBLIC_ enum ndr_err_code ndr_push_dcerpc_ack(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_ack *r)
1219 if (ndr_flags & NDR_SCALARS) {
1220 NDR_CHECK(ndr_push_align(ndr, 1));
1221 NDR_CHECK(ndr_push_trailer_align(ndr, 1));
1223 if (ndr_flags & NDR_BUFFERS) {
1225 return NDR_ERR_SUCCESS;
1228 _PUBLIC_ enum ndr_err_code ndr_pull_dcerpc_ack(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_ack *r)
1230 if (ndr_flags & NDR_SCALARS) {
1231 NDR_CHECK(ndr_pull_align(ndr, 1));
1232 NDR_CHECK(ndr_pull_trailer_align(ndr, 1));
1234 if (ndr_flags & NDR_BUFFERS) {
1236 return NDR_ERR_SUCCESS;
1239 _PUBLIC_ void ndr_print_dcerpc_ack(struct ndr_print *ndr, const char *name, const struct dcerpc_ack *r)
1241 ndr_print_struct(ndr, name, "dcerpc_ack");
1242 ndr->depth++;
1243 ndr->depth--;
1246 _PUBLIC_ enum ndr_err_code ndr_push_dcerpc_ping(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_ping *r)
1248 if (ndr_flags & NDR_SCALARS) {
1249 NDR_CHECK(ndr_push_align(ndr, 1));
1250 NDR_CHECK(ndr_push_trailer_align(ndr, 1));
1252 if (ndr_flags & NDR_BUFFERS) {
1254 return NDR_ERR_SUCCESS;
1257 _PUBLIC_ enum ndr_err_code ndr_pull_dcerpc_ping(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_ping *r)
1259 if (ndr_flags & NDR_SCALARS) {
1260 NDR_CHECK(ndr_pull_align(ndr, 1));
1261 NDR_CHECK(ndr_pull_trailer_align(ndr, 1));
1263 if (ndr_flags & NDR_BUFFERS) {
1265 return NDR_ERR_SUCCESS;
1268 _PUBLIC_ void ndr_print_dcerpc_ping(struct ndr_print *ndr, const char *name, const struct dcerpc_ping *r)
1270 ndr_print_struct(ndr, name, "dcerpc_ping");
1271 ndr->depth++;
1272 ndr->depth--;
1275 _PUBLIC_ enum ndr_err_code ndr_push_dcerpc_shutdown(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_shutdown *r)
1277 if (ndr_flags & NDR_SCALARS) {
1278 NDR_CHECK(ndr_push_align(ndr, 1));
1279 NDR_CHECK(ndr_push_trailer_align(ndr, 1));
1281 if (ndr_flags & NDR_BUFFERS) {
1283 return NDR_ERR_SUCCESS;
1286 _PUBLIC_ enum ndr_err_code ndr_pull_dcerpc_shutdown(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_shutdown *r)
1288 if (ndr_flags & NDR_SCALARS) {
1289 NDR_CHECK(ndr_pull_align(ndr, 1));
1290 NDR_CHECK(ndr_pull_trailer_align(ndr, 1));
1292 if (ndr_flags & NDR_BUFFERS) {
1294 return NDR_ERR_SUCCESS;
1297 _PUBLIC_ void ndr_print_dcerpc_shutdown(struct ndr_print *ndr, const char *name, const struct dcerpc_shutdown *r)
1299 ndr_print_struct(ndr, name, "dcerpc_shutdown");
1300 ndr->depth++;
1301 ndr->depth--;
1304 _PUBLIC_ enum ndr_err_code ndr_push_dcerpc_working(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_working *r)
1306 if (ndr_flags & NDR_SCALARS) {
1307 NDR_CHECK(ndr_push_align(ndr, 1));
1308 NDR_CHECK(ndr_push_trailer_align(ndr, 1));
1310 if (ndr_flags & NDR_BUFFERS) {
1312 return NDR_ERR_SUCCESS;
1315 _PUBLIC_ enum ndr_err_code ndr_pull_dcerpc_working(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_working *r)
1317 if (ndr_flags & NDR_SCALARS) {
1318 NDR_CHECK(ndr_pull_align(ndr, 1));
1319 NDR_CHECK(ndr_pull_trailer_align(ndr, 1));
1321 if (ndr_flags & NDR_BUFFERS) {
1323 return NDR_ERR_SUCCESS;
1326 _PUBLIC_ void ndr_print_dcerpc_working(struct ndr_print *ndr, const char *name, const struct dcerpc_working *r)
1328 ndr_print_struct(ndr, name, "dcerpc_working");
1329 ndr->depth++;
1330 ndr->depth--;
1333 static enum ndr_err_code ndr_push_dcerpc_pkt_type(struct ndr_push *ndr, int ndr_flags, enum dcerpc_pkt_type r)
1335 NDR_CHECK(ndr_push_enum_uint8(ndr, NDR_SCALARS, r));
1336 return NDR_ERR_SUCCESS;
1339 static enum ndr_err_code ndr_pull_dcerpc_pkt_type(struct ndr_pull *ndr, int ndr_flags, enum dcerpc_pkt_type *r)
1341 uint8_t v;
1342 NDR_CHECK(ndr_pull_enum_uint8(ndr, NDR_SCALARS, &v));
1343 *r = v;
1344 return NDR_ERR_SUCCESS;
1347 _PUBLIC_ void ndr_print_dcerpc_pkt_type(struct ndr_print *ndr, const char *name, enum dcerpc_pkt_type r)
1349 const char *val = NULL;
1351 switch (r) {
1352 case DCERPC_PKT_REQUEST: val = "DCERPC_PKT_REQUEST"; break;
1353 case DCERPC_PKT_PING: val = "DCERPC_PKT_PING"; break;
1354 case DCERPC_PKT_RESPONSE: val = "DCERPC_PKT_RESPONSE"; break;
1355 case DCERPC_PKT_FAULT: val = "DCERPC_PKT_FAULT"; break;
1356 case DCERPC_PKT_WORKING: val = "DCERPC_PKT_WORKING"; break;
1357 case DCERPC_PKT_NOCALL: val = "DCERPC_PKT_NOCALL"; break;
1358 case DCERPC_PKT_REJECT: val = "DCERPC_PKT_REJECT"; break;
1359 case DCERPC_PKT_ACK: val = "DCERPC_PKT_ACK"; break;
1360 case DCERPC_PKT_CL_CANCEL: val = "DCERPC_PKT_CL_CANCEL"; break;
1361 case DCERPC_PKT_FACK: val = "DCERPC_PKT_FACK"; break;
1362 case DCERPC_PKT_CANCEL_ACK: val = "DCERPC_PKT_CANCEL_ACK"; break;
1363 case DCERPC_PKT_BIND: val = "DCERPC_PKT_BIND"; break;
1364 case DCERPC_PKT_BIND_ACK: val = "DCERPC_PKT_BIND_ACK"; break;
1365 case DCERPC_PKT_BIND_NAK: val = "DCERPC_PKT_BIND_NAK"; break;
1366 case DCERPC_PKT_ALTER: val = "DCERPC_PKT_ALTER"; break;
1367 case DCERPC_PKT_ALTER_RESP: val = "DCERPC_PKT_ALTER_RESP"; break;
1368 case DCERPC_PKT_AUTH3: val = "DCERPC_PKT_AUTH3"; break;
1369 case DCERPC_PKT_SHUTDOWN: val = "DCERPC_PKT_SHUTDOWN"; break;
1370 case DCERPC_PKT_CO_CANCEL: val = "DCERPC_PKT_CO_CANCEL"; break;
1371 case DCERPC_PKT_ORPHANED: val = "DCERPC_PKT_ORPHANED"; break;
1373 ndr_print_enum(ndr, name, "ENUM", val, r);
1376 static enum ndr_err_code ndr_push_dcerpc_payload(struct ndr_push *ndr, int ndr_flags, const union dcerpc_payload *r)
1378 if (ndr_flags & NDR_SCALARS) {
1379 int level = ndr_push_get_switch_value(ndr, r);
1380 NDR_CHECK(ndr_push_union_align(ndr, 4));
1381 switch (level) {
1382 case DCERPC_PKT_REQUEST: {
1383 NDR_CHECK(ndr_push_dcerpc_request(ndr, NDR_SCALARS, &r->request));
1384 break; }
1386 case DCERPC_PKT_PING: {
1387 NDR_CHECK(ndr_push_dcerpc_ping(ndr, NDR_SCALARS, &r->ping));
1388 break; }
1390 case DCERPC_PKT_RESPONSE: {
1391 NDR_CHECK(ndr_push_dcerpc_response(ndr, NDR_SCALARS, &r->response));
1392 break; }
1394 case DCERPC_PKT_FAULT: {
1395 NDR_CHECK(ndr_push_dcerpc_fault(ndr, NDR_SCALARS, &r->fault));
1396 break; }
1398 case DCERPC_PKT_WORKING: {
1399 NDR_CHECK(ndr_push_dcerpc_working(ndr, NDR_SCALARS, &r->working));
1400 break; }
1402 case DCERPC_PKT_NOCALL: {
1403 NDR_CHECK(ndr_push_dcerpc_fack(ndr, NDR_SCALARS, &r->nocall));
1404 break; }
1406 case DCERPC_PKT_REJECT: {
1407 NDR_CHECK(ndr_push_dcerpc_fault(ndr, NDR_SCALARS, &r->reject));
1408 break; }
1410 case DCERPC_PKT_ACK: {
1411 NDR_CHECK(ndr_push_dcerpc_ack(ndr, NDR_SCALARS, &r->ack));
1412 break; }
1414 case DCERPC_PKT_CL_CANCEL: {
1415 NDR_CHECK(ndr_push_dcerpc_cl_cancel(ndr, NDR_SCALARS, &r->cl_cancel));
1416 break; }
1418 case DCERPC_PKT_FACK: {
1419 NDR_CHECK(ndr_push_dcerpc_fack(ndr, NDR_SCALARS, &r->fack));
1420 break; }
1422 case DCERPC_PKT_CANCEL_ACK: {
1423 NDR_CHECK(ndr_push_dcerpc_cancel_ack(ndr, NDR_SCALARS, &r->cancel_ack));
1424 break; }
1426 case DCERPC_PKT_BIND: {
1427 NDR_CHECK(ndr_push_dcerpc_bind(ndr, NDR_SCALARS, &r->bind));
1428 break; }
1430 case DCERPC_PKT_BIND_ACK: {
1431 NDR_CHECK(ndr_push_dcerpc_bind_ack(ndr, NDR_SCALARS, &r->bind_ack));
1432 break; }
1434 case DCERPC_PKT_BIND_NAK: {
1435 NDR_CHECK(ndr_push_dcerpc_bind_nak(ndr, NDR_SCALARS, &r->bind_nak));
1436 break; }
1438 case DCERPC_PKT_ALTER: {
1439 NDR_CHECK(ndr_push_dcerpc_bind(ndr, NDR_SCALARS, &r->alter));
1440 break; }
1442 case DCERPC_PKT_ALTER_RESP: {
1443 NDR_CHECK(ndr_push_dcerpc_bind_ack(ndr, NDR_SCALARS, &r->alter_resp));
1444 break; }
1446 case DCERPC_PKT_SHUTDOWN: {
1447 NDR_CHECK(ndr_push_dcerpc_shutdown(ndr, NDR_SCALARS, &r->shutdown));
1448 break; }
1450 case DCERPC_PKT_CO_CANCEL: {
1451 NDR_CHECK(ndr_push_dcerpc_co_cancel(ndr, NDR_SCALARS, &r->co_cancel));
1452 break; }
1454 case DCERPC_PKT_ORPHANED: {
1455 NDR_CHECK(ndr_push_dcerpc_orphaned(ndr, NDR_SCALARS, &r->orphaned));
1456 break; }
1458 case DCERPC_PKT_AUTH3: {
1459 NDR_CHECK(ndr_push_dcerpc_auth3(ndr, NDR_SCALARS, &r->auth3));
1460 break; }
1462 default:
1463 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
1466 if (ndr_flags & NDR_BUFFERS) {
1467 int level = ndr_push_get_switch_value(ndr, r);
1468 switch (level) {
1469 case DCERPC_PKT_REQUEST:
1470 break;
1472 case DCERPC_PKT_PING:
1473 break;
1475 case DCERPC_PKT_RESPONSE:
1476 break;
1478 case DCERPC_PKT_FAULT:
1479 break;
1481 case DCERPC_PKT_WORKING:
1482 break;
1484 case DCERPC_PKT_NOCALL:
1485 break;
1487 case DCERPC_PKT_REJECT:
1488 break;
1490 case DCERPC_PKT_ACK:
1491 break;
1493 case DCERPC_PKT_CL_CANCEL:
1494 break;
1496 case DCERPC_PKT_FACK:
1497 break;
1499 case DCERPC_PKT_CANCEL_ACK:
1500 break;
1502 case DCERPC_PKT_BIND:
1503 break;
1505 case DCERPC_PKT_BIND_ACK:
1506 break;
1508 case DCERPC_PKT_BIND_NAK:
1509 NDR_CHECK(ndr_push_dcerpc_bind_nak(ndr, NDR_BUFFERS, &r->bind_nak));
1510 break;
1512 case DCERPC_PKT_ALTER:
1513 break;
1515 case DCERPC_PKT_ALTER_RESP:
1516 break;
1518 case DCERPC_PKT_SHUTDOWN:
1519 break;
1521 case DCERPC_PKT_CO_CANCEL:
1522 break;
1524 case DCERPC_PKT_ORPHANED:
1525 break;
1527 case DCERPC_PKT_AUTH3:
1528 break;
1530 default:
1531 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
1534 return NDR_ERR_SUCCESS;
1537 static enum ndr_err_code ndr_pull_dcerpc_payload(struct ndr_pull *ndr, int ndr_flags, union dcerpc_payload *r)
1539 int level;
1540 level = ndr_pull_get_switch_value(ndr, r);
1541 if (ndr_flags & NDR_SCALARS) {
1542 NDR_CHECK(ndr_pull_union_align(ndr, 4));
1543 switch (level) {
1544 case DCERPC_PKT_REQUEST: {
1545 NDR_CHECK(ndr_pull_dcerpc_request(ndr, NDR_SCALARS, &r->request));
1546 break; }
1548 case DCERPC_PKT_PING: {
1549 NDR_CHECK(ndr_pull_dcerpc_ping(ndr, NDR_SCALARS, &r->ping));
1550 break; }
1552 case DCERPC_PKT_RESPONSE: {
1553 NDR_CHECK(ndr_pull_dcerpc_response(ndr, NDR_SCALARS, &r->response));
1554 break; }
1556 case DCERPC_PKT_FAULT: {
1557 NDR_CHECK(ndr_pull_dcerpc_fault(ndr, NDR_SCALARS, &r->fault));
1558 break; }
1560 case DCERPC_PKT_WORKING: {
1561 NDR_CHECK(ndr_pull_dcerpc_working(ndr, NDR_SCALARS, &r->working));
1562 break; }
1564 case DCERPC_PKT_NOCALL: {
1565 NDR_CHECK(ndr_pull_dcerpc_fack(ndr, NDR_SCALARS, &r->nocall));
1566 break; }
1568 case DCERPC_PKT_REJECT: {
1569 NDR_CHECK(ndr_pull_dcerpc_fault(ndr, NDR_SCALARS, &r->reject));
1570 break; }
1572 case DCERPC_PKT_ACK: {
1573 NDR_CHECK(ndr_pull_dcerpc_ack(ndr, NDR_SCALARS, &r->ack));
1574 break; }
1576 case DCERPC_PKT_CL_CANCEL: {
1577 NDR_CHECK(ndr_pull_dcerpc_cl_cancel(ndr, NDR_SCALARS, &r->cl_cancel));
1578 break; }
1580 case DCERPC_PKT_FACK: {
1581 NDR_CHECK(ndr_pull_dcerpc_fack(ndr, NDR_SCALARS, &r->fack));
1582 break; }
1584 case DCERPC_PKT_CANCEL_ACK: {
1585 NDR_CHECK(ndr_pull_dcerpc_cancel_ack(ndr, NDR_SCALARS, &r->cancel_ack));
1586 break; }
1588 case DCERPC_PKT_BIND: {
1589 NDR_CHECK(ndr_pull_dcerpc_bind(ndr, NDR_SCALARS, &r->bind));
1590 break; }
1592 case DCERPC_PKT_BIND_ACK: {
1593 NDR_CHECK(ndr_pull_dcerpc_bind_ack(ndr, NDR_SCALARS, &r->bind_ack));
1594 break; }
1596 case DCERPC_PKT_BIND_NAK: {
1597 NDR_CHECK(ndr_pull_dcerpc_bind_nak(ndr, NDR_SCALARS, &r->bind_nak));
1598 break; }
1600 case DCERPC_PKT_ALTER: {
1601 NDR_CHECK(ndr_pull_dcerpc_bind(ndr, NDR_SCALARS, &r->alter));
1602 break; }
1604 case DCERPC_PKT_ALTER_RESP: {
1605 NDR_CHECK(ndr_pull_dcerpc_bind_ack(ndr, NDR_SCALARS, &r->alter_resp));
1606 break; }
1608 case DCERPC_PKT_SHUTDOWN: {
1609 NDR_CHECK(ndr_pull_dcerpc_shutdown(ndr, NDR_SCALARS, &r->shutdown));
1610 break; }
1612 case DCERPC_PKT_CO_CANCEL: {
1613 NDR_CHECK(ndr_pull_dcerpc_co_cancel(ndr, NDR_SCALARS, &r->co_cancel));
1614 break; }
1616 case DCERPC_PKT_ORPHANED: {
1617 NDR_CHECK(ndr_pull_dcerpc_orphaned(ndr, NDR_SCALARS, &r->orphaned));
1618 break; }
1620 case DCERPC_PKT_AUTH3: {
1621 NDR_CHECK(ndr_pull_dcerpc_auth3(ndr, NDR_SCALARS, &r->auth3));
1622 break; }
1624 default:
1625 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
1628 if (ndr_flags & NDR_BUFFERS) {
1629 switch (level) {
1630 case DCERPC_PKT_REQUEST:
1631 break;
1633 case DCERPC_PKT_PING:
1634 break;
1636 case DCERPC_PKT_RESPONSE:
1637 break;
1639 case DCERPC_PKT_FAULT:
1640 break;
1642 case DCERPC_PKT_WORKING:
1643 break;
1645 case DCERPC_PKT_NOCALL:
1646 break;
1648 case DCERPC_PKT_REJECT:
1649 break;
1651 case DCERPC_PKT_ACK:
1652 break;
1654 case DCERPC_PKT_CL_CANCEL:
1655 break;
1657 case DCERPC_PKT_FACK:
1658 break;
1660 case DCERPC_PKT_CANCEL_ACK:
1661 break;
1663 case DCERPC_PKT_BIND:
1664 break;
1666 case DCERPC_PKT_BIND_ACK:
1667 break;
1669 case DCERPC_PKT_BIND_NAK:
1670 NDR_CHECK(ndr_pull_dcerpc_bind_nak(ndr, NDR_BUFFERS, &r->bind_nak));
1671 break;
1673 case DCERPC_PKT_ALTER:
1674 break;
1676 case DCERPC_PKT_ALTER_RESP:
1677 break;
1679 case DCERPC_PKT_SHUTDOWN:
1680 break;
1682 case DCERPC_PKT_CO_CANCEL:
1683 break;
1685 case DCERPC_PKT_ORPHANED:
1686 break;
1688 case DCERPC_PKT_AUTH3:
1689 break;
1691 default:
1692 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
1695 return NDR_ERR_SUCCESS;
1698 _PUBLIC_ void ndr_print_dcerpc_payload(struct ndr_print *ndr, const char *name, const union dcerpc_payload *r)
1700 int level;
1701 level = ndr_print_get_switch_value(ndr, r);
1702 ndr_print_union(ndr, name, level, "dcerpc_payload");
1703 switch (level) {
1704 case DCERPC_PKT_REQUEST:
1705 ndr_print_dcerpc_request(ndr, "request", &r->request);
1706 break;
1708 case DCERPC_PKT_PING:
1709 ndr_print_dcerpc_ping(ndr, "ping", &r->ping);
1710 break;
1712 case DCERPC_PKT_RESPONSE:
1713 ndr_print_dcerpc_response(ndr, "response", &r->response);
1714 break;
1716 case DCERPC_PKT_FAULT:
1717 ndr_print_dcerpc_fault(ndr, "fault", &r->fault);
1718 break;
1720 case DCERPC_PKT_WORKING:
1721 ndr_print_dcerpc_working(ndr, "working", &r->working);
1722 break;
1724 case DCERPC_PKT_NOCALL:
1725 ndr_print_dcerpc_fack(ndr, "nocall", &r->nocall);
1726 break;
1728 case DCERPC_PKT_REJECT:
1729 ndr_print_dcerpc_fault(ndr, "reject", &r->reject);
1730 break;
1732 case DCERPC_PKT_ACK:
1733 ndr_print_dcerpc_ack(ndr, "ack", &r->ack);
1734 break;
1736 case DCERPC_PKT_CL_CANCEL:
1737 ndr_print_dcerpc_cl_cancel(ndr, "cl_cancel", &r->cl_cancel);
1738 break;
1740 case DCERPC_PKT_FACK:
1741 ndr_print_dcerpc_fack(ndr, "fack", &r->fack);
1742 break;
1744 case DCERPC_PKT_CANCEL_ACK:
1745 ndr_print_dcerpc_cancel_ack(ndr, "cancel_ack", &r->cancel_ack);
1746 break;
1748 case DCERPC_PKT_BIND:
1749 ndr_print_dcerpc_bind(ndr, "bind", &r->bind);
1750 break;
1752 case DCERPC_PKT_BIND_ACK:
1753 ndr_print_dcerpc_bind_ack(ndr, "bind_ack", &r->bind_ack);
1754 break;
1756 case DCERPC_PKT_BIND_NAK:
1757 ndr_print_dcerpc_bind_nak(ndr, "bind_nak", &r->bind_nak);
1758 break;
1760 case DCERPC_PKT_ALTER:
1761 ndr_print_dcerpc_bind(ndr, "alter", &r->alter);
1762 break;
1764 case DCERPC_PKT_ALTER_RESP:
1765 ndr_print_dcerpc_bind_ack(ndr, "alter_resp", &r->alter_resp);
1766 break;
1768 case DCERPC_PKT_SHUTDOWN:
1769 ndr_print_dcerpc_shutdown(ndr, "shutdown", &r->shutdown);
1770 break;
1772 case DCERPC_PKT_CO_CANCEL:
1773 ndr_print_dcerpc_co_cancel(ndr, "co_cancel", &r->co_cancel);
1774 break;
1776 case DCERPC_PKT_ORPHANED:
1777 ndr_print_dcerpc_orphaned(ndr, "orphaned", &r->orphaned);
1778 break;
1780 case DCERPC_PKT_AUTH3:
1781 ndr_print_dcerpc_auth3(ndr, "auth3", &r->auth3);
1782 break;
1784 default:
1785 ndr_print_bad_level(ndr, name, level);
1789 _PUBLIC_ enum ndr_err_code ndr_push_ncacn_packet(struct ndr_push *ndr, int ndr_flags, const struct ncacn_packet *r)
1791 if (ndr_flags & NDR_SCALARS) {
1792 NDR_CHECK(ndr_push_align(ndr, 4));
1793 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->rpc_vers));
1794 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->rpc_vers_minor));
1795 NDR_CHECK(ndr_push_dcerpc_pkt_type(ndr, NDR_SCALARS, r->ptype));
1796 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->pfc_flags));
1797 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->drep, 4));
1798 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->frag_length));
1799 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->auth_length));
1800 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->call_id));
1801 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->u, r->ptype));
1802 NDR_CHECK(ndr_push_dcerpc_payload(ndr, NDR_SCALARS, &r->u));
1803 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
1805 if (ndr_flags & NDR_BUFFERS) {
1806 NDR_CHECK(ndr_push_dcerpc_payload(ndr, NDR_BUFFERS, &r->u));
1808 return NDR_ERR_SUCCESS;
1811 _PUBLIC_ enum ndr_err_code ndr_pull_ncacn_packet(struct ndr_pull *ndr, int ndr_flags, struct ncacn_packet *r)
1813 if (ndr_flags & NDR_SCALARS) {
1814 NDR_CHECK(ndr_pull_align(ndr, 4));
1815 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->rpc_vers));
1816 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->rpc_vers_minor));
1817 NDR_CHECK(ndr_pull_dcerpc_pkt_type(ndr, NDR_SCALARS, &r->ptype));
1818 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->pfc_flags));
1819 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->drep, 4));
1820 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->frag_length));
1821 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->auth_length));
1822 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->call_id));
1823 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->u, r->ptype));
1824 NDR_CHECK(ndr_pull_dcerpc_payload(ndr, NDR_SCALARS, &r->u));
1825 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
1827 if (ndr_flags & NDR_BUFFERS) {
1828 NDR_CHECK(ndr_pull_dcerpc_payload(ndr, NDR_BUFFERS, &r->u));
1830 return NDR_ERR_SUCCESS;
1833 _PUBLIC_ void ndr_print_ncacn_packet(struct ndr_print *ndr, const char *name, const struct ncacn_packet *r)
1835 ndr_print_struct(ndr, name, "ncacn_packet");
1836 ndr->depth++;
1837 ndr_print_uint8(ndr, "rpc_vers", r->rpc_vers);
1838 ndr_print_uint8(ndr, "rpc_vers_minor", r->rpc_vers_minor);
1839 ndr_print_dcerpc_pkt_type(ndr, "ptype", r->ptype);
1840 ndr_print_uint8(ndr, "pfc_flags", r->pfc_flags);
1841 ndr_print_array_uint8(ndr, "drep", r->drep, 4);
1842 ndr_print_uint16(ndr, "frag_length", r->frag_length);
1843 ndr_print_uint16(ndr, "auth_length", r->auth_length);
1844 ndr_print_uint32(ndr, "call_id", r->call_id);
1845 ndr_print_set_switch_value(ndr, &r->u, r->ptype);
1846 ndr_print_dcerpc_payload(ndr, "u", &r->u);
1847 ndr->depth--;
1850 _PUBLIC_ enum ndr_err_code ndr_push_ncadg_packet(struct ndr_push *ndr, int ndr_flags, const struct ncadg_packet *r)
1852 if (ndr_flags & NDR_SCALARS) {
1853 NDR_CHECK(ndr_push_align(ndr, 4));
1854 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->rpc_vers));
1855 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->ptype));
1856 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->pfc_flags));
1857 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->ncadg_flags));
1858 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->drep, 3));
1859 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->serial_high));
1860 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->object));
1861 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->iface));
1862 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->activity));
1863 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->server_boot));
1864 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->iface_version));
1865 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->seq_num));
1866 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->opnum));
1867 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->ihint));
1868 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->ahint));
1869 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->len));
1870 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->fragnum));
1871 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->auth_proto));
1872 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->serial_low));
1873 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->u, r->ptype));
1874 NDR_CHECK(ndr_push_dcerpc_payload(ndr, NDR_SCALARS, &r->u));
1875 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
1877 if (ndr_flags & NDR_BUFFERS) {
1878 NDR_CHECK(ndr_push_dcerpc_payload(ndr, NDR_BUFFERS, &r->u));
1880 return NDR_ERR_SUCCESS;
1883 _PUBLIC_ enum ndr_err_code ndr_pull_ncadg_packet(struct ndr_pull *ndr, int ndr_flags, struct ncadg_packet *r)
1885 if (ndr_flags & NDR_SCALARS) {
1886 NDR_CHECK(ndr_pull_align(ndr, 4));
1887 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->rpc_vers));
1888 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->ptype));
1889 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->pfc_flags));
1890 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->ncadg_flags));
1891 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->drep, 3));
1892 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->serial_high));
1893 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->object));
1894 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->iface));
1895 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->activity));
1896 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->server_boot));
1897 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->iface_version));
1898 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->seq_num));
1899 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->opnum));
1900 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->ihint));
1901 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->ahint));
1902 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->len));
1903 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->fragnum));
1904 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->auth_proto));
1905 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->serial_low));
1906 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->u, r->ptype));
1907 NDR_CHECK(ndr_pull_dcerpc_payload(ndr, NDR_SCALARS, &r->u));
1908 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
1910 if (ndr_flags & NDR_BUFFERS) {
1911 NDR_CHECK(ndr_pull_dcerpc_payload(ndr, NDR_BUFFERS, &r->u));
1913 return NDR_ERR_SUCCESS;
1916 _PUBLIC_ void ndr_print_ncadg_packet(struct ndr_print *ndr, const char *name, const struct ncadg_packet *r)
1918 ndr_print_struct(ndr, name, "ncadg_packet");
1919 ndr->depth++;
1920 ndr_print_uint8(ndr, "rpc_vers", r->rpc_vers);
1921 ndr_print_uint8(ndr, "ptype", r->ptype);
1922 ndr_print_uint8(ndr, "pfc_flags", r->pfc_flags);
1923 ndr_print_uint8(ndr, "ncadg_flags", r->ncadg_flags);
1924 ndr_print_array_uint8(ndr, "drep", r->drep, 3);
1925 ndr_print_uint8(ndr, "serial_high", r->serial_high);
1926 ndr_print_GUID(ndr, "object", &r->object);
1927 ndr_print_GUID(ndr, "iface", &r->iface);
1928 ndr_print_GUID(ndr, "activity", &r->activity);
1929 ndr_print_uint32(ndr, "server_boot", r->server_boot);
1930 ndr_print_uint32(ndr, "iface_version", r->iface_version);
1931 ndr_print_uint32(ndr, "seq_num", r->seq_num);
1932 ndr_print_uint16(ndr, "opnum", r->opnum);
1933 ndr_print_uint16(ndr, "ihint", r->ihint);
1934 ndr_print_uint16(ndr, "ahint", r->ahint);
1935 ndr_print_uint16(ndr, "len", r->len);
1936 ndr_print_uint16(ndr, "fragnum", r->fragnum);
1937 ndr_print_uint8(ndr, "auth_proto", r->auth_proto);
1938 ndr_print_uint8(ndr, "serial_low", r->serial_low);
1939 ndr_print_set_switch_value(ndr, &r->u, r->ptype);
1940 ndr_print_dcerpc_payload(ndr, "u", &r->u);
1941 ndr->depth--;