2 * Unix SMB/CIFS implementation.
3 * server auto-generated by pidl. DO NOT MODIFY!
7 #include "librpc/gen_ndr/srv_echo.h"
9 static BOOL
api_echo_AddOne(pipes_struct
*p
)
11 struct ndr_pull
*pull
;
12 struct ndr_push
*push
;
16 TALLOC_CTX
*mem_ctx
= talloc_init("api_echo_AddOne");
18 if (!prs_data_blob(&p
->in_data
.data
, &blob
, mem_ctx
)) {
23 pull
= ndr_pull_init_blob(&blob
, mem_ctx
);
29 pull
->flags
|= LIBNDR_FLAG_REF_ALLOC
;
30 status
= ndr_pull_echo_AddOne(pull
, NDR_IN
, &r
);
31 if (NT_STATUS_IS_ERR(status
)) {
37 NDR_PRINT_IN_DEBUG(echo_AddOne
, &r
);
40 r
.out
.out_data
= talloc_zero(mem_ctx
, uint32_t);
41 if (r
.out
.out_data
== NULL
) {
48 if (p
->rng_fault_state
) {
50 /* Return True here, srv_pipe_hnd.c will take care */
55 NDR_PRINT_OUT_DEBUG(echo_AddOne
, &r
);
57 push
= ndr_push_init_ctx(mem_ctx
);
63 status
= ndr_push_echo_AddOne(push
, NDR_OUT
, &r
);
64 if (NT_STATUS_IS_ERR(status
)) {
69 blob
= ndr_push_blob(push
);
70 if (!prs_copy_data_in(&p
->out_data
.rdata
, (const char *)blob
.data
, (uint32
)blob
.length
)) {
80 static BOOL
api_echo_EchoData(pipes_struct
*p
)
82 struct ndr_pull
*pull
;
83 struct ndr_push
*push
;
86 struct echo_EchoData r
;
87 TALLOC_CTX
*mem_ctx
= talloc_init("api_echo_EchoData");
89 if (!prs_data_blob(&p
->in_data
.data
, &blob
, mem_ctx
)) {
94 pull
= ndr_pull_init_blob(&blob
, mem_ctx
);
100 pull
->flags
|= LIBNDR_FLAG_REF_ALLOC
;
101 status
= ndr_pull_echo_EchoData(pull
, NDR_IN
, &r
);
102 if (NT_STATUS_IS_ERR(status
)) {
103 talloc_free(mem_ctx
);
107 if (DEBUGLEVEL
>= 10)
108 NDR_PRINT_IN_DEBUG(echo_EchoData
, &r
);
111 r
.out
.out_data
= talloc_zero_array(mem_ctx
, uint8_t, r
.in
.len
);
112 if (r
.out
.out_data
== NULL
) {
113 talloc_free(mem_ctx
);
117 _echo_EchoData(p
, &r
);
119 if (p
->rng_fault_state
) {
120 talloc_free(mem_ctx
);
121 /* Return True here, srv_pipe_hnd.c will take care */
125 if (DEBUGLEVEL
>= 10)
126 NDR_PRINT_OUT_DEBUG(echo_EchoData
, &r
);
128 push
= ndr_push_init_ctx(mem_ctx
);
130 talloc_free(mem_ctx
);
134 status
= ndr_push_echo_EchoData(push
, NDR_OUT
, &r
);
135 if (NT_STATUS_IS_ERR(status
)) {
136 talloc_free(mem_ctx
);
140 blob
= ndr_push_blob(push
);
141 if (!prs_copy_data_in(&p
->out_data
.rdata
, (const char *)blob
.data
, (uint32
)blob
.length
)) {
142 talloc_free(mem_ctx
);
146 talloc_free(mem_ctx
);
151 static BOOL
api_echo_SinkData(pipes_struct
*p
)
153 struct ndr_pull
*pull
;
154 struct ndr_push
*push
;
157 struct echo_SinkData r
;
158 TALLOC_CTX
*mem_ctx
= talloc_init("api_echo_SinkData");
160 if (!prs_data_blob(&p
->in_data
.data
, &blob
, mem_ctx
)) {
161 talloc_free(mem_ctx
);
165 pull
= ndr_pull_init_blob(&blob
, mem_ctx
);
167 talloc_free(mem_ctx
);
171 pull
->flags
|= LIBNDR_FLAG_REF_ALLOC
;
172 status
= ndr_pull_echo_SinkData(pull
, NDR_IN
, &r
);
173 if (NT_STATUS_IS_ERR(status
)) {
174 talloc_free(mem_ctx
);
178 if (DEBUGLEVEL
>= 10)
179 NDR_PRINT_IN_DEBUG(echo_SinkData
, &r
);
181 _echo_SinkData(p
, &r
);
183 if (p
->rng_fault_state
) {
184 talloc_free(mem_ctx
);
185 /* Return True here, srv_pipe_hnd.c will take care */
189 if (DEBUGLEVEL
>= 10)
190 NDR_PRINT_OUT_DEBUG(echo_SinkData
, &r
);
192 push
= ndr_push_init_ctx(mem_ctx
);
194 talloc_free(mem_ctx
);
198 status
= ndr_push_echo_SinkData(push
, NDR_OUT
, &r
);
199 if (NT_STATUS_IS_ERR(status
)) {
200 talloc_free(mem_ctx
);
204 blob
= ndr_push_blob(push
);
205 if (!prs_copy_data_in(&p
->out_data
.rdata
, (const char *)blob
.data
, (uint32
)blob
.length
)) {
206 talloc_free(mem_ctx
);
210 talloc_free(mem_ctx
);
215 static BOOL
api_echo_SourceData(pipes_struct
*p
)
217 struct ndr_pull
*pull
;
218 struct ndr_push
*push
;
221 struct echo_SourceData r
;
222 TALLOC_CTX
*mem_ctx
= talloc_init("api_echo_SourceData");
224 if (!prs_data_blob(&p
->in_data
.data
, &blob
, mem_ctx
)) {
225 talloc_free(mem_ctx
);
229 pull
= ndr_pull_init_blob(&blob
, mem_ctx
);
231 talloc_free(mem_ctx
);
235 pull
->flags
|= LIBNDR_FLAG_REF_ALLOC
;
236 status
= ndr_pull_echo_SourceData(pull
, NDR_IN
, &r
);
237 if (NT_STATUS_IS_ERR(status
)) {
238 talloc_free(mem_ctx
);
242 if (DEBUGLEVEL
>= 10)
243 NDR_PRINT_IN_DEBUG(echo_SourceData
, &r
);
246 r
.out
.data
= talloc_zero_array(mem_ctx
, uint8_t, r
.in
.len
);
247 if (r
.out
.data
== NULL
) {
248 talloc_free(mem_ctx
);
252 _echo_SourceData(p
, &r
);
254 if (p
->rng_fault_state
) {
255 talloc_free(mem_ctx
);
256 /* Return True here, srv_pipe_hnd.c will take care */
260 if (DEBUGLEVEL
>= 10)
261 NDR_PRINT_OUT_DEBUG(echo_SourceData
, &r
);
263 push
= ndr_push_init_ctx(mem_ctx
);
265 talloc_free(mem_ctx
);
269 status
= ndr_push_echo_SourceData(push
, NDR_OUT
, &r
);
270 if (NT_STATUS_IS_ERR(status
)) {
271 talloc_free(mem_ctx
);
275 blob
= ndr_push_blob(push
);
276 if (!prs_copy_data_in(&p
->out_data
.rdata
, (const char *)blob
.data
, (uint32
)blob
.length
)) {
277 talloc_free(mem_ctx
);
281 talloc_free(mem_ctx
);
286 static BOOL
api_echo_TestCall(pipes_struct
*p
)
288 struct ndr_pull
*pull
;
289 struct ndr_push
*push
;
292 struct echo_TestCall r
;
293 TALLOC_CTX
*mem_ctx
= talloc_init("api_echo_TestCall");
295 if (!prs_data_blob(&p
->in_data
.data
, &blob
, mem_ctx
)) {
296 talloc_free(mem_ctx
);
300 pull
= ndr_pull_init_blob(&blob
, mem_ctx
);
302 talloc_free(mem_ctx
);
306 pull
->flags
|= LIBNDR_FLAG_REF_ALLOC
;
307 status
= ndr_pull_echo_TestCall(pull
, NDR_IN
, &r
);
308 if (NT_STATUS_IS_ERR(status
)) {
309 talloc_free(mem_ctx
);
313 if (DEBUGLEVEL
>= 10)
314 NDR_PRINT_IN_DEBUG(echo_TestCall
, &r
);
317 r
.out
.s2
= talloc_zero(mem_ctx
, const char *);
318 if (r
.out
.s2
== NULL
) {
319 talloc_free(mem_ctx
);
323 _echo_TestCall(p
, &r
);
325 if (p
->rng_fault_state
) {
326 talloc_free(mem_ctx
);
327 /* Return True here, srv_pipe_hnd.c will take care */
331 if (DEBUGLEVEL
>= 10)
332 NDR_PRINT_OUT_DEBUG(echo_TestCall
, &r
);
334 push
= ndr_push_init_ctx(mem_ctx
);
336 talloc_free(mem_ctx
);
340 status
= ndr_push_echo_TestCall(push
, NDR_OUT
, &r
);
341 if (NT_STATUS_IS_ERR(status
)) {
342 talloc_free(mem_ctx
);
346 blob
= ndr_push_blob(push
);
347 if (!prs_copy_data_in(&p
->out_data
.rdata
, (const char *)blob
.data
, (uint32
)blob
.length
)) {
348 talloc_free(mem_ctx
);
352 talloc_free(mem_ctx
);
357 static BOOL
api_echo_TestCall2(pipes_struct
*p
)
359 struct ndr_pull
*pull
;
360 struct ndr_push
*push
;
363 struct echo_TestCall2 r
;
364 TALLOC_CTX
*mem_ctx
= talloc_init("api_echo_TestCall2");
366 if (!prs_data_blob(&p
->in_data
.data
, &blob
, mem_ctx
)) {
367 talloc_free(mem_ctx
);
371 pull
= ndr_pull_init_blob(&blob
, mem_ctx
);
373 talloc_free(mem_ctx
);
377 pull
->flags
|= LIBNDR_FLAG_REF_ALLOC
;
378 status
= ndr_pull_echo_TestCall2(pull
, NDR_IN
, &r
);
379 if (NT_STATUS_IS_ERR(status
)) {
380 talloc_free(mem_ctx
);
384 if (DEBUGLEVEL
>= 10)
385 NDR_PRINT_IN_DEBUG(echo_TestCall2
, &r
);
388 r
.out
.info
= talloc_zero(mem_ctx
, union echo_Info
);
389 if (r
.out
.info
== NULL
) {
390 talloc_free(mem_ctx
);
394 r
.out
.result
= _echo_TestCall2(p
, &r
);
396 if (p
->rng_fault_state
) {
397 talloc_free(mem_ctx
);
398 /* Return True here, srv_pipe_hnd.c will take care */
402 if (DEBUGLEVEL
>= 10)
403 NDR_PRINT_OUT_DEBUG(echo_TestCall2
, &r
);
405 push
= ndr_push_init_ctx(mem_ctx
);
407 talloc_free(mem_ctx
);
411 status
= ndr_push_echo_TestCall2(push
, NDR_OUT
, &r
);
412 if (NT_STATUS_IS_ERR(status
)) {
413 talloc_free(mem_ctx
);
417 blob
= ndr_push_blob(push
);
418 if (!prs_copy_data_in(&p
->out_data
.rdata
, (const char *)blob
.data
, (uint32
)blob
.length
)) {
419 talloc_free(mem_ctx
);
423 talloc_free(mem_ctx
);
428 static BOOL
api_echo_TestSleep(pipes_struct
*p
)
430 struct ndr_pull
*pull
;
431 struct ndr_push
*push
;
434 struct echo_TestSleep r
;
435 TALLOC_CTX
*mem_ctx
= talloc_init("api_echo_TestSleep");
437 if (!prs_data_blob(&p
->in_data
.data
, &blob
, mem_ctx
)) {
438 talloc_free(mem_ctx
);
442 pull
= ndr_pull_init_blob(&blob
, mem_ctx
);
444 talloc_free(mem_ctx
);
448 pull
->flags
|= LIBNDR_FLAG_REF_ALLOC
;
449 status
= ndr_pull_echo_TestSleep(pull
, NDR_IN
, &r
);
450 if (NT_STATUS_IS_ERR(status
)) {
451 talloc_free(mem_ctx
);
455 if (DEBUGLEVEL
>= 10)
456 NDR_PRINT_IN_DEBUG(echo_TestSleep
, &r
);
458 r
.out
.result
= _echo_TestSleep(p
, &r
);
460 if (p
->rng_fault_state
) {
461 talloc_free(mem_ctx
);
462 /* Return True here, srv_pipe_hnd.c will take care */
466 if (DEBUGLEVEL
>= 10)
467 NDR_PRINT_OUT_DEBUG(echo_TestSleep
, &r
);
469 push
= ndr_push_init_ctx(mem_ctx
);
471 talloc_free(mem_ctx
);
475 status
= ndr_push_echo_TestSleep(push
, NDR_OUT
, &r
);
476 if (NT_STATUS_IS_ERR(status
)) {
477 talloc_free(mem_ctx
);
481 blob
= ndr_push_blob(push
);
482 if (!prs_copy_data_in(&p
->out_data
.rdata
, (const char *)blob
.data
, (uint32
)blob
.length
)) {
483 talloc_free(mem_ctx
);
487 talloc_free(mem_ctx
);
492 static BOOL
api_echo_TestEnum(pipes_struct
*p
)
494 struct ndr_pull
*pull
;
495 struct ndr_push
*push
;
498 struct echo_TestEnum r
;
499 TALLOC_CTX
*mem_ctx
= talloc_init("api_echo_TestEnum");
501 if (!prs_data_blob(&p
->in_data
.data
, &blob
, mem_ctx
)) {
502 talloc_free(mem_ctx
);
506 pull
= ndr_pull_init_blob(&blob
, mem_ctx
);
508 talloc_free(mem_ctx
);
512 pull
->flags
|= LIBNDR_FLAG_REF_ALLOC
;
513 status
= ndr_pull_echo_TestEnum(pull
, NDR_IN
, &r
);
514 if (NT_STATUS_IS_ERR(status
)) {
515 talloc_free(mem_ctx
);
519 if (DEBUGLEVEL
>= 10)
520 NDR_PRINT_IN_DEBUG(echo_TestEnum
, &r
);
523 r
.out
.foo1
= r
.in
.foo1
;
524 r
.out
.foo2
= r
.in
.foo2
;
525 r
.out
.foo3
= r
.in
.foo3
;
526 _echo_TestEnum(p
, &r
);
528 if (p
->rng_fault_state
) {
529 talloc_free(mem_ctx
);
530 /* Return True here, srv_pipe_hnd.c will take care */
534 if (DEBUGLEVEL
>= 10)
535 NDR_PRINT_OUT_DEBUG(echo_TestEnum
, &r
);
537 push
= ndr_push_init_ctx(mem_ctx
);
539 talloc_free(mem_ctx
);
543 status
= ndr_push_echo_TestEnum(push
, NDR_OUT
, &r
);
544 if (NT_STATUS_IS_ERR(status
)) {
545 talloc_free(mem_ctx
);
549 blob
= ndr_push_blob(push
);
550 if (!prs_copy_data_in(&p
->out_data
.rdata
, (const char *)blob
.data
, (uint32
)blob
.length
)) {
551 talloc_free(mem_ctx
);
555 talloc_free(mem_ctx
);
560 static BOOL
api_echo_TestSurrounding(pipes_struct
*p
)
562 struct ndr_pull
*pull
;
563 struct ndr_push
*push
;
566 struct echo_TestSurrounding r
;
567 TALLOC_CTX
*mem_ctx
= talloc_init("api_echo_TestSurrounding");
569 if (!prs_data_blob(&p
->in_data
.data
, &blob
, mem_ctx
)) {
570 talloc_free(mem_ctx
);
574 pull
= ndr_pull_init_blob(&blob
, mem_ctx
);
576 talloc_free(mem_ctx
);
580 pull
->flags
|= LIBNDR_FLAG_REF_ALLOC
;
581 status
= ndr_pull_echo_TestSurrounding(pull
, NDR_IN
, &r
);
582 if (NT_STATUS_IS_ERR(status
)) {
583 talloc_free(mem_ctx
);
587 if (DEBUGLEVEL
>= 10)
588 NDR_PRINT_IN_DEBUG(echo_TestSurrounding
, &r
);
591 r
.out
.data
= r
.in
.data
;
592 _echo_TestSurrounding(p
, &r
);
594 if (p
->rng_fault_state
) {
595 talloc_free(mem_ctx
);
596 /* Return True here, srv_pipe_hnd.c will take care */
600 if (DEBUGLEVEL
>= 10)
601 NDR_PRINT_OUT_DEBUG(echo_TestSurrounding
, &r
);
603 push
= ndr_push_init_ctx(mem_ctx
);
605 talloc_free(mem_ctx
);
609 status
= ndr_push_echo_TestSurrounding(push
, NDR_OUT
, &r
);
610 if (NT_STATUS_IS_ERR(status
)) {
611 talloc_free(mem_ctx
);
615 blob
= ndr_push_blob(push
);
616 if (!prs_copy_data_in(&p
->out_data
.rdata
, (const char *)blob
.data
, (uint32
)blob
.length
)) {
617 talloc_free(mem_ctx
);
621 talloc_free(mem_ctx
);
626 static BOOL
api_echo_TestDoublePointer(pipes_struct
*p
)
628 struct ndr_pull
*pull
;
629 struct ndr_push
*push
;
632 struct echo_TestDoublePointer r
;
633 TALLOC_CTX
*mem_ctx
= talloc_init("api_echo_TestDoublePointer");
635 if (!prs_data_blob(&p
->in_data
.data
, &blob
, mem_ctx
)) {
636 talloc_free(mem_ctx
);
640 pull
= ndr_pull_init_blob(&blob
, mem_ctx
);
642 talloc_free(mem_ctx
);
646 pull
->flags
|= LIBNDR_FLAG_REF_ALLOC
;
647 status
= ndr_pull_echo_TestDoublePointer(pull
, NDR_IN
, &r
);
648 if (NT_STATUS_IS_ERR(status
)) {
649 talloc_free(mem_ctx
);
653 if (DEBUGLEVEL
>= 10)
654 NDR_PRINT_IN_DEBUG(echo_TestDoublePointer
, &r
);
656 r
.out
.result
= _echo_TestDoublePointer(p
, &r
);
658 if (p
->rng_fault_state
) {
659 talloc_free(mem_ctx
);
660 /* Return True here, srv_pipe_hnd.c will take care */
664 if (DEBUGLEVEL
>= 10)
665 NDR_PRINT_OUT_DEBUG(echo_TestDoublePointer
, &r
);
667 push
= ndr_push_init_ctx(mem_ctx
);
669 talloc_free(mem_ctx
);
673 status
= ndr_push_echo_TestDoublePointer(push
, NDR_OUT
, &r
);
674 if (NT_STATUS_IS_ERR(status
)) {
675 talloc_free(mem_ctx
);
679 blob
= ndr_push_blob(push
);
680 if (!prs_copy_data_in(&p
->out_data
.rdata
, (const char *)blob
.data
, (uint32
)blob
.length
)) {
681 talloc_free(mem_ctx
);
685 talloc_free(mem_ctx
);
692 static struct api_struct api_rpcecho_cmds
[] =
694 {"ECHO_ADDONE", DCERPC_ECHO_ADDONE
, api_echo_AddOne
},
695 {"ECHO_ECHODATA", DCERPC_ECHO_ECHODATA
, api_echo_EchoData
},
696 {"ECHO_SINKDATA", DCERPC_ECHO_SINKDATA
, api_echo_SinkData
},
697 {"ECHO_SOURCEDATA", DCERPC_ECHO_SOURCEDATA
, api_echo_SourceData
},
698 {"ECHO_TESTCALL", DCERPC_ECHO_TESTCALL
, api_echo_TestCall
},
699 {"ECHO_TESTCALL2", DCERPC_ECHO_TESTCALL2
, api_echo_TestCall2
},
700 {"ECHO_TESTSLEEP", DCERPC_ECHO_TESTSLEEP
, api_echo_TestSleep
},
701 {"ECHO_TESTENUM", DCERPC_ECHO_TESTENUM
, api_echo_TestEnum
},
702 {"ECHO_TESTSURROUNDING", DCERPC_ECHO_TESTSURROUNDING
, api_echo_TestSurrounding
},
703 {"ECHO_TESTDOUBLEPOINTER", DCERPC_ECHO_TESTDOUBLEPOINTER
, api_echo_TestDoublePointer
},
706 void rpcecho_get_pipe_fns(struct api_struct
**fns
, int *n_fns
)
708 *fns
= api_rpcecho_cmds
;
709 *n_fns
= sizeof(api_rpcecho_cmds
) / sizeof(struct api_struct
);
712 NTSTATUS
rpc_rpcecho_init(void)
714 return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION
, "rpcecho", "rpcecho", api_rpcecho_cmds
, sizeof(api_rpcecho_cmds
) / sizeof(struct api_struct
));