s3:configure: fix syntax error in avahi configure test
[Samba/gebeck_regimport.git] / librpc / gen_ndr / ndr_dcerpc.c
blobc510967c7a8f5b53d9bbbb0019895f6a90b73af0
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]));
19 if (ndr_flags & NDR_BUFFERS) {
21 return NDR_ERR_SUCCESS;
24 static enum ndr_err_code ndr_pull_dcerpc_ctx_list(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_ctx_list *r)
26 uint32_t cntr_transfer_syntaxes_0;
27 TALLOC_CTX *_mem_save_transfer_syntaxes_0;
28 if (ndr_flags & NDR_SCALARS) {
29 NDR_CHECK(ndr_pull_align(ndr, 4));
30 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->context_id));
31 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->num_transfer_syntaxes));
32 NDR_CHECK(ndr_pull_ndr_syntax_id(ndr, NDR_SCALARS, &r->abstract_syntax));
33 NDR_PULL_ALLOC_N(ndr, r->transfer_syntaxes, r->num_transfer_syntaxes);
34 _mem_save_transfer_syntaxes_0 = NDR_PULL_GET_MEM_CTX(ndr);
35 NDR_PULL_SET_MEM_CTX(ndr, r->transfer_syntaxes, 0);
36 for (cntr_transfer_syntaxes_0 = 0; cntr_transfer_syntaxes_0 < r->num_transfer_syntaxes; cntr_transfer_syntaxes_0++) {
37 NDR_CHECK(ndr_pull_ndr_syntax_id(ndr, NDR_SCALARS, &r->transfer_syntaxes[cntr_transfer_syntaxes_0]));
39 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_transfer_syntaxes_0, 0);
41 if (ndr_flags & NDR_BUFFERS) {
43 return NDR_ERR_SUCCESS;
46 _PUBLIC_ void ndr_print_dcerpc_ctx_list(struct ndr_print *ndr, const char *name, const struct dcerpc_ctx_list *r)
48 uint32_t cntr_transfer_syntaxes_0;
49 ndr_print_struct(ndr, name, "dcerpc_ctx_list");
50 ndr->depth++;
51 ndr_print_uint16(ndr, "context_id", r->context_id);
52 ndr_print_uint8(ndr, "num_transfer_syntaxes", r->num_transfer_syntaxes);
53 ndr_print_ndr_syntax_id(ndr, "abstract_syntax", &r->abstract_syntax);
54 ndr->print(ndr, "%s: ARRAY(%d)", "transfer_syntaxes", (int)r->num_transfer_syntaxes);
55 ndr->depth++;
56 for (cntr_transfer_syntaxes_0=0;cntr_transfer_syntaxes_0<r->num_transfer_syntaxes;cntr_transfer_syntaxes_0++) {
57 char *idx_0=NULL;
58 if (asprintf(&idx_0, "[%d]", cntr_transfer_syntaxes_0) != -1) {
59 ndr_print_ndr_syntax_id(ndr, "transfer_syntaxes", &r->transfer_syntaxes[cntr_transfer_syntaxes_0]);
60 free(idx_0);
63 ndr->depth--;
64 ndr->depth--;
67 static enum ndr_err_code ndr_push_dcerpc_bind(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_bind *r)
69 uint32_t cntr_ctx_list_0;
70 if (ndr_flags & NDR_SCALARS) {
71 NDR_CHECK(ndr_push_align(ndr, 4));
72 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->max_xmit_frag));
73 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->max_recv_frag));
74 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->assoc_group_id));
75 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->num_contexts));
76 for (cntr_ctx_list_0 = 0; cntr_ctx_list_0 < r->num_contexts; cntr_ctx_list_0++) {
77 NDR_CHECK(ndr_push_dcerpc_ctx_list(ndr, NDR_SCALARS, &r->ctx_list[cntr_ctx_list_0]));
80 uint32_t _flags_save_DATA_BLOB = ndr->flags;
81 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4);
82 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->_pad));
83 ndr->flags = _flags_save_DATA_BLOB;
86 uint32_t _flags_save_DATA_BLOB = ndr->flags;
87 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
88 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->auth_info));
89 ndr->flags = _flags_save_DATA_BLOB;
92 if (ndr_flags & NDR_BUFFERS) {
94 return NDR_ERR_SUCCESS;
97 static enum ndr_err_code ndr_pull_dcerpc_bind(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_bind *r)
99 uint32_t cntr_ctx_list_0;
100 TALLOC_CTX *_mem_save_ctx_list_0;
101 if (ndr_flags & NDR_SCALARS) {
102 NDR_CHECK(ndr_pull_align(ndr, 4));
103 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->max_xmit_frag));
104 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->max_recv_frag));
105 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->assoc_group_id));
106 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->num_contexts));
107 NDR_PULL_ALLOC_N(ndr, r->ctx_list, r->num_contexts);
108 _mem_save_ctx_list_0 = NDR_PULL_GET_MEM_CTX(ndr);
109 NDR_PULL_SET_MEM_CTX(ndr, r->ctx_list, 0);
110 for (cntr_ctx_list_0 = 0; cntr_ctx_list_0 < r->num_contexts; cntr_ctx_list_0++) {
111 NDR_CHECK(ndr_pull_dcerpc_ctx_list(ndr, NDR_SCALARS, &r->ctx_list[cntr_ctx_list_0]));
113 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctx_list_0, 0);
115 uint32_t _flags_save_DATA_BLOB = ndr->flags;
116 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4);
117 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->_pad));
118 ndr->flags = _flags_save_DATA_BLOB;
121 uint32_t _flags_save_DATA_BLOB = ndr->flags;
122 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
123 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->auth_info));
124 ndr->flags = _flags_save_DATA_BLOB;
127 if (ndr_flags & NDR_BUFFERS) {
129 return NDR_ERR_SUCCESS;
132 _PUBLIC_ void ndr_print_dcerpc_bind(struct ndr_print *ndr, const char *name, const struct dcerpc_bind *r)
134 uint32_t cntr_ctx_list_0;
135 ndr_print_struct(ndr, name, "dcerpc_bind");
136 ndr->depth++;
137 ndr_print_uint16(ndr, "max_xmit_frag", r->max_xmit_frag);
138 ndr_print_uint16(ndr, "max_recv_frag", r->max_recv_frag);
139 ndr_print_uint32(ndr, "assoc_group_id", r->assoc_group_id);
140 ndr_print_uint8(ndr, "num_contexts", r->num_contexts);
141 ndr->print(ndr, "%s: ARRAY(%d)", "ctx_list", (int)r->num_contexts);
142 ndr->depth++;
143 for (cntr_ctx_list_0=0;cntr_ctx_list_0<r->num_contexts;cntr_ctx_list_0++) {
144 char *idx_0=NULL;
145 if (asprintf(&idx_0, "[%d]", cntr_ctx_list_0) != -1) {
146 ndr_print_dcerpc_ctx_list(ndr, "ctx_list", &r->ctx_list[cntr_ctx_list_0]);
147 free(idx_0);
150 ndr->depth--;
151 ndr_print_DATA_BLOB(ndr, "_pad", r->_pad);
152 ndr_print_DATA_BLOB(ndr, "auth_info", r->auth_info);
153 ndr->depth--;
156 static enum ndr_err_code ndr_push_dcerpc_empty(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_empty *r)
158 if (ndr_flags & NDR_SCALARS) {
159 NDR_CHECK(ndr_push_align(ndr, 1));
161 if (ndr_flags & NDR_BUFFERS) {
163 return NDR_ERR_SUCCESS;
166 static enum ndr_err_code ndr_pull_dcerpc_empty(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_empty *r)
168 if (ndr_flags & NDR_SCALARS) {
169 NDR_CHECK(ndr_pull_align(ndr, 1));
171 if (ndr_flags & NDR_BUFFERS) {
173 return NDR_ERR_SUCCESS;
176 _PUBLIC_ void ndr_print_dcerpc_empty(struct ndr_print *ndr, const char *name, const struct dcerpc_empty *r)
178 ndr_print_struct(ndr, name, "dcerpc_empty");
179 ndr->depth++;
180 ndr->depth--;
183 static enum ndr_err_code ndr_push_dcerpc_object(struct ndr_push *ndr, int ndr_flags, const union dcerpc_object *r)
185 if (ndr_flags & NDR_SCALARS) {
186 int level = ndr_push_get_switch_value(ndr, r);
187 switch (level) {
188 default: {
189 NDR_CHECK(ndr_push_dcerpc_empty(ndr, NDR_SCALARS, &r->empty));
190 break; }
192 case LIBNDR_FLAG_OBJECT_PRESENT: {
193 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->object));
194 break; }
198 if (ndr_flags & NDR_BUFFERS) {
199 int level = ndr_push_get_switch_value(ndr, r);
200 switch (level) {
201 default:
202 break;
204 case LIBNDR_FLAG_OBJECT_PRESENT:
205 break;
209 return NDR_ERR_SUCCESS;
212 static enum ndr_err_code ndr_pull_dcerpc_object(struct ndr_pull *ndr, int ndr_flags, union dcerpc_object *r)
214 int level;
215 level = ndr_pull_get_switch_value(ndr, r);
216 if (ndr_flags & NDR_SCALARS) {
217 switch (level) {
218 default: {
219 NDR_CHECK(ndr_pull_dcerpc_empty(ndr, NDR_SCALARS, &r->empty));
220 break; }
222 case LIBNDR_FLAG_OBJECT_PRESENT: {
223 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->object));
224 break; }
228 if (ndr_flags & NDR_BUFFERS) {
229 switch (level) {
230 default:
231 break;
233 case LIBNDR_FLAG_OBJECT_PRESENT:
234 break;
238 return NDR_ERR_SUCCESS;
241 _PUBLIC_ void ndr_print_dcerpc_object(struct ndr_print *ndr, const char *name, const union dcerpc_object *r)
243 int level;
244 level = ndr_print_get_switch_value(ndr, r);
245 ndr_print_union(ndr, name, level, "dcerpc_object");
246 switch (level) {
247 default:
248 ndr_print_dcerpc_empty(ndr, "empty", &r->empty);
249 break;
251 case LIBNDR_FLAG_OBJECT_PRESENT:
252 ndr_print_GUID(ndr, "object", &r->object);
253 break;
258 static enum ndr_err_code ndr_push_dcerpc_request(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_request *r)
260 if (ndr_flags & NDR_SCALARS) {
261 NDR_CHECK(ndr_push_align(ndr, 4));
262 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->alloc_hint));
263 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->context_id));
264 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->opnum));
265 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->object, ndr->flags & LIBNDR_FLAG_OBJECT_PRESENT));
266 NDR_CHECK(ndr_push_dcerpc_object(ndr, NDR_SCALARS, &r->object));
268 uint32_t _flags_save_DATA_BLOB = ndr->flags;
269 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN8);
270 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->_pad));
271 ndr->flags = _flags_save_DATA_BLOB;
274 uint32_t _flags_save_DATA_BLOB = ndr->flags;
275 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
276 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->stub_and_verifier));
277 ndr->flags = _flags_save_DATA_BLOB;
280 if (ndr_flags & NDR_BUFFERS) {
282 return NDR_ERR_SUCCESS;
285 static enum ndr_err_code ndr_pull_dcerpc_request(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_request *r)
287 if (ndr_flags & NDR_SCALARS) {
288 NDR_CHECK(ndr_pull_align(ndr, 4));
289 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->alloc_hint));
290 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->context_id));
291 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->opnum));
292 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->object, ndr->flags & LIBNDR_FLAG_OBJECT_PRESENT));
293 NDR_CHECK(ndr_pull_dcerpc_object(ndr, NDR_SCALARS, &r->object));
295 uint32_t _flags_save_DATA_BLOB = ndr->flags;
296 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN8);
297 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->_pad));
298 ndr->flags = _flags_save_DATA_BLOB;
301 uint32_t _flags_save_DATA_BLOB = ndr->flags;
302 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
303 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->stub_and_verifier));
304 ndr->flags = _flags_save_DATA_BLOB;
307 if (ndr_flags & NDR_BUFFERS) {
309 return NDR_ERR_SUCCESS;
312 _PUBLIC_ void ndr_print_dcerpc_request(struct ndr_print *ndr, const char *name, const struct dcerpc_request *r)
314 ndr_print_struct(ndr, name, "dcerpc_request");
315 ndr->depth++;
316 ndr_print_uint32(ndr, "alloc_hint", r->alloc_hint);
317 ndr_print_uint16(ndr, "context_id", r->context_id);
318 ndr_print_uint16(ndr, "opnum", r->opnum);
319 ndr_print_set_switch_value(ndr, &r->object, ndr->flags & LIBNDR_FLAG_OBJECT_PRESENT);
320 ndr_print_dcerpc_object(ndr, "object", &r->object);
321 ndr_print_DATA_BLOB(ndr, "_pad", r->_pad);
322 ndr_print_DATA_BLOB(ndr, "stub_and_verifier", r->stub_and_verifier);
323 ndr->depth--;
326 static enum ndr_err_code ndr_push_dcerpc_ack_ctx(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_ack_ctx *r)
328 if (ndr_flags & NDR_SCALARS) {
329 NDR_CHECK(ndr_push_align(ndr, 4));
330 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->result));
331 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->reason));
332 NDR_CHECK(ndr_push_ndr_syntax_id(ndr, NDR_SCALARS, &r->syntax));
334 if (ndr_flags & NDR_BUFFERS) {
336 return NDR_ERR_SUCCESS;
339 static enum ndr_err_code ndr_pull_dcerpc_ack_ctx(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_ack_ctx *r)
341 if (ndr_flags & NDR_SCALARS) {
342 NDR_CHECK(ndr_pull_align(ndr, 4));
343 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->result));
344 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->reason));
345 NDR_CHECK(ndr_pull_ndr_syntax_id(ndr, NDR_SCALARS, &r->syntax));
347 if (ndr_flags & NDR_BUFFERS) {
349 return NDR_ERR_SUCCESS;
352 _PUBLIC_ void ndr_print_dcerpc_ack_ctx(struct ndr_print *ndr, const char *name, const struct dcerpc_ack_ctx *r)
354 ndr_print_struct(ndr, name, "dcerpc_ack_ctx");
355 ndr->depth++;
356 ndr_print_uint16(ndr, "result", r->result);
357 ndr_print_uint16(ndr, "reason", r->reason);
358 ndr_print_ndr_syntax_id(ndr, "syntax", &r->syntax);
359 ndr->depth--;
362 static enum ndr_err_code ndr_push_dcerpc_bind_ack(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_bind_ack *r)
364 uint32_t cntr_ctx_list_0;
365 if (ndr_flags & NDR_SCALARS) {
366 NDR_CHECK(ndr_push_align(ndr, 4));
367 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->max_xmit_frag));
368 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->max_recv_frag));
369 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->assoc_group_id));
370 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, strlen(r->secondary_address) + 1));
371 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->secondary_address, strlen(r->secondary_address) + 1, sizeof(uint8_t), CH_DOS));
373 uint32_t _flags_save_DATA_BLOB = ndr->flags;
374 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4);
375 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->_pad1));
376 ndr->flags = _flags_save_DATA_BLOB;
378 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->num_results));
379 for (cntr_ctx_list_0 = 0; cntr_ctx_list_0 < r->num_results; cntr_ctx_list_0++) {
380 NDR_CHECK(ndr_push_dcerpc_ack_ctx(ndr, NDR_SCALARS, &r->ctx_list[cntr_ctx_list_0]));
383 uint32_t _flags_save_DATA_BLOB = ndr->flags;
384 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
385 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->auth_info));
386 ndr->flags = _flags_save_DATA_BLOB;
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;
426 if (ndr_flags & NDR_BUFFERS) {
428 return NDR_ERR_SUCCESS;
431 _PUBLIC_ void ndr_print_dcerpc_bind_ack(struct ndr_print *ndr, const char *name, const struct dcerpc_bind_ack *r)
433 uint32_t cntr_ctx_list_0;
434 ndr_print_struct(ndr, name, "dcerpc_bind_ack");
435 ndr->depth++;
436 ndr_print_uint16(ndr, "max_xmit_frag", r->max_xmit_frag);
437 ndr_print_uint16(ndr, "max_recv_frag", r->max_recv_frag);
438 ndr_print_uint32(ndr, "assoc_group_id", r->assoc_group_id);
439 ndr_print_uint16(ndr, "secondary_address_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen(r->secondary_address) + 1:r->secondary_address_size);
440 ndr_print_string(ndr, "secondary_address", r->secondary_address);
441 ndr_print_DATA_BLOB(ndr, "_pad1", r->_pad1);
442 ndr_print_uint8(ndr, "num_results", r->num_results);
443 ndr->print(ndr, "%s: ARRAY(%d)", "ctx_list", (int)r->num_results);
444 ndr->depth++;
445 for (cntr_ctx_list_0=0;cntr_ctx_list_0<r->num_results;cntr_ctx_list_0++) {
446 char *idx_0=NULL;
447 if (asprintf(&idx_0, "[%d]", cntr_ctx_list_0) != -1) {
448 ndr_print_dcerpc_ack_ctx(ndr, "ctx_list", &r->ctx_list[cntr_ctx_list_0]);
449 free(idx_0);
452 ndr->depth--;
453 ndr_print_DATA_BLOB(ndr, "auth_info", r->auth_info);
454 ndr->depth--;
457 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)
459 uint32_t cntr_versions_0;
460 if (ndr_flags & NDR_SCALARS) {
461 NDR_CHECK(ndr_push_align(ndr, 4));
462 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_versions));
463 for (cntr_versions_0 = 0; cntr_versions_0 < r->num_versions; cntr_versions_0++) {
464 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->versions[cntr_versions_0]));
467 if (ndr_flags & NDR_BUFFERS) {
469 return NDR_ERR_SUCCESS;
472 static enum ndr_err_code ndr_pull_dcerpc_bind_nak_versions(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_bind_nak_versions *r)
474 uint32_t cntr_versions_0;
475 TALLOC_CTX *_mem_save_versions_0;
476 if (ndr_flags & NDR_SCALARS) {
477 NDR_CHECK(ndr_pull_align(ndr, 4));
478 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_versions));
479 NDR_PULL_ALLOC_N(ndr, r->versions, r->num_versions);
480 _mem_save_versions_0 = NDR_PULL_GET_MEM_CTX(ndr);
481 NDR_PULL_SET_MEM_CTX(ndr, r->versions, 0);
482 for (cntr_versions_0 = 0; cntr_versions_0 < r->num_versions; cntr_versions_0++) {
483 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->versions[cntr_versions_0]));
485 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_versions_0, 0);
487 if (ndr_flags & NDR_BUFFERS) {
489 return NDR_ERR_SUCCESS;
492 _PUBLIC_ void ndr_print_dcerpc_bind_nak_versions(struct ndr_print *ndr, const char *name, const struct dcerpc_bind_nak_versions *r)
494 uint32_t cntr_versions_0;
495 ndr_print_struct(ndr, name, "dcerpc_bind_nak_versions");
496 ndr->depth++;
497 ndr_print_uint32(ndr, "num_versions", r->num_versions);
498 ndr->print(ndr, "%s: ARRAY(%d)", "versions", (int)r->num_versions);
499 ndr->depth++;
500 for (cntr_versions_0=0;cntr_versions_0<r->num_versions;cntr_versions_0++) {
501 char *idx_0=NULL;
502 if (asprintf(&idx_0, "[%d]", cntr_versions_0) != -1) {
503 ndr_print_uint32(ndr, "versions", r->versions[cntr_versions_0]);
504 free(idx_0);
507 ndr->depth--;
508 ndr->depth--;
511 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)
513 if (ndr_flags & NDR_SCALARS) {
514 int level = ndr_push_get_switch_value(ndr, r);
515 switch (level) {
516 case DECRPC_BIND_PROTOCOL_VERSION_NOT_SUPPORTED: {
517 NDR_CHECK(ndr_push_dcerpc_bind_nak_versions(ndr, NDR_SCALARS, &r->v));
518 break; }
520 default: {
521 break; }
525 if (ndr_flags & NDR_BUFFERS) {
526 int level = ndr_push_get_switch_value(ndr, r);
527 switch (level) {
528 case DECRPC_BIND_PROTOCOL_VERSION_NOT_SUPPORTED:
529 break;
531 default:
532 break;
536 return NDR_ERR_SUCCESS;
539 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)
541 int level;
542 level = ndr_pull_get_switch_value(ndr, r);
543 if (ndr_flags & NDR_SCALARS) {
544 switch (level) {
545 case DECRPC_BIND_PROTOCOL_VERSION_NOT_SUPPORTED: {
546 NDR_CHECK(ndr_pull_dcerpc_bind_nak_versions(ndr, NDR_SCALARS, &r->v));
547 break; }
549 default: {
550 break; }
554 if (ndr_flags & NDR_BUFFERS) {
555 switch (level) {
556 case DECRPC_BIND_PROTOCOL_VERSION_NOT_SUPPORTED:
557 break;
559 default:
560 break;
564 return NDR_ERR_SUCCESS;
567 _PUBLIC_ void ndr_print_dcerpc_bind_nak_versions_ctr(struct ndr_print *ndr, const char *name, const union dcerpc_bind_nak_versions_ctr *r)
569 int level;
570 level = ndr_print_get_switch_value(ndr, r);
571 ndr_print_union(ndr, name, level, "dcerpc_bind_nak_versions_ctr");
572 switch (level) {
573 case DECRPC_BIND_PROTOCOL_VERSION_NOT_SUPPORTED:
574 ndr_print_dcerpc_bind_nak_versions(ndr, "v", &r->v);
575 break;
577 default:
578 break;
583 static enum ndr_err_code ndr_push_dcerpc_bind_nak(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_bind_nak *r)
585 if (ndr_flags & NDR_SCALARS) {
586 NDR_CHECK(ndr_push_align(ndr, 4));
587 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->reject_reason));
588 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->versions, r->reject_reason));
589 NDR_CHECK(ndr_push_dcerpc_bind_nak_versions_ctr(ndr, NDR_SCALARS, &r->versions));
591 if (ndr_flags & NDR_BUFFERS) {
592 NDR_CHECK(ndr_push_dcerpc_bind_nak_versions_ctr(ndr, NDR_BUFFERS, &r->versions));
594 return NDR_ERR_SUCCESS;
597 static enum ndr_err_code ndr_pull_dcerpc_bind_nak(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_bind_nak *r)
599 if (ndr_flags & NDR_SCALARS) {
600 NDR_CHECK(ndr_pull_align(ndr, 4));
601 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->reject_reason));
602 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->versions, r->reject_reason));
603 NDR_CHECK(ndr_pull_dcerpc_bind_nak_versions_ctr(ndr, NDR_SCALARS, &r->versions));
605 if (ndr_flags & NDR_BUFFERS) {
606 NDR_CHECK(ndr_pull_dcerpc_bind_nak_versions_ctr(ndr, NDR_BUFFERS, &r->versions));
608 return NDR_ERR_SUCCESS;
611 _PUBLIC_ void ndr_print_dcerpc_bind_nak(struct ndr_print *ndr, const char *name, const struct dcerpc_bind_nak *r)
613 ndr_print_struct(ndr, name, "dcerpc_bind_nak");
614 ndr->depth++;
615 ndr_print_uint16(ndr, "reject_reason", r->reject_reason);
616 ndr_print_set_switch_value(ndr, &r->versions, r->reject_reason);
617 ndr_print_dcerpc_bind_nak_versions_ctr(ndr, "versions", &r->versions);
618 ndr->depth--;
621 static enum ndr_err_code ndr_push_dcerpc_response(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_response *r)
623 if (ndr_flags & NDR_SCALARS) {
624 NDR_CHECK(ndr_push_align(ndr, 4));
625 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->alloc_hint));
626 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->context_id));
627 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->cancel_count));
629 uint32_t _flags_save_DATA_BLOB = ndr->flags;
630 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN8);
631 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->_pad));
632 ndr->flags = _flags_save_DATA_BLOB;
635 uint32_t _flags_save_DATA_BLOB = ndr->flags;
636 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
637 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->stub_and_verifier));
638 ndr->flags = _flags_save_DATA_BLOB;
641 if (ndr_flags & NDR_BUFFERS) {
643 return NDR_ERR_SUCCESS;
646 static enum ndr_err_code ndr_pull_dcerpc_response(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_response *r)
648 if (ndr_flags & NDR_SCALARS) {
649 NDR_CHECK(ndr_pull_align(ndr, 4));
650 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->alloc_hint));
651 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->context_id));
652 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->cancel_count));
654 uint32_t _flags_save_DATA_BLOB = ndr->flags;
655 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN8);
656 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->_pad));
657 ndr->flags = _flags_save_DATA_BLOB;
660 uint32_t _flags_save_DATA_BLOB = ndr->flags;
661 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
662 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->stub_and_verifier));
663 ndr->flags = _flags_save_DATA_BLOB;
666 if (ndr_flags & NDR_BUFFERS) {
668 return NDR_ERR_SUCCESS;
671 _PUBLIC_ void ndr_print_dcerpc_response(struct ndr_print *ndr, const char *name, const struct dcerpc_response *r)
673 ndr_print_struct(ndr, name, "dcerpc_response");
674 ndr->depth++;
675 ndr_print_uint32(ndr, "alloc_hint", r->alloc_hint);
676 ndr_print_uint16(ndr, "context_id", r->context_id);
677 ndr_print_uint8(ndr, "cancel_count", r->cancel_count);
678 ndr_print_DATA_BLOB(ndr, "_pad", r->_pad);
679 ndr_print_DATA_BLOB(ndr, "stub_and_verifier", r->stub_and_verifier);
680 ndr->depth--;
683 static enum ndr_err_code ndr_push_dcerpc_fault(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_fault *r)
685 if (ndr_flags & NDR_SCALARS) {
686 NDR_CHECK(ndr_push_align(ndr, 4));
687 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->alloc_hint));
688 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->context_id));
689 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->cancel_count));
690 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->status));
692 uint32_t _flags_save_DATA_BLOB = ndr->flags;
693 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
694 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->_pad));
695 ndr->flags = _flags_save_DATA_BLOB;
698 if (ndr_flags & NDR_BUFFERS) {
700 return NDR_ERR_SUCCESS;
703 static enum ndr_err_code ndr_pull_dcerpc_fault(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_fault *r)
705 if (ndr_flags & NDR_SCALARS) {
706 NDR_CHECK(ndr_pull_align(ndr, 4));
707 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->alloc_hint));
708 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->context_id));
709 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->cancel_count));
710 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->status));
712 uint32_t _flags_save_DATA_BLOB = ndr->flags;
713 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
714 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->_pad));
715 ndr->flags = _flags_save_DATA_BLOB;
718 if (ndr_flags & NDR_BUFFERS) {
720 return NDR_ERR_SUCCESS;
723 _PUBLIC_ void ndr_print_dcerpc_fault(struct ndr_print *ndr, const char *name, const struct dcerpc_fault *r)
725 ndr_print_struct(ndr, name, "dcerpc_fault");
726 ndr->depth++;
727 ndr_print_uint32(ndr, "alloc_hint", r->alloc_hint);
728 ndr_print_uint16(ndr, "context_id", r->context_id);
729 ndr_print_uint8(ndr, "cancel_count", r->cancel_count);
730 ndr_print_uint32(ndr, "status", r->status);
731 ndr_print_DATA_BLOB(ndr, "_pad", r->_pad);
732 ndr->depth--;
735 static enum ndr_err_code ndr_push_dcerpc_AuthType(struct ndr_push *ndr, int ndr_flags, enum dcerpc_AuthType r)
737 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r));
738 return NDR_ERR_SUCCESS;
741 static enum ndr_err_code ndr_pull_dcerpc_AuthType(struct ndr_pull *ndr, int ndr_flags, enum dcerpc_AuthType *r)
743 uint8_t v;
744 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &v));
745 *r = v;
746 return NDR_ERR_SUCCESS;
749 _PUBLIC_ void ndr_print_dcerpc_AuthType(struct ndr_print *ndr, const char *name, enum dcerpc_AuthType r)
751 const char *val = NULL;
753 switch (r) {
754 case DCERPC_AUTH_TYPE_NONE: val = "DCERPC_AUTH_TYPE_NONE"; break;
755 case DCERPC_AUTH_TYPE_KRB5_1: val = "DCERPC_AUTH_TYPE_KRB5_1"; break;
756 case DCERPC_AUTH_TYPE_SPNEGO: val = "DCERPC_AUTH_TYPE_SPNEGO"; break;
757 case DCERPC_AUTH_TYPE_NTLMSSP: val = "DCERPC_AUTH_TYPE_NTLMSSP"; break;
758 case DCERPC_AUTH_TYPE_KRB5: val = "DCERPC_AUTH_TYPE_KRB5"; break;
759 case DCERPC_AUTH_TYPE_DPA: val = "DCERPC_AUTH_TYPE_DPA"; break;
760 case DCERPC_AUTH_TYPE_MSN: val = "DCERPC_AUTH_TYPE_MSN"; break;
761 case DCERPC_AUTH_TYPE_DIGEST: val = "DCERPC_AUTH_TYPE_DIGEST"; break;
762 case DCERPC_AUTH_TYPE_SCHANNEL: val = "DCERPC_AUTH_TYPE_SCHANNEL"; break;
763 case DCERPC_AUTH_TYPE_MSMQ: val = "DCERPC_AUTH_TYPE_MSMQ"; break;
765 ndr_print_enum(ndr, name, "ENUM", val, r);
768 static enum ndr_err_code ndr_push_dcerpc_AuthLevel(struct ndr_push *ndr, int ndr_flags, enum dcerpc_AuthLevel r)
770 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r));
771 return NDR_ERR_SUCCESS;
774 static enum ndr_err_code ndr_pull_dcerpc_AuthLevel(struct ndr_pull *ndr, int ndr_flags, enum dcerpc_AuthLevel *r)
776 uint8_t v;
777 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &v));
778 *r = v;
779 return NDR_ERR_SUCCESS;
782 _PUBLIC_ void ndr_print_dcerpc_AuthLevel(struct ndr_print *ndr, const char *name, enum dcerpc_AuthLevel r)
784 const char *val = NULL;
786 switch (r) {
787 case DCERPC_AUTH_LEVEL_NONE: val = "DCERPC_AUTH_LEVEL_NONE"; break;
788 case DCERPC_AUTH_LEVEL_CONNECT: val = "DCERPC_AUTH_LEVEL_CONNECT"; break;
789 case DCERPC_AUTH_LEVEL_CALL: val = "DCERPC_AUTH_LEVEL_CALL"; break;
790 case DCERPC_AUTH_LEVEL_PACKET: val = "DCERPC_AUTH_LEVEL_PACKET"; break;
791 case DCERPC_AUTH_LEVEL_INTEGRITY: val = "DCERPC_AUTH_LEVEL_INTEGRITY"; break;
792 case DCERPC_AUTH_LEVEL_PRIVACY: val = "DCERPC_AUTH_LEVEL_PRIVACY"; break;
794 ndr_print_enum(ndr, name, "ENUM", val, r);
797 _PUBLIC_ enum ndr_err_code ndr_push_dcerpc_auth(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_auth *r)
799 if (ndr_flags & NDR_SCALARS) {
800 NDR_CHECK(ndr_push_align(ndr, 4));
801 NDR_CHECK(ndr_push_dcerpc_AuthType(ndr, NDR_SCALARS, r->auth_type));
802 NDR_CHECK(ndr_push_dcerpc_AuthLevel(ndr, NDR_SCALARS, r->auth_level));
803 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->auth_pad_length));
804 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->auth_reserved));
805 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->auth_context_id));
807 uint32_t _flags_save_DATA_BLOB = ndr->flags;
808 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
809 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->credentials));
810 ndr->flags = _flags_save_DATA_BLOB;
813 if (ndr_flags & NDR_BUFFERS) {
815 return NDR_ERR_SUCCESS;
818 _PUBLIC_ enum ndr_err_code ndr_pull_dcerpc_auth(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_auth *r)
820 if (ndr_flags & NDR_SCALARS) {
821 NDR_CHECK(ndr_pull_align(ndr, 4));
822 NDR_CHECK(ndr_pull_dcerpc_AuthType(ndr, NDR_SCALARS, &r->auth_type));
823 NDR_CHECK(ndr_pull_dcerpc_AuthLevel(ndr, NDR_SCALARS, &r->auth_level));
824 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->auth_pad_length));
825 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->auth_reserved));
826 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->auth_context_id));
828 uint32_t _flags_save_DATA_BLOB = ndr->flags;
829 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
830 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->credentials));
831 ndr->flags = _flags_save_DATA_BLOB;
834 if (ndr_flags & NDR_BUFFERS) {
836 return NDR_ERR_SUCCESS;
839 _PUBLIC_ void ndr_print_dcerpc_auth(struct ndr_print *ndr, const char *name, const struct dcerpc_auth *r)
841 ndr_print_struct(ndr, name, "dcerpc_auth");
842 ndr->depth++;
843 ndr_print_dcerpc_AuthType(ndr, "auth_type", r->auth_type);
844 ndr_print_dcerpc_AuthLevel(ndr, "auth_level", r->auth_level);
845 ndr_print_uint8(ndr, "auth_pad_length", r->auth_pad_length);
846 ndr_print_uint8(ndr, "auth_reserved", r->auth_reserved);
847 ndr_print_uint32(ndr, "auth_context_id", r->auth_context_id);
848 ndr_print_DATA_BLOB(ndr, "credentials", r->credentials);
849 ndr->depth--;
852 _PUBLIC_ enum ndr_err_code ndr_push_dcerpc_auth3(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_auth3 *r)
854 if (ndr_flags & NDR_SCALARS) {
855 NDR_CHECK(ndr_push_align(ndr, 4));
856 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->_pad));
858 uint32_t _flags_save_DATA_BLOB = ndr->flags;
859 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
860 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->auth_info));
861 ndr->flags = _flags_save_DATA_BLOB;
864 if (ndr_flags & NDR_BUFFERS) {
866 return NDR_ERR_SUCCESS;
869 _PUBLIC_ enum ndr_err_code ndr_pull_dcerpc_auth3(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_auth3 *r)
871 if (ndr_flags & NDR_SCALARS) {
872 NDR_CHECK(ndr_pull_align(ndr, 4));
873 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->_pad));
875 uint32_t _flags_save_DATA_BLOB = ndr->flags;
876 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
877 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->auth_info));
878 ndr->flags = _flags_save_DATA_BLOB;
881 if (ndr_flags & NDR_BUFFERS) {
883 return NDR_ERR_SUCCESS;
886 _PUBLIC_ void ndr_print_dcerpc_auth3(struct ndr_print *ndr, const char *name, const struct dcerpc_auth3 *r)
888 ndr_print_struct(ndr, name, "dcerpc_auth3");
889 ndr->depth++;
890 ndr_print_uint32(ndr, "_pad", r->_pad);
891 ndr_print_DATA_BLOB(ndr, "auth_info", r->auth_info);
892 ndr->depth--;
895 _PUBLIC_ enum ndr_err_code ndr_push_dcerpc_orphaned(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_orphaned *r)
897 if (ndr_flags & NDR_SCALARS) {
898 NDR_CHECK(ndr_push_align(ndr, 4));
899 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->_pad));
901 uint32_t _flags_save_DATA_BLOB = ndr->flags;
902 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
903 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->auth_info));
904 ndr->flags = _flags_save_DATA_BLOB;
907 if (ndr_flags & NDR_BUFFERS) {
909 return NDR_ERR_SUCCESS;
912 _PUBLIC_ enum ndr_err_code ndr_pull_dcerpc_orphaned(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_orphaned *r)
914 if (ndr_flags & NDR_SCALARS) {
915 NDR_CHECK(ndr_pull_align(ndr, 4));
916 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->_pad));
918 uint32_t _flags_save_DATA_BLOB = ndr->flags;
919 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
920 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->auth_info));
921 ndr->flags = _flags_save_DATA_BLOB;
924 if (ndr_flags & NDR_BUFFERS) {
926 return NDR_ERR_SUCCESS;
929 _PUBLIC_ void ndr_print_dcerpc_orphaned(struct ndr_print *ndr, const char *name, const struct dcerpc_orphaned *r)
931 ndr_print_struct(ndr, name, "dcerpc_orphaned");
932 ndr->depth++;
933 ndr_print_uint32(ndr, "_pad", r->_pad);
934 ndr_print_DATA_BLOB(ndr, "auth_info", r->auth_info);
935 ndr->depth--;
938 _PUBLIC_ enum ndr_err_code ndr_push_dcerpc_co_cancel(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_co_cancel *r)
940 if (ndr_flags & NDR_SCALARS) {
941 NDR_CHECK(ndr_push_align(ndr, 4));
942 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->_pad));
944 uint32_t _flags_save_DATA_BLOB = ndr->flags;
945 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
946 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->auth_info));
947 ndr->flags = _flags_save_DATA_BLOB;
950 if (ndr_flags & NDR_BUFFERS) {
952 return NDR_ERR_SUCCESS;
955 _PUBLIC_ enum ndr_err_code ndr_pull_dcerpc_co_cancel(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_co_cancel *r)
957 if (ndr_flags & NDR_SCALARS) {
958 NDR_CHECK(ndr_pull_align(ndr, 4));
959 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->_pad));
961 uint32_t _flags_save_DATA_BLOB = ndr->flags;
962 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
963 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->auth_info));
964 ndr->flags = _flags_save_DATA_BLOB;
967 if (ndr_flags & NDR_BUFFERS) {
969 return NDR_ERR_SUCCESS;
972 _PUBLIC_ void ndr_print_dcerpc_co_cancel(struct ndr_print *ndr, const char *name, const struct dcerpc_co_cancel *r)
974 ndr_print_struct(ndr, name, "dcerpc_co_cancel");
975 ndr->depth++;
976 ndr_print_uint32(ndr, "_pad", r->_pad);
977 ndr_print_DATA_BLOB(ndr, "auth_info", r->auth_info);
978 ndr->depth--;
981 _PUBLIC_ enum ndr_err_code ndr_push_dcerpc_cl_cancel(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_cl_cancel *r)
983 if (ndr_flags & NDR_SCALARS) {
984 NDR_CHECK(ndr_push_align(ndr, 4));
985 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version));
986 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->id));
988 if (ndr_flags & NDR_BUFFERS) {
990 return NDR_ERR_SUCCESS;
993 _PUBLIC_ enum ndr_err_code ndr_pull_dcerpc_cl_cancel(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_cl_cancel *r)
995 if (ndr_flags & NDR_SCALARS) {
996 NDR_CHECK(ndr_pull_align(ndr, 4));
997 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version));
998 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->id));
1000 if (ndr_flags & NDR_BUFFERS) {
1002 return NDR_ERR_SUCCESS;
1005 _PUBLIC_ void ndr_print_dcerpc_cl_cancel(struct ndr_print *ndr, const char *name, const struct dcerpc_cl_cancel *r)
1007 ndr_print_struct(ndr, name, "dcerpc_cl_cancel");
1008 ndr->depth++;
1009 ndr_print_uint32(ndr, "version", r->version);
1010 ndr_print_uint32(ndr, "id", r->id);
1011 ndr->depth--;
1014 _PUBLIC_ enum ndr_err_code ndr_push_dcerpc_cancel_ack(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_cancel_ack *r)
1016 if (ndr_flags & NDR_SCALARS) {
1017 NDR_CHECK(ndr_push_align(ndr, 4));
1018 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version));
1019 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->id));
1020 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->server_is_accepting));
1022 if (ndr_flags & NDR_BUFFERS) {
1024 return NDR_ERR_SUCCESS;
1027 _PUBLIC_ enum ndr_err_code ndr_pull_dcerpc_cancel_ack(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_cancel_ack *r)
1029 if (ndr_flags & NDR_SCALARS) {
1030 NDR_CHECK(ndr_pull_align(ndr, 4));
1031 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version));
1032 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->id));
1033 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->server_is_accepting));
1035 if (ndr_flags & NDR_BUFFERS) {
1037 return NDR_ERR_SUCCESS;
1040 _PUBLIC_ void ndr_print_dcerpc_cancel_ack(struct ndr_print *ndr, const char *name, const struct dcerpc_cancel_ack *r)
1042 ndr_print_struct(ndr, name, "dcerpc_cancel_ack");
1043 ndr->depth++;
1044 ndr_print_uint32(ndr, "version", r->version);
1045 ndr_print_uint32(ndr, "id", r->id);
1046 ndr_print_uint32(ndr, "server_is_accepting", r->server_is_accepting);
1047 ndr->depth--;
1050 _PUBLIC_ enum ndr_err_code ndr_push_dcerpc_fack(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_fack *r)
1052 uint32_t cntr_selack_0;
1053 if (ndr_flags & NDR_SCALARS) {
1054 NDR_CHECK(ndr_push_align(ndr, 4));
1055 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version));
1056 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->_pad1));
1057 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->window_size));
1058 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->max_tdsu));
1059 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->max_frag_size));
1060 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->serial_no));
1061 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->selack_size));
1062 for (cntr_selack_0 = 0; cntr_selack_0 < r->selack_size; cntr_selack_0++) {
1063 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->selack[cntr_selack_0]));
1066 if (ndr_flags & NDR_BUFFERS) {
1068 return NDR_ERR_SUCCESS;
1071 _PUBLIC_ enum ndr_err_code ndr_pull_dcerpc_fack(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_fack *r)
1073 uint32_t cntr_selack_0;
1074 TALLOC_CTX *_mem_save_selack_0;
1075 if (ndr_flags & NDR_SCALARS) {
1076 NDR_CHECK(ndr_pull_align(ndr, 4));
1077 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version));
1078 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->_pad1));
1079 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->window_size));
1080 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->max_tdsu));
1081 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->max_frag_size));
1082 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->serial_no));
1083 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->selack_size));
1084 NDR_PULL_ALLOC_N(ndr, r->selack, r->selack_size);
1085 _mem_save_selack_0 = NDR_PULL_GET_MEM_CTX(ndr);
1086 NDR_PULL_SET_MEM_CTX(ndr, r->selack, 0);
1087 for (cntr_selack_0 = 0; cntr_selack_0 < r->selack_size; cntr_selack_0++) {
1088 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->selack[cntr_selack_0]));
1090 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_selack_0, 0);
1092 if (ndr_flags & NDR_BUFFERS) {
1094 return NDR_ERR_SUCCESS;
1097 _PUBLIC_ void ndr_print_dcerpc_fack(struct ndr_print *ndr, const char *name, const struct dcerpc_fack *r)
1099 uint32_t cntr_selack_0;
1100 ndr_print_struct(ndr, name, "dcerpc_fack");
1101 ndr->depth++;
1102 ndr_print_uint32(ndr, "version", r->version);
1103 ndr_print_uint8(ndr, "_pad1", r->_pad1);
1104 ndr_print_uint16(ndr, "window_size", r->window_size);
1105 ndr_print_uint32(ndr, "max_tdsu", r->max_tdsu);
1106 ndr_print_uint32(ndr, "max_frag_size", r->max_frag_size);
1107 ndr_print_uint16(ndr, "serial_no", r->serial_no);
1108 ndr_print_uint16(ndr, "selack_size", r->selack_size);
1109 ndr->print(ndr, "%s: ARRAY(%d)", "selack", (int)r->selack_size);
1110 ndr->depth++;
1111 for (cntr_selack_0=0;cntr_selack_0<r->selack_size;cntr_selack_0++) {
1112 char *idx_0=NULL;
1113 if (asprintf(&idx_0, "[%d]", cntr_selack_0) != -1) {
1114 ndr_print_uint32(ndr, "selack", r->selack[cntr_selack_0]);
1115 free(idx_0);
1118 ndr->depth--;
1119 ndr->depth--;
1122 _PUBLIC_ enum ndr_err_code ndr_push_dcerpc_ack(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_ack *r)
1124 if (ndr_flags & NDR_SCALARS) {
1125 NDR_CHECK(ndr_push_align(ndr, 1));
1127 if (ndr_flags & NDR_BUFFERS) {
1129 return NDR_ERR_SUCCESS;
1132 _PUBLIC_ enum ndr_err_code ndr_pull_dcerpc_ack(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_ack *r)
1134 if (ndr_flags & NDR_SCALARS) {
1135 NDR_CHECK(ndr_pull_align(ndr, 1));
1137 if (ndr_flags & NDR_BUFFERS) {
1139 return NDR_ERR_SUCCESS;
1142 _PUBLIC_ void ndr_print_dcerpc_ack(struct ndr_print *ndr, const char *name, const struct dcerpc_ack *r)
1144 ndr_print_struct(ndr, name, "dcerpc_ack");
1145 ndr->depth++;
1146 ndr->depth--;
1149 _PUBLIC_ enum ndr_err_code ndr_push_dcerpc_ping(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_ping *r)
1151 if (ndr_flags & NDR_SCALARS) {
1152 NDR_CHECK(ndr_push_align(ndr, 1));
1154 if (ndr_flags & NDR_BUFFERS) {
1156 return NDR_ERR_SUCCESS;
1159 _PUBLIC_ enum ndr_err_code ndr_pull_dcerpc_ping(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_ping *r)
1161 if (ndr_flags & NDR_SCALARS) {
1162 NDR_CHECK(ndr_pull_align(ndr, 1));
1164 if (ndr_flags & NDR_BUFFERS) {
1166 return NDR_ERR_SUCCESS;
1169 _PUBLIC_ void ndr_print_dcerpc_ping(struct ndr_print *ndr, const char *name, const struct dcerpc_ping *r)
1171 ndr_print_struct(ndr, name, "dcerpc_ping");
1172 ndr->depth++;
1173 ndr->depth--;
1176 _PUBLIC_ enum ndr_err_code ndr_push_dcerpc_shutdown(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_shutdown *r)
1178 if (ndr_flags & NDR_SCALARS) {
1179 NDR_CHECK(ndr_push_align(ndr, 1));
1181 if (ndr_flags & NDR_BUFFERS) {
1183 return NDR_ERR_SUCCESS;
1186 _PUBLIC_ enum ndr_err_code ndr_pull_dcerpc_shutdown(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_shutdown *r)
1188 if (ndr_flags & NDR_SCALARS) {
1189 NDR_CHECK(ndr_pull_align(ndr, 1));
1191 if (ndr_flags & NDR_BUFFERS) {
1193 return NDR_ERR_SUCCESS;
1196 _PUBLIC_ void ndr_print_dcerpc_shutdown(struct ndr_print *ndr, const char *name, const struct dcerpc_shutdown *r)
1198 ndr_print_struct(ndr, name, "dcerpc_shutdown");
1199 ndr->depth++;
1200 ndr->depth--;
1203 _PUBLIC_ enum ndr_err_code ndr_push_dcerpc_working(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_working *r)
1205 if (ndr_flags & NDR_SCALARS) {
1206 NDR_CHECK(ndr_push_align(ndr, 1));
1208 if (ndr_flags & NDR_BUFFERS) {
1210 return NDR_ERR_SUCCESS;
1213 _PUBLIC_ enum ndr_err_code ndr_pull_dcerpc_working(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_working *r)
1215 if (ndr_flags & NDR_SCALARS) {
1216 NDR_CHECK(ndr_pull_align(ndr, 1));
1218 if (ndr_flags & NDR_BUFFERS) {
1220 return NDR_ERR_SUCCESS;
1223 _PUBLIC_ void ndr_print_dcerpc_working(struct ndr_print *ndr, const char *name, const struct dcerpc_working *r)
1225 ndr_print_struct(ndr, name, "dcerpc_working");
1226 ndr->depth++;
1227 ndr->depth--;
1230 static enum ndr_err_code ndr_push_dcerpc_pkt_type(struct ndr_push *ndr, int ndr_flags, enum dcerpc_pkt_type r)
1232 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r));
1233 return NDR_ERR_SUCCESS;
1236 static enum ndr_err_code ndr_pull_dcerpc_pkt_type(struct ndr_pull *ndr, int ndr_flags, enum dcerpc_pkt_type *r)
1238 uint8_t v;
1239 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &v));
1240 *r = v;
1241 return NDR_ERR_SUCCESS;
1244 _PUBLIC_ void ndr_print_dcerpc_pkt_type(struct ndr_print *ndr, const char *name, enum dcerpc_pkt_type r)
1246 const char *val = NULL;
1248 switch (r) {
1249 case DCERPC_PKT_REQUEST: val = "DCERPC_PKT_REQUEST"; break;
1250 case DCERPC_PKT_PING: val = "DCERPC_PKT_PING"; break;
1251 case DCERPC_PKT_RESPONSE: val = "DCERPC_PKT_RESPONSE"; break;
1252 case DCERPC_PKT_FAULT: val = "DCERPC_PKT_FAULT"; break;
1253 case DCERPC_PKT_WORKING: val = "DCERPC_PKT_WORKING"; break;
1254 case DCERPC_PKT_NOCALL: val = "DCERPC_PKT_NOCALL"; break;
1255 case DCERPC_PKT_REJECT: val = "DCERPC_PKT_REJECT"; break;
1256 case DCERPC_PKT_ACK: val = "DCERPC_PKT_ACK"; break;
1257 case DCERPC_PKT_CL_CANCEL: val = "DCERPC_PKT_CL_CANCEL"; break;
1258 case DCERPC_PKT_FACK: val = "DCERPC_PKT_FACK"; break;
1259 case DCERPC_PKT_CANCEL_ACK: val = "DCERPC_PKT_CANCEL_ACK"; break;
1260 case DCERPC_PKT_BIND: val = "DCERPC_PKT_BIND"; break;
1261 case DCERPC_PKT_BIND_ACK: val = "DCERPC_PKT_BIND_ACK"; break;
1262 case DCERPC_PKT_BIND_NAK: val = "DCERPC_PKT_BIND_NAK"; break;
1263 case DCERPC_PKT_ALTER: val = "DCERPC_PKT_ALTER"; break;
1264 case DCERPC_PKT_ALTER_RESP: val = "DCERPC_PKT_ALTER_RESP"; break;
1265 case DCERPC_PKT_AUTH3: val = "DCERPC_PKT_AUTH3"; break;
1266 case DCERPC_PKT_SHUTDOWN: val = "DCERPC_PKT_SHUTDOWN"; break;
1267 case DCERPC_PKT_CO_CANCEL: val = "DCERPC_PKT_CO_CANCEL"; break;
1268 case DCERPC_PKT_ORPHANED: val = "DCERPC_PKT_ORPHANED"; break;
1270 ndr_print_enum(ndr, name, "ENUM", val, r);
1273 static enum ndr_err_code ndr_push_dcerpc_payload(struct ndr_push *ndr, int ndr_flags, const union dcerpc_payload *r)
1275 if (ndr_flags & NDR_SCALARS) {
1276 int level = ndr_push_get_switch_value(ndr, r);
1277 switch (level) {
1278 case DCERPC_PKT_REQUEST: {
1279 NDR_CHECK(ndr_push_dcerpc_request(ndr, NDR_SCALARS, &r->request));
1280 break; }
1282 case DCERPC_PKT_PING: {
1283 NDR_CHECK(ndr_push_dcerpc_ping(ndr, NDR_SCALARS, &r->ping));
1284 break; }
1286 case DCERPC_PKT_RESPONSE: {
1287 NDR_CHECK(ndr_push_dcerpc_response(ndr, NDR_SCALARS, &r->response));
1288 break; }
1290 case DCERPC_PKT_FAULT: {
1291 NDR_CHECK(ndr_push_dcerpc_fault(ndr, NDR_SCALARS, &r->fault));
1292 break; }
1294 case DCERPC_PKT_WORKING: {
1295 NDR_CHECK(ndr_push_dcerpc_working(ndr, NDR_SCALARS, &r->working));
1296 break; }
1298 case DCERPC_PKT_NOCALL: {
1299 NDR_CHECK(ndr_push_dcerpc_fack(ndr, NDR_SCALARS, &r->nocall));
1300 break; }
1302 case DCERPC_PKT_REJECT: {
1303 NDR_CHECK(ndr_push_dcerpc_fault(ndr, NDR_SCALARS, &r->reject));
1304 break; }
1306 case DCERPC_PKT_ACK: {
1307 NDR_CHECK(ndr_push_dcerpc_ack(ndr, NDR_SCALARS, &r->ack));
1308 break; }
1310 case DCERPC_PKT_CL_CANCEL: {
1311 NDR_CHECK(ndr_push_dcerpc_cl_cancel(ndr, NDR_SCALARS, &r->cl_cancel));
1312 break; }
1314 case DCERPC_PKT_FACK: {
1315 NDR_CHECK(ndr_push_dcerpc_fack(ndr, NDR_SCALARS, &r->fack));
1316 break; }
1318 case DCERPC_PKT_CANCEL_ACK: {
1319 NDR_CHECK(ndr_push_dcerpc_cancel_ack(ndr, NDR_SCALARS, &r->cancel_ack));
1320 break; }
1322 case DCERPC_PKT_BIND: {
1323 NDR_CHECK(ndr_push_dcerpc_bind(ndr, NDR_SCALARS, &r->bind));
1324 break; }
1326 case DCERPC_PKT_BIND_ACK: {
1327 NDR_CHECK(ndr_push_dcerpc_bind_ack(ndr, NDR_SCALARS, &r->bind_ack));
1328 break; }
1330 case DCERPC_PKT_BIND_NAK: {
1331 NDR_CHECK(ndr_push_dcerpc_bind_nak(ndr, NDR_SCALARS, &r->bind_nak));
1332 break; }
1334 case DCERPC_PKT_ALTER: {
1335 NDR_CHECK(ndr_push_dcerpc_bind(ndr, NDR_SCALARS, &r->alter));
1336 break; }
1338 case DCERPC_PKT_ALTER_RESP: {
1339 NDR_CHECK(ndr_push_dcerpc_bind_ack(ndr, NDR_SCALARS, &r->alter_resp));
1340 break; }
1342 case DCERPC_PKT_SHUTDOWN: {
1343 NDR_CHECK(ndr_push_dcerpc_shutdown(ndr, NDR_SCALARS, &r->shutdown));
1344 break; }
1346 case DCERPC_PKT_CO_CANCEL: {
1347 NDR_CHECK(ndr_push_dcerpc_co_cancel(ndr, NDR_SCALARS, &r->co_cancel));
1348 break; }
1350 case DCERPC_PKT_ORPHANED: {
1351 NDR_CHECK(ndr_push_dcerpc_orphaned(ndr, NDR_SCALARS, &r->orphaned));
1352 break; }
1354 case DCERPC_PKT_AUTH3: {
1355 NDR_CHECK(ndr_push_dcerpc_auth3(ndr, NDR_SCALARS, &r->auth3));
1356 break; }
1358 default:
1359 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
1362 if (ndr_flags & NDR_BUFFERS) {
1363 int level = ndr_push_get_switch_value(ndr, r);
1364 switch (level) {
1365 case DCERPC_PKT_REQUEST:
1366 break;
1368 case DCERPC_PKT_PING:
1369 break;
1371 case DCERPC_PKT_RESPONSE:
1372 break;
1374 case DCERPC_PKT_FAULT:
1375 break;
1377 case DCERPC_PKT_WORKING:
1378 break;
1380 case DCERPC_PKT_NOCALL:
1381 break;
1383 case DCERPC_PKT_REJECT:
1384 break;
1386 case DCERPC_PKT_ACK:
1387 break;
1389 case DCERPC_PKT_CL_CANCEL:
1390 break;
1392 case DCERPC_PKT_FACK:
1393 break;
1395 case DCERPC_PKT_CANCEL_ACK:
1396 break;
1398 case DCERPC_PKT_BIND:
1399 break;
1401 case DCERPC_PKT_BIND_ACK:
1402 break;
1404 case DCERPC_PKT_BIND_NAK:
1405 NDR_CHECK(ndr_push_dcerpc_bind_nak(ndr, NDR_BUFFERS, &r->bind_nak));
1406 break;
1408 case DCERPC_PKT_ALTER:
1409 break;
1411 case DCERPC_PKT_ALTER_RESP:
1412 break;
1414 case DCERPC_PKT_SHUTDOWN:
1415 break;
1417 case DCERPC_PKT_CO_CANCEL:
1418 break;
1420 case DCERPC_PKT_ORPHANED:
1421 break;
1423 case DCERPC_PKT_AUTH3:
1424 break;
1426 default:
1427 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
1430 return NDR_ERR_SUCCESS;
1433 static enum ndr_err_code ndr_pull_dcerpc_payload(struct ndr_pull *ndr, int ndr_flags, union dcerpc_payload *r)
1435 int level;
1436 level = ndr_pull_get_switch_value(ndr, r);
1437 if (ndr_flags & NDR_SCALARS) {
1438 switch (level) {
1439 case DCERPC_PKT_REQUEST: {
1440 NDR_CHECK(ndr_pull_dcerpc_request(ndr, NDR_SCALARS, &r->request));
1441 break; }
1443 case DCERPC_PKT_PING: {
1444 NDR_CHECK(ndr_pull_dcerpc_ping(ndr, NDR_SCALARS, &r->ping));
1445 break; }
1447 case DCERPC_PKT_RESPONSE: {
1448 NDR_CHECK(ndr_pull_dcerpc_response(ndr, NDR_SCALARS, &r->response));
1449 break; }
1451 case DCERPC_PKT_FAULT: {
1452 NDR_CHECK(ndr_pull_dcerpc_fault(ndr, NDR_SCALARS, &r->fault));
1453 break; }
1455 case DCERPC_PKT_WORKING: {
1456 NDR_CHECK(ndr_pull_dcerpc_working(ndr, NDR_SCALARS, &r->working));
1457 break; }
1459 case DCERPC_PKT_NOCALL: {
1460 NDR_CHECK(ndr_pull_dcerpc_fack(ndr, NDR_SCALARS, &r->nocall));
1461 break; }
1463 case DCERPC_PKT_REJECT: {
1464 NDR_CHECK(ndr_pull_dcerpc_fault(ndr, NDR_SCALARS, &r->reject));
1465 break; }
1467 case DCERPC_PKT_ACK: {
1468 NDR_CHECK(ndr_pull_dcerpc_ack(ndr, NDR_SCALARS, &r->ack));
1469 break; }
1471 case DCERPC_PKT_CL_CANCEL: {
1472 NDR_CHECK(ndr_pull_dcerpc_cl_cancel(ndr, NDR_SCALARS, &r->cl_cancel));
1473 break; }
1475 case DCERPC_PKT_FACK: {
1476 NDR_CHECK(ndr_pull_dcerpc_fack(ndr, NDR_SCALARS, &r->fack));
1477 break; }
1479 case DCERPC_PKT_CANCEL_ACK: {
1480 NDR_CHECK(ndr_pull_dcerpc_cancel_ack(ndr, NDR_SCALARS, &r->cancel_ack));
1481 break; }
1483 case DCERPC_PKT_BIND: {
1484 NDR_CHECK(ndr_pull_dcerpc_bind(ndr, NDR_SCALARS, &r->bind));
1485 break; }
1487 case DCERPC_PKT_BIND_ACK: {
1488 NDR_CHECK(ndr_pull_dcerpc_bind_ack(ndr, NDR_SCALARS, &r->bind_ack));
1489 break; }
1491 case DCERPC_PKT_BIND_NAK: {
1492 NDR_CHECK(ndr_pull_dcerpc_bind_nak(ndr, NDR_SCALARS, &r->bind_nak));
1493 break; }
1495 case DCERPC_PKT_ALTER: {
1496 NDR_CHECK(ndr_pull_dcerpc_bind(ndr, NDR_SCALARS, &r->alter));
1497 break; }
1499 case DCERPC_PKT_ALTER_RESP: {
1500 NDR_CHECK(ndr_pull_dcerpc_bind_ack(ndr, NDR_SCALARS, &r->alter_resp));
1501 break; }
1503 case DCERPC_PKT_SHUTDOWN: {
1504 NDR_CHECK(ndr_pull_dcerpc_shutdown(ndr, NDR_SCALARS, &r->shutdown));
1505 break; }
1507 case DCERPC_PKT_CO_CANCEL: {
1508 NDR_CHECK(ndr_pull_dcerpc_co_cancel(ndr, NDR_SCALARS, &r->co_cancel));
1509 break; }
1511 case DCERPC_PKT_ORPHANED: {
1512 NDR_CHECK(ndr_pull_dcerpc_orphaned(ndr, NDR_SCALARS, &r->orphaned));
1513 break; }
1515 case DCERPC_PKT_AUTH3: {
1516 NDR_CHECK(ndr_pull_dcerpc_auth3(ndr, NDR_SCALARS, &r->auth3));
1517 break; }
1519 default:
1520 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
1523 if (ndr_flags & NDR_BUFFERS) {
1524 switch (level) {
1525 case DCERPC_PKT_REQUEST:
1526 break;
1528 case DCERPC_PKT_PING:
1529 break;
1531 case DCERPC_PKT_RESPONSE:
1532 break;
1534 case DCERPC_PKT_FAULT:
1535 break;
1537 case DCERPC_PKT_WORKING:
1538 break;
1540 case DCERPC_PKT_NOCALL:
1541 break;
1543 case DCERPC_PKT_REJECT:
1544 break;
1546 case DCERPC_PKT_ACK:
1547 break;
1549 case DCERPC_PKT_CL_CANCEL:
1550 break;
1552 case DCERPC_PKT_FACK:
1553 break;
1555 case DCERPC_PKT_CANCEL_ACK:
1556 break;
1558 case DCERPC_PKT_BIND:
1559 break;
1561 case DCERPC_PKT_BIND_ACK:
1562 break;
1564 case DCERPC_PKT_BIND_NAK:
1565 NDR_CHECK(ndr_pull_dcerpc_bind_nak(ndr, NDR_BUFFERS, &r->bind_nak));
1566 break;
1568 case DCERPC_PKT_ALTER:
1569 break;
1571 case DCERPC_PKT_ALTER_RESP:
1572 break;
1574 case DCERPC_PKT_SHUTDOWN:
1575 break;
1577 case DCERPC_PKT_CO_CANCEL:
1578 break;
1580 case DCERPC_PKT_ORPHANED:
1581 break;
1583 case DCERPC_PKT_AUTH3:
1584 break;
1586 default:
1587 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
1590 return NDR_ERR_SUCCESS;
1593 _PUBLIC_ void ndr_print_dcerpc_payload(struct ndr_print *ndr, const char *name, const union dcerpc_payload *r)
1595 int level;
1596 level = ndr_print_get_switch_value(ndr, r);
1597 ndr_print_union(ndr, name, level, "dcerpc_payload");
1598 switch (level) {
1599 case DCERPC_PKT_REQUEST:
1600 ndr_print_dcerpc_request(ndr, "request", &r->request);
1601 break;
1603 case DCERPC_PKT_PING:
1604 ndr_print_dcerpc_ping(ndr, "ping", &r->ping);
1605 break;
1607 case DCERPC_PKT_RESPONSE:
1608 ndr_print_dcerpc_response(ndr, "response", &r->response);
1609 break;
1611 case DCERPC_PKT_FAULT:
1612 ndr_print_dcerpc_fault(ndr, "fault", &r->fault);
1613 break;
1615 case DCERPC_PKT_WORKING:
1616 ndr_print_dcerpc_working(ndr, "working", &r->working);
1617 break;
1619 case DCERPC_PKT_NOCALL:
1620 ndr_print_dcerpc_fack(ndr, "nocall", &r->nocall);
1621 break;
1623 case DCERPC_PKT_REJECT:
1624 ndr_print_dcerpc_fault(ndr, "reject", &r->reject);
1625 break;
1627 case DCERPC_PKT_ACK:
1628 ndr_print_dcerpc_ack(ndr, "ack", &r->ack);
1629 break;
1631 case DCERPC_PKT_CL_CANCEL:
1632 ndr_print_dcerpc_cl_cancel(ndr, "cl_cancel", &r->cl_cancel);
1633 break;
1635 case DCERPC_PKT_FACK:
1636 ndr_print_dcerpc_fack(ndr, "fack", &r->fack);
1637 break;
1639 case DCERPC_PKT_CANCEL_ACK:
1640 ndr_print_dcerpc_cancel_ack(ndr, "cancel_ack", &r->cancel_ack);
1641 break;
1643 case DCERPC_PKT_BIND:
1644 ndr_print_dcerpc_bind(ndr, "bind", &r->bind);
1645 break;
1647 case DCERPC_PKT_BIND_ACK:
1648 ndr_print_dcerpc_bind_ack(ndr, "bind_ack", &r->bind_ack);
1649 break;
1651 case DCERPC_PKT_BIND_NAK:
1652 ndr_print_dcerpc_bind_nak(ndr, "bind_nak", &r->bind_nak);
1653 break;
1655 case DCERPC_PKT_ALTER:
1656 ndr_print_dcerpc_bind(ndr, "alter", &r->alter);
1657 break;
1659 case DCERPC_PKT_ALTER_RESP:
1660 ndr_print_dcerpc_bind_ack(ndr, "alter_resp", &r->alter_resp);
1661 break;
1663 case DCERPC_PKT_SHUTDOWN:
1664 ndr_print_dcerpc_shutdown(ndr, "shutdown", &r->shutdown);
1665 break;
1667 case DCERPC_PKT_CO_CANCEL:
1668 ndr_print_dcerpc_co_cancel(ndr, "co_cancel", &r->co_cancel);
1669 break;
1671 case DCERPC_PKT_ORPHANED:
1672 ndr_print_dcerpc_orphaned(ndr, "orphaned", &r->orphaned);
1673 break;
1675 case DCERPC_PKT_AUTH3:
1676 ndr_print_dcerpc_auth3(ndr, "auth3", &r->auth3);
1677 break;
1679 default:
1680 ndr_print_bad_level(ndr, name, level);
1684 _PUBLIC_ enum ndr_err_code ndr_push_ncacn_packet(struct ndr_push *ndr, int ndr_flags, const struct ncacn_packet *r)
1686 if (ndr_flags & NDR_SCALARS) {
1687 NDR_CHECK(ndr_push_align(ndr, 4));
1688 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->rpc_vers));
1689 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->rpc_vers_minor));
1690 NDR_CHECK(ndr_push_dcerpc_pkt_type(ndr, NDR_SCALARS, r->ptype));
1691 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->pfc_flags));
1692 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->drep, 4));
1693 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->frag_length));
1694 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->auth_length));
1695 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->call_id));
1696 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->u, r->ptype));
1697 NDR_CHECK(ndr_push_dcerpc_payload(ndr, NDR_SCALARS, &r->u));
1699 if (ndr_flags & NDR_BUFFERS) {
1700 NDR_CHECK(ndr_push_dcerpc_payload(ndr, NDR_BUFFERS, &r->u));
1702 return NDR_ERR_SUCCESS;
1705 _PUBLIC_ enum ndr_err_code ndr_pull_ncacn_packet(struct ndr_pull *ndr, int ndr_flags, struct ncacn_packet *r)
1707 if (ndr_flags & NDR_SCALARS) {
1708 NDR_CHECK(ndr_pull_align(ndr, 4));
1709 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->rpc_vers));
1710 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->rpc_vers_minor));
1711 NDR_CHECK(ndr_pull_dcerpc_pkt_type(ndr, NDR_SCALARS, &r->ptype));
1712 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->pfc_flags));
1713 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->drep, 4));
1714 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->frag_length));
1715 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->auth_length));
1716 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->call_id));
1717 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->u, r->ptype));
1718 NDR_CHECK(ndr_pull_dcerpc_payload(ndr, NDR_SCALARS, &r->u));
1720 if (ndr_flags & NDR_BUFFERS) {
1721 NDR_CHECK(ndr_pull_dcerpc_payload(ndr, NDR_BUFFERS, &r->u));
1723 return NDR_ERR_SUCCESS;
1726 _PUBLIC_ void ndr_print_ncacn_packet(struct ndr_print *ndr, const char *name, const struct ncacn_packet *r)
1728 ndr_print_struct(ndr, name, "ncacn_packet");
1729 ndr->depth++;
1730 ndr_print_uint8(ndr, "rpc_vers", r->rpc_vers);
1731 ndr_print_uint8(ndr, "rpc_vers_minor", r->rpc_vers_minor);
1732 ndr_print_dcerpc_pkt_type(ndr, "ptype", r->ptype);
1733 ndr_print_uint8(ndr, "pfc_flags", r->pfc_flags);
1734 ndr_print_array_uint8(ndr, "drep", r->drep, 4);
1735 ndr_print_uint16(ndr, "frag_length", r->frag_length);
1736 ndr_print_uint16(ndr, "auth_length", r->auth_length);
1737 ndr_print_uint32(ndr, "call_id", r->call_id);
1738 ndr_print_set_switch_value(ndr, &r->u, r->ptype);
1739 ndr_print_dcerpc_payload(ndr, "u", &r->u);
1740 ndr->depth--;
1743 _PUBLIC_ enum ndr_err_code ndr_push_ncadg_packet(struct ndr_push *ndr, int ndr_flags, const struct ncadg_packet *r)
1745 if (ndr_flags & NDR_SCALARS) {
1746 NDR_CHECK(ndr_push_align(ndr, 4));
1747 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->rpc_vers));
1748 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->ptype));
1749 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->pfc_flags));
1750 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->ncadg_flags));
1751 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->drep, 3));
1752 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->serial_high));
1753 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->object));
1754 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->iface));
1755 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->activity));
1756 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->server_boot));
1757 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->iface_version));
1758 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->seq_num));
1759 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->opnum));
1760 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->ihint));
1761 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->ahint));
1762 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->len));
1763 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->fragnum));
1764 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->auth_proto));
1765 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->serial_low));
1766 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->u, r->ptype));
1767 NDR_CHECK(ndr_push_dcerpc_payload(ndr, NDR_SCALARS, &r->u));
1769 if (ndr_flags & NDR_BUFFERS) {
1770 NDR_CHECK(ndr_push_dcerpc_payload(ndr, NDR_BUFFERS, &r->u));
1772 return NDR_ERR_SUCCESS;
1775 _PUBLIC_ enum ndr_err_code ndr_pull_ncadg_packet(struct ndr_pull *ndr, int ndr_flags, struct ncadg_packet *r)
1777 if (ndr_flags & NDR_SCALARS) {
1778 NDR_CHECK(ndr_pull_align(ndr, 4));
1779 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->rpc_vers));
1780 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->ptype));
1781 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->pfc_flags));
1782 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->ncadg_flags));
1783 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->drep, 3));
1784 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->serial_high));
1785 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->object));
1786 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->iface));
1787 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->activity));
1788 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->server_boot));
1789 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->iface_version));
1790 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->seq_num));
1791 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->opnum));
1792 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->ihint));
1793 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->ahint));
1794 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->len));
1795 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->fragnum));
1796 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->auth_proto));
1797 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->serial_low));
1798 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->u, r->ptype));
1799 NDR_CHECK(ndr_pull_dcerpc_payload(ndr, NDR_SCALARS, &r->u));
1801 if (ndr_flags & NDR_BUFFERS) {
1802 NDR_CHECK(ndr_pull_dcerpc_payload(ndr, NDR_BUFFERS, &r->u));
1804 return NDR_ERR_SUCCESS;
1807 _PUBLIC_ void ndr_print_ncadg_packet(struct ndr_print *ndr, const char *name, const struct ncadg_packet *r)
1809 ndr_print_struct(ndr, name, "ncadg_packet");
1810 ndr->depth++;
1811 ndr_print_uint8(ndr, "rpc_vers", r->rpc_vers);
1812 ndr_print_uint8(ndr, "ptype", r->ptype);
1813 ndr_print_uint8(ndr, "pfc_flags", r->pfc_flags);
1814 ndr_print_uint8(ndr, "ncadg_flags", r->ncadg_flags);
1815 ndr_print_array_uint8(ndr, "drep", r->drep, 3);
1816 ndr_print_uint8(ndr, "serial_high", r->serial_high);
1817 ndr_print_GUID(ndr, "object", &r->object);
1818 ndr_print_GUID(ndr, "iface", &r->iface);
1819 ndr_print_GUID(ndr, "activity", &r->activity);
1820 ndr_print_uint32(ndr, "server_boot", r->server_boot);
1821 ndr_print_uint32(ndr, "iface_version", r->iface_version);
1822 ndr_print_uint32(ndr, "seq_num", r->seq_num);
1823 ndr_print_uint16(ndr, "opnum", r->opnum);
1824 ndr_print_uint16(ndr, "ihint", r->ihint);
1825 ndr_print_uint16(ndr, "ahint", r->ahint);
1826 ndr_print_uint16(ndr, "len", r->len);
1827 ndr_print_uint16(ndr, "fragnum", r->fragnum);
1828 ndr_print_uint8(ndr, "auth_proto", r->auth_proto);
1829 ndr_print_uint8(ndr, "serial_low", r->serial_low);
1830 ndr_print_set_switch_value(ndr, &r->u, r->ptype);
1831 ndr_print_dcerpc_payload(ndr, "u", &r->u);
1832 ndr->depth--;