idl: recompile our IDL
[Samba/aatanasov.git] / librpc / gen_ndr / cli_echo.c
blobfd18666e4089d444a4545e76e25b9c91c64b2b8c
1 /*
2 * Unix SMB/CIFS implementation.
3 * client auto-generated by pidl. DO NOT MODIFY!
4 */
6 #include "includes.h"
7 #include "../librpc/gen_ndr/cli_echo.h"
9 struct rpccli_echo_AddOne_state {
10 struct echo_AddOne orig;
11 struct echo_AddOne tmp;
12 TALLOC_CTX *out_mem_ctx;
13 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
16 static void rpccli_echo_AddOne_done(struct tevent_req *subreq);
18 struct tevent_req *rpccli_echo_AddOne_send(TALLOC_CTX *mem_ctx,
19 struct tevent_context *ev,
20 struct rpc_pipe_client *cli,
21 uint32_t _in_data /* [in] */,
22 uint32_t *_out_data /* [out] [ref] */)
24 struct tevent_req *req;
25 struct rpccli_echo_AddOne_state *state;
26 struct tevent_req *subreq;
28 req = tevent_req_create(mem_ctx, &state,
29 struct rpccli_echo_AddOne_state);
30 if (req == NULL) {
31 return NULL;
33 state->out_mem_ctx = NULL;
34 state->dispatch_recv = cli->dispatch_recv;
36 /* In parameters */
37 state->orig.in.in_data = _in_data;
39 /* Out parameters */
40 state->orig.out.out_data = _out_data;
42 if (DEBUGLEVEL >= 10) {
43 NDR_PRINT_IN_DEBUG(echo_AddOne, &state->orig);
46 state->out_mem_ctx = talloc_named_const(state, 0,
47 "rpccli_echo_AddOne_out_memory");
48 if (tevent_req_nomem(state->out_mem_ctx, req)) {
49 return tevent_req_post(req, ev);
52 /* make a temporary copy, that we pass to the dispatch function */
53 state->tmp = state->orig;
55 subreq = cli->dispatch_send(state, ev, cli,
56 &ndr_table_rpcecho,
57 NDR_ECHO_ADDONE,
58 &state->tmp);
59 if (tevent_req_nomem(subreq, req)) {
60 return tevent_req_post(req, ev);
62 tevent_req_set_callback(subreq, rpccli_echo_AddOne_done, req);
63 return req;
66 static void rpccli_echo_AddOne_done(struct tevent_req *subreq)
68 struct tevent_req *req = tevent_req_callback_data(
69 subreq, struct tevent_req);
70 struct rpccli_echo_AddOne_state *state = tevent_req_data(
71 req, struct rpccli_echo_AddOne_state);
72 NTSTATUS status;
73 TALLOC_CTX *mem_ctx;
75 if (state->out_mem_ctx) {
76 mem_ctx = state->out_mem_ctx;
77 } else {
78 mem_ctx = state;
81 status = state->dispatch_recv(subreq, mem_ctx);
82 TALLOC_FREE(subreq);
83 if (!NT_STATUS_IS_OK(status)) {
84 tevent_req_nterror(req, status);
85 return;
88 /* Copy out parameters */
89 *state->orig.out.out_data = *state->tmp.out.out_data;
91 /* Reset temporary structure */
92 ZERO_STRUCT(state->tmp);
94 if (DEBUGLEVEL >= 10) {
95 NDR_PRINT_OUT_DEBUG(echo_AddOne, &state->orig);
98 tevent_req_done(req);
101 NTSTATUS rpccli_echo_AddOne_recv(struct tevent_req *req,
102 TALLOC_CTX *mem_ctx)
104 struct rpccli_echo_AddOne_state *state = tevent_req_data(
105 req, struct rpccli_echo_AddOne_state);
106 NTSTATUS status;
108 if (tevent_req_is_nterror(req, &status)) {
109 tevent_req_received(req);
110 return status;
113 /* Steal possbile out parameters to the callers context */
114 talloc_steal(mem_ctx, state->out_mem_ctx);
116 tevent_req_received(req);
117 return NT_STATUS_OK;
120 NTSTATUS rpccli_echo_AddOne(struct rpc_pipe_client *cli,
121 TALLOC_CTX *mem_ctx,
122 uint32_t in_data /* [in] */,
123 uint32_t *out_data /* [out] [ref] */)
125 struct echo_AddOne r;
126 NTSTATUS status;
128 /* In parameters */
129 r.in.in_data = in_data;
131 if (DEBUGLEVEL >= 10) {
132 NDR_PRINT_IN_DEBUG(echo_AddOne, &r);
135 status = cli->dispatch(cli,
136 mem_ctx,
137 &ndr_table_rpcecho,
138 NDR_ECHO_ADDONE,
139 &r);
141 if (!NT_STATUS_IS_OK(status)) {
142 return status;
145 if (DEBUGLEVEL >= 10) {
146 NDR_PRINT_OUT_DEBUG(echo_AddOne, &r);
149 if (NT_STATUS_IS_ERR(status)) {
150 return status;
153 /* Return variables */
154 *out_data = *r.out.out_data;
156 /* Return result */
157 return NT_STATUS_OK;
160 struct rpccli_echo_EchoData_state {
161 struct echo_EchoData orig;
162 struct echo_EchoData tmp;
163 TALLOC_CTX *out_mem_ctx;
164 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
167 static void rpccli_echo_EchoData_done(struct tevent_req *subreq);
169 struct tevent_req *rpccli_echo_EchoData_send(TALLOC_CTX *mem_ctx,
170 struct tevent_context *ev,
171 struct rpc_pipe_client *cli,
172 uint32_t _len /* [in] */,
173 uint8_t *_in_data /* [in] [size_is(len)] */,
174 uint8_t *_out_data /* [out] [size_is(len)] */)
176 struct tevent_req *req;
177 struct rpccli_echo_EchoData_state *state;
178 struct tevent_req *subreq;
180 req = tevent_req_create(mem_ctx, &state,
181 struct rpccli_echo_EchoData_state);
182 if (req == NULL) {
183 return NULL;
185 state->out_mem_ctx = NULL;
186 state->dispatch_recv = cli->dispatch_recv;
188 /* In parameters */
189 state->orig.in.len = _len;
190 state->orig.in.in_data = _in_data;
192 /* Out parameters */
193 state->orig.out.out_data = _out_data;
195 if (DEBUGLEVEL >= 10) {
196 NDR_PRINT_IN_DEBUG(echo_EchoData, &state->orig);
199 state->out_mem_ctx = talloc_named_const(state, 0,
200 "rpccli_echo_EchoData_out_memory");
201 if (tevent_req_nomem(state->out_mem_ctx, req)) {
202 return tevent_req_post(req, ev);
205 /* make a temporary copy, that we pass to the dispatch function */
206 state->tmp = state->orig;
208 subreq = cli->dispatch_send(state, ev, cli,
209 &ndr_table_rpcecho,
210 NDR_ECHO_ECHODATA,
211 &state->tmp);
212 if (tevent_req_nomem(subreq, req)) {
213 return tevent_req_post(req, ev);
215 tevent_req_set_callback(subreq, rpccli_echo_EchoData_done, req);
216 return req;
219 static void rpccli_echo_EchoData_done(struct tevent_req *subreq)
221 struct tevent_req *req = tevent_req_callback_data(
222 subreq, struct tevent_req);
223 struct rpccli_echo_EchoData_state *state = tevent_req_data(
224 req, struct rpccli_echo_EchoData_state);
225 NTSTATUS status;
226 TALLOC_CTX *mem_ctx;
228 if (state->out_mem_ctx) {
229 mem_ctx = state->out_mem_ctx;
230 } else {
231 mem_ctx = state;
234 status = state->dispatch_recv(subreq, mem_ctx);
235 TALLOC_FREE(subreq);
236 if (!NT_STATUS_IS_OK(status)) {
237 tevent_req_nterror(req, status);
238 return;
241 /* Copy out parameters */
242 memcpy(state->orig.out.out_data, state->tmp.out.out_data, state->tmp.in.len * sizeof(*state->orig.out.out_data));
244 /* Reset temporary structure */
245 ZERO_STRUCT(state->tmp);
247 if (DEBUGLEVEL >= 10) {
248 NDR_PRINT_OUT_DEBUG(echo_EchoData, &state->orig);
251 tevent_req_done(req);
254 NTSTATUS rpccli_echo_EchoData_recv(struct tevent_req *req,
255 TALLOC_CTX *mem_ctx)
257 struct rpccli_echo_EchoData_state *state = tevent_req_data(
258 req, struct rpccli_echo_EchoData_state);
259 NTSTATUS status;
261 if (tevent_req_is_nterror(req, &status)) {
262 tevent_req_received(req);
263 return status;
266 /* Steal possbile out parameters to the callers context */
267 talloc_steal(mem_ctx, state->out_mem_ctx);
269 tevent_req_received(req);
270 return NT_STATUS_OK;
273 NTSTATUS rpccli_echo_EchoData(struct rpc_pipe_client *cli,
274 TALLOC_CTX *mem_ctx,
275 uint32_t len /* [in] */,
276 uint8_t *in_data /* [in] [size_is(len)] */,
277 uint8_t *out_data /* [out] [size_is(len)] */)
279 struct echo_EchoData r;
280 NTSTATUS status;
282 /* In parameters */
283 r.in.len = len;
284 r.in.in_data = in_data;
286 if (DEBUGLEVEL >= 10) {
287 NDR_PRINT_IN_DEBUG(echo_EchoData, &r);
290 status = cli->dispatch(cli,
291 mem_ctx,
292 &ndr_table_rpcecho,
293 NDR_ECHO_ECHODATA,
294 &r);
296 if (!NT_STATUS_IS_OK(status)) {
297 return status;
300 if (DEBUGLEVEL >= 10) {
301 NDR_PRINT_OUT_DEBUG(echo_EchoData, &r);
304 if (NT_STATUS_IS_ERR(status)) {
305 return status;
308 /* Return variables */
309 memcpy(out_data, r.out.out_data, r.in.len * sizeof(*out_data));
311 /* Return result */
312 return NT_STATUS_OK;
315 struct rpccli_echo_SinkData_state {
316 struct echo_SinkData orig;
317 struct echo_SinkData tmp;
318 TALLOC_CTX *out_mem_ctx;
319 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
322 static void rpccli_echo_SinkData_done(struct tevent_req *subreq);
324 struct tevent_req *rpccli_echo_SinkData_send(TALLOC_CTX *mem_ctx,
325 struct tevent_context *ev,
326 struct rpc_pipe_client *cli,
327 uint32_t _len /* [in] */,
328 uint8_t *_data /* [in] [size_is(len)] */)
330 struct tevent_req *req;
331 struct rpccli_echo_SinkData_state *state;
332 struct tevent_req *subreq;
334 req = tevent_req_create(mem_ctx, &state,
335 struct rpccli_echo_SinkData_state);
336 if (req == NULL) {
337 return NULL;
339 state->out_mem_ctx = NULL;
340 state->dispatch_recv = cli->dispatch_recv;
342 /* In parameters */
343 state->orig.in.len = _len;
344 state->orig.in.data = _data;
346 /* Out parameters */
348 if (DEBUGLEVEL >= 10) {
349 NDR_PRINT_IN_DEBUG(echo_SinkData, &state->orig);
352 /* make a temporary copy, that we pass to the dispatch function */
353 state->tmp = state->orig;
355 subreq = cli->dispatch_send(state, ev, cli,
356 &ndr_table_rpcecho,
357 NDR_ECHO_SINKDATA,
358 &state->tmp);
359 if (tevent_req_nomem(subreq, req)) {
360 return tevent_req_post(req, ev);
362 tevent_req_set_callback(subreq, rpccli_echo_SinkData_done, req);
363 return req;
366 static void rpccli_echo_SinkData_done(struct tevent_req *subreq)
368 struct tevent_req *req = tevent_req_callback_data(
369 subreq, struct tevent_req);
370 struct rpccli_echo_SinkData_state *state = tevent_req_data(
371 req, struct rpccli_echo_SinkData_state);
372 NTSTATUS status;
373 TALLOC_CTX *mem_ctx;
375 if (state->out_mem_ctx) {
376 mem_ctx = state->out_mem_ctx;
377 } else {
378 mem_ctx = state;
381 status = state->dispatch_recv(subreq, mem_ctx);
382 TALLOC_FREE(subreq);
383 if (!NT_STATUS_IS_OK(status)) {
384 tevent_req_nterror(req, status);
385 return;
388 /* Copy out parameters */
390 /* Reset temporary structure */
391 ZERO_STRUCT(state->tmp);
393 if (DEBUGLEVEL >= 10) {
394 NDR_PRINT_OUT_DEBUG(echo_SinkData, &state->orig);
397 tevent_req_done(req);
400 NTSTATUS rpccli_echo_SinkData_recv(struct tevent_req *req,
401 TALLOC_CTX *mem_ctx)
403 struct rpccli_echo_SinkData_state *state = tevent_req_data(
404 req, struct rpccli_echo_SinkData_state);
405 NTSTATUS status;
407 if (tevent_req_is_nterror(req, &status)) {
408 tevent_req_received(req);
409 return status;
412 /* Steal possbile out parameters to the callers context */
413 talloc_steal(mem_ctx, state->out_mem_ctx);
415 tevent_req_received(req);
416 return NT_STATUS_OK;
419 NTSTATUS rpccli_echo_SinkData(struct rpc_pipe_client *cli,
420 TALLOC_CTX *mem_ctx,
421 uint32_t len /* [in] */,
422 uint8_t *data /* [in] [size_is(len)] */)
424 struct echo_SinkData r;
425 NTSTATUS status;
427 /* In parameters */
428 r.in.len = len;
429 r.in.data = data;
431 if (DEBUGLEVEL >= 10) {
432 NDR_PRINT_IN_DEBUG(echo_SinkData, &r);
435 status = cli->dispatch(cli,
436 mem_ctx,
437 &ndr_table_rpcecho,
438 NDR_ECHO_SINKDATA,
439 &r);
441 if (!NT_STATUS_IS_OK(status)) {
442 return status;
445 if (DEBUGLEVEL >= 10) {
446 NDR_PRINT_OUT_DEBUG(echo_SinkData, &r);
449 if (NT_STATUS_IS_ERR(status)) {
450 return status;
453 /* Return variables */
455 /* Return result */
456 return NT_STATUS_OK;
459 struct rpccli_echo_SourceData_state {
460 struct echo_SourceData orig;
461 struct echo_SourceData tmp;
462 TALLOC_CTX *out_mem_ctx;
463 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
466 static void rpccli_echo_SourceData_done(struct tevent_req *subreq);
468 struct tevent_req *rpccli_echo_SourceData_send(TALLOC_CTX *mem_ctx,
469 struct tevent_context *ev,
470 struct rpc_pipe_client *cli,
471 uint32_t _len /* [in] */,
472 uint8_t *_data /* [out] [size_is(len)] */)
474 struct tevent_req *req;
475 struct rpccli_echo_SourceData_state *state;
476 struct tevent_req *subreq;
478 req = tevent_req_create(mem_ctx, &state,
479 struct rpccli_echo_SourceData_state);
480 if (req == NULL) {
481 return NULL;
483 state->out_mem_ctx = NULL;
484 state->dispatch_recv = cli->dispatch_recv;
486 /* In parameters */
487 state->orig.in.len = _len;
489 /* Out parameters */
490 state->orig.out.data = _data;
492 if (DEBUGLEVEL >= 10) {
493 NDR_PRINT_IN_DEBUG(echo_SourceData, &state->orig);
496 state->out_mem_ctx = talloc_named_const(state, 0,
497 "rpccli_echo_SourceData_out_memory");
498 if (tevent_req_nomem(state->out_mem_ctx, req)) {
499 return tevent_req_post(req, ev);
502 /* make a temporary copy, that we pass to the dispatch function */
503 state->tmp = state->orig;
505 subreq = cli->dispatch_send(state, ev, cli,
506 &ndr_table_rpcecho,
507 NDR_ECHO_SOURCEDATA,
508 &state->tmp);
509 if (tevent_req_nomem(subreq, req)) {
510 return tevent_req_post(req, ev);
512 tevent_req_set_callback(subreq, rpccli_echo_SourceData_done, req);
513 return req;
516 static void rpccli_echo_SourceData_done(struct tevent_req *subreq)
518 struct tevent_req *req = tevent_req_callback_data(
519 subreq, struct tevent_req);
520 struct rpccli_echo_SourceData_state *state = tevent_req_data(
521 req, struct rpccli_echo_SourceData_state);
522 NTSTATUS status;
523 TALLOC_CTX *mem_ctx;
525 if (state->out_mem_ctx) {
526 mem_ctx = state->out_mem_ctx;
527 } else {
528 mem_ctx = state;
531 status = state->dispatch_recv(subreq, mem_ctx);
532 TALLOC_FREE(subreq);
533 if (!NT_STATUS_IS_OK(status)) {
534 tevent_req_nterror(req, status);
535 return;
538 /* Copy out parameters */
539 memcpy(state->orig.out.data, state->tmp.out.data, state->tmp.in.len * sizeof(*state->orig.out.data));
541 /* Reset temporary structure */
542 ZERO_STRUCT(state->tmp);
544 if (DEBUGLEVEL >= 10) {
545 NDR_PRINT_OUT_DEBUG(echo_SourceData, &state->orig);
548 tevent_req_done(req);
551 NTSTATUS rpccli_echo_SourceData_recv(struct tevent_req *req,
552 TALLOC_CTX *mem_ctx)
554 struct rpccli_echo_SourceData_state *state = tevent_req_data(
555 req, struct rpccli_echo_SourceData_state);
556 NTSTATUS status;
558 if (tevent_req_is_nterror(req, &status)) {
559 tevent_req_received(req);
560 return status;
563 /* Steal possbile out parameters to the callers context */
564 talloc_steal(mem_ctx, state->out_mem_ctx);
566 tevent_req_received(req);
567 return NT_STATUS_OK;
570 NTSTATUS rpccli_echo_SourceData(struct rpc_pipe_client *cli,
571 TALLOC_CTX *mem_ctx,
572 uint32_t len /* [in] */,
573 uint8_t *data /* [out] [size_is(len)] */)
575 struct echo_SourceData r;
576 NTSTATUS status;
578 /* In parameters */
579 r.in.len = len;
581 if (DEBUGLEVEL >= 10) {
582 NDR_PRINT_IN_DEBUG(echo_SourceData, &r);
585 status = cli->dispatch(cli,
586 mem_ctx,
587 &ndr_table_rpcecho,
588 NDR_ECHO_SOURCEDATA,
589 &r);
591 if (!NT_STATUS_IS_OK(status)) {
592 return status;
595 if (DEBUGLEVEL >= 10) {
596 NDR_PRINT_OUT_DEBUG(echo_SourceData, &r);
599 if (NT_STATUS_IS_ERR(status)) {
600 return status;
603 /* Return variables */
604 memcpy(data, r.out.data, r.in.len * sizeof(*data));
606 /* Return result */
607 return NT_STATUS_OK;
610 struct rpccli_echo_TestCall_state {
611 struct echo_TestCall orig;
612 struct echo_TestCall tmp;
613 TALLOC_CTX *out_mem_ctx;
614 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
617 static void rpccli_echo_TestCall_done(struct tevent_req *subreq);
619 struct tevent_req *rpccli_echo_TestCall_send(TALLOC_CTX *mem_ctx,
620 struct tevent_context *ev,
621 struct rpc_pipe_client *cli,
622 const char *_s1 /* [in] [ref,charset(UTF16)] */,
623 const char **_s2 /* [out] [ref,charset(UTF16)] */)
625 struct tevent_req *req;
626 struct rpccli_echo_TestCall_state *state;
627 struct tevent_req *subreq;
629 req = tevent_req_create(mem_ctx, &state,
630 struct rpccli_echo_TestCall_state);
631 if (req == NULL) {
632 return NULL;
634 state->out_mem_ctx = NULL;
635 state->dispatch_recv = cli->dispatch_recv;
637 /* In parameters */
638 state->orig.in.s1 = _s1;
640 /* Out parameters */
641 state->orig.out.s2 = _s2;
643 if (DEBUGLEVEL >= 10) {
644 NDR_PRINT_IN_DEBUG(echo_TestCall, &state->orig);
647 state->out_mem_ctx = talloc_named_const(state, 0,
648 "rpccli_echo_TestCall_out_memory");
649 if (tevent_req_nomem(state->out_mem_ctx, req)) {
650 return tevent_req_post(req, ev);
653 /* make a temporary copy, that we pass to the dispatch function */
654 state->tmp = state->orig;
656 subreq = cli->dispatch_send(state, ev, cli,
657 &ndr_table_rpcecho,
658 NDR_ECHO_TESTCALL,
659 &state->tmp);
660 if (tevent_req_nomem(subreq, req)) {
661 return tevent_req_post(req, ev);
663 tevent_req_set_callback(subreq, rpccli_echo_TestCall_done, req);
664 return req;
667 static void rpccli_echo_TestCall_done(struct tevent_req *subreq)
669 struct tevent_req *req = tevent_req_callback_data(
670 subreq, struct tevent_req);
671 struct rpccli_echo_TestCall_state *state = tevent_req_data(
672 req, struct rpccli_echo_TestCall_state);
673 NTSTATUS status;
674 TALLOC_CTX *mem_ctx;
676 if (state->out_mem_ctx) {
677 mem_ctx = state->out_mem_ctx;
678 } else {
679 mem_ctx = state;
682 status = state->dispatch_recv(subreq, mem_ctx);
683 TALLOC_FREE(subreq);
684 if (!NT_STATUS_IS_OK(status)) {
685 tevent_req_nterror(req, status);
686 return;
689 /* Copy out parameters */
690 *state->orig.out.s2 = *state->tmp.out.s2;
692 /* Reset temporary structure */
693 ZERO_STRUCT(state->tmp);
695 if (DEBUGLEVEL >= 10) {
696 NDR_PRINT_OUT_DEBUG(echo_TestCall, &state->orig);
699 tevent_req_done(req);
702 NTSTATUS rpccli_echo_TestCall_recv(struct tevent_req *req,
703 TALLOC_CTX *mem_ctx)
705 struct rpccli_echo_TestCall_state *state = tevent_req_data(
706 req, struct rpccli_echo_TestCall_state);
707 NTSTATUS status;
709 if (tevent_req_is_nterror(req, &status)) {
710 tevent_req_received(req);
711 return status;
714 /* Steal possbile out parameters to the callers context */
715 talloc_steal(mem_ctx, state->out_mem_ctx);
717 tevent_req_received(req);
718 return NT_STATUS_OK;
721 NTSTATUS rpccli_echo_TestCall(struct rpc_pipe_client *cli,
722 TALLOC_CTX *mem_ctx,
723 const char *s1 /* [in] [ref,charset(UTF16)] */,
724 const char **s2 /* [out] [ref,charset(UTF16)] */)
726 struct echo_TestCall r;
727 NTSTATUS status;
729 /* In parameters */
730 r.in.s1 = s1;
732 if (DEBUGLEVEL >= 10) {
733 NDR_PRINT_IN_DEBUG(echo_TestCall, &r);
736 status = cli->dispatch(cli,
737 mem_ctx,
738 &ndr_table_rpcecho,
739 NDR_ECHO_TESTCALL,
740 &r);
742 if (!NT_STATUS_IS_OK(status)) {
743 return status;
746 if (DEBUGLEVEL >= 10) {
747 NDR_PRINT_OUT_DEBUG(echo_TestCall, &r);
750 if (NT_STATUS_IS_ERR(status)) {
751 return status;
754 /* Return variables */
755 *s2 = *r.out.s2;
757 /* Return result */
758 return NT_STATUS_OK;
761 struct rpccli_echo_TestCall2_state {
762 struct echo_TestCall2 orig;
763 struct echo_TestCall2 tmp;
764 TALLOC_CTX *out_mem_ctx;
765 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
768 static void rpccli_echo_TestCall2_done(struct tevent_req *subreq);
770 struct tevent_req *rpccli_echo_TestCall2_send(TALLOC_CTX *mem_ctx,
771 struct tevent_context *ev,
772 struct rpc_pipe_client *cli,
773 uint16_t _level /* [in] */,
774 union echo_Info *_info /* [out] [ref,switch_is(level)] */)
776 struct tevent_req *req;
777 struct rpccli_echo_TestCall2_state *state;
778 struct tevent_req *subreq;
780 req = tevent_req_create(mem_ctx, &state,
781 struct rpccli_echo_TestCall2_state);
782 if (req == NULL) {
783 return NULL;
785 state->out_mem_ctx = NULL;
786 state->dispatch_recv = cli->dispatch_recv;
788 /* In parameters */
789 state->orig.in.level = _level;
791 /* Out parameters */
792 state->orig.out.info = _info;
794 /* Result */
795 ZERO_STRUCT(state->orig.out.result);
797 if (DEBUGLEVEL >= 10) {
798 NDR_PRINT_IN_DEBUG(echo_TestCall2, &state->orig);
801 state->out_mem_ctx = talloc_named_const(state, 0,
802 "rpccli_echo_TestCall2_out_memory");
803 if (tevent_req_nomem(state->out_mem_ctx, req)) {
804 return tevent_req_post(req, ev);
807 /* make a temporary copy, that we pass to the dispatch function */
808 state->tmp = state->orig;
810 subreq = cli->dispatch_send(state, ev, cli,
811 &ndr_table_rpcecho,
812 NDR_ECHO_TESTCALL2,
813 &state->tmp);
814 if (tevent_req_nomem(subreq, req)) {
815 return tevent_req_post(req, ev);
817 tevent_req_set_callback(subreq, rpccli_echo_TestCall2_done, req);
818 return req;
821 static void rpccli_echo_TestCall2_done(struct tevent_req *subreq)
823 struct tevent_req *req = tevent_req_callback_data(
824 subreq, struct tevent_req);
825 struct rpccli_echo_TestCall2_state *state = tevent_req_data(
826 req, struct rpccli_echo_TestCall2_state);
827 NTSTATUS status;
828 TALLOC_CTX *mem_ctx;
830 if (state->out_mem_ctx) {
831 mem_ctx = state->out_mem_ctx;
832 } else {
833 mem_ctx = state;
836 status = state->dispatch_recv(subreq, mem_ctx);
837 TALLOC_FREE(subreq);
838 if (!NT_STATUS_IS_OK(status)) {
839 tevent_req_nterror(req, status);
840 return;
843 /* Copy out parameters */
844 *state->orig.out.info = *state->tmp.out.info;
846 /* Copy result */
847 state->orig.out.result = state->tmp.out.result;
849 /* Reset temporary structure */
850 ZERO_STRUCT(state->tmp);
852 if (DEBUGLEVEL >= 10) {
853 NDR_PRINT_OUT_DEBUG(echo_TestCall2, &state->orig);
856 tevent_req_done(req);
859 NTSTATUS rpccli_echo_TestCall2_recv(struct tevent_req *req,
860 TALLOC_CTX *mem_ctx,
861 NTSTATUS *result)
863 struct rpccli_echo_TestCall2_state *state = tevent_req_data(
864 req, struct rpccli_echo_TestCall2_state);
865 NTSTATUS status;
867 if (tevent_req_is_nterror(req, &status)) {
868 tevent_req_received(req);
869 return status;
872 /* Steal possbile out parameters to the callers context */
873 talloc_steal(mem_ctx, state->out_mem_ctx);
875 /* Return result */
876 *result = state->orig.out.result;
878 tevent_req_received(req);
879 return NT_STATUS_OK;
882 NTSTATUS rpccli_echo_TestCall2(struct rpc_pipe_client *cli,
883 TALLOC_CTX *mem_ctx,
884 uint16_t level /* [in] */,
885 union echo_Info *info /* [out] [ref,switch_is(level)] */)
887 struct echo_TestCall2 r;
888 NTSTATUS status;
890 /* In parameters */
891 r.in.level = level;
893 if (DEBUGLEVEL >= 10) {
894 NDR_PRINT_IN_DEBUG(echo_TestCall2, &r);
897 status = cli->dispatch(cli,
898 mem_ctx,
899 &ndr_table_rpcecho,
900 NDR_ECHO_TESTCALL2,
901 &r);
903 if (!NT_STATUS_IS_OK(status)) {
904 return status;
907 if (DEBUGLEVEL >= 10) {
908 NDR_PRINT_OUT_DEBUG(echo_TestCall2, &r);
911 if (NT_STATUS_IS_ERR(status)) {
912 return status;
915 /* Return variables */
916 *info = *r.out.info;
918 /* Return result */
919 return r.out.result;
922 struct rpccli_echo_TestSleep_state {
923 struct echo_TestSleep orig;
924 struct echo_TestSleep tmp;
925 TALLOC_CTX *out_mem_ctx;
926 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
929 static void rpccli_echo_TestSleep_done(struct tevent_req *subreq);
931 struct tevent_req *rpccli_echo_TestSleep_send(TALLOC_CTX *mem_ctx,
932 struct tevent_context *ev,
933 struct rpc_pipe_client *cli,
934 uint32_t _seconds /* [in] */)
936 struct tevent_req *req;
937 struct rpccli_echo_TestSleep_state *state;
938 struct tevent_req *subreq;
940 req = tevent_req_create(mem_ctx, &state,
941 struct rpccli_echo_TestSleep_state);
942 if (req == NULL) {
943 return NULL;
945 state->out_mem_ctx = NULL;
946 state->dispatch_recv = cli->dispatch_recv;
948 /* In parameters */
949 state->orig.in.seconds = _seconds;
951 /* Out parameters */
953 /* Result */
954 ZERO_STRUCT(state->orig.out.result);
956 if (DEBUGLEVEL >= 10) {
957 NDR_PRINT_IN_DEBUG(echo_TestSleep, &state->orig);
960 /* make a temporary copy, that we pass to the dispatch function */
961 state->tmp = state->orig;
963 subreq = cli->dispatch_send(state, ev, cli,
964 &ndr_table_rpcecho,
965 NDR_ECHO_TESTSLEEP,
966 &state->tmp);
967 if (tevent_req_nomem(subreq, req)) {
968 return tevent_req_post(req, ev);
970 tevent_req_set_callback(subreq, rpccli_echo_TestSleep_done, req);
971 return req;
974 static void rpccli_echo_TestSleep_done(struct tevent_req *subreq)
976 struct tevent_req *req = tevent_req_callback_data(
977 subreq, struct tevent_req);
978 struct rpccli_echo_TestSleep_state *state = tevent_req_data(
979 req, struct rpccli_echo_TestSleep_state);
980 NTSTATUS status;
981 TALLOC_CTX *mem_ctx;
983 if (state->out_mem_ctx) {
984 mem_ctx = state->out_mem_ctx;
985 } else {
986 mem_ctx = state;
989 status = state->dispatch_recv(subreq, mem_ctx);
990 TALLOC_FREE(subreq);
991 if (!NT_STATUS_IS_OK(status)) {
992 tevent_req_nterror(req, status);
993 return;
996 /* Copy out parameters */
998 /* Copy result */
999 state->orig.out.result = state->tmp.out.result;
1001 /* Reset temporary structure */
1002 ZERO_STRUCT(state->tmp);
1004 if (DEBUGLEVEL >= 10) {
1005 NDR_PRINT_OUT_DEBUG(echo_TestSleep, &state->orig);
1008 tevent_req_done(req);
1011 NTSTATUS rpccli_echo_TestSleep_recv(struct tevent_req *req,
1012 TALLOC_CTX *mem_ctx,
1013 uint32 *result)
1015 struct rpccli_echo_TestSleep_state *state = tevent_req_data(
1016 req, struct rpccli_echo_TestSleep_state);
1017 NTSTATUS status;
1019 if (tevent_req_is_nterror(req, &status)) {
1020 tevent_req_received(req);
1021 return status;
1024 /* Steal possbile out parameters to the callers context */
1025 talloc_steal(mem_ctx, state->out_mem_ctx);
1027 /* Return result */
1028 *result = state->orig.out.result;
1030 tevent_req_received(req);
1031 return NT_STATUS_OK;
1034 NTSTATUS rpccli_echo_TestSleep(struct rpc_pipe_client *cli,
1035 TALLOC_CTX *mem_ctx,
1036 uint32_t seconds /* [in] */)
1038 struct echo_TestSleep r;
1039 NTSTATUS status;
1041 /* In parameters */
1042 r.in.seconds = seconds;
1044 if (DEBUGLEVEL >= 10) {
1045 NDR_PRINT_IN_DEBUG(echo_TestSleep, &r);
1048 status = cli->dispatch(cli,
1049 mem_ctx,
1050 &ndr_table_rpcecho,
1051 NDR_ECHO_TESTSLEEP,
1052 &r);
1054 if (!NT_STATUS_IS_OK(status)) {
1055 return status;
1058 if (DEBUGLEVEL >= 10) {
1059 NDR_PRINT_OUT_DEBUG(echo_TestSleep, &r);
1062 if (NT_STATUS_IS_ERR(status)) {
1063 return status;
1066 /* Return variables */
1068 /* Return result */
1069 return NT_STATUS_OK;
1072 struct rpccli_echo_TestEnum_state {
1073 struct echo_TestEnum orig;
1074 struct echo_TestEnum tmp;
1075 TALLOC_CTX *out_mem_ctx;
1076 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1079 static void rpccli_echo_TestEnum_done(struct tevent_req *subreq);
1081 struct tevent_req *rpccli_echo_TestEnum_send(TALLOC_CTX *mem_ctx,
1082 struct tevent_context *ev,
1083 struct rpc_pipe_client *cli,
1084 enum echo_Enum1 *_foo1 /* [in,out] [ref] */,
1085 struct echo_Enum2 *_foo2 /* [in,out] [ref] */,
1086 union echo_Enum3 *_foo3 /* [in,out] [ref,switch_is(*foo1)] */)
1088 struct tevent_req *req;
1089 struct rpccli_echo_TestEnum_state *state;
1090 struct tevent_req *subreq;
1092 req = tevent_req_create(mem_ctx, &state,
1093 struct rpccli_echo_TestEnum_state);
1094 if (req == NULL) {
1095 return NULL;
1097 state->out_mem_ctx = NULL;
1098 state->dispatch_recv = cli->dispatch_recv;
1100 /* In parameters */
1101 state->orig.in.foo1 = _foo1;
1102 state->orig.in.foo2 = _foo2;
1103 state->orig.in.foo3 = _foo3;
1105 /* Out parameters */
1106 state->orig.out.foo1 = _foo1;
1107 state->orig.out.foo2 = _foo2;
1108 state->orig.out.foo3 = _foo3;
1110 if (DEBUGLEVEL >= 10) {
1111 NDR_PRINT_IN_DEBUG(echo_TestEnum, &state->orig);
1114 state->out_mem_ctx = talloc_named_const(state, 0,
1115 "rpccli_echo_TestEnum_out_memory");
1116 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1117 return tevent_req_post(req, ev);
1120 /* make a temporary copy, that we pass to the dispatch function */
1121 state->tmp = state->orig;
1123 subreq = cli->dispatch_send(state, ev, cli,
1124 &ndr_table_rpcecho,
1125 NDR_ECHO_TESTENUM,
1126 &state->tmp);
1127 if (tevent_req_nomem(subreq, req)) {
1128 return tevent_req_post(req, ev);
1130 tevent_req_set_callback(subreq, rpccli_echo_TestEnum_done, req);
1131 return req;
1134 static void rpccli_echo_TestEnum_done(struct tevent_req *subreq)
1136 struct tevent_req *req = tevent_req_callback_data(
1137 subreq, struct tevent_req);
1138 struct rpccli_echo_TestEnum_state *state = tevent_req_data(
1139 req, struct rpccli_echo_TestEnum_state);
1140 NTSTATUS status;
1141 TALLOC_CTX *mem_ctx;
1143 if (state->out_mem_ctx) {
1144 mem_ctx = state->out_mem_ctx;
1145 } else {
1146 mem_ctx = state;
1149 status = state->dispatch_recv(subreq, mem_ctx);
1150 TALLOC_FREE(subreq);
1151 if (!NT_STATUS_IS_OK(status)) {
1152 tevent_req_nterror(req, status);
1153 return;
1156 /* Copy out parameters */
1157 *state->orig.out.foo1 = *state->tmp.out.foo1;
1158 *state->orig.out.foo2 = *state->tmp.out.foo2;
1159 *state->orig.out.foo3 = *state->tmp.out.foo3;
1161 /* Reset temporary structure */
1162 ZERO_STRUCT(state->tmp);
1164 if (DEBUGLEVEL >= 10) {
1165 NDR_PRINT_OUT_DEBUG(echo_TestEnum, &state->orig);
1168 tevent_req_done(req);
1171 NTSTATUS rpccli_echo_TestEnum_recv(struct tevent_req *req,
1172 TALLOC_CTX *mem_ctx)
1174 struct rpccli_echo_TestEnum_state *state = tevent_req_data(
1175 req, struct rpccli_echo_TestEnum_state);
1176 NTSTATUS status;
1178 if (tevent_req_is_nterror(req, &status)) {
1179 tevent_req_received(req);
1180 return status;
1183 /* Steal possbile out parameters to the callers context */
1184 talloc_steal(mem_ctx, state->out_mem_ctx);
1186 tevent_req_received(req);
1187 return NT_STATUS_OK;
1190 NTSTATUS rpccli_echo_TestEnum(struct rpc_pipe_client *cli,
1191 TALLOC_CTX *mem_ctx,
1192 enum echo_Enum1 *foo1 /* [in,out] [ref] */,
1193 struct echo_Enum2 *foo2 /* [in,out] [ref] */,
1194 union echo_Enum3 *foo3 /* [in,out] [ref,switch_is(*foo1)] */)
1196 struct echo_TestEnum r;
1197 NTSTATUS status;
1199 /* In parameters */
1200 r.in.foo1 = foo1;
1201 r.in.foo2 = foo2;
1202 r.in.foo3 = foo3;
1204 if (DEBUGLEVEL >= 10) {
1205 NDR_PRINT_IN_DEBUG(echo_TestEnum, &r);
1208 status = cli->dispatch(cli,
1209 mem_ctx,
1210 &ndr_table_rpcecho,
1211 NDR_ECHO_TESTENUM,
1212 &r);
1214 if (!NT_STATUS_IS_OK(status)) {
1215 return status;
1218 if (DEBUGLEVEL >= 10) {
1219 NDR_PRINT_OUT_DEBUG(echo_TestEnum, &r);
1222 if (NT_STATUS_IS_ERR(status)) {
1223 return status;
1226 /* Return variables */
1227 *foo1 = *r.out.foo1;
1228 *foo2 = *r.out.foo2;
1229 *foo3 = *r.out.foo3;
1231 /* Return result */
1232 return NT_STATUS_OK;
1235 struct rpccli_echo_TestSurrounding_state {
1236 struct echo_TestSurrounding orig;
1237 struct echo_TestSurrounding tmp;
1238 TALLOC_CTX *out_mem_ctx;
1239 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1242 static void rpccli_echo_TestSurrounding_done(struct tevent_req *subreq);
1244 struct tevent_req *rpccli_echo_TestSurrounding_send(TALLOC_CTX *mem_ctx,
1245 struct tevent_context *ev,
1246 struct rpc_pipe_client *cli,
1247 struct echo_Surrounding *_data /* [in,out] [ref] */)
1249 struct tevent_req *req;
1250 struct rpccli_echo_TestSurrounding_state *state;
1251 struct tevent_req *subreq;
1253 req = tevent_req_create(mem_ctx, &state,
1254 struct rpccli_echo_TestSurrounding_state);
1255 if (req == NULL) {
1256 return NULL;
1258 state->out_mem_ctx = NULL;
1259 state->dispatch_recv = cli->dispatch_recv;
1261 /* In parameters */
1262 state->orig.in.data = _data;
1264 /* Out parameters */
1265 state->orig.out.data = _data;
1267 if (DEBUGLEVEL >= 10) {
1268 NDR_PRINT_IN_DEBUG(echo_TestSurrounding, &state->orig);
1271 state->out_mem_ctx = talloc_named_const(state, 0,
1272 "rpccli_echo_TestSurrounding_out_memory");
1273 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1274 return tevent_req_post(req, ev);
1277 /* make a temporary copy, that we pass to the dispatch function */
1278 state->tmp = state->orig;
1280 subreq = cli->dispatch_send(state, ev, cli,
1281 &ndr_table_rpcecho,
1282 NDR_ECHO_TESTSURROUNDING,
1283 &state->tmp);
1284 if (tevent_req_nomem(subreq, req)) {
1285 return tevent_req_post(req, ev);
1287 tevent_req_set_callback(subreq, rpccli_echo_TestSurrounding_done, req);
1288 return req;
1291 static void rpccli_echo_TestSurrounding_done(struct tevent_req *subreq)
1293 struct tevent_req *req = tevent_req_callback_data(
1294 subreq, struct tevent_req);
1295 struct rpccli_echo_TestSurrounding_state *state = tevent_req_data(
1296 req, struct rpccli_echo_TestSurrounding_state);
1297 NTSTATUS status;
1298 TALLOC_CTX *mem_ctx;
1300 if (state->out_mem_ctx) {
1301 mem_ctx = state->out_mem_ctx;
1302 } else {
1303 mem_ctx = state;
1306 status = state->dispatch_recv(subreq, mem_ctx);
1307 TALLOC_FREE(subreq);
1308 if (!NT_STATUS_IS_OK(status)) {
1309 tevent_req_nterror(req, status);
1310 return;
1313 /* Copy out parameters */
1314 *state->orig.out.data = *state->tmp.out.data;
1316 /* Reset temporary structure */
1317 ZERO_STRUCT(state->tmp);
1319 if (DEBUGLEVEL >= 10) {
1320 NDR_PRINT_OUT_DEBUG(echo_TestSurrounding, &state->orig);
1323 tevent_req_done(req);
1326 NTSTATUS rpccli_echo_TestSurrounding_recv(struct tevent_req *req,
1327 TALLOC_CTX *mem_ctx)
1329 struct rpccli_echo_TestSurrounding_state *state = tevent_req_data(
1330 req, struct rpccli_echo_TestSurrounding_state);
1331 NTSTATUS status;
1333 if (tevent_req_is_nterror(req, &status)) {
1334 tevent_req_received(req);
1335 return status;
1338 /* Steal possbile out parameters to the callers context */
1339 talloc_steal(mem_ctx, state->out_mem_ctx);
1341 tevent_req_received(req);
1342 return NT_STATUS_OK;
1345 NTSTATUS rpccli_echo_TestSurrounding(struct rpc_pipe_client *cli,
1346 TALLOC_CTX *mem_ctx,
1347 struct echo_Surrounding *data /* [in,out] [ref] */)
1349 struct echo_TestSurrounding r;
1350 NTSTATUS status;
1352 /* In parameters */
1353 r.in.data = data;
1355 if (DEBUGLEVEL >= 10) {
1356 NDR_PRINT_IN_DEBUG(echo_TestSurrounding, &r);
1359 status = cli->dispatch(cli,
1360 mem_ctx,
1361 &ndr_table_rpcecho,
1362 NDR_ECHO_TESTSURROUNDING,
1363 &r);
1365 if (!NT_STATUS_IS_OK(status)) {
1366 return status;
1369 if (DEBUGLEVEL >= 10) {
1370 NDR_PRINT_OUT_DEBUG(echo_TestSurrounding, &r);
1373 if (NT_STATUS_IS_ERR(status)) {
1374 return status;
1377 /* Return variables */
1378 *data = *r.out.data;
1380 /* Return result */
1381 return NT_STATUS_OK;
1384 struct rpccli_echo_TestDoublePointer_state {
1385 struct echo_TestDoublePointer orig;
1386 struct echo_TestDoublePointer tmp;
1387 TALLOC_CTX *out_mem_ctx;
1388 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1391 static void rpccli_echo_TestDoublePointer_done(struct tevent_req *subreq);
1393 struct tevent_req *rpccli_echo_TestDoublePointer_send(TALLOC_CTX *mem_ctx,
1394 struct tevent_context *ev,
1395 struct rpc_pipe_client *cli,
1396 uint16_t ***_data /* [in] [ref] */)
1398 struct tevent_req *req;
1399 struct rpccli_echo_TestDoublePointer_state *state;
1400 struct tevent_req *subreq;
1402 req = tevent_req_create(mem_ctx, &state,
1403 struct rpccli_echo_TestDoublePointer_state);
1404 if (req == NULL) {
1405 return NULL;
1407 state->out_mem_ctx = NULL;
1408 state->dispatch_recv = cli->dispatch_recv;
1410 /* In parameters */
1411 state->orig.in.data = _data;
1413 /* Out parameters */
1415 /* Result */
1416 ZERO_STRUCT(state->orig.out.result);
1418 if (DEBUGLEVEL >= 10) {
1419 NDR_PRINT_IN_DEBUG(echo_TestDoublePointer, &state->orig);
1422 /* make a temporary copy, that we pass to the dispatch function */
1423 state->tmp = state->orig;
1425 subreq = cli->dispatch_send(state, ev, cli,
1426 &ndr_table_rpcecho,
1427 NDR_ECHO_TESTDOUBLEPOINTER,
1428 &state->tmp);
1429 if (tevent_req_nomem(subreq, req)) {
1430 return tevent_req_post(req, ev);
1432 tevent_req_set_callback(subreq, rpccli_echo_TestDoublePointer_done, req);
1433 return req;
1436 static void rpccli_echo_TestDoublePointer_done(struct tevent_req *subreq)
1438 struct tevent_req *req = tevent_req_callback_data(
1439 subreq, struct tevent_req);
1440 struct rpccli_echo_TestDoublePointer_state *state = tevent_req_data(
1441 req, struct rpccli_echo_TestDoublePointer_state);
1442 NTSTATUS status;
1443 TALLOC_CTX *mem_ctx;
1445 if (state->out_mem_ctx) {
1446 mem_ctx = state->out_mem_ctx;
1447 } else {
1448 mem_ctx = state;
1451 status = state->dispatch_recv(subreq, mem_ctx);
1452 TALLOC_FREE(subreq);
1453 if (!NT_STATUS_IS_OK(status)) {
1454 tevent_req_nterror(req, status);
1455 return;
1458 /* Copy out parameters */
1460 /* Copy result */
1461 state->orig.out.result = state->tmp.out.result;
1463 /* Reset temporary structure */
1464 ZERO_STRUCT(state->tmp);
1466 if (DEBUGLEVEL >= 10) {
1467 NDR_PRINT_OUT_DEBUG(echo_TestDoublePointer, &state->orig);
1470 tevent_req_done(req);
1473 NTSTATUS rpccli_echo_TestDoublePointer_recv(struct tevent_req *req,
1474 TALLOC_CTX *mem_ctx,
1475 uint16 *result)
1477 struct rpccli_echo_TestDoublePointer_state *state = tevent_req_data(
1478 req, struct rpccli_echo_TestDoublePointer_state);
1479 NTSTATUS status;
1481 if (tevent_req_is_nterror(req, &status)) {
1482 tevent_req_received(req);
1483 return status;
1486 /* Steal possbile out parameters to the callers context */
1487 talloc_steal(mem_ctx, state->out_mem_ctx);
1489 /* Return result */
1490 *result = state->orig.out.result;
1492 tevent_req_received(req);
1493 return NT_STATUS_OK;
1496 NTSTATUS rpccli_echo_TestDoublePointer(struct rpc_pipe_client *cli,
1497 TALLOC_CTX *mem_ctx,
1498 uint16_t ***data /* [in] [ref] */)
1500 struct echo_TestDoublePointer r;
1501 NTSTATUS status;
1503 /* In parameters */
1504 r.in.data = data;
1506 if (DEBUGLEVEL >= 10) {
1507 NDR_PRINT_IN_DEBUG(echo_TestDoublePointer, &r);
1510 status = cli->dispatch(cli,
1511 mem_ctx,
1512 &ndr_table_rpcecho,
1513 NDR_ECHO_TESTDOUBLEPOINTER,
1514 &r);
1516 if (!NT_STATUS_IS_OK(status)) {
1517 return status;
1520 if (DEBUGLEVEL >= 10) {
1521 NDR_PRINT_OUT_DEBUG(echo_TestDoublePointer, &r);
1524 if (NT_STATUS_IS_ERR(status)) {
1525 return status;
1528 /* Return variables */
1530 /* Return result */
1531 return NT_STATUS_OK;