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 const struct ndr_interface_call *call;
12 struct ndr_pull *pull;
13 struct ndr_push *push;
16 struct echo_AddOne *r;
18 call = &ndr_table_rpcecho.calls[NDR_ECHO_ADDONE];
20 r = talloc(NULL, struct echo_AddOne);
25 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
30 pull = ndr_pull_init_blob(&blob, r);
36 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
37 status = call->ndr_pull(pull, NDR_IN, r);
38 if (NT_STATUS_IS_ERR(status)) {
44 NDR_PRINT_IN_DEBUG(echo_AddOne, r);
47 r->out.out_data = talloc_zero(r, uint32_t);
48 if (r->out.out_data == NULL) {
55 if (p->rng_fault_state) {
57 /* Return True here, srv_pipe_hnd.c will take care */
62 NDR_PRINT_OUT_DEBUG(echo_AddOne, r);
64 push = ndr_push_init_ctx(r);
70 status = call->ndr_push(push, NDR_OUT, r);
71 if (NT_STATUS_IS_ERR(status)) {
76 blob = ndr_push_blob(push);
77 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
87 static bool api_echo_EchoData(pipes_struct *p)
89 const struct ndr_interface_call *call;
90 struct ndr_pull *pull;
91 struct ndr_push *push;
94 struct echo_EchoData *r;
96 call = &ndr_table_rpcecho.calls[NDR_ECHO_ECHODATA];
98 r = talloc(NULL, struct echo_EchoData);
103 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
108 pull = ndr_pull_init_blob(&blob, r);
114 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
115 status = call->ndr_pull(pull, NDR_IN, r);
116 if (NT_STATUS_IS_ERR(status)) {
121 if (DEBUGLEVEL >= 10)
122 NDR_PRINT_IN_DEBUG(echo_EchoData, r);
125 r->out.out_data = talloc_zero_array(r, uint8_t, r->in.len);
126 if (r->out.out_data == NULL) {
131 _echo_EchoData(p, r);
133 if (p->rng_fault_state) {
135 /* Return True here, srv_pipe_hnd.c will take care */
139 if (DEBUGLEVEL >= 10)
140 NDR_PRINT_OUT_DEBUG(echo_EchoData, r);
142 push = ndr_push_init_ctx(r);
148 status = call->ndr_push(push, NDR_OUT, r);
149 if (NT_STATUS_IS_ERR(status)) {
154 blob = ndr_push_blob(push);
155 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
165 static bool api_echo_SinkData(pipes_struct *p)
167 const struct ndr_interface_call *call;
168 struct ndr_pull *pull;
169 struct ndr_push *push;
172 struct echo_SinkData *r;
174 call = &ndr_table_rpcecho.calls[NDR_ECHO_SINKDATA];
176 r = talloc(NULL, struct echo_SinkData);
181 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
186 pull = ndr_pull_init_blob(&blob, r);
192 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
193 status = call->ndr_pull(pull, NDR_IN, r);
194 if (NT_STATUS_IS_ERR(status)) {
199 if (DEBUGLEVEL >= 10)
200 NDR_PRINT_IN_DEBUG(echo_SinkData, r);
202 _echo_SinkData(p, r);
204 if (p->rng_fault_state) {
206 /* Return True here, srv_pipe_hnd.c will take care */
210 if (DEBUGLEVEL >= 10)
211 NDR_PRINT_OUT_DEBUG(echo_SinkData, r);
213 push = ndr_push_init_ctx(r);
219 status = call->ndr_push(push, NDR_OUT, r);
220 if (NT_STATUS_IS_ERR(status)) {
225 blob = ndr_push_blob(push);
226 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
236 static bool api_echo_SourceData(pipes_struct *p)
238 const struct ndr_interface_call *call;
239 struct ndr_pull *pull;
240 struct ndr_push *push;
243 struct echo_SourceData *r;
245 call = &ndr_table_rpcecho.calls[NDR_ECHO_SOURCEDATA];
247 r = talloc(NULL, struct echo_SourceData);
252 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
257 pull = ndr_pull_init_blob(&blob, r);
263 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
264 status = call->ndr_pull(pull, NDR_IN, r);
265 if (NT_STATUS_IS_ERR(status)) {
270 if (DEBUGLEVEL >= 10)
271 NDR_PRINT_IN_DEBUG(echo_SourceData, r);
274 r->out.data = talloc_zero_array(r, uint8_t, r->in.len);
275 if (r->out.data == NULL) {
280 _echo_SourceData(p, r);
282 if (p->rng_fault_state) {
284 /* Return True here, srv_pipe_hnd.c will take care */
288 if (DEBUGLEVEL >= 10)
289 NDR_PRINT_OUT_DEBUG(echo_SourceData, r);
291 push = ndr_push_init_ctx(r);
297 status = call->ndr_push(push, NDR_OUT, r);
298 if (NT_STATUS_IS_ERR(status)) {
303 blob = ndr_push_blob(push);
304 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
314 static bool api_echo_TestCall(pipes_struct *p)
316 const struct ndr_interface_call *call;
317 struct ndr_pull *pull;
318 struct ndr_push *push;
321 struct echo_TestCall *r;
323 call = &ndr_table_rpcecho.calls[NDR_ECHO_TESTCALL];
325 r = talloc(NULL, struct echo_TestCall);
330 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
335 pull = ndr_pull_init_blob(&blob, r);
341 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
342 status = call->ndr_pull(pull, NDR_IN, r);
343 if (NT_STATUS_IS_ERR(status)) {
348 if (DEBUGLEVEL >= 10)
349 NDR_PRINT_IN_DEBUG(echo_TestCall, r);
352 r->out.s2 = talloc_zero(r, const char *);
353 if (r->out.s2 == NULL) {
358 _echo_TestCall(p, r);
360 if (p->rng_fault_state) {
362 /* Return True here, srv_pipe_hnd.c will take care */
366 if (DEBUGLEVEL >= 10)
367 NDR_PRINT_OUT_DEBUG(echo_TestCall, r);
369 push = ndr_push_init_ctx(r);
375 status = call->ndr_push(push, NDR_OUT, r);
376 if (NT_STATUS_IS_ERR(status)) {
381 blob = ndr_push_blob(push);
382 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
392 static bool api_echo_TestCall2(pipes_struct *p)
394 const struct ndr_interface_call *call;
395 struct ndr_pull *pull;
396 struct ndr_push *push;
399 struct echo_TestCall2 *r;
401 call = &ndr_table_rpcecho.calls[NDR_ECHO_TESTCALL2];
403 r = talloc(NULL, struct echo_TestCall2);
408 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
413 pull = ndr_pull_init_blob(&blob, r);
419 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
420 status = call->ndr_pull(pull, NDR_IN, r);
421 if (NT_STATUS_IS_ERR(status)) {
426 if (DEBUGLEVEL >= 10)
427 NDR_PRINT_IN_DEBUG(echo_TestCall2, r);
430 r->out.info = talloc_zero(r, union echo_Info);
431 if (r->out.info == NULL) {
436 r->out.result = _echo_TestCall2(p, r);
438 if (p->rng_fault_state) {
440 /* Return True here, srv_pipe_hnd.c will take care */
444 if (DEBUGLEVEL >= 10)
445 NDR_PRINT_OUT_DEBUG(echo_TestCall2, r);
447 push = ndr_push_init_ctx(r);
453 status = call->ndr_push(push, NDR_OUT, r);
454 if (NT_STATUS_IS_ERR(status)) {
459 blob = ndr_push_blob(push);
460 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
470 static bool api_echo_TestSleep(pipes_struct *p)
472 const struct ndr_interface_call *call;
473 struct ndr_pull *pull;
474 struct ndr_push *push;
477 struct echo_TestSleep *r;
479 call = &ndr_table_rpcecho.calls[NDR_ECHO_TESTSLEEP];
481 r = talloc(NULL, struct echo_TestSleep);
486 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
491 pull = ndr_pull_init_blob(&blob, r);
497 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
498 status = call->ndr_pull(pull, NDR_IN, r);
499 if (NT_STATUS_IS_ERR(status)) {
504 if (DEBUGLEVEL >= 10)
505 NDR_PRINT_IN_DEBUG(echo_TestSleep, r);
507 r->out.result = _echo_TestSleep(p, r);
509 if (p->rng_fault_state) {
511 /* Return True here, srv_pipe_hnd.c will take care */
515 if (DEBUGLEVEL >= 10)
516 NDR_PRINT_OUT_DEBUG(echo_TestSleep, r);
518 push = ndr_push_init_ctx(r);
524 status = call->ndr_push(push, NDR_OUT, r);
525 if (NT_STATUS_IS_ERR(status)) {
530 blob = ndr_push_blob(push);
531 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
541 static bool api_echo_TestEnum(pipes_struct *p)
543 const struct ndr_interface_call *call;
544 struct ndr_pull *pull;
545 struct ndr_push *push;
548 struct echo_TestEnum *r;
550 call = &ndr_table_rpcecho.calls[NDR_ECHO_TESTENUM];
552 r = talloc(NULL, struct echo_TestEnum);
557 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
562 pull = ndr_pull_init_blob(&blob, r);
568 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
569 status = call->ndr_pull(pull, NDR_IN, r);
570 if (NT_STATUS_IS_ERR(status)) {
575 if (DEBUGLEVEL >= 10)
576 NDR_PRINT_IN_DEBUG(echo_TestEnum, r);
579 r->out.foo1 = r->in.foo1;
580 r->out.foo2 = r->in.foo2;
581 r->out.foo3 = r->in.foo3;
582 _echo_TestEnum(p, r);
584 if (p->rng_fault_state) {
586 /* Return True here, srv_pipe_hnd.c will take care */
590 if (DEBUGLEVEL >= 10)
591 NDR_PRINT_OUT_DEBUG(echo_TestEnum, r);
593 push = ndr_push_init_ctx(r);
599 status = call->ndr_push(push, NDR_OUT, r);
600 if (NT_STATUS_IS_ERR(status)) {
605 blob = ndr_push_blob(push);
606 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
616 static bool api_echo_TestSurrounding(pipes_struct *p)
618 const struct ndr_interface_call *call;
619 struct ndr_pull *pull;
620 struct ndr_push *push;
623 struct echo_TestSurrounding *r;
625 call = &ndr_table_rpcecho.calls[NDR_ECHO_TESTSURROUNDING];
627 r = talloc(NULL, struct echo_TestSurrounding);
632 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
637 pull = ndr_pull_init_blob(&blob, r);
643 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
644 status = call->ndr_pull(pull, NDR_IN, r);
645 if (NT_STATUS_IS_ERR(status)) {
650 if (DEBUGLEVEL >= 10)
651 NDR_PRINT_IN_DEBUG(echo_TestSurrounding, r);
654 r->out.data = r->in.data;
655 _echo_TestSurrounding(p, r);
657 if (p->rng_fault_state) {
659 /* Return True here, srv_pipe_hnd.c will take care */
663 if (DEBUGLEVEL >= 10)
664 NDR_PRINT_OUT_DEBUG(echo_TestSurrounding, r);
666 push = ndr_push_init_ctx(r);
672 status = call->ndr_push(push, NDR_OUT, r);
673 if (NT_STATUS_IS_ERR(status)) {
678 blob = ndr_push_blob(push);
679 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
689 static bool api_echo_TestDoublePointer(pipes_struct *p)
691 const struct ndr_interface_call *call;
692 struct ndr_pull *pull;
693 struct ndr_push *push;
696 struct echo_TestDoublePointer *r;
698 call = &ndr_table_rpcecho.calls[NDR_ECHO_TESTDOUBLEPOINTER];
700 r = talloc(NULL, struct echo_TestDoublePointer);
705 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
710 pull = ndr_pull_init_blob(&blob, r);
716 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
717 status = call->ndr_pull(pull, NDR_IN, r);
718 if (NT_STATUS_IS_ERR(status)) {
723 if (DEBUGLEVEL >= 10)
724 NDR_PRINT_IN_DEBUG(echo_TestDoublePointer, r);
726 r->out.result = _echo_TestDoublePointer(p, r);
728 if (p->rng_fault_state) {
730 /* Return True here, srv_pipe_hnd.c will take care */
734 if (DEBUGLEVEL >= 10)
735 NDR_PRINT_OUT_DEBUG(echo_TestDoublePointer, r);
737 push = ndr_push_init_ctx(r);
743 status = call->ndr_push(push, NDR_OUT, r);
744 if (NT_STATUS_IS_ERR(status)) {
749 blob = ndr_push_blob(push);
750 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
762 static struct api_struct api_rpcecho_cmds[] =
764 {"ECHO_ADDONE", NDR_ECHO_ADDONE, api_echo_AddOne},
765 {"ECHO_ECHODATA", NDR_ECHO_ECHODATA, api_echo_EchoData},
766 {"ECHO_SINKDATA", NDR_ECHO_SINKDATA, api_echo_SinkData},
767 {"ECHO_SOURCEDATA", NDR_ECHO_SOURCEDATA, api_echo_SourceData},
768 {"ECHO_TESTCALL", NDR_ECHO_TESTCALL, api_echo_TestCall},
769 {"ECHO_TESTCALL2", NDR_ECHO_TESTCALL2, api_echo_TestCall2},
770 {"ECHO_TESTSLEEP", NDR_ECHO_TESTSLEEP, api_echo_TestSleep},
771 {"ECHO_TESTENUM", NDR_ECHO_TESTENUM, api_echo_TestEnum},
772 {"ECHO_TESTSURROUNDING", NDR_ECHO_TESTSURROUNDING, api_echo_TestSurrounding},
773 {"ECHO_TESTDOUBLEPOINTER", NDR_ECHO_TESTDOUBLEPOINTER, api_echo_TestDoublePointer},
776 void rpcecho_get_pipe_fns(struct api_struct **fns, int *n_fns)
778 *fns = api_rpcecho_cmds;
779 *n_fns = sizeof(api_rpcecho_cmds) / sizeof(struct api_struct);
782 NTSTATUS rpc_rpcecho_init(void)
784 return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "rpcecho", "rpcecho", api_rpcecho_cmds, sizeof(api_rpcecho_cmds) / sizeof(struct api_struct));