1 /* parser auto-generated by pidl */
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");
34 ndr_print_uint8(ndr
, "v", r
->v
);
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");
66 ndr_print_uint16(ndr
, "v", r
->v
);
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");
98 ndr_print_uint32(ndr
, "v", r
->v
);
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");
130 ndr_print_hyper(ndr
, "v", r
->v
);
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");
164 ndr_print_uint8(ndr
, "v1", r
->v1
);
165 ndr_print_hyper(ndr
, "v2", r
->v2
);
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");
199 ndr_print_uint8(ndr
, "v1", r
->v1
);
200 ndr_print_echo_info1(ndr
, "info1", &r
->info1
);
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");
234 ndr_print_uint8(ndr
, "v1", r
->v1
);
235 ndr_print_STRUCT_echo_info4(ndr
, "info4", &r
->info4
);
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));
247 NDR_CHECK(ndr_push_echo_info1(ndr
, NDR_SCALARS
, &r
->info1
));
251 NDR_CHECK(ndr_push_echo_info2(ndr
, NDR_SCALARS
, &r
->info2
));
255 NDR_CHECK(ndr_push_echo_info3(ndr
, NDR_SCALARS
, &r
->info3
));
259 NDR_CHECK(ndr_push_STRUCT_echo_info4(ndr
, NDR_SCALARS
, &r
->info4
));
263 NDR_CHECK(ndr_push_echo_info5(ndr
, NDR_SCALARS
, &r
->info5
));
267 NDR_CHECK(ndr_push_echo_info6(ndr
, NDR_SCALARS
, &r
->info6
));
271 NDR_CHECK(ndr_push_echo_info7(ndr
, NDR_SCALARS
, &r
->info7
));
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
);
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
)
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));
322 NDR_CHECK(ndr_pull_echo_info1(ndr
, NDR_SCALARS
, &r
->info1
));
326 NDR_CHECK(ndr_pull_echo_info2(ndr
, NDR_SCALARS
, &r
->info2
));
330 NDR_CHECK(ndr_pull_echo_info3(ndr
, NDR_SCALARS
, &r
->info3
));
334 NDR_CHECK(ndr_pull_STRUCT_echo_info4(ndr
, NDR_SCALARS
, &r
->info4
));
338 NDR_CHECK(ndr_pull_echo_info5(ndr
, NDR_SCALARS
, &r
->info5
));
342 NDR_CHECK(ndr_pull_echo_info6(ndr
, NDR_SCALARS
, &r
->info6
));
346 NDR_CHECK(ndr_pull_echo_info7(ndr
, NDR_SCALARS
, &r
->info7
));
350 return ndr_pull_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u at %s", level
, __location__
);
353 if (ndr_flags
& NDR_BUFFERS
) {
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
)
386 level
= ndr_print_get_switch_value(ndr
, r
);
387 ndr_print_union(ndr
, name
, level
, "echo_Info");
390 ndr_print_echo_info1(ndr
, "info1", &r
->info1
);
394 ndr_print_echo_info2(ndr
, "info2", &r
->info2
);
398 ndr_print_echo_info3(ndr
, "info3", &r
->info3
);
402 ndr_print_STRUCT_echo_info4(ndr
, "info4", &r
->info4
);
406 ndr_print_echo_info5(ndr
, "info5", &r
->info5
);
410 ndr_print_echo_info6(ndr
, "info6", &r
->info6
);
414 ndr_print_echo_info7(ndr
, "info7", &r
->info7
);
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
)
431 NDR_CHECK(ndr_pull_enum_uint1632(ndr
, NDR_SCALARS
, &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
;
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
)
456 NDR_CHECK(ndr_pull_enum_uint32(ndr
, NDR_SCALARS
, &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
;
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");
502 ndr_print_echo_Enum1(ndr
, "e1", r
->e1
);
503 ndr_print_echo_Enum1_32(ndr
, "e2", r
->e2
);
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));
515 NDR_CHECK(ndr_push_echo_Enum1(ndr
, NDR_SCALARS
, r
->e1
));
519 NDR_CHECK(ndr_push_echo_Enum2(ndr
, NDR_SCALARS
, &r
->e2
));
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
);
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
)
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));
555 NDR_CHECK(ndr_pull_echo_Enum1(ndr
, NDR_SCALARS
, &r
->e1
));
559 NDR_CHECK(ndr_pull_echo_Enum2(ndr
, NDR_SCALARS
, &r
->e2
));
563 return ndr_pull_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u at %s", level
, __location__
);
566 if (ndr_flags
& NDR_BUFFERS
) {
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
)
584 level
= ndr_print_get_switch_value(ndr
, r
);
585 ndr_print_union(ndr
, name
, level
, "echo_Enum3");
588 ndr_print_echo_Enum1(ndr
, "e1", r
->e1
);
592 ndr_print_echo_Enum2(ndr
, "e2", &r
->e2
);
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");
647 ndr_print_uint32(ndr
, "x", r
->x
);
648 ndr
->print(ndr
, "%s: ARRAY(%d)", "surrounding", (int)r
->x
);
650 for (cntr_surrounding_0
=0;cntr_surrounding_0
<r
->x
;cntr_surrounding_0
++) {
652 if (asprintf(&idx_0
, "[%d]", cntr_surrounding_0
) != -1) {
653 ndr_print_uint16(ndr
, "surrounding", r
->surrounding
[cntr_surrounding_0
]);
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
) {
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");
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");
707 ndr_print_uint32(ndr
, "in_data", r
->in
.in_data
);
710 if (flags
& NDR_OUT
) {
711 ndr_print_struct(ndr
, "out", "echo_AddOne");
713 ndr_print_ptr(ndr
, "out_data", r
->out
.out_data
);
715 ndr_print_uint32(ndr
, "out_data", *r
->out
.out_data
);
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
) {
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
)));
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");
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");
770 ndr_print_uint32(ndr
, "len", r
->in
.len
);
771 ndr_print_array_uint8(ndr
, "in_data", r
->in
.in_data
, r
->in
.len
);
774 if (flags
& NDR_OUT
) {
775 ndr_print_struct(ndr
, "out", "echo_EchoData");
777 ndr_print_array_uint8(ndr
, "out_data", r
->out
.out_data
, r
->in
.len
);
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
)));
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");
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");
821 ndr_print_uint32(ndr
, "len", r
->in
.len
);
822 ndr_print_array_uint8(ndr
, "data", r
->in
.data
, r
->in
.len
);
825 if (flags
& NDR_OUT
) {
826 ndr_print_struct(ndr
, "out", "echo_SinkData");
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
) {
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
)));
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");
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");
873 ndr_print_uint32(ndr
, "len", r
->in
.len
);
876 if (flags
& NDR_OUT
) {
877 ndr_print_struct(ndr
, "out", "echo_SourceData");
879 ndr_print_array_uint8(ndr
, "data", r
->out
.data
, r
->in
.len
);
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
));
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
)
914 TALLOC_CTX
*_mem_save_s2_0
;
915 TALLOC_CTX
*_mem_save_s2_1
;
916 if (flags
& NDR_IN
) {
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
));
937 NDR_PULL_ALLOC(ndr
, *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");
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");
968 ndr_print_ptr(ndr
, "s1", r
->in
.s1
);
970 ndr_print_string(ndr
, "s1", r
->in
.s1
);
974 if (flags
& NDR_OUT
) {
975 ndr_print_struct(ndr
, "out", "echo_TestCall");
977 ndr_print_ptr(ndr
, "s2", r
->out
.s2
);
979 ndr_print_ptr(ndr
, "s2", *r
->out
.s2
);
982 ndr_print_string(ndr
, "s2", *r
->out
.s2
);
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");
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");
1041 ndr_print_uint16(ndr
, "level", r
->in
.level
);
1044 if (flags
& NDR_OUT
) {
1045 ndr_print_struct(ndr
, "out", "echo_TestCall2");
1047 ndr_print_ptr(ndr
, "info", r
->out
.info
);
1049 ndr_print_set_switch_value(ndr
, r
->out
.info
, r
->in
.level
);
1050 ndr_print_echo_Info(ndr
, "info", r
->out
.info
);
1052 ndr_print_NTSTATUS(ndr
, "result", r
->out
.result
);
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");
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");
1090 ndr_print_uint32(ndr
, "seconds", r
->in
.seconds
);
1093 if (flags
& NDR_OUT
) {
1094 ndr_print_struct(ndr
, "out", "echo_TestSleep");
1096 ndr_print_uint32(ndr
, "result", r
->out
.result
);
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");
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");
1211 ndr_print_ptr(ndr
, "foo1", r
->in
.foo1
);
1213 ndr_print_echo_Enum1(ndr
, "foo1", *r
->in
.foo1
);
1215 ndr_print_ptr(ndr
, "foo2", r
->in
.foo2
);
1217 ndr_print_echo_Enum2(ndr
, "foo2", r
->in
.foo2
);
1219 ndr_print_ptr(ndr
, "foo3", r
->in
.foo3
);
1221 ndr_print_set_switch_value(ndr
, r
->in
.foo3
, *r
->in
.foo1
);
1222 ndr_print_echo_Enum3(ndr
, "foo3", r
->in
.foo3
);
1226 if (flags
& NDR_OUT
) {
1227 ndr_print_struct(ndr
, "out", "echo_TestEnum");
1229 ndr_print_ptr(ndr
, "foo1", r
->out
.foo1
);
1231 ndr_print_echo_Enum1(ndr
, "foo1", *r
->out
.foo1
);
1233 ndr_print_ptr(ndr
, "foo2", r
->out
.foo2
);
1235 ndr_print_echo_Enum2(ndr
, "foo2", r
->out
.foo2
);
1237 ndr_print_ptr(ndr
, "foo3", r
->out
.foo3
);
1239 ndr_print_set_switch_value(ndr
, r
->out
.foo3
, *r
->out
.foo1
);
1240 ndr_print_echo_Enum3(ndr
, "foo3", r
->out
.foo3
);
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");
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");
1302 ndr_print_ptr(ndr
, "data", r
->in
.data
);
1304 ndr_print_echo_Surrounding(ndr
, "data", r
->in
.data
);
1308 if (flags
& NDR_OUT
) {
1309 ndr_print_struct(ndr
, "out", "echo_TestSurrounding");
1311 ndr_print_ptr(ndr
, "data", r
->out
.data
);
1313 ndr_print_echo_Surrounding(ndr
, "data", r
->out
.data
);
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
));
1328 NDR_CHECK(ndr_push_unique_ptr(ndr
, **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
)
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
));
1354 NDR_PULL_ALLOC(ndr
, *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
));
1363 NDR_PULL_ALLOC(ndr
, **r
->in
.data
);
1365 **r
->in
.data
= NULL
;
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");
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");
1393 ndr_print_ptr(ndr
, "data", r
->in
.data
);
1395 ndr_print_ptr(ndr
, "data", *r
->in
.data
);
1398 ndr_print_ptr(ndr
, "data", **r
->in
.data
);
1401 ndr_print_uint16(ndr
, "data", ***r
->in
.data
);
1409 if (flags
& NDR_OUT
) {
1410 ndr_print_struct(ndr
, "out", "echo_TestDoublePointer");
1412 ndr_print_uint16(ndr
, "result", r
->out
.result
);
1418 static const struct ndr_interface_call rpcecho_calls
[] = {
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
,
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
,
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
,
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
,
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
,
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
,
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
,
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
,
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
,
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
,
1499 { NULL
, 0, NULL
, NULL
, NULL
, false }
1502 static const char * const rpcecho_endpoint_strings
[] = {
1503 "ncacn_np:[\\pipe\\rpcecho]",
1508 static const struct ndr_interface_string_array rpcecho_endpoints
= {
1510 .names
= rpcecho_endpoint_strings
1513 static const char * const rpcecho_authservice_strings
[] = {
1517 static const struct ndr_interface_string_array rpcecho_authservices
= {
1519 .names
= rpcecho_authservice_strings
1523 const struct ndr_interface_table ndr_table_rpcecho
= {
1526 {0x60a15ec5,0x4de8,0x11d7,{0xa6,0x37},{0x00,0x50,0x56,0xa2,0x01,0x82}},
1529 .helpstring
= NDR_RPCECHO_HELPSTRING
,
1531 .calls
= rpcecho_calls
,
1532 .endpoints
= &rpcecho_endpoints
,
1533 .authservices
= &rpcecho_authservices