Line data Source code
1 : /* parser auto-generated by pidl */
2 :
3 : #include "includes.h"
4 : #include "bin/default/librpc/gen_ndr/ndr_echo.h"
5 :
6 587 : _PUBLIC_ enum ndr_err_code ndr_push_echo_info1(struct ndr_push *ndr, int ndr_flags, const struct echo_info1 *r)
7 : {
8 587 : NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
9 587 : if (ndr_flags & NDR_SCALARS) {
10 587 : NDR_CHECK(ndr_push_align(ndr, 1));
11 587 : NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->v));
12 587 : NDR_CHECK(ndr_push_trailer_align(ndr, 1));
13 : }
14 587 : if (ndr_flags & NDR_BUFFERS) {
15 : }
16 587 : return NDR_ERR_SUCCESS;
17 : }
18 :
19 553 : _PUBLIC_ enum ndr_err_code ndr_pull_echo_info1(struct ndr_pull *ndr, int ndr_flags, struct echo_info1 *r)
20 : {
21 553 : NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
22 553 : if (ndr_flags & NDR_SCALARS) {
23 553 : NDR_CHECK(ndr_pull_align(ndr, 1));
24 553 : NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->v));
25 553 : NDR_CHECK(ndr_pull_trailer_align(ndr, 1));
26 : }
27 553 : if (ndr_flags & NDR_BUFFERS) {
28 : }
29 553 : return NDR_ERR_SUCCESS;
30 : }
31 :
32 0 : static void ndr_print_flags_echo_info1(struct ndr_print *ndr, const char *name, int unused, const struct echo_info1 *r)
33 : {
34 0 : ndr_print_echo_info1(ndr, name, r);
35 0 : }
36 :
37 68 : _PUBLIC_ void ndr_print_echo_info1(struct ndr_print *ndr, const char *name, const struct echo_info1 *r)
38 : {
39 68 : ndr_print_struct(ndr, name, "echo_info1");
40 68 : if (r == NULL) { ndr_print_null(ndr); return; }
41 68 : ndr->depth++;
42 68 : ndr_print_uint8(ndr, "v", r->v);
43 68 : ndr->depth--;
44 : }
45 :
46 293 : static enum ndr_err_code ndr_push_echo_info2(struct ndr_push *ndr, int ndr_flags, const struct echo_info2 *r)
47 : {
48 293 : NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
49 293 : if (ndr_flags & NDR_SCALARS) {
50 293 : NDR_CHECK(ndr_push_align(ndr, 2));
51 293 : NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->v));
52 293 : NDR_CHECK(ndr_push_trailer_align(ndr, 2));
53 : }
54 293 : if (ndr_flags & NDR_BUFFERS) {
55 : }
56 293 : return NDR_ERR_SUCCESS;
57 : }
58 :
59 276 : static enum ndr_err_code ndr_pull_echo_info2(struct ndr_pull *ndr, int ndr_flags, struct echo_info2 *r)
60 : {
61 276 : NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
62 276 : if (ndr_flags & NDR_SCALARS) {
63 276 : NDR_CHECK(ndr_pull_align(ndr, 2));
64 276 : NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->v));
65 276 : NDR_CHECK(ndr_pull_trailer_align(ndr, 2));
66 : }
67 276 : if (ndr_flags & NDR_BUFFERS) {
68 : }
69 276 : return NDR_ERR_SUCCESS;
70 : }
71 :
72 34 : _PUBLIC_ void ndr_print_echo_info2(struct ndr_print *ndr, const char *name, const struct echo_info2 *r)
73 : {
74 34 : ndr_print_struct(ndr, name, "echo_info2");
75 34 : if (r == NULL) { ndr_print_null(ndr); return; }
76 34 : ndr->depth++;
77 34 : ndr_print_uint16(ndr, "v", r->v);
78 34 : ndr->depth--;
79 : }
80 :
81 293 : static enum ndr_err_code ndr_push_echo_info3(struct ndr_push *ndr, int ndr_flags, const struct echo_info3 *r)
82 : {
83 293 : NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
84 293 : if (ndr_flags & NDR_SCALARS) {
85 293 : NDR_CHECK(ndr_push_align(ndr, 4));
86 293 : NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->v));
87 293 : NDR_CHECK(ndr_push_trailer_align(ndr, 4));
88 : }
89 293 : if (ndr_flags & NDR_BUFFERS) {
90 : }
91 293 : return NDR_ERR_SUCCESS;
92 : }
93 :
94 276 : static enum ndr_err_code ndr_pull_echo_info3(struct ndr_pull *ndr, int ndr_flags, struct echo_info3 *r)
95 : {
96 276 : NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
97 276 : if (ndr_flags & NDR_SCALARS) {
98 276 : NDR_CHECK(ndr_pull_align(ndr, 4));
99 276 : NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->v));
100 276 : NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
101 : }
102 276 : if (ndr_flags & NDR_BUFFERS) {
103 : }
104 276 : return NDR_ERR_SUCCESS;
105 : }
106 :
107 34 : _PUBLIC_ void ndr_print_echo_info3(struct ndr_print *ndr, const char *name, const struct echo_info3 *r)
108 : {
109 34 : ndr_print_struct(ndr, name, "echo_info3");
110 34 : if (r == NULL) { ndr_print_null(ndr); return; }
111 34 : ndr->depth++;
112 34 : ndr_print_uint32(ndr, "v", r->v);
113 34 : ndr->depth--;
114 : }
115 :
116 586 : static enum ndr_err_code ndr_push_STRUCT_echo_info4(struct ndr_push *ndr, int ndr_flags, const struct echo_info4 *r)
117 : {
118 586 : NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
119 586 : if (ndr_flags & NDR_SCALARS) {
120 586 : NDR_CHECK(ndr_push_align(ndr, 8));
121 586 : NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->v));
122 586 : NDR_CHECK(ndr_push_trailer_align(ndr, 8));
123 : }
124 586 : if (ndr_flags & NDR_BUFFERS) {
125 : }
126 586 : return NDR_ERR_SUCCESS;
127 : }
128 :
129 552 : static enum ndr_err_code ndr_pull_STRUCT_echo_info4(struct ndr_pull *ndr, int ndr_flags, struct echo_info4 *r)
130 : {
131 552 : NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
132 552 : if (ndr_flags & NDR_SCALARS) {
133 552 : NDR_CHECK(ndr_pull_align(ndr, 8));
134 552 : NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->v));
135 552 : NDR_CHECK(ndr_pull_trailer_align(ndr, 8));
136 : }
137 552 : if (ndr_flags & NDR_BUFFERS) {
138 : }
139 552 : return NDR_ERR_SUCCESS;
140 : }
141 :
142 68 : _PUBLIC_ void ndr_print_STRUCT_echo_info4(struct ndr_print *ndr, const char *name, const struct echo_info4 *r)
143 : {
144 68 : ndr_print_struct(ndr, name, "echo_info4");
145 68 : if (r == NULL) { ndr_print_null(ndr); return; }
146 68 : ndr->depth++;
147 68 : ndr_print_hyper(ndr, "v", r->v);
148 68 : ndr->depth--;
149 : }
150 :
151 293 : static enum ndr_err_code ndr_push_echo_info5(struct ndr_push *ndr, int ndr_flags, const struct echo_info5 *r)
152 : {
153 293 : NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
154 293 : if (ndr_flags & NDR_SCALARS) {
155 293 : NDR_CHECK(ndr_push_align(ndr, 8));
156 293 : NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->v1));
157 293 : NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->v2));
158 293 : NDR_CHECK(ndr_push_trailer_align(ndr, 8));
159 : }
160 293 : if (ndr_flags & NDR_BUFFERS) {
161 : }
162 293 : return NDR_ERR_SUCCESS;
163 : }
164 :
165 276 : static enum ndr_err_code ndr_pull_echo_info5(struct ndr_pull *ndr, int ndr_flags, struct echo_info5 *r)
166 : {
167 276 : NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
168 276 : if (ndr_flags & NDR_SCALARS) {
169 276 : NDR_CHECK(ndr_pull_align(ndr, 8));
170 276 : NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->v1));
171 276 : NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->v2));
172 276 : NDR_CHECK(ndr_pull_trailer_align(ndr, 8));
173 : }
174 276 : if (ndr_flags & NDR_BUFFERS) {
175 : }
176 276 : return NDR_ERR_SUCCESS;
177 : }
178 :
179 34 : _PUBLIC_ void ndr_print_echo_info5(struct ndr_print *ndr, const char *name, const struct echo_info5 *r)
180 : {
181 34 : ndr_print_struct(ndr, name, "echo_info5");
182 34 : if (r == NULL) { ndr_print_null(ndr); return; }
183 34 : ndr->depth++;
184 34 : ndr_print_uint8(ndr, "v1", r->v1);
185 34 : ndr_print_hyper(ndr, "v2", r->v2);
186 34 : ndr->depth--;
187 : }
188 :
189 293 : static enum ndr_err_code ndr_push_echo_info6(struct ndr_push *ndr, int ndr_flags, const struct echo_info6 *r)
190 : {
191 293 : NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
192 293 : if (ndr_flags & NDR_SCALARS) {
193 293 : NDR_CHECK(ndr_push_align(ndr, 1));
194 293 : NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->v1));
195 293 : NDR_CHECK(ndr_push_echo_info1(ndr, NDR_SCALARS, &r->info1));
196 293 : NDR_CHECK(ndr_push_trailer_align(ndr, 1));
197 : }
198 293 : if (ndr_flags & NDR_BUFFERS) {
199 : }
200 293 : return NDR_ERR_SUCCESS;
201 : }
202 :
203 276 : static enum ndr_err_code ndr_pull_echo_info6(struct ndr_pull *ndr, int ndr_flags, struct echo_info6 *r)
204 : {
205 276 : NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
206 276 : if (ndr_flags & NDR_SCALARS) {
207 276 : NDR_CHECK(ndr_pull_align(ndr, 1));
208 276 : NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->v1));
209 276 : NDR_CHECK(ndr_pull_echo_info1(ndr, NDR_SCALARS, &r->info1));
210 276 : NDR_CHECK(ndr_pull_trailer_align(ndr, 1));
211 : }
212 276 : if (ndr_flags & NDR_BUFFERS) {
213 : }
214 276 : return NDR_ERR_SUCCESS;
215 : }
216 :
217 34 : _PUBLIC_ void ndr_print_echo_info6(struct ndr_print *ndr, const char *name, const struct echo_info6 *r)
218 : {
219 34 : ndr_print_struct(ndr, name, "echo_info6");
220 34 : if (r == NULL) { ndr_print_null(ndr); return; }
221 34 : ndr->depth++;
222 34 : ndr_print_uint8(ndr, "v1", r->v1);
223 34 : ndr_print_echo_info1(ndr, "info1", &r->info1);
224 34 : ndr->depth--;
225 : }
226 :
227 293 : static enum ndr_err_code ndr_push_echo_info7(struct ndr_push *ndr, int ndr_flags, const struct echo_info7 *r)
228 : {
229 293 : NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
230 293 : if (ndr_flags & NDR_SCALARS) {
231 293 : NDR_CHECK(ndr_push_align(ndr, 8));
232 293 : NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->v1));
233 293 : NDR_CHECK(ndr_push_STRUCT_echo_info4(ndr, NDR_SCALARS, &r->info4));
234 293 : NDR_CHECK(ndr_push_trailer_align(ndr, 8));
235 : }
236 293 : if (ndr_flags & NDR_BUFFERS) {
237 : }
238 293 : return NDR_ERR_SUCCESS;
239 : }
240 :
241 276 : static enum ndr_err_code ndr_pull_echo_info7(struct ndr_pull *ndr, int ndr_flags, struct echo_info7 *r)
242 : {
243 276 : NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
244 276 : if (ndr_flags & NDR_SCALARS) {
245 276 : NDR_CHECK(ndr_pull_align(ndr, 8));
246 276 : NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->v1));
247 276 : NDR_CHECK(ndr_pull_STRUCT_echo_info4(ndr, NDR_SCALARS, &r->info4));
248 276 : NDR_CHECK(ndr_pull_trailer_align(ndr, 8));
249 : }
250 276 : if (ndr_flags & NDR_BUFFERS) {
251 : }
252 276 : return NDR_ERR_SUCCESS;
253 : }
254 :
255 34 : _PUBLIC_ void ndr_print_echo_info7(struct ndr_print *ndr, const char *name, const struct echo_info7 *r)
256 : {
257 34 : ndr_print_struct(ndr, name, "echo_info7");
258 34 : if (r == NULL) { ndr_print_null(ndr); return; }
259 34 : ndr->depth++;
260 34 : ndr_print_uint8(ndr, "v1", r->v1);
261 34 : ndr_print_STRUCT_echo_info4(ndr, "info4", &r->info4);
262 34 : ndr->depth--;
263 : }
264 :
265 2051 : static enum ndr_err_code ndr_push_echo_Info(struct ndr_push *ndr, int ndr_flags, const union echo_Info *r)
266 : {
267 : uint32_t level;
268 2051 : NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
269 2051 : if (ndr_flags & NDR_SCALARS) {
270 : /* This token is not used again (except perhaps below in the NDR_BUFFERS case) */
271 2051 : NDR_CHECK(ndr_push_steal_switch_value(ndr, r, &level));
272 2051 : NDR_CHECK(ndr_push_union_align(ndr, 8));
273 2051 : NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, level));
274 2051 : NDR_CHECK(ndr_push_union_align(ndr, 8));
275 2051 : switch (level) {
276 293 : case 1: {
277 293 : NDR_CHECK(ndr_push_echo_info1(ndr, NDR_SCALARS, &r->info1));
278 293 : break; }
279 :
280 293 : case 2: {
281 293 : NDR_CHECK(ndr_push_echo_info2(ndr, NDR_SCALARS, &r->info2));
282 293 : break; }
283 :
284 293 : case 3: {
285 293 : NDR_CHECK(ndr_push_echo_info3(ndr, NDR_SCALARS, &r->info3));
286 293 : break; }
287 :
288 293 : case 4: {
289 293 : NDR_CHECK(ndr_push_STRUCT_echo_info4(ndr, NDR_SCALARS, &r->info4));
290 293 : break; }
291 :
292 293 : case 5: {
293 293 : NDR_CHECK(ndr_push_echo_info5(ndr, NDR_SCALARS, &r->info5));
294 293 : break; }
295 :
296 293 : case 6: {
297 293 : NDR_CHECK(ndr_push_echo_info6(ndr, NDR_SCALARS, &r->info6));
298 293 : break; }
299 :
300 293 : case 7: {
301 293 : NDR_CHECK(ndr_push_echo_info7(ndr, NDR_SCALARS, &r->info7));
302 293 : break; }
303 :
304 0 : default:
305 0 : return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
306 : }
307 0 : }
308 2051 : if (ndr_flags & NDR_BUFFERS) {
309 0 : if (!(ndr_flags & NDR_SCALARS)) {
310 : /* We didn't get it above, and the token is not needed after this. */
311 0 : NDR_CHECK(ndr_push_steal_switch_value(ndr, r, &level));
312 : }
313 0 : switch (level) {
314 0 : case 1:
315 0 : break;
316 :
317 0 : case 2:
318 0 : break;
319 :
320 0 : case 3:
321 0 : break;
322 :
323 0 : case 4:
324 0 : break;
325 :
326 0 : case 5:
327 0 : break;
328 :
329 0 : case 6:
330 0 : break;
331 :
332 0 : case 7:
333 0 : break;
334 :
335 0 : default:
336 0 : return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
337 : }
338 1239 : }
339 2051 : return NDR_ERR_SUCCESS;
340 : }
341 :
342 1932 : static enum ndr_err_code ndr_pull_echo_Info(struct ndr_pull *ndr, int ndr_flags, union echo_Info *r)
343 : {
344 : uint32_t level;
345 : uint16_t _level;
346 1932 : NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
347 1932 : if (ndr_flags & NDR_SCALARS) {
348 : /* This token is not used again (except perhaps below in the NDR_BUFFERS case) */
349 1932 : NDR_CHECK(ndr_pull_steal_switch_value(ndr, r, &level));
350 1932 : NDR_CHECK(ndr_pull_union_align(ndr, 8));
351 1932 : NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level));
352 1932 : if (_level != level) {
353 0 : return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
354 : }
355 1932 : NDR_CHECK(ndr_pull_union_align(ndr, 8));
356 1932 : switch (level) {
357 276 : case 1: {
358 276 : NDR_CHECK(ndr_pull_echo_info1(ndr, NDR_SCALARS, &r->info1));
359 276 : break; }
360 :
361 276 : case 2: {
362 276 : NDR_CHECK(ndr_pull_echo_info2(ndr, NDR_SCALARS, &r->info2));
363 276 : break; }
364 :
365 276 : case 3: {
366 276 : NDR_CHECK(ndr_pull_echo_info3(ndr, NDR_SCALARS, &r->info3));
367 276 : break; }
368 :
369 276 : case 4: {
370 276 : NDR_CHECK(ndr_pull_STRUCT_echo_info4(ndr, NDR_SCALARS, &r->info4));
371 276 : break; }
372 :
373 276 : case 5: {
374 276 : NDR_CHECK(ndr_pull_echo_info5(ndr, NDR_SCALARS, &r->info5));
375 276 : break; }
376 :
377 276 : case 6: {
378 276 : NDR_CHECK(ndr_pull_echo_info6(ndr, NDR_SCALARS, &r->info6));
379 276 : break; }
380 :
381 276 : case 7: {
382 276 : NDR_CHECK(ndr_pull_echo_info7(ndr, NDR_SCALARS, &r->info7));
383 276 : break; }
384 :
385 0 : default:
386 0 : return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
387 : }
388 0 : }
389 1932 : if (ndr_flags & NDR_BUFFERS) {
390 0 : if (!(ndr_flags & NDR_SCALARS)) {
391 : /* We didn't get it above, and the token is not needed after this. */
392 0 : NDR_CHECK(ndr_pull_steal_switch_value(ndr, r, &level));
393 : }
394 0 : switch (level) {
395 0 : case 1:
396 0 : break;
397 :
398 0 : case 2:
399 0 : break;
400 :
401 0 : case 3:
402 0 : break;
403 :
404 0 : case 4:
405 0 : break;
406 :
407 0 : case 5:
408 0 : break;
409 :
410 0 : case 6:
411 0 : break;
412 :
413 0 : case 7:
414 0 : break;
415 :
416 0 : default:
417 0 : return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
418 : }
419 1176 : }
420 1932 : return NDR_ERR_SUCCESS;
421 : }
422 :
423 238 : _PUBLIC_ void ndr_print_echo_Info(struct ndr_print *ndr, const char *name, const union echo_Info *r)
424 : {
425 : uint32_t level;
426 238 : level = ndr_print_steal_switch_value(ndr, r);
427 238 : ndr_print_union(ndr, name, level, "echo_Info");
428 238 : switch (level) {
429 34 : case 1:
430 34 : ndr_print_echo_info1(ndr, "info1", &r->info1);
431 34 : break;
432 :
433 34 : case 2:
434 34 : ndr_print_echo_info2(ndr, "info2", &r->info2);
435 34 : break;
436 :
437 34 : case 3:
438 34 : ndr_print_echo_info3(ndr, "info3", &r->info3);
439 34 : break;
440 :
441 34 : case 4:
442 34 : ndr_print_STRUCT_echo_info4(ndr, "info4", &r->info4);
443 34 : break;
444 :
445 34 : case 5:
446 34 : ndr_print_echo_info5(ndr, "info5", &r->info5);
447 34 : break;
448 :
449 34 : case 6:
450 34 : ndr_print_echo_info6(ndr, "info6", &r->info6);
451 34 : break;
452 :
453 34 : case 7:
454 34 : ndr_print_echo_info7(ndr, "info7", &r->info7);
455 34 : break;
456 :
457 0 : default:
458 0 : ndr_print_bad_level(ndr, name, level);
459 : }
460 238 : }
461 :
462 1707 : static enum ndr_err_code ndr_push_echo_Enum1(struct ndr_push *ndr, int ndr_flags, enum echo_Enum1 r)
463 : {
464 1707 : NDR_CHECK(ndr_push_enum_uint1632(ndr, NDR_SCALARS, r));
465 1707 : return NDR_ERR_SUCCESS;
466 : }
467 :
468 1656 : static enum ndr_err_code ndr_pull_echo_Enum1(struct ndr_pull *ndr, int ndr_flags, enum echo_Enum1 *r)
469 : {
470 : uint16_t v;
471 1656 : NDR_CHECK(ndr_pull_enum_uint1632(ndr, NDR_SCALARS, &v));
472 1656 : *r = v;
473 1656 : return NDR_ERR_SUCCESS;
474 : }
475 :
476 102 : _PUBLIC_ void ndr_print_echo_Enum1(struct ndr_print *ndr, const char *name, enum echo_Enum1 r)
477 : {
478 102 : const char *val = NULL;
479 :
480 102 : switch (r) {
481 34 : case ECHO_ENUM1: val = "ECHO_ENUM1"; break;
482 68 : case ECHO_ENUM2: val = "ECHO_ENUM2"; break;
483 : }
484 102 : ndr_print_enum(ndr, name, "ENUM", val, r);
485 102 : }
486 :
487 569 : static enum ndr_err_code ndr_push_echo_Enum1_32(struct ndr_push *ndr, int ndr_flags, enum echo_Enum1_32 r)
488 : {
489 569 : NDR_CHECK(ndr_push_enum_uint32(ndr, NDR_SCALARS, r));
490 569 : return NDR_ERR_SUCCESS;
491 : }
492 :
493 552 : static enum ndr_err_code ndr_pull_echo_Enum1_32(struct ndr_pull *ndr, int ndr_flags, enum echo_Enum1_32 *r)
494 : {
495 : uint32_t v;
496 552 : NDR_CHECK(ndr_pull_enum_uint32(ndr, NDR_SCALARS, &v));
497 552 : *r = v;
498 552 : return NDR_ERR_SUCCESS;
499 : }
500 :
501 34 : _PUBLIC_ void ndr_print_echo_Enum1_32(struct ndr_print *ndr, const char *name, enum echo_Enum1_32 r)
502 : {
503 34 : const char *val = NULL;
504 :
505 34 : switch (r) {
506 34 : case ECHO_ENUM1_32: val = "ECHO_ENUM1_32"; break;
507 0 : case ECHO_ENUM2_32: val = "ECHO_ENUM2_32"; break;
508 : }
509 34 : ndr_print_enum(ndr, name, "ENUM", val, r);
510 34 : }
511 :
512 569 : static enum ndr_err_code ndr_push_echo_Enum2(struct ndr_push *ndr, int ndr_flags, const struct echo_Enum2 *r)
513 : {
514 569 : NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
515 569 : if (ndr_flags & NDR_SCALARS) {
516 569 : NDR_CHECK(ndr_push_align(ndr, 4));
517 569 : NDR_CHECK(ndr_push_echo_Enum1(ndr, NDR_SCALARS, r->e1));
518 569 : NDR_CHECK(ndr_push_echo_Enum1_32(ndr, NDR_SCALARS, r->e2));
519 569 : NDR_CHECK(ndr_push_trailer_align(ndr, 4));
520 : }
521 569 : if (ndr_flags & NDR_BUFFERS) {
522 : }
523 569 : return NDR_ERR_SUCCESS;
524 : }
525 :
526 552 : static enum ndr_err_code ndr_pull_echo_Enum2(struct ndr_pull *ndr, int ndr_flags, struct echo_Enum2 *r)
527 : {
528 552 : NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
529 552 : if (ndr_flags & NDR_SCALARS) {
530 552 : NDR_CHECK(ndr_pull_align(ndr, 4));
531 552 : NDR_CHECK(ndr_pull_echo_Enum1(ndr, NDR_SCALARS, &r->e1));
532 552 : NDR_CHECK(ndr_pull_echo_Enum1_32(ndr, NDR_SCALARS, &r->e2));
533 552 : NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
534 : }
535 552 : if (ndr_flags & NDR_BUFFERS) {
536 : }
537 552 : return NDR_ERR_SUCCESS;
538 : }
539 :
540 34 : _PUBLIC_ void ndr_print_echo_Enum2(struct ndr_print *ndr, const char *name, const struct echo_Enum2 *r)
541 : {
542 34 : ndr_print_struct(ndr, name, "echo_Enum2");
543 34 : if (r == NULL) { ndr_print_null(ndr); return; }
544 34 : ndr->depth++;
545 34 : ndr_print_echo_Enum1(ndr, "e1", r->e1);
546 34 : ndr_print_echo_Enum1_32(ndr, "e2", r->e2);
547 34 : ndr->depth--;
548 : }
549 :
550 569 : static enum ndr_err_code ndr_push_echo_Enum3(struct ndr_push *ndr, int ndr_flags, const union echo_Enum3 *r)
551 : {
552 : uint32_t level;
553 569 : NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
554 569 : if (ndr_flags & NDR_SCALARS) {
555 : /* This token is not used again (except perhaps below in the NDR_BUFFERS case) */
556 569 : NDR_CHECK(ndr_push_steal_switch_value(ndr, r, &level));
557 569 : NDR_CHECK(ndr_push_union_align(ndr, 4));
558 569 : NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, level));
559 569 : NDR_CHECK(ndr_push_union_align(ndr, 4));
560 569 : switch (level) {
561 569 : case ECHO_ENUM1: {
562 569 : NDR_CHECK(ndr_push_echo_Enum1(ndr, NDR_SCALARS, r->e1));
563 569 : break; }
564 :
565 0 : case ECHO_ENUM2: {
566 0 : NDR_CHECK(ndr_push_echo_Enum2(ndr, NDR_SCALARS, &r->e2));
567 0 : break; }
568 :
569 0 : default:
570 0 : return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
571 : }
572 0 : }
573 569 : if (ndr_flags & NDR_BUFFERS) {
574 0 : if (!(ndr_flags & NDR_SCALARS)) {
575 : /* We didn't get it above, and the token is not needed after this. */
576 0 : NDR_CHECK(ndr_push_steal_switch_value(ndr, r, &level));
577 : }
578 0 : switch (level) {
579 0 : case ECHO_ENUM1:
580 0 : break;
581 :
582 0 : case ECHO_ENUM2:
583 0 : break;
584 :
585 0 : default:
586 0 : return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
587 : }
588 345 : }
589 569 : return NDR_ERR_SUCCESS;
590 : }
591 :
592 552 : static enum ndr_err_code ndr_pull_echo_Enum3(struct ndr_pull *ndr, int ndr_flags, union echo_Enum3 *r)
593 : {
594 : uint32_t level;
595 : uint16_t _level;
596 552 : NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
597 552 : if (ndr_flags & NDR_SCALARS) {
598 : /* This token is not used again (except perhaps below in the NDR_BUFFERS case) */
599 552 : NDR_CHECK(ndr_pull_steal_switch_value(ndr, r, &level));
600 552 : NDR_CHECK(ndr_pull_union_align(ndr, 4));
601 552 : NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level));
602 552 : if (_level != level) {
603 0 : return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
604 : }
605 552 : NDR_CHECK(ndr_pull_union_align(ndr, 4));
606 552 : switch (level) {
607 552 : case ECHO_ENUM1: {
608 552 : NDR_CHECK(ndr_pull_echo_Enum1(ndr, NDR_SCALARS, &r->e1));
609 552 : break; }
610 :
611 0 : case ECHO_ENUM2: {
612 0 : NDR_CHECK(ndr_pull_echo_Enum2(ndr, NDR_SCALARS, &r->e2));
613 0 : break; }
614 :
615 0 : default:
616 0 : return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
617 : }
618 0 : }
619 552 : if (ndr_flags & NDR_BUFFERS) {
620 0 : if (!(ndr_flags & NDR_SCALARS)) {
621 : /* We didn't get it above, and the token is not needed after this. */
622 0 : NDR_CHECK(ndr_pull_steal_switch_value(ndr, r, &level));
623 : }
624 0 : switch (level) {
625 0 : case ECHO_ENUM1:
626 0 : break;
627 :
628 0 : case ECHO_ENUM2:
629 0 : break;
630 :
631 0 : default:
632 0 : return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
633 : }
634 336 : }
635 552 : return NDR_ERR_SUCCESS;
636 : }
637 :
638 34 : _PUBLIC_ void ndr_print_echo_Enum3(struct ndr_print *ndr, const char *name, const union echo_Enum3 *r)
639 : {
640 : uint32_t level;
641 34 : level = ndr_print_steal_switch_value(ndr, r);
642 34 : ndr_print_union(ndr, name, level, "echo_Enum3");
643 34 : switch (level) {
644 34 : case ECHO_ENUM1:
645 34 : ndr_print_echo_Enum1(ndr, "e1", r->e1);
646 34 : break;
647 :
648 0 : case ECHO_ENUM2:
649 0 : ndr_print_echo_Enum2(ndr, "e2", &r->e2);
650 0 : break;
651 :
652 0 : default:
653 0 : ndr_print_bad_level(ndr, name, level);
654 : }
655 34 : }
656 :
657 571 : static enum ndr_err_code ndr_push_echo_Surrounding(struct ndr_push *ndr, int ndr_flags, const struct echo_Surrounding *r)
658 : {
659 : uint32_t cntr_surrounding_0;
660 571 : NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
661 571 : if (ndr_flags & NDR_SCALARS) {
662 571 : NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->x));
663 571 : NDR_CHECK(ndr_push_align(ndr, 4));
664 571 : NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->x));
665 17823 : for (cntr_surrounding_0 = 0; cntr_surrounding_0 < (r->x); cntr_surrounding_0++) {
666 17252 : NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->surrounding[cntr_surrounding_0]));
667 : }
668 571 : NDR_CHECK(ndr_push_trailer_align(ndr, 4));
669 : }
670 571 : if (ndr_flags & NDR_BUFFERS) {
671 : }
672 571 : return NDR_ERR_SUCCESS;
673 : }
674 :
675 554 : static enum ndr_err_code ndr_pull_echo_Surrounding(struct ndr_pull *ndr, int ndr_flags, struct echo_Surrounding *r)
676 : {
677 554 : uint32_t size_surrounding_0 = 0;
678 : uint32_t cntr_surrounding_0;
679 554 : TALLOC_CTX *_mem_save_surrounding_0 = NULL;
680 554 : NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
681 554 : if (ndr_flags & NDR_SCALARS) {
682 554 : NDR_CHECK(ndr_pull_array_size(ndr, &r->surrounding));
683 554 : NDR_CHECK(ndr_pull_align(ndr, 4));
684 554 : NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->x));
685 554 : NDR_CHECK(ndr_get_array_size(ndr, (void*)&r->surrounding, &size_surrounding_0));
686 554 : NDR_PULL_ALLOC_N(ndr, r->surrounding, size_surrounding_0);
687 554 : _mem_save_surrounding_0 = NDR_PULL_GET_MEM_CTX(ndr);
688 554 : NDR_PULL_SET_MEM_CTX(ndr, r->surrounding, 0);
689 17126 : for (cntr_surrounding_0 = 0; cntr_surrounding_0 < (size_surrounding_0); cntr_surrounding_0++) {
690 16572 : NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->surrounding[cntr_surrounding_0]));
691 : }
692 554 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_surrounding_0, 0);
693 554 : if (r->surrounding) {
694 554 : NDR_CHECK(ndr_check_steal_array_size(ndr, (void*)&r->surrounding, r->x));
695 : }
696 554 : NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
697 : }
698 554 : if (ndr_flags & NDR_BUFFERS) {
699 : }
700 554 : return NDR_ERR_SUCCESS;
701 : }
702 :
703 34 : _PUBLIC_ void ndr_print_echo_Surrounding(struct ndr_print *ndr, const char *name, const struct echo_Surrounding *r)
704 : {
705 : uint32_t cntr_surrounding_0;
706 34 : ndr_print_struct(ndr, name, "echo_Surrounding");
707 34 : if (r == NULL) { ndr_print_null(ndr); return; }
708 34 : ndr->depth++;
709 34 : ndr_print_uint32(ndr, "x", r->x);
710 34 : ndr->print(ndr, "%s: ARRAY(%d)", "surrounding", (int)r->x);
711 34 : ndr->depth++;
712 1394 : for (cntr_surrounding_0 = 0; cntr_surrounding_0 < (r->x); cntr_surrounding_0++) {
713 1360 : ndr_print_uint16(ndr, "surrounding", r->surrounding[cntr_surrounding_0]);
714 : }
715 34 : ndr->depth--;
716 34 : ndr->depth--;
717 : }
718 :
719 7975 : static enum ndr_err_code ndr_push_echo_AddOne(struct ndr_push *ndr, int flags, const struct echo_AddOne *r)
720 : {
721 7975 : NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
722 7975 : if (flags & NDR_IN) {
723 3866 : NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.in_data));
724 : }
725 7975 : if (flags & NDR_OUT) {
726 4109 : if (r->out.out_data == NULL) {
727 0 : return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
728 : }
729 4109 : NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.out_data));
730 : }
731 7975 : return NDR_ERR_SUCCESS;
732 : }
733 :
734 7737 : static enum ndr_err_code ndr_pull_echo_AddOne(struct ndr_pull *ndr, int flags, struct echo_AddOne *r)
735 : {
736 7737 : TALLOC_CTX *_mem_save_out_data_0 = NULL;
737 7737 : NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
738 7737 : if (flags & NDR_IN) {
739 3871 : NDR_ZERO_STRUCT(r->out);
740 :
741 3871 : NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.in_data));
742 3871 : NDR_PULL_ALLOC(ndr, r->out.out_data);
743 3871 : NDR_ZERO_STRUCTP(r->out.out_data);
744 : }
745 7737 : if (flags & NDR_OUT) {
746 : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
747 : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
748 3866 : if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
749 268 : NDR_PULL_ALLOC(ndr, r->out.out_data);
750 : }
751 3866 : _mem_save_out_data_0 = NDR_PULL_GET_MEM_CTX(ndr);
752 3866 : NDR_PULL_SET_MEM_CTX(ndr, r->out.out_data, LIBNDR_FLAG_REF_ALLOC);
753 3866 : NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.out_data));
754 3866 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_out_data_0, LIBNDR_FLAG_REF_ALLOC);
755 : }
756 7737 : return NDR_ERR_SUCCESS;
757 : }
758 :
759 476 : _PUBLIC_ void ndr_print_echo_AddOne(struct ndr_print *ndr, const char *name, int flags, const struct echo_AddOne *r)
760 : {
761 476 : ndr_print_struct(ndr, name, "echo_AddOne");
762 476 : if (r == NULL) { ndr_print_null(ndr); return; }
763 476 : ndr->depth++;
764 476 : if (flags & NDR_SET_VALUES) {
765 0 : ndr->flags |= LIBNDR_PRINT_SET_VALUES;
766 : }
767 476 : if (flags & NDR_IN) {
768 0 : ndr_print_struct(ndr, "in", "echo_AddOne");
769 0 : ndr->depth++;
770 0 : ndr_print_uint32(ndr, "in_data", r->in.in_data);
771 0 : ndr->depth--;
772 : }
773 476 : if (flags & NDR_OUT) {
774 476 : ndr_print_struct(ndr, "out", "echo_AddOne");
775 476 : ndr->depth++;
776 476 : ndr_print_ptr(ndr, "out_data", r->out.out_data);
777 476 : ndr->depth++;
778 476 : ndr_print_uint32(ndr, "out_data", *r->out.out_data);
779 476 : ndr->depth--;
780 476 : ndr->depth--;
781 : }
782 476 : ndr->depth--;
783 : }
784 :
785 583 : static enum ndr_err_code ndr_push_echo_EchoData(struct ndr_push *ndr, int flags, const struct echo_EchoData *r)
786 : {
787 583 : NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
788 583 : if (flags & NDR_IN) {
789 283 : NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.len));
790 283 : NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.len));
791 283 : NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.in_data, r->in.len));
792 : }
793 583 : if (flags & NDR_OUT) {
794 300 : NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.len));
795 300 : NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.out_data, r->in.len));
796 : }
797 583 : return NDR_ERR_SUCCESS;
798 : }
799 :
800 566 : static enum ndr_err_code ndr_pull_echo_EchoData(struct ndr_pull *ndr, int flags, struct echo_EchoData *r)
801 : {
802 566 : uint32_t size_in_data_0 = 0;
803 566 : uint32_t size_out_data_0 = 0;
804 566 : NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
805 566 : if (flags & NDR_IN) {
806 283 : NDR_ZERO_STRUCT(r->out);
807 :
808 283 : NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.len));
809 283 : NDR_CHECK(ndr_pull_array_size(ndr, &r->in.in_data));
810 283 : NDR_CHECK(ndr_get_array_size(ndr, (void*)&r->in.in_data, &size_in_data_0));
811 283 : NDR_PULL_ALLOC_N(ndr, r->in.in_data, size_in_data_0);
812 283 : NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.in_data, size_in_data_0));
813 283 : if (r->in.in_data) {
814 283 : NDR_CHECK(ndr_check_steal_array_size(ndr, (void*)&r->in.in_data, r->in.len));
815 : }
816 : }
817 566 : if (flags & NDR_OUT) {
818 : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
819 : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
820 283 : NDR_CHECK(ndr_pull_array_size(ndr, &r->out.out_data));
821 283 : NDR_CHECK(ndr_get_array_size(ndr, (void*)&r->out.out_data, &size_out_data_0));
822 283 : NDR_PULL_ALLOC_N(ndr, r->out.out_data, size_out_data_0);
823 283 : NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.out_data, size_out_data_0));
824 283 : if (r->out.out_data) {
825 283 : NDR_CHECK(ndr_check_steal_array_size(ndr, (void*)&r->out.out_data, r->in.len));
826 : }
827 : }
828 566 : return NDR_ERR_SUCCESS;
829 : }
830 :
831 34 : _PUBLIC_ void ndr_print_echo_EchoData(struct ndr_print *ndr, const char *name, int flags, const struct echo_EchoData *r)
832 : {
833 34 : ndr_print_struct(ndr, name, "echo_EchoData");
834 34 : if (r == NULL) { ndr_print_null(ndr); return; }
835 34 : ndr->depth++;
836 34 : if (flags & NDR_SET_VALUES) {
837 0 : ndr->flags |= LIBNDR_PRINT_SET_VALUES;
838 : }
839 34 : if (flags & NDR_IN) {
840 0 : ndr_print_struct(ndr, "in", "echo_EchoData");
841 0 : ndr->depth++;
842 0 : ndr_print_uint32(ndr, "len", r->in.len);
843 0 : ndr_print_array_uint8(ndr, "in_data", r->in.in_data, r->in.len);
844 0 : ndr->depth--;
845 : }
846 34 : if (flags & NDR_OUT) {
847 34 : ndr_print_struct(ndr, "out", "echo_EchoData");
848 34 : ndr->depth++;
849 34 : ndr_print_array_uint8(ndr, "out_data", r->out.out_data, r->in.len);
850 34 : ndr->depth--;
851 : }
852 34 : ndr->depth--;
853 : }
854 :
855 569 : static enum ndr_err_code ndr_push_echo_SinkData(struct ndr_push *ndr, int flags, const struct echo_SinkData *r)
856 : {
857 569 : NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
858 569 : if (flags & NDR_IN) {
859 276 : NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.len));
860 276 : NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.len));
861 276 : NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.data, r->in.len));
862 : }
863 569 : if (flags & NDR_OUT) {
864 : }
865 569 : return NDR_ERR_SUCCESS;
866 : }
867 :
868 552 : static enum ndr_err_code ndr_pull_echo_SinkData(struct ndr_pull *ndr, int flags, struct echo_SinkData *r)
869 : {
870 552 : uint32_t size_data_0 = 0;
871 552 : NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
872 552 : if (flags & NDR_IN) {
873 276 : NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.len));
874 276 : NDR_CHECK(ndr_pull_array_size(ndr, &r->in.data));
875 276 : NDR_CHECK(ndr_get_array_size(ndr, (void*)&r->in.data, &size_data_0));
876 276 : NDR_PULL_ALLOC_N(ndr, r->in.data, size_data_0);
877 276 : NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.data, size_data_0));
878 276 : if (r->in.data) {
879 276 : NDR_CHECK(ndr_check_steal_array_size(ndr, (void*)&r->in.data, r->in.len));
880 : }
881 : }
882 552 : if (flags & NDR_OUT) {
883 : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
884 : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
885 : }
886 552 : return NDR_ERR_SUCCESS;
887 : }
888 :
889 34 : _PUBLIC_ void ndr_print_echo_SinkData(struct ndr_print *ndr, const char *name, int flags, const struct echo_SinkData *r)
890 : {
891 34 : ndr_print_struct(ndr, name, "echo_SinkData");
892 34 : if (r == NULL) { ndr_print_null(ndr); return; }
893 34 : ndr->depth++;
894 34 : if (flags & NDR_SET_VALUES) {
895 0 : ndr->flags |= LIBNDR_PRINT_SET_VALUES;
896 : }
897 34 : if (flags & NDR_IN) {
898 0 : ndr_print_struct(ndr, "in", "echo_SinkData");
899 0 : ndr->depth++;
900 0 : ndr_print_uint32(ndr, "len", r->in.len);
901 0 : ndr_print_array_uint8(ndr, "data", r->in.data, r->in.len);
902 0 : ndr->depth--;
903 : }
904 34 : if (flags & NDR_OUT) {
905 34 : ndr_print_struct(ndr, "out", "echo_SinkData");
906 34 : ndr->depth++;
907 34 : ndr->depth--;
908 : }
909 34 : ndr->depth--;
910 : }
911 :
912 569 : static enum ndr_err_code ndr_push_echo_SourceData(struct ndr_push *ndr, int flags, const struct echo_SourceData *r)
913 : {
914 569 : NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
915 569 : if (flags & NDR_IN) {
916 276 : NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.len));
917 : }
918 569 : if (flags & NDR_OUT) {
919 293 : NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.len));
920 293 : NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.data, r->in.len));
921 : }
922 569 : return NDR_ERR_SUCCESS;
923 : }
924 :
925 552 : static enum ndr_err_code ndr_pull_echo_SourceData(struct ndr_pull *ndr, int flags, struct echo_SourceData *r)
926 : {
927 552 : uint32_t size_data_0 = 0;
928 552 : NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
929 552 : if (flags & NDR_IN) {
930 276 : NDR_ZERO_STRUCT(r->out);
931 :
932 276 : NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.len));
933 : }
934 552 : if (flags & NDR_OUT) {
935 : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
936 : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
937 276 : NDR_CHECK(ndr_pull_array_size(ndr, &r->out.data));
938 276 : NDR_CHECK(ndr_get_array_size(ndr, (void*)&r->out.data, &size_data_0));
939 276 : NDR_PULL_ALLOC_N(ndr, r->out.data, size_data_0);
940 276 : NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.data, size_data_0));
941 276 : if (r->out.data) {
942 276 : NDR_CHECK(ndr_check_steal_array_size(ndr, (void*)&r->out.data, r->in.len));
943 : }
944 : }
945 552 : return NDR_ERR_SUCCESS;
946 : }
947 :
948 34 : _PUBLIC_ void ndr_print_echo_SourceData(struct ndr_print *ndr, const char *name, int flags, const struct echo_SourceData *r)
949 : {
950 34 : ndr_print_struct(ndr, name, "echo_SourceData");
951 34 : if (r == NULL) { ndr_print_null(ndr); return; }
952 34 : ndr->depth++;
953 34 : if (flags & NDR_SET_VALUES) {
954 0 : ndr->flags |= LIBNDR_PRINT_SET_VALUES;
955 : }
956 34 : if (flags & NDR_IN) {
957 0 : ndr_print_struct(ndr, "in", "echo_SourceData");
958 0 : ndr->depth++;
959 0 : ndr_print_uint32(ndr, "len", r->in.len);
960 0 : ndr->depth--;
961 : }
962 34 : if (flags & NDR_OUT) {
963 34 : ndr_print_struct(ndr, "out", "echo_SourceData");
964 34 : ndr->depth++;
965 34 : ndr_print_array_uint8(ndr, "data", r->out.data, r->in.len);
966 34 : ndr->depth--;
967 : }
968 34 : ndr->depth--;
969 : }
970 :
971 571 : static enum ndr_err_code ndr_push_echo_TestCall(struct ndr_push *ndr, int flags, const struct echo_TestCall *r)
972 : {
973 571 : NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
974 571 : if (flags & NDR_IN) {
975 277 : if (r->in.s1 == NULL) {
976 0 : return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
977 : }
978 277 : NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.s1, CH_UTF16)));
979 277 : NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
980 277 : NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.s1, CH_UTF16)));
981 277 : NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.s1, ndr_charset_length(r->in.s1, CH_UTF16), sizeof(uint16_t), CH_UTF16));
982 : }
983 571 : if (flags & NDR_OUT) {
984 294 : if (r->out.s2 == NULL) {
985 0 : return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
986 : }
987 294 : NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.s2));
988 294 : if (*r->out.s2) {
989 294 : NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(*r->out.s2, CH_UTF16)));
990 294 : NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
991 294 : NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(*r->out.s2, CH_UTF16)));
992 294 : NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.s2, ndr_charset_length(*r->out.s2, CH_UTF16), sizeof(uint16_t), CH_UTF16));
993 : }
994 : }
995 571 : return NDR_ERR_SUCCESS;
996 : }
997 :
998 554 : static enum ndr_err_code ndr_pull_echo_TestCall(struct ndr_pull *ndr, int flags, struct echo_TestCall *r)
999 : {
1000 554 : uint32_t size_s1_1 = 0;
1001 554 : uint32_t length_s1_1 = 0;
1002 : uint32_t _ptr_s2;
1003 554 : uint32_t size_s2_2 = 0;
1004 554 : uint32_t length_s2_2 = 0;
1005 554 : TALLOC_CTX *_mem_save_s2_0 = NULL;
1006 554 : TALLOC_CTX *_mem_save_s2_1 = NULL;
1007 554 : NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
1008 554 : if (flags & NDR_IN) {
1009 277 : NDR_ZERO_STRUCT(r->out);
1010 :
1011 277 : NDR_CHECK(ndr_pull_array_size(ndr, &r->in.s1));
1012 277 : NDR_CHECK(ndr_pull_array_length(ndr, &r->in.s1));
1013 277 : NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.s1, &size_s1_1));
1014 277 : NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.s1, &length_s1_1));
1015 277 : if (length_s1_1 > size_s1_1) {
1016 0 : return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_s1_1, length_s1_1);
1017 : }
1018 277 : NDR_CHECK(ndr_check_string_terminator(ndr, length_s1_1, sizeof(uint16_t)));
1019 277 : NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.s1, length_s1_1, sizeof(uint16_t), CH_UTF16));
1020 277 : NDR_PULL_ALLOC(ndr, r->out.s2);
1021 277 : NDR_ZERO_STRUCTP(r->out.s2);
1022 : }
1023 554 : if (flags & NDR_OUT) {
1024 : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
1025 : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
1026 277 : if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1027 20 : NDR_PULL_ALLOC(ndr, r->out.s2);
1028 : }
1029 277 : _mem_save_s2_0 = NDR_PULL_GET_MEM_CTX(ndr);
1030 277 : NDR_PULL_SET_MEM_CTX(ndr, r->out.s2, LIBNDR_FLAG_REF_ALLOC);
1031 277 : NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_s2));
1032 277 : if (_ptr_s2) {
1033 277 : NDR_PULL_ALLOC(ndr, *r->out.s2);
1034 : } else {
1035 0 : *r->out.s2 = NULL;
1036 : }
1037 277 : if (*r->out.s2) {
1038 277 : _mem_save_s2_1 = NDR_PULL_GET_MEM_CTX(ndr);
1039 277 : NDR_PULL_SET_MEM_CTX(ndr, *r->out.s2, 0);
1040 277 : NDR_CHECK(ndr_pull_array_size(ndr, r->out.s2));
1041 277 : NDR_CHECK(ndr_pull_array_length(ndr, r->out.s2));
1042 277 : NDR_CHECK(ndr_steal_array_size(ndr, (void*)r->out.s2, &size_s2_2));
1043 277 : NDR_CHECK(ndr_steal_array_length(ndr, (void*)r->out.s2, &length_s2_2));
1044 277 : if (length_s2_2 > size_s2_2) {
1045 0 : return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_s2_2, length_s2_2);
1046 : }
1047 277 : NDR_CHECK(ndr_check_string_terminator(ndr, length_s2_2, sizeof(uint16_t)));
1048 277 : NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.s2, length_s2_2, sizeof(uint16_t), CH_UTF16));
1049 277 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_s2_1, 0);
1050 : }
1051 277 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_s2_0, LIBNDR_FLAG_REF_ALLOC);
1052 : }
1053 554 : return NDR_ERR_SUCCESS;
1054 : }
1055 :
1056 34 : _PUBLIC_ void ndr_print_echo_TestCall(struct ndr_print *ndr, const char *name, int flags, const struct echo_TestCall *r)
1057 : {
1058 34 : ndr_print_struct(ndr, name, "echo_TestCall");
1059 34 : if (r == NULL) { ndr_print_null(ndr); return; }
1060 34 : ndr->depth++;
1061 34 : if (flags & NDR_SET_VALUES) {
1062 0 : ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1063 : }
1064 34 : if (flags & NDR_IN) {
1065 0 : ndr_print_struct(ndr, "in", "echo_TestCall");
1066 0 : ndr->depth++;
1067 0 : ndr_print_ptr(ndr, "s1", r->in.s1);
1068 0 : ndr->depth++;
1069 0 : ndr_print_string(ndr, "s1", r->in.s1);
1070 0 : ndr->depth--;
1071 0 : ndr->depth--;
1072 : }
1073 34 : if (flags & NDR_OUT) {
1074 34 : ndr_print_struct(ndr, "out", "echo_TestCall");
1075 34 : ndr->depth++;
1076 34 : ndr_print_ptr(ndr, "s2", r->out.s2);
1077 34 : ndr->depth++;
1078 34 : ndr_print_ptr(ndr, "s2", *r->out.s2);
1079 34 : ndr->depth++;
1080 34 : if (*r->out.s2) {
1081 34 : ndr_print_string(ndr, "s2", *r->out.s2);
1082 : }
1083 34 : ndr->depth--;
1084 34 : ndr->depth--;
1085 34 : ndr->depth--;
1086 : }
1087 34 : ndr->depth--;
1088 : }
1089 :
1090 3983 : static enum ndr_err_code ndr_push_echo_TestCall2(struct ndr_push *ndr, int flags, const struct echo_TestCall2 *r)
1091 : {
1092 3983 : NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
1093 3983 : if (flags & NDR_IN) {
1094 1932 : NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level));
1095 : }
1096 3983 : if (flags & NDR_OUT) {
1097 2051 : if (r->out.info == NULL) {
1098 0 : return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1099 : }
1100 2051 : NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.info, r->in.level));
1101 2051 : NDR_CHECK(ndr_push_echo_Info(ndr, NDR_SCALARS, r->out.info));
1102 2051 : NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
1103 : }
1104 3983 : return NDR_ERR_SUCCESS;
1105 : }
1106 :
1107 3864 : static enum ndr_err_code ndr_pull_echo_TestCall2(struct ndr_pull *ndr, int flags, struct echo_TestCall2 *r)
1108 : {
1109 3864 : TALLOC_CTX *_mem_save_info_0 = NULL;
1110 3864 : NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
1111 3864 : if (flags & NDR_IN) {
1112 1932 : NDR_ZERO_STRUCT(r->out);
1113 :
1114 1932 : NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.level));
1115 1932 : NDR_PULL_ALLOC(ndr, r->out.info);
1116 1932 : NDR_ZERO_STRUCTP(r->out.info);
1117 : }
1118 3864 : if (flags & NDR_OUT) {
1119 : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
1120 : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
1121 1932 : if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1122 133 : NDR_PULL_ALLOC(ndr, r->out.info);
1123 : }
1124 1932 : _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
1125 1932 : NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC);
1126 1932 : NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.info, r->in.level));
1127 1932 : NDR_CHECK(ndr_pull_echo_Info(ndr, NDR_SCALARS, r->out.info));
1128 1932 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC);
1129 1932 : NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
1130 : }
1131 3864 : return NDR_ERR_SUCCESS;
1132 : }
1133 :
1134 238 : _PUBLIC_ void ndr_print_echo_TestCall2(struct ndr_print *ndr, const char *name, int flags, const struct echo_TestCall2 *r)
1135 : {
1136 238 : ndr_print_struct(ndr, name, "echo_TestCall2");
1137 238 : if (r == NULL) { ndr_print_null(ndr); return; }
1138 238 : ndr->depth++;
1139 238 : if (flags & NDR_SET_VALUES) {
1140 0 : ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1141 : }
1142 238 : if (flags & NDR_IN) {
1143 0 : ndr_print_struct(ndr, "in", "echo_TestCall2");
1144 0 : ndr->depth++;
1145 0 : ndr_print_uint16(ndr, "level", r->in.level);
1146 0 : ndr->depth--;
1147 : }
1148 238 : if (flags & NDR_OUT) {
1149 238 : ndr_print_struct(ndr, "out", "echo_TestCall2");
1150 238 : ndr->depth++;
1151 238 : ndr_print_ptr(ndr, "info", r->out.info);
1152 238 : ndr->depth++;
1153 238 : ndr_print_set_switch_value(ndr, r->out.info, r->in.level);
1154 238 : ndr_print_echo_Info(ndr, "info", r->out.info);
1155 238 : ndr->depth--;
1156 238 : ndr_print_NTSTATUS(ndr, "result", r->out.result);
1157 238 : ndr->depth--;
1158 : }
1159 238 : ndr->depth--;
1160 : }
1161 :
1162 291 : static enum ndr_err_code ndr_push_echo_TestSleep(struct ndr_push *ndr, int flags, const struct echo_TestSleep *r)
1163 : {
1164 291 : NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
1165 291 : if (flags & NDR_IN) {
1166 144 : NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.seconds));
1167 : }
1168 291 : if (flags & NDR_OUT) {
1169 147 : NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.result));
1170 : }
1171 291 : return NDR_ERR_SUCCESS;
1172 : }
1173 :
1174 288 : static enum ndr_err_code ndr_pull_echo_TestSleep(struct ndr_pull *ndr, int flags, struct echo_TestSleep *r)
1175 : {
1176 288 : NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
1177 288 : if (flags & NDR_IN) {
1178 144 : NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.seconds));
1179 : }
1180 288 : if (flags & NDR_OUT) {
1181 : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
1182 : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
1183 144 : NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.result));
1184 : }
1185 288 : return NDR_ERR_SUCCESS;
1186 : }
1187 :
1188 6 : _PUBLIC_ void ndr_print_echo_TestSleep(struct ndr_print *ndr, const char *name, int flags, const struct echo_TestSleep *r)
1189 : {
1190 6 : ndr_print_struct(ndr, name, "echo_TestSleep");
1191 6 : if (r == NULL) { ndr_print_null(ndr); return; }
1192 6 : ndr->depth++;
1193 6 : if (flags & NDR_SET_VALUES) {
1194 0 : ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1195 : }
1196 6 : if (flags & NDR_IN) {
1197 0 : ndr_print_struct(ndr, "in", "echo_TestSleep");
1198 0 : ndr->depth++;
1199 0 : ndr_print_uint32(ndr, "seconds", r->in.seconds);
1200 0 : ndr->depth--;
1201 : }
1202 6 : if (flags & NDR_OUT) {
1203 6 : ndr_print_struct(ndr, "out", "echo_TestSleep");
1204 6 : ndr->depth++;
1205 6 : ndr_print_uint32(ndr, "result", r->out.result);
1206 6 : ndr->depth--;
1207 : }
1208 6 : ndr->depth--;
1209 : }
1210 :
1211 569 : static enum ndr_err_code ndr_push_echo_TestEnum(struct ndr_push *ndr, int flags, const struct echo_TestEnum *r)
1212 : {
1213 569 : NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
1214 569 : if (flags & NDR_IN) {
1215 276 : if (r->in.foo1 == NULL) {
1216 0 : return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1217 : }
1218 276 : if (r->in.foo2 == NULL) {
1219 0 : return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1220 : }
1221 276 : if (r->in.foo3 == NULL) {
1222 0 : return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1223 : }
1224 276 : NDR_CHECK(ndr_push_echo_Enum1(ndr, NDR_SCALARS, *r->in.foo1));
1225 276 : NDR_CHECK(ndr_push_echo_Enum2(ndr, NDR_SCALARS, r->in.foo2));
1226 276 : NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.foo3, *r->in.foo1));
1227 276 : NDR_CHECK(ndr_push_echo_Enum3(ndr, NDR_SCALARS, r->in.foo3));
1228 : }
1229 569 : if (flags & NDR_OUT) {
1230 293 : if (r->out.foo1 == NULL) {
1231 0 : return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1232 : }
1233 293 : if (r->out.foo2 == NULL) {
1234 0 : return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1235 : }
1236 293 : if (r->out.foo3 == NULL) {
1237 0 : return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1238 : }
1239 293 : NDR_CHECK(ndr_push_echo_Enum1(ndr, NDR_SCALARS, *r->out.foo1));
1240 293 : NDR_CHECK(ndr_push_echo_Enum2(ndr, NDR_SCALARS, r->out.foo2));
1241 293 : NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.foo3, *r->out.foo1));
1242 293 : NDR_CHECK(ndr_push_echo_Enum3(ndr, NDR_SCALARS, r->out.foo3));
1243 : }
1244 569 : return NDR_ERR_SUCCESS;
1245 : }
1246 :
1247 552 : static enum ndr_err_code ndr_pull_echo_TestEnum(struct ndr_pull *ndr, int flags, struct echo_TestEnum *r)
1248 : {
1249 552 : TALLOC_CTX *_mem_save_foo1_0 = NULL;
1250 552 : TALLOC_CTX *_mem_save_foo2_0 = NULL;
1251 552 : TALLOC_CTX *_mem_save_foo3_0 = NULL;
1252 552 : NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
1253 552 : if (flags & NDR_IN) {
1254 276 : NDR_ZERO_STRUCT(r->out);
1255 :
1256 276 : if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1257 276 : NDR_PULL_ALLOC(ndr, r->in.foo1);
1258 : }
1259 276 : _mem_save_foo1_0 = NDR_PULL_GET_MEM_CTX(ndr);
1260 276 : NDR_PULL_SET_MEM_CTX(ndr, r->in.foo1, LIBNDR_FLAG_REF_ALLOC);
1261 276 : NDR_CHECK(ndr_pull_echo_Enum1(ndr, NDR_SCALARS, r->in.foo1));
1262 276 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_foo1_0, LIBNDR_FLAG_REF_ALLOC);
1263 276 : if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1264 276 : NDR_PULL_ALLOC(ndr, r->in.foo2);
1265 : }
1266 276 : _mem_save_foo2_0 = NDR_PULL_GET_MEM_CTX(ndr);
1267 276 : NDR_PULL_SET_MEM_CTX(ndr, r->in.foo2, LIBNDR_FLAG_REF_ALLOC);
1268 276 : NDR_CHECK(ndr_pull_echo_Enum2(ndr, NDR_SCALARS, r->in.foo2));
1269 276 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_foo2_0, LIBNDR_FLAG_REF_ALLOC);
1270 276 : if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1271 276 : NDR_PULL_ALLOC(ndr, r->in.foo3);
1272 : }
1273 276 : _mem_save_foo3_0 = NDR_PULL_GET_MEM_CTX(ndr);
1274 276 : NDR_PULL_SET_MEM_CTX(ndr, r->in.foo3, LIBNDR_FLAG_REF_ALLOC);
1275 276 : NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.foo3, *r->in.foo1));
1276 276 : NDR_CHECK(ndr_pull_echo_Enum3(ndr, NDR_SCALARS, r->in.foo3));
1277 276 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_foo3_0, LIBNDR_FLAG_REF_ALLOC);
1278 276 : NDR_PULL_ALLOC(ndr, r->out.foo1);
1279 276 : *r->out.foo1 = *r->in.foo1;
1280 276 : NDR_PULL_ALLOC(ndr, r->out.foo2);
1281 276 : *r->out.foo2 = *r->in.foo2;
1282 276 : NDR_PULL_ALLOC(ndr, r->out.foo3);
1283 276 : *r->out.foo3 = *r->in.foo3;
1284 : }
1285 552 : if (flags & NDR_OUT) {
1286 : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
1287 : if (r->in.foo1 == NULL) {
1288 : NDR_PULL_ALLOC(ndr, r->in.foo1);
1289 : NDR_ZERO_STRUCTP(r->in.foo1);
1290 : }
1291 : if (r->in.foo2 == NULL) {
1292 : NDR_PULL_ALLOC(ndr, r->in.foo2);
1293 : NDR_ZERO_STRUCTP(r->in.foo2);
1294 : }
1295 : if (r->in.foo3 == NULL) {
1296 : NDR_PULL_ALLOC(ndr, r->in.foo3);
1297 : NDR_ZERO_STRUCTP(r->in.foo3);
1298 : }
1299 : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
1300 276 : if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1301 19 : NDR_PULL_ALLOC(ndr, r->out.foo1);
1302 : }
1303 276 : _mem_save_foo1_0 = NDR_PULL_GET_MEM_CTX(ndr);
1304 276 : NDR_PULL_SET_MEM_CTX(ndr, r->out.foo1, LIBNDR_FLAG_REF_ALLOC);
1305 276 : NDR_CHECK(ndr_pull_echo_Enum1(ndr, NDR_SCALARS, r->out.foo1));
1306 276 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_foo1_0, LIBNDR_FLAG_REF_ALLOC);
1307 276 : if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1308 19 : NDR_PULL_ALLOC(ndr, r->out.foo2);
1309 : }
1310 276 : _mem_save_foo2_0 = NDR_PULL_GET_MEM_CTX(ndr);
1311 276 : NDR_PULL_SET_MEM_CTX(ndr, r->out.foo2, LIBNDR_FLAG_REF_ALLOC);
1312 276 : NDR_CHECK(ndr_pull_echo_Enum2(ndr, NDR_SCALARS, r->out.foo2));
1313 276 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_foo2_0, LIBNDR_FLAG_REF_ALLOC);
1314 276 : if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1315 19 : NDR_PULL_ALLOC(ndr, r->out.foo3);
1316 : }
1317 276 : _mem_save_foo3_0 = NDR_PULL_GET_MEM_CTX(ndr);
1318 276 : NDR_PULL_SET_MEM_CTX(ndr, r->out.foo3, LIBNDR_FLAG_REF_ALLOC);
1319 276 : NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.foo3, *r->out.foo1));
1320 276 : NDR_CHECK(ndr_pull_echo_Enum3(ndr, NDR_SCALARS, r->out.foo3));
1321 276 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_foo3_0, LIBNDR_FLAG_REF_ALLOC);
1322 : }
1323 552 : return NDR_ERR_SUCCESS;
1324 : }
1325 :
1326 34 : _PUBLIC_ void ndr_print_echo_TestEnum(struct ndr_print *ndr, const char *name, int flags, const struct echo_TestEnum *r)
1327 : {
1328 34 : ndr_print_struct(ndr, name, "echo_TestEnum");
1329 34 : if (r == NULL) { ndr_print_null(ndr); return; }
1330 34 : ndr->depth++;
1331 34 : if (flags & NDR_SET_VALUES) {
1332 0 : ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1333 : }
1334 34 : if (flags & NDR_IN) {
1335 0 : ndr_print_struct(ndr, "in", "echo_TestEnum");
1336 0 : ndr->depth++;
1337 0 : ndr_print_ptr(ndr, "foo1", r->in.foo1);
1338 0 : ndr->depth++;
1339 0 : ndr_print_echo_Enum1(ndr, "foo1", *r->in.foo1);
1340 0 : ndr->depth--;
1341 0 : ndr_print_ptr(ndr, "foo2", r->in.foo2);
1342 0 : ndr->depth++;
1343 0 : ndr_print_echo_Enum2(ndr, "foo2", r->in.foo2);
1344 0 : ndr->depth--;
1345 0 : ndr_print_ptr(ndr, "foo3", r->in.foo3);
1346 0 : ndr->depth++;
1347 0 : ndr_print_set_switch_value(ndr, r->in.foo3, *r->in.foo1);
1348 0 : ndr_print_echo_Enum3(ndr, "foo3", r->in.foo3);
1349 0 : ndr->depth--;
1350 0 : ndr->depth--;
1351 : }
1352 34 : if (flags & NDR_OUT) {
1353 34 : ndr_print_struct(ndr, "out", "echo_TestEnum");
1354 34 : ndr->depth++;
1355 34 : ndr_print_ptr(ndr, "foo1", r->out.foo1);
1356 34 : ndr->depth++;
1357 34 : ndr_print_echo_Enum1(ndr, "foo1", *r->out.foo1);
1358 34 : ndr->depth--;
1359 34 : ndr_print_ptr(ndr, "foo2", r->out.foo2);
1360 34 : ndr->depth++;
1361 34 : ndr_print_echo_Enum2(ndr, "foo2", r->out.foo2);
1362 34 : ndr->depth--;
1363 34 : ndr_print_ptr(ndr, "foo3", r->out.foo3);
1364 34 : ndr->depth++;
1365 34 : ndr_print_set_switch_value(ndr, r->out.foo3, *r->out.foo1);
1366 34 : ndr_print_echo_Enum3(ndr, "foo3", r->out.foo3);
1367 34 : ndr->depth--;
1368 34 : ndr->depth--;
1369 : }
1370 34 : ndr->depth--;
1371 : }
1372 :
1373 571 : static enum ndr_err_code ndr_push_echo_TestSurrounding(struct ndr_push *ndr, int flags, const struct echo_TestSurrounding *r)
1374 : {
1375 571 : NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
1376 571 : if (flags & NDR_IN) {
1377 277 : if (r->in.data == NULL) {
1378 0 : return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1379 : }
1380 277 : NDR_CHECK(ndr_push_echo_Surrounding(ndr, NDR_SCALARS, r->in.data));
1381 : }
1382 571 : if (flags & NDR_OUT) {
1383 294 : if (r->out.data == NULL) {
1384 0 : return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1385 : }
1386 294 : NDR_CHECK(ndr_push_echo_Surrounding(ndr, NDR_SCALARS, r->out.data));
1387 : }
1388 571 : return NDR_ERR_SUCCESS;
1389 : }
1390 :
1391 554 : static enum ndr_err_code ndr_pull_echo_TestSurrounding(struct ndr_pull *ndr, int flags, struct echo_TestSurrounding *r)
1392 : {
1393 554 : TALLOC_CTX *_mem_save_data_0 = NULL;
1394 554 : NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
1395 554 : if (flags & NDR_IN) {
1396 277 : NDR_ZERO_STRUCT(r->out);
1397 :
1398 277 : if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1399 277 : NDR_PULL_ALLOC(ndr, r->in.data);
1400 : }
1401 277 : _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr);
1402 277 : NDR_PULL_SET_MEM_CTX(ndr, r->in.data, LIBNDR_FLAG_REF_ALLOC);
1403 277 : NDR_CHECK(ndr_pull_echo_Surrounding(ndr, NDR_SCALARS, r->in.data));
1404 277 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, LIBNDR_FLAG_REF_ALLOC);
1405 277 : NDR_PULL_ALLOC(ndr, r->out.data);
1406 277 : *r->out.data = *r->in.data;
1407 : }
1408 554 : if (flags & NDR_OUT) {
1409 : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
1410 : if (r->in.data == NULL) {
1411 : NDR_PULL_ALLOC(ndr, r->in.data);
1412 : NDR_ZERO_STRUCTP(r->in.data);
1413 : }
1414 : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
1415 277 : if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1416 20 : NDR_PULL_ALLOC(ndr, r->out.data);
1417 : }
1418 277 : _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr);
1419 277 : NDR_PULL_SET_MEM_CTX(ndr, r->out.data, LIBNDR_FLAG_REF_ALLOC);
1420 277 : NDR_CHECK(ndr_pull_echo_Surrounding(ndr, NDR_SCALARS, r->out.data));
1421 277 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, LIBNDR_FLAG_REF_ALLOC);
1422 : }
1423 554 : return NDR_ERR_SUCCESS;
1424 : }
1425 :
1426 34 : _PUBLIC_ void ndr_print_echo_TestSurrounding(struct ndr_print *ndr, const char *name, int flags, const struct echo_TestSurrounding *r)
1427 : {
1428 34 : ndr_print_struct(ndr, name, "echo_TestSurrounding");
1429 34 : if (r == NULL) { ndr_print_null(ndr); return; }
1430 34 : ndr->depth++;
1431 34 : if (flags & NDR_SET_VALUES) {
1432 0 : ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1433 : }
1434 34 : if (flags & NDR_IN) {
1435 0 : ndr_print_struct(ndr, "in", "echo_TestSurrounding");
1436 0 : ndr->depth++;
1437 0 : ndr_print_ptr(ndr, "data", r->in.data);
1438 0 : ndr->depth++;
1439 0 : ndr_print_echo_Surrounding(ndr, "data", r->in.data);
1440 0 : ndr->depth--;
1441 0 : ndr->depth--;
1442 : }
1443 34 : if (flags & NDR_OUT) {
1444 34 : ndr_print_struct(ndr, "out", "echo_TestSurrounding");
1445 34 : ndr->depth++;
1446 34 : ndr_print_ptr(ndr, "data", r->out.data);
1447 34 : ndr->depth++;
1448 34 : ndr_print_echo_Surrounding(ndr, "data", r->out.data);
1449 34 : ndr->depth--;
1450 34 : ndr->depth--;
1451 : }
1452 34 : ndr->depth--;
1453 : }
1454 :
1455 569 : static enum ndr_err_code ndr_push_echo_TestDoublePointer(struct ndr_push *ndr, int flags, const struct echo_TestDoublePointer *r)
1456 : {
1457 569 : NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
1458 569 : if (flags & NDR_IN) {
1459 276 : if (r->in.data == NULL) {
1460 0 : return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1461 : }
1462 276 : NDR_CHECK(ndr_push_unique_ptr(ndr, *r->in.data));
1463 276 : if (*r->in.data) {
1464 276 : NDR_CHECK(ndr_push_unique_ptr(ndr, **r->in.data));
1465 276 : if (**r->in.data) {
1466 276 : NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, ***r->in.data));
1467 : }
1468 : }
1469 : }
1470 569 : if (flags & NDR_OUT) {
1471 293 : NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->out.result));
1472 : }
1473 569 : return NDR_ERR_SUCCESS;
1474 : }
1475 :
1476 552 : static enum ndr_err_code ndr_pull_echo_TestDoublePointer(struct ndr_pull *ndr, int flags, struct echo_TestDoublePointer *r)
1477 : {
1478 : uint32_t _ptr_data;
1479 552 : TALLOC_CTX *_mem_save_data_0 = NULL;
1480 552 : TALLOC_CTX *_mem_save_data_1 = NULL;
1481 552 : TALLOC_CTX *_mem_save_data_2 = NULL;
1482 552 : NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
1483 552 : if (flags & NDR_IN) {
1484 276 : if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1485 276 : NDR_PULL_ALLOC(ndr, r->in.data);
1486 : }
1487 276 : _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr);
1488 276 : NDR_PULL_SET_MEM_CTX(ndr, r->in.data, LIBNDR_FLAG_REF_ALLOC);
1489 276 : NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data));
1490 276 : if (_ptr_data) {
1491 276 : NDR_PULL_ALLOC(ndr, *r->in.data);
1492 : } else {
1493 0 : *r->in.data = NULL;
1494 : }
1495 276 : if (*r->in.data) {
1496 276 : _mem_save_data_1 = NDR_PULL_GET_MEM_CTX(ndr);
1497 276 : NDR_PULL_SET_MEM_CTX(ndr, *r->in.data, 0);
1498 276 : NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data));
1499 276 : if (_ptr_data) {
1500 276 : NDR_PULL_ALLOC(ndr, **r->in.data);
1501 : } else {
1502 0 : **r->in.data = NULL;
1503 : }
1504 276 : if (**r->in.data) {
1505 276 : _mem_save_data_2 = NDR_PULL_GET_MEM_CTX(ndr);
1506 276 : NDR_PULL_SET_MEM_CTX(ndr, **r->in.data, 0);
1507 276 : NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, **r->in.data));
1508 276 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_2, 0);
1509 : }
1510 276 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_1, 0);
1511 : }
1512 276 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, LIBNDR_FLAG_REF_ALLOC);
1513 : }
1514 552 : if (flags & NDR_OUT) {
1515 : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
1516 : if (r->in.data == NULL) {
1517 : NDR_PULL_ALLOC(ndr, r->in.data);
1518 : NDR_ZERO_STRUCTP(r->in.data);
1519 : }
1520 : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
1521 276 : NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->out.result));
1522 : }
1523 552 : return NDR_ERR_SUCCESS;
1524 : }
1525 :
1526 34 : _PUBLIC_ void ndr_print_echo_TestDoublePointer(struct ndr_print *ndr, const char *name, int flags, const struct echo_TestDoublePointer *r)
1527 : {
1528 34 : ndr_print_struct(ndr, name, "echo_TestDoublePointer");
1529 34 : if (r == NULL) { ndr_print_null(ndr); return; }
1530 34 : ndr->depth++;
1531 34 : if (flags & NDR_SET_VALUES) {
1532 0 : ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1533 : }
1534 34 : if (flags & NDR_IN) {
1535 0 : ndr_print_struct(ndr, "in", "echo_TestDoublePointer");
1536 0 : ndr->depth++;
1537 0 : ndr_print_ptr(ndr, "data", r->in.data);
1538 0 : ndr->depth++;
1539 0 : ndr_print_ptr(ndr, "data", *r->in.data);
1540 0 : ndr->depth++;
1541 0 : if (*r->in.data) {
1542 0 : ndr_print_ptr(ndr, "data", **r->in.data);
1543 0 : ndr->depth++;
1544 0 : if (**r->in.data) {
1545 0 : ndr_print_uint16(ndr, "data", ***r->in.data);
1546 : }
1547 0 : ndr->depth--;
1548 : }
1549 0 : ndr->depth--;
1550 0 : ndr->depth--;
1551 0 : ndr->depth--;
1552 : }
1553 34 : if (flags & NDR_OUT) {
1554 34 : ndr_print_struct(ndr, "out", "echo_TestDoublePointer");
1555 34 : ndr->depth++;
1556 34 : ndr_print_uint16(ndr, "result", r->out.result);
1557 34 : ndr->depth--;
1558 : }
1559 34 : ndr->depth--;
1560 : }
1561 :
1562 : #ifndef SKIP_NDR_TABLE_rpcecho
1563 : static const struct ndr_interface_public_struct rpcecho_public_structs[] = {
1564 : {
1565 : .name = "echo_info1",
1566 : .struct_size = sizeof(struct echo_info1 ),
1567 : .ndr_push = (ndr_push_flags_fn_t) ndr_push_echo_info1,
1568 : .ndr_pull = (ndr_pull_flags_fn_t) ndr_pull_echo_info1,
1569 : .ndr_print = (ndr_print_function_t) ndr_print_flags_echo_info1,
1570 : },
1571 : { .name = NULL }
1572 : };
1573 :
1574 : static const struct ndr_interface_call rpcecho_calls[] = {
1575 : {
1576 : "echo_AddOne",
1577 : sizeof(struct echo_AddOne),
1578 : (ndr_push_flags_fn_t) ndr_push_echo_AddOne,
1579 : (ndr_pull_flags_fn_t) ndr_pull_echo_AddOne,
1580 : (ndr_print_function_t) ndr_print_echo_AddOne,
1581 : { 0, NULL },
1582 : { 0, NULL },
1583 : },
1584 : {
1585 : "echo_EchoData",
1586 : sizeof(struct echo_EchoData),
1587 : (ndr_push_flags_fn_t) ndr_push_echo_EchoData,
1588 : (ndr_pull_flags_fn_t) ndr_pull_echo_EchoData,
1589 : (ndr_print_function_t) ndr_print_echo_EchoData,
1590 : { 0, NULL },
1591 : { 0, NULL },
1592 : },
1593 : {
1594 : "echo_SinkData",
1595 : sizeof(struct echo_SinkData),
1596 : (ndr_push_flags_fn_t) ndr_push_echo_SinkData,
1597 : (ndr_pull_flags_fn_t) ndr_pull_echo_SinkData,
1598 : (ndr_print_function_t) ndr_print_echo_SinkData,
1599 : { 0, NULL },
1600 : { 0, NULL },
1601 : },
1602 : {
1603 : "echo_SourceData",
1604 : sizeof(struct echo_SourceData),
1605 : (ndr_push_flags_fn_t) ndr_push_echo_SourceData,
1606 : (ndr_pull_flags_fn_t) ndr_pull_echo_SourceData,
1607 : (ndr_print_function_t) ndr_print_echo_SourceData,
1608 : { 0, NULL },
1609 : { 0, NULL },
1610 : },
1611 : {
1612 : "echo_TestCall",
1613 : sizeof(struct echo_TestCall),
1614 : (ndr_push_flags_fn_t) ndr_push_echo_TestCall,
1615 : (ndr_pull_flags_fn_t) ndr_pull_echo_TestCall,
1616 : (ndr_print_function_t) ndr_print_echo_TestCall,
1617 : { 0, NULL },
1618 : { 0, NULL },
1619 : },
1620 : {
1621 : "echo_TestCall2",
1622 : sizeof(struct echo_TestCall2),
1623 : (ndr_push_flags_fn_t) ndr_push_echo_TestCall2,
1624 : (ndr_pull_flags_fn_t) ndr_pull_echo_TestCall2,
1625 : (ndr_print_function_t) ndr_print_echo_TestCall2,
1626 : { 0, NULL },
1627 : { 0, NULL },
1628 : },
1629 : {
1630 : "echo_TestSleep",
1631 : sizeof(struct echo_TestSleep),
1632 : (ndr_push_flags_fn_t) ndr_push_echo_TestSleep,
1633 : (ndr_pull_flags_fn_t) ndr_pull_echo_TestSleep,
1634 : (ndr_print_function_t) ndr_print_echo_TestSleep,
1635 : { 0, NULL },
1636 : { 0, NULL },
1637 : },
1638 : {
1639 : "echo_TestEnum",
1640 : sizeof(struct echo_TestEnum),
1641 : (ndr_push_flags_fn_t) ndr_push_echo_TestEnum,
1642 : (ndr_pull_flags_fn_t) ndr_pull_echo_TestEnum,
1643 : (ndr_print_function_t) ndr_print_echo_TestEnum,
1644 : { 0, NULL },
1645 : { 0, NULL },
1646 : },
1647 : {
1648 : "echo_TestSurrounding",
1649 : sizeof(struct echo_TestSurrounding),
1650 : (ndr_push_flags_fn_t) ndr_push_echo_TestSurrounding,
1651 : (ndr_pull_flags_fn_t) ndr_pull_echo_TestSurrounding,
1652 : (ndr_print_function_t) ndr_print_echo_TestSurrounding,
1653 : { 0, NULL },
1654 : { 0, NULL },
1655 : },
1656 : {
1657 : "echo_TestDoublePointer",
1658 : sizeof(struct echo_TestDoublePointer),
1659 : (ndr_push_flags_fn_t) ndr_push_echo_TestDoublePointer,
1660 : (ndr_pull_flags_fn_t) ndr_pull_echo_TestDoublePointer,
1661 : (ndr_print_function_t) ndr_print_echo_TestDoublePointer,
1662 : { 0, NULL },
1663 : { 0, NULL },
1664 : },
1665 : { .name = NULL }
1666 : };
1667 :
1668 : static const char * const rpcecho_endpoint_strings[] = {
1669 : "ncacn_np:[\\pipe\\rpcecho]",
1670 : "ncacn_ip_tcp:",
1671 : "ncalrpc:",
1672 : };
1673 :
1674 : static const struct ndr_interface_string_array rpcecho_endpoints = {
1675 : .count = 3,
1676 : .names = rpcecho_endpoint_strings
1677 : };
1678 :
1679 : static const char * const rpcecho_authservice_strings[] = {
1680 : "host",
1681 : };
1682 :
1683 : static const struct ndr_interface_string_array rpcecho_authservices = {
1684 : .count = 1,
1685 : .names = rpcecho_authservice_strings
1686 : };
1687 :
1688 :
1689 : const struct ndr_interface_table ndr_table_rpcecho = {
1690 : .name = "rpcecho",
1691 : .syntax_id = {
1692 : {0x60a15ec5,0x4de8,0x11d7,{0xa6,0x37},{0x00,0x50,0x56,0xa2,0x01,0x82}},
1693 : NDR_RPCECHO_VERSION
1694 : },
1695 : .helpstring = NDR_RPCECHO_HELPSTRING,
1696 : .num_calls = 10,
1697 : .calls = rpcecho_calls,
1698 : .num_public_structs = 1,
1699 : .public_structs = rpcecho_public_structs,
1700 : .endpoints = &rpcecho_endpoints,
1701 : .authservices = &rpcecho_authservices
1702 : };
1703 :
1704 : #endif /* SKIP_NDR_TABLE_rpcecho */
|