s3: add generated dcerpc files.
[ira/wip.git] / librpc / gen_ndr / ndr_dcerpc.c
1 /* parser auto-generated by pidl */
2
3 #include "includes.h"
4 #include "../librpc/gen_ndr/ndr_dcerpc.h"
5
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)
8 {
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]));
17                 }
18         }
19         if (ndr_flags & NDR_BUFFERS) {
20         }
21         return NDR_ERR_SUCCESS;
22 }
23
24 static enum ndr_err_code ndr_pull_dcerpc_ctx_list(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_ctx_list *r)
25 {
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]));
38                 }
39                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_transfer_syntaxes_0, 0);
40         }
41         if (ndr_flags & NDR_BUFFERS) {
42         }
43         return NDR_ERR_SUCCESS;
44 }
45
46 _PUBLIC_ void ndr_print_dcerpc_ctx_list(struct ndr_print *ndr, const char *name, const struct dcerpc_ctx_list *r)
47 {
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);
61                 }
62         }
63         ndr->depth--;
64         ndr->depth--;
65 }
66
67 static enum ndr_err_code ndr_push_dcerpc_bind(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_bind *r)
68 {
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]));
78                 }
79                 {
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;
84                 }
85                 {
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;
90                 }
91         }
92         if (ndr_flags & NDR_BUFFERS) {
93         }
94         return NDR_ERR_SUCCESS;
95 }
96
97 static enum ndr_err_code ndr_pull_dcerpc_bind(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_bind *r)
98 {
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]));
112                 }
113                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctx_list_0, 0);
114                 {
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;
119                 }
120                 {
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;
125                 }
126         }
127         if (ndr_flags & NDR_BUFFERS) {
128         }
129         return NDR_ERR_SUCCESS;
130 }
131
132 _PUBLIC_ void ndr_print_dcerpc_bind(struct ndr_print *ndr, const char *name, const struct dcerpc_bind *r)
133 {
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);
148                 }
149         }
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--;
154 }
155
156 static enum ndr_err_code ndr_push_dcerpc_empty(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_empty *r)
157 {
158         if (ndr_flags & NDR_SCALARS) {
159                 NDR_CHECK(ndr_push_align(ndr, 1));
160         }
161         if (ndr_flags & NDR_BUFFERS) {
162         }
163         return NDR_ERR_SUCCESS;
164 }
165
166 static enum ndr_err_code ndr_pull_dcerpc_empty(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_empty *r)
167 {
168         if (ndr_flags & NDR_SCALARS) {
169                 NDR_CHECK(ndr_pull_align(ndr, 1));
170         }
171         if (ndr_flags & NDR_BUFFERS) {
172         }
173         return NDR_ERR_SUCCESS;
174 }
175
176 _PUBLIC_ void ndr_print_dcerpc_empty(struct ndr_print *ndr, const char *name, const struct dcerpc_empty *r)
177 {
178         ndr_print_struct(ndr, name, "dcerpc_empty");
179         ndr->depth++;
180         ndr->depth--;
181 }
182
183 static enum ndr_err_code ndr_push_dcerpc_object(struct ndr_push *ndr, int ndr_flags, const union dcerpc_object *r)
184 {
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; }
191
192                         case LIBNDR_FLAG_OBJECT_PRESENT: {
193                                 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->object));
194                         break; }
195
196                 }
197         }
198         if (ndr_flags & NDR_BUFFERS) {
199                 int level = ndr_push_get_switch_value(ndr, r);
200                 switch (level) {
201                         default:
202                         break;
203
204                         case LIBNDR_FLAG_OBJECT_PRESENT:
205                         break;
206
207                 }
208         }
209         return NDR_ERR_SUCCESS;
210 }
211
212 static enum ndr_err_code ndr_pull_dcerpc_object(struct ndr_pull *ndr, int ndr_flags, union dcerpc_object *r)
213 {
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; }
221
222                         case LIBNDR_FLAG_OBJECT_PRESENT: {
223                                 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->object));
224                         break; }
225
226                 }
227         }
228         if (ndr_flags & NDR_BUFFERS) {
229                 switch (level) {
230                         default:
231                         break;
232
233                         case LIBNDR_FLAG_OBJECT_PRESENT:
234                         break;
235
236                 }
237         }
238         return NDR_ERR_SUCCESS;
239 }
240
241 _PUBLIC_ void ndr_print_dcerpc_object(struct ndr_print *ndr, const char *name, const union dcerpc_object *r)
242 {
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;
250
251                 case LIBNDR_FLAG_OBJECT_PRESENT:
252                         ndr_print_GUID(ndr, "object", &r->object);
253                 break;
254
255         }
256 }
257
258 static enum ndr_err_code ndr_push_dcerpc_request(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_request *r)
259 {
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));
267                 {
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;
272                 }
273                 {
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;
278                 }
279         }
280         if (ndr_flags & NDR_BUFFERS) {
281         }
282         return NDR_ERR_SUCCESS;
283 }
284
285 static enum ndr_err_code ndr_pull_dcerpc_request(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_request *r)
286 {
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));
294                 {
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;
299                 }
300                 {
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;
305                 }
306         }
307         if (ndr_flags & NDR_BUFFERS) {
308         }
309         return NDR_ERR_SUCCESS;
310 }
311
312 _PUBLIC_ void ndr_print_dcerpc_request(struct ndr_print *ndr, const char *name, const struct dcerpc_request *r)
313 {
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--;
324 }
325
326 static enum ndr_err_code ndr_push_dcerpc_ack_ctx(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_ack_ctx *r)
327 {
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));
333         }
334         if (ndr_flags & NDR_BUFFERS) {
335         }
336         return NDR_ERR_SUCCESS;
337 }
338
339 static enum ndr_err_code ndr_pull_dcerpc_ack_ctx(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_ack_ctx *r)
340 {
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));
346         }
347         if (ndr_flags & NDR_BUFFERS) {
348         }
349         return NDR_ERR_SUCCESS;
350 }
351
352 _PUBLIC_ void ndr_print_dcerpc_ack_ctx(struct ndr_print *ndr, const char *name, const struct dcerpc_ack_ctx *r)
353 {
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--;
360 }
361
362 static enum ndr_err_code ndr_push_dcerpc_bind_ack(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_bind_ack *r)
363 {
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));
372                 {
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;
377                 }
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]));
381                 }
382                 {
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;
387                 }
388         }
389         if (ndr_flags & NDR_BUFFERS) {
390         }
391         return NDR_ERR_SUCCESS;
392 }
393
394 static enum ndr_err_code ndr_pull_dcerpc_bind_ack(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_bind_ack *r)
395 {
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));
405                 {
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;
410                 }
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]));
417                 }
418                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctx_list_0, 0);
419                 {
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;
424                 }
425         }
426         if (ndr_flags & NDR_BUFFERS) {
427         }
428         return NDR_ERR_SUCCESS;
429 }
430
431 _PUBLIC_ void ndr_print_dcerpc_bind_ack(struct ndr_print *ndr, const char *name, const struct dcerpc_bind_ack *r)
432 {
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);
450                 }
451         }
452         ndr->depth--;
453         ndr_print_DATA_BLOB(ndr, "auth_info", r->auth_info);
454         ndr->depth--;
455 }
456
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)
458 {
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]));
465                 }
466         }
467         if (ndr_flags & NDR_BUFFERS) {
468         }
469         return NDR_ERR_SUCCESS;
470 }
471
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)
473 {
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]));
484                 }
485                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_versions_0, 0);
486         }
487         if (ndr_flags & NDR_BUFFERS) {
488         }
489         return NDR_ERR_SUCCESS;
490 }
491
492 _PUBLIC_ void ndr_print_dcerpc_bind_nak_versions(struct ndr_print *ndr, const char *name, const struct dcerpc_bind_nak_versions *r)
493 {
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);
505                 }
506         }
507         ndr->depth--;
508         ndr->depth--;
509 }
510
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)
512 {
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; }
519
520                         default: {
521                         break; }
522
523                 }
524         }
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;
530
531                         default:
532                         break;
533
534                 }
535         }
536         return NDR_ERR_SUCCESS;
537 }
538
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)
540 {
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; }
548
549                         default: {
550                         break; }
551
552                 }
553         }
554         if (ndr_flags & NDR_BUFFERS) {
555                 switch (level) {
556                         case DECRPC_BIND_PROTOCOL_VERSION_NOT_SUPPORTED:
557                         break;
558
559                         default:
560                         break;
561
562                 }
563         }
564         return NDR_ERR_SUCCESS;
565 }
566
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)
568 {
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;
576
577                 default:
578                 break;
579
580         }
581 }
582
583 static enum ndr_err_code ndr_push_dcerpc_bind_nak(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_bind_nak *r)
584 {
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));
590         }
591         if (ndr_flags & NDR_BUFFERS) {
592                 NDR_CHECK(ndr_push_dcerpc_bind_nak_versions_ctr(ndr, NDR_BUFFERS, &r->versions));
593         }
594         return NDR_ERR_SUCCESS;
595 }
596
597 static enum ndr_err_code ndr_pull_dcerpc_bind_nak(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_bind_nak *r)
598 {
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));
604         }
605         if (ndr_flags & NDR_BUFFERS) {
606                 NDR_CHECK(ndr_pull_dcerpc_bind_nak_versions_ctr(ndr, NDR_BUFFERS, &r->versions));
607         }
608         return NDR_ERR_SUCCESS;
609 }
610
611 _PUBLIC_ void ndr_print_dcerpc_bind_nak(struct ndr_print *ndr, const char *name, const struct dcerpc_bind_nak *r)
612 {
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--;
619 }
620
621 static enum ndr_err_code ndr_push_dcerpc_response(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_response *r)
622 {
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));
628                 {
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;
633                 }
634                 {
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;
639                 }
640         }
641         if (ndr_flags & NDR_BUFFERS) {
642         }
643         return NDR_ERR_SUCCESS;
644 }
645
646 static enum ndr_err_code ndr_pull_dcerpc_response(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_response *r)
647 {
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));
653                 {
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;
658                 }
659                 {
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;
664                 }
665         }
666         if (ndr_flags & NDR_BUFFERS) {
667         }
668         return NDR_ERR_SUCCESS;
669 }
670
671 _PUBLIC_ void ndr_print_dcerpc_response(struct ndr_print *ndr, const char *name, const struct dcerpc_response *r)
672 {
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--;
681 }
682
683 static enum ndr_err_code ndr_push_dcerpc_fault(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_fault *r)
684 {
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));
691                 {
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;
696                 }
697         }
698         if (ndr_flags & NDR_BUFFERS) {
699         }
700         return NDR_ERR_SUCCESS;
701 }
702
703 static enum ndr_err_code ndr_pull_dcerpc_fault(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_fault *r)
704 {
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));
711                 {
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;
716                 }
717         }
718         if (ndr_flags & NDR_BUFFERS) {
719         }
720         return NDR_ERR_SUCCESS;
721 }
722
723 _PUBLIC_ void ndr_print_dcerpc_fault(struct ndr_print *ndr, const char *name, const struct dcerpc_fault *r)
724 {
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--;
733 }
734
735 static enum ndr_err_code ndr_push_dcerpc_AuthType(struct ndr_push *ndr, int ndr_flags, enum dcerpc_AuthType r)
736 {
737         NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r));
738         return NDR_ERR_SUCCESS;
739 }
740
741 static enum ndr_err_code ndr_pull_dcerpc_AuthType(struct ndr_pull *ndr, int ndr_flags, enum dcerpc_AuthType *r)
742 {
743         uint8_t v;
744         NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &v));
745         *r = v;
746         return NDR_ERR_SUCCESS;
747 }
748
749 _PUBLIC_ void ndr_print_dcerpc_AuthType(struct ndr_print *ndr, const char *name, enum dcerpc_AuthType r)
750 {
751         const char *val = NULL;
752
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;
764         }
765         ndr_print_enum(ndr, name, "ENUM", val, r);
766 }
767
768 static enum ndr_err_code ndr_push_dcerpc_AuthLevel(struct ndr_push *ndr, int ndr_flags, enum dcerpc_AuthLevel r)
769 {
770         NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r));
771         return NDR_ERR_SUCCESS;
772 }
773
774 static enum ndr_err_code ndr_pull_dcerpc_AuthLevel(struct ndr_pull *ndr, int ndr_flags, enum dcerpc_AuthLevel *r)
775 {
776         uint8_t v;
777         NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &v));
778         *r = v;
779         return NDR_ERR_SUCCESS;
780 }
781
782 _PUBLIC_ void ndr_print_dcerpc_AuthLevel(struct ndr_print *ndr, const char *name, enum dcerpc_AuthLevel r)
783 {
784         const char *val = NULL;
785
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;
793         }
794         ndr_print_enum(ndr, name, "ENUM", val, r);
795 }
796
797 _PUBLIC_ enum ndr_err_code ndr_push_dcerpc_auth(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_auth *r)
798 {
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));
806                 {
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;
811                 }
812         }
813         if (ndr_flags & NDR_BUFFERS) {
814         }
815         return NDR_ERR_SUCCESS;
816 }
817
818 _PUBLIC_ enum ndr_err_code ndr_pull_dcerpc_auth(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_auth *r)
819 {
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));
827                 {
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;
832                 }
833         }
834         if (ndr_flags & NDR_BUFFERS) {
835         }
836         return NDR_ERR_SUCCESS;
837 }
838
839 _PUBLIC_ void ndr_print_dcerpc_auth(struct ndr_print *ndr, const char *name, const struct dcerpc_auth *r)
840 {
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--;
850 }
851
852 _PUBLIC_ enum ndr_err_code ndr_push_dcerpc_auth3(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_auth3 *r)
853 {
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));
857                 {
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;
862                 }
863         }
864         if (ndr_flags & NDR_BUFFERS) {
865         }
866         return NDR_ERR_SUCCESS;
867 }
868
869 _PUBLIC_ enum ndr_err_code ndr_pull_dcerpc_auth3(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_auth3 *r)
870 {
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));
874                 {
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;
879                 }
880         }
881         if (ndr_flags & NDR_BUFFERS) {
882         }
883         return NDR_ERR_SUCCESS;
884 }
885
886 _PUBLIC_ void ndr_print_dcerpc_auth3(struct ndr_print *ndr, const char *name, const struct dcerpc_auth3 *r)
887 {
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--;
893 }
894
895 _PUBLIC_ enum ndr_err_code ndr_push_dcerpc_orphaned(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_orphaned *r)
896 {
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));
900                 {
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;
905                 }
906         }
907         if (ndr_flags & NDR_BUFFERS) {
908         }
909         return NDR_ERR_SUCCESS;
910 }
911
912 _PUBLIC_ enum ndr_err_code ndr_pull_dcerpc_orphaned(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_orphaned *r)
913 {
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));
917                 {
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;
922                 }
923         }
924         if (ndr_flags & NDR_BUFFERS) {
925         }
926         return NDR_ERR_SUCCESS;
927 }
928
929 _PUBLIC_ void ndr_print_dcerpc_orphaned(struct ndr_print *ndr, const char *name, const struct dcerpc_orphaned *r)
930 {
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--;
936 }
937
938 _PUBLIC_ enum ndr_err_code ndr_push_dcerpc_co_cancel(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_co_cancel *r)
939 {
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));
943                 {
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;
948                 }
949         }
950         if (ndr_flags & NDR_BUFFERS) {
951         }
952         return NDR_ERR_SUCCESS;
953 }
954
955 _PUBLIC_ enum ndr_err_code ndr_pull_dcerpc_co_cancel(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_co_cancel *r)
956 {
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));
960                 {
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;
965                 }
966         }
967         if (ndr_flags & NDR_BUFFERS) {
968         }
969         return NDR_ERR_SUCCESS;
970 }
971
972 _PUBLIC_ void ndr_print_dcerpc_co_cancel(struct ndr_print *ndr, const char *name, const struct dcerpc_co_cancel *r)
973 {
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--;
979 }
980
981 _PUBLIC_ enum ndr_err_code ndr_push_dcerpc_cl_cancel(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_cl_cancel *r)
982 {
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));
987         }
988         if (ndr_flags & NDR_BUFFERS) {
989         }
990         return NDR_ERR_SUCCESS;
991 }
992
993 _PUBLIC_ enum ndr_err_code ndr_pull_dcerpc_cl_cancel(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_cl_cancel *r)
994 {
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));
999         }
1000         if (ndr_flags & NDR_BUFFERS) {
1001         }
1002         return NDR_ERR_SUCCESS;
1003 }
1004
1005 _PUBLIC_ void ndr_print_dcerpc_cl_cancel(struct ndr_print *ndr, const char *name, const struct dcerpc_cl_cancel *r)
1006 {
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--;
1012 }
1013
1014 _PUBLIC_ enum ndr_err_code ndr_push_dcerpc_cancel_ack(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_cancel_ack *r)
1015 {
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));
1021         }
1022         if (ndr_flags & NDR_BUFFERS) {
1023         }
1024         return NDR_ERR_SUCCESS;
1025 }
1026
1027 _PUBLIC_ enum ndr_err_code ndr_pull_dcerpc_cancel_ack(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_cancel_ack *r)
1028 {
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));
1034         }
1035         if (ndr_flags & NDR_BUFFERS) {
1036         }
1037         return NDR_ERR_SUCCESS;
1038 }
1039
1040 _PUBLIC_ void ndr_print_dcerpc_cancel_ack(struct ndr_print *ndr, const char *name, const struct dcerpc_cancel_ack *r)
1041 {
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--;
1048 }
1049
1050 _PUBLIC_ enum ndr_err_code ndr_push_dcerpc_fack(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_fack *r)
1051 {
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]));
1064                 }
1065         }
1066         if (ndr_flags & NDR_BUFFERS) {
1067         }
1068         return NDR_ERR_SUCCESS;
1069 }
1070
1071 _PUBLIC_ enum ndr_err_code ndr_pull_dcerpc_fack(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_fack *r)
1072 {
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]));
1089                 }
1090                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_selack_0, 0);
1091         }
1092         if (ndr_flags & NDR_BUFFERS) {
1093         }
1094         return NDR_ERR_SUCCESS;
1095 }
1096
1097 _PUBLIC_ void ndr_print_dcerpc_fack(struct ndr_print *ndr, const char *name, const struct dcerpc_fack *r)
1098 {
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);
1116                 }
1117         }
1118         ndr->depth--;
1119         ndr->depth--;
1120 }
1121
1122 _PUBLIC_ enum ndr_err_code ndr_push_dcerpc_ack(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_ack *r)
1123 {
1124         if (ndr_flags & NDR_SCALARS) {
1125                 NDR_CHECK(ndr_push_align(ndr, 1));
1126         }
1127         if (ndr_flags & NDR_BUFFERS) {
1128         }
1129         return NDR_ERR_SUCCESS;
1130 }
1131
1132 _PUBLIC_ enum ndr_err_code ndr_pull_dcerpc_ack(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_ack *r)
1133 {
1134         if (ndr_flags & NDR_SCALARS) {
1135                 NDR_CHECK(ndr_pull_align(ndr, 1));
1136         }
1137         if (ndr_flags & NDR_BUFFERS) {
1138         }
1139         return NDR_ERR_SUCCESS;
1140 }
1141
1142 _PUBLIC_ void ndr_print_dcerpc_ack(struct ndr_print *ndr, const char *name, const struct dcerpc_ack *r)
1143 {
1144         ndr_print_struct(ndr, name, "dcerpc_ack");
1145         ndr->depth++;
1146         ndr->depth--;
1147 }
1148
1149 _PUBLIC_ enum ndr_err_code ndr_push_dcerpc_ping(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_ping *r)
1150 {
1151         if (ndr_flags & NDR_SCALARS) {
1152                 NDR_CHECK(ndr_push_align(ndr, 1));
1153         }
1154         if (ndr_flags & NDR_BUFFERS) {
1155         }
1156         return NDR_ERR_SUCCESS;
1157 }
1158
1159 _PUBLIC_ enum ndr_err_code ndr_pull_dcerpc_ping(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_ping *r)
1160 {
1161         if (ndr_flags & NDR_SCALARS) {
1162                 NDR_CHECK(ndr_pull_align(ndr, 1));
1163         }
1164         if (ndr_flags & NDR_BUFFERS) {
1165         }
1166         return NDR_ERR_SUCCESS;
1167 }
1168
1169 _PUBLIC_ void ndr_print_dcerpc_ping(struct ndr_print *ndr, const char *name, const struct dcerpc_ping *r)
1170 {
1171         ndr_print_struct(ndr, name, "dcerpc_ping");
1172         ndr->depth++;
1173         ndr->depth--;
1174 }
1175
1176 _PUBLIC_ enum ndr_err_code ndr_push_dcerpc_shutdown(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_shutdown *r)
1177 {
1178         if (ndr_flags & NDR_SCALARS) {
1179                 NDR_CHECK(ndr_push_align(ndr, 1));
1180         }
1181         if (ndr_flags & NDR_BUFFERS) {
1182         }
1183         return NDR_ERR_SUCCESS;
1184 }
1185
1186 _PUBLIC_ enum ndr_err_code ndr_pull_dcerpc_shutdown(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_shutdown *r)
1187 {
1188         if (ndr_flags & NDR_SCALARS) {
1189                 NDR_CHECK(ndr_pull_align(ndr, 1));
1190         }
1191         if (ndr_flags & NDR_BUFFERS) {
1192         }
1193         return NDR_ERR_SUCCESS;
1194 }
1195
1196 _PUBLIC_ void ndr_print_dcerpc_shutdown(struct ndr_print *ndr, const char *name, const struct dcerpc_shutdown *r)
1197 {
1198         ndr_print_struct(ndr, name, "dcerpc_shutdown");
1199         ndr->depth++;
1200         ndr->depth--;
1201 }
1202
1203 _PUBLIC_ enum ndr_err_code ndr_push_dcerpc_working(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_working *r)
1204 {
1205         if (ndr_flags & NDR_SCALARS) {
1206                 NDR_CHECK(ndr_push_align(ndr, 1));
1207         }
1208         if (ndr_flags & NDR_BUFFERS) {
1209         }
1210         return NDR_ERR_SUCCESS;
1211 }
1212
1213 _PUBLIC_ enum ndr_err_code ndr_pull_dcerpc_working(struct ndr_pull *ndr, int ndr_flags, struct dcerpc_working *r)
1214 {
1215         if (ndr_flags & NDR_SCALARS) {
1216                 NDR_CHECK(ndr_pull_align(ndr, 1));
1217         }
1218         if (ndr_flags & NDR_BUFFERS) {
1219         }
1220         return NDR_ERR_SUCCESS;
1221 }
1222
1223 _PUBLIC_ void ndr_print_dcerpc_working(struct ndr_print *ndr, const char *name, const struct dcerpc_working *r)
1224 {
1225         ndr_print_struct(ndr, name, "dcerpc_working");
1226         ndr->depth++;
1227         ndr->depth--;
1228 }
1229
1230 static enum ndr_err_code ndr_push_dcerpc_pkt_type(struct ndr_push *ndr, int ndr_flags, enum dcerpc_pkt_type r)
1231 {
1232         NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r));
1233         return NDR_ERR_SUCCESS;
1234 }
1235
1236 static enum ndr_err_code ndr_pull_dcerpc_pkt_type(struct ndr_pull *ndr, int ndr_flags, enum dcerpc_pkt_type *r)
1237 {
1238         uint8_t v;
1239         NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &v));
1240         *r = v;
1241         return NDR_ERR_SUCCESS;
1242 }
1243
1244 _PUBLIC_ void ndr_print_dcerpc_pkt_type(struct ndr_print *ndr, const char *name, enum dcerpc_pkt_type r)
1245 {
1246         const char *val = NULL;
1247
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;
1269         }
1270         ndr_print_enum(ndr, name, "ENUM", val, r);
1271 }
1272
1273 static enum ndr_err_code ndr_push_dcerpc_payload(struct ndr_push *ndr, int ndr_flags, const union dcerpc_payload *r)
1274 {
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; }
1281
1282                         case DCERPC_PKT_PING: {
1283                                 NDR_CHECK(ndr_push_dcerpc_ping(ndr, NDR_SCALARS, &r->ping));
1284                         break; }
1285
1286                         case DCERPC_PKT_RESPONSE: {
1287                                 NDR_CHECK(ndr_push_dcerpc_response(ndr, NDR_SCALARS, &r->response));
1288                         break; }
1289
1290                         case DCERPC_PKT_FAULT: {
1291                                 NDR_CHECK(ndr_push_dcerpc_fault(ndr, NDR_SCALARS, &r->fault));
1292                         break; }
1293
1294                         case DCERPC_PKT_WORKING: {
1295                                 NDR_CHECK(ndr_push_dcerpc_working(ndr, NDR_SCALARS, &r->working));
1296                         break; }
1297
1298                         case DCERPC_PKT_NOCALL: {
1299                                 NDR_CHECK(ndr_push_dcerpc_fack(ndr, NDR_SCALARS, &r->nocall));
1300                         break; }
1301
1302                         case DCERPC_PKT_REJECT: {
1303                                 NDR_CHECK(ndr_push_dcerpc_fault(ndr, NDR_SCALARS, &r->reject));
1304                         break; }
1305
1306                         case DCERPC_PKT_ACK: {
1307                                 NDR_CHECK(ndr_push_dcerpc_ack(ndr, NDR_SCALARS, &r->ack));
1308                         break; }
1309
1310                         case DCERPC_PKT_CL_CANCEL: {
1311                                 NDR_CHECK(ndr_push_dcerpc_cl_cancel(ndr, NDR_SCALARS, &r->cl_cancel));
1312                         break; }
1313
1314                         case DCERPC_PKT_FACK: {
1315                                 NDR_CHECK(ndr_push_dcerpc_fack(ndr, NDR_SCALARS, &r->fack));
1316                         break; }
1317
1318                         case DCERPC_PKT_CANCEL_ACK: {
1319                                 NDR_CHECK(ndr_push_dcerpc_cancel_ack(ndr, NDR_SCALARS, &r->cancel_ack));
1320                         break; }
1321
1322                         case DCERPC_PKT_BIND: {
1323                                 NDR_CHECK(ndr_push_dcerpc_bind(ndr, NDR_SCALARS, &r->bind));
1324                         break; }
1325
1326                         case DCERPC_PKT_BIND_ACK: {
1327                                 NDR_CHECK(ndr_push_dcerpc_bind_ack(ndr, NDR_SCALARS, &r->bind_ack));
1328                         break; }
1329
1330                         case DCERPC_PKT_BIND_NAK: {
1331                                 NDR_CHECK(ndr_push_dcerpc_bind_nak(ndr, NDR_SCALARS, &r->bind_nak));
1332                         break; }
1333
1334                         case DCERPC_PKT_ALTER: {
1335                                 NDR_CHECK(ndr_push_dcerpc_bind(ndr, NDR_SCALARS, &r->alter));
1336                         break; }
1337
1338                         case DCERPC_PKT_ALTER_RESP: {
1339                                 NDR_CHECK(ndr_push_dcerpc_bind_ack(ndr, NDR_SCALARS, &r->alter_resp));
1340                         break; }
1341
1342                         case DCERPC_PKT_SHUTDOWN: {
1343                                 NDR_CHECK(ndr_push_dcerpc_shutdown(ndr, NDR_SCALARS, &r->shutdown));
1344                         break; }
1345
1346                         case DCERPC_PKT_CO_CANCEL: {
1347                                 NDR_CHECK(ndr_push_dcerpc_co_cancel(ndr, NDR_SCALARS, &r->co_cancel));
1348                         break; }
1349
1350                         case DCERPC_PKT_ORPHANED: {
1351                                 NDR_CHECK(ndr_push_dcerpc_orphaned(ndr, NDR_SCALARS, &r->orphaned));
1352                         break; }
1353
1354                         case DCERPC_PKT_AUTH3: {
1355                                 NDR_CHECK(ndr_push_dcerpc_auth3(ndr, NDR_SCALARS, &r->auth3));
1356                         break; }
1357
1358                         default:
1359                                 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
1360                 }
1361         }
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;
1367
1368                         case DCERPC_PKT_PING:
1369                         break;
1370
1371                         case DCERPC_PKT_RESPONSE:
1372                         break;
1373
1374                         case DCERPC_PKT_FAULT:
1375                         break;
1376
1377                         case DCERPC_PKT_WORKING:
1378                         break;
1379
1380                         case DCERPC_PKT_NOCALL:
1381                         break;
1382
1383                         case DCERPC_PKT_REJECT:
1384                         break;
1385
1386                         case DCERPC_PKT_ACK:
1387                         break;
1388
1389                         case DCERPC_PKT_CL_CANCEL:
1390                         break;
1391
1392                         case DCERPC_PKT_FACK:
1393                         break;
1394
1395                         case DCERPC_PKT_CANCEL_ACK:
1396                         break;
1397
1398                         case DCERPC_PKT_BIND:
1399                         break;
1400
1401                         case DCERPC_PKT_BIND_ACK:
1402                         break;
1403
1404                         case DCERPC_PKT_BIND_NAK:
1405                                 NDR_CHECK(ndr_push_dcerpc_bind_nak(ndr, NDR_BUFFERS, &r->bind_nak));
1406                         break;
1407
1408                         case DCERPC_PKT_ALTER:
1409                         break;
1410
1411                         case DCERPC_PKT_ALTER_RESP:
1412                         break;
1413
1414                         case DCERPC_PKT_SHUTDOWN:
1415                         break;
1416
1417                         case DCERPC_PKT_CO_CANCEL:
1418                         break;
1419
1420                         case DCERPC_PKT_ORPHANED:
1421                         break;
1422
1423                         case DCERPC_PKT_AUTH3:
1424                         break;
1425
1426                         default:
1427                                 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
1428                 }
1429         }
1430         return NDR_ERR_SUCCESS;
1431 }
1432
1433 static enum ndr_err_code ndr_pull_dcerpc_payload(struct ndr_pull *ndr, int ndr_flags, union dcerpc_payload *r)
1434 {
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; }
1442
1443                         case DCERPC_PKT_PING: {
1444                                 NDR_CHECK(ndr_pull_dcerpc_ping(ndr, NDR_SCALARS, &r->ping));
1445                         break; }
1446
1447                         case DCERPC_PKT_RESPONSE: {
1448                                 NDR_CHECK(ndr_pull_dcerpc_response(ndr, NDR_SCALARS, &r->response));
1449                         break; }
1450
1451                         case DCERPC_PKT_FAULT: {
1452                                 NDR_CHECK(ndr_pull_dcerpc_fault(ndr, NDR_SCALARS, &r->fault));
1453                         break; }
1454
1455                         case DCERPC_PKT_WORKING: {
1456                                 NDR_CHECK(ndr_pull_dcerpc_working(ndr, NDR_SCALARS, &r->working));
1457                         break; }
1458
1459                         case DCERPC_PKT_NOCALL: {
1460                                 NDR_CHECK(ndr_pull_dcerpc_fack(ndr, NDR_SCALARS, &r->nocall));
1461                         break; }
1462
1463                         case DCERPC_PKT_REJECT: {
1464                                 NDR_CHECK(ndr_pull_dcerpc_fault(ndr, NDR_SCALARS, &r->reject));
1465                         break; }
1466
1467                         case DCERPC_PKT_ACK: {
1468                                 NDR_CHECK(ndr_pull_dcerpc_ack(ndr, NDR_SCALARS, &r->ack));
1469                         break; }
1470
1471                         case DCERPC_PKT_CL_CANCEL: {
1472                                 NDR_CHECK(ndr_pull_dcerpc_cl_cancel(ndr, NDR_SCALARS, &r->cl_cancel));
1473                         break; }
1474
1475                         case DCERPC_PKT_FACK: {
1476                                 NDR_CHECK(ndr_pull_dcerpc_fack(ndr, NDR_SCALARS, &r->fack));
1477                         break; }
1478
1479                         case DCERPC_PKT_CANCEL_ACK: {
1480                                 NDR_CHECK(ndr_pull_dcerpc_cancel_ack(ndr, NDR_SCALARS, &r->cancel_ack));
1481                         break; }
1482
1483                         case DCERPC_PKT_BIND: {
1484                                 NDR_CHECK(ndr_pull_dcerpc_bind(ndr, NDR_SCALARS, &r->bind));
1485                         break; }
1486
1487                         case DCERPC_PKT_BIND_ACK: {
1488                                 NDR_CHECK(ndr_pull_dcerpc_bind_ack(ndr, NDR_SCALARS, &r->bind_ack));
1489                         break; }
1490
1491                         case DCERPC_PKT_BIND_NAK: {
1492                                 NDR_CHECK(ndr_pull_dcerpc_bind_nak(ndr, NDR_SCALARS, &r->bind_nak));
1493                         break; }
1494
1495                         case DCERPC_PKT_ALTER: {
1496                                 NDR_CHECK(ndr_pull_dcerpc_bind(ndr, NDR_SCALARS, &r->alter));
1497                         break; }
1498
1499                         case DCERPC_PKT_ALTER_RESP: {
1500                                 NDR_CHECK(ndr_pull_dcerpc_bind_ack(ndr, NDR_SCALARS, &r->alter_resp));
1501                         break; }
1502
1503                         case DCERPC_PKT_SHUTDOWN: {
1504                                 NDR_CHECK(ndr_pull_dcerpc_shutdown(ndr, NDR_SCALARS, &r->shutdown));
1505                         break; }
1506
1507                         case DCERPC_PKT_CO_CANCEL: {
1508                                 NDR_CHECK(ndr_pull_dcerpc_co_cancel(ndr, NDR_SCALARS, &r->co_cancel));
1509                         break; }
1510
1511                         case DCERPC_PKT_ORPHANED: {
1512                                 NDR_CHECK(ndr_pull_dcerpc_orphaned(ndr, NDR_SCALARS, &r->orphaned));
1513                         break; }
1514
1515                         case DCERPC_PKT_AUTH3: {
1516                                 NDR_CHECK(ndr_pull_dcerpc_auth3(ndr, NDR_SCALARS, &r->auth3));
1517                         break; }
1518
1519                         default:
1520                                 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
1521                 }
1522         }
1523         if (ndr_flags & NDR_BUFFERS) {
1524                 switch (level) {
1525                         case DCERPC_PKT_REQUEST:
1526                         break;
1527
1528                         case DCERPC_PKT_PING:
1529                         break;
1530
1531                         case DCERPC_PKT_RESPONSE:
1532                         break;
1533
1534                         case DCERPC_PKT_FAULT:
1535                         break;
1536
1537                         case DCERPC_PKT_WORKING:
1538                         break;
1539
1540                         case DCERPC_PKT_NOCALL:
1541                         break;
1542
1543                         case DCERPC_PKT_REJECT:
1544                         break;
1545
1546                         case DCERPC_PKT_ACK:
1547                         break;
1548
1549                         case DCERPC_PKT_CL_CANCEL:
1550                         break;
1551
1552                         case DCERPC_PKT_FACK:
1553                         break;
1554
1555                         case DCERPC_PKT_CANCEL_ACK:
1556                         break;
1557
1558                         case DCERPC_PKT_BIND:
1559                         break;
1560
1561                         case DCERPC_PKT_BIND_ACK:
1562                         break;
1563
1564                         case DCERPC_PKT_BIND_NAK:
1565                                 NDR_CHECK(ndr_pull_dcerpc_bind_nak(ndr, NDR_BUFFERS, &r->bind_nak));
1566                         break;
1567
1568                         case DCERPC_PKT_ALTER:
1569                         break;
1570
1571                         case DCERPC_PKT_ALTER_RESP:
1572                         break;
1573
1574                         case DCERPC_PKT_SHUTDOWN:
1575                         break;
1576
1577                         case DCERPC_PKT_CO_CANCEL:
1578                         break;
1579
1580                         case DCERPC_PKT_ORPHANED:
1581                         break;
1582
1583                         case DCERPC_PKT_AUTH3:
1584                         break;
1585
1586                         default:
1587                                 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
1588                 }
1589         }
1590         return NDR_ERR_SUCCESS;
1591 }
1592
1593 _PUBLIC_ void ndr_print_dcerpc_payload(struct ndr_print *ndr, const char *name, const union dcerpc_payload *r)
1594 {
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;
1602
1603                 case DCERPC_PKT_PING:
1604                         ndr_print_dcerpc_ping(ndr, "ping", &r->ping);
1605                 break;
1606
1607                 case DCERPC_PKT_RESPONSE:
1608                         ndr_print_dcerpc_response(ndr, "response", &r->response);
1609                 break;
1610
1611                 case DCERPC_PKT_FAULT:
1612                         ndr_print_dcerpc_fault(ndr, "fault", &r->fault);
1613                 break;
1614
1615                 case DCERPC_PKT_WORKING:
1616                         ndr_print_dcerpc_working(ndr, "working", &r->working);
1617                 break;
1618
1619                 case DCERPC_PKT_NOCALL:
1620                         ndr_print_dcerpc_fack(ndr, "nocall", &r->nocall);
1621                 break;
1622
1623                 case DCERPC_PKT_REJECT:
1624                         ndr_print_dcerpc_fault(ndr, "reject", &r->reject);
1625                 break;
1626
1627                 case DCERPC_PKT_ACK:
1628                         ndr_print_dcerpc_ack(ndr, "ack", &r->ack);
1629                 break;
1630
1631                 case DCERPC_PKT_CL_CANCEL:
1632                         ndr_print_dcerpc_cl_cancel(ndr, "cl_cancel", &r->cl_cancel);
1633                 break;
1634
1635                 case DCERPC_PKT_FACK:
1636                         ndr_print_dcerpc_fack(ndr, "fack", &r->fack);
1637                 break;
1638
1639                 case DCERPC_PKT_CANCEL_ACK:
1640                         ndr_print_dcerpc_cancel_ack(ndr, "cancel_ack", &r->cancel_ack);
1641                 break;
1642
1643                 case DCERPC_PKT_BIND:
1644                         ndr_print_dcerpc_bind(ndr, "bind", &r->bind);
1645                 break;
1646
1647                 case DCERPC_PKT_BIND_ACK:
1648                         ndr_print_dcerpc_bind_ack(ndr, "bind_ack", &r->bind_ack);
1649                 break;
1650
1651                 case DCERPC_PKT_BIND_NAK:
1652                         ndr_print_dcerpc_bind_nak(ndr, "bind_nak", &r->bind_nak);
1653                 break;
1654
1655                 case DCERPC_PKT_ALTER:
1656                         ndr_print_dcerpc_bind(ndr, "alter", &r->alter);
1657                 break;
1658
1659                 case DCERPC_PKT_ALTER_RESP:
1660                         ndr_print_dcerpc_bind_ack(ndr, "alter_resp", &r->alter_resp);
1661                 break;
1662
1663                 case DCERPC_PKT_SHUTDOWN:
1664                         ndr_print_dcerpc_shutdown(ndr, "shutdown", &r->shutdown);
1665                 break;
1666
1667                 case DCERPC_PKT_CO_CANCEL:
1668                         ndr_print_dcerpc_co_cancel(ndr, "co_cancel", &r->co_cancel);
1669                 break;
1670
1671                 case DCERPC_PKT_ORPHANED:
1672                         ndr_print_dcerpc_orphaned(ndr, "orphaned", &r->orphaned);
1673                 break;
1674
1675                 case DCERPC_PKT_AUTH3:
1676                         ndr_print_dcerpc_auth3(ndr, "auth3", &r->auth3);
1677                 break;
1678
1679                 default:
1680                         ndr_print_bad_level(ndr, name, level);
1681         }
1682 }
1683
1684 _PUBLIC_ enum ndr_err_code ndr_push_ncacn_packet(struct ndr_push *ndr, int ndr_flags, const struct ncacn_packet *r)
1685 {
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));
1698         }
1699         if (ndr_flags & NDR_BUFFERS) {
1700                 NDR_CHECK(ndr_push_dcerpc_payload(ndr, NDR_BUFFERS, &r->u));
1701         }
1702         return NDR_ERR_SUCCESS;
1703 }
1704
1705 _PUBLIC_ enum ndr_err_code ndr_pull_ncacn_packet(struct ndr_pull *ndr, int ndr_flags, struct ncacn_packet *r)
1706 {
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));
1719         }
1720         if (ndr_flags & NDR_BUFFERS) {
1721                 NDR_CHECK(ndr_pull_dcerpc_payload(ndr, NDR_BUFFERS, &r->u));
1722         }
1723         return NDR_ERR_SUCCESS;
1724 }
1725
1726 _PUBLIC_ void ndr_print_ncacn_packet(struct ndr_print *ndr, const char *name, const struct ncacn_packet *r)
1727 {
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--;
1741 }
1742
1743 _PUBLIC_ enum ndr_err_code ndr_push_ncadg_packet(struct ndr_push *ndr, int ndr_flags, const struct ncadg_packet *r)
1744 {
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));
1768         }
1769         if (ndr_flags & NDR_BUFFERS) {
1770                 NDR_CHECK(ndr_push_dcerpc_payload(ndr, NDR_BUFFERS, &r->u));
1771         }
1772         return NDR_ERR_SUCCESS;
1773 }
1774
1775 _PUBLIC_ enum ndr_err_code ndr_pull_ncadg_packet(struct ndr_pull *ndr, int ndr_flags, struct ncadg_packet *r)
1776 {
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));
1800         }
1801         if (ndr_flags & NDR_BUFFERS) {
1802                 NDR_CHECK(ndr_pull_dcerpc_payload(ndr, NDR_BUFFERS, &r->u));
1803         }
1804         return NDR_ERR_SUCCESS;
1805 }
1806
1807 _PUBLIC_ void ndr_print_ncadg_packet(struct ndr_print *ndr, const char *name, const struct ncadg_packet *r)
1808 {
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--;
1833 }
1834