WHATSNEW: Update release notes.
[Samba/bb.git] / librpc / gen_ndr / ndr_echo.c
blob4c54ff47c30008ad9ba129c63411936a649ab592
1 /* parser auto-generated by pidl */
3 #include "includes.h"
4 #include "../librpc/gen_ndr/ndr_echo.h"
6 _PUBLIC_ enum ndr_err_code ndr_push_echo_info1(struct ndr_push *ndr, int ndr_flags, const struct echo_info1 *r)
8 if (ndr_flags & NDR_SCALARS) {
9 NDR_CHECK(ndr_push_align(ndr, 1));
10 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->v));
11 NDR_CHECK(ndr_push_trailer_align(ndr, 1));
13 if (ndr_flags & NDR_BUFFERS) {
15 return NDR_ERR_SUCCESS;
18 _PUBLIC_ enum ndr_err_code ndr_pull_echo_info1(struct ndr_pull *ndr, int ndr_flags, struct echo_info1 *r)
20 if (ndr_flags & NDR_SCALARS) {
21 NDR_CHECK(ndr_pull_align(ndr, 1));
22 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->v));
23 NDR_CHECK(ndr_pull_trailer_align(ndr, 1));
25 if (ndr_flags & NDR_BUFFERS) {
27 return NDR_ERR_SUCCESS;
30 _PUBLIC_ void ndr_print_echo_info1(struct ndr_print *ndr, const char *name, const struct echo_info1 *r)
32 ndr_print_struct(ndr, name, "echo_info1");
33 ndr->depth++;
34 ndr_print_uint8(ndr, "v", r->v);
35 ndr->depth--;
38 static enum ndr_err_code ndr_push_echo_info2(struct ndr_push *ndr, int ndr_flags, const struct echo_info2 *r)
40 if (ndr_flags & NDR_SCALARS) {
41 NDR_CHECK(ndr_push_align(ndr, 2));
42 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->v));
43 NDR_CHECK(ndr_push_trailer_align(ndr, 2));
45 if (ndr_flags & NDR_BUFFERS) {
47 return NDR_ERR_SUCCESS;
50 static enum ndr_err_code ndr_pull_echo_info2(struct ndr_pull *ndr, int ndr_flags, struct echo_info2 *r)
52 if (ndr_flags & NDR_SCALARS) {
53 NDR_CHECK(ndr_pull_align(ndr, 2));
54 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->v));
55 NDR_CHECK(ndr_pull_trailer_align(ndr, 2));
57 if (ndr_flags & NDR_BUFFERS) {
59 return NDR_ERR_SUCCESS;
62 _PUBLIC_ void ndr_print_echo_info2(struct ndr_print *ndr, const char *name, const struct echo_info2 *r)
64 ndr_print_struct(ndr, name, "echo_info2");
65 ndr->depth++;
66 ndr_print_uint16(ndr, "v", r->v);
67 ndr->depth--;
70 static enum ndr_err_code ndr_push_echo_info3(struct ndr_push *ndr, int ndr_flags, const struct echo_info3 *r)
72 if (ndr_flags & NDR_SCALARS) {
73 NDR_CHECK(ndr_push_align(ndr, 4));
74 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->v));
75 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
77 if (ndr_flags & NDR_BUFFERS) {
79 return NDR_ERR_SUCCESS;
82 static enum ndr_err_code ndr_pull_echo_info3(struct ndr_pull *ndr, int ndr_flags, struct echo_info3 *r)
84 if (ndr_flags & NDR_SCALARS) {
85 NDR_CHECK(ndr_pull_align(ndr, 4));
86 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->v));
87 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
89 if (ndr_flags & NDR_BUFFERS) {
91 return NDR_ERR_SUCCESS;
94 _PUBLIC_ void ndr_print_echo_info3(struct ndr_print *ndr, const char *name, const struct echo_info3 *r)
96 ndr_print_struct(ndr, name, "echo_info3");
97 ndr->depth++;
98 ndr_print_uint32(ndr, "v", r->v);
99 ndr->depth--;
102 static enum ndr_err_code ndr_push_STRUCT_echo_info4(struct ndr_push *ndr, int ndr_flags, const struct echo_info4 *r)
104 if (ndr_flags & NDR_SCALARS) {
105 NDR_CHECK(ndr_push_align(ndr, 8));
106 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->v));
107 NDR_CHECK(ndr_push_trailer_align(ndr, 8));
109 if (ndr_flags & NDR_BUFFERS) {
111 return NDR_ERR_SUCCESS;
114 static enum ndr_err_code ndr_pull_STRUCT_echo_info4(struct ndr_pull *ndr, int ndr_flags, struct echo_info4 *r)
116 if (ndr_flags & NDR_SCALARS) {
117 NDR_CHECK(ndr_pull_align(ndr, 8));
118 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->v));
119 NDR_CHECK(ndr_pull_trailer_align(ndr, 8));
121 if (ndr_flags & NDR_BUFFERS) {
123 return NDR_ERR_SUCCESS;
126 _PUBLIC_ void ndr_print_STRUCT_echo_info4(struct ndr_print *ndr, const char *name, const struct echo_info4 *r)
128 ndr_print_struct(ndr, name, "echo_info4");
129 ndr->depth++;
130 ndr_print_hyper(ndr, "v", r->v);
131 ndr->depth--;
134 static enum ndr_err_code ndr_push_echo_info5(struct ndr_push *ndr, int ndr_flags, const struct echo_info5 *r)
136 if (ndr_flags & NDR_SCALARS) {
137 NDR_CHECK(ndr_push_align(ndr, 8));
138 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->v1));
139 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->v2));
140 NDR_CHECK(ndr_push_trailer_align(ndr, 8));
142 if (ndr_flags & NDR_BUFFERS) {
144 return NDR_ERR_SUCCESS;
147 static enum ndr_err_code ndr_pull_echo_info5(struct ndr_pull *ndr, int ndr_flags, struct echo_info5 *r)
149 if (ndr_flags & NDR_SCALARS) {
150 NDR_CHECK(ndr_pull_align(ndr, 8));
151 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->v1));
152 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->v2));
153 NDR_CHECK(ndr_pull_trailer_align(ndr, 8));
155 if (ndr_flags & NDR_BUFFERS) {
157 return NDR_ERR_SUCCESS;
160 _PUBLIC_ void ndr_print_echo_info5(struct ndr_print *ndr, const char *name, const struct echo_info5 *r)
162 ndr_print_struct(ndr, name, "echo_info5");
163 ndr->depth++;
164 ndr_print_uint8(ndr, "v1", r->v1);
165 ndr_print_hyper(ndr, "v2", r->v2);
166 ndr->depth--;
169 static enum ndr_err_code ndr_push_echo_info6(struct ndr_push *ndr, int ndr_flags, const struct echo_info6 *r)
171 if (ndr_flags & NDR_SCALARS) {
172 NDR_CHECK(ndr_push_align(ndr, 1));
173 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->v1));
174 NDR_CHECK(ndr_push_echo_info1(ndr, NDR_SCALARS, &r->info1));
175 NDR_CHECK(ndr_push_trailer_align(ndr, 1));
177 if (ndr_flags & NDR_BUFFERS) {
179 return NDR_ERR_SUCCESS;
182 static enum ndr_err_code ndr_pull_echo_info6(struct ndr_pull *ndr, int ndr_flags, struct echo_info6 *r)
184 if (ndr_flags & NDR_SCALARS) {
185 NDR_CHECK(ndr_pull_align(ndr, 1));
186 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->v1));
187 NDR_CHECK(ndr_pull_echo_info1(ndr, NDR_SCALARS, &r->info1));
188 NDR_CHECK(ndr_pull_trailer_align(ndr, 1));
190 if (ndr_flags & NDR_BUFFERS) {
192 return NDR_ERR_SUCCESS;
195 _PUBLIC_ void ndr_print_echo_info6(struct ndr_print *ndr, const char *name, const struct echo_info6 *r)
197 ndr_print_struct(ndr, name, "echo_info6");
198 ndr->depth++;
199 ndr_print_uint8(ndr, "v1", r->v1);
200 ndr_print_echo_info1(ndr, "info1", &r->info1);
201 ndr->depth--;
204 static enum ndr_err_code ndr_push_echo_info7(struct ndr_push *ndr, int ndr_flags, const struct echo_info7 *r)
206 if (ndr_flags & NDR_SCALARS) {
207 NDR_CHECK(ndr_push_align(ndr, 8));
208 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->v1));
209 NDR_CHECK(ndr_push_STRUCT_echo_info4(ndr, NDR_SCALARS, &r->info4));
210 NDR_CHECK(ndr_push_trailer_align(ndr, 8));
212 if (ndr_flags & NDR_BUFFERS) {
214 return NDR_ERR_SUCCESS;
217 static enum ndr_err_code ndr_pull_echo_info7(struct ndr_pull *ndr, int ndr_flags, struct echo_info7 *r)
219 if (ndr_flags & NDR_SCALARS) {
220 NDR_CHECK(ndr_pull_align(ndr, 8));
221 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->v1));
222 NDR_CHECK(ndr_pull_STRUCT_echo_info4(ndr, NDR_SCALARS, &r->info4));
223 NDR_CHECK(ndr_pull_trailer_align(ndr, 8));
225 if (ndr_flags & NDR_BUFFERS) {
227 return NDR_ERR_SUCCESS;
230 _PUBLIC_ void ndr_print_echo_info7(struct ndr_print *ndr, const char *name, const struct echo_info7 *r)
232 ndr_print_struct(ndr, name, "echo_info7");
233 ndr->depth++;
234 ndr_print_uint8(ndr, "v1", r->v1);
235 ndr_print_STRUCT_echo_info4(ndr, "info4", &r->info4);
236 ndr->depth--;
239 static enum ndr_err_code ndr_push_echo_Info(struct ndr_push *ndr, int ndr_flags, const union echo_Info *r)
241 if (ndr_flags & NDR_SCALARS) {
242 int level = ndr_push_get_switch_value(ndr, r);
243 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, level));
244 NDR_CHECK(ndr_push_union_align(ndr, 8));
245 switch (level) {
246 case 1: {
247 NDR_CHECK(ndr_push_echo_info1(ndr, NDR_SCALARS, &r->info1));
248 break; }
250 case 2: {
251 NDR_CHECK(ndr_push_echo_info2(ndr, NDR_SCALARS, &r->info2));
252 break; }
254 case 3: {
255 NDR_CHECK(ndr_push_echo_info3(ndr, NDR_SCALARS, &r->info3));
256 break; }
258 case 4: {
259 NDR_CHECK(ndr_push_STRUCT_echo_info4(ndr, NDR_SCALARS, &r->info4));
260 break; }
262 case 5: {
263 NDR_CHECK(ndr_push_echo_info5(ndr, NDR_SCALARS, &r->info5));
264 break; }
266 case 6: {
267 NDR_CHECK(ndr_push_echo_info6(ndr, NDR_SCALARS, &r->info6));
268 break; }
270 case 7: {
271 NDR_CHECK(ndr_push_echo_info7(ndr, NDR_SCALARS, &r->info7));
272 break; }
274 default:
275 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
278 if (ndr_flags & NDR_BUFFERS) {
279 int level = ndr_push_get_switch_value(ndr, r);
280 switch (level) {
281 case 1:
282 break;
284 case 2:
285 break;
287 case 3:
288 break;
290 case 4:
291 break;
293 case 5:
294 break;
296 case 6:
297 break;
299 case 7:
300 break;
302 default:
303 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
306 return NDR_ERR_SUCCESS;
309 static enum ndr_err_code ndr_pull_echo_Info(struct ndr_pull *ndr, int ndr_flags, union echo_Info *r)
311 int level;
312 uint16_t _level;
313 level = ndr_pull_get_switch_value(ndr, r);
314 if (ndr_flags & NDR_SCALARS) {
315 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level));
316 if (_level != level) {
317 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
319 NDR_CHECK(ndr_pull_union_align(ndr, 8));
320 switch (level) {
321 case 1: {
322 NDR_CHECK(ndr_pull_echo_info1(ndr, NDR_SCALARS, &r->info1));
323 break; }
325 case 2: {
326 NDR_CHECK(ndr_pull_echo_info2(ndr, NDR_SCALARS, &r->info2));
327 break; }
329 case 3: {
330 NDR_CHECK(ndr_pull_echo_info3(ndr, NDR_SCALARS, &r->info3));
331 break; }
333 case 4: {
334 NDR_CHECK(ndr_pull_STRUCT_echo_info4(ndr, NDR_SCALARS, &r->info4));
335 break; }
337 case 5: {
338 NDR_CHECK(ndr_pull_echo_info5(ndr, NDR_SCALARS, &r->info5));
339 break; }
341 case 6: {
342 NDR_CHECK(ndr_pull_echo_info6(ndr, NDR_SCALARS, &r->info6));
343 break; }
345 case 7: {
346 NDR_CHECK(ndr_pull_echo_info7(ndr, NDR_SCALARS, &r->info7));
347 break; }
349 default:
350 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
353 if (ndr_flags & NDR_BUFFERS) {
354 switch (level) {
355 case 1:
356 break;
358 case 2:
359 break;
361 case 3:
362 break;
364 case 4:
365 break;
367 case 5:
368 break;
370 case 6:
371 break;
373 case 7:
374 break;
376 default:
377 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
380 return NDR_ERR_SUCCESS;
383 _PUBLIC_ void ndr_print_echo_Info(struct ndr_print *ndr, const char *name, const union echo_Info *r)
385 int level;
386 level = ndr_print_get_switch_value(ndr, r);
387 ndr_print_union(ndr, name, level, "echo_Info");
388 switch (level) {
389 case 1:
390 ndr_print_echo_info1(ndr, "info1", &r->info1);
391 break;
393 case 2:
394 ndr_print_echo_info2(ndr, "info2", &r->info2);
395 break;
397 case 3:
398 ndr_print_echo_info3(ndr, "info3", &r->info3);
399 break;
401 case 4:
402 ndr_print_STRUCT_echo_info4(ndr, "info4", &r->info4);
403 break;
405 case 5:
406 ndr_print_echo_info5(ndr, "info5", &r->info5);
407 break;
409 case 6:
410 ndr_print_echo_info6(ndr, "info6", &r->info6);
411 break;
413 case 7:
414 ndr_print_echo_info7(ndr, "info7", &r->info7);
415 break;
417 default:
418 ndr_print_bad_level(ndr, name, level);
422 static enum ndr_err_code ndr_push_echo_Enum1(struct ndr_push *ndr, int ndr_flags, enum echo_Enum1 r)
424 NDR_CHECK(ndr_push_enum_uint1632(ndr, NDR_SCALARS, r));
425 return NDR_ERR_SUCCESS;
428 static enum ndr_err_code ndr_pull_echo_Enum1(struct ndr_pull *ndr, int ndr_flags, enum echo_Enum1 *r)
430 uint16_t v;
431 NDR_CHECK(ndr_pull_enum_uint1632(ndr, NDR_SCALARS, &v));
432 *r = v;
433 return NDR_ERR_SUCCESS;
436 _PUBLIC_ void ndr_print_echo_Enum1(struct ndr_print *ndr, const char *name, enum echo_Enum1 r)
438 const char *val = NULL;
440 switch (r) {
441 case ECHO_ENUM1: val = "ECHO_ENUM1"; break;
442 case ECHO_ENUM2: val = "ECHO_ENUM2"; break;
444 ndr_print_enum(ndr, name, "ENUM", val, r);
447 static enum ndr_err_code ndr_push_echo_Enum1_32(struct ndr_push *ndr, int ndr_flags, enum echo_Enum1_32 r)
449 NDR_CHECK(ndr_push_enum_uint32(ndr, NDR_SCALARS, r));
450 return NDR_ERR_SUCCESS;
453 static enum ndr_err_code ndr_pull_echo_Enum1_32(struct ndr_pull *ndr, int ndr_flags, enum echo_Enum1_32 *r)
455 uint32_t v;
456 NDR_CHECK(ndr_pull_enum_uint32(ndr, NDR_SCALARS, &v));
457 *r = v;
458 return NDR_ERR_SUCCESS;
461 _PUBLIC_ void ndr_print_echo_Enum1_32(struct ndr_print *ndr, const char *name, enum echo_Enum1_32 r)
463 const char *val = NULL;
465 switch (r) {
466 case ECHO_ENUM1_32: val = "ECHO_ENUM1_32"; break;
467 case ECHO_ENUM2_32: val = "ECHO_ENUM2_32"; break;
469 ndr_print_enum(ndr, name, "ENUM", val, r);
472 static enum ndr_err_code ndr_push_echo_Enum2(struct ndr_push *ndr, int ndr_flags, const struct echo_Enum2 *r)
474 if (ndr_flags & NDR_SCALARS) {
475 NDR_CHECK(ndr_push_align(ndr, 4));
476 NDR_CHECK(ndr_push_echo_Enum1(ndr, NDR_SCALARS, r->e1));
477 NDR_CHECK(ndr_push_echo_Enum1_32(ndr, NDR_SCALARS, r->e2));
478 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
480 if (ndr_flags & NDR_BUFFERS) {
482 return NDR_ERR_SUCCESS;
485 static enum ndr_err_code ndr_pull_echo_Enum2(struct ndr_pull *ndr, int ndr_flags, struct echo_Enum2 *r)
487 if (ndr_flags & NDR_SCALARS) {
488 NDR_CHECK(ndr_pull_align(ndr, 4));
489 NDR_CHECK(ndr_pull_echo_Enum1(ndr, NDR_SCALARS, &r->e1));
490 NDR_CHECK(ndr_pull_echo_Enum1_32(ndr, NDR_SCALARS, &r->e2));
491 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
493 if (ndr_flags & NDR_BUFFERS) {
495 return NDR_ERR_SUCCESS;
498 _PUBLIC_ void ndr_print_echo_Enum2(struct ndr_print *ndr, const char *name, const struct echo_Enum2 *r)
500 ndr_print_struct(ndr, name, "echo_Enum2");
501 ndr->depth++;
502 ndr_print_echo_Enum1(ndr, "e1", r->e1);
503 ndr_print_echo_Enum1_32(ndr, "e2", r->e2);
504 ndr->depth--;
507 static enum ndr_err_code ndr_push_echo_Enum3(struct ndr_push *ndr, int ndr_flags, const union echo_Enum3 *r)
509 if (ndr_flags & NDR_SCALARS) {
510 int level = ndr_push_get_switch_value(ndr, r);
511 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, level));
512 NDR_CHECK(ndr_push_union_align(ndr, 4));
513 switch (level) {
514 case ECHO_ENUM1: {
515 NDR_CHECK(ndr_push_echo_Enum1(ndr, NDR_SCALARS, r->e1));
516 break; }
518 case ECHO_ENUM2: {
519 NDR_CHECK(ndr_push_echo_Enum2(ndr, NDR_SCALARS, &r->e2));
520 break; }
522 default:
523 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
526 if (ndr_flags & NDR_BUFFERS) {
527 int level = ndr_push_get_switch_value(ndr, r);
528 switch (level) {
529 case ECHO_ENUM1:
530 break;
532 case ECHO_ENUM2:
533 break;
535 default:
536 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
539 return NDR_ERR_SUCCESS;
542 static enum ndr_err_code ndr_pull_echo_Enum3(struct ndr_pull *ndr, int ndr_flags, union echo_Enum3 *r)
544 int level;
545 uint16_t _level;
546 level = ndr_pull_get_switch_value(ndr, r);
547 if (ndr_flags & NDR_SCALARS) {
548 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level));
549 if (_level != level) {
550 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
552 NDR_CHECK(ndr_pull_union_align(ndr, 4));
553 switch (level) {
554 case ECHO_ENUM1: {
555 NDR_CHECK(ndr_pull_echo_Enum1(ndr, NDR_SCALARS, &r->e1));
556 break; }
558 case ECHO_ENUM2: {
559 NDR_CHECK(ndr_pull_echo_Enum2(ndr, NDR_SCALARS, &r->e2));
560 break; }
562 default:
563 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
566 if (ndr_flags & NDR_BUFFERS) {
567 switch (level) {
568 case ECHO_ENUM1:
569 break;
571 case ECHO_ENUM2:
572 break;
574 default:
575 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
578 return NDR_ERR_SUCCESS;
581 _PUBLIC_ void ndr_print_echo_Enum3(struct ndr_print *ndr, const char *name, const union echo_Enum3 *r)
583 int level;
584 level = ndr_print_get_switch_value(ndr, r);
585 ndr_print_union(ndr, name, level, "echo_Enum3");
586 switch (level) {
587 case ECHO_ENUM1:
588 ndr_print_echo_Enum1(ndr, "e1", r->e1);
589 break;
591 case ECHO_ENUM2:
592 ndr_print_echo_Enum2(ndr, "e2", &r->e2);
593 break;
595 default:
596 ndr_print_bad_level(ndr, name, level);
600 static enum ndr_err_code ndr_push_echo_Surrounding(struct ndr_push *ndr, int ndr_flags, const struct echo_Surrounding *r)
602 uint32_t cntr_surrounding_0;
603 if (ndr_flags & NDR_SCALARS) {
604 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->x));
605 NDR_CHECK(ndr_push_align(ndr, 4));
606 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->x));
607 for (cntr_surrounding_0 = 0; cntr_surrounding_0 < r->x; cntr_surrounding_0++) {
608 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->surrounding[cntr_surrounding_0]));
610 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
612 if (ndr_flags & NDR_BUFFERS) {
614 return NDR_ERR_SUCCESS;
617 static enum ndr_err_code ndr_pull_echo_Surrounding(struct ndr_pull *ndr, int ndr_flags, struct echo_Surrounding *r)
619 uint32_t cntr_surrounding_0;
620 TALLOC_CTX *_mem_save_surrounding_0;
621 if (ndr_flags & NDR_SCALARS) {
622 NDR_CHECK(ndr_pull_array_size(ndr, &r->surrounding));
623 NDR_CHECK(ndr_pull_align(ndr, 4));
624 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->x));
625 NDR_PULL_ALLOC_N(ndr, r->surrounding, ndr_get_array_size(ndr, &r->surrounding));
626 _mem_save_surrounding_0 = NDR_PULL_GET_MEM_CTX(ndr);
627 NDR_PULL_SET_MEM_CTX(ndr, r->surrounding, 0);
628 for (cntr_surrounding_0 = 0; cntr_surrounding_0 < r->x; cntr_surrounding_0++) {
629 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->surrounding[cntr_surrounding_0]));
631 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_surrounding_0, 0);
632 if (r->surrounding) {
633 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->surrounding, r->x));
635 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
637 if (ndr_flags & NDR_BUFFERS) {
639 return NDR_ERR_SUCCESS;
642 _PUBLIC_ void ndr_print_echo_Surrounding(struct ndr_print *ndr, const char *name, const struct echo_Surrounding *r)
644 uint32_t cntr_surrounding_0;
645 ndr_print_struct(ndr, name, "echo_Surrounding");
646 ndr->depth++;
647 ndr_print_uint32(ndr, "x", r->x);
648 ndr->print(ndr, "%s: ARRAY(%d)", "surrounding", (int)r->x);
649 ndr->depth++;
650 for (cntr_surrounding_0=0;cntr_surrounding_0<r->x;cntr_surrounding_0++) {
651 char *idx_0=NULL;
652 if (asprintf(&idx_0, "[%d]", cntr_surrounding_0) != -1) {
653 ndr_print_uint16(ndr, "surrounding", r->surrounding[cntr_surrounding_0]);
654 free(idx_0);
657 ndr->depth--;
658 ndr->depth--;
661 static enum ndr_err_code ndr_push_echo_AddOne(struct ndr_push *ndr, int flags, const struct echo_AddOne *r)
663 if (flags & NDR_IN) {
664 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.in_data));
666 if (flags & NDR_OUT) {
667 if (r->out.out_data == NULL) {
668 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
670 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.out_data));
672 return NDR_ERR_SUCCESS;
675 static enum ndr_err_code ndr_pull_echo_AddOne(struct ndr_pull *ndr, int flags, struct echo_AddOne *r)
677 TALLOC_CTX *_mem_save_out_data_0;
678 if (flags & NDR_IN) {
679 ZERO_STRUCT(r->out);
681 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.in_data));
682 NDR_PULL_ALLOC(ndr, r->out.out_data);
683 ZERO_STRUCTP(r->out.out_data);
685 if (flags & NDR_OUT) {
686 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
687 NDR_PULL_ALLOC(ndr, r->out.out_data);
689 _mem_save_out_data_0 = NDR_PULL_GET_MEM_CTX(ndr);
690 NDR_PULL_SET_MEM_CTX(ndr, r->out.out_data, LIBNDR_FLAG_REF_ALLOC);
691 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.out_data));
692 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_out_data_0, LIBNDR_FLAG_REF_ALLOC);
694 return NDR_ERR_SUCCESS;
697 _PUBLIC_ void ndr_print_echo_AddOne(struct ndr_print *ndr, const char *name, int flags, const struct echo_AddOne *r)
699 ndr_print_struct(ndr, name, "echo_AddOne");
700 ndr->depth++;
701 if (flags & NDR_SET_VALUES) {
702 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
704 if (flags & NDR_IN) {
705 ndr_print_struct(ndr, "in", "echo_AddOne");
706 ndr->depth++;
707 ndr_print_uint32(ndr, "in_data", r->in.in_data);
708 ndr->depth--;
710 if (flags & NDR_OUT) {
711 ndr_print_struct(ndr, "out", "echo_AddOne");
712 ndr->depth++;
713 ndr_print_ptr(ndr, "out_data", r->out.out_data);
714 ndr->depth++;
715 ndr_print_uint32(ndr, "out_data", *r->out.out_data);
716 ndr->depth--;
717 ndr->depth--;
719 ndr->depth--;
722 static enum ndr_err_code ndr_push_echo_EchoData(struct ndr_push *ndr, int flags, const struct echo_EchoData *r)
724 if (flags & NDR_IN) {
725 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.len));
726 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.len));
727 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.in_data, r->in.len));
729 if (flags & NDR_OUT) {
730 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.len));
731 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.out_data, r->in.len));
733 return NDR_ERR_SUCCESS;
736 static enum ndr_err_code ndr_pull_echo_EchoData(struct ndr_pull *ndr, int flags, struct echo_EchoData *r)
738 if (flags & NDR_IN) {
739 ZERO_STRUCT(r->out);
741 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.len));
742 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.in_data));
743 NDR_PULL_ALLOC_N(ndr, r->in.in_data, ndr_get_array_size(ndr, &r->in.in_data));
744 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.in_data, ndr_get_array_size(ndr, &r->in.in_data)));
745 if (r->in.in_data) {
746 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.in_data, r->in.len));
749 if (flags & NDR_OUT) {
750 NDR_CHECK(ndr_pull_array_size(ndr, &r->out.out_data));
751 NDR_PULL_ALLOC_N(ndr, r->out.out_data, ndr_get_array_size(ndr, &r->out.out_data));
752 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.out_data, ndr_get_array_size(ndr, &r->out.out_data)));
753 if (r->out.out_data) {
754 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.out_data, r->in.len));
757 return NDR_ERR_SUCCESS;
760 _PUBLIC_ void ndr_print_echo_EchoData(struct ndr_print *ndr, const char *name, int flags, const struct echo_EchoData *r)
762 ndr_print_struct(ndr, name, "echo_EchoData");
763 ndr->depth++;
764 if (flags & NDR_SET_VALUES) {
765 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
767 if (flags & NDR_IN) {
768 ndr_print_struct(ndr, "in", "echo_EchoData");
769 ndr->depth++;
770 ndr_print_uint32(ndr, "len", r->in.len);
771 ndr_print_array_uint8(ndr, "in_data", r->in.in_data, r->in.len);
772 ndr->depth--;
774 if (flags & NDR_OUT) {
775 ndr_print_struct(ndr, "out", "echo_EchoData");
776 ndr->depth++;
777 ndr_print_array_uint8(ndr, "out_data", r->out.out_data, r->in.len);
778 ndr->depth--;
780 ndr->depth--;
783 static enum ndr_err_code ndr_push_echo_SinkData(struct ndr_push *ndr, int flags, const struct echo_SinkData *r)
785 if (flags & NDR_IN) {
786 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.len));
787 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.len));
788 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.data, r->in.len));
790 if (flags & NDR_OUT) {
792 return NDR_ERR_SUCCESS;
795 static enum ndr_err_code ndr_pull_echo_SinkData(struct ndr_pull *ndr, int flags, struct echo_SinkData *r)
797 if (flags & NDR_IN) {
798 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.len));
799 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.data));
800 NDR_PULL_ALLOC_N(ndr, r->in.data, ndr_get_array_size(ndr, &r->in.data));
801 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.data, ndr_get_array_size(ndr, &r->in.data)));
802 if (r->in.data) {
803 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.data, r->in.len));
806 if (flags & NDR_OUT) {
808 return NDR_ERR_SUCCESS;
811 _PUBLIC_ void ndr_print_echo_SinkData(struct ndr_print *ndr, const char *name, int flags, const struct echo_SinkData *r)
813 ndr_print_struct(ndr, name, "echo_SinkData");
814 ndr->depth++;
815 if (flags & NDR_SET_VALUES) {
816 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
818 if (flags & NDR_IN) {
819 ndr_print_struct(ndr, "in", "echo_SinkData");
820 ndr->depth++;
821 ndr_print_uint32(ndr, "len", r->in.len);
822 ndr_print_array_uint8(ndr, "data", r->in.data, r->in.len);
823 ndr->depth--;
825 if (flags & NDR_OUT) {
826 ndr_print_struct(ndr, "out", "echo_SinkData");
827 ndr->depth++;
828 ndr->depth--;
830 ndr->depth--;
833 static enum ndr_err_code ndr_push_echo_SourceData(struct ndr_push *ndr, int flags, const struct echo_SourceData *r)
835 if (flags & NDR_IN) {
836 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.len));
838 if (flags & NDR_OUT) {
839 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.len));
840 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.data, r->in.len));
842 return NDR_ERR_SUCCESS;
845 static enum ndr_err_code ndr_pull_echo_SourceData(struct ndr_pull *ndr, int flags, struct echo_SourceData *r)
847 if (flags & NDR_IN) {
848 ZERO_STRUCT(r->out);
850 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.len));
852 if (flags & NDR_OUT) {
853 NDR_CHECK(ndr_pull_array_size(ndr, &r->out.data));
854 NDR_PULL_ALLOC_N(ndr, r->out.data, ndr_get_array_size(ndr, &r->out.data));
855 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.data, ndr_get_array_size(ndr, &r->out.data)));
856 if (r->out.data) {
857 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.data, r->in.len));
860 return NDR_ERR_SUCCESS;
863 _PUBLIC_ void ndr_print_echo_SourceData(struct ndr_print *ndr, const char *name, int flags, const struct echo_SourceData *r)
865 ndr_print_struct(ndr, name, "echo_SourceData");
866 ndr->depth++;
867 if (flags & NDR_SET_VALUES) {
868 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
870 if (flags & NDR_IN) {
871 ndr_print_struct(ndr, "in", "echo_SourceData");
872 ndr->depth++;
873 ndr_print_uint32(ndr, "len", r->in.len);
874 ndr->depth--;
876 if (flags & NDR_OUT) {
877 ndr_print_struct(ndr, "out", "echo_SourceData");
878 ndr->depth++;
879 ndr_print_array_uint8(ndr, "data", r->out.data, r->in.len);
880 ndr->depth--;
882 ndr->depth--;
885 static enum ndr_err_code ndr_push_echo_TestCall(struct ndr_push *ndr, int flags, const struct echo_TestCall *r)
887 if (flags & NDR_IN) {
888 if (r->in.s1 == NULL) {
889 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
891 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.s1, CH_UTF16)));
892 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
893 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.s1, CH_UTF16)));
894 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.s1, ndr_charset_length(r->in.s1, CH_UTF16), sizeof(uint16_t), CH_UTF16));
896 if (flags & NDR_OUT) {
897 if (r->out.s2 == NULL) {
898 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
900 NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.s2));
901 if (*r->out.s2) {
902 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(*r->out.s2, CH_UTF16)));
903 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
904 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(*r->out.s2, CH_UTF16)));
905 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.s2, ndr_charset_length(*r->out.s2, CH_UTF16), sizeof(uint16_t), CH_UTF16));
908 return NDR_ERR_SUCCESS;
911 static enum ndr_err_code ndr_pull_echo_TestCall(struct ndr_pull *ndr, int flags, struct echo_TestCall *r)
913 uint32_t _ptr_s2;
914 TALLOC_CTX *_mem_save_s2_0;
915 TALLOC_CTX *_mem_save_s2_1;
916 if (flags & NDR_IN) {
917 ZERO_STRUCT(r->out);
919 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.s1));
920 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.s1));
921 if (ndr_get_array_length(ndr, &r->in.s1) > ndr_get_array_size(ndr, &r->in.s1)) {
922 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.s1), ndr_get_array_length(ndr, &r->in.s1));
924 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.s1), sizeof(uint16_t)));
925 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.s1, ndr_get_array_length(ndr, &r->in.s1), sizeof(uint16_t), CH_UTF16));
926 NDR_PULL_ALLOC(ndr, r->out.s2);
927 ZERO_STRUCTP(r->out.s2);
929 if (flags & NDR_OUT) {
930 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
931 NDR_PULL_ALLOC(ndr, r->out.s2);
933 _mem_save_s2_0 = NDR_PULL_GET_MEM_CTX(ndr);
934 NDR_PULL_SET_MEM_CTX(ndr, r->out.s2, LIBNDR_FLAG_REF_ALLOC);
935 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_s2));
936 if (_ptr_s2) {
937 NDR_PULL_ALLOC(ndr, *r->out.s2);
938 } else {
939 *r->out.s2 = NULL;
941 if (*r->out.s2) {
942 _mem_save_s2_1 = NDR_PULL_GET_MEM_CTX(ndr);
943 NDR_PULL_SET_MEM_CTX(ndr, *r->out.s2, 0);
944 NDR_CHECK(ndr_pull_array_size(ndr, r->out.s2));
945 NDR_CHECK(ndr_pull_array_length(ndr, r->out.s2));
946 if (ndr_get_array_length(ndr, r->out.s2) > ndr_get_array_size(ndr, r->out.s2)) {
947 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, r->out.s2), ndr_get_array_length(ndr, r->out.s2));
949 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.s2), sizeof(uint16_t)));
950 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.s2, ndr_get_array_length(ndr, r->out.s2), sizeof(uint16_t), CH_UTF16));
951 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_s2_1, 0);
953 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_s2_0, LIBNDR_FLAG_REF_ALLOC);
955 return NDR_ERR_SUCCESS;
958 _PUBLIC_ void ndr_print_echo_TestCall(struct ndr_print *ndr, const char *name, int flags, const struct echo_TestCall *r)
960 ndr_print_struct(ndr, name, "echo_TestCall");
961 ndr->depth++;
962 if (flags & NDR_SET_VALUES) {
963 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
965 if (flags & NDR_IN) {
966 ndr_print_struct(ndr, "in", "echo_TestCall");
967 ndr->depth++;
968 ndr_print_ptr(ndr, "s1", r->in.s1);
969 ndr->depth++;
970 ndr_print_string(ndr, "s1", r->in.s1);
971 ndr->depth--;
972 ndr->depth--;
974 if (flags & NDR_OUT) {
975 ndr_print_struct(ndr, "out", "echo_TestCall");
976 ndr->depth++;
977 ndr_print_ptr(ndr, "s2", r->out.s2);
978 ndr->depth++;
979 ndr_print_ptr(ndr, "s2", *r->out.s2);
980 ndr->depth++;
981 if (*r->out.s2) {
982 ndr_print_string(ndr, "s2", *r->out.s2);
984 ndr->depth--;
985 ndr->depth--;
986 ndr->depth--;
988 ndr->depth--;
991 static enum ndr_err_code ndr_push_echo_TestCall2(struct ndr_push *ndr, int flags, const struct echo_TestCall2 *r)
993 if (flags & NDR_IN) {
994 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level));
996 if (flags & NDR_OUT) {
997 if (r->out.info == NULL) {
998 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1000 NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.info, r->in.level));
1001 NDR_CHECK(ndr_push_echo_Info(ndr, NDR_SCALARS, r->out.info));
1002 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
1004 return NDR_ERR_SUCCESS;
1007 static enum ndr_err_code ndr_pull_echo_TestCall2(struct ndr_pull *ndr, int flags, struct echo_TestCall2 *r)
1009 TALLOC_CTX *_mem_save_info_0;
1010 if (flags & NDR_IN) {
1011 ZERO_STRUCT(r->out);
1013 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.level));
1014 NDR_PULL_ALLOC(ndr, r->out.info);
1015 ZERO_STRUCTP(r->out.info);
1017 if (flags & NDR_OUT) {
1018 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1019 NDR_PULL_ALLOC(ndr, r->out.info);
1021 _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
1022 NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC);
1023 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.info, r->in.level));
1024 NDR_CHECK(ndr_pull_echo_Info(ndr, NDR_SCALARS, r->out.info));
1025 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC);
1026 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
1028 return NDR_ERR_SUCCESS;
1031 _PUBLIC_ void ndr_print_echo_TestCall2(struct ndr_print *ndr, const char *name, int flags, const struct echo_TestCall2 *r)
1033 ndr_print_struct(ndr, name, "echo_TestCall2");
1034 ndr->depth++;
1035 if (flags & NDR_SET_VALUES) {
1036 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1038 if (flags & NDR_IN) {
1039 ndr_print_struct(ndr, "in", "echo_TestCall2");
1040 ndr->depth++;
1041 ndr_print_uint16(ndr, "level", r->in.level);
1042 ndr->depth--;
1044 if (flags & NDR_OUT) {
1045 ndr_print_struct(ndr, "out", "echo_TestCall2");
1046 ndr->depth++;
1047 ndr_print_ptr(ndr, "info", r->out.info);
1048 ndr->depth++;
1049 ndr_print_set_switch_value(ndr, r->out.info, r->in.level);
1050 ndr_print_echo_Info(ndr, "info", r->out.info);
1051 ndr->depth--;
1052 ndr_print_NTSTATUS(ndr, "result", r->out.result);
1053 ndr->depth--;
1055 ndr->depth--;
1058 static enum ndr_err_code ndr_push_echo_TestSleep(struct ndr_push *ndr, int flags, const struct echo_TestSleep *r)
1060 if (flags & NDR_IN) {
1061 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.seconds));
1063 if (flags & NDR_OUT) {
1064 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.result));
1066 return NDR_ERR_SUCCESS;
1069 static enum ndr_err_code ndr_pull_echo_TestSleep(struct ndr_pull *ndr, int flags, struct echo_TestSleep *r)
1071 if (flags & NDR_IN) {
1072 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.seconds));
1074 if (flags & NDR_OUT) {
1075 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.result));
1077 return NDR_ERR_SUCCESS;
1080 _PUBLIC_ void ndr_print_echo_TestSleep(struct ndr_print *ndr, const char *name, int flags, const struct echo_TestSleep *r)
1082 ndr_print_struct(ndr, name, "echo_TestSleep");
1083 ndr->depth++;
1084 if (flags & NDR_SET_VALUES) {
1085 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1087 if (flags & NDR_IN) {
1088 ndr_print_struct(ndr, "in", "echo_TestSleep");
1089 ndr->depth++;
1090 ndr_print_uint32(ndr, "seconds", r->in.seconds);
1091 ndr->depth--;
1093 if (flags & NDR_OUT) {
1094 ndr_print_struct(ndr, "out", "echo_TestSleep");
1095 ndr->depth++;
1096 ndr_print_uint32(ndr, "result", r->out.result);
1097 ndr->depth--;
1099 ndr->depth--;
1102 static enum ndr_err_code ndr_push_echo_TestEnum(struct ndr_push *ndr, int flags, const struct echo_TestEnum *r)
1104 if (flags & NDR_IN) {
1105 if (r->in.foo1 == NULL) {
1106 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1108 NDR_CHECK(ndr_push_echo_Enum1(ndr, NDR_SCALARS, *r->in.foo1));
1109 if (r->in.foo2 == NULL) {
1110 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1112 NDR_CHECK(ndr_push_echo_Enum2(ndr, NDR_SCALARS, r->in.foo2));
1113 if (r->in.foo3 == NULL) {
1114 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1116 NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.foo3, *r->in.foo1));
1117 NDR_CHECK(ndr_push_echo_Enum3(ndr, NDR_SCALARS, r->in.foo3));
1119 if (flags & NDR_OUT) {
1120 if (r->out.foo1 == NULL) {
1121 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1123 NDR_CHECK(ndr_push_echo_Enum1(ndr, NDR_SCALARS, *r->out.foo1));
1124 if (r->out.foo2 == NULL) {
1125 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1127 NDR_CHECK(ndr_push_echo_Enum2(ndr, NDR_SCALARS, r->out.foo2));
1128 if (r->out.foo3 == NULL) {
1129 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1131 NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.foo3, *r->out.foo1));
1132 NDR_CHECK(ndr_push_echo_Enum3(ndr, NDR_SCALARS, r->out.foo3));
1134 return NDR_ERR_SUCCESS;
1137 static enum ndr_err_code ndr_pull_echo_TestEnum(struct ndr_pull *ndr, int flags, struct echo_TestEnum *r)
1139 TALLOC_CTX *_mem_save_foo1_0;
1140 TALLOC_CTX *_mem_save_foo2_0;
1141 TALLOC_CTX *_mem_save_foo3_0;
1142 if (flags & NDR_IN) {
1143 ZERO_STRUCT(r->out);
1145 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1146 NDR_PULL_ALLOC(ndr, r->in.foo1);
1148 _mem_save_foo1_0 = NDR_PULL_GET_MEM_CTX(ndr);
1149 NDR_PULL_SET_MEM_CTX(ndr, r->in.foo1, LIBNDR_FLAG_REF_ALLOC);
1150 NDR_CHECK(ndr_pull_echo_Enum1(ndr, NDR_SCALARS, r->in.foo1));
1151 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_foo1_0, LIBNDR_FLAG_REF_ALLOC);
1152 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1153 NDR_PULL_ALLOC(ndr, r->in.foo2);
1155 _mem_save_foo2_0 = NDR_PULL_GET_MEM_CTX(ndr);
1156 NDR_PULL_SET_MEM_CTX(ndr, r->in.foo2, LIBNDR_FLAG_REF_ALLOC);
1157 NDR_CHECK(ndr_pull_echo_Enum2(ndr, NDR_SCALARS, r->in.foo2));
1158 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_foo2_0, LIBNDR_FLAG_REF_ALLOC);
1159 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1160 NDR_PULL_ALLOC(ndr, r->in.foo3);
1162 _mem_save_foo3_0 = NDR_PULL_GET_MEM_CTX(ndr);
1163 NDR_PULL_SET_MEM_CTX(ndr, r->in.foo3, LIBNDR_FLAG_REF_ALLOC);
1164 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.foo3, *r->in.foo1));
1165 NDR_CHECK(ndr_pull_echo_Enum3(ndr, NDR_SCALARS, r->in.foo3));
1166 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_foo3_0, LIBNDR_FLAG_REF_ALLOC);
1167 NDR_PULL_ALLOC(ndr, r->out.foo1);
1168 *r->out.foo1 = *r->in.foo1;
1169 NDR_PULL_ALLOC(ndr, r->out.foo2);
1170 *r->out.foo2 = *r->in.foo2;
1171 NDR_PULL_ALLOC(ndr, r->out.foo3);
1172 *r->out.foo3 = *r->in.foo3;
1174 if (flags & NDR_OUT) {
1175 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1176 NDR_PULL_ALLOC(ndr, r->out.foo1);
1178 _mem_save_foo1_0 = NDR_PULL_GET_MEM_CTX(ndr);
1179 NDR_PULL_SET_MEM_CTX(ndr, r->out.foo1, LIBNDR_FLAG_REF_ALLOC);
1180 NDR_CHECK(ndr_pull_echo_Enum1(ndr, NDR_SCALARS, r->out.foo1));
1181 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_foo1_0, LIBNDR_FLAG_REF_ALLOC);
1182 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1183 NDR_PULL_ALLOC(ndr, r->out.foo2);
1185 _mem_save_foo2_0 = NDR_PULL_GET_MEM_CTX(ndr);
1186 NDR_PULL_SET_MEM_CTX(ndr, r->out.foo2, LIBNDR_FLAG_REF_ALLOC);
1187 NDR_CHECK(ndr_pull_echo_Enum2(ndr, NDR_SCALARS, r->out.foo2));
1188 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_foo2_0, LIBNDR_FLAG_REF_ALLOC);
1189 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1190 NDR_PULL_ALLOC(ndr, r->out.foo3);
1192 _mem_save_foo3_0 = NDR_PULL_GET_MEM_CTX(ndr);
1193 NDR_PULL_SET_MEM_CTX(ndr, r->out.foo3, LIBNDR_FLAG_REF_ALLOC);
1194 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.foo3, *r->out.foo1));
1195 NDR_CHECK(ndr_pull_echo_Enum3(ndr, NDR_SCALARS, r->out.foo3));
1196 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_foo3_0, LIBNDR_FLAG_REF_ALLOC);
1198 return NDR_ERR_SUCCESS;
1201 _PUBLIC_ void ndr_print_echo_TestEnum(struct ndr_print *ndr, const char *name, int flags, const struct echo_TestEnum *r)
1203 ndr_print_struct(ndr, name, "echo_TestEnum");
1204 ndr->depth++;
1205 if (flags & NDR_SET_VALUES) {
1206 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1208 if (flags & NDR_IN) {
1209 ndr_print_struct(ndr, "in", "echo_TestEnum");
1210 ndr->depth++;
1211 ndr_print_ptr(ndr, "foo1", r->in.foo1);
1212 ndr->depth++;
1213 ndr_print_echo_Enum1(ndr, "foo1", *r->in.foo1);
1214 ndr->depth--;
1215 ndr_print_ptr(ndr, "foo2", r->in.foo2);
1216 ndr->depth++;
1217 ndr_print_echo_Enum2(ndr, "foo2", r->in.foo2);
1218 ndr->depth--;
1219 ndr_print_ptr(ndr, "foo3", r->in.foo3);
1220 ndr->depth++;
1221 ndr_print_set_switch_value(ndr, r->in.foo3, *r->in.foo1);
1222 ndr_print_echo_Enum3(ndr, "foo3", r->in.foo3);
1223 ndr->depth--;
1224 ndr->depth--;
1226 if (flags & NDR_OUT) {
1227 ndr_print_struct(ndr, "out", "echo_TestEnum");
1228 ndr->depth++;
1229 ndr_print_ptr(ndr, "foo1", r->out.foo1);
1230 ndr->depth++;
1231 ndr_print_echo_Enum1(ndr, "foo1", *r->out.foo1);
1232 ndr->depth--;
1233 ndr_print_ptr(ndr, "foo2", r->out.foo2);
1234 ndr->depth++;
1235 ndr_print_echo_Enum2(ndr, "foo2", r->out.foo2);
1236 ndr->depth--;
1237 ndr_print_ptr(ndr, "foo3", r->out.foo3);
1238 ndr->depth++;
1239 ndr_print_set_switch_value(ndr, r->out.foo3, *r->out.foo1);
1240 ndr_print_echo_Enum3(ndr, "foo3", r->out.foo3);
1241 ndr->depth--;
1242 ndr->depth--;
1244 ndr->depth--;
1247 static enum ndr_err_code ndr_push_echo_TestSurrounding(struct ndr_push *ndr, int flags, const struct echo_TestSurrounding *r)
1249 if (flags & NDR_IN) {
1250 if (r->in.data == NULL) {
1251 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1253 NDR_CHECK(ndr_push_echo_Surrounding(ndr, NDR_SCALARS, r->in.data));
1255 if (flags & NDR_OUT) {
1256 if (r->out.data == NULL) {
1257 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1259 NDR_CHECK(ndr_push_echo_Surrounding(ndr, NDR_SCALARS, r->out.data));
1261 return NDR_ERR_SUCCESS;
1264 static enum ndr_err_code ndr_pull_echo_TestSurrounding(struct ndr_pull *ndr, int flags, struct echo_TestSurrounding *r)
1266 TALLOC_CTX *_mem_save_data_0;
1267 if (flags & NDR_IN) {
1268 ZERO_STRUCT(r->out);
1270 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1271 NDR_PULL_ALLOC(ndr, r->in.data);
1273 _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr);
1274 NDR_PULL_SET_MEM_CTX(ndr, r->in.data, LIBNDR_FLAG_REF_ALLOC);
1275 NDR_CHECK(ndr_pull_echo_Surrounding(ndr, NDR_SCALARS, r->in.data));
1276 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, LIBNDR_FLAG_REF_ALLOC);
1277 NDR_PULL_ALLOC(ndr, r->out.data);
1278 *r->out.data = *r->in.data;
1280 if (flags & NDR_OUT) {
1281 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1282 NDR_PULL_ALLOC(ndr, r->out.data);
1284 _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr);
1285 NDR_PULL_SET_MEM_CTX(ndr, r->out.data, LIBNDR_FLAG_REF_ALLOC);
1286 NDR_CHECK(ndr_pull_echo_Surrounding(ndr, NDR_SCALARS, r->out.data));
1287 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, LIBNDR_FLAG_REF_ALLOC);
1289 return NDR_ERR_SUCCESS;
1292 _PUBLIC_ void ndr_print_echo_TestSurrounding(struct ndr_print *ndr, const char *name, int flags, const struct echo_TestSurrounding *r)
1294 ndr_print_struct(ndr, name, "echo_TestSurrounding");
1295 ndr->depth++;
1296 if (flags & NDR_SET_VALUES) {
1297 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1299 if (flags & NDR_IN) {
1300 ndr_print_struct(ndr, "in", "echo_TestSurrounding");
1301 ndr->depth++;
1302 ndr_print_ptr(ndr, "data", r->in.data);
1303 ndr->depth++;
1304 ndr_print_echo_Surrounding(ndr, "data", r->in.data);
1305 ndr->depth--;
1306 ndr->depth--;
1308 if (flags & NDR_OUT) {
1309 ndr_print_struct(ndr, "out", "echo_TestSurrounding");
1310 ndr->depth++;
1311 ndr_print_ptr(ndr, "data", r->out.data);
1312 ndr->depth++;
1313 ndr_print_echo_Surrounding(ndr, "data", r->out.data);
1314 ndr->depth--;
1315 ndr->depth--;
1317 ndr->depth--;
1320 static enum ndr_err_code ndr_push_echo_TestDoublePointer(struct ndr_push *ndr, int flags, const struct echo_TestDoublePointer *r)
1322 if (flags & NDR_IN) {
1323 if (r->in.data == NULL) {
1324 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1326 NDR_CHECK(ndr_push_unique_ptr(ndr, *r->in.data));
1327 if (*r->in.data) {
1328 NDR_CHECK(ndr_push_unique_ptr(ndr, **r->in.data));
1329 if (**r->in.data) {
1330 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, ***r->in.data));
1334 if (flags & NDR_OUT) {
1335 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->out.result));
1337 return NDR_ERR_SUCCESS;
1340 static enum ndr_err_code ndr_pull_echo_TestDoublePointer(struct ndr_pull *ndr, int flags, struct echo_TestDoublePointer *r)
1342 uint32_t _ptr_data;
1343 TALLOC_CTX *_mem_save_data_0;
1344 TALLOC_CTX *_mem_save_data_1;
1345 TALLOC_CTX *_mem_save_data_2;
1346 if (flags & NDR_IN) {
1347 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1348 NDR_PULL_ALLOC(ndr, r->in.data);
1350 _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr);
1351 NDR_PULL_SET_MEM_CTX(ndr, r->in.data, LIBNDR_FLAG_REF_ALLOC);
1352 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data));
1353 if (_ptr_data) {
1354 NDR_PULL_ALLOC(ndr, *r->in.data);
1355 } else {
1356 *r->in.data = NULL;
1358 if (*r->in.data) {
1359 _mem_save_data_1 = NDR_PULL_GET_MEM_CTX(ndr);
1360 NDR_PULL_SET_MEM_CTX(ndr, *r->in.data, 0);
1361 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data));
1362 if (_ptr_data) {
1363 NDR_PULL_ALLOC(ndr, **r->in.data);
1364 } else {
1365 **r->in.data = NULL;
1367 if (**r->in.data) {
1368 _mem_save_data_2 = NDR_PULL_GET_MEM_CTX(ndr);
1369 NDR_PULL_SET_MEM_CTX(ndr, **r->in.data, 0);
1370 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, **r->in.data));
1371 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_2, 0);
1373 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_1, 0);
1375 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, LIBNDR_FLAG_REF_ALLOC);
1377 if (flags & NDR_OUT) {
1378 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->out.result));
1380 return NDR_ERR_SUCCESS;
1383 _PUBLIC_ void ndr_print_echo_TestDoublePointer(struct ndr_print *ndr, const char *name, int flags, const struct echo_TestDoublePointer *r)
1385 ndr_print_struct(ndr, name, "echo_TestDoublePointer");
1386 ndr->depth++;
1387 if (flags & NDR_SET_VALUES) {
1388 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1390 if (flags & NDR_IN) {
1391 ndr_print_struct(ndr, "in", "echo_TestDoublePointer");
1392 ndr->depth++;
1393 ndr_print_ptr(ndr, "data", r->in.data);
1394 ndr->depth++;
1395 ndr_print_ptr(ndr, "data", *r->in.data);
1396 ndr->depth++;
1397 if (*r->in.data) {
1398 ndr_print_ptr(ndr, "data", **r->in.data);
1399 ndr->depth++;
1400 if (**r->in.data) {
1401 ndr_print_uint16(ndr, "data", ***r->in.data);
1403 ndr->depth--;
1405 ndr->depth--;
1406 ndr->depth--;
1407 ndr->depth--;
1409 if (flags & NDR_OUT) {
1410 ndr_print_struct(ndr, "out", "echo_TestDoublePointer");
1411 ndr->depth++;
1412 ndr_print_uint16(ndr, "result", r->out.result);
1413 ndr->depth--;
1415 ndr->depth--;
1418 static const struct ndr_interface_call rpcecho_calls[] = {
1420 "echo_AddOne",
1421 sizeof(struct echo_AddOne),
1422 (ndr_push_flags_fn_t) ndr_push_echo_AddOne,
1423 (ndr_pull_flags_fn_t) ndr_pull_echo_AddOne,
1424 (ndr_print_function_t) ndr_print_echo_AddOne,
1425 false,
1428 "echo_EchoData",
1429 sizeof(struct echo_EchoData),
1430 (ndr_push_flags_fn_t) ndr_push_echo_EchoData,
1431 (ndr_pull_flags_fn_t) ndr_pull_echo_EchoData,
1432 (ndr_print_function_t) ndr_print_echo_EchoData,
1433 false,
1436 "echo_SinkData",
1437 sizeof(struct echo_SinkData),
1438 (ndr_push_flags_fn_t) ndr_push_echo_SinkData,
1439 (ndr_pull_flags_fn_t) ndr_pull_echo_SinkData,
1440 (ndr_print_function_t) ndr_print_echo_SinkData,
1441 false,
1444 "echo_SourceData",
1445 sizeof(struct echo_SourceData),
1446 (ndr_push_flags_fn_t) ndr_push_echo_SourceData,
1447 (ndr_pull_flags_fn_t) ndr_pull_echo_SourceData,
1448 (ndr_print_function_t) ndr_print_echo_SourceData,
1449 false,
1452 "echo_TestCall",
1453 sizeof(struct echo_TestCall),
1454 (ndr_push_flags_fn_t) ndr_push_echo_TestCall,
1455 (ndr_pull_flags_fn_t) ndr_pull_echo_TestCall,
1456 (ndr_print_function_t) ndr_print_echo_TestCall,
1457 false,
1460 "echo_TestCall2",
1461 sizeof(struct echo_TestCall2),
1462 (ndr_push_flags_fn_t) ndr_push_echo_TestCall2,
1463 (ndr_pull_flags_fn_t) ndr_pull_echo_TestCall2,
1464 (ndr_print_function_t) ndr_print_echo_TestCall2,
1465 false,
1468 "echo_TestSleep",
1469 sizeof(struct echo_TestSleep),
1470 (ndr_push_flags_fn_t) ndr_push_echo_TestSleep,
1471 (ndr_pull_flags_fn_t) ndr_pull_echo_TestSleep,
1472 (ndr_print_function_t) ndr_print_echo_TestSleep,
1473 false,
1476 "echo_TestEnum",
1477 sizeof(struct echo_TestEnum),
1478 (ndr_push_flags_fn_t) ndr_push_echo_TestEnum,
1479 (ndr_pull_flags_fn_t) ndr_pull_echo_TestEnum,
1480 (ndr_print_function_t) ndr_print_echo_TestEnum,
1481 false,
1484 "echo_TestSurrounding",
1485 sizeof(struct echo_TestSurrounding),
1486 (ndr_push_flags_fn_t) ndr_push_echo_TestSurrounding,
1487 (ndr_pull_flags_fn_t) ndr_pull_echo_TestSurrounding,
1488 (ndr_print_function_t) ndr_print_echo_TestSurrounding,
1489 false,
1492 "echo_TestDoublePointer",
1493 sizeof(struct echo_TestDoublePointer),
1494 (ndr_push_flags_fn_t) ndr_push_echo_TestDoublePointer,
1495 (ndr_pull_flags_fn_t) ndr_pull_echo_TestDoublePointer,
1496 (ndr_print_function_t) ndr_print_echo_TestDoublePointer,
1497 false,
1499 { NULL, 0, NULL, NULL, NULL, false }
1502 static const char * const rpcecho_endpoint_strings[] = {
1503 "ncacn_np:[\\pipe\\rpcecho]",
1504 "ncacn_ip_tcp:",
1505 "ncalrpc:",
1508 static const struct ndr_interface_string_array rpcecho_endpoints = {
1509 .count = 3,
1510 .names = rpcecho_endpoint_strings
1513 static const char * const rpcecho_authservice_strings[] = {
1514 "host",
1517 static const struct ndr_interface_string_array rpcecho_authservices = {
1518 .count = 1,
1519 .names = rpcecho_authservice_strings
1523 const struct ndr_interface_table ndr_table_rpcecho = {
1524 .name = "rpcecho",
1525 .syntax_id = {
1526 {0x60a15ec5,0x4de8,0x11d7,{0xa6,0x37},{0x00,0x50,0x56,0xa2,0x01,0x82}},
1527 NDR_RPCECHO_VERSION
1529 .helpstring = NDR_RPCECHO_HELPSTRING,
1530 .num_calls = 10,
1531 .calls = rpcecho_calls,
1532 .endpoints = &rpcecho_endpoints,
1533 .authservices = &rpcecho_authservices