6ce5b5fcafb453f3aadc22ae3488597f7dc629e5
[ira/wip.git] / librpc / gen_ndr / cli_dfs.c
1 /*
2  * Unix SMB/CIFS implementation.
3  * client auto-generated by pidl. DO NOT MODIFY!
4  */
5
6 #include "includes.h"
7 #include "../librpc/gen_ndr/cli_dfs.h"
8
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);
14 };
15
16 static void rpccli_dfs_GetManagerVersion_done(struct tevent_req *subreq);
17
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] */)
22 {
23         struct tevent_req *req;
24         struct rpccli_dfs_GetManagerVersion_state *state;
25         struct tevent_req *subreq;
26
27         req = tevent_req_create(mem_ctx, &state,
28                                 struct rpccli_dfs_GetManagerVersion_state);
29         if (req == NULL) {
30                 return NULL;
31         }
32         state->out_mem_ctx = NULL;
33         state->dispatch_recv = cli->dispatch_recv;
34
35         /* In parameters */
36
37         /* Out parameters */
38         state->orig.out.version = _version;
39
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);
44         }
45
46         /* make a temporary copy, that we pass to the dispatch function */
47         state->tmp = state->orig;
48
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);
55         }
56         tevent_req_set_callback(subreq, rpccli_dfs_GetManagerVersion_done, req);
57         return req;
58 }
59
60 static void rpccli_dfs_GetManagerVersion_done(struct tevent_req *subreq)
61 {
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;
68
69         if (state->out_mem_ctx) {
70                 mem_ctx = state->out_mem_ctx;
71         } else {
72                 mem_ctx = state;
73         }
74
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;
80         }
81
82         /* Copy out parameters */
83         *state->orig.out.version = *state->tmp.out.version;
84
85         /* Reset temporary structure */
86         ZERO_STRUCT(state->tmp);
87
88         tevent_req_done(req);
89 }
90
91 NTSTATUS rpccli_dfs_GetManagerVersion_recv(struct tevent_req *req,
92                                            TALLOC_CTX *mem_ctx)
93 {
94         struct rpccli_dfs_GetManagerVersion_state *state = tevent_req_data(
95                 req, struct rpccli_dfs_GetManagerVersion_state);
96         NTSTATUS status;
97
98         if (tevent_req_is_nterror(req, &status)) {
99                 tevent_req_received(req);
100                 return status;
101         }
102
103         /* Steal possbile out parameters to the callers context */
104         talloc_steal(mem_ctx, state->out_mem_ctx);
105
106         tevent_req_received(req);
107         return NT_STATUS_OK;
108 }
109
110 NTSTATUS rpccli_dfs_GetManagerVersion(struct rpc_pipe_client *cli,
111                                       TALLOC_CTX *mem_ctx,
112                                       enum dfs_ManagerVersion *version /* [out] [ref] */)
113 {
114         struct dfs_GetManagerVersion r;
115         NTSTATUS status;
116
117         /* In parameters */
118
119         status = cli->dispatch(cli,
120                                 mem_ctx,
121                                 &ndr_table_netdfs,
122                                 NDR_DFS_GETMANAGERVERSION,
123                                 &r);
124
125         if (!NT_STATUS_IS_OK(status)) {
126                 return status;
127         }
128
129         if (NT_STATUS_IS_ERR(status)) {
130                 return status;
131         }
132
133         /* Return variables */
134         *version = *r.out.version;
135
136         /* Return result */
137         return NT_STATUS_OK;
138 }
139
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);
145 };
146
147 static void rpccli_dfs_Add_done(struct tevent_req *subreq);
148
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]  */)
157 {
158         struct tevent_req *req;
159         struct rpccli_dfs_Add_state *state;
160         struct tevent_req *subreq;
161
162         req = tevent_req_create(mem_ctx, &state,
163                                 struct rpccli_dfs_Add_state);
164         if (req == NULL) {
165                 return NULL;
166         }
167         state->out_mem_ctx = NULL;
168         state->dispatch_recv = cli->dispatch_recv;
169
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;
176
177         /* Out parameters */
178
179         /* Result */
180         ZERO_STRUCT(state->orig.out.result);
181
182         /* make a temporary copy, that we pass to the dispatch function */
183         state->tmp = state->orig;
184
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);
191         }
192         tevent_req_set_callback(subreq, rpccli_dfs_Add_done, req);
193         return req;
194 }
195
196 static void rpccli_dfs_Add_done(struct tevent_req *subreq)
197 {
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;
204
205         if (state->out_mem_ctx) {
206                 mem_ctx = state->out_mem_ctx;
207         } else {
208                 mem_ctx = state;
209         }
210
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;
216         }
217
218         /* Copy out parameters */
219
220         /* Copy result */
221         state->orig.out.result = state->tmp.out.result;
222
223         /* Reset temporary structure */
224         ZERO_STRUCT(state->tmp);
225
226         tevent_req_done(req);
227 }
228
229 NTSTATUS rpccli_dfs_Add_recv(struct tevent_req *req,
230                              TALLOC_CTX *mem_ctx,
231                              WERROR *result)
232 {
233         struct rpccli_dfs_Add_state *state = tevent_req_data(
234                 req, struct rpccli_dfs_Add_state);
235         NTSTATUS status;
236
237         if (tevent_req_is_nterror(req, &status)) {
238                 tevent_req_received(req);
239                 return status;
240         }
241
242         /* Steal possbile out parameters to the callers context */
243         talloc_steal(mem_ctx, state->out_mem_ctx);
244
245         /* Return result */
246         *result = state->orig.out.result;
247
248         tevent_req_received(req);
249         return NT_STATUS_OK;
250 }
251
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)
260 {
261         struct dfs_Add r;
262         NTSTATUS status;
263
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;
270
271         status = cli->dispatch(cli,
272                                 mem_ctx,
273                                 &ndr_table_netdfs,
274                                 NDR_DFS_ADD,
275                                 &r);
276
277         if (!NT_STATUS_IS_OK(status)) {
278                 return status;
279         }
280
281         if (NT_STATUS_IS_ERR(status)) {
282                 return status;
283         }
284
285         /* Return variables */
286
287         /* Return result */
288         if (werror) {
289                 *werror = r.out.result;
290         }
291
292         return werror_to_ntstatus(r.out.result);
293 }
294
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);
300 };
301
302 static void rpccli_dfs_Remove_done(struct tevent_req *subreq);
303
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)] */)
310 {
311         struct tevent_req *req;
312         struct rpccli_dfs_Remove_state *state;
313         struct tevent_req *subreq;
314
315         req = tevent_req_create(mem_ctx, &state,
316                                 struct rpccli_dfs_Remove_state);
317         if (req == NULL) {
318                 return NULL;
319         }
320         state->out_mem_ctx = NULL;
321         state->dispatch_recv = cli->dispatch_recv;
322
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;
327
328         /* Out parameters */
329
330         /* Result */
331         ZERO_STRUCT(state->orig.out.result);
332
333         /* make a temporary copy, that we pass to the dispatch function */
334         state->tmp = state->orig;
335
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);
342         }
343         tevent_req_set_callback(subreq, rpccli_dfs_Remove_done, req);
344         return req;
345 }
346
347 static void rpccli_dfs_Remove_done(struct tevent_req *subreq)
348 {
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;
355
356         if (state->out_mem_ctx) {
357                 mem_ctx = state->out_mem_ctx;
358         } else {
359                 mem_ctx = state;
360         }
361
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;
367         }
368
369         /* Copy out parameters */
370
371         /* Copy result */
372         state->orig.out.result = state->tmp.out.result;
373
374         /* Reset temporary structure */
375         ZERO_STRUCT(state->tmp);
376
377         tevent_req_done(req);
378 }
379
380 NTSTATUS rpccli_dfs_Remove_recv(struct tevent_req *req,
381                                 TALLOC_CTX *mem_ctx,
382                                 WERROR *result)
383 {
384         struct rpccli_dfs_Remove_state *state = tevent_req_data(
385                 req, struct rpccli_dfs_Remove_state);
386         NTSTATUS status;
387
388         if (tevent_req_is_nterror(req, &status)) {
389                 tevent_req_received(req);
390                 return status;
391         }
392
393         /* Steal possbile out parameters to the callers context */
394         talloc_steal(mem_ctx, state->out_mem_ctx);
395
396         /* Return result */
397         *result = state->orig.out.result;
398
399         tevent_req_received(req);
400         return NT_STATUS_OK;
401 }
402
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)
409 {
410         struct dfs_Remove r;
411         NTSTATUS status;
412
413         /* In parameters */
414         r.in.dfs_entry_path = dfs_entry_path;
415         r.in.servername = servername;
416         r.in.sharename = sharename;
417
418         status = cli->dispatch(cli,
419                                 mem_ctx,
420                                 &ndr_table_netdfs,
421                                 NDR_DFS_REMOVE,
422                                 &r);
423
424         if (!NT_STATUS_IS_OK(status)) {
425                 return status;
426         }
427
428         if (NT_STATUS_IS_ERR(status)) {
429                 return status;
430         }
431
432         /* Return variables */
433
434         /* Return result */
435         if (werror) {
436                 *werror = r.out.result;
437         }
438
439         return werror_to_ntstatus(r.out.result);
440 }
441
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);
447 };
448
449 static void rpccli_dfs_SetInfo_done(struct tevent_req *subreq);
450
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)] */)
459 {
460         struct tevent_req *req;
461         struct rpccli_dfs_SetInfo_state *state;
462         struct tevent_req *subreq;
463
464         req = tevent_req_create(mem_ctx, &state,
465                                 struct rpccli_dfs_SetInfo_state);
466         if (req == NULL) {
467                 return NULL;
468         }
469         state->out_mem_ctx = NULL;
470         state->dispatch_recv = cli->dispatch_recv;
471
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;
478
479         /* Out parameters */
480
481         /* Result */
482         ZERO_STRUCT(state->orig.out.result);
483
484         /* make a temporary copy, that we pass to the dispatch function */
485         state->tmp = state->orig;
486
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);
493         }
494         tevent_req_set_callback(subreq, rpccli_dfs_SetInfo_done, req);
495         return req;
496 }
497
498 static void rpccli_dfs_SetInfo_done(struct tevent_req *subreq)
499 {
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;
506
507         if (state->out_mem_ctx) {
508                 mem_ctx = state->out_mem_ctx;
509         } else {
510                 mem_ctx = state;
511         }
512
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;
518         }
519
520         /* Copy out parameters */
521
522         /* Copy result */
523         state->orig.out.result = state->tmp.out.result;
524
525         /* Reset temporary structure */
526         ZERO_STRUCT(state->tmp);
527
528         tevent_req_done(req);
529 }
530
531 NTSTATUS rpccli_dfs_SetInfo_recv(struct tevent_req *req,
532                                  TALLOC_CTX *mem_ctx,
533                                  WERROR *result)
534 {
535         struct rpccli_dfs_SetInfo_state *state = tevent_req_data(
536                 req, struct rpccli_dfs_SetInfo_state);
537         NTSTATUS status;
538
539         if (tevent_req_is_nterror(req, &status)) {
540                 tevent_req_received(req);
541                 return status;
542         }
543
544         /* Steal possbile out parameters to the callers context */
545         talloc_steal(mem_ctx, state->out_mem_ctx);
546
547         /* Return result */
548         *result = state->orig.out.result;
549
550         tevent_req_received(req);
551         return NT_STATUS_OK;
552 }
553
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)
562 {
563         struct dfs_SetInfo r;
564         NTSTATUS status;
565
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;
572
573         status = cli->dispatch(cli,
574                                 mem_ctx,
575                                 &ndr_table_netdfs,
576                                 NDR_DFS_SETINFO,
577                                 &r);
578
579         if (!NT_STATUS_IS_OK(status)) {
580                 return status;
581         }
582
583         if (NT_STATUS_IS_ERR(status)) {
584                 return status;
585         }
586
587         /* Return variables */
588
589         /* Return result */
590         if (werror) {
591                 *werror = r.out.result;
592         }
593
594         return werror_to_ntstatus(r.out.result);
595 }
596
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);
602 };
603
604 static void rpccli_dfs_GetInfo_done(struct tevent_req *subreq);
605
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)] */)
614 {
615         struct tevent_req *req;
616         struct rpccli_dfs_GetInfo_state *state;
617         struct tevent_req *subreq;
618
619         req = tevent_req_create(mem_ctx, &state,
620                                 struct rpccli_dfs_GetInfo_state);
621         if (req == NULL) {
622                 return NULL;
623         }
624         state->out_mem_ctx = NULL;
625         state->dispatch_recv = cli->dispatch_recv;
626
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;
632
633         /* Out parameters */
634         state->orig.out.info = _info;
635
636         /* Result */
637         ZERO_STRUCT(state->orig.out.result);
638
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);
643         }
644
645         /* make a temporary copy, that we pass to the dispatch function */
646         state->tmp = state->orig;
647
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);
654         }
655         tevent_req_set_callback(subreq, rpccli_dfs_GetInfo_done, req);
656         return req;
657 }
658
659 static void rpccli_dfs_GetInfo_done(struct tevent_req *subreq)
660 {
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;
667
668         if (state->out_mem_ctx) {
669                 mem_ctx = state->out_mem_ctx;
670         } else {
671                 mem_ctx = state;
672         }
673
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;
679         }
680
681         /* Copy out parameters */
682         *state->orig.out.info = *state->tmp.out.info;
683
684         /* Copy result */
685         state->orig.out.result = state->tmp.out.result;
686
687         /* Reset temporary structure */
688         ZERO_STRUCT(state->tmp);
689
690         tevent_req_done(req);
691 }
692
693 NTSTATUS rpccli_dfs_GetInfo_recv(struct tevent_req *req,
694                                  TALLOC_CTX *mem_ctx,
695                                  WERROR *result)
696 {
697         struct rpccli_dfs_GetInfo_state *state = tevent_req_data(
698                 req, struct rpccli_dfs_GetInfo_state);
699         NTSTATUS status;
700
701         if (tevent_req_is_nterror(req, &status)) {
702                 tevent_req_received(req);
703                 return status;
704         }
705
706         /* Steal possbile out parameters to the callers context */
707         talloc_steal(mem_ctx, state->out_mem_ctx);
708
709         /* Return result */
710         *result = state->orig.out.result;
711
712         tevent_req_received(req);
713         return NT_STATUS_OK;
714 }
715
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)
724 {
725         struct dfs_GetInfo r;
726         NTSTATUS status;
727
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;
733
734         status = cli->dispatch(cli,
735                                 mem_ctx,
736                                 &ndr_table_netdfs,
737                                 NDR_DFS_GETINFO,
738                                 &r);
739
740         if (!NT_STATUS_IS_OK(status)) {
741                 return status;
742         }
743
744         if (NT_STATUS_IS_ERR(status)) {
745                 return status;
746         }
747
748         /* Return variables */
749         *info = *r.out.info;
750
751         /* Return result */
752         if (werror) {
753                 *werror = r.out.result;
754         }
755
756         return werror_to_ntstatus(r.out.result);
757 }
758
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);
764 };
765
766 static void rpccli_dfs_Enum_done(struct tevent_req *subreq);
767
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] */)
775 {
776         struct tevent_req *req;
777         struct rpccli_dfs_Enum_state *state;
778         struct tevent_req *subreq;
779
780         req = tevent_req_create(mem_ctx, &state,
781                                 struct rpccli_dfs_Enum_state);
782         if (req == NULL) {
783                 return NULL;
784         }
785         state->out_mem_ctx = NULL;
786         state->dispatch_recv = cli->dispatch_recv;
787
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;
793
794         /* Out parameters */
795         state->orig.out.info = _info;
796         state->orig.out.total = _total;
797
798         /* Result */
799         ZERO_STRUCT(state->orig.out.result);
800
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);
805         }
806
807         /* make a temporary copy, that we pass to the dispatch function */
808         state->tmp = state->orig;
809
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);
816         }
817         tevent_req_set_callback(subreq, rpccli_dfs_Enum_done, req);
818         return req;
819 }
820
821 static void rpccli_dfs_Enum_done(struct tevent_req *subreq)
822 {
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;
829
830         if (state->out_mem_ctx) {
831                 mem_ctx = state->out_mem_ctx;
832         } else {
833                 mem_ctx = state;
834         }
835
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;
841         }
842
843         /* Copy out parameters */
844         if (state->orig.out.info && state->tmp.out.info) {
845                 *state->orig.out.info = *state->tmp.out.info;
846         }
847         if (state->orig.out.total && state->tmp.out.total) {
848                 *state->orig.out.total = *state->tmp.out.total;
849         }
850
851         /* Copy result */
852         state->orig.out.result = state->tmp.out.result;
853
854         /* Reset temporary structure */
855         ZERO_STRUCT(state->tmp);
856
857         tevent_req_done(req);
858 }
859
860 NTSTATUS rpccli_dfs_Enum_recv(struct tevent_req *req,
861                               TALLOC_CTX *mem_ctx,
862                               WERROR *result)
863 {
864         struct rpccli_dfs_Enum_state *state = tevent_req_data(
865                 req, struct rpccli_dfs_Enum_state);
866         NTSTATUS status;
867
868         if (tevent_req_is_nterror(req, &status)) {
869                 tevent_req_received(req);
870                 return status;
871         }
872
873         /* Steal possbile out parameters to the callers context */
874         talloc_steal(mem_ctx, state->out_mem_ctx);
875
876         /* Return result */
877         *result = state->orig.out.result;
878
879         tevent_req_received(req);
880         return NT_STATUS_OK;
881 }
882
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)
890 {
891         struct dfs_Enum r;
892         NTSTATUS status;
893
894         /* In parameters */
895         r.in.level = level;
896         r.in.bufsize = bufsize;
897         r.in.info = info;
898         r.in.total = total;
899
900         status = cli->dispatch(cli,
901                                 mem_ctx,
902                                 &ndr_table_netdfs,
903                                 NDR_DFS_ENUM,
904                                 &r);
905
906         if (!NT_STATUS_IS_OK(status)) {
907                 return status;
908         }
909
910         if (NT_STATUS_IS_ERR(status)) {
911                 return status;
912         }
913
914         /* Return variables */
915         if (info && r.out.info) {
916                 *info = *r.out.info;
917         }
918         if (total && r.out.total) {
919                 *total = *r.out.total;
920         }
921
922         /* Return result */
923         if (werror) {
924                 *werror = r.out.result;
925         }
926
927         return werror_to_ntstatus(r.out.result);
928 }
929
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);
935 };
936
937 static void rpccli_dfs_Rename_done(struct tevent_req *subreq);
938
939 struct tevent_req *rpccli_dfs_Rename_send(TALLOC_CTX *mem_ctx,
940                                           struct tevent_context *ev,
941                                           struct rpc_pipe_client *cli)
942 {
943         struct tevent_req *req;
944         struct rpccli_dfs_Rename_state *state;
945         struct tevent_req *subreq;
946
947         req = tevent_req_create(mem_ctx, &state,
948                                 struct rpccli_dfs_Rename_state);
949         if (req == NULL) {
950                 return NULL;
951         }
952         state->out_mem_ctx = NULL;
953         state->dispatch_recv = cli->dispatch_recv;
954
955         /* In parameters */
956
957         /* Out parameters */
958
959         /* Result */
960         ZERO_STRUCT(state->orig.out.result);
961
962         /* make a temporary copy, that we pass to the dispatch function */
963         state->tmp = state->orig;
964
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);
971         }
972         tevent_req_set_callback(subreq, rpccli_dfs_Rename_done, req);
973         return req;
974 }
975
976 static void rpccli_dfs_Rename_done(struct tevent_req *subreq)
977 {
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;
984
985         if (state->out_mem_ctx) {
986                 mem_ctx = state->out_mem_ctx;
987         } else {
988                 mem_ctx = state;
989         }
990
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;
996         }
997
998         /* Copy out parameters */
999
1000         /* Copy result */
1001         state->orig.out.result = state->tmp.out.result;
1002
1003         /* Reset temporary structure */
1004         ZERO_STRUCT(state->tmp);
1005
1006         tevent_req_done(req);
1007 }
1008
1009 NTSTATUS rpccli_dfs_Rename_recv(struct tevent_req *req,
1010                                 TALLOC_CTX *mem_ctx,
1011                                 WERROR *result)
1012 {
1013         struct rpccli_dfs_Rename_state *state = tevent_req_data(
1014                 req, struct rpccli_dfs_Rename_state);
1015         NTSTATUS status;
1016
1017         if (tevent_req_is_nterror(req, &status)) {
1018                 tevent_req_received(req);
1019                 return status;
1020         }
1021
1022         /* Steal possbile out parameters to the callers context */
1023         talloc_steal(mem_ctx, state->out_mem_ctx);
1024
1025         /* Return result */
1026         *result = state->orig.out.result;
1027
1028         tevent_req_received(req);
1029         return NT_STATUS_OK;
1030 }
1031
1032 NTSTATUS rpccli_dfs_Rename(struct rpc_pipe_client *cli,
1033                            TALLOC_CTX *mem_ctx,
1034                            WERROR *werror)
1035 {
1036         struct dfs_Rename r;
1037         NTSTATUS status;
1038
1039         /* In parameters */
1040
1041         status = cli->dispatch(cli,
1042                                 mem_ctx,
1043                                 &ndr_table_netdfs,
1044                                 NDR_DFS_RENAME,
1045                                 &r);
1046
1047         if (!NT_STATUS_IS_OK(status)) {
1048                 return status;
1049         }
1050
1051         if (NT_STATUS_IS_ERR(status)) {
1052                 return status;
1053         }
1054
1055         /* Return variables */
1056
1057         /* Return result */
1058         if (werror) {
1059                 *werror = r.out.result;
1060         }
1061
1062         return werror_to_ntstatus(r.out.result);
1063 }
1064
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);
1070 };
1071
1072 static void rpccli_dfs_Move_done(struct tevent_req *subreq);
1073
1074 struct tevent_req *rpccli_dfs_Move_send(TALLOC_CTX *mem_ctx,
1075                                         struct tevent_context *ev,
1076                                         struct rpc_pipe_client *cli)
1077 {
1078         struct tevent_req *req;
1079         struct rpccli_dfs_Move_state *state;
1080         struct tevent_req *subreq;
1081
1082         req = tevent_req_create(mem_ctx, &state,
1083                                 struct rpccli_dfs_Move_state);
1084         if (req == NULL) {
1085                 return NULL;
1086         }
1087         state->out_mem_ctx = NULL;
1088         state->dispatch_recv = cli->dispatch_recv;
1089
1090         /* In parameters */
1091
1092         /* Out parameters */
1093
1094         /* Result */
1095         ZERO_STRUCT(state->orig.out.result);
1096
1097         /* make a temporary copy, that we pass to the dispatch function */
1098         state->tmp = state->orig;
1099
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);
1106         }
1107         tevent_req_set_callback(subreq, rpccli_dfs_Move_done, req);
1108         return req;
1109 }
1110
1111 static void rpccli_dfs_Move_done(struct tevent_req *subreq)
1112 {
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;
1119
1120         if (state->out_mem_ctx) {
1121                 mem_ctx = state->out_mem_ctx;
1122         } else {
1123                 mem_ctx = state;
1124         }
1125
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;
1131         }
1132
1133         /* Copy out parameters */
1134
1135         /* Copy result */
1136         state->orig.out.result = state->tmp.out.result;
1137
1138         /* Reset temporary structure */
1139         ZERO_STRUCT(state->tmp);
1140
1141         tevent_req_done(req);
1142 }
1143
1144 NTSTATUS rpccli_dfs_Move_recv(struct tevent_req *req,
1145                               TALLOC_CTX *mem_ctx,
1146                               WERROR *result)
1147 {
1148         struct rpccli_dfs_Move_state *state = tevent_req_data(
1149                 req, struct rpccli_dfs_Move_state);
1150         NTSTATUS status;
1151
1152         if (tevent_req_is_nterror(req, &status)) {
1153                 tevent_req_received(req);
1154                 return status;
1155         }
1156
1157         /* Steal possbile out parameters to the callers context */
1158         talloc_steal(mem_ctx, state->out_mem_ctx);
1159
1160         /* Return result */
1161         *result = state->orig.out.result;
1162
1163         tevent_req_received(req);
1164         return NT_STATUS_OK;
1165 }
1166
1167 NTSTATUS rpccli_dfs_Move(struct rpc_pipe_client *cli,
1168                          TALLOC_CTX *mem_ctx,
1169                          WERROR *werror)
1170 {
1171         struct dfs_Move r;
1172         NTSTATUS status;
1173
1174         /* In parameters */
1175
1176         status = cli->dispatch(cli,
1177                                 mem_ctx,
1178                                 &ndr_table_netdfs,
1179                                 NDR_DFS_MOVE,
1180                                 &r);
1181
1182         if (!NT_STATUS_IS_OK(status)) {
1183                 return status;
1184         }
1185
1186         if (NT_STATUS_IS_ERR(status)) {
1187                 return status;
1188         }
1189
1190         /* Return variables */
1191
1192         /* Return result */
1193         if (werror) {
1194                 *werror = r.out.result;
1195         }
1196
1197         return werror_to_ntstatus(r.out.result);
1198 }
1199
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);
1205 };
1206
1207 static void rpccli_dfs_ManagerGetConfigInfo_done(struct tevent_req *subreq);
1208
1209 struct tevent_req *rpccli_dfs_ManagerGetConfigInfo_send(TALLOC_CTX *mem_ctx,
1210                                                         struct tevent_context *ev,
1211                                                         struct rpc_pipe_client *cli)
1212 {
1213         struct tevent_req *req;
1214         struct rpccli_dfs_ManagerGetConfigInfo_state *state;
1215         struct tevent_req *subreq;
1216
1217         req = tevent_req_create(mem_ctx, &state,
1218                                 struct rpccli_dfs_ManagerGetConfigInfo_state);
1219         if (req == NULL) {
1220                 return NULL;
1221         }
1222         state->out_mem_ctx = NULL;
1223         state->dispatch_recv = cli->dispatch_recv;
1224
1225         /* In parameters */
1226
1227         /* Out parameters */
1228
1229         /* Result */
1230         ZERO_STRUCT(state->orig.out.result);
1231
1232         /* make a temporary copy, that we pass to the dispatch function */
1233         state->tmp = state->orig;
1234
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);
1241         }
1242         tevent_req_set_callback(subreq, rpccli_dfs_ManagerGetConfigInfo_done, req);
1243         return req;
1244 }
1245
1246 static void rpccli_dfs_ManagerGetConfigInfo_done(struct tevent_req *subreq)
1247 {
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;
1254
1255         if (state->out_mem_ctx) {
1256                 mem_ctx = state->out_mem_ctx;
1257         } else {
1258                 mem_ctx = state;
1259         }
1260
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;
1266         }
1267
1268         /* Copy out parameters */
1269
1270         /* Copy result */
1271         state->orig.out.result = state->tmp.out.result;
1272
1273         /* Reset temporary structure */
1274         ZERO_STRUCT(state->tmp);
1275
1276         tevent_req_done(req);
1277 }
1278
1279 NTSTATUS rpccli_dfs_ManagerGetConfigInfo_recv(struct tevent_req *req,
1280                                               TALLOC_CTX *mem_ctx,
1281                                               WERROR *result)
1282 {
1283         struct rpccli_dfs_ManagerGetConfigInfo_state *state = tevent_req_data(
1284                 req, struct rpccli_dfs_ManagerGetConfigInfo_state);
1285         NTSTATUS status;
1286
1287         if (tevent_req_is_nterror(req, &status)) {
1288                 tevent_req_received(req);
1289                 return status;
1290         }
1291
1292         /* Steal possbile out parameters to the callers context */
1293         talloc_steal(mem_ctx, state->out_mem_ctx);
1294
1295         /* Return result */
1296         *result = state->orig.out.result;
1297
1298         tevent_req_received(req);
1299         return NT_STATUS_OK;
1300 }
1301
1302 NTSTATUS rpccli_dfs_ManagerGetConfigInfo(struct rpc_pipe_client *cli,
1303                                          TALLOC_CTX *mem_ctx,
1304                                          WERROR *werror)
1305 {
1306         struct dfs_ManagerGetConfigInfo r;
1307         NTSTATUS status;
1308
1309         /* In parameters */
1310
1311         status = cli->dispatch(cli,
1312                                 mem_ctx,
1313                                 &ndr_table_netdfs,
1314                                 NDR_DFS_MANAGERGETCONFIGINFO,
1315                                 &r);
1316
1317         if (!NT_STATUS_IS_OK(status)) {
1318                 return status;
1319         }
1320
1321         if (NT_STATUS_IS_ERR(status)) {
1322                 return status;
1323         }
1324
1325         /* Return variables */
1326
1327         /* Return result */
1328         if (werror) {
1329                 *werror = r.out.result;
1330         }
1331
1332         return werror_to_ntstatus(r.out.result);
1333 }
1334
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);
1340 };
1341
1342 static void rpccli_dfs_ManagerSendSiteInfo_done(struct tevent_req *subreq);
1343
1344 struct tevent_req *rpccli_dfs_ManagerSendSiteInfo_send(TALLOC_CTX *mem_ctx,
1345                                                        struct tevent_context *ev,
1346                                                        struct rpc_pipe_client *cli)
1347 {
1348         struct tevent_req *req;
1349         struct rpccli_dfs_ManagerSendSiteInfo_state *state;
1350         struct tevent_req *subreq;
1351
1352         req = tevent_req_create(mem_ctx, &state,
1353                                 struct rpccli_dfs_ManagerSendSiteInfo_state);
1354         if (req == NULL) {
1355                 return NULL;
1356         }
1357         state->out_mem_ctx = NULL;
1358         state->dispatch_recv = cli->dispatch_recv;
1359
1360         /* In parameters */
1361
1362         /* Out parameters */
1363
1364         /* Result */
1365         ZERO_STRUCT(state->orig.out.result);
1366
1367         /* make a temporary copy, that we pass to the dispatch function */
1368         state->tmp = state->orig;
1369
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);
1376         }
1377         tevent_req_set_callback(subreq, rpccli_dfs_ManagerSendSiteInfo_done, req);
1378         return req;
1379 }
1380
1381 static void rpccli_dfs_ManagerSendSiteInfo_done(struct tevent_req *subreq)
1382 {
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;
1389
1390         if (state->out_mem_ctx) {
1391                 mem_ctx = state->out_mem_ctx;
1392         } else {
1393                 mem_ctx = state;
1394         }
1395
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;
1401         }
1402
1403         /* Copy out parameters */
1404
1405         /* Copy result */
1406         state->orig.out.result = state->tmp.out.result;
1407
1408         /* Reset temporary structure */
1409         ZERO_STRUCT(state->tmp);
1410
1411         tevent_req_done(req);
1412 }
1413
1414 NTSTATUS rpccli_dfs_ManagerSendSiteInfo_recv(struct tevent_req *req,
1415                                              TALLOC_CTX *mem_ctx,
1416                                              WERROR *result)
1417 {
1418         struct rpccli_dfs_ManagerSendSiteInfo_state *state = tevent_req_data(
1419                 req, struct rpccli_dfs_ManagerSendSiteInfo_state);
1420         NTSTATUS status;
1421
1422         if (tevent_req_is_nterror(req, &status)) {
1423                 tevent_req_received(req);
1424                 return status;
1425         }
1426
1427         /* Steal possbile out parameters to the callers context */
1428         talloc_steal(mem_ctx, state->out_mem_ctx);
1429
1430         /* Return result */
1431         *result = state->orig.out.result;
1432
1433         tevent_req_received(req);
1434         return NT_STATUS_OK;
1435 }
1436
1437 NTSTATUS rpccli_dfs_ManagerSendSiteInfo(struct rpc_pipe_client *cli,
1438                                         TALLOC_CTX *mem_ctx,
1439                                         WERROR *werror)
1440 {
1441         struct dfs_ManagerSendSiteInfo r;
1442         NTSTATUS status;
1443
1444         /* In parameters */
1445
1446         status = cli->dispatch(cli,
1447                                 mem_ctx,
1448                                 &ndr_table_netdfs,
1449                                 NDR_DFS_MANAGERSENDSITEINFO,
1450                                 &r);
1451
1452         if (!NT_STATUS_IS_OK(status)) {
1453                 return status;
1454         }
1455
1456         if (NT_STATUS_IS_ERR(status)) {
1457                 return status;
1458         }
1459
1460         /* Return variables */
1461
1462         /* Return result */
1463         if (werror) {
1464                 *werror = r.out.result;
1465         }
1466
1467         return werror_to_ntstatus(r.out.result);
1468 }
1469
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);
1475 };
1476
1477 static void rpccli_dfs_AddFtRoot_done(struct tevent_req *subreq);
1478
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] */)
1491 {
1492         struct tevent_req *req;
1493         struct rpccli_dfs_AddFtRoot_state *state;
1494         struct tevent_req *subreq;
1495
1496         req = tevent_req_create(mem_ctx, &state,
1497                                 struct rpccli_dfs_AddFtRoot_state);
1498         if (req == NULL) {
1499                 return NULL;
1500         }
1501         state->out_mem_ctx = NULL;
1502         state->dispatch_recv = cli->dispatch_recv;
1503
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;
1514
1515         /* Out parameters */
1516         state->orig.out.unknown2 = _unknown2;
1517
1518         /* Result */
1519         ZERO_STRUCT(state->orig.out.result);
1520
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);
1525         }
1526
1527         /* make a temporary copy, that we pass to the dispatch function */
1528         state->tmp = state->orig;
1529
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);
1536         }
1537         tevent_req_set_callback(subreq, rpccli_dfs_AddFtRoot_done, req);
1538         return req;
1539 }
1540
1541 static void rpccli_dfs_AddFtRoot_done(struct tevent_req *subreq)
1542 {
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;
1549
1550         if (state->out_mem_ctx) {
1551                 mem_ctx = state->out_mem_ctx;
1552         } else {
1553                 mem_ctx = state;
1554         }
1555
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;
1561         }
1562
1563         /* Copy out parameters */
1564         if (state->orig.out.unknown2 && state->tmp.out.unknown2) {
1565                 *state->orig.out.unknown2 = *state->tmp.out.unknown2;
1566         }
1567
1568         /* Copy result */
1569         state->orig.out.result = state->tmp.out.result;
1570
1571         /* Reset temporary structure */
1572         ZERO_STRUCT(state->tmp);
1573
1574         tevent_req_done(req);
1575 }
1576
1577 NTSTATUS rpccli_dfs_AddFtRoot_recv(struct tevent_req *req,
1578                                    TALLOC_CTX *mem_ctx,
1579                                    WERROR *result)
1580 {
1581         struct rpccli_dfs_AddFtRoot_state *state = tevent_req_data(
1582                 req, struct rpccli_dfs_AddFtRoot_state);
1583         NTSTATUS status;
1584
1585         if (tevent_req_is_nterror(req, &status)) {
1586                 tevent_req_received(req);
1587                 return status;
1588         }
1589
1590         /* Steal possbile out parameters to the callers context */
1591         talloc_steal(mem_ctx, state->out_mem_ctx);
1592
1593         /* Return result */
1594         *result = state->orig.out.result;
1595
1596         tevent_req_received(req);
1597         return NT_STATUS_OK;
1598 }
1599
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)
1612 {
1613         struct dfs_AddFtRoot r;
1614         NTSTATUS status;
1615
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;
1626
1627         status = cli->dispatch(cli,
1628                                 mem_ctx,
1629                                 &ndr_table_netdfs,
1630                                 NDR_DFS_ADDFTROOT,
1631                                 &r);
1632
1633         if (!NT_STATUS_IS_OK(status)) {
1634                 return status;
1635         }
1636
1637         if (NT_STATUS_IS_ERR(status)) {
1638                 return status;
1639         }
1640
1641         /* Return variables */
1642         if (unknown2 && r.out.unknown2) {
1643                 *unknown2 = *r.out.unknown2;
1644         }
1645
1646         /* Return result */
1647         if (werror) {
1648                 *werror = r.out.result;
1649         }
1650
1651         return werror_to_ntstatus(r.out.result);
1652 }
1653
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);
1659 };
1660
1661 static void rpccli_dfs_RemoveFtRoot_done(struct tevent_req *subreq);
1662
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] */)
1672 {
1673         struct tevent_req *req;
1674         struct rpccli_dfs_RemoveFtRoot_state *state;
1675         struct tevent_req *subreq;
1676
1677         req = tevent_req_create(mem_ctx, &state,
1678                                 struct rpccli_dfs_RemoveFtRoot_state);
1679         if (req == NULL) {
1680                 return NULL;
1681         }
1682         state->out_mem_ctx = NULL;
1683         state->dispatch_recv = cli->dispatch_recv;
1684
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;
1692
1693         /* Out parameters */
1694         state->orig.out.unknown = _unknown;
1695
1696         /* Result */
1697         ZERO_STRUCT(state->orig.out.result);
1698
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);
1703         }
1704
1705         /* make a temporary copy, that we pass to the dispatch function */
1706         state->tmp = state->orig;
1707
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);
1714         }
1715         tevent_req_set_callback(subreq, rpccli_dfs_RemoveFtRoot_done, req);
1716         return req;
1717 }
1718
1719 static void rpccli_dfs_RemoveFtRoot_done(struct tevent_req *subreq)
1720 {
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;
1727
1728         if (state->out_mem_ctx) {
1729                 mem_ctx = state->out_mem_ctx;
1730         } else {
1731                 mem_ctx = state;
1732         }
1733
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;
1739         }
1740
1741         /* Copy out parameters */
1742         if (state->orig.out.unknown && state->tmp.out.unknown) {
1743                 *state->orig.out.unknown = *state->tmp.out.unknown;
1744         }
1745
1746         /* Copy result */
1747         state->orig.out.result = state->tmp.out.result;
1748
1749         /* Reset temporary structure */
1750         ZERO_STRUCT(state->tmp);
1751
1752         tevent_req_done(req);
1753 }
1754
1755 NTSTATUS rpccli_dfs_RemoveFtRoot_recv(struct tevent_req *req,
1756                                       TALLOC_CTX *mem_ctx,
1757                                       WERROR *result)
1758 {
1759         struct rpccli_dfs_RemoveFtRoot_state *state = tevent_req_data(
1760                 req, struct rpccli_dfs_RemoveFtRoot_state);
1761         NTSTATUS status;
1762
1763         if (tevent_req_is_nterror(req, &status)) {
1764                 tevent_req_received(req);
1765                 return status;
1766         }
1767
1768         /* Steal possbile out parameters to the callers context */
1769         talloc_steal(mem_ctx, state->out_mem_ctx);
1770
1771         /* Return result */
1772         *result = state->orig.out.result;
1773
1774         tevent_req_received(req);
1775         return NT_STATUS_OK;
1776 }
1777
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)
1787 {
1788         struct dfs_RemoveFtRoot r;
1789         NTSTATUS status;
1790
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;
1798
1799         status = cli->dispatch(cli,
1800                                 mem_ctx,
1801                                 &ndr_table_netdfs,
1802                                 NDR_DFS_REMOVEFTROOT,
1803                                 &r);
1804
1805         if (!NT_STATUS_IS_OK(status)) {
1806                 return status;
1807         }
1808
1809         if (NT_STATUS_IS_ERR(status)) {
1810                 return status;
1811         }
1812
1813         /* Return variables */
1814         if (unknown && r.out.unknown) {
1815                 *unknown = *r.out.unknown;
1816         }
1817
1818         /* Return result */
1819         if (werror) {
1820                 *werror = r.out.result;
1821         }
1822
1823         return werror_to_ntstatus(r.out.result);
1824 }
1825
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);
1831 };
1832
1833 static void rpccli_dfs_AddStdRoot_done(struct tevent_req *subreq);
1834
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]  */)
1842 {
1843         struct tevent_req *req;
1844         struct rpccli_dfs_AddStdRoot_state *state;
1845         struct tevent_req *subreq;
1846
1847         req = tevent_req_create(mem_ctx, &state,
1848                                 struct rpccli_dfs_AddStdRoot_state);
1849         if (req == NULL) {
1850                 return NULL;
1851         }
1852         state->out_mem_ctx = NULL;
1853         state->dispatch_recv = cli->dispatch_recv;
1854
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;
1860
1861         /* Out parameters */
1862
1863         /* Result */
1864         ZERO_STRUCT(state->orig.out.result);
1865
1866         /* make a temporary copy, that we pass to the dispatch function */
1867         state->tmp = state->orig;
1868
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);
1875         }
1876         tevent_req_set_callback(subreq, rpccli_dfs_AddStdRoot_done, req);
1877         return req;
1878 }
1879
1880 static void rpccli_dfs_AddStdRoot_done(struct tevent_req *subreq)
1881 {
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;
1888
1889         if (state->out_mem_ctx) {
1890                 mem_ctx = state->out_mem_ctx;
1891         } else {
1892                 mem_ctx = state;
1893         }
1894
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;
1900         }
1901
1902         /* Copy out parameters */
1903
1904         /* Copy result */
1905         state->orig.out.result = state->tmp.out.result;
1906
1907         /* Reset temporary structure */
1908         ZERO_STRUCT(state->tmp);
1909
1910         tevent_req_done(req);
1911 }
1912
1913 NTSTATUS rpccli_dfs_AddStdRoot_recv(struct tevent_req *req,
1914                                     TALLOC_CTX *mem_ctx,
1915                                     WERROR *result)
1916 {
1917         struct rpccli_dfs_AddStdRoot_state *state = tevent_req_data(
1918                 req, struct rpccli_dfs_AddStdRoot_state);
1919         NTSTATUS status;
1920
1921         if (tevent_req_is_nterror(req, &status)) {
1922                 tevent_req_received(req);
1923                 return status;
1924         }
1925
1926         /* Steal possbile out parameters to the callers context */
1927         talloc_steal(mem_ctx, state->out_mem_ctx);
1928
1929         /* Return result */
1930         *result = state->orig.out.result;
1931
1932         tevent_req_received(req);
1933         return NT_STATUS_OK;
1934 }
1935
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)
1943 {
1944         struct dfs_AddStdRoot r;
1945         NTSTATUS status;
1946
1947         /* In parameters */
1948         r.in.servername = servername;
1949         r.in.rootshare = rootshare;
1950         r.in.comment = comment;
1951         r.in.flags = flags;
1952
1953         status = cli->dispatch(cli,
1954                                 mem_ctx,
1955                                 &ndr_table_netdfs,
1956                                 NDR_DFS_ADDSTDROOT,
1957                                 &r);
1958
1959         if (!NT_STATUS_IS_OK(status)) {
1960                 return status;
1961         }
1962
1963         if (NT_STATUS_IS_ERR(status)) {
1964                 return status;
1965         }
1966
1967         /* Return variables */
1968
1969         /* Return result */
1970         if (werror) {
1971                 *werror = r.out.result;
1972         }
1973
1974         return werror_to_ntstatus(r.out.result);
1975 }
1976
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);
1982 };
1983
1984 static void rpccli_dfs_RemoveStdRoot_done(struct tevent_req *subreq);
1985
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]  */)
1992 {
1993         struct tevent_req *req;
1994         struct rpccli_dfs_RemoveStdRoot_state *state;
1995         struct tevent_req *subreq;
1996
1997         req = tevent_req_create(mem_ctx, &state,
1998                                 struct rpccli_dfs_RemoveStdRoot_state);
1999         if (req == NULL) {
2000                 return NULL;
2001         }
2002         state->out_mem_ctx = NULL;
2003         state->dispatch_recv = cli->dispatch_recv;
2004
2005         /* In parameters */
2006         state->orig.in.servername = _servername;
2007         state->orig.in.rootshare = _rootshare;
2008         state->orig.in.flags = _flags;
2009
2010         /* Out parameters */
2011
2012         /* Result */
2013         ZERO_STRUCT(state->orig.out.result);
2014
2015         /* make a temporary copy, that we pass to the dispatch function */
2016         state->tmp = state->orig;
2017
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);
2024         }
2025         tevent_req_set_callback(subreq, rpccli_dfs_RemoveStdRoot_done, req);
2026         return req;
2027 }
2028
2029 static void rpccli_dfs_RemoveStdRoot_done(struct tevent_req *subreq)
2030 {
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;
2037
2038         if (state->out_mem_ctx) {
2039                 mem_ctx = state->out_mem_ctx;
2040         } else {
2041                 mem_ctx = state;
2042         }
2043
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;
2049         }
2050
2051         /* Copy out parameters */
2052
2053         /* Copy result */
2054         state->orig.out.result = state->tmp.out.result;
2055
2056         /* Reset temporary structure */
2057         ZERO_STRUCT(state->tmp);
2058
2059         tevent_req_done(req);
2060 }
2061
2062 NTSTATUS rpccli_dfs_RemoveStdRoot_recv(struct tevent_req *req,
2063                                        TALLOC_CTX *mem_ctx,
2064                                        WERROR *result)
2065 {
2066         struct rpccli_dfs_RemoveStdRoot_state *state = tevent_req_data(
2067                 req, struct rpccli_dfs_RemoveStdRoot_state);
2068         NTSTATUS status;
2069
2070         if (tevent_req_is_nterror(req, &status)) {
2071                 tevent_req_received(req);
2072                 return status;
2073         }
2074
2075         /* Steal possbile out parameters to the callers context */
2076         talloc_steal(mem_ctx, state->out_mem_ctx);
2077
2078         /* Return result */
2079         *result = state->orig.out.result;
2080
2081         tevent_req_received(req);
2082         return NT_STATUS_OK;
2083 }
2084
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)
2091 {
2092         struct dfs_RemoveStdRoot r;
2093         NTSTATUS status;
2094
2095         /* In parameters */
2096         r.in.servername = servername;
2097         r.in.rootshare = rootshare;
2098         r.in.flags = flags;
2099
2100         status = cli->dispatch(cli,
2101                                 mem_ctx,
2102                                 &ndr_table_netdfs,
2103                                 NDR_DFS_REMOVESTDROOT,
2104                                 &r);
2105
2106         if (!NT_STATUS_IS_OK(status)) {
2107                 return status;
2108         }
2109
2110         if (NT_STATUS_IS_ERR(status)) {
2111                 return status;
2112         }
2113
2114         /* Return variables */
2115
2116         /* Return result */
2117         if (werror) {
2118                 *werror = r.out.result;
2119         }
2120
2121         return werror_to_ntstatus(r.out.result);
2122 }
2123
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);
2129 };
2130
2131 static void rpccli_dfs_ManagerInitialize_done(struct tevent_req *subreq);
2132
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]  */)
2138 {
2139         struct tevent_req *req;
2140         struct rpccli_dfs_ManagerInitialize_state *state;
2141         struct tevent_req *subreq;
2142
2143         req = tevent_req_create(mem_ctx, &state,
2144                                 struct rpccli_dfs_ManagerInitialize_state);
2145         if (req == NULL) {
2146                 return NULL;
2147         }
2148         state->out_mem_ctx = NULL;
2149         state->dispatch_recv = cli->dispatch_recv;
2150
2151         /* In parameters */
2152         state->orig.in.servername = _servername;
2153         state->orig.in.flags = _flags;
2154
2155         /* Out parameters */
2156
2157         /* Result */
2158         ZERO_STRUCT(state->orig.out.result);
2159
2160         /* make a temporary copy, that we pass to the dispatch function */
2161         state->tmp = state->orig;
2162
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);
2169         }
2170         tevent_req_set_callback(subreq, rpccli_dfs_ManagerInitialize_done, req);
2171         return req;
2172 }
2173
2174 static void rpccli_dfs_ManagerInitialize_done(struct tevent_req *subreq)
2175 {
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;
2182
2183         if (state->out_mem_ctx) {
2184                 mem_ctx = state->out_mem_ctx;
2185         } else {
2186                 mem_ctx = state;
2187         }
2188
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;
2194         }
2195
2196         /* Copy out parameters */
2197
2198         /* Copy result */
2199         state->orig.out.result = state->tmp.out.result;
2200
2201         /* Reset temporary structure */
2202         ZERO_STRUCT(state->tmp);
2203
2204         tevent_req_done(req);
2205 }
2206
2207 NTSTATUS rpccli_dfs_ManagerInitialize_recv(struct tevent_req *req,
2208                                            TALLOC_CTX *mem_ctx,
2209                                            WERROR *result)
2210 {
2211         struct rpccli_dfs_ManagerInitialize_state *state = tevent_req_data(
2212                 req, struct rpccli_dfs_ManagerInitialize_state);
2213         NTSTATUS status;
2214
2215         if (tevent_req_is_nterror(req, &status)) {
2216                 tevent_req_received(req);
2217                 return status;
2218         }
2219
2220         /* Steal possbile out parameters to the callers context */
2221         talloc_steal(mem_ctx, state->out_mem_ctx);
2222
2223         /* Return result */
2224         *result = state->orig.out.result;
2225
2226         tevent_req_received(req);
2227         return NT_STATUS_OK;
2228 }
2229
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)
2235 {
2236         struct dfs_ManagerInitialize r;
2237         NTSTATUS status;
2238
2239         /* In parameters */
2240         r.in.servername = servername;
2241         r.in.flags = flags;
2242
2243         status = cli->dispatch(cli,
2244                                 mem_ctx,
2245                                 &ndr_table_netdfs,
2246                                 NDR_DFS_MANAGERINITIALIZE,
2247                                 &r);
2248
2249         if (!NT_STATUS_IS_OK(status)) {
2250                 return status;
2251         }
2252
2253         if (NT_STATUS_IS_ERR(status)) {
2254                 return status;
2255         }
2256
2257         /* Return variables */
2258
2259         /* Return result */
2260         if (werror) {
2261                 *werror = r.out.result;
2262         }
2263
2264         return werror_to_ntstatus(r.out.result);
2265 }
2266
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);
2272 };
2273
2274 static void rpccli_dfs_AddStdRootForced_done(struct tevent_req *subreq);
2275
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)] */)
2283 {
2284         struct tevent_req *req;
2285         struct rpccli_dfs_AddStdRootForced_state *state;
2286         struct tevent_req *subreq;
2287
2288         req = tevent_req_create(mem_ctx, &state,
2289                                 struct rpccli_dfs_AddStdRootForced_state);
2290         if (req == NULL) {
2291                 return NULL;
2292         }
2293         state->out_mem_ctx = NULL;
2294         state->dispatch_recv = cli->dispatch_recv;
2295
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;
2301
2302         /* Out parameters */
2303
2304         /* Result */
2305         ZERO_STRUCT(state->orig.out.result);
2306
2307         /* make a temporary copy, that we pass to the dispatch function */
2308         state->tmp = state->orig;
2309
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);
2316         }
2317         tevent_req_set_callback(subreq, rpccli_dfs_AddStdRootForced_done, req);
2318         return req;
2319 }
2320
2321 static void rpccli_dfs_AddStdRootForced_done(struct tevent_req *subreq)
2322 {
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;
2329
2330         if (state->out_mem_ctx) {
2331                 mem_ctx = state->out_mem_ctx;
2332         } else {
2333                 mem_ctx = state;
2334         }
2335
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;
2341         }
2342
2343         /* Copy out parameters */
2344
2345         /* Copy result */
2346         state->orig.out.result = state->tmp.out.result;
2347
2348         /* Reset temporary structure */
2349         ZERO_STRUCT(state->tmp);
2350
2351         tevent_req_done(req);
2352 }
2353
2354 NTSTATUS rpccli_dfs_AddStdRootForced_recv(struct tevent_req *req,
2355                                           TALLOC_CTX *mem_ctx,
2356                                           WERROR *result)
2357 {
2358         struct rpccli_dfs_AddStdRootForced_state *state = tevent_req_data(
2359                 req, struct rpccli_dfs_AddStdRootForced_state);
2360         NTSTATUS status;
2361
2362         if (tevent_req_is_nterror(req, &status)) {
2363                 tevent_req_received(req);
2364                 return status;
2365         }
2366
2367         /* Steal possbile out parameters to the callers context */
2368         talloc_steal(mem_ctx, state->out_mem_ctx);
2369
2370         /* Return result */
2371         *result = state->orig.out.result;
2372
2373         tevent_req_received(req);
2374         return NT_STATUS_OK;
2375 }
2376
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)
2384 {
2385         struct dfs_AddStdRootForced r;
2386         NTSTATUS status;
2387
2388         /* In parameters */
2389         r.in.servername = servername;
2390         r.in.rootshare = rootshare;
2391         r.in.comment = comment;
2392         r.in.store = store;
2393
2394         status = cli->dispatch(cli,
2395                                 mem_ctx,
2396                                 &ndr_table_netdfs,
2397                                 NDR_DFS_ADDSTDROOTFORCED,
2398                                 &r);
2399
2400         if (!NT_STATUS_IS_OK(status)) {
2401                 return status;
2402         }
2403
2404         if (NT_STATUS_IS_ERR(status)) {
2405                 return status;
2406         }
2407
2408         /* Return variables */
2409
2410         /* Return result */
2411         if (werror) {
2412                 *werror = r.out.result;
2413         }
2414
2415         return werror_to_ntstatus(r.out.result);
2416 }
2417
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);
2423 };
2424
2425 static void rpccli_dfs_GetDcAddress_done(struct tevent_req *subreq);
2426
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] */)
2434 {
2435         struct tevent_req *req;
2436         struct rpccli_dfs_GetDcAddress_state *state;
2437         struct tevent_req *subreq;
2438
2439         req = tevent_req_create(mem_ctx, &state,
2440                                 struct rpccli_dfs_GetDcAddress_state);
2441         if (req == NULL) {
2442                 return NULL;
2443         }
2444         state->out_mem_ctx = NULL;
2445         state->dispatch_recv = cli->dispatch_recv;
2446
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;
2452
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;
2457
2458         /* Result */
2459         ZERO_STRUCT(state->orig.out.result);
2460
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);
2465         }
2466
2467         /* make a temporary copy, that we pass to the dispatch function */
2468         state->tmp = state->orig;
2469
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);
2476         }
2477         tevent_req_set_callback(subreq, rpccli_dfs_GetDcAddress_done, req);
2478         return req;
2479 }
2480
2481 static void rpccli_dfs_GetDcAddress_done(struct tevent_req *subreq)
2482 {
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;
2489
2490         if (state->out_mem_ctx) {
2491                 mem_ctx = state->out_mem_ctx;
2492         } else {
2493                 mem_ctx = state;
2494         }
2495
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;
2501         }
2502
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;
2507
2508         /* Copy result */
2509         state->orig.out.result = state->tmp.out.result;
2510
2511         /* Reset temporary structure */
2512         ZERO_STRUCT(state->tmp);
2513
2514         tevent_req_done(req);
2515 }
2516
2517 NTSTATUS rpccli_dfs_GetDcAddress_recv(struct tevent_req *req,
2518                                       TALLOC_CTX *mem_ctx,
2519                                       WERROR *result)
2520 {
2521         struct rpccli_dfs_GetDcAddress_state *state = tevent_req_data(
2522                 req, struct rpccli_dfs_GetDcAddress_state);
2523         NTSTATUS status;
2524
2525         if (tevent_req_is_nterror(req, &status)) {
2526                 tevent_req_received(req);
2527                 return status;
2528         }
2529
2530         /* Steal possbile out parameters to the callers context */
2531         talloc_steal(mem_ctx, state->out_mem_ctx);
2532
2533         /* Return result */
2534         *result = state->orig.out.result;
2535
2536         tevent_req_received(req);
2537         return NT_STATUS_OK;
2538 }
2539
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)
2547 {
2548         struct dfs_GetDcAddress r;
2549         NTSTATUS status;
2550
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;
2556
2557         status = cli->dispatch(cli,
2558                                 mem_ctx,
2559                                 &ndr_table_netdfs,
2560                                 NDR_DFS_GETDCADDRESS,
2561                                 &r);
2562
2563         if (!NT_STATUS_IS_OK(status)) {
2564                 return status;
2565         }
2566
2567         if (NT_STATUS_IS_ERR(status)) {
2568                 return status;
2569         }
2570
2571         /* Return variables */
2572         *server_fullname = *r.out.server_fullname;
2573         *is_root = *r.out.is_root;
2574         *ttl = *r.out.ttl;
2575
2576         /* Return result */
2577         if (werror) {
2578                 *werror = r.out.result;
2579         }
2580
2581         return werror_to_ntstatus(r.out.result);
2582 }
2583
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);
2589 };
2590
2591 static void rpccli_dfs_SetDcAddress_done(struct tevent_req *subreq);
2592
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]  */)
2600 {
2601         struct tevent_req *req;
2602         struct rpccli_dfs_SetDcAddress_state *state;
2603         struct tevent_req *subreq;
2604
2605         req = tevent_req_create(mem_ctx, &state,
2606                                 struct rpccli_dfs_SetDcAddress_state);
2607         if (req == NULL) {
2608                 return NULL;
2609         }
2610         state->out_mem_ctx = NULL;
2611         state->dispatch_recv = cli->dispatch_recv;
2612
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;
2618
2619         /* Out parameters */
2620
2621         /* Result */
2622         ZERO_STRUCT(state->orig.out.result);
2623
2624         /* make a temporary copy, that we pass to the dispatch function */
2625         state->tmp = state->orig;
2626
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);
2633         }
2634         tevent_req_set_callback(subreq, rpccli_dfs_SetDcAddress_done, req);
2635         return req;
2636 }
2637
2638 static void rpccli_dfs_SetDcAddress_done(struct tevent_req *subreq)
2639 {
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;
2646
2647         if (state->out_mem_ctx) {
2648                 mem_ctx = state->out_mem_ctx;
2649         } else {
2650                 mem_ctx = state;
2651         }
2652
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;
2658         }
2659
2660         /* Copy out parameters */
2661
2662         /* Copy result */
2663         state->orig.out.result = state->tmp.out.result;
2664
2665         /* Reset temporary structure */
2666         ZERO_STRUCT(state->tmp);
2667
2668         tevent_req_done(req);
2669 }
2670
2671 NTSTATUS rpccli_dfs_SetDcAddress_recv(struct tevent_req *req,
2672                                       TALLOC_CTX *mem_ctx,
2673                                       WERROR *result)
2674 {
2675         struct rpccli_dfs_SetDcAddress_state *state = tevent_req_data(
2676                 req, struct rpccli_dfs_SetDcAddress_state);
2677         NTSTATUS status;
2678
2679         if (tevent_req_is_nterror(req, &status)) {
2680                 tevent_req_received(req);
2681                 return status;
2682         }
2683
2684         /* Steal possbile out parameters to the callers context */
2685         talloc_steal(mem_ctx, state->out_mem_ctx);
2686
2687         /* Return result */
2688         *result = state->orig.out.result;
2689
2690         tevent_req_received(req);
2691         return NT_STATUS_OK;
2692 }
2693
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)
2701 {
2702         struct dfs_SetDcAddress r;
2703         NTSTATUS status;
2704
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;
2710
2711         status = cli->dispatch(cli,
2712                                 mem_ctx,
2713                                 &ndr_table_netdfs,
2714                                 NDR_DFS_SETDCADDRESS,
2715                                 &r);
2716
2717         if (!NT_STATUS_IS_OK(status)) {
2718                 return status;
2719         }
2720
2721         if (NT_STATUS_IS_ERR(status)) {
2722                 return status;
2723         }
2724
2725         /* Return variables */
2726
2727         /* Return result */
2728         if (werror) {
2729                 *werror = r.out.result;
2730         }
2731
2732         return werror_to_ntstatus(r.out.result);
2733 }
2734
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);
2740 };
2741
2742 static void rpccli_dfs_FlushFtTable_done(struct tevent_req *subreq);
2743
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)] */)
2749 {
2750         struct tevent_req *req;
2751         struct rpccli_dfs_FlushFtTable_state *state;
2752         struct tevent_req *subreq;
2753
2754         req = tevent_req_create(mem_ctx, &state,
2755                                 struct rpccli_dfs_FlushFtTable_state);
2756         if (req == NULL) {
2757                 return NULL;
2758         }
2759         state->out_mem_ctx = NULL;
2760         state->dispatch_recv = cli->dispatch_recv;
2761
2762         /* In parameters */
2763         state->orig.in.servername = _servername;
2764         state->orig.in.rootshare = _rootshare;
2765
2766         /* Out parameters */
2767
2768         /* Result */
2769         ZERO_STRUCT(state->orig.out.result);
2770
2771         /* make a temporary copy, that we pass to the dispatch function */
2772         state->tmp = state->orig;
2773
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);
2780         }
2781         tevent_req_set_callback(subreq, rpccli_dfs_FlushFtTable_done, req);
2782         return req;
2783 }
2784
2785 static void rpccli_dfs_FlushFtTable_done(struct tevent_req *subreq)
2786 {
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;
2793
2794         if (state->out_mem_ctx) {
2795                 mem_ctx = state->out_mem_ctx;
2796         } else {
2797                 mem_ctx = state;
2798         }
2799
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;
2805         }
2806
2807         /* Copy out parameters */
2808
2809         /* Copy result */
2810         state->orig.out.result = state->tmp.out.result;
2811
2812         /* Reset temporary structure */
2813         ZERO_STRUCT(state->tmp);
2814
2815         tevent_req_done(req);
2816 }
2817
2818 NTSTATUS rpccli_dfs_FlushFtTable_recv(struct tevent_req *req,
2819                                       TALLOC_CTX *mem_ctx,
2820                                       WERROR *result)
2821 {
2822         struct rpccli_dfs_FlushFtTable_state *state = tevent_req_data(
2823                 req, struct rpccli_dfs_FlushFtTable_state);
2824         NTSTATUS status;
2825
2826         if (tevent_req_is_nterror(req, &status)) {
2827                 tevent_req_received(req);
2828                 return status;
2829         }
2830
2831         /* Steal possbile out parameters to the callers context */
2832         talloc_steal(mem_ctx, state->out_mem_ctx);
2833
2834         /* Return result */
2835         *result = state->orig.out.result;
2836
2837         tevent_req_received(req);
2838         return NT_STATUS_OK;
2839 }
2840
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)
2846 {
2847         struct dfs_FlushFtTable r;
2848         NTSTATUS status;
2849
2850         /* In parameters */
2851         r.in.servername = servername;
2852         r.in.rootshare = rootshare;
2853
2854         status = cli->dispatch(cli,
2855                                 mem_ctx,
2856                                 &ndr_table_netdfs,
2857                                 NDR_DFS_FLUSHFTTABLE,
2858                                 &r);
2859
2860         if (!NT_STATUS_IS_OK(status)) {
2861                 return status;
2862         }
2863
2864         if (NT_STATUS_IS_ERR(status)) {
2865                 return status;
2866         }
2867
2868         /* Return variables */
2869
2870         /* Return result */
2871         if (werror) {
2872                 *werror = r.out.result;
2873         }
2874
2875         return werror_to_ntstatus(r.out.result);
2876 }
2877
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);
2883 };
2884
2885 static void rpccli_dfs_Add2_done(struct tevent_req *subreq);
2886
2887 struct tevent_req *rpccli_dfs_Add2_send(TALLOC_CTX *mem_ctx,
2888                                         struct tevent_context *ev,
2889                                         struct rpc_pipe_client *cli)
2890 {
2891         struct tevent_req *req;
2892         struct rpccli_dfs_Add2_state *state;
2893         struct tevent_req *subreq;
2894
2895         req = tevent_req_create(mem_ctx, &state,
2896                                 struct rpccli_dfs_Add2_state);
2897         if (req == NULL) {
2898                 return NULL;
2899         }
2900         state->out_mem_ctx = NULL;
2901         state->dispatch_recv = cli->dispatch_recv;
2902
2903         /* In parameters */
2904
2905         /* Out parameters */
2906
2907         /* Result */
2908         ZERO_STRUCT(state->orig.out.result);
2909
2910         /* make a temporary copy, that we pass to the dispatch function */
2911         state->tmp = state->orig;
2912
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);
2919         }
2920         tevent_req_set_callback(subreq, rpccli_dfs_Add2_done, req);
2921         return req;
2922 }
2923
2924 static void rpccli_dfs_Add2_done(struct tevent_req *subreq)
2925 {
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;
2932
2933         if (state->out_mem_ctx) {
2934                 mem_ctx = state->out_mem_ctx;
2935         } else {
2936                 mem_ctx = state;
2937         }
2938
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;
2944         }
2945
2946         /* Copy out parameters */
2947
2948         /* Copy result */
2949         state->orig.out.result = state->tmp.out.result;
2950
2951         /* Reset temporary structure */
2952         ZERO_STRUCT(state->tmp);
2953
2954         tevent_req_done(req);
2955 }
2956
2957 NTSTATUS rpccli_dfs_Add2_recv(struct tevent_req *req,
2958                               TALLOC_CTX *mem_ctx,
2959                               WERROR *result)
2960 {
2961         struct rpccli_dfs_Add2_state *state = tevent_req_data(
2962                 req, struct rpccli_dfs_Add2_state);
2963         NTSTATUS status;
2964
2965         if (tevent_req_is_nterror(req, &status)) {
2966                 tevent_req_received(req);
2967                 return status;
2968         }
2969
2970         /* Steal possbile out parameters to the callers context */
2971         talloc_steal(mem_ctx, state->out_mem_ctx);
2972
2973         /* Return result */
2974         *result = state->orig.out.result;
2975
2976         tevent_req_received(req);
2977         return NT_STATUS_OK;
2978 }
2979
2980 NTSTATUS rpccli_dfs_Add2(struct rpc_pipe_client *cli,
2981                          TALLOC_CTX *mem_ctx,
2982                          WERROR *werror)
2983 {
2984         struct dfs_Add2 r;
2985         NTSTATUS status;
2986
2987         /* In parameters */
2988
2989         status = cli->dispatch(cli,
2990                                 mem_ctx,
2991                                 &ndr_table_netdfs,
2992                                 NDR_DFS_ADD2,
2993                                 &r);
2994
2995         if (!NT_STATUS_IS_OK(status)) {
2996                 return status;
2997         }
2998
2999         if (NT_STATUS_IS_ERR(status)) {
3000                 return status;
3001         }
3002
3003         /* Return variables */
3004
3005         /* Return result */
3006         if (werror) {
3007                 *werror = r.out.result;
3008         }
3009
3010         return werror_to_ntstatus(r.out.result);
3011 }
3012
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);
3018 };
3019
3020 static void rpccli_dfs_Remove2_done(struct tevent_req *subreq);
3021
3022 struct tevent_req *rpccli_dfs_Remove2_send(TALLOC_CTX *mem_ctx,
3023                                            struct tevent_context *ev,
3024                                            struct rpc_pipe_client *cli)
3025 {
3026         struct tevent_req *req;
3027         struct rpccli_dfs_Remove2_state *state;
3028         struct tevent_req *subreq;
3029
3030         req = tevent_req_create(mem_ctx, &state,
3031                                 struct rpccli_dfs_Remove2_state);
3032         if (req == NULL) {
3033                 return NULL;
3034         }
3035         state->out_mem_ctx = NULL;
3036         state->dispatch_recv = cli->dispatch_recv;
3037
3038         /* In parameters */
3039
3040         /* Out parameters */
3041
3042         /* Result */
3043         ZERO_STRUCT(state->orig.out.result);
3044
3045         /* make a temporary copy, that we pass to the dispatch function */
3046         state->tmp = state->orig;
3047
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);
3054         }
3055         tevent_req_set_callback(subreq, rpccli_dfs_Remove2_done, req);
3056         return req;
3057 }
3058
3059 static void rpccli_dfs_Remove2_done(struct tevent_req *subreq)
3060 {
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;
3067
3068         if (state->out_mem_ctx) {
3069                 mem_ctx = state->out_mem_ctx;
3070         } else {
3071                 mem_ctx = state;
3072         }
3073
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;
3079         }
3080
3081         /* Copy out parameters */
3082
3083         /* Copy result */
3084         state->orig.out.result = state->tmp.out.result;
3085
3086         /* Reset temporary structure */
3087         ZERO_STRUCT(state->tmp);
3088
3089         tevent_req_done(req);
3090 }
3091
3092 NTSTATUS rpccli_dfs_Remove2_recv(struct tevent_req *req,
3093                                  TALLOC_CTX *mem_ctx,
3094                                  WERROR *result)
3095 {
3096         struct rpccli_dfs_Remove2_state *state = tevent_req_data(
3097                 req, struct rpccli_dfs_Remove2_state);
3098         NTSTATUS status;
3099
3100         if (tevent_req_is_nterror(req, &status)) {
3101                 tevent_req_received(req);
3102                 return status;
3103         }
3104
3105         /* Steal possbile out parameters to the callers context */
3106         talloc_steal(mem_ctx, state->out_mem_ctx);
3107
3108         /* Return result */
3109         *result = state->orig.out.result;
3110
3111         tevent_req_received(req);
3112         return NT_STATUS_OK;
3113 }
3114
3115 NTSTATUS rpccli_dfs_Remove2(struct rpc_pipe_client *cli,
3116                             TALLOC_CTX *mem_ctx,
3117                             WERROR *werror)
3118 {
3119         struct dfs_Remove2 r;
3120         NTSTATUS status;
3121
3122         /* In parameters */
3123
3124         status = cli->dispatch(cli,
3125                                 mem_ctx,
3126                                 &ndr_table_netdfs,
3127                                 NDR_DFS_REMOVE2,
3128                                 &r);
3129
3130         if (!NT_STATUS_IS_OK(status)) {
3131                 return status;
3132         }
3133
3134         if (NT_STATUS_IS_ERR(status)) {
3135                 return status;
3136         }
3137
3138         /* Return variables */
3139
3140         /* Return result */
3141         if (werror) {
3142                 *werror = r.out.result;
3143         }
3144
3145         return werror_to_ntstatus(r.out.result);
3146 }
3147
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);
3153 };
3154
3155 static void rpccli_dfs_EnumEx_done(struct tevent_req *subreq);
3156
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] */)
3165 {
3166         struct tevent_req *req;
3167         struct rpccli_dfs_EnumEx_state *state;
3168         struct tevent_req *subreq;
3169
3170         req = tevent_req_create(mem_ctx, &state,
3171                                 struct rpccli_dfs_EnumEx_state);
3172         if (req == NULL) {
3173                 return NULL;
3174         }
3175         state->out_mem_ctx = NULL;
3176         state->dispatch_recv = cli->dispatch_recv;
3177
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;
3184
3185         /* Out parameters */
3186         state->orig.out.info = _info;
3187         state->orig.out.total = _total;
3188
3189         /* Result */
3190         ZERO_STRUCT(state->orig.out.result);
3191
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);
3196         }
3197
3198         /* make a temporary copy, that we pass to the dispatch function */
3199         state->tmp = state->orig;
3200
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);
3207         }
3208         tevent_req_set_callback(subreq, rpccli_dfs_EnumEx_done, req);
3209         return req;
3210 }
3211
3212 static void rpccli_dfs_EnumEx_done(struct tevent_req *subreq)
3213 {
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;
3220
3221         if (state->out_mem_ctx) {
3222                 mem_ctx = state->out_mem_ctx;
3223         } else {
3224                 mem_ctx = state;
3225         }
3226
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;
3232         }
3233
3234         /* Copy out parameters */
3235         if (state->orig.out.info && state->tmp.out.info) {
3236                 *state->orig.out.info = *state->tmp.out.info;
3237         }
3238         if (state->orig.out.total && state->tmp.out.total) {
3239                 *state->orig.out.total = *state->tmp.out.total;
3240         }
3241
3242         /* Copy result */
3243         state->orig.out.result = state->tmp.out.result;
3244
3245         /* Reset temporary structure */
3246         ZERO_STRUCT(state->tmp);
3247
3248         tevent_req_done(req);
3249 }
3250
3251 NTSTATUS rpccli_dfs_EnumEx_recv(struct tevent_req *req,
3252                                 TALLOC_CTX *mem_ctx,
3253                                 WERROR *result)
3254 {
3255         struct rpccli_dfs_EnumEx_state *state = tevent_req_data(
3256                 req, struct rpccli_dfs_EnumEx_state);
3257         NTSTATUS status;
3258
3259         if (tevent_req_is_nterror(req, &status)) {
3260                 tevent_req_received(req);
3261                 return status;
3262         }
3263
3264         /* Steal possbile out parameters to the callers context */
3265         talloc_steal(mem_ctx, state->out_mem_ctx);
3266
3267         /* Return result */
3268         *result = state->orig.out.result;
3269
3270         tevent_req_received(req);
3271         return NT_STATUS_OK;
3272 }
3273
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)
3282 {
3283         struct dfs_EnumEx r;
3284         NTSTATUS status;
3285
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;
3292
3293         status = cli->dispatch(cli,
3294                                 mem_ctx,
3295                                 &ndr_table_netdfs,
3296                                 NDR_DFS_ENUMEX,
3297                                 &r);
3298
3299         if (!NT_STATUS_IS_OK(status)) {
3300                 return status;
3301         }
3302
3303         if (NT_STATUS_IS_ERR(status)) {
3304                 return status;
3305         }
3306
3307         /* Return variables */
3308         if (info && r.out.info) {
3309                 *info = *r.out.info;
3310         }
3311         if (total && r.out.total) {
3312                 *total = *r.out.total;
3313         }
3314
3315         /* Return result */
3316         if (werror) {
3317                 *werror = r.out.result;
3318         }
3319
3320         return werror_to_ntstatus(r.out.result);
3321 }
3322
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);
3328 };
3329
3330 static void rpccli_dfs_SetInfo2_done(struct tevent_req *subreq);
3331
3332 struct tevent_req *rpccli_dfs_SetInfo2_send(TALLOC_CTX *mem_ctx,
3333                                             struct tevent_context *ev,
3334                                             struct rpc_pipe_client *cli)
3335 {
3336         struct tevent_req *req;
3337         struct rpccli_dfs_SetInfo2_state *state;
3338         struct tevent_req *subreq;
3339
3340         req = tevent_req_create(mem_ctx, &state,
3341                                 struct rpccli_dfs_SetInfo2_state);
3342         if (req == NULL) {
3343                 return NULL;
3344         }
3345         state->out_mem_ctx = NULL;
3346         state->dispatch_recv = cli->dispatch_recv;
3347
3348         /* In parameters */
3349
3350         /* Out parameters */
3351
3352         /* Result */
3353         ZERO_STRUCT(state->orig.out.result);
3354
3355         /* make a temporary copy, that we pass to the dispatch function */
3356         state->tmp = state->orig;
3357
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);
3364         }
3365         tevent_req_set_callback(subreq, rpccli_dfs_SetInfo2_done, req);
3366         return req;
3367 }
3368
3369 static void rpccli_dfs_SetInfo2_done(struct tevent_req *subreq)
3370 {
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;
3377
3378         if (state->out_mem_ctx) {
3379                 mem_ctx = state->out_mem_ctx;
3380         } else {
3381                 mem_ctx = state;
3382         }
3383
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;
3389         }
3390
3391         /* Copy out parameters */
3392
3393         /* Copy result */
3394         state->orig.out.result = state->tmp.out.result;
3395
3396         /* Reset temporary structure */
3397         ZERO_STRUCT(state->tmp);
3398
3399         tevent_req_done(req);
3400 }
3401
3402 NTSTATUS rpccli_dfs_SetInfo2_recv(struct tevent_req *req,
3403                                   TALLOC_CTX *mem_ctx,
3404                                   WERROR *result)
3405 {
3406         struct rpccli_dfs_SetInfo2_state *state = tevent_req_data(
3407                 req, struct rpccli_dfs_SetInfo2_state);
3408         NTSTATUS status;
3409
3410         if (tevent_req_is_nterror(req, &status)) {
3411                 tevent_req_received(req);
3412                 return status;
3413         }
3414
3415         /* Steal possbile out parameters to the callers context */
3416         talloc_steal(mem_ctx, state->out_mem_ctx);
3417
3418         /* Return result */
3419         *result = state->orig.out.result;
3420
3421         tevent_req_received(req);
3422         return NT_STATUS_OK;
3423 }
3424
3425 NTSTATUS rpccli_dfs_SetInfo2(struct rpc_pipe_client *cli,
3426                              TALLOC_CTX *mem_ctx,
3427                              WERROR *werror)
3428 {
3429         struct dfs_SetInfo2 r;
3430         NTSTATUS status;
3431
3432         /* In parameters */
3433
3434         status = cli->dispatch(cli,
3435                                 mem_ctx,
3436                                 &ndr_table_netdfs,
3437                                 NDR_DFS_SETINFO2,
3438                                 &r);
3439
3440         if (!NT_STATUS_IS_OK(status)) {
3441                 return status;
3442         }
3443
3444         if (NT_STATUS_IS_ERR(status)) {
3445                 return status;
3446         }
3447
3448         /* Return variables */
3449
3450         /* Return result */
3451         if (werror) {
3452                 *werror = r.out.result;
3453         }
3454
3455         return werror_to_ntstatus(r.out.result);
3456 }
3457