s3-lib: Remove obsolete signal type cast.
[Samba/nascimento.git] / librpc / gen_ndr / cli_echo.c
blob04d4bbc46e73ece8a9bbc07b991649a142a4adcf
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 state->out_mem_ctx = talloc_named_const(state, 0,
43 "rpccli_echo_AddOne_out_memory");
44 if (tevent_req_nomem(state->out_mem_ctx, req)) {
45 return tevent_req_post(req, ev);
48 /* make a temporary copy, that we pass to the dispatch function */
49 state->tmp = state->orig;
51 subreq = cli->dispatch_send(state, ev, cli,
52 &ndr_table_rpcecho,
53 NDR_ECHO_ADDONE,
54 &state->tmp);
55 if (tevent_req_nomem(subreq, req)) {
56 return tevent_req_post(req, ev);
58 tevent_req_set_callback(subreq, rpccli_echo_AddOne_done, req);
59 return req;
62 static void rpccli_echo_AddOne_done(struct tevent_req *subreq)
64 struct tevent_req *req = tevent_req_callback_data(
65 subreq, struct tevent_req);
66 struct rpccli_echo_AddOne_state *state = tevent_req_data(
67 req, struct rpccli_echo_AddOne_state);
68 NTSTATUS status;
69 TALLOC_CTX *mem_ctx;
71 if (state->out_mem_ctx) {
72 mem_ctx = state->out_mem_ctx;
73 } else {
74 mem_ctx = state;
77 status = state->dispatch_recv(subreq, mem_ctx);
78 TALLOC_FREE(subreq);
79 if (!NT_STATUS_IS_OK(status)) {
80 tevent_req_nterror(req, status);
81 return;
84 /* Copy out parameters */
85 *state->orig.out.out_data = *state->tmp.out.out_data;
87 /* Reset temporary structure */
88 ZERO_STRUCT(state->tmp);
90 tevent_req_done(req);
93 NTSTATUS rpccli_echo_AddOne_recv(struct tevent_req *req,
94 TALLOC_CTX *mem_ctx)
96 struct rpccli_echo_AddOne_state *state = tevent_req_data(
97 req, struct rpccli_echo_AddOne_state);
98 NTSTATUS status;
100 if (tevent_req_is_nterror(req, &status)) {
101 tevent_req_received(req);
102 return status;
105 /* Steal possbile out parameters to the callers context */
106 talloc_steal(mem_ctx, state->out_mem_ctx);
108 tevent_req_received(req);
109 return NT_STATUS_OK;
112 NTSTATUS rpccli_echo_AddOne(struct rpc_pipe_client *cli,
113 TALLOC_CTX *mem_ctx,
114 uint32_t in_data /* [in] */,
115 uint32_t *out_data /* [out] [ref] */)
117 struct echo_AddOne r;
118 NTSTATUS status;
120 /* In parameters */
121 r.in.in_data = in_data;
123 status = cli->dispatch(cli,
124 mem_ctx,
125 &ndr_table_rpcecho,
126 NDR_ECHO_ADDONE,
127 &r);
129 if (!NT_STATUS_IS_OK(status)) {
130 return status;
133 if (NT_STATUS_IS_ERR(status)) {
134 return status;
137 /* Return variables */
138 *out_data = *r.out.out_data;
140 /* Return result */
141 return NT_STATUS_OK;
144 struct rpccli_echo_EchoData_state {
145 struct echo_EchoData orig;
146 struct echo_EchoData tmp;
147 TALLOC_CTX *out_mem_ctx;
148 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
151 static void rpccli_echo_EchoData_done(struct tevent_req *subreq);
153 struct tevent_req *rpccli_echo_EchoData_send(TALLOC_CTX *mem_ctx,
154 struct tevent_context *ev,
155 struct rpc_pipe_client *cli,
156 uint32_t _len /* [in] */,
157 uint8_t *_in_data /* [in] [size_is(len)] */,
158 uint8_t *_out_data /* [out] [size_is(len)] */)
160 struct tevent_req *req;
161 struct rpccli_echo_EchoData_state *state;
162 struct tevent_req *subreq;
164 req = tevent_req_create(mem_ctx, &state,
165 struct rpccli_echo_EchoData_state);
166 if (req == NULL) {
167 return NULL;
169 state->out_mem_ctx = NULL;
170 state->dispatch_recv = cli->dispatch_recv;
172 /* In parameters */
173 state->orig.in.len = _len;
174 state->orig.in.in_data = _in_data;
176 /* Out parameters */
177 state->orig.out.out_data = _out_data;
179 state->out_mem_ctx = talloc_named_const(state, 0,
180 "rpccli_echo_EchoData_out_memory");
181 if (tevent_req_nomem(state->out_mem_ctx, req)) {
182 return tevent_req_post(req, ev);
185 /* make a temporary copy, that we pass to the dispatch function */
186 state->tmp = state->orig;
188 subreq = cli->dispatch_send(state, ev, cli,
189 &ndr_table_rpcecho,
190 NDR_ECHO_ECHODATA,
191 &state->tmp);
192 if (tevent_req_nomem(subreq, req)) {
193 return tevent_req_post(req, ev);
195 tevent_req_set_callback(subreq, rpccli_echo_EchoData_done, req);
196 return req;
199 static void rpccli_echo_EchoData_done(struct tevent_req *subreq)
201 struct tevent_req *req = tevent_req_callback_data(
202 subreq, struct tevent_req);
203 struct rpccli_echo_EchoData_state *state = tevent_req_data(
204 req, struct rpccli_echo_EchoData_state);
205 NTSTATUS status;
206 TALLOC_CTX *mem_ctx;
208 if (state->out_mem_ctx) {
209 mem_ctx = state->out_mem_ctx;
210 } else {
211 mem_ctx = state;
214 status = state->dispatch_recv(subreq, mem_ctx);
215 TALLOC_FREE(subreq);
216 if (!NT_STATUS_IS_OK(status)) {
217 tevent_req_nterror(req, status);
218 return;
221 /* Copy out parameters */
222 memcpy(state->orig.out.out_data, state->tmp.out.out_data, (state->tmp.in.len) * sizeof(*state->orig.out.out_data));
224 /* Reset temporary structure */
225 ZERO_STRUCT(state->tmp);
227 tevent_req_done(req);
230 NTSTATUS rpccli_echo_EchoData_recv(struct tevent_req *req,
231 TALLOC_CTX *mem_ctx)
233 struct rpccli_echo_EchoData_state *state = tevent_req_data(
234 req, struct rpccli_echo_EchoData_state);
235 NTSTATUS status;
237 if (tevent_req_is_nterror(req, &status)) {
238 tevent_req_received(req);
239 return status;
242 /* Steal possbile out parameters to the callers context */
243 talloc_steal(mem_ctx, state->out_mem_ctx);
245 tevent_req_received(req);
246 return NT_STATUS_OK;
249 NTSTATUS rpccli_echo_EchoData(struct rpc_pipe_client *cli,
250 TALLOC_CTX *mem_ctx,
251 uint32_t len /* [in] */,
252 uint8_t *in_data /* [in] [size_is(len)] */,
253 uint8_t *out_data /* [out] [size_is(len)] */)
255 struct echo_EchoData r;
256 NTSTATUS status;
258 /* In parameters */
259 r.in.len = len;
260 r.in.in_data = in_data;
262 status = cli->dispatch(cli,
263 mem_ctx,
264 &ndr_table_rpcecho,
265 NDR_ECHO_ECHODATA,
266 &r);
268 if (!NT_STATUS_IS_OK(status)) {
269 return status;
272 if (NT_STATUS_IS_ERR(status)) {
273 return status;
276 /* Return variables */
277 memcpy(out_data, r.out.out_data, (r.in.len) * sizeof(*out_data));
279 /* Return result */
280 return NT_STATUS_OK;
283 struct rpccli_echo_SinkData_state {
284 struct echo_SinkData orig;
285 struct echo_SinkData tmp;
286 TALLOC_CTX *out_mem_ctx;
287 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
290 static void rpccli_echo_SinkData_done(struct tevent_req *subreq);
292 struct tevent_req *rpccli_echo_SinkData_send(TALLOC_CTX *mem_ctx,
293 struct tevent_context *ev,
294 struct rpc_pipe_client *cli,
295 uint32_t _len /* [in] */,
296 uint8_t *_data /* [in] [size_is(len)] */)
298 struct tevent_req *req;
299 struct rpccli_echo_SinkData_state *state;
300 struct tevent_req *subreq;
302 req = tevent_req_create(mem_ctx, &state,
303 struct rpccli_echo_SinkData_state);
304 if (req == NULL) {
305 return NULL;
307 state->out_mem_ctx = NULL;
308 state->dispatch_recv = cli->dispatch_recv;
310 /* In parameters */
311 state->orig.in.len = _len;
312 state->orig.in.data = _data;
314 /* Out parameters */
316 /* make a temporary copy, that we pass to the dispatch function */
317 state->tmp = state->orig;
319 subreq = cli->dispatch_send(state, ev, cli,
320 &ndr_table_rpcecho,
321 NDR_ECHO_SINKDATA,
322 &state->tmp);
323 if (tevent_req_nomem(subreq, req)) {
324 return tevent_req_post(req, ev);
326 tevent_req_set_callback(subreq, rpccli_echo_SinkData_done, req);
327 return req;
330 static void rpccli_echo_SinkData_done(struct tevent_req *subreq)
332 struct tevent_req *req = tevent_req_callback_data(
333 subreq, struct tevent_req);
334 struct rpccli_echo_SinkData_state *state = tevent_req_data(
335 req, struct rpccli_echo_SinkData_state);
336 NTSTATUS status;
337 TALLOC_CTX *mem_ctx;
339 if (state->out_mem_ctx) {
340 mem_ctx = state->out_mem_ctx;
341 } else {
342 mem_ctx = state;
345 status = state->dispatch_recv(subreq, mem_ctx);
346 TALLOC_FREE(subreq);
347 if (!NT_STATUS_IS_OK(status)) {
348 tevent_req_nterror(req, status);
349 return;
352 /* Copy out parameters */
354 /* Reset temporary structure */
355 ZERO_STRUCT(state->tmp);
357 tevent_req_done(req);
360 NTSTATUS rpccli_echo_SinkData_recv(struct tevent_req *req,
361 TALLOC_CTX *mem_ctx)
363 struct rpccli_echo_SinkData_state *state = tevent_req_data(
364 req, struct rpccli_echo_SinkData_state);
365 NTSTATUS status;
367 if (tevent_req_is_nterror(req, &status)) {
368 tevent_req_received(req);
369 return status;
372 /* Steal possbile out parameters to the callers context */
373 talloc_steal(mem_ctx, state->out_mem_ctx);
375 tevent_req_received(req);
376 return NT_STATUS_OK;
379 NTSTATUS rpccli_echo_SinkData(struct rpc_pipe_client *cli,
380 TALLOC_CTX *mem_ctx,
381 uint32_t len /* [in] */,
382 uint8_t *data /* [in] [size_is(len)] */)
384 struct echo_SinkData r;
385 NTSTATUS status;
387 /* In parameters */
388 r.in.len = len;
389 r.in.data = data;
391 status = cli->dispatch(cli,
392 mem_ctx,
393 &ndr_table_rpcecho,
394 NDR_ECHO_SINKDATA,
395 &r);
397 if (!NT_STATUS_IS_OK(status)) {
398 return status;
401 if (NT_STATUS_IS_ERR(status)) {
402 return status;
405 /* Return variables */
407 /* Return result */
408 return NT_STATUS_OK;
411 struct rpccli_echo_SourceData_state {
412 struct echo_SourceData orig;
413 struct echo_SourceData tmp;
414 TALLOC_CTX *out_mem_ctx;
415 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
418 static void rpccli_echo_SourceData_done(struct tevent_req *subreq);
420 struct tevent_req *rpccli_echo_SourceData_send(TALLOC_CTX *mem_ctx,
421 struct tevent_context *ev,
422 struct rpc_pipe_client *cli,
423 uint32_t _len /* [in] */,
424 uint8_t *_data /* [out] [size_is(len)] */)
426 struct tevent_req *req;
427 struct rpccli_echo_SourceData_state *state;
428 struct tevent_req *subreq;
430 req = tevent_req_create(mem_ctx, &state,
431 struct rpccli_echo_SourceData_state);
432 if (req == NULL) {
433 return NULL;
435 state->out_mem_ctx = NULL;
436 state->dispatch_recv = cli->dispatch_recv;
438 /* In parameters */
439 state->orig.in.len = _len;
441 /* Out parameters */
442 state->orig.out.data = _data;
444 state->out_mem_ctx = talloc_named_const(state, 0,
445 "rpccli_echo_SourceData_out_memory");
446 if (tevent_req_nomem(state->out_mem_ctx, req)) {
447 return tevent_req_post(req, ev);
450 /* make a temporary copy, that we pass to the dispatch function */
451 state->tmp = state->orig;
453 subreq = cli->dispatch_send(state, ev, cli,
454 &ndr_table_rpcecho,
455 NDR_ECHO_SOURCEDATA,
456 &state->tmp);
457 if (tevent_req_nomem(subreq, req)) {
458 return tevent_req_post(req, ev);
460 tevent_req_set_callback(subreq, rpccli_echo_SourceData_done, req);
461 return req;
464 static void rpccli_echo_SourceData_done(struct tevent_req *subreq)
466 struct tevent_req *req = tevent_req_callback_data(
467 subreq, struct tevent_req);
468 struct rpccli_echo_SourceData_state *state = tevent_req_data(
469 req, struct rpccli_echo_SourceData_state);
470 NTSTATUS status;
471 TALLOC_CTX *mem_ctx;
473 if (state->out_mem_ctx) {
474 mem_ctx = state->out_mem_ctx;
475 } else {
476 mem_ctx = state;
479 status = state->dispatch_recv(subreq, mem_ctx);
480 TALLOC_FREE(subreq);
481 if (!NT_STATUS_IS_OK(status)) {
482 tevent_req_nterror(req, status);
483 return;
486 /* Copy out parameters */
487 memcpy(state->orig.out.data, state->tmp.out.data, (state->tmp.in.len) * sizeof(*state->orig.out.data));
489 /* Reset temporary structure */
490 ZERO_STRUCT(state->tmp);
492 tevent_req_done(req);
495 NTSTATUS rpccli_echo_SourceData_recv(struct tevent_req *req,
496 TALLOC_CTX *mem_ctx)
498 struct rpccli_echo_SourceData_state *state = tevent_req_data(
499 req, struct rpccli_echo_SourceData_state);
500 NTSTATUS status;
502 if (tevent_req_is_nterror(req, &status)) {
503 tevent_req_received(req);
504 return status;
507 /* Steal possbile out parameters to the callers context */
508 talloc_steal(mem_ctx, state->out_mem_ctx);
510 tevent_req_received(req);
511 return NT_STATUS_OK;
514 NTSTATUS rpccli_echo_SourceData(struct rpc_pipe_client *cli,
515 TALLOC_CTX *mem_ctx,
516 uint32_t len /* [in] */,
517 uint8_t *data /* [out] [size_is(len)] */)
519 struct echo_SourceData r;
520 NTSTATUS status;
522 /* In parameters */
523 r.in.len = len;
525 status = cli->dispatch(cli,
526 mem_ctx,
527 &ndr_table_rpcecho,
528 NDR_ECHO_SOURCEDATA,
529 &r);
531 if (!NT_STATUS_IS_OK(status)) {
532 return status;
535 if (NT_STATUS_IS_ERR(status)) {
536 return status;
539 /* Return variables */
540 memcpy(data, r.out.data, (r.in.len) * sizeof(*data));
542 /* Return result */
543 return NT_STATUS_OK;
546 struct rpccli_echo_TestCall_state {
547 struct echo_TestCall orig;
548 struct echo_TestCall tmp;
549 TALLOC_CTX *out_mem_ctx;
550 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
553 static void rpccli_echo_TestCall_done(struct tevent_req *subreq);
555 struct tevent_req *rpccli_echo_TestCall_send(TALLOC_CTX *mem_ctx,
556 struct tevent_context *ev,
557 struct rpc_pipe_client *cli,
558 const char *_s1 /* [in] [ref,charset(UTF16)] */,
559 const char **_s2 /* [out] [ref,charset(UTF16)] */)
561 struct tevent_req *req;
562 struct rpccli_echo_TestCall_state *state;
563 struct tevent_req *subreq;
565 req = tevent_req_create(mem_ctx, &state,
566 struct rpccli_echo_TestCall_state);
567 if (req == NULL) {
568 return NULL;
570 state->out_mem_ctx = NULL;
571 state->dispatch_recv = cli->dispatch_recv;
573 /* In parameters */
574 state->orig.in.s1 = _s1;
576 /* Out parameters */
577 state->orig.out.s2 = _s2;
579 state->out_mem_ctx = talloc_named_const(state, 0,
580 "rpccli_echo_TestCall_out_memory");
581 if (tevent_req_nomem(state->out_mem_ctx, req)) {
582 return tevent_req_post(req, ev);
585 /* make a temporary copy, that we pass to the dispatch function */
586 state->tmp = state->orig;
588 subreq = cli->dispatch_send(state, ev, cli,
589 &ndr_table_rpcecho,
590 NDR_ECHO_TESTCALL,
591 &state->tmp);
592 if (tevent_req_nomem(subreq, req)) {
593 return tevent_req_post(req, ev);
595 tevent_req_set_callback(subreq, rpccli_echo_TestCall_done, req);
596 return req;
599 static void rpccli_echo_TestCall_done(struct tevent_req *subreq)
601 struct tevent_req *req = tevent_req_callback_data(
602 subreq, struct tevent_req);
603 struct rpccli_echo_TestCall_state *state = tevent_req_data(
604 req, struct rpccli_echo_TestCall_state);
605 NTSTATUS status;
606 TALLOC_CTX *mem_ctx;
608 if (state->out_mem_ctx) {
609 mem_ctx = state->out_mem_ctx;
610 } else {
611 mem_ctx = state;
614 status = state->dispatch_recv(subreq, mem_ctx);
615 TALLOC_FREE(subreq);
616 if (!NT_STATUS_IS_OK(status)) {
617 tevent_req_nterror(req, status);
618 return;
621 /* Copy out parameters */
622 *state->orig.out.s2 = *state->tmp.out.s2;
624 /* Reset temporary structure */
625 ZERO_STRUCT(state->tmp);
627 tevent_req_done(req);
630 NTSTATUS rpccli_echo_TestCall_recv(struct tevent_req *req,
631 TALLOC_CTX *mem_ctx)
633 struct rpccli_echo_TestCall_state *state = tevent_req_data(
634 req, struct rpccli_echo_TestCall_state);
635 NTSTATUS status;
637 if (tevent_req_is_nterror(req, &status)) {
638 tevent_req_received(req);
639 return status;
642 /* Steal possbile out parameters to the callers context */
643 talloc_steal(mem_ctx, state->out_mem_ctx);
645 tevent_req_received(req);
646 return NT_STATUS_OK;
649 NTSTATUS rpccli_echo_TestCall(struct rpc_pipe_client *cli,
650 TALLOC_CTX *mem_ctx,
651 const char *s1 /* [in] [ref,charset(UTF16)] */,
652 const char **s2 /* [out] [ref,charset(UTF16)] */)
654 struct echo_TestCall r;
655 NTSTATUS status;
657 /* In parameters */
658 r.in.s1 = s1;
660 status = cli->dispatch(cli,
661 mem_ctx,
662 &ndr_table_rpcecho,
663 NDR_ECHO_TESTCALL,
664 &r);
666 if (!NT_STATUS_IS_OK(status)) {
667 return status;
670 if (NT_STATUS_IS_ERR(status)) {
671 return status;
674 /* Return variables */
675 *s2 = *r.out.s2;
677 /* Return result */
678 return NT_STATUS_OK;
681 struct rpccli_echo_TestCall2_state {
682 struct echo_TestCall2 orig;
683 struct echo_TestCall2 tmp;
684 TALLOC_CTX *out_mem_ctx;
685 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
688 static void rpccli_echo_TestCall2_done(struct tevent_req *subreq);
690 struct tevent_req *rpccli_echo_TestCall2_send(TALLOC_CTX *mem_ctx,
691 struct tevent_context *ev,
692 struct rpc_pipe_client *cli,
693 uint16_t _level /* [in] */,
694 union echo_Info *_info /* [out] [ref,switch_is(level)] */)
696 struct tevent_req *req;
697 struct rpccli_echo_TestCall2_state *state;
698 struct tevent_req *subreq;
700 req = tevent_req_create(mem_ctx, &state,
701 struct rpccli_echo_TestCall2_state);
702 if (req == NULL) {
703 return NULL;
705 state->out_mem_ctx = NULL;
706 state->dispatch_recv = cli->dispatch_recv;
708 /* In parameters */
709 state->orig.in.level = _level;
711 /* Out parameters */
712 state->orig.out.info = _info;
714 /* Result */
715 ZERO_STRUCT(state->orig.out.result);
717 state->out_mem_ctx = talloc_named_const(state, 0,
718 "rpccli_echo_TestCall2_out_memory");
719 if (tevent_req_nomem(state->out_mem_ctx, req)) {
720 return tevent_req_post(req, ev);
723 /* make a temporary copy, that we pass to the dispatch function */
724 state->tmp = state->orig;
726 subreq = cli->dispatch_send(state, ev, cli,
727 &ndr_table_rpcecho,
728 NDR_ECHO_TESTCALL2,
729 &state->tmp);
730 if (tevent_req_nomem(subreq, req)) {
731 return tevent_req_post(req, ev);
733 tevent_req_set_callback(subreq, rpccli_echo_TestCall2_done, req);
734 return req;
737 static void rpccli_echo_TestCall2_done(struct tevent_req *subreq)
739 struct tevent_req *req = tevent_req_callback_data(
740 subreq, struct tevent_req);
741 struct rpccli_echo_TestCall2_state *state = tevent_req_data(
742 req, struct rpccli_echo_TestCall2_state);
743 NTSTATUS status;
744 TALLOC_CTX *mem_ctx;
746 if (state->out_mem_ctx) {
747 mem_ctx = state->out_mem_ctx;
748 } else {
749 mem_ctx = state;
752 status = state->dispatch_recv(subreq, mem_ctx);
753 TALLOC_FREE(subreq);
754 if (!NT_STATUS_IS_OK(status)) {
755 tevent_req_nterror(req, status);
756 return;
759 /* Copy out parameters */
760 *state->orig.out.info = *state->tmp.out.info;
762 /* Copy result */
763 state->orig.out.result = state->tmp.out.result;
765 /* Reset temporary structure */
766 ZERO_STRUCT(state->tmp);
768 tevent_req_done(req);
771 NTSTATUS rpccli_echo_TestCall2_recv(struct tevent_req *req,
772 TALLOC_CTX *mem_ctx,
773 NTSTATUS *result)
775 struct rpccli_echo_TestCall2_state *state = tevent_req_data(
776 req, struct rpccli_echo_TestCall2_state);
777 NTSTATUS status;
779 if (tevent_req_is_nterror(req, &status)) {
780 tevent_req_received(req);
781 return status;
784 /* Steal possbile out parameters to the callers context */
785 talloc_steal(mem_ctx, state->out_mem_ctx);
787 /* Return result */
788 *result = state->orig.out.result;
790 tevent_req_received(req);
791 return NT_STATUS_OK;
794 NTSTATUS rpccli_echo_TestCall2(struct rpc_pipe_client *cli,
795 TALLOC_CTX *mem_ctx,
796 uint16_t level /* [in] */,
797 union echo_Info *info /* [out] [ref,switch_is(level)] */)
799 struct echo_TestCall2 r;
800 NTSTATUS status;
802 /* In parameters */
803 r.in.level = level;
805 status = cli->dispatch(cli,
806 mem_ctx,
807 &ndr_table_rpcecho,
808 NDR_ECHO_TESTCALL2,
809 &r);
811 if (!NT_STATUS_IS_OK(status)) {
812 return status;
815 if (NT_STATUS_IS_ERR(status)) {
816 return status;
819 /* Return variables */
820 *info = *r.out.info;
822 /* Return result */
823 return r.out.result;
826 struct rpccli_echo_TestSleep_state {
827 struct echo_TestSleep orig;
828 struct echo_TestSleep tmp;
829 TALLOC_CTX *out_mem_ctx;
830 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
833 static void rpccli_echo_TestSleep_done(struct tevent_req *subreq);
835 struct tevent_req *rpccli_echo_TestSleep_send(TALLOC_CTX *mem_ctx,
836 struct tevent_context *ev,
837 struct rpc_pipe_client *cli,
838 uint32_t _seconds /* [in] */)
840 struct tevent_req *req;
841 struct rpccli_echo_TestSleep_state *state;
842 struct tevent_req *subreq;
844 req = tevent_req_create(mem_ctx, &state,
845 struct rpccli_echo_TestSleep_state);
846 if (req == NULL) {
847 return NULL;
849 state->out_mem_ctx = NULL;
850 state->dispatch_recv = cli->dispatch_recv;
852 /* In parameters */
853 state->orig.in.seconds = _seconds;
855 /* Out parameters */
857 /* Result */
858 ZERO_STRUCT(state->orig.out.result);
860 /* make a temporary copy, that we pass to the dispatch function */
861 state->tmp = state->orig;
863 subreq = cli->dispatch_send(state, ev, cli,
864 &ndr_table_rpcecho,
865 NDR_ECHO_TESTSLEEP,
866 &state->tmp);
867 if (tevent_req_nomem(subreq, req)) {
868 return tevent_req_post(req, ev);
870 tevent_req_set_callback(subreq, rpccli_echo_TestSleep_done, req);
871 return req;
874 static void rpccli_echo_TestSleep_done(struct tevent_req *subreq)
876 struct tevent_req *req = tevent_req_callback_data(
877 subreq, struct tevent_req);
878 struct rpccli_echo_TestSleep_state *state = tevent_req_data(
879 req, struct rpccli_echo_TestSleep_state);
880 NTSTATUS status;
881 TALLOC_CTX *mem_ctx;
883 if (state->out_mem_ctx) {
884 mem_ctx = state->out_mem_ctx;
885 } else {
886 mem_ctx = state;
889 status = state->dispatch_recv(subreq, mem_ctx);
890 TALLOC_FREE(subreq);
891 if (!NT_STATUS_IS_OK(status)) {
892 tevent_req_nterror(req, status);
893 return;
896 /* Copy out parameters */
898 /* Copy result */
899 state->orig.out.result = state->tmp.out.result;
901 /* Reset temporary structure */
902 ZERO_STRUCT(state->tmp);
904 tevent_req_done(req);
907 NTSTATUS rpccli_echo_TestSleep_recv(struct tevent_req *req,
908 TALLOC_CTX *mem_ctx,
909 uint32 *result)
911 struct rpccli_echo_TestSleep_state *state = tevent_req_data(
912 req, struct rpccli_echo_TestSleep_state);
913 NTSTATUS status;
915 if (tevent_req_is_nterror(req, &status)) {
916 tevent_req_received(req);
917 return status;
920 /* Steal possbile out parameters to the callers context */
921 talloc_steal(mem_ctx, state->out_mem_ctx);
923 /* Return result */
924 *result = state->orig.out.result;
926 tevent_req_received(req);
927 return NT_STATUS_OK;
930 NTSTATUS rpccli_echo_TestSleep(struct rpc_pipe_client *cli,
931 TALLOC_CTX *mem_ctx,
932 uint32_t seconds /* [in] */)
934 struct echo_TestSleep r;
935 NTSTATUS status;
937 /* In parameters */
938 r.in.seconds = seconds;
940 status = cli->dispatch(cli,
941 mem_ctx,
942 &ndr_table_rpcecho,
943 NDR_ECHO_TESTSLEEP,
944 &r);
946 if (!NT_STATUS_IS_OK(status)) {
947 return status;
950 if (NT_STATUS_IS_ERR(status)) {
951 return status;
954 /* Return variables */
956 /* Return result */
957 return NT_STATUS_OK;
960 struct rpccli_echo_TestEnum_state {
961 struct echo_TestEnum orig;
962 struct echo_TestEnum tmp;
963 TALLOC_CTX *out_mem_ctx;
964 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
967 static void rpccli_echo_TestEnum_done(struct tevent_req *subreq);
969 struct tevent_req *rpccli_echo_TestEnum_send(TALLOC_CTX *mem_ctx,
970 struct tevent_context *ev,
971 struct rpc_pipe_client *cli,
972 enum echo_Enum1 *_foo1 /* [in,out] [ref] */,
973 struct echo_Enum2 *_foo2 /* [in,out] [ref] */,
974 union echo_Enum3 *_foo3 /* [in,out] [ref,switch_is(*foo1)] */)
976 struct tevent_req *req;
977 struct rpccli_echo_TestEnum_state *state;
978 struct tevent_req *subreq;
980 req = tevent_req_create(mem_ctx, &state,
981 struct rpccli_echo_TestEnum_state);
982 if (req == NULL) {
983 return NULL;
985 state->out_mem_ctx = NULL;
986 state->dispatch_recv = cli->dispatch_recv;
988 /* In parameters */
989 state->orig.in.foo1 = _foo1;
990 state->orig.in.foo2 = _foo2;
991 state->orig.in.foo3 = _foo3;
993 /* Out parameters */
994 state->orig.out.foo1 = _foo1;
995 state->orig.out.foo2 = _foo2;
996 state->orig.out.foo3 = _foo3;
998 state->out_mem_ctx = talloc_named_const(state, 0,
999 "rpccli_echo_TestEnum_out_memory");
1000 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1001 return tevent_req_post(req, ev);
1004 /* make a temporary copy, that we pass to the dispatch function */
1005 state->tmp = state->orig;
1007 subreq = cli->dispatch_send(state, ev, cli,
1008 &ndr_table_rpcecho,
1009 NDR_ECHO_TESTENUM,
1010 &state->tmp);
1011 if (tevent_req_nomem(subreq, req)) {
1012 return tevent_req_post(req, ev);
1014 tevent_req_set_callback(subreq, rpccli_echo_TestEnum_done, req);
1015 return req;
1018 static void rpccli_echo_TestEnum_done(struct tevent_req *subreq)
1020 struct tevent_req *req = tevent_req_callback_data(
1021 subreq, struct tevent_req);
1022 struct rpccli_echo_TestEnum_state *state = tevent_req_data(
1023 req, struct rpccli_echo_TestEnum_state);
1024 NTSTATUS status;
1025 TALLOC_CTX *mem_ctx;
1027 if (state->out_mem_ctx) {
1028 mem_ctx = state->out_mem_ctx;
1029 } else {
1030 mem_ctx = state;
1033 status = state->dispatch_recv(subreq, mem_ctx);
1034 TALLOC_FREE(subreq);
1035 if (!NT_STATUS_IS_OK(status)) {
1036 tevent_req_nterror(req, status);
1037 return;
1040 /* Copy out parameters */
1041 *state->orig.out.foo1 = *state->tmp.out.foo1;
1042 *state->orig.out.foo2 = *state->tmp.out.foo2;
1043 *state->orig.out.foo3 = *state->tmp.out.foo3;
1045 /* Reset temporary structure */
1046 ZERO_STRUCT(state->tmp);
1048 tevent_req_done(req);
1051 NTSTATUS rpccli_echo_TestEnum_recv(struct tevent_req *req,
1052 TALLOC_CTX *mem_ctx)
1054 struct rpccli_echo_TestEnum_state *state = tevent_req_data(
1055 req, struct rpccli_echo_TestEnum_state);
1056 NTSTATUS status;
1058 if (tevent_req_is_nterror(req, &status)) {
1059 tevent_req_received(req);
1060 return status;
1063 /* Steal possbile out parameters to the callers context */
1064 talloc_steal(mem_ctx, state->out_mem_ctx);
1066 tevent_req_received(req);
1067 return NT_STATUS_OK;
1070 NTSTATUS rpccli_echo_TestEnum(struct rpc_pipe_client *cli,
1071 TALLOC_CTX *mem_ctx,
1072 enum echo_Enum1 *foo1 /* [in,out] [ref] */,
1073 struct echo_Enum2 *foo2 /* [in,out] [ref] */,
1074 union echo_Enum3 *foo3 /* [in,out] [ref,switch_is(*foo1)] */)
1076 struct echo_TestEnum r;
1077 NTSTATUS status;
1079 /* In parameters */
1080 r.in.foo1 = foo1;
1081 r.in.foo2 = foo2;
1082 r.in.foo3 = foo3;
1084 status = cli->dispatch(cli,
1085 mem_ctx,
1086 &ndr_table_rpcecho,
1087 NDR_ECHO_TESTENUM,
1088 &r);
1090 if (!NT_STATUS_IS_OK(status)) {
1091 return status;
1094 if (NT_STATUS_IS_ERR(status)) {
1095 return status;
1098 /* Return variables */
1099 *foo1 = *r.out.foo1;
1100 *foo2 = *r.out.foo2;
1101 *foo3 = *r.out.foo3;
1103 /* Return result */
1104 return NT_STATUS_OK;
1107 struct rpccli_echo_TestSurrounding_state {
1108 struct echo_TestSurrounding orig;
1109 struct echo_TestSurrounding tmp;
1110 TALLOC_CTX *out_mem_ctx;
1111 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1114 static void rpccli_echo_TestSurrounding_done(struct tevent_req *subreq);
1116 struct tevent_req *rpccli_echo_TestSurrounding_send(TALLOC_CTX *mem_ctx,
1117 struct tevent_context *ev,
1118 struct rpc_pipe_client *cli,
1119 struct echo_Surrounding *_data /* [in,out] [ref] */)
1121 struct tevent_req *req;
1122 struct rpccli_echo_TestSurrounding_state *state;
1123 struct tevent_req *subreq;
1125 req = tevent_req_create(mem_ctx, &state,
1126 struct rpccli_echo_TestSurrounding_state);
1127 if (req == NULL) {
1128 return NULL;
1130 state->out_mem_ctx = NULL;
1131 state->dispatch_recv = cli->dispatch_recv;
1133 /* In parameters */
1134 state->orig.in.data = _data;
1136 /* Out parameters */
1137 state->orig.out.data = _data;
1139 state->out_mem_ctx = talloc_named_const(state, 0,
1140 "rpccli_echo_TestSurrounding_out_memory");
1141 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1142 return tevent_req_post(req, ev);
1145 /* make a temporary copy, that we pass to the dispatch function */
1146 state->tmp = state->orig;
1148 subreq = cli->dispatch_send(state, ev, cli,
1149 &ndr_table_rpcecho,
1150 NDR_ECHO_TESTSURROUNDING,
1151 &state->tmp);
1152 if (tevent_req_nomem(subreq, req)) {
1153 return tevent_req_post(req, ev);
1155 tevent_req_set_callback(subreq, rpccli_echo_TestSurrounding_done, req);
1156 return req;
1159 static void rpccli_echo_TestSurrounding_done(struct tevent_req *subreq)
1161 struct tevent_req *req = tevent_req_callback_data(
1162 subreq, struct tevent_req);
1163 struct rpccli_echo_TestSurrounding_state *state = tevent_req_data(
1164 req, struct rpccli_echo_TestSurrounding_state);
1165 NTSTATUS status;
1166 TALLOC_CTX *mem_ctx;
1168 if (state->out_mem_ctx) {
1169 mem_ctx = state->out_mem_ctx;
1170 } else {
1171 mem_ctx = state;
1174 status = state->dispatch_recv(subreq, mem_ctx);
1175 TALLOC_FREE(subreq);
1176 if (!NT_STATUS_IS_OK(status)) {
1177 tevent_req_nterror(req, status);
1178 return;
1181 /* Copy out parameters */
1182 *state->orig.out.data = *state->tmp.out.data;
1184 /* Reset temporary structure */
1185 ZERO_STRUCT(state->tmp);
1187 tevent_req_done(req);
1190 NTSTATUS rpccli_echo_TestSurrounding_recv(struct tevent_req *req,
1191 TALLOC_CTX *mem_ctx)
1193 struct rpccli_echo_TestSurrounding_state *state = tevent_req_data(
1194 req, struct rpccli_echo_TestSurrounding_state);
1195 NTSTATUS status;
1197 if (tevent_req_is_nterror(req, &status)) {
1198 tevent_req_received(req);
1199 return status;
1202 /* Steal possbile out parameters to the callers context */
1203 talloc_steal(mem_ctx, state->out_mem_ctx);
1205 tevent_req_received(req);
1206 return NT_STATUS_OK;
1209 NTSTATUS rpccli_echo_TestSurrounding(struct rpc_pipe_client *cli,
1210 TALLOC_CTX *mem_ctx,
1211 struct echo_Surrounding *data /* [in,out] [ref] */)
1213 struct echo_TestSurrounding r;
1214 NTSTATUS status;
1216 /* In parameters */
1217 r.in.data = data;
1219 status = cli->dispatch(cli,
1220 mem_ctx,
1221 &ndr_table_rpcecho,
1222 NDR_ECHO_TESTSURROUNDING,
1223 &r);
1225 if (!NT_STATUS_IS_OK(status)) {
1226 return status;
1229 if (NT_STATUS_IS_ERR(status)) {
1230 return status;
1233 /* Return variables */
1234 *data = *r.out.data;
1236 /* Return result */
1237 return NT_STATUS_OK;
1240 struct rpccli_echo_TestDoublePointer_state {
1241 struct echo_TestDoublePointer orig;
1242 struct echo_TestDoublePointer tmp;
1243 TALLOC_CTX *out_mem_ctx;
1244 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1247 static void rpccli_echo_TestDoublePointer_done(struct tevent_req *subreq);
1249 struct tevent_req *rpccli_echo_TestDoublePointer_send(TALLOC_CTX *mem_ctx,
1250 struct tevent_context *ev,
1251 struct rpc_pipe_client *cli,
1252 uint16_t ***_data /* [in] [ref] */)
1254 struct tevent_req *req;
1255 struct rpccli_echo_TestDoublePointer_state *state;
1256 struct tevent_req *subreq;
1258 req = tevent_req_create(mem_ctx, &state,
1259 struct rpccli_echo_TestDoublePointer_state);
1260 if (req == NULL) {
1261 return NULL;
1263 state->out_mem_ctx = NULL;
1264 state->dispatch_recv = cli->dispatch_recv;
1266 /* In parameters */
1267 state->orig.in.data = _data;
1269 /* Out parameters */
1271 /* Result */
1272 ZERO_STRUCT(state->orig.out.result);
1274 /* make a temporary copy, that we pass to the dispatch function */
1275 state->tmp = state->orig;
1277 subreq = cli->dispatch_send(state, ev, cli,
1278 &ndr_table_rpcecho,
1279 NDR_ECHO_TESTDOUBLEPOINTER,
1280 &state->tmp);
1281 if (tevent_req_nomem(subreq, req)) {
1282 return tevent_req_post(req, ev);
1284 tevent_req_set_callback(subreq, rpccli_echo_TestDoublePointer_done, req);
1285 return req;
1288 static void rpccli_echo_TestDoublePointer_done(struct tevent_req *subreq)
1290 struct tevent_req *req = tevent_req_callback_data(
1291 subreq, struct tevent_req);
1292 struct rpccli_echo_TestDoublePointer_state *state = tevent_req_data(
1293 req, struct rpccli_echo_TestDoublePointer_state);
1294 NTSTATUS status;
1295 TALLOC_CTX *mem_ctx;
1297 if (state->out_mem_ctx) {
1298 mem_ctx = state->out_mem_ctx;
1299 } else {
1300 mem_ctx = state;
1303 status = state->dispatch_recv(subreq, mem_ctx);
1304 TALLOC_FREE(subreq);
1305 if (!NT_STATUS_IS_OK(status)) {
1306 tevent_req_nterror(req, status);
1307 return;
1310 /* Copy out parameters */
1312 /* Copy result */
1313 state->orig.out.result = state->tmp.out.result;
1315 /* Reset temporary structure */
1316 ZERO_STRUCT(state->tmp);
1318 tevent_req_done(req);
1321 NTSTATUS rpccli_echo_TestDoublePointer_recv(struct tevent_req *req,
1322 TALLOC_CTX *mem_ctx,
1323 uint16 *result)
1325 struct rpccli_echo_TestDoublePointer_state *state = tevent_req_data(
1326 req, struct rpccli_echo_TestDoublePointer_state);
1327 NTSTATUS status;
1329 if (tevent_req_is_nterror(req, &status)) {
1330 tevent_req_received(req);
1331 return status;
1334 /* Steal possbile out parameters to the callers context */
1335 talloc_steal(mem_ctx, state->out_mem_ctx);
1337 /* Return result */
1338 *result = state->orig.out.result;
1340 tevent_req_received(req);
1341 return NT_STATUS_OK;
1344 NTSTATUS rpccli_echo_TestDoublePointer(struct rpc_pipe_client *cli,
1345 TALLOC_CTX *mem_ctx,
1346 uint16_t ***data /* [in] [ref] */)
1348 struct echo_TestDoublePointer r;
1349 NTSTATUS status;
1351 /* In parameters */
1352 r.in.data = data;
1354 status = cli->dispatch(cli,
1355 mem_ctx,
1356 &ndr_table_rpcecho,
1357 NDR_ECHO_TESTDOUBLEPOINTER,
1358 &r);
1360 if (!NT_STATUS_IS_OK(status)) {
1361 return status;
1364 if (NT_STATUS_IS_ERR(status)) {
1365 return status;
1368 /* Return variables */
1370 /* Return result */
1371 return NT_STATUS_OK;