s3-passdb: Fix typo in debug message.
[Samba/gebeck_regimport.git] / librpc / gen_ndr / cli_dfs.c
blob6ce5b5fcafb453f3aadc22ae3488597f7dc629e5
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_dfs.h"
9 struct rpccli_dfs_GetManagerVersion_state {
10 struct dfs_GetManagerVersion orig;
11 struct dfs_GetManagerVersion tmp;
12 TALLOC_CTX *out_mem_ctx;
13 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
16 static void rpccli_dfs_GetManagerVersion_done(struct tevent_req *subreq);
18 struct tevent_req *rpccli_dfs_GetManagerVersion_send(TALLOC_CTX *mem_ctx,
19 struct tevent_context *ev,
20 struct rpc_pipe_client *cli,
21 enum dfs_ManagerVersion *_version /* [out] [ref] */)
23 struct tevent_req *req;
24 struct rpccli_dfs_GetManagerVersion_state *state;
25 struct tevent_req *subreq;
27 req = tevent_req_create(mem_ctx, &state,
28 struct rpccli_dfs_GetManagerVersion_state);
29 if (req == NULL) {
30 return NULL;
32 state->out_mem_ctx = NULL;
33 state->dispatch_recv = cli->dispatch_recv;
35 /* In parameters */
37 /* Out parameters */
38 state->orig.out.version = _version;
40 state->out_mem_ctx = talloc_named_const(state, 0,
41 "rpccli_dfs_GetManagerVersion_out_memory");
42 if (tevent_req_nomem(state->out_mem_ctx, req)) {
43 return tevent_req_post(req, ev);
46 /* make a temporary copy, that we pass to the dispatch function */
47 state->tmp = state->orig;
49 subreq = cli->dispatch_send(state, ev, cli,
50 &ndr_table_netdfs,
51 NDR_DFS_GETMANAGERVERSION,
52 &state->tmp);
53 if (tevent_req_nomem(subreq, req)) {
54 return tevent_req_post(req, ev);
56 tevent_req_set_callback(subreq, rpccli_dfs_GetManagerVersion_done, req);
57 return req;
60 static void rpccli_dfs_GetManagerVersion_done(struct tevent_req *subreq)
62 struct tevent_req *req = tevent_req_callback_data(
63 subreq, struct tevent_req);
64 struct rpccli_dfs_GetManagerVersion_state *state = tevent_req_data(
65 req, struct rpccli_dfs_GetManagerVersion_state);
66 NTSTATUS status;
67 TALLOC_CTX *mem_ctx;
69 if (state->out_mem_ctx) {
70 mem_ctx = state->out_mem_ctx;
71 } else {
72 mem_ctx = state;
75 status = state->dispatch_recv(subreq, mem_ctx);
76 TALLOC_FREE(subreq);
77 if (!NT_STATUS_IS_OK(status)) {
78 tevent_req_nterror(req, status);
79 return;
82 /* Copy out parameters */
83 *state->orig.out.version = *state->tmp.out.version;
85 /* Reset temporary structure */
86 ZERO_STRUCT(state->tmp);
88 tevent_req_done(req);
91 NTSTATUS rpccli_dfs_GetManagerVersion_recv(struct tevent_req *req,
92 TALLOC_CTX *mem_ctx)
94 struct rpccli_dfs_GetManagerVersion_state *state = tevent_req_data(
95 req, struct rpccli_dfs_GetManagerVersion_state);
96 NTSTATUS status;
98 if (tevent_req_is_nterror(req, &status)) {
99 tevent_req_received(req);
100 return status;
103 /* Steal possbile out parameters to the callers context */
104 talloc_steal(mem_ctx, state->out_mem_ctx);
106 tevent_req_received(req);
107 return NT_STATUS_OK;
110 NTSTATUS rpccli_dfs_GetManagerVersion(struct rpc_pipe_client *cli,
111 TALLOC_CTX *mem_ctx,
112 enum dfs_ManagerVersion *version /* [out] [ref] */)
114 struct dfs_GetManagerVersion r;
115 NTSTATUS status;
117 /* In parameters */
119 status = cli->dispatch(cli,
120 mem_ctx,
121 &ndr_table_netdfs,
122 NDR_DFS_GETMANAGERVERSION,
123 &r);
125 if (!NT_STATUS_IS_OK(status)) {
126 return status;
129 if (NT_STATUS_IS_ERR(status)) {
130 return status;
133 /* Return variables */
134 *version = *r.out.version;
136 /* Return result */
137 return NT_STATUS_OK;
140 struct rpccli_dfs_Add_state {
141 struct dfs_Add orig;
142 struct dfs_Add tmp;
143 TALLOC_CTX *out_mem_ctx;
144 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
147 static void rpccli_dfs_Add_done(struct tevent_req *subreq);
149 struct tevent_req *rpccli_dfs_Add_send(TALLOC_CTX *mem_ctx,
150 struct tevent_context *ev,
151 struct rpc_pipe_client *cli,
152 const char *_path /* [in] [ref,charset(UTF16)] */,
153 const char *_server /* [in] [ref,charset(UTF16)] */,
154 const char *_share /* [in] [unique,charset(UTF16)] */,
155 const char *_comment /* [in] [unique,charset(UTF16)] */,
156 uint32_t _flags /* [in] */)
158 struct tevent_req *req;
159 struct rpccli_dfs_Add_state *state;
160 struct tevent_req *subreq;
162 req = tevent_req_create(mem_ctx, &state,
163 struct rpccli_dfs_Add_state);
164 if (req == NULL) {
165 return NULL;
167 state->out_mem_ctx = NULL;
168 state->dispatch_recv = cli->dispatch_recv;
170 /* In parameters */
171 state->orig.in.path = _path;
172 state->orig.in.server = _server;
173 state->orig.in.share = _share;
174 state->orig.in.comment = _comment;
175 state->orig.in.flags = _flags;
177 /* Out parameters */
179 /* Result */
180 ZERO_STRUCT(state->orig.out.result);
182 /* make a temporary copy, that we pass to the dispatch function */
183 state->tmp = state->orig;
185 subreq = cli->dispatch_send(state, ev, cli,
186 &ndr_table_netdfs,
187 NDR_DFS_ADD,
188 &state->tmp);
189 if (tevent_req_nomem(subreq, req)) {
190 return tevent_req_post(req, ev);
192 tevent_req_set_callback(subreq, rpccli_dfs_Add_done, req);
193 return req;
196 static void rpccli_dfs_Add_done(struct tevent_req *subreq)
198 struct tevent_req *req = tevent_req_callback_data(
199 subreq, struct tevent_req);
200 struct rpccli_dfs_Add_state *state = tevent_req_data(
201 req, struct rpccli_dfs_Add_state);
202 NTSTATUS status;
203 TALLOC_CTX *mem_ctx;
205 if (state->out_mem_ctx) {
206 mem_ctx = state->out_mem_ctx;
207 } else {
208 mem_ctx = state;
211 status = state->dispatch_recv(subreq, mem_ctx);
212 TALLOC_FREE(subreq);
213 if (!NT_STATUS_IS_OK(status)) {
214 tevent_req_nterror(req, status);
215 return;
218 /* Copy out parameters */
220 /* Copy result */
221 state->orig.out.result = state->tmp.out.result;
223 /* Reset temporary structure */
224 ZERO_STRUCT(state->tmp);
226 tevent_req_done(req);
229 NTSTATUS rpccli_dfs_Add_recv(struct tevent_req *req,
230 TALLOC_CTX *mem_ctx,
231 WERROR *result)
233 struct rpccli_dfs_Add_state *state = tevent_req_data(
234 req, struct rpccli_dfs_Add_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 /* Return result */
246 *result = state->orig.out.result;
248 tevent_req_received(req);
249 return NT_STATUS_OK;
252 NTSTATUS rpccli_dfs_Add(struct rpc_pipe_client *cli,
253 TALLOC_CTX *mem_ctx,
254 const char *path /* [in] [ref,charset(UTF16)] */,
255 const char *server /* [in] [ref,charset(UTF16)] */,
256 const char *share /* [in] [unique,charset(UTF16)] */,
257 const char *comment /* [in] [unique,charset(UTF16)] */,
258 uint32_t flags /* [in] */,
259 WERROR *werror)
261 struct dfs_Add r;
262 NTSTATUS status;
264 /* In parameters */
265 r.in.path = path;
266 r.in.server = server;
267 r.in.share = share;
268 r.in.comment = comment;
269 r.in.flags = flags;
271 status = cli->dispatch(cli,
272 mem_ctx,
273 &ndr_table_netdfs,
274 NDR_DFS_ADD,
275 &r);
277 if (!NT_STATUS_IS_OK(status)) {
278 return status;
281 if (NT_STATUS_IS_ERR(status)) {
282 return status;
285 /* Return variables */
287 /* Return result */
288 if (werror) {
289 *werror = r.out.result;
292 return werror_to_ntstatus(r.out.result);
295 struct rpccli_dfs_Remove_state {
296 struct dfs_Remove orig;
297 struct dfs_Remove tmp;
298 TALLOC_CTX *out_mem_ctx;
299 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
302 static void rpccli_dfs_Remove_done(struct tevent_req *subreq);
304 struct tevent_req *rpccli_dfs_Remove_send(TALLOC_CTX *mem_ctx,
305 struct tevent_context *ev,
306 struct rpc_pipe_client *cli,
307 const char *_dfs_entry_path /* [in] [ref,charset(UTF16)] */,
308 const char *_servername /* [in] [unique,charset(UTF16)] */,
309 const char *_sharename /* [in] [unique,charset(UTF16)] */)
311 struct tevent_req *req;
312 struct rpccli_dfs_Remove_state *state;
313 struct tevent_req *subreq;
315 req = tevent_req_create(mem_ctx, &state,
316 struct rpccli_dfs_Remove_state);
317 if (req == NULL) {
318 return NULL;
320 state->out_mem_ctx = NULL;
321 state->dispatch_recv = cli->dispatch_recv;
323 /* In parameters */
324 state->orig.in.dfs_entry_path = _dfs_entry_path;
325 state->orig.in.servername = _servername;
326 state->orig.in.sharename = _sharename;
328 /* Out parameters */
330 /* Result */
331 ZERO_STRUCT(state->orig.out.result);
333 /* make a temporary copy, that we pass to the dispatch function */
334 state->tmp = state->orig;
336 subreq = cli->dispatch_send(state, ev, cli,
337 &ndr_table_netdfs,
338 NDR_DFS_REMOVE,
339 &state->tmp);
340 if (tevent_req_nomem(subreq, req)) {
341 return tevent_req_post(req, ev);
343 tevent_req_set_callback(subreq, rpccli_dfs_Remove_done, req);
344 return req;
347 static void rpccli_dfs_Remove_done(struct tevent_req *subreq)
349 struct tevent_req *req = tevent_req_callback_data(
350 subreq, struct tevent_req);
351 struct rpccli_dfs_Remove_state *state = tevent_req_data(
352 req, struct rpccli_dfs_Remove_state);
353 NTSTATUS status;
354 TALLOC_CTX *mem_ctx;
356 if (state->out_mem_ctx) {
357 mem_ctx = state->out_mem_ctx;
358 } else {
359 mem_ctx = state;
362 status = state->dispatch_recv(subreq, mem_ctx);
363 TALLOC_FREE(subreq);
364 if (!NT_STATUS_IS_OK(status)) {
365 tevent_req_nterror(req, status);
366 return;
369 /* Copy out parameters */
371 /* Copy result */
372 state->orig.out.result = state->tmp.out.result;
374 /* Reset temporary structure */
375 ZERO_STRUCT(state->tmp);
377 tevent_req_done(req);
380 NTSTATUS rpccli_dfs_Remove_recv(struct tevent_req *req,
381 TALLOC_CTX *mem_ctx,
382 WERROR *result)
384 struct rpccli_dfs_Remove_state *state = tevent_req_data(
385 req, struct rpccli_dfs_Remove_state);
386 NTSTATUS status;
388 if (tevent_req_is_nterror(req, &status)) {
389 tevent_req_received(req);
390 return status;
393 /* Steal possbile out parameters to the callers context */
394 talloc_steal(mem_ctx, state->out_mem_ctx);
396 /* Return result */
397 *result = state->orig.out.result;
399 tevent_req_received(req);
400 return NT_STATUS_OK;
403 NTSTATUS rpccli_dfs_Remove(struct rpc_pipe_client *cli,
404 TALLOC_CTX *mem_ctx,
405 const char *dfs_entry_path /* [in] [ref,charset(UTF16)] */,
406 const char *servername /* [in] [unique,charset(UTF16)] */,
407 const char *sharename /* [in] [unique,charset(UTF16)] */,
408 WERROR *werror)
410 struct dfs_Remove r;
411 NTSTATUS status;
413 /* In parameters */
414 r.in.dfs_entry_path = dfs_entry_path;
415 r.in.servername = servername;
416 r.in.sharename = sharename;
418 status = cli->dispatch(cli,
419 mem_ctx,
420 &ndr_table_netdfs,
421 NDR_DFS_REMOVE,
422 &r);
424 if (!NT_STATUS_IS_OK(status)) {
425 return status;
428 if (NT_STATUS_IS_ERR(status)) {
429 return status;
432 /* Return variables */
434 /* Return result */
435 if (werror) {
436 *werror = r.out.result;
439 return werror_to_ntstatus(r.out.result);
442 struct rpccli_dfs_SetInfo_state {
443 struct dfs_SetInfo orig;
444 struct dfs_SetInfo tmp;
445 TALLOC_CTX *out_mem_ctx;
446 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
449 static void rpccli_dfs_SetInfo_done(struct tevent_req *subreq);
451 struct tevent_req *rpccli_dfs_SetInfo_send(TALLOC_CTX *mem_ctx,
452 struct tevent_context *ev,
453 struct rpc_pipe_client *cli,
454 const char *_dfs_entry_path /* [in] [charset(UTF16)] */,
455 const char *_servername /* [in] [unique,charset(UTF16)] */,
456 const char *_sharename /* [in] [unique,charset(UTF16)] */,
457 uint32_t _level /* [in] */,
458 union dfs_Info *_info /* [in] [ref,switch_is(level)] */)
460 struct tevent_req *req;
461 struct rpccli_dfs_SetInfo_state *state;
462 struct tevent_req *subreq;
464 req = tevent_req_create(mem_ctx, &state,
465 struct rpccli_dfs_SetInfo_state);
466 if (req == NULL) {
467 return NULL;
469 state->out_mem_ctx = NULL;
470 state->dispatch_recv = cli->dispatch_recv;
472 /* In parameters */
473 state->orig.in.dfs_entry_path = _dfs_entry_path;
474 state->orig.in.servername = _servername;
475 state->orig.in.sharename = _sharename;
476 state->orig.in.level = _level;
477 state->orig.in.info = _info;
479 /* Out parameters */
481 /* Result */
482 ZERO_STRUCT(state->orig.out.result);
484 /* make a temporary copy, that we pass to the dispatch function */
485 state->tmp = state->orig;
487 subreq = cli->dispatch_send(state, ev, cli,
488 &ndr_table_netdfs,
489 NDR_DFS_SETINFO,
490 &state->tmp);
491 if (tevent_req_nomem(subreq, req)) {
492 return tevent_req_post(req, ev);
494 tevent_req_set_callback(subreq, rpccli_dfs_SetInfo_done, req);
495 return req;
498 static void rpccli_dfs_SetInfo_done(struct tevent_req *subreq)
500 struct tevent_req *req = tevent_req_callback_data(
501 subreq, struct tevent_req);
502 struct rpccli_dfs_SetInfo_state *state = tevent_req_data(
503 req, struct rpccli_dfs_SetInfo_state);
504 NTSTATUS status;
505 TALLOC_CTX *mem_ctx;
507 if (state->out_mem_ctx) {
508 mem_ctx = state->out_mem_ctx;
509 } else {
510 mem_ctx = state;
513 status = state->dispatch_recv(subreq, mem_ctx);
514 TALLOC_FREE(subreq);
515 if (!NT_STATUS_IS_OK(status)) {
516 tevent_req_nterror(req, status);
517 return;
520 /* Copy out parameters */
522 /* Copy result */
523 state->orig.out.result = state->tmp.out.result;
525 /* Reset temporary structure */
526 ZERO_STRUCT(state->tmp);
528 tevent_req_done(req);
531 NTSTATUS rpccli_dfs_SetInfo_recv(struct tevent_req *req,
532 TALLOC_CTX *mem_ctx,
533 WERROR *result)
535 struct rpccli_dfs_SetInfo_state *state = tevent_req_data(
536 req, struct rpccli_dfs_SetInfo_state);
537 NTSTATUS status;
539 if (tevent_req_is_nterror(req, &status)) {
540 tevent_req_received(req);
541 return status;
544 /* Steal possbile out parameters to the callers context */
545 talloc_steal(mem_ctx, state->out_mem_ctx);
547 /* Return result */
548 *result = state->orig.out.result;
550 tevent_req_received(req);
551 return NT_STATUS_OK;
554 NTSTATUS rpccli_dfs_SetInfo(struct rpc_pipe_client *cli,
555 TALLOC_CTX *mem_ctx,
556 const char *dfs_entry_path /* [in] [charset(UTF16)] */,
557 const char *servername /* [in] [unique,charset(UTF16)] */,
558 const char *sharename /* [in] [unique,charset(UTF16)] */,
559 uint32_t level /* [in] */,
560 union dfs_Info *info /* [in] [ref,switch_is(level)] */,
561 WERROR *werror)
563 struct dfs_SetInfo r;
564 NTSTATUS status;
566 /* In parameters */
567 r.in.dfs_entry_path = dfs_entry_path;
568 r.in.servername = servername;
569 r.in.sharename = sharename;
570 r.in.level = level;
571 r.in.info = info;
573 status = cli->dispatch(cli,
574 mem_ctx,
575 &ndr_table_netdfs,
576 NDR_DFS_SETINFO,
577 &r);
579 if (!NT_STATUS_IS_OK(status)) {
580 return status;
583 if (NT_STATUS_IS_ERR(status)) {
584 return status;
587 /* Return variables */
589 /* Return result */
590 if (werror) {
591 *werror = r.out.result;
594 return werror_to_ntstatus(r.out.result);
597 struct rpccli_dfs_GetInfo_state {
598 struct dfs_GetInfo orig;
599 struct dfs_GetInfo tmp;
600 TALLOC_CTX *out_mem_ctx;
601 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
604 static void rpccli_dfs_GetInfo_done(struct tevent_req *subreq);
606 struct tevent_req *rpccli_dfs_GetInfo_send(TALLOC_CTX *mem_ctx,
607 struct tevent_context *ev,
608 struct rpc_pipe_client *cli,
609 const char *_dfs_entry_path /* [in] [charset(UTF16)] */,
610 const char *_servername /* [in] [unique,charset(UTF16)] */,
611 const char *_sharename /* [in] [unique,charset(UTF16)] */,
612 uint32_t _level /* [in] */,
613 union dfs_Info *_info /* [out] [ref,switch_is(level)] */)
615 struct tevent_req *req;
616 struct rpccli_dfs_GetInfo_state *state;
617 struct tevent_req *subreq;
619 req = tevent_req_create(mem_ctx, &state,
620 struct rpccli_dfs_GetInfo_state);
621 if (req == NULL) {
622 return NULL;
624 state->out_mem_ctx = NULL;
625 state->dispatch_recv = cli->dispatch_recv;
627 /* In parameters */
628 state->orig.in.dfs_entry_path = _dfs_entry_path;
629 state->orig.in.servername = _servername;
630 state->orig.in.sharename = _sharename;
631 state->orig.in.level = _level;
633 /* Out parameters */
634 state->orig.out.info = _info;
636 /* Result */
637 ZERO_STRUCT(state->orig.out.result);
639 state->out_mem_ctx = talloc_named_const(state, 0,
640 "rpccli_dfs_GetInfo_out_memory");
641 if (tevent_req_nomem(state->out_mem_ctx, req)) {
642 return tevent_req_post(req, ev);
645 /* make a temporary copy, that we pass to the dispatch function */
646 state->tmp = state->orig;
648 subreq = cli->dispatch_send(state, ev, cli,
649 &ndr_table_netdfs,
650 NDR_DFS_GETINFO,
651 &state->tmp);
652 if (tevent_req_nomem(subreq, req)) {
653 return tevent_req_post(req, ev);
655 tevent_req_set_callback(subreq, rpccli_dfs_GetInfo_done, req);
656 return req;
659 static void rpccli_dfs_GetInfo_done(struct tevent_req *subreq)
661 struct tevent_req *req = tevent_req_callback_data(
662 subreq, struct tevent_req);
663 struct rpccli_dfs_GetInfo_state *state = tevent_req_data(
664 req, struct rpccli_dfs_GetInfo_state);
665 NTSTATUS status;
666 TALLOC_CTX *mem_ctx;
668 if (state->out_mem_ctx) {
669 mem_ctx = state->out_mem_ctx;
670 } else {
671 mem_ctx = state;
674 status = state->dispatch_recv(subreq, mem_ctx);
675 TALLOC_FREE(subreq);
676 if (!NT_STATUS_IS_OK(status)) {
677 tevent_req_nterror(req, status);
678 return;
681 /* Copy out parameters */
682 *state->orig.out.info = *state->tmp.out.info;
684 /* Copy result */
685 state->orig.out.result = state->tmp.out.result;
687 /* Reset temporary structure */
688 ZERO_STRUCT(state->tmp);
690 tevent_req_done(req);
693 NTSTATUS rpccli_dfs_GetInfo_recv(struct tevent_req *req,
694 TALLOC_CTX *mem_ctx,
695 WERROR *result)
697 struct rpccli_dfs_GetInfo_state *state = tevent_req_data(
698 req, struct rpccli_dfs_GetInfo_state);
699 NTSTATUS status;
701 if (tevent_req_is_nterror(req, &status)) {
702 tevent_req_received(req);
703 return status;
706 /* Steal possbile out parameters to the callers context */
707 talloc_steal(mem_ctx, state->out_mem_ctx);
709 /* Return result */
710 *result = state->orig.out.result;
712 tevent_req_received(req);
713 return NT_STATUS_OK;
716 NTSTATUS rpccli_dfs_GetInfo(struct rpc_pipe_client *cli,
717 TALLOC_CTX *mem_ctx,
718 const char *dfs_entry_path /* [in] [charset(UTF16)] */,
719 const char *servername /* [in] [unique,charset(UTF16)] */,
720 const char *sharename /* [in] [unique,charset(UTF16)] */,
721 uint32_t level /* [in] */,
722 union dfs_Info *info /* [out] [ref,switch_is(level)] */,
723 WERROR *werror)
725 struct dfs_GetInfo r;
726 NTSTATUS status;
728 /* In parameters */
729 r.in.dfs_entry_path = dfs_entry_path;
730 r.in.servername = servername;
731 r.in.sharename = sharename;
732 r.in.level = level;
734 status = cli->dispatch(cli,
735 mem_ctx,
736 &ndr_table_netdfs,
737 NDR_DFS_GETINFO,
738 &r);
740 if (!NT_STATUS_IS_OK(status)) {
741 return status;
744 if (NT_STATUS_IS_ERR(status)) {
745 return status;
748 /* Return variables */
749 *info = *r.out.info;
751 /* Return result */
752 if (werror) {
753 *werror = r.out.result;
756 return werror_to_ntstatus(r.out.result);
759 struct rpccli_dfs_Enum_state {
760 struct dfs_Enum orig;
761 struct dfs_Enum tmp;
762 TALLOC_CTX *out_mem_ctx;
763 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
766 static void rpccli_dfs_Enum_done(struct tevent_req *subreq);
768 struct tevent_req *rpccli_dfs_Enum_send(TALLOC_CTX *mem_ctx,
769 struct tevent_context *ev,
770 struct rpc_pipe_client *cli,
771 uint32_t _level /* [in] */,
772 uint32_t _bufsize /* [in] */,
773 struct dfs_EnumStruct *_info /* [in,out] [unique] */,
774 uint32_t *_total /* [in,out] [unique] */)
776 struct tevent_req *req;
777 struct rpccli_dfs_Enum_state *state;
778 struct tevent_req *subreq;
780 req = tevent_req_create(mem_ctx, &state,
781 struct rpccli_dfs_Enum_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;
790 state->orig.in.bufsize = _bufsize;
791 state->orig.in.info = _info;
792 state->orig.in.total = _total;
794 /* Out parameters */
795 state->orig.out.info = _info;
796 state->orig.out.total = _total;
798 /* Result */
799 ZERO_STRUCT(state->orig.out.result);
801 state->out_mem_ctx = talloc_named_const(state, 0,
802 "rpccli_dfs_Enum_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_netdfs,
812 NDR_DFS_ENUM,
813 &state->tmp);
814 if (tevent_req_nomem(subreq, req)) {
815 return tevent_req_post(req, ev);
817 tevent_req_set_callback(subreq, rpccli_dfs_Enum_done, req);
818 return req;
821 static void rpccli_dfs_Enum_done(struct tevent_req *subreq)
823 struct tevent_req *req = tevent_req_callback_data(
824 subreq, struct tevent_req);
825 struct rpccli_dfs_Enum_state *state = tevent_req_data(
826 req, struct rpccli_dfs_Enum_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 if (state->orig.out.info && state->tmp.out.info) {
845 *state->orig.out.info = *state->tmp.out.info;
847 if (state->orig.out.total && state->tmp.out.total) {
848 *state->orig.out.total = *state->tmp.out.total;
851 /* Copy result */
852 state->orig.out.result = state->tmp.out.result;
854 /* Reset temporary structure */
855 ZERO_STRUCT(state->tmp);
857 tevent_req_done(req);
860 NTSTATUS rpccli_dfs_Enum_recv(struct tevent_req *req,
861 TALLOC_CTX *mem_ctx,
862 WERROR *result)
864 struct rpccli_dfs_Enum_state *state = tevent_req_data(
865 req, struct rpccli_dfs_Enum_state);
866 NTSTATUS status;
868 if (tevent_req_is_nterror(req, &status)) {
869 tevent_req_received(req);
870 return status;
873 /* Steal possbile out parameters to the callers context */
874 talloc_steal(mem_ctx, state->out_mem_ctx);
876 /* Return result */
877 *result = state->orig.out.result;
879 tevent_req_received(req);
880 return NT_STATUS_OK;
883 NTSTATUS rpccli_dfs_Enum(struct rpc_pipe_client *cli,
884 TALLOC_CTX *mem_ctx,
885 uint32_t level /* [in] */,
886 uint32_t bufsize /* [in] */,
887 struct dfs_EnumStruct *info /* [in,out] [unique] */,
888 uint32_t *total /* [in,out] [unique] */,
889 WERROR *werror)
891 struct dfs_Enum r;
892 NTSTATUS status;
894 /* In parameters */
895 r.in.level = level;
896 r.in.bufsize = bufsize;
897 r.in.info = info;
898 r.in.total = total;
900 status = cli->dispatch(cli,
901 mem_ctx,
902 &ndr_table_netdfs,
903 NDR_DFS_ENUM,
904 &r);
906 if (!NT_STATUS_IS_OK(status)) {
907 return status;
910 if (NT_STATUS_IS_ERR(status)) {
911 return status;
914 /* Return variables */
915 if (info && r.out.info) {
916 *info = *r.out.info;
918 if (total && r.out.total) {
919 *total = *r.out.total;
922 /* Return result */
923 if (werror) {
924 *werror = r.out.result;
927 return werror_to_ntstatus(r.out.result);
930 struct rpccli_dfs_Rename_state {
931 struct dfs_Rename orig;
932 struct dfs_Rename tmp;
933 TALLOC_CTX *out_mem_ctx;
934 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
937 static void rpccli_dfs_Rename_done(struct tevent_req *subreq);
939 struct tevent_req *rpccli_dfs_Rename_send(TALLOC_CTX *mem_ctx,
940 struct tevent_context *ev,
941 struct rpc_pipe_client *cli)
943 struct tevent_req *req;
944 struct rpccli_dfs_Rename_state *state;
945 struct tevent_req *subreq;
947 req = tevent_req_create(mem_ctx, &state,
948 struct rpccli_dfs_Rename_state);
949 if (req == NULL) {
950 return NULL;
952 state->out_mem_ctx = NULL;
953 state->dispatch_recv = cli->dispatch_recv;
955 /* In parameters */
957 /* Out parameters */
959 /* Result */
960 ZERO_STRUCT(state->orig.out.result);
962 /* make a temporary copy, that we pass to the dispatch function */
963 state->tmp = state->orig;
965 subreq = cli->dispatch_send(state, ev, cli,
966 &ndr_table_netdfs,
967 NDR_DFS_RENAME,
968 &state->tmp);
969 if (tevent_req_nomem(subreq, req)) {
970 return tevent_req_post(req, ev);
972 tevent_req_set_callback(subreq, rpccli_dfs_Rename_done, req);
973 return req;
976 static void rpccli_dfs_Rename_done(struct tevent_req *subreq)
978 struct tevent_req *req = tevent_req_callback_data(
979 subreq, struct tevent_req);
980 struct rpccli_dfs_Rename_state *state = tevent_req_data(
981 req, struct rpccli_dfs_Rename_state);
982 NTSTATUS status;
983 TALLOC_CTX *mem_ctx;
985 if (state->out_mem_ctx) {
986 mem_ctx = state->out_mem_ctx;
987 } else {
988 mem_ctx = state;
991 status = state->dispatch_recv(subreq, mem_ctx);
992 TALLOC_FREE(subreq);
993 if (!NT_STATUS_IS_OK(status)) {
994 tevent_req_nterror(req, status);
995 return;
998 /* Copy out parameters */
1000 /* Copy result */
1001 state->orig.out.result = state->tmp.out.result;
1003 /* Reset temporary structure */
1004 ZERO_STRUCT(state->tmp);
1006 tevent_req_done(req);
1009 NTSTATUS rpccli_dfs_Rename_recv(struct tevent_req *req,
1010 TALLOC_CTX *mem_ctx,
1011 WERROR *result)
1013 struct rpccli_dfs_Rename_state *state = tevent_req_data(
1014 req, struct rpccli_dfs_Rename_state);
1015 NTSTATUS status;
1017 if (tevent_req_is_nterror(req, &status)) {
1018 tevent_req_received(req);
1019 return status;
1022 /* Steal possbile out parameters to the callers context */
1023 talloc_steal(mem_ctx, state->out_mem_ctx);
1025 /* Return result */
1026 *result = state->orig.out.result;
1028 tevent_req_received(req);
1029 return NT_STATUS_OK;
1032 NTSTATUS rpccli_dfs_Rename(struct rpc_pipe_client *cli,
1033 TALLOC_CTX *mem_ctx,
1034 WERROR *werror)
1036 struct dfs_Rename r;
1037 NTSTATUS status;
1039 /* In parameters */
1041 status = cli->dispatch(cli,
1042 mem_ctx,
1043 &ndr_table_netdfs,
1044 NDR_DFS_RENAME,
1045 &r);
1047 if (!NT_STATUS_IS_OK(status)) {
1048 return status;
1051 if (NT_STATUS_IS_ERR(status)) {
1052 return status;
1055 /* Return variables */
1057 /* Return result */
1058 if (werror) {
1059 *werror = r.out.result;
1062 return werror_to_ntstatus(r.out.result);
1065 struct rpccli_dfs_Move_state {
1066 struct dfs_Move orig;
1067 struct dfs_Move tmp;
1068 TALLOC_CTX *out_mem_ctx;
1069 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1072 static void rpccli_dfs_Move_done(struct tevent_req *subreq);
1074 struct tevent_req *rpccli_dfs_Move_send(TALLOC_CTX *mem_ctx,
1075 struct tevent_context *ev,
1076 struct rpc_pipe_client *cli)
1078 struct tevent_req *req;
1079 struct rpccli_dfs_Move_state *state;
1080 struct tevent_req *subreq;
1082 req = tevent_req_create(mem_ctx, &state,
1083 struct rpccli_dfs_Move_state);
1084 if (req == NULL) {
1085 return NULL;
1087 state->out_mem_ctx = NULL;
1088 state->dispatch_recv = cli->dispatch_recv;
1090 /* In parameters */
1092 /* Out parameters */
1094 /* Result */
1095 ZERO_STRUCT(state->orig.out.result);
1097 /* make a temporary copy, that we pass to the dispatch function */
1098 state->tmp = state->orig;
1100 subreq = cli->dispatch_send(state, ev, cli,
1101 &ndr_table_netdfs,
1102 NDR_DFS_MOVE,
1103 &state->tmp);
1104 if (tevent_req_nomem(subreq, req)) {
1105 return tevent_req_post(req, ev);
1107 tevent_req_set_callback(subreq, rpccli_dfs_Move_done, req);
1108 return req;
1111 static void rpccli_dfs_Move_done(struct tevent_req *subreq)
1113 struct tevent_req *req = tevent_req_callback_data(
1114 subreq, struct tevent_req);
1115 struct rpccli_dfs_Move_state *state = tevent_req_data(
1116 req, struct rpccli_dfs_Move_state);
1117 NTSTATUS status;
1118 TALLOC_CTX *mem_ctx;
1120 if (state->out_mem_ctx) {
1121 mem_ctx = state->out_mem_ctx;
1122 } else {
1123 mem_ctx = state;
1126 status = state->dispatch_recv(subreq, mem_ctx);
1127 TALLOC_FREE(subreq);
1128 if (!NT_STATUS_IS_OK(status)) {
1129 tevent_req_nterror(req, status);
1130 return;
1133 /* Copy out parameters */
1135 /* Copy result */
1136 state->orig.out.result = state->tmp.out.result;
1138 /* Reset temporary structure */
1139 ZERO_STRUCT(state->tmp);
1141 tevent_req_done(req);
1144 NTSTATUS rpccli_dfs_Move_recv(struct tevent_req *req,
1145 TALLOC_CTX *mem_ctx,
1146 WERROR *result)
1148 struct rpccli_dfs_Move_state *state = tevent_req_data(
1149 req, struct rpccli_dfs_Move_state);
1150 NTSTATUS status;
1152 if (tevent_req_is_nterror(req, &status)) {
1153 tevent_req_received(req);
1154 return status;
1157 /* Steal possbile out parameters to the callers context */
1158 talloc_steal(mem_ctx, state->out_mem_ctx);
1160 /* Return result */
1161 *result = state->orig.out.result;
1163 tevent_req_received(req);
1164 return NT_STATUS_OK;
1167 NTSTATUS rpccli_dfs_Move(struct rpc_pipe_client *cli,
1168 TALLOC_CTX *mem_ctx,
1169 WERROR *werror)
1171 struct dfs_Move r;
1172 NTSTATUS status;
1174 /* In parameters */
1176 status = cli->dispatch(cli,
1177 mem_ctx,
1178 &ndr_table_netdfs,
1179 NDR_DFS_MOVE,
1180 &r);
1182 if (!NT_STATUS_IS_OK(status)) {
1183 return status;
1186 if (NT_STATUS_IS_ERR(status)) {
1187 return status;
1190 /* Return variables */
1192 /* Return result */
1193 if (werror) {
1194 *werror = r.out.result;
1197 return werror_to_ntstatus(r.out.result);
1200 struct rpccli_dfs_ManagerGetConfigInfo_state {
1201 struct dfs_ManagerGetConfigInfo orig;
1202 struct dfs_ManagerGetConfigInfo tmp;
1203 TALLOC_CTX *out_mem_ctx;
1204 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1207 static void rpccli_dfs_ManagerGetConfigInfo_done(struct tevent_req *subreq);
1209 struct tevent_req *rpccli_dfs_ManagerGetConfigInfo_send(TALLOC_CTX *mem_ctx,
1210 struct tevent_context *ev,
1211 struct rpc_pipe_client *cli)
1213 struct tevent_req *req;
1214 struct rpccli_dfs_ManagerGetConfigInfo_state *state;
1215 struct tevent_req *subreq;
1217 req = tevent_req_create(mem_ctx, &state,
1218 struct rpccli_dfs_ManagerGetConfigInfo_state);
1219 if (req == NULL) {
1220 return NULL;
1222 state->out_mem_ctx = NULL;
1223 state->dispatch_recv = cli->dispatch_recv;
1225 /* In parameters */
1227 /* Out parameters */
1229 /* Result */
1230 ZERO_STRUCT(state->orig.out.result);
1232 /* make a temporary copy, that we pass to the dispatch function */
1233 state->tmp = state->orig;
1235 subreq = cli->dispatch_send(state, ev, cli,
1236 &ndr_table_netdfs,
1237 NDR_DFS_MANAGERGETCONFIGINFO,
1238 &state->tmp);
1239 if (tevent_req_nomem(subreq, req)) {
1240 return tevent_req_post(req, ev);
1242 tevent_req_set_callback(subreq, rpccli_dfs_ManagerGetConfigInfo_done, req);
1243 return req;
1246 static void rpccli_dfs_ManagerGetConfigInfo_done(struct tevent_req *subreq)
1248 struct tevent_req *req = tevent_req_callback_data(
1249 subreq, struct tevent_req);
1250 struct rpccli_dfs_ManagerGetConfigInfo_state *state = tevent_req_data(
1251 req, struct rpccli_dfs_ManagerGetConfigInfo_state);
1252 NTSTATUS status;
1253 TALLOC_CTX *mem_ctx;
1255 if (state->out_mem_ctx) {
1256 mem_ctx = state->out_mem_ctx;
1257 } else {
1258 mem_ctx = state;
1261 status = state->dispatch_recv(subreq, mem_ctx);
1262 TALLOC_FREE(subreq);
1263 if (!NT_STATUS_IS_OK(status)) {
1264 tevent_req_nterror(req, status);
1265 return;
1268 /* Copy out parameters */
1270 /* Copy result */
1271 state->orig.out.result = state->tmp.out.result;
1273 /* Reset temporary structure */
1274 ZERO_STRUCT(state->tmp);
1276 tevent_req_done(req);
1279 NTSTATUS rpccli_dfs_ManagerGetConfigInfo_recv(struct tevent_req *req,
1280 TALLOC_CTX *mem_ctx,
1281 WERROR *result)
1283 struct rpccli_dfs_ManagerGetConfigInfo_state *state = tevent_req_data(
1284 req, struct rpccli_dfs_ManagerGetConfigInfo_state);
1285 NTSTATUS status;
1287 if (tevent_req_is_nterror(req, &status)) {
1288 tevent_req_received(req);
1289 return status;
1292 /* Steal possbile out parameters to the callers context */
1293 talloc_steal(mem_ctx, state->out_mem_ctx);
1295 /* Return result */
1296 *result = state->orig.out.result;
1298 tevent_req_received(req);
1299 return NT_STATUS_OK;
1302 NTSTATUS rpccli_dfs_ManagerGetConfigInfo(struct rpc_pipe_client *cli,
1303 TALLOC_CTX *mem_ctx,
1304 WERROR *werror)
1306 struct dfs_ManagerGetConfigInfo r;
1307 NTSTATUS status;
1309 /* In parameters */
1311 status = cli->dispatch(cli,
1312 mem_ctx,
1313 &ndr_table_netdfs,
1314 NDR_DFS_MANAGERGETCONFIGINFO,
1315 &r);
1317 if (!NT_STATUS_IS_OK(status)) {
1318 return status;
1321 if (NT_STATUS_IS_ERR(status)) {
1322 return status;
1325 /* Return variables */
1327 /* Return result */
1328 if (werror) {
1329 *werror = r.out.result;
1332 return werror_to_ntstatus(r.out.result);
1335 struct rpccli_dfs_ManagerSendSiteInfo_state {
1336 struct dfs_ManagerSendSiteInfo orig;
1337 struct dfs_ManagerSendSiteInfo tmp;
1338 TALLOC_CTX *out_mem_ctx;
1339 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1342 static void rpccli_dfs_ManagerSendSiteInfo_done(struct tevent_req *subreq);
1344 struct tevent_req *rpccli_dfs_ManagerSendSiteInfo_send(TALLOC_CTX *mem_ctx,
1345 struct tevent_context *ev,
1346 struct rpc_pipe_client *cli)
1348 struct tevent_req *req;
1349 struct rpccli_dfs_ManagerSendSiteInfo_state *state;
1350 struct tevent_req *subreq;
1352 req = tevent_req_create(mem_ctx, &state,
1353 struct rpccli_dfs_ManagerSendSiteInfo_state);
1354 if (req == NULL) {
1355 return NULL;
1357 state->out_mem_ctx = NULL;
1358 state->dispatch_recv = cli->dispatch_recv;
1360 /* In parameters */
1362 /* Out parameters */
1364 /* Result */
1365 ZERO_STRUCT(state->orig.out.result);
1367 /* make a temporary copy, that we pass to the dispatch function */
1368 state->tmp = state->orig;
1370 subreq = cli->dispatch_send(state, ev, cli,
1371 &ndr_table_netdfs,
1372 NDR_DFS_MANAGERSENDSITEINFO,
1373 &state->tmp);
1374 if (tevent_req_nomem(subreq, req)) {
1375 return tevent_req_post(req, ev);
1377 tevent_req_set_callback(subreq, rpccli_dfs_ManagerSendSiteInfo_done, req);
1378 return req;
1381 static void rpccli_dfs_ManagerSendSiteInfo_done(struct tevent_req *subreq)
1383 struct tevent_req *req = tevent_req_callback_data(
1384 subreq, struct tevent_req);
1385 struct rpccli_dfs_ManagerSendSiteInfo_state *state = tevent_req_data(
1386 req, struct rpccli_dfs_ManagerSendSiteInfo_state);
1387 NTSTATUS status;
1388 TALLOC_CTX *mem_ctx;
1390 if (state->out_mem_ctx) {
1391 mem_ctx = state->out_mem_ctx;
1392 } else {
1393 mem_ctx = state;
1396 status = state->dispatch_recv(subreq, mem_ctx);
1397 TALLOC_FREE(subreq);
1398 if (!NT_STATUS_IS_OK(status)) {
1399 tevent_req_nterror(req, status);
1400 return;
1403 /* Copy out parameters */
1405 /* Copy result */
1406 state->orig.out.result = state->tmp.out.result;
1408 /* Reset temporary structure */
1409 ZERO_STRUCT(state->tmp);
1411 tevent_req_done(req);
1414 NTSTATUS rpccli_dfs_ManagerSendSiteInfo_recv(struct tevent_req *req,
1415 TALLOC_CTX *mem_ctx,
1416 WERROR *result)
1418 struct rpccli_dfs_ManagerSendSiteInfo_state *state = tevent_req_data(
1419 req, struct rpccli_dfs_ManagerSendSiteInfo_state);
1420 NTSTATUS status;
1422 if (tevent_req_is_nterror(req, &status)) {
1423 tevent_req_received(req);
1424 return status;
1427 /* Steal possbile out parameters to the callers context */
1428 talloc_steal(mem_ctx, state->out_mem_ctx);
1430 /* Return result */
1431 *result = state->orig.out.result;
1433 tevent_req_received(req);
1434 return NT_STATUS_OK;
1437 NTSTATUS rpccli_dfs_ManagerSendSiteInfo(struct rpc_pipe_client *cli,
1438 TALLOC_CTX *mem_ctx,
1439 WERROR *werror)
1441 struct dfs_ManagerSendSiteInfo r;
1442 NTSTATUS status;
1444 /* In parameters */
1446 status = cli->dispatch(cli,
1447 mem_ctx,
1448 &ndr_table_netdfs,
1449 NDR_DFS_MANAGERSENDSITEINFO,
1450 &r);
1452 if (!NT_STATUS_IS_OK(status)) {
1453 return status;
1456 if (NT_STATUS_IS_ERR(status)) {
1457 return status;
1460 /* Return variables */
1462 /* Return result */
1463 if (werror) {
1464 *werror = r.out.result;
1467 return werror_to_ntstatus(r.out.result);
1470 struct rpccli_dfs_AddFtRoot_state {
1471 struct dfs_AddFtRoot orig;
1472 struct dfs_AddFtRoot tmp;
1473 TALLOC_CTX *out_mem_ctx;
1474 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1477 static void rpccli_dfs_AddFtRoot_done(struct tevent_req *subreq);
1479 struct tevent_req *rpccli_dfs_AddFtRoot_send(TALLOC_CTX *mem_ctx,
1480 struct tevent_context *ev,
1481 struct rpc_pipe_client *cli,
1482 const char *_servername /* [in] [charset(UTF16)] */,
1483 const char *_dns_servername /* [in] [charset(UTF16)] */,
1484 const char *_dfsname /* [in] [charset(UTF16)] */,
1485 const char *_rootshare /* [in] [charset(UTF16)] */,
1486 const char *_comment /* [in] [charset(UTF16)] */,
1487 const char *_dfs_config_dn /* [in] [charset(UTF16)] */,
1488 uint8_t _unknown1 /* [in] */,
1489 uint32_t _flags /* [in] */,
1490 struct dfs_UnknownStruct **_unknown2 /* [in,out] [unique] */)
1492 struct tevent_req *req;
1493 struct rpccli_dfs_AddFtRoot_state *state;
1494 struct tevent_req *subreq;
1496 req = tevent_req_create(mem_ctx, &state,
1497 struct rpccli_dfs_AddFtRoot_state);
1498 if (req == NULL) {
1499 return NULL;
1501 state->out_mem_ctx = NULL;
1502 state->dispatch_recv = cli->dispatch_recv;
1504 /* In parameters */
1505 state->orig.in.servername = _servername;
1506 state->orig.in.dns_servername = _dns_servername;
1507 state->orig.in.dfsname = _dfsname;
1508 state->orig.in.rootshare = _rootshare;
1509 state->orig.in.comment = _comment;
1510 state->orig.in.dfs_config_dn = _dfs_config_dn;
1511 state->orig.in.unknown1 = _unknown1;
1512 state->orig.in.flags = _flags;
1513 state->orig.in.unknown2 = _unknown2;
1515 /* Out parameters */
1516 state->orig.out.unknown2 = _unknown2;
1518 /* Result */
1519 ZERO_STRUCT(state->orig.out.result);
1521 state->out_mem_ctx = talloc_named_const(state, 0,
1522 "rpccli_dfs_AddFtRoot_out_memory");
1523 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1524 return tevent_req_post(req, ev);
1527 /* make a temporary copy, that we pass to the dispatch function */
1528 state->tmp = state->orig;
1530 subreq = cli->dispatch_send(state, ev, cli,
1531 &ndr_table_netdfs,
1532 NDR_DFS_ADDFTROOT,
1533 &state->tmp);
1534 if (tevent_req_nomem(subreq, req)) {
1535 return tevent_req_post(req, ev);
1537 tevent_req_set_callback(subreq, rpccli_dfs_AddFtRoot_done, req);
1538 return req;
1541 static void rpccli_dfs_AddFtRoot_done(struct tevent_req *subreq)
1543 struct tevent_req *req = tevent_req_callback_data(
1544 subreq, struct tevent_req);
1545 struct rpccli_dfs_AddFtRoot_state *state = tevent_req_data(
1546 req, struct rpccli_dfs_AddFtRoot_state);
1547 NTSTATUS status;
1548 TALLOC_CTX *mem_ctx;
1550 if (state->out_mem_ctx) {
1551 mem_ctx = state->out_mem_ctx;
1552 } else {
1553 mem_ctx = state;
1556 status = state->dispatch_recv(subreq, mem_ctx);
1557 TALLOC_FREE(subreq);
1558 if (!NT_STATUS_IS_OK(status)) {
1559 tevent_req_nterror(req, status);
1560 return;
1563 /* Copy out parameters */
1564 if (state->orig.out.unknown2 && state->tmp.out.unknown2) {
1565 *state->orig.out.unknown2 = *state->tmp.out.unknown2;
1568 /* Copy result */
1569 state->orig.out.result = state->tmp.out.result;
1571 /* Reset temporary structure */
1572 ZERO_STRUCT(state->tmp);
1574 tevent_req_done(req);
1577 NTSTATUS rpccli_dfs_AddFtRoot_recv(struct tevent_req *req,
1578 TALLOC_CTX *mem_ctx,
1579 WERROR *result)
1581 struct rpccli_dfs_AddFtRoot_state *state = tevent_req_data(
1582 req, struct rpccli_dfs_AddFtRoot_state);
1583 NTSTATUS status;
1585 if (tevent_req_is_nterror(req, &status)) {
1586 tevent_req_received(req);
1587 return status;
1590 /* Steal possbile out parameters to the callers context */
1591 talloc_steal(mem_ctx, state->out_mem_ctx);
1593 /* Return result */
1594 *result = state->orig.out.result;
1596 tevent_req_received(req);
1597 return NT_STATUS_OK;
1600 NTSTATUS rpccli_dfs_AddFtRoot(struct rpc_pipe_client *cli,
1601 TALLOC_CTX *mem_ctx,
1602 const char *servername /* [in] [charset(UTF16)] */,
1603 const char *dns_servername /* [in] [charset(UTF16)] */,
1604 const char *dfsname /* [in] [charset(UTF16)] */,
1605 const char *rootshare /* [in] [charset(UTF16)] */,
1606 const char *comment /* [in] [charset(UTF16)] */,
1607 const char *dfs_config_dn /* [in] [charset(UTF16)] */,
1608 uint8_t unknown1 /* [in] */,
1609 uint32_t flags /* [in] */,
1610 struct dfs_UnknownStruct **unknown2 /* [in,out] [unique] */,
1611 WERROR *werror)
1613 struct dfs_AddFtRoot r;
1614 NTSTATUS status;
1616 /* In parameters */
1617 r.in.servername = servername;
1618 r.in.dns_servername = dns_servername;
1619 r.in.dfsname = dfsname;
1620 r.in.rootshare = rootshare;
1621 r.in.comment = comment;
1622 r.in.dfs_config_dn = dfs_config_dn;
1623 r.in.unknown1 = unknown1;
1624 r.in.flags = flags;
1625 r.in.unknown2 = unknown2;
1627 status = cli->dispatch(cli,
1628 mem_ctx,
1629 &ndr_table_netdfs,
1630 NDR_DFS_ADDFTROOT,
1631 &r);
1633 if (!NT_STATUS_IS_OK(status)) {
1634 return status;
1637 if (NT_STATUS_IS_ERR(status)) {
1638 return status;
1641 /* Return variables */
1642 if (unknown2 && r.out.unknown2) {
1643 *unknown2 = *r.out.unknown2;
1646 /* Return result */
1647 if (werror) {
1648 *werror = r.out.result;
1651 return werror_to_ntstatus(r.out.result);
1654 struct rpccli_dfs_RemoveFtRoot_state {
1655 struct dfs_RemoveFtRoot orig;
1656 struct dfs_RemoveFtRoot tmp;
1657 TALLOC_CTX *out_mem_ctx;
1658 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1661 static void rpccli_dfs_RemoveFtRoot_done(struct tevent_req *subreq);
1663 struct tevent_req *rpccli_dfs_RemoveFtRoot_send(TALLOC_CTX *mem_ctx,
1664 struct tevent_context *ev,
1665 struct rpc_pipe_client *cli,
1666 const char *_servername /* [in] [charset(UTF16)] */,
1667 const char *_dns_servername /* [in] [charset(UTF16)] */,
1668 const char *_dfsname /* [in] [charset(UTF16)] */,
1669 const char *_rootshare /* [in] [charset(UTF16)] */,
1670 uint32_t _flags /* [in] */,
1671 struct dfs_UnknownStruct **_unknown /* [in,out] [unique] */)
1673 struct tevent_req *req;
1674 struct rpccli_dfs_RemoveFtRoot_state *state;
1675 struct tevent_req *subreq;
1677 req = tevent_req_create(mem_ctx, &state,
1678 struct rpccli_dfs_RemoveFtRoot_state);
1679 if (req == NULL) {
1680 return NULL;
1682 state->out_mem_ctx = NULL;
1683 state->dispatch_recv = cli->dispatch_recv;
1685 /* In parameters */
1686 state->orig.in.servername = _servername;
1687 state->orig.in.dns_servername = _dns_servername;
1688 state->orig.in.dfsname = _dfsname;
1689 state->orig.in.rootshare = _rootshare;
1690 state->orig.in.flags = _flags;
1691 state->orig.in.unknown = _unknown;
1693 /* Out parameters */
1694 state->orig.out.unknown = _unknown;
1696 /* Result */
1697 ZERO_STRUCT(state->orig.out.result);
1699 state->out_mem_ctx = talloc_named_const(state, 0,
1700 "rpccli_dfs_RemoveFtRoot_out_memory");
1701 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1702 return tevent_req_post(req, ev);
1705 /* make a temporary copy, that we pass to the dispatch function */
1706 state->tmp = state->orig;
1708 subreq = cli->dispatch_send(state, ev, cli,
1709 &ndr_table_netdfs,
1710 NDR_DFS_REMOVEFTROOT,
1711 &state->tmp);
1712 if (tevent_req_nomem(subreq, req)) {
1713 return tevent_req_post(req, ev);
1715 tevent_req_set_callback(subreq, rpccli_dfs_RemoveFtRoot_done, req);
1716 return req;
1719 static void rpccli_dfs_RemoveFtRoot_done(struct tevent_req *subreq)
1721 struct tevent_req *req = tevent_req_callback_data(
1722 subreq, struct tevent_req);
1723 struct rpccli_dfs_RemoveFtRoot_state *state = tevent_req_data(
1724 req, struct rpccli_dfs_RemoveFtRoot_state);
1725 NTSTATUS status;
1726 TALLOC_CTX *mem_ctx;
1728 if (state->out_mem_ctx) {
1729 mem_ctx = state->out_mem_ctx;
1730 } else {
1731 mem_ctx = state;
1734 status = state->dispatch_recv(subreq, mem_ctx);
1735 TALLOC_FREE(subreq);
1736 if (!NT_STATUS_IS_OK(status)) {
1737 tevent_req_nterror(req, status);
1738 return;
1741 /* Copy out parameters */
1742 if (state->orig.out.unknown && state->tmp.out.unknown) {
1743 *state->orig.out.unknown = *state->tmp.out.unknown;
1746 /* Copy result */
1747 state->orig.out.result = state->tmp.out.result;
1749 /* Reset temporary structure */
1750 ZERO_STRUCT(state->tmp);
1752 tevent_req_done(req);
1755 NTSTATUS rpccli_dfs_RemoveFtRoot_recv(struct tevent_req *req,
1756 TALLOC_CTX *mem_ctx,
1757 WERROR *result)
1759 struct rpccli_dfs_RemoveFtRoot_state *state = tevent_req_data(
1760 req, struct rpccli_dfs_RemoveFtRoot_state);
1761 NTSTATUS status;
1763 if (tevent_req_is_nterror(req, &status)) {
1764 tevent_req_received(req);
1765 return status;
1768 /* Steal possbile out parameters to the callers context */
1769 talloc_steal(mem_ctx, state->out_mem_ctx);
1771 /* Return result */
1772 *result = state->orig.out.result;
1774 tevent_req_received(req);
1775 return NT_STATUS_OK;
1778 NTSTATUS rpccli_dfs_RemoveFtRoot(struct rpc_pipe_client *cli,
1779 TALLOC_CTX *mem_ctx,
1780 const char *servername /* [in] [charset(UTF16)] */,
1781 const char *dns_servername /* [in] [charset(UTF16)] */,
1782 const char *dfsname /* [in] [charset(UTF16)] */,
1783 const char *rootshare /* [in] [charset(UTF16)] */,
1784 uint32_t flags /* [in] */,
1785 struct dfs_UnknownStruct **unknown /* [in,out] [unique] */,
1786 WERROR *werror)
1788 struct dfs_RemoveFtRoot r;
1789 NTSTATUS status;
1791 /* In parameters */
1792 r.in.servername = servername;
1793 r.in.dns_servername = dns_servername;
1794 r.in.dfsname = dfsname;
1795 r.in.rootshare = rootshare;
1796 r.in.flags = flags;
1797 r.in.unknown = unknown;
1799 status = cli->dispatch(cli,
1800 mem_ctx,
1801 &ndr_table_netdfs,
1802 NDR_DFS_REMOVEFTROOT,
1803 &r);
1805 if (!NT_STATUS_IS_OK(status)) {
1806 return status;
1809 if (NT_STATUS_IS_ERR(status)) {
1810 return status;
1813 /* Return variables */
1814 if (unknown && r.out.unknown) {
1815 *unknown = *r.out.unknown;
1818 /* Return result */
1819 if (werror) {
1820 *werror = r.out.result;
1823 return werror_to_ntstatus(r.out.result);
1826 struct rpccli_dfs_AddStdRoot_state {
1827 struct dfs_AddStdRoot orig;
1828 struct dfs_AddStdRoot tmp;
1829 TALLOC_CTX *out_mem_ctx;
1830 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1833 static void rpccli_dfs_AddStdRoot_done(struct tevent_req *subreq);
1835 struct tevent_req *rpccli_dfs_AddStdRoot_send(TALLOC_CTX *mem_ctx,
1836 struct tevent_context *ev,
1837 struct rpc_pipe_client *cli,
1838 const char *_servername /* [in] [charset(UTF16)] */,
1839 const char *_rootshare /* [in] [charset(UTF16)] */,
1840 const char *_comment /* [in] [charset(UTF16)] */,
1841 uint32_t _flags /* [in] */)
1843 struct tevent_req *req;
1844 struct rpccli_dfs_AddStdRoot_state *state;
1845 struct tevent_req *subreq;
1847 req = tevent_req_create(mem_ctx, &state,
1848 struct rpccli_dfs_AddStdRoot_state);
1849 if (req == NULL) {
1850 return NULL;
1852 state->out_mem_ctx = NULL;
1853 state->dispatch_recv = cli->dispatch_recv;
1855 /* In parameters */
1856 state->orig.in.servername = _servername;
1857 state->orig.in.rootshare = _rootshare;
1858 state->orig.in.comment = _comment;
1859 state->orig.in.flags = _flags;
1861 /* Out parameters */
1863 /* Result */
1864 ZERO_STRUCT(state->orig.out.result);
1866 /* make a temporary copy, that we pass to the dispatch function */
1867 state->tmp = state->orig;
1869 subreq = cli->dispatch_send(state, ev, cli,
1870 &ndr_table_netdfs,
1871 NDR_DFS_ADDSTDROOT,
1872 &state->tmp);
1873 if (tevent_req_nomem(subreq, req)) {
1874 return tevent_req_post(req, ev);
1876 tevent_req_set_callback(subreq, rpccli_dfs_AddStdRoot_done, req);
1877 return req;
1880 static void rpccli_dfs_AddStdRoot_done(struct tevent_req *subreq)
1882 struct tevent_req *req = tevent_req_callback_data(
1883 subreq, struct tevent_req);
1884 struct rpccli_dfs_AddStdRoot_state *state = tevent_req_data(
1885 req, struct rpccli_dfs_AddStdRoot_state);
1886 NTSTATUS status;
1887 TALLOC_CTX *mem_ctx;
1889 if (state->out_mem_ctx) {
1890 mem_ctx = state->out_mem_ctx;
1891 } else {
1892 mem_ctx = state;
1895 status = state->dispatch_recv(subreq, mem_ctx);
1896 TALLOC_FREE(subreq);
1897 if (!NT_STATUS_IS_OK(status)) {
1898 tevent_req_nterror(req, status);
1899 return;
1902 /* Copy out parameters */
1904 /* Copy result */
1905 state->orig.out.result = state->tmp.out.result;
1907 /* Reset temporary structure */
1908 ZERO_STRUCT(state->tmp);
1910 tevent_req_done(req);
1913 NTSTATUS rpccli_dfs_AddStdRoot_recv(struct tevent_req *req,
1914 TALLOC_CTX *mem_ctx,
1915 WERROR *result)
1917 struct rpccli_dfs_AddStdRoot_state *state = tevent_req_data(
1918 req, struct rpccli_dfs_AddStdRoot_state);
1919 NTSTATUS status;
1921 if (tevent_req_is_nterror(req, &status)) {
1922 tevent_req_received(req);
1923 return status;
1926 /* Steal possbile out parameters to the callers context */
1927 talloc_steal(mem_ctx, state->out_mem_ctx);
1929 /* Return result */
1930 *result = state->orig.out.result;
1932 tevent_req_received(req);
1933 return NT_STATUS_OK;
1936 NTSTATUS rpccli_dfs_AddStdRoot(struct rpc_pipe_client *cli,
1937 TALLOC_CTX *mem_ctx,
1938 const char *servername /* [in] [charset(UTF16)] */,
1939 const char *rootshare /* [in] [charset(UTF16)] */,
1940 const char *comment /* [in] [charset(UTF16)] */,
1941 uint32_t flags /* [in] */,
1942 WERROR *werror)
1944 struct dfs_AddStdRoot r;
1945 NTSTATUS status;
1947 /* In parameters */
1948 r.in.servername = servername;
1949 r.in.rootshare = rootshare;
1950 r.in.comment = comment;
1951 r.in.flags = flags;
1953 status = cli->dispatch(cli,
1954 mem_ctx,
1955 &ndr_table_netdfs,
1956 NDR_DFS_ADDSTDROOT,
1957 &r);
1959 if (!NT_STATUS_IS_OK(status)) {
1960 return status;
1963 if (NT_STATUS_IS_ERR(status)) {
1964 return status;
1967 /* Return variables */
1969 /* Return result */
1970 if (werror) {
1971 *werror = r.out.result;
1974 return werror_to_ntstatus(r.out.result);
1977 struct rpccli_dfs_RemoveStdRoot_state {
1978 struct dfs_RemoveStdRoot orig;
1979 struct dfs_RemoveStdRoot tmp;
1980 TALLOC_CTX *out_mem_ctx;
1981 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1984 static void rpccli_dfs_RemoveStdRoot_done(struct tevent_req *subreq);
1986 struct tevent_req *rpccli_dfs_RemoveStdRoot_send(TALLOC_CTX *mem_ctx,
1987 struct tevent_context *ev,
1988 struct rpc_pipe_client *cli,
1989 const char *_servername /* [in] [charset(UTF16)] */,
1990 const char *_rootshare /* [in] [charset(UTF16)] */,
1991 uint32_t _flags /* [in] */)
1993 struct tevent_req *req;
1994 struct rpccli_dfs_RemoveStdRoot_state *state;
1995 struct tevent_req *subreq;
1997 req = tevent_req_create(mem_ctx, &state,
1998 struct rpccli_dfs_RemoveStdRoot_state);
1999 if (req == NULL) {
2000 return NULL;
2002 state->out_mem_ctx = NULL;
2003 state->dispatch_recv = cli->dispatch_recv;
2005 /* In parameters */
2006 state->orig.in.servername = _servername;
2007 state->orig.in.rootshare = _rootshare;
2008 state->orig.in.flags = _flags;
2010 /* Out parameters */
2012 /* Result */
2013 ZERO_STRUCT(state->orig.out.result);
2015 /* make a temporary copy, that we pass to the dispatch function */
2016 state->tmp = state->orig;
2018 subreq = cli->dispatch_send(state, ev, cli,
2019 &ndr_table_netdfs,
2020 NDR_DFS_REMOVESTDROOT,
2021 &state->tmp);
2022 if (tevent_req_nomem(subreq, req)) {
2023 return tevent_req_post(req, ev);
2025 tevent_req_set_callback(subreq, rpccli_dfs_RemoveStdRoot_done, req);
2026 return req;
2029 static void rpccli_dfs_RemoveStdRoot_done(struct tevent_req *subreq)
2031 struct tevent_req *req = tevent_req_callback_data(
2032 subreq, struct tevent_req);
2033 struct rpccli_dfs_RemoveStdRoot_state *state = tevent_req_data(
2034 req, struct rpccli_dfs_RemoveStdRoot_state);
2035 NTSTATUS status;
2036 TALLOC_CTX *mem_ctx;
2038 if (state->out_mem_ctx) {
2039 mem_ctx = state->out_mem_ctx;
2040 } else {
2041 mem_ctx = state;
2044 status = state->dispatch_recv(subreq, mem_ctx);
2045 TALLOC_FREE(subreq);
2046 if (!NT_STATUS_IS_OK(status)) {
2047 tevent_req_nterror(req, status);
2048 return;
2051 /* Copy out parameters */
2053 /* Copy result */
2054 state->orig.out.result = state->tmp.out.result;
2056 /* Reset temporary structure */
2057 ZERO_STRUCT(state->tmp);
2059 tevent_req_done(req);
2062 NTSTATUS rpccli_dfs_RemoveStdRoot_recv(struct tevent_req *req,
2063 TALLOC_CTX *mem_ctx,
2064 WERROR *result)
2066 struct rpccli_dfs_RemoveStdRoot_state *state = tevent_req_data(
2067 req, struct rpccli_dfs_RemoveStdRoot_state);
2068 NTSTATUS status;
2070 if (tevent_req_is_nterror(req, &status)) {
2071 tevent_req_received(req);
2072 return status;
2075 /* Steal possbile out parameters to the callers context */
2076 talloc_steal(mem_ctx, state->out_mem_ctx);
2078 /* Return result */
2079 *result = state->orig.out.result;
2081 tevent_req_received(req);
2082 return NT_STATUS_OK;
2085 NTSTATUS rpccli_dfs_RemoveStdRoot(struct rpc_pipe_client *cli,
2086 TALLOC_CTX *mem_ctx,
2087 const char *servername /* [in] [charset(UTF16)] */,
2088 const char *rootshare /* [in] [charset(UTF16)] */,
2089 uint32_t flags /* [in] */,
2090 WERROR *werror)
2092 struct dfs_RemoveStdRoot r;
2093 NTSTATUS status;
2095 /* In parameters */
2096 r.in.servername = servername;
2097 r.in.rootshare = rootshare;
2098 r.in.flags = flags;
2100 status = cli->dispatch(cli,
2101 mem_ctx,
2102 &ndr_table_netdfs,
2103 NDR_DFS_REMOVESTDROOT,
2104 &r);
2106 if (!NT_STATUS_IS_OK(status)) {
2107 return status;
2110 if (NT_STATUS_IS_ERR(status)) {
2111 return status;
2114 /* Return variables */
2116 /* Return result */
2117 if (werror) {
2118 *werror = r.out.result;
2121 return werror_to_ntstatus(r.out.result);
2124 struct rpccli_dfs_ManagerInitialize_state {
2125 struct dfs_ManagerInitialize orig;
2126 struct dfs_ManagerInitialize tmp;
2127 TALLOC_CTX *out_mem_ctx;
2128 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2131 static void rpccli_dfs_ManagerInitialize_done(struct tevent_req *subreq);
2133 struct tevent_req *rpccli_dfs_ManagerInitialize_send(TALLOC_CTX *mem_ctx,
2134 struct tevent_context *ev,
2135 struct rpc_pipe_client *cli,
2136 const char *_servername /* [in] [ref,charset(UTF16)] */,
2137 uint32_t _flags /* [in] */)
2139 struct tevent_req *req;
2140 struct rpccli_dfs_ManagerInitialize_state *state;
2141 struct tevent_req *subreq;
2143 req = tevent_req_create(mem_ctx, &state,
2144 struct rpccli_dfs_ManagerInitialize_state);
2145 if (req == NULL) {
2146 return NULL;
2148 state->out_mem_ctx = NULL;
2149 state->dispatch_recv = cli->dispatch_recv;
2151 /* In parameters */
2152 state->orig.in.servername = _servername;
2153 state->orig.in.flags = _flags;
2155 /* Out parameters */
2157 /* Result */
2158 ZERO_STRUCT(state->orig.out.result);
2160 /* make a temporary copy, that we pass to the dispatch function */
2161 state->tmp = state->orig;
2163 subreq = cli->dispatch_send(state, ev, cli,
2164 &ndr_table_netdfs,
2165 NDR_DFS_MANAGERINITIALIZE,
2166 &state->tmp);
2167 if (tevent_req_nomem(subreq, req)) {
2168 return tevent_req_post(req, ev);
2170 tevent_req_set_callback(subreq, rpccli_dfs_ManagerInitialize_done, req);
2171 return req;
2174 static void rpccli_dfs_ManagerInitialize_done(struct tevent_req *subreq)
2176 struct tevent_req *req = tevent_req_callback_data(
2177 subreq, struct tevent_req);
2178 struct rpccli_dfs_ManagerInitialize_state *state = tevent_req_data(
2179 req, struct rpccli_dfs_ManagerInitialize_state);
2180 NTSTATUS status;
2181 TALLOC_CTX *mem_ctx;
2183 if (state->out_mem_ctx) {
2184 mem_ctx = state->out_mem_ctx;
2185 } else {
2186 mem_ctx = state;
2189 status = state->dispatch_recv(subreq, mem_ctx);
2190 TALLOC_FREE(subreq);
2191 if (!NT_STATUS_IS_OK(status)) {
2192 tevent_req_nterror(req, status);
2193 return;
2196 /* Copy out parameters */
2198 /* Copy result */
2199 state->orig.out.result = state->tmp.out.result;
2201 /* Reset temporary structure */
2202 ZERO_STRUCT(state->tmp);
2204 tevent_req_done(req);
2207 NTSTATUS rpccli_dfs_ManagerInitialize_recv(struct tevent_req *req,
2208 TALLOC_CTX *mem_ctx,
2209 WERROR *result)
2211 struct rpccli_dfs_ManagerInitialize_state *state = tevent_req_data(
2212 req, struct rpccli_dfs_ManagerInitialize_state);
2213 NTSTATUS status;
2215 if (tevent_req_is_nterror(req, &status)) {
2216 tevent_req_received(req);
2217 return status;
2220 /* Steal possbile out parameters to the callers context */
2221 talloc_steal(mem_ctx, state->out_mem_ctx);
2223 /* Return result */
2224 *result = state->orig.out.result;
2226 tevent_req_received(req);
2227 return NT_STATUS_OK;
2230 NTSTATUS rpccli_dfs_ManagerInitialize(struct rpc_pipe_client *cli,
2231 TALLOC_CTX *mem_ctx,
2232 const char *servername /* [in] [ref,charset(UTF16)] */,
2233 uint32_t flags /* [in] */,
2234 WERROR *werror)
2236 struct dfs_ManagerInitialize r;
2237 NTSTATUS status;
2239 /* In parameters */
2240 r.in.servername = servername;
2241 r.in.flags = flags;
2243 status = cli->dispatch(cli,
2244 mem_ctx,
2245 &ndr_table_netdfs,
2246 NDR_DFS_MANAGERINITIALIZE,
2247 &r);
2249 if (!NT_STATUS_IS_OK(status)) {
2250 return status;
2253 if (NT_STATUS_IS_ERR(status)) {
2254 return status;
2257 /* Return variables */
2259 /* Return result */
2260 if (werror) {
2261 *werror = r.out.result;
2264 return werror_to_ntstatus(r.out.result);
2267 struct rpccli_dfs_AddStdRootForced_state {
2268 struct dfs_AddStdRootForced orig;
2269 struct dfs_AddStdRootForced tmp;
2270 TALLOC_CTX *out_mem_ctx;
2271 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2274 static void rpccli_dfs_AddStdRootForced_done(struct tevent_req *subreq);
2276 struct tevent_req *rpccli_dfs_AddStdRootForced_send(TALLOC_CTX *mem_ctx,
2277 struct tevent_context *ev,
2278 struct rpc_pipe_client *cli,
2279 const char *_servername /* [in] [charset(UTF16)] */,
2280 const char *_rootshare /* [in] [charset(UTF16)] */,
2281 const char *_comment /* [in] [charset(UTF16)] */,
2282 const char *_store /* [in] [charset(UTF16)] */)
2284 struct tevent_req *req;
2285 struct rpccli_dfs_AddStdRootForced_state *state;
2286 struct tevent_req *subreq;
2288 req = tevent_req_create(mem_ctx, &state,
2289 struct rpccli_dfs_AddStdRootForced_state);
2290 if (req == NULL) {
2291 return NULL;
2293 state->out_mem_ctx = NULL;
2294 state->dispatch_recv = cli->dispatch_recv;
2296 /* In parameters */
2297 state->orig.in.servername = _servername;
2298 state->orig.in.rootshare = _rootshare;
2299 state->orig.in.comment = _comment;
2300 state->orig.in.store = _store;
2302 /* Out parameters */
2304 /* Result */
2305 ZERO_STRUCT(state->orig.out.result);
2307 /* make a temporary copy, that we pass to the dispatch function */
2308 state->tmp = state->orig;
2310 subreq = cli->dispatch_send(state, ev, cli,
2311 &ndr_table_netdfs,
2312 NDR_DFS_ADDSTDROOTFORCED,
2313 &state->tmp);
2314 if (tevent_req_nomem(subreq, req)) {
2315 return tevent_req_post(req, ev);
2317 tevent_req_set_callback(subreq, rpccli_dfs_AddStdRootForced_done, req);
2318 return req;
2321 static void rpccli_dfs_AddStdRootForced_done(struct tevent_req *subreq)
2323 struct tevent_req *req = tevent_req_callback_data(
2324 subreq, struct tevent_req);
2325 struct rpccli_dfs_AddStdRootForced_state *state = tevent_req_data(
2326 req, struct rpccli_dfs_AddStdRootForced_state);
2327 NTSTATUS status;
2328 TALLOC_CTX *mem_ctx;
2330 if (state->out_mem_ctx) {
2331 mem_ctx = state->out_mem_ctx;
2332 } else {
2333 mem_ctx = state;
2336 status = state->dispatch_recv(subreq, mem_ctx);
2337 TALLOC_FREE(subreq);
2338 if (!NT_STATUS_IS_OK(status)) {
2339 tevent_req_nterror(req, status);
2340 return;
2343 /* Copy out parameters */
2345 /* Copy result */
2346 state->orig.out.result = state->tmp.out.result;
2348 /* Reset temporary structure */
2349 ZERO_STRUCT(state->tmp);
2351 tevent_req_done(req);
2354 NTSTATUS rpccli_dfs_AddStdRootForced_recv(struct tevent_req *req,
2355 TALLOC_CTX *mem_ctx,
2356 WERROR *result)
2358 struct rpccli_dfs_AddStdRootForced_state *state = tevent_req_data(
2359 req, struct rpccli_dfs_AddStdRootForced_state);
2360 NTSTATUS status;
2362 if (tevent_req_is_nterror(req, &status)) {
2363 tevent_req_received(req);
2364 return status;
2367 /* Steal possbile out parameters to the callers context */
2368 talloc_steal(mem_ctx, state->out_mem_ctx);
2370 /* Return result */
2371 *result = state->orig.out.result;
2373 tevent_req_received(req);
2374 return NT_STATUS_OK;
2377 NTSTATUS rpccli_dfs_AddStdRootForced(struct rpc_pipe_client *cli,
2378 TALLOC_CTX *mem_ctx,
2379 const char *servername /* [in] [charset(UTF16)] */,
2380 const char *rootshare /* [in] [charset(UTF16)] */,
2381 const char *comment /* [in] [charset(UTF16)] */,
2382 const char *store /* [in] [charset(UTF16)] */,
2383 WERROR *werror)
2385 struct dfs_AddStdRootForced r;
2386 NTSTATUS status;
2388 /* In parameters */
2389 r.in.servername = servername;
2390 r.in.rootshare = rootshare;
2391 r.in.comment = comment;
2392 r.in.store = store;
2394 status = cli->dispatch(cli,
2395 mem_ctx,
2396 &ndr_table_netdfs,
2397 NDR_DFS_ADDSTDROOTFORCED,
2398 &r);
2400 if (!NT_STATUS_IS_OK(status)) {
2401 return status;
2404 if (NT_STATUS_IS_ERR(status)) {
2405 return status;
2408 /* Return variables */
2410 /* Return result */
2411 if (werror) {
2412 *werror = r.out.result;
2415 return werror_to_ntstatus(r.out.result);
2418 struct rpccli_dfs_GetDcAddress_state {
2419 struct dfs_GetDcAddress orig;
2420 struct dfs_GetDcAddress tmp;
2421 TALLOC_CTX *out_mem_ctx;
2422 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2425 static void rpccli_dfs_GetDcAddress_done(struct tevent_req *subreq);
2427 struct tevent_req *rpccli_dfs_GetDcAddress_send(TALLOC_CTX *mem_ctx,
2428 struct tevent_context *ev,
2429 struct rpc_pipe_client *cli,
2430 const char *_servername /* [in] [charset(UTF16)] */,
2431 const char **_server_fullname /* [in,out] [ref,charset(UTF16)] */,
2432 uint8_t *_is_root /* [in,out] [ref] */,
2433 uint32_t *_ttl /* [in,out] [ref] */)
2435 struct tevent_req *req;
2436 struct rpccli_dfs_GetDcAddress_state *state;
2437 struct tevent_req *subreq;
2439 req = tevent_req_create(mem_ctx, &state,
2440 struct rpccli_dfs_GetDcAddress_state);
2441 if (req == NULL) {
2442 return NULL;
2444 state->out_mem_ctx = NULL;
2445 state->dispatch_recv = cli->dispatch_recv;
2447 /* In parameters */
2448 state->orig.in.servername = _servername;
2449 state->orig.in.server_fullname = _server_fullname;
2450 state->orig.in.is_root = _is_root;
2451 state->orig.in.ttl = _ttl;
2453 /* Out parameters */
2454 state->orig.out.server_fullname = _server_fullname;
2455 state->orig.out.is_root = _is_root;
2456 state->orig.out.ttl = _ttl;
2458 /* Result */
2459 ZERO_STRUCT(state->orig.out.result);
2461 state->out_mem_ctx = talloc_named_const(state, 0,
2462 "rpccli_dfs_GetDcAddress_out_memory");
2463 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2464 return tevent_req_post(req, ev);
2467 /* make a temporary copy, that we pass to the dispatch function */
2468 state->tmp = state->orig;
2470 subreq = cli->dispatch_send(state, ev, cli,
2471 &ndr_table_netdfs,
2472 NDR_DFS_GETDCADDRESS,
2473 &state->tmp);
2474 if (tevent_req_nomem(subreq, req)) {
2475 return tevent_req_post(req, ev);
2477 tevent_req_set_callback(subreq, rpccli_dfs_GetDcAddress_done, req);
2478 return req;
2481 static void rpccli_dfs_GetDcAddress_done(struct tevent_req *subreq)
2483 struct tevent_req *req = tevent_req_callback_data(
2484 subreq, struct tevent_req);
2485 struct rpccli_dfs_GetDcAddress_state *state = tevent_req_data(
2486 req, struct rpccli_dfs_GetDcAddress_state);
2487 NTSTATUS status;
2488 TALLOC_CTX *mem_ctx;
2490 if (state->out_mem_ctx) {
2491 mem_ctx = state->out_mem_ctx;
2492 } else {
2493 mem_ctx = state;
2496 status = state->dispatch_recv(subreq, mem_ctx);
2497 TALLOC_FREE(subreq);
2498 if (!NT_STATUS_IS_OK(status)) {
2499 tevent_req_nterror(req, status);
2500 return;
2503 /* Copy out parameters */
2504 *state->orig.out.server_fullname = *state->tmp.out.server_fullname;
2505 *state->orig.out.is_root = *state->tmp.out.is_root;
2506 *state->orig.out.ttl = *state->tmp.out.ttl;
2508 /* Copy result */
2509 state->orig.out.result = state->tmp.out.result;
2511 /* Reset temporary structure */
2512 ZERO_STRUCT(state->tmp);
2514 tevent_req_done(req);
2517 NTSTATUS rpccli_dfs_GetDcAddress_recv(struct tevent_req *req,
2518 TALLOC_CTX *mem_ctx,
2519 WERROR *result)
2521 struct rpccli_dfs_GetDcAddress_state *state = tevent_req_data(
2522 req, struct rpccli_dfs_GetDcAddress_state);
2523 NTSTATUS status;
2525 if (tevent_req_is_nterror(req, &status)) {
2526 tevent_req_received(req);
2527 return status;
2530 /* Steal possbile out parameters to the callers context */
2531 talloc_steal(mem_ctx, state->out_mem_ctx);
2533 /* Return result */
2534 *result = state->orig.out.result;
2536 tevent_req_received(req);
2537 return NT_STATUS_OK;
2540 NTSTATUS rpccli_dfs_GetDcAddress(struct rpc_pipe_client *cli,
2541 TALLOC_CTX *mem_ctx,
2542 const char *servername /* [in] [charset(UTF16)] */,
2543 const char **server_fullname /* [in,out] [ref,charset(UTF16)] */,
2544 uint8_t *is_root /* [in,out] [ref] */,
2545 uint32_t *ttl /* [in,out] [ref] */,
2546 WERROR *werror)
2548 struct dfs_GetDcAddress r;
2549 NTSTATUS status;
2551 /* In parameters */
2552 r.in.servername = servername;
2553 r.in.server_fullname = server_fullname;
2554 r.in.is_root = is_root;
2555 r.in.ttl = ttl;
2557 status = cli->dispatch(cli,
2558 mem_ctx,
2559 &ndr_table_netdfs,
2560 NDR_DFS_GETDCADDRESS,
2561 &r);
2563 if (!NT_STATUS_IS_OK(status)) {
2564 return status;
2567 if (NT_STATUS_IS_ERR(status)) {
2568 return status;
2571 /* Return variables */
2572 *server_fullname = *r.out.server_fullname;
2573 *is_root = *r.out.is_root;
2574 *ttl = *r.out.ttl;
2576 /* Return result */
2577 if (werror) {
2578 *werror = r.out.result;
2581 return werror_to_ntstatus(r.out.result);
2584 struct rpccli_dfs_SetDcAddress_state {
2585 struct dfs_SetDcAddress orig;
2586 struct dfs_SetDcAddress tmp;
2587 TALLOC_CTX *out_mem_ctx;
2588 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2591 static void rpccli_dfs_SetDcAddress_done(struct tevent_req *subreq);
2593 struct tevent_req *rpccli_dfs_SetDcAddress_send(TALLOC_CTX *mem_ctx,
2594 struct tevent_context *ev,
2595 struct rpc_pipe_client *cli,
2596 const char *_servername /* [in] [charset(UTF16)] */,
2597 const char *_server_fullname /* [in] [charset(UTF16)] */,
2598 uint32_t _flags /* [in] */,
2599 uint32_t _ttl /* [in] */)
2601 struct tevent_req *req;
2602 struct rpccli_dfs_SetDcAddress_state *state;
2603 struct tevent_req *subreq;
2605 req = tevent_req_create(mem_ctx, &state,
2606 struct rpccli_dfs_SetDcAddress_state);
2607 if (req == NULL) {
2608 return NULL;
2610 state->out_mem_ctx = NULL;
2611 state->dispatch_recv = cli->dispatch_recv;
2613 /* In parameters */
2614 state->orig.in.servername = _servername;
2615 state->orig.in.server_fullname = _server_fullname;
2616 state->orig.in.flags = _flags;
2617 state->orig.in.ttl = _ttl;
2619 /* Out parameters */
2621 /* Result */
2622 ZERO_STRUCT(state->orig.out.result);
2624 /* make a temporary copy, that we pass to the dispatch function */
2625 state->tmp = state->orig;
2627 subreq = cli->dispatch_send(state, ev, cli,
2628 &ndr_table_netdfs,
2629 NDR_DFS_SETDCADDRESS,
2630 &state->tmp);
2631 if (tevent_req_nomem(subreq, req)) {
2632 return tevent_req_post(req, ev);
2634 tevent_req_set_callback(subreq, rpccli_dfs_SetDcAddress_done, req);
2635 return req;
2638 static void rpccli_dfs_SetDcAddress_done(struct tevent_req *subreq)
2640 struct tevent_req *req = tevent_req_callback_data(
2641 subreq, struct tevent_req);
2642 struct rpccli_dfs_SetDcAddress_state *state = tevent_req_data(
2643 req, struct rpccli_dfs_SetDcAddress_state);
2644 NTSTATUS status;
2645 TALLOC_CTX *mem_ctx;
2647 if (state->out_mem_ctx) {
2648 mem_ctx = state->out_mem_ctx;
2649 } else {
2650 mem_ctx = state;
2653 status = state->dispatch_recv(subreq, mem_ctx);
2654 TALLOC_FREE(subreq);
2655 if (!NT_STATUS_IS_OK(status)) {
2656 tevent_req_nterror(req, status);
2657 return;
2660 /* Copy out parameters */
2662 /* Copy result */
2663 state->orig.out.result = state->tmp.out.result;
2665 /* Reset temporary structure */
2666 ZERO_STRUCT(state->tmp);
2668 tevent_req_done(req);
2671 NTSTATUS rpccli_dfs_SetDcAddress_recv(struct tevent_req *req,
2672 TALLOC_CTX *mem_ctx,
2673 WERROR *result)
2675 struct rpccli_dfs_SetDcAddress_state *state = tevent_req_data(
2676 req, struct rpccli_dfs_SetDcAddress_state);
2677 NTSTATUS status;
2679 if (tevent_req_is_nterror(req, &status)) {
2680 tevent_req_received(req);
2681 return status;
2684 /* Steal possbile out parameters to the callers context */
2685 talloc_steal(mem_ctx, state->out_mem_ctx);
2687 /* Return result */
2688 *result = state->orig.out.result;
2690 tevent_req_received(req);
2691 return NT_STATUS_OK;
2694 NTSTATUS rpccli_dfs_SetDcAddress(struct rpc_pipe_client *cli,
2695 TALLOC_CTX *mem_ctx,
2696 const char *servername /* [in] [charset(UTF16)] */,
2697 const char *server_fullname /* [in] [charset(UTF16)] */,
2698 uint32_t flags /* [in] */,
2699 uint32_t ttl /* [in] */,
2700 WERROR *werror)
2702 struct dfs_SetDcAddress r;
2703 NTSTATUS status;
2705 /* In parameters */
2706 r.in.servername = servername;
2707 r.in.server_fullname = server_fullname;
2708 r.in.flags = flags;
2709 r.in.ttl = ttl;
2711 status = cli->dispatch(cli,
2712 mem_ctx,
2713 &ndr_table_netdfs,
2714 NDR_DFS_SETDCADDRESS,
2715 &r);
2717 if (!NT_STATUS_IS_OK(status)) {
2718 return status;
2721 if (NT_STATUS_IS_ERR(status)) {
2722 return status;
2725 /* Return variables */
2727 /* Return result */
2728 if (werror) {
2729 *werror = r.out.result;
2732 return werror_to_ntstatus(r.out.result);
2735 struct rpccli_dfs_FlushFtTable_state {
2736 struct dfs_FlushFtTable orig;
2737 struct dfs_FlushFtTable tmp;
2738 TALLOC_CTX *out_mem_ctx;
2739 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2742 static void rpccli_dfs_FlushFtTable_done(struct tevent_req *subreq);
2744 struct tevent_req *rpccli_dfs_FlushFtTable_send(TALLOC_CTX *mem_ctx,
2745 struct tevent_context *ev,
2746 struct rpc_pipe_client *cli,
2747 const char *_servername /* [in] [charset(UTF16)] */,
2748 const char *_rootshare /* [in] [charset(UTF16)] */)
2750 struct tevent_req *req;
2751 struct rpccli_dfs_FlushFtTable_state *state;
2752 struct tevent_req *subreq;
2754 req = tevent_req_create(mem_ctx, &state,
2755 struct rpccli_dfs_FlushFtTable_state);
2756 if (req == NULL) {
2757 return NULL;
2759 state->out_mem_ctx = NULL;
2760 state->dispatch_recv = cli->dispatch_recv;
2762 /* In parameters */
2763 state->orig.in.servername = _servername;
2764 state->orig.in.rootshare = _rootshare;
2766 /* Out parameters */
2768 /* Result */
2769 ZERO_STRUCT(state->orig.out.result);
2771 /* make a temporary copy, that we pass to the dispatch function */
2772 state->tmp = state->orig;
2774 subreq = cli->dispatch_send(state, ev, cli,
2775 &ndr_table_netdfs,
2776 NDR_DFS_FLUSHFTTABLE,
2777 &state->tmp);
2778 if (tevent_req_nomem(subreq, req)) {
2779 return tevent_req_post(req, ev);
2781 tevent_req_set_callback(subreq, rpccli_dfs_FlushFtTable_done, req);
2782 return req;
2785 static void rpccli_dfs_FlushFtTable_done(struct tevent_req *subreq)
2787 struct tevent_req *req = tevent_req_callback_data(
2788 subreq, struct tevent_req);
2789 struct rpccli_dfs_FlushFtTable_state *state = tevent_req_data(
2790 req, struct rpccli_dfs_FlushFtTable_state);
2791 NTSTATUS status;
2792 TALLOC_CTX *mem_ctx;
2794 if (state->out_mem_ctx) {
2795 mem_ctx = state->out_mem_ctx;
2796 } else {
2797 mem_ctx = state;
2800 status = state->dispatch_recv(subreq, mem_ctx);
2801 TALLOC_FREE(subreq);
2802 if (!NT_STATUS_IS_OK(status)) {
2803 tevent_req_nterror(req, status);
2804 return;
2807 /* Copy out parameters */
2809 /* Copy result */
2810 state->orig.out.result = state->tmp.out.result;
2812 /* Reset temporary structure */
2813 ZERO_STRUCT(state->tmp);
2815 tevent_req_done(req);
2818 NTSTATUS rpccli_dfs_FlushFtTable_recv(struct tevent_req *req,
2819 TALLOC_CTX *mem_ctx,
2820 WERROR *result)
2822 struct rpccli_dfs_FlushFtTable_state *state = tevent_req_data(
2823 req, struct rpccli_dfs_FlushFtTable_state);
2824 NTSTATUS status;
2826 if (tevent_req_is_nterror(req, &status)) {
2827 tevent_req_received(req);
2828 return status;
2831 /* Steal possbile out parameters to the callers context */
2832 talloc_steal(mem_ctx, state->out_mem_ctx);
2834 /* Return result */
2835 *result = state->orig.out.result;
2837 tevent_req_received(req);
2838 return NT_STATUS_OK;
2841 NTSTATUS rpccli_dfs_FlushFtTable(struct rpc_pipe_client *cli,
2842 TALLOC_CTX *mem_ctx,
2843 const char *servername /* [in] [charset(UTF16)] */,
2844 const char *rootshare /* [in] [charset(UTF16)] */,
2845 WERROR *werror)
2847 struct dfs_FlushFtTable r;
2848 NTSTATUS status;
2850 /* In parameters */
2851 r.in.servername = servername;
2852 r.in.rootshare = rootshare;
2854 status = cli->dispatch(cli,
2855 mem_ctx,
2856 &ndr_table_netdfs,
2857 NDR_DFS_FLUSHFTTABLE,
2858 &r);
2860 if (!NT_STATUS_IS_OK(status)) {
2861 return status;
2864 if (NT_STATUS_IS_ERR(status)) {
2865 return status;
2868 /* Return variables */
2870 /* Return result */
2871 if (werror) {
2872 *werror = r.out.result;
2875 return werror_to_ntstatus(r.out.result);
2878 struct rpccli_dfs_Add2_state {
2879 struct dfs_Add2 orig;
2880 struct dfs_Add2 tmp;
2881 TALLOC_CTX *out_mem_ctx;
2882 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2885 static void rpccli_dfs_Add2_done(struct tevent_req *subreq);
2887 struct tevent_req *rpccli_dfs_Add2_send(TALLOC_CTX *mem_ctx,
2888 struct tevent_context *ev,
2889 struct rpc_pipe_client *cli)
2891 struct tevent_req *req;
2892 struct rpccli_dfs_Add2_state *state;
2893 struct tevent_req *subreq;
2895 req = tevent_req_create(mem_ctx, &state,
2896 struct rpccli_dfs_Add2_state);
2897 if (req == NULL) {
2898 return NULL;
2900 state->out_mem_ctx = NULL;
2901 state->dispatch_recv = cli->dispatch_recv;
2903 /* In parameters */
2905 /* Out parameters */
2907 /* Result */
2908 ZERO_STRUCT(state->orig.out.result);
2910 /* make a temporary copy, that we pass to the dispatch function */
2911 state->tmp = state->orig;
2913 subreq = cli->dispatch_send(state, ev, cli,
2914 &ndr_table_netdfs,
2915 NDR_DFS_ADD2,
2916 &state->tmp);
2917 if (tevent_req_nomem(subreq, req)) {
2918 return tevent_req_post(req, ev);
2920 tevent_req_set_callback(subreq, rpccli_dfs_Add2_done, req);
2921 return req;
2924 static void rpccli_dfs_Add2_done(struct tevent_req *subreq)
2926 struct tevent_req *req = tevent_req_callback_data(
2927 subreq, struct tevent_req);
2928 struct rpccli_dfs_Add2_state *state = tevent_req_data(
2929 req, struct rpccli_dfs_Add2_state);
2930 NTSTATUS status;
2931 TALLOC_CTX *mem_ctx;
2933 if (state->out_mem_ctx) {
2934 mem_ctx = state->out_mem_ctx;
2935 } else {
2936 mem_ctx = state;
2939 status = state->dispatch_recv(subreq, mem_ctx);
2940 TALLOC_FREE(subreq);
2941 if (!NT_STATUS_IS_OK(status)) {
2942 tevent_req_nterror(req, status);
2943 return;
2946 /* Copy out parameters */
2948 /* Copy result */
2949 state->orig.out.result = state->tmp.out.result;
2951 /* Reset temporary structure */
2952 ZERO_STRUCT(state->tmp);
2954 tevent_req_done(req);
2957 NTSTATUS rpccli_dfs_Add2_recv(struct tevent_req *req,
2958 TALLOC_CTX *mem_ctx,
2959 WERROR *result)
2961 struct rpccli_dfs_Add2_state *state = tevent_req_data(
2962 req, struct rpccli_dfs_Add2_state);
2963 NTSTATUS status;
2965 if (tevent_req_is_nterror(req, &status)) {
2966 tevent_req_received(req);
2967 return status;
2970 /* Steal possbile out parameters to the callers context */
2971 talloc_steal(mem_ctx, state->out_mem_ctx);
2973 /* Return result */
2974 *result = state->orig.out.result;
2976 tevent_req_received(req);
2977 return NT_STATUS_OK;
2980 NTSTATUS rpccli_dfs_Add2(struct rpc_pipe_client *cli,
2981 TALLOC_CTX *mem_ctx,
2982 WERROR *werror)
2984 struct dfs_Add2 r;
2985 NTSTATUS status;
2987 /* In parameters */
2989 status = cli->dispatch(cli,
2990 mem_ctx,
2991 &ndr_table_netdfs,
2992 NDR_DFS_ADD2,
2993 &r);
2995 if (!NT_STATUS_IS_OK(status)) {
2996 return status;
2999 if (NT_STATUS_IS_ERR(status)) {
3000 return status;
3003 /* Return variables */
3005 /* Return result */
3006 if (werror) {
3007 *werror = r.out.result;
3010 return werror_to_ntstatus(r.out.result);
3013 struct rpccli_dfs_Remove2_state {
3014 struct dfs_Remove2 orig;
3015 struct dfs_Remove2 tmp;
3016 TALLOC_CTX *out_mem_ctx;
3017 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3020 static void rpccli_dfs_Remove2_done(struct tevent_req *subreq);
3022 struct tevent_req *rpccli_dfs_Remove2_send(TALLOC_CTX *mem_ctx,
3023 struct tevent_context *ev,
3024 struct rpc_pipe_client *cli)
3026 struct tevent_req *req;
3027 struct rpccli_dfs_Remove2_state *state;
3028 struct tevent_req *subreq;
3030 req = tevent_req_create(mem_ctx, &state,
3031 struct rpccli_dfs_Remove2_state);
3032 if (req == NULL) {
3033 return NULL;
3035 state->out_mem_ctx = NULL;
3036 state->dispatch_recv = cli->dispatch_recv;
3038 /* In parameters */
3040 /* Out parameters */
3042 /* Result */
3043 ZERO_STRUCT(state->orig.out.result);
3045 /* make a temporary copy, that we pass to the dispatch function */
3046 state->tmp = state->orig;
3048 subreq = cli->dispatch_send(state, ev, cli,
3049 &ndr_table_netdfs,
3050 NDR_DFS_REMOVE2,
3051 &state->tmp);
3052 if (tevent_req_nomem(subreq, req)) {
3053 return tevent_req_post(req, ev);
3055 tevent_req_set_callback(subreq, rpccli_dfs_Remove2_done, req);
3056 return req;
3059 static void rpccli_dfs_Remove2_done(struct tevent_req *subreq)
3061 struct tevent_req *req = tevent_req_callback_data(
3062 subreq, struct tevent_req);
3063 struct rpccli_dfs_Remove2_state *state = tevent_req_data(
3064 req, struct rpccli_dfs_Remove2_state);
3065 NTSTATUS status;
3066 TALLOC_CTX *mem_ctx;
3068 if (state->out_mem_ctx) {
3069 mem_ctx = state->out_mem_ctx;
3070 } else {
3071 mem_ctx = state;
3074 status = state->dispatch_recv(subreq, mem_ctx);
3075 TALLOC_FREE(subreq);
3076 if (!NT_STATUS_IS_OK(status)) {
3077 tevent_req_nterror(req, status);
3078 return;
3081 /* Copy out parameters */
3083 /* Copy result */
3084 state->orig.out.result = state->tmp.out.result;
3086 /* Reset temporary structure */
3087 ZERO_STRUCT(state->tmp);
3089 tevent_req_done(req);
3092 NTSTATUS rpccli_dfs_Remove2_recv(struct tevent_req *req,
3093 TALLOC_CTX *mem_ctx,
3094 WERROR *result)
3096 struct rpccli_dfs_Remove2_state *state = tevent_req_data(
3097 req, struct rpccli_dfs_Remove2_state);
3098 NTSTATUS status;
3100 if (tevent_req_is_nterror(req, &status)) {
3101 tevent_req_received(req);
3102 return status;
3105 /* Steal possbile out parameters to the callers context */
3106 talloc_steal(mem_ctx, state->out_mem_ctx);
3108 /* Return result */
3109 *result = state->orig.out.result;
3111 tevent_req_received(req);
3112 return NT_STATUS_OK;
3115 NTSTATUS rpccli_dfs_Remove2(struct rpc_pipe_client *cli,
3116 TALLOC_CTX *mem_ctx,
3117 WERROR *werror)
3119 struct dfs_Remove2 r;
3120 NTSTATUS status;
3122 /* In parameters */
3124 status = cli->dispatch(cli,
3125 mem_ctx,
3126 &ndr_table_netdfs,
3127 NDR_DFS_REMOVE2,
3128 &r);
3130 if (!NT_STATUS_IS_OK(status)) {
3131 return status;
3134 if (NT_STATUS_IS_ERR(status)) {
3135 return status;
3138 /* Return variables */
3140 /* Return result */
3141 if (werror) {
3142 *werror = r.out.result;
3145 return werror_to_ntstatus(r.out.result);
3148 struct rpccli_dfs_EnumEx_state {
3149 struct dfs_EnumEx orig;
3150 struct dfs_EnumEx tmp;
3151 TALLOC_CTX *out_mem_ctx;
3152 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3155 static void rpccli_dfs_EnumEx_done(struct tevent_req *subreq);
3157 struct tevent_req *rpccli_dfs_EnumEx_send(TALLOC_CTX *mem_ctx,
3158 struct tevent_context *ev,
3159 struct rpc_pipe_client *cli,
3160 const char *_dfs_name /* [in] [charset(UTF16)] */,
3161 uint32_t _level /* [in] */,
3162 uint32_t _bufsize /* [in] */,
3163 struct dfs_EnumStruct *_info /* [in,out] [unique] */,
3164 uint32_t *_total /* [in,out] [unique] */)
3166 struct tevent_req *req;
3167 struct rpccli_dfs_EnumEx_state *state;
3168 struct tevent_req *subreq;
3170 req = tevent_req_create(mem_ctx, &state,
3171 struct rpccli_dfs_EnumEx_state);
3172 if (req == NULL) {
3173 return NULL;
3175 state->out_mem_ctx = NULL;
3176 state->dispatch_recv = cli->dispatch_recv;
3178 /* In parameters */
3179 state->orig.in.dfs_name = _dfs_name;
3180 state->orig.in.level = _level;
3181 state->orig.in.bufsize = _bufsize;
3182 state->orig.in.info = _info;
3183 state->orig.in.total = _total;
3185 /* Out parameters */
3186 state->orig.out.info = _info;
3187 state->orig.out.total = _total;
3189 /* Result */
3190 ZERO_STRUCT(state->orig.out.result);
3192 state->out_mem_ctx = talloc_named_const(state, 0,
3193 "rpccli_dfs_EnumEx_out_memory");
3194 if (tevent_req_nomem(state->out_mem_ctx, req)) {
3195 return tevent_req_post(req, ev);
3198 /* make a temporary copy, that we pass to the dispatch function */
3199 state->tmp = state->orig;
3201 subreq = cli->dispatch_send(state, ev, cli,
3202 &ndr_table_netdfs,
3203 NDR_DFS_ENUMEX,
3204 &state->tmp);
3205 if (tevent_req_nomem(subreq, req)) {
3206 return tevent_req_post(req, ev);
3208 tevent_req_set_callback(subreq, rpccli_dfs_EnumEx_done, req);
3209 return req;
3212 static void rpccli_dfs_EnumEx_done(struct tevent_req *subreq)
3214 struct tevent_req *req = tevent_req_callback_data(
3215 subreq, struct tevent_req);
3216 struct rpccli_dfs_EnumEx_state *state = tevent_req_data(
3217 req, struct rpccli_dfs_EnumEx_state);
3218 NTSTATUS status;
3219 TALLOC_CTX *mem_ctx;
3221 if (state->out_mem_ctx) {
3222 mem_ctx = state->out_mem_ctx;
3223 } else {
3224 mem_ctx = state;
3227 status = state->dispatch_recv(subreq, mem_ctx);
3228 TALLOC_FREE(subreq);
3229 if (!NT_STATUS_IS_OK(status)) {
3230 tevent_req_nterror(req, status);
3231 return;
3234 /* Copy out parameters */
3235 if (state->orig.out.info && state->tmp.out.info) {
3236 *state->orig.out.info = *state->tmp.out.info;
3238 if (state->orig.out.total && state->tmp.out.total) {
3239 *state->orig.out.total = *state->tmp.out.total;
3242 /* Copy result */
3243 state->orig.out.result = state->tmp.out.result;
3245 /* Reset temporary structure */
3246 ZERO_STRUCT(state->tmp);
3248 tevent_req_done(req);
3251 NTSTATUS rpccli_dfs_EnumEx_recv(struct tevent_req *req,
3252 TALLOC_CTX *mem_ctx,
3253 WERROR *result)
3255 struct rpccli_dfs_EnumEx_state *state = tevent_req_data(
3256 req, struct rpccli_dfs_EnumEx_state);
3257 NTSTATUS status;
3259 if (tevent_req_is_nterror(req, &status)) {
3260 tevent_req_received(req);
3261 return status;
3264 /* Steal possbile out parameters to the callers context */
3265 talloc_steal(mem_ctx, state->out_mem_ctx);
3267 /* Return result */
3268 *result = state->orig.out.result;
3270 tevent_req_received(req);
3271 return NT_STATUS_OK;
3274 NTSTATUS rpccli_dfs_EnumEx(struct rpc_pipe_client *cli,
3275 TALLOC_CTX *mem_ctx,
3276 const char *dfs_name /* [in] [charset(UTF16)] */,
3277 uint32_t level /* [in] */,
3278 uint32_t bufsize /* [in] */,
3279 struct dfs_EnumStruct *info /* [in,out] [unique] */,
3280 uint32_t *total /* [in,out] [unique] */,
3281 WERROR *werror)
3283 struct dfs_EnumEx r;
3284 NTSTATUS status;
3286 /* In parameters */
3287 r.in.dfs_name = dfs_name;
3288 r.in.level = level;
3289 r.in.bufsize = bufsize;
3290 r.in.info = info;
3291 r.in.total = total;
3293 status = cli->dispatch(cli,
3294 mem_ctx,
3295 &ndr_table_netdfs,
3296 NDR_DFS_ENUMEX,
3297 &r);
3299 if (!NT_STATUS_IS_OK(status)) {
3300 return status;
3303 if (NT_STATUS_IS_ERR(status)) {
3304 return status;
3307 /* Return variables */
3308 if (info && r.out.info) {
3309 *info = *r.out.info;
3311 if (total && r.out.total) {
3312 *total = *r.out.total;
3315 /* Return result */
3316 if (werror) {
3317 *werror = r.out.result;
3320 return werror_to_ntstatus(r.out.result);
3323 struct rpccli_dfs_SetInfo2_state {
3324 struct dfs_SetInfo2 orig;
3325 struct dfs_SetInfo2 tmp;
3326 TALLOC_CTX *out_mem_ctx;
3327 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3330 static void rpccli_dfs_SetInfo2_done(struct tevent_req *subreq);
3332 struct tevent_req *rpccli_dfs_SetInfo2_send(TALLOC_CTX *mem_ctx,
3333 struct tevent_context *ev,
3334 struct rpc_pipe_client *cli)
3336 struct tevent_req *req;
3337 struct rpccli_dfs_SetInfo2_state *state;
3338 struct tevent_req *subreq;
3340 req = tevent_req_create(mem_ctx, &state,
3341 struct rpccli_dfs_SetInfo2_state);
3342 if (req == NULL) {
3343 return NULL;
3345 state->out_mem_ctx = NULL;
3346 state->dispatch_recv = cli->dispatch_recv;
3348 /* In parameters */
3350 /* Out parameters */
3352 /* Result */
3353 ZERO_STRUCT(state->orig.out.result);
3355 /* make a temporary copy, that we pass to the dispatch function */
3356 state->tmp = state->orig;
3358 subreq = cli->dispatch_send(state, ev, cli,
3359 &ndr_table_netdfs,
3360 NDR_DFS_SETINFO2,
3361 &state->tmp);
3362 if (tevent_req_nomem(subreq, req)) {
3363 return tevent_req_post(req, ev);
3365 tevent_req_set_callback(subreq, rpccli_dfs_SetInfo2_done, req);
3366 return req;
3369 static void rpccli_dfs_SetInfo2_done(struct tevent_req *subreq)
3371 struct tevent_req *req = tevent_req_callback_data(
3372 subreq, struct tevent_req);
3373 struct rpccli_dfs_SetInfo2_state *state = tevent_req_data(
3374 req, struct rpccli_dfs_SetInfo2_state);
3375 NTSTATUS status;
3376 TALLOC_CTX *mem_ctx;
3378 if (state->out_mem_ctx) {
3379 mem_ctx = state->out_mem_ctx;
3380 } else {
3381 mem_ctx = state;
3384 status = state->dispatch_recv(subreq, mem_ctx);
3385 TALLOC_FREE(subreq);
3386 if (!NT_STATUS_IS_OK(status)) {
3387 tevent_req_nterror(req, status);
3388 return;
3391 /* Copy out parameters */
3393 /* Copy result */
3394 state->orig.out.result = state->tmp.out.result;
3396 /* Reset temporary structure */
3397 ZERO_STRUCT(state->tmp);
3399 tevent_req_done(req);
3402 NTSTATUS rpccli_dfs_SetInfo2_recv(struct tevent_req *req,
3403 TALLOC_CTX *mem_ctx,
3404 WERROR *result)
3406 struct rpccli_dfs_SetInfo2_state *state = tevent_req_data(
3407 req, struct rpccli_dfs_SetInfo2_state);
3408 NTSTATUS status;
3410 if (tevent_req_is_nterror(req, &status)) {
3411 tevent_req_received(req);
3412 return status;
3415 /* Steal possbile out parameters to the callers context */
3416 talloc_steal(mem_ctx, state->out_mem_ctx);
3418 /* Return result */
3419 *result = state->orig.out.result;
3421 tevent_req_received(req);
3422 return NT_STATUS_OK;
3425 NTSTATUS rpccli_dfs_SetInfo2(struct rpc_pipe_client *cli,
3426 TALLOC_CTX *mem_ctx,
3427 WERROR *werror)
3429 struct dfs_SetInfo2 r;
3430 NTSTATUS status;
3432 /* In parameters */
3434 status = cli->dispatch(cli,
3435 mem_ctx,
3436 &ndr_table_netdfs,
3437 NDR_DFS_SETINFO2,
3438 &r);
3440 if (!NT_STATUS_IS_OK(status)) {
3441 return status;
3444 if (NT_STATUS_IS_ERR(status)) {
3445 return status;
3448 /* Return variables */
3450 /* Return result */
3451 if (werror) {
3452 *werror = r.out.result;
3455 return werror_to_ntstatus(r.out.result);