git add -f bin/default/librpc/gen_ndr/*.[ch] bin/default/source*/librpc/gen_ndr/...
[metze/samba/wip.git] / bin.gen_ndr / default / librpc / gen_ndr / ndr_dfs_c.c
1 /* client functions auto-generated by pidl */
2
3 #include "includes.h"
4 #include <tevent.h>
5 #include "lib/util/tevent_ntstatus.h"
6 #include "bin/default/librpc/gen_ndr/ndr_dfs.h"
7 #include "bin/default/librpc/gen_ndr/ndr_dfs_c.h"
8
9 /* netdfs - client functions generated by pidl */
10
11 struct dcerpc_dfs_GetManagerVersion_r_state {
12         TALLOC_CTX *out_mem_ctx;
13 };
14
15 static void dcerpc_dfs_GetManagerVersion_r_done(struct tevent_req *subreq);
16
17 struct tevent_req *dcerpc_dfs_GetManagerVersion_r_send(TALLOC_CTX *mem_ctx,
18         struct tevent_context *ev,
19         struct dcerpc_binding_handle *h,
20         struct dfs_GetManagerVersion *r)
21 {
22         struct tevent_req *req;
23         struct dcerpc_dfs_GetManagerVersion_r_state *state;
24         struct tevent_req *subreq;
25
26         req = tevent_req_create(mem_ctx, &state,
27                                 struct dcerpc_dfs_GetManagerVersion_r_state);
28         if (req == NULL) {
29                 return NULL;
30         }
31
32         state->out_mem_ctx = talloc_new(state);
33         if (tevent_req_nomem(state->out_mem_ctx, req)) {
34                 return tevent_req_post(req, ev);
35         }
36
37         subreq = dcerpc_binding_handle_call_send(state, ev, h,
38                         NULL, &ndr_table_netdfs,
39                         NDR_DFS_GETMANAGERVERSION, state->out_mem_ctx, r);
40         if (tevent_req_nomem(subreq, req)) {
41                 return tevent_req_post(req, ev);
42         }
43         tevent_req_set_callback(subreq, dcerpc_dfs_GetManagerVersion_r_done, req);
44
45         return req;
46 }
47
48 static void dcerpc_dfs_GetManagerVersion_r_done(struct tevent_req *subreq)
49 {
50         struct tevent_req *req =
51                 tevent_req_callback_data(subreq,
52                 struct tevent_req);
53         NTSTATUS status;
54
55         status = dcerpc_binding_handle_call_recv(subreq);
56         TALLOC_FREE(subreq);
57         if (tevent_req_nterror(req, status)) {
58                 return;
59         }
60
61         tevent_req_done(req);
62 }
63
64 NTSTATUS dcerpc_dfs_GetManagerVersion_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
65 {
66         struct dcerpc_dfs_GetManagerVersion_r_state *state =
67                 tevent_req_data(req,
68                 struct dcerpc_dfs_GetManagerVersion_r_state);
69         NTSTATUS status;
70
71         if (tevent_req_is_nterror(req, &status)) {
72                 tevent_req_received(req);
73                 return status;
74         }
75
76         talloc_steal(mem_ctx, state->out_mem_ctx);
77
78         tevent_req_received(req);
79         return NT_STATUS_OK;
80 }
81
82 NTSTATUS dcerpc_dfs_GetManagerVersion_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct dfs_GetManagerVersion *r)
83 {
84         NTSTATUS status;
85
86         status = dcerpc_binding_handle_call(h,
87                         NULL, &ndr_table_netdfs,
88                         NDR_DFS_GETMANAGERVERSION, mem_ctx, r);
89
90         return status;
91 }
92
93 struct dcerpc_dfs_GetManagerVersion_state {
94         struct dfs_GetManagerVersion orig;
95         struct dfs_GetManagerVersion tmp;
96         TALLOC_CTX *out_mem_ctx;
97 };
98
99 static void dcerpc_dfs_GetManagerVersion_done(struct tevent_req *subreq);
100
101 struct tevent_req *dcerpc_dfs_GetManagerVersion_send(TALLOC_CTX *mem_ctx,
102                                                      struct tevent_context *ev,
103                                                      struct dcerpc_binding_handle *h,
104                                                      enum dfs_ManagerVersion *_version /* [out] [ref] */)
105 {
106         struct tevent_req *req;
107         struct dcerpc_dfs_GetManagerVersion_state *state;
108         struct tevent_req *subreq;
109
110         req = tevent_req_create(mem_ctx, &state,
111                                 struct dcerpc_dfs_GetManagerVersion_state);
112         if (req == NULL) {
113                 return NULL;
114         }
115         state->out_mem_ctx = NULL;
116
117         /* In parameters */
118
119         /* Out parameters */
120         state->orig.out.version = _version;
121
122         state->out_mem_ctx = talloc_named_const(state, 0,
123                              "dcerpc_dfs_GetManagerVersion_out_memory");
124         if (tevent_req_nomem(state->out_mem_ctx, req)) {
125                 return tevent_req_post(req, ev);
126         }
127
128         /* make a temporary copy, that we pass to the dispatch function */
129         state->tmp = state->orig;
130
131         subreq = dcerpc_dfs_GetManagerVersion_r_send(state, ev, h, &state->tmp);
132         if (tevent_req_nomem(subreq, req)) {
133                 return tevent_req_post(req, ev);
134         }
135         tevent_req_set_callback(subreq, dcerpc_dfs_GetManagerVersion_done, req);
136         return req;
137 }
138
139 static void dcerpc_dfs_GetManagerVersion_done(struct tevent_req *subreq)
140 {
141         struct tevent_req *req = tevent_req_callback_data(
142                 subreq, struct tevent_req);
143         struct dcerpc_dfs_GetManagerVersion_state *state = tevent_req_data(
144                 req, struct dcerpc_dfs_GetManagerVersion_state);
145         NTSTATUS status;
146         TALLOC_CTX *mem_ctx;
147
148         if (state->out_mem_ctx) {
149                 mem_ctx = state->out_mem_ctx;
150         } else {
151                 mem_ctx = state;
152         }
153
154         status = dcerpc_dfs_GetManagerVersion_r_recv(subreq, mem_ctx);
155         TALLOC_FREE(subreq);
156         if (tevent_req_nterror(req, status)) {
157                 return;
158         }
159
160         /* Copy out parameters */
161         *state->orig.out.version = *state->tmp.out.version;
162
163         /* Reset temporary structure */
164         ZERO_STRUCT(state->tmp);
165
166         tevent_req_done(req);
167 }
168
169 NTSTATUS dcerpc_dfs_GetManagerVersion_recv(struct tevent_req *req,
170                                            TALLOC_CTX *mem_ctx)
171 {
172         struct dcerpc_dfs_GetManagerVersion_state *state = tevent_req_data(
173                 req, struct dcerpc_dfs_GetManagerVersion_state);
174         NTSTATUS status;
175
176         if (tevent_req_is_nterror(req, &status)) {
177                 tevent_req_received(req);
178                 return status;
179         }
180
181         /* Steal possible out parameters to the callers context */
182         talloc_steal(mem_ctx, state->out_mem_ctx);
183
184         tevent_req_received(req);
185         return NT_STATUS_OK;
186 }
187
188 NTSTATUS dcerpc_dfs_GetManagerVersion(struct dcerpc_binding_handle *h,
189                                       TALLOC_CTX *mem_ctx,
190                                       enum dfs_ManagerVersion *_version /* [out] [ref] */)
191 {
192         struct dfs_GetManagerVersion r;
193         NTSTATUS status;
194
195         /* In parameters */
196
197         status = dcerpc_dfs_GetManagerVersion_r(h, mem_ctx, &r);
198         if (!NT_STATUS_IS_OK(status)) {
199                 return status;
200         }
201
202         /* Return variables */
203         *_version = *r.out.version;
204
205         /* Return result */
206
207         return NT_STATUS_OK;
208 }
209
210 struct dcerpc_dfs_Add_r_state {
211         TALLOC_CTX *out_mem_ctx;
212 };
213
214 static void dcerpc_dfs_Add_r_done(struct tevent_req *subreq);
215
216 struct tevent_req *dcerpc_dfs_Add_r_send(TALLOC_CTX *mem_ctx,
217         struct tevent_context *ev,
218         struct dcerpc_binding_handle *h,
219         struct dfs_Add *r)
220 {
221         struct tevent_req *req;
222         struct dcerpc_dfs_Add_r_state *state;
223         struct tevent_req *subreq;
224
225         req = tevent_req_create(mem_ctx, &state,
226                                 struct dcerpc_dfs_Add_r_state);
227         if (req == NULL) {
228                 return NULL;
229         }
230
231         state->out_mem_ctx = NULL;
232
233         subreq = dcerpc_binding_handle_call_send(state, ev, h,
234                         NULL, &ndr_table_netdfs,
235                         NDR_DFS_ADD, state, r);
236         if (tevent_req_nomem(subreq, req)) {
237                 return tevent_req_post(req, ev);
238         }
239         tevent_req_set_callback(subreq, dcerpc_dfs_Add_r_done, req);
240
241         return req;
242 }
243
244 static void dcerpc_dfs_Add_r_done(struct tevent_req *subreq)
245 {
246         struct tevent_req *req =
247                 tevent_req_callback_data(subreq,
248                 struct tevent_req);
249         NTSTATUS status;
250
251         status = dcerpc_binding_handle_call_recv(subreq);
252         TALLOC_FREE(subreq);
253         if (tevent_req_nterror(req, status)) {
254                 return;
255         }
256
257         tevent_req_done(req);
258 }
259
260 NTSTATUS dcerpc_dfs_Add_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
261 {
262         struct dcerpc_dfs_Add_r_state *state =
263                 tevent_req_data(req,
264                 struct dcerpc_dfs_Add_r_state);
265         NTSTATUS status;
266
267         if (tevent_req_is_nterror(req, &status)) {
268                 tevent_req_received(req);
269                 return status;
270         }
271
272         talloc_steal(mem_ctx, state->out_mem_ctx);
273
274         tevent_req_received(req);
275         return NT_STATUS_OK;
276 }
277
278 NTSTATUS dcerpc_dfs_Add_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct dfs_Add *r)
279 {
280         NTSTATUS status;
281
282         status = dcerpc_binding_handle_call(h,
283                         NULL, &ndr_table_netdfs,
284                         NDR_DFS_ADD, mem_ctx, r);
285
286         return status;
287 }
288
289 struct dcerpc_dfs_Add_state {
290         struct dfs_Add orig;
291         struct dfs_Add tmp;
292         TALLOC_CTX *out_mem_ctx;
293 };
294
295 static void dcerpc_dfs_Add_done(struct tevent_req *subreq);
296
297 struct tevent_req *dcerpc_dfs_Add_send(TALLOC_CTX *mem_ctx,
298                                        struct tevent_context *ev,
299                                        struct dcerpc_binding_handle *h,
300                                        const char *_path /* [in] [ref,charset(UTF16)] */,
301                                        const char *_server /* [in] [ref,charset(UTF16)] */,
302                                        const char *_share /* [in] [unique,charset(UTF16)] */,
303                                        const char *_comment /* [in] [unique,charset(UTF16)] */,
304                                        uint32_t _flags /* [in]  */)
305 {
306         struct tevent_req *req;
307         struct dcerpc_dfs_Add_state *state;
308         struct tevent_req *subreq;
309
310         req = tevent_req_create(mem_ctx, &state,
311                                 struct dcerpc_dfs_Add_state);
312         if (req == NULL) {
313                 return NULL;
314         }
315         state->out_mem_ctx = NULL;
316
317         /* In parameters */
318         state->orig.in.path = _path;
319         state->orig.in.server = _server;
320         state->orig.in.share = _share;
321         state->orig.in.comment = _comment;
322         state->orig.in.flags = _flags;
323
324         /* Out parameters */
325
326         /* Result */
327         ZERO_STRUCT(state->orig.out.result);
328
329         /* make a temporary copy, that we pass to the dispatch function */
330         state->tmp = state->orig;
331
332         subreq = dcerpc_dfs_Add_r_send(state, ev, h, &state->tmp);
333         if (tevent_req_nomem(subreq, req)) {
334                 return tevent_req_post(req, ev);
335         }
336         tevent_req_set_callback(subreq, dcerpc_dfs_Add_done, req);
337         return req;
338 }
339
340 static void dcerpc_dfs_Add_done(struct tevent_req *subreq)
341 {
342         struct tevent_req *req = tevent_req_callback_data(
343                 subreq, struct tevent_req);
344         struct dcerpc_dfs_Add_state *state = tevent_req_data(
345                 req, struct dcerpc_dfs_Add_state);
346         NTSTATUS status;
347         TALLOC_CTX *mem_ctx;
348
349         if (state->out_mem_ctx) {
350                 mem_ctx = state->out_mem_ctx;
351         } else {
352                 mem_ctx = state;
353         }
354
355         status = dcerpc_dfs_Add_r_recv(subreq, mem_ctx);
356         TALLOC_FREE(subreq);
357         if (tevent_req_nterror(req, status)) {
358                 return;
359         }
360
361         /* Copy out parameters */
362
363         /* Copy result */
364         state->orig.out.result = state->tmp.out.result;
365
366         /* Reset temporary structure */
367         ZERO_STRUCT(state->tmp);
368
369         tevent_req_done(req);
370 }
371
372 NTSTATUS dcerpc_dfs_Add_recv(struct tevent_req *req,
373                              TALLOC_CTX *mem_ctx,
374                              WERROR *result)
375 {
376         struct dcerpc_dfs_Add_state *state = tevent_req_data(
377                 req, struct dcerpc_dfs_Add_state);
378         NTSTATUS status;
379
380         if (tevent_req_is_nterror(req, &status)) {
381                 tevent_req_received(req);
382                 return status;
383         }
384
385         /* Steal possible out parameters to the callers context */
386         talloc_steal(mem_ctx, state->out_mem_ctx);
387
388         /* Return result */
389         *result = state->orig.out.result;
390
391         tevent_req_received(req);
392         return NT_STATUS_OK;
393 }
394
395 NTSTATUS dcerpc_dfs_Add(struct dcerpc_binding_handle *h,
396                         TALLOC_CTX *mem_ctx,
397                         const char *_path /* [in] [ref,charset(UTF16)] */,
398                         const char *_server /* [in] [ref,charset(UTF16)] */,
399                         const char *_share /* [in] [unique,charset(UTF16)] */,
400                         const char *_comment /* [in] [unique,charset(UTF16)] */,
401                         uint32_t _flags /* [in]  */,
402                         WERROR *result)
403 {
404         struct dfs_Add r;
405         NTSTATUS status;
406
407         /* In parameters */
408         r.in.path = _path;
409         r.in.server = _server;
410         r.in.share = _share;
411         r.in.comment = _comment;
412         r.in.flags = _flags;
413
414         status = dcerpc_dfs_Add_r(h, mem_ctx, &r);
415         if (!NT_STATUS_IS_OK(status)) {
416                 return status;
417         }
418
419         /* Return variables */
420
421         /* Return result */
422         *result = r.out.result;
423
424         return NT_STATUS_OK;
425 }
426
427 struct dcerpc_dfs_Remove_r_state {
428         TALLOC_CTX *out_mem_ctx;
429 };
430
431 static void dcerpc_dfs_Remove_r_done(struct tevent_req *subreq);
432
433 struct tevent_req *dcerpc_dfs_Remove_r_send(TALLOC_CTX *mem_ctx,
434         struct tevent_context *ev,
435         struct dcerpc_binding_handle *h,
436         struct dfs_Remove *r)
437 {
438         struct tevent_req *req;
439         struct dcerpc_dfs_Remove_r_state *state;
440         struct tevent_req *subreq;
441
442         req = tevent_req_create(mem_ctx, &state,
443                                 struct dcerpc_dfs_Remove_r_state);
444         if (req == NULL) {
445                 return NULL;
446         }
447
448         state->out_mem_ctx = NULL;
449
450         subreq = dcerpc_binding_handle_call_send(state, ev, h,
451                         NULL, &ndr_table_netdfs,
452                         NDR_DFS_REMOVE, state, r);
453         if (tevent_req_nomem(subreq, req)) {
454                 return tevent_req_post(req, ev);
455         }
456         tevent_req_set_callback(subreq, dcerpc_dfs_Remove_r_done, req);
457
458         return req;
459 }
460
461 static void dcerpc_dfs_Remove_r_done(struct tevent_req *subreq)
462 {
463         struct tevent_req *req =
464                 tevent_req_callback_data(subreq,
465                 struct tevent_req);
466         NTSTATUS status;
467
468         status = dcerpc_binding_handle_call_recv(subreq);
469         TALLOC_FREE(subreq);
470         if (tevent_req_nterror(req, status)) {
471                 return;
472         }
473
474         tevent_req_done(req);
475 }
476
477 NTSTATUS dcerpc_dfs_Remove_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
478 {
479         struct dcerpc_dfs_Remove_r_state *state =
480                 tevent_req_data(req,
481                 struct dcerpc_dfs_Remove_r_state);
482         NTSTATUS status;
483
484         if (tevent_req_is_nterror(req, &status)) {
485                 tevent_req_received(req);
486                 return status;
487         }
488
489         talloc_steal(mem_ctx, state->out_mem_ctx);
490
491         tevent_req_received(req);
492         return NT_STATUS_OK;
493 }
494
495 NTSTATUS dcerpc_dfs_Remove_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct dfs_Remove *r)
496 {
497         NTSTATUS status;
498
499         status = dcerpc_binding_handle_call(h,
500                         NULL, &ndr_table_netdfs,
501                         NDR_DFS_REMOVE, mem_ctx, r);
502
503         return status;
504 }
505
506 struct dcerpc_dfs_Remove_state {
507         struct dfs_Remove orig;
508         struct dfs_Remove tmp;
509         TALLOC_CTX *out_mem_ctx;
510 };
511
512 static void dcerpc_dfs_Remove_done(struct tevent_req *subreq);
513
514 struct tevent_req *dcerpc_dfs_Remove_send(TALLOC_CTX *mem_ctx,
515                                           struct tevent_context *ev,
516                                           struct dcerpc_binding_handle *h,
517                                           const char *_dfs_entry_path /* [in] [ref,charset(UTF16)] */,
518                                           const char *_servername /* [in] [unique,charset(UTF16)] */,
519                                           const char *_sharename /* [in] [unique,charset(UTF16)] */)
520 {
521         struct tevent_req *req;
522         struct dcerpc_dfs_Remove_state *state;
523         struct tevent_req *subreq;
524
525         req = tevent_req_create(mem_ctx, &state,
526                                 struct dcerpc_dfs_Remove_state);
527         if (req == NULL) {
528                 return NULL;
529         }
530         state->out_mem_ctx = NULL;
531
532         /* In parameters */
533         state->orig.in.dfs_entry_path = _dfs_entry_path;
534         state->orig.in.servername = _servername;
535         state->orig.in.sharename = _sharename;
536
537         /* Out parameters */
538
539         /* Result */
540         ZERO_STRUCT(state->orig.out.result);
541
542         /* make a temporary copy, that we pass to the dispatch function */
543         state->tmp = state->orig;
544
545         subreq = dcerpc_dfs_Remove_r_send(state, ev, h, &state->tmp);
546         if (tevent_req_nomem(subreq, req)) {
547                 return tevent_req_post(req, ev);
548         }
549         tevent_req_set_callback(subreq, dcerpc_dfs_Remove_done, req);
550         return req;
551 }
552
553 static void dcerpc_dfs_Remove_done(struct tevent_req *subreq)
554 {
555         struct tevent_req *req = tevent_req_callback_data(
556                 subreq, struct tevent_req);
557         struct dcerpc_dfs_Remove_state *state = tevent_req_data(
558                 req, struct dcerpc_dfs_Remove_state);
559         NTSTATUS status;
560         TALLOC_CTX *mem_ctx;
561
562         if (state->out_mem_ctx) {
563                 mem_ctx = state->out_mem_ctx;
564         } else {
565                 mem_ctx = state;
566         }
567
568         status = dcerpc_dfs_Remove_r_recv(subreq, mem_ctx);
569         TALLOC_FREE(subreq);
570         if (tevent_req_nterror(req, status)) {
571                 return;
572         }
573
574         /* Copy out parameters */
575
576         /* Copy result */
577         state->orig.out.result = state->tmp.out.result;
578
579         /* Reset temporary structure */
580         ZERO_STRUCT(state->tmp);
581
582         tevent_req_done(req);
583 }
584
585 NTSTATUS dcerpc_dfs_Remove_recv(struct tevent_req *req,
586                                 TALLOC_CTX *mem_ctx,
587                                 WERROR *result)
588 {
589         struct dcerpc_dfs_Remove_state *state = tevent_req_data(
590                 req, struct dcerpc_dfs_Remove_state);
591         NTSTATUS status;
592
593         if (tevent_req_is_nterror(req, &status)) {
594                 tevent_req_received(req);
595                 return status;
596         }
597
598         /* Steal possible out parameters to the callers context */
599         talloc_steal(mem_ctx, state->out_mem_ctx);
600
601         /* Return result */
602         *result = state->orig.out.result;
603
604         tevent_req_received(req);
605         return NT_STATUS_OK;
606 }
607
608 NTSTATUS dcerpc_dfs_Remove(struct dcerpc_binding_handle *h,
609                            TALLOC_CTX *mem_ctx,
610                            const char *_dfs_entry_path /* [in] [ref,charset(UTF16)] */,
611                            const char *_servername /* [in] [unique,charset(UTF16)] */,
612                            const char *_sharename /* [in] [unique,charset(UTF16)] */,
613                            WERROR *result)
614 {
615         struct dfs_Remove r;
616         NTSTATUS status;
617
618         /* In parameters */
619         r.in.dfs_entry_path = _dfs_entry_path;
620         r.in.servername = _servername;
621         r.in.sharename = _sharename;
622
623         status = dcerpc_dfs_Remove_r(h, mem_ctx, &r);
624         if (!NT_STATUS_IS_OK(status)) {
625                 return status;
626         }
627
628         /* Return variables */
629
630         /* Return result */
631         *result = r.out.result;
632
633         return NT_STATUS_OK;
634 }
635
636 struct dcerpc_dfs_SetInfo_r_state {
637         TALLOC_CTX *out_mem_ctx;
638 };
639
640 static void dcerpc_dfs_SetInfo_r_done(struct tevent_req *subreq);
641
642 struct tevent_req *dcerpc_dfs_SetInfo_r_send(TALLOC_CTX *mem_ctx,
643         struct tevent_context *ev,
644         struct dcerpc_binding_handle *h,
645         struct dfs_SetInfo *r)
646 {
647         struct tevent_req *req;
648         struct dcerpc_dfs_SetInfo_r_state *state;
649         struct tevent_req *subreq;
650
651         req = tevent_req_create(mem_ctx, &state,
652                                 struct dcerpc_dfs_SetInfo_r_state);
653         if (req == NULL) {
654                 return NULL;
655         }
656
657         state->out_mem_ctx = NULL;
658
659         subreq = dcerpc_binding_handle_call_send(state, ev, h,
660                         NULL, &ndr_table_netdfs,
661                         NDR_DFS_SETINFO, state, r);
662         if (tevent_req_nomem(subreq, req)) {
663                 return tevent_req_post(req, ev);
664         }
665         tevent_req_set_callback(subreq, dcerpc_dfs_SetInfo_r_done, req);
666
667         return req;
668 }
669
670 static void dcerpc_dfs_SetInfo_r_done(struct tevent_req *subreq)
671 {
672         struct tevent_req *req =
673                 tevent_req_callback_data(subreq,
674                 struct tevent_req);
675         NTSTATUS status;
676
677         status = dcerpc_binding_handle_call_recv(subreq);
678         TALLOC_FREE(subreq);
679         if (tevent_req_nterror(req, status)) {
680                 return;
681         }
682
683         tevent_req_done(req);
684 }
685
686 NTSTATUS dcerpc_dfs_SetInfo_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
687 {
688         struct dcerpc_dfs_SetInfo_r_state *state =
689                 tevent_req_data(req,
690                 struct dcerpc_dfs_SetInfo_r_state);
691         NTSTATUS status;
692
693         if (tevent_req_is_nterror(req, &status)) {
694                 tevent_req_received(req);
695                 return status;
696         }
697
698         talloc_steal(mem_ctx, state->out_mem_ctx);
699
700         tevent_req_received(req);
701         return NT_STATUS_OK;
702 }
703
704 NTSTATUS dcerpc_dfs_SetInfo_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct dfs_SetInfo *r)
705 {
706         NTSTATUS status;
707
708         status = dcerpc_binding_handle_call(h,
709                         NULL, &ndr_table_netdfs,
710                         NDR_DFS_SETINFO, mem_ctx, r);
711
712         return status;
713 }
714
715 struct dcerpc_dfs_SetInfo_state {
716         struct dfs_SetInfo orig;
717         struct dfs_SetInfo tmp;
718         TALLOC_CTX *out_mem_ctx;
719 };
720
721 static void dcerpc_dfs_SetInfo_done(struct tevent_req *subreq);
722
723 struct tevent_req *dcerpc_dfs_SetInfo_send(TALLOC_CTX *mem_ctx,
724                                            struct tevent_context *ev,
725                                            struct dcerpc_binding_handle *h,
726                                            const char *_dfs_entry_path /* [in] [charset(UTF16)] */,
727                                            const char *_servername /* [in] [unique,charset(UTF16)] */,
728                                            const char *_sharename /* [in] [unique,charset(UTF16)] */,
729                                            uint32_t _level /* [in]  */,
730                                            union dfs_Info *_info /* [in] [ref,switch_is(level)] */)
731 {
732         struct tevent_req *req;
733         struct dcerpc_dfs_SetInfo_state *state;
734         struct tevent_req *subreq;
735
736         req = tevent_req_create(mem_ctx, &state,
737                                 struct dcerpc_dfs_SetInfo_state);
738         if (req == NULL) {
739                 return NULL;
740         }
741         state->out_mem_ctx = NULL;
742
743         /* In parameters */
744         state->orig.in.dfs_entry_path = _dfs_entry_path;
745         state->orig.in.servername = _servername;
746         state->orig.in.sharename = _sharename;
747         state->orig.in.level = _level;
748         state->orig.in.info = _info;
749
750         /* Out parameters */
751
752         /* Result */
753         ZERO_STRUCT(state->orig.out.result);
754
755         /* make a temporary copy, that we pass to the dispatch function */
756         state->tmp = state->orig;
757
758         subreq = dcerpc_dfs_SetInfo_r_send(state, ev, h, &state->tmp);
759         if (tevent_req_nomem(subreq, req)) {
760                 return tevent_req_post(req, ev);
761         }
762         tevent_req_set_callback(subreq, dcerpc_dfs_SetInfo_done, req);
763         return req;
764 }
765
766 static void dcerpc_dfs_SetInfo_done(struct tevent_req *subreq)
767 {
768         struct tevent_req *req = tevent_req_callback_data(
769                 subreq, struct tevent_req);
770         struct dcerpc_dfs_SetInfo_state *state = tevent_req_data(
771                 req, struct dcerpc_dfs_SetInfo_state);
772         NTSTATUS status;
773         TALLOC_CTX *mem_ctx;
774
775         if (state->out_mem_ctx) {
776                 mem_ctx = state->out_mem_ctx;
777         } else {
778                 mem_ctx = state;
779         }
780
781         status = dcerpc_dfs_SetInfo_r_recv(subreq, mem_ctx);
782         TALLOC_FREE(subreq);
783         if (tevent_req_nterror(req, status)) {
784                 return;
785         }
786
787         /* Copy out parameters */
788
789         /* Copy result */
790         state->orig.out.result = state->tmp.out.result;
791
792         /* Reset temporary structure */
793         ZERO_STRUCT(state->tmp);
794
795         tevent_req_done(req);
796 }
797
798 NTSTATUS dcerpc_dfs_SetInfo_recv(struct tevent_req *req,
799                                  TALLOC_CTX *mem_ctx,
800                                  WERROR *result)
801 {
802         struct dcerpc_dfs_SetInfo_state *state = tevent_req_data(
803                 req, struct dcerpc_dfs_SetInfo_state);
804         NTSTATUS status;
805
806         if (tevent_req_is_nterror(req, &status)) {
807                 tevent_req_received(req);
808                 return status;
809         }
810
811         /* Steal possible out parameters to the callers context */
812         talloc_steal(mem_ctx, state->out_mem_ctx);
813
814         /* Return result */
815         *result = state->orig.out.result;
816
817         tevent_req_received(req);
818         return NT_STATUS_OK;
819 }
820
821 NTSTATUS dcerpc_dfs_SetInfo(struct dcerpc_binding_handle *h,
822                             TALLOC_CTX *mem_ctx,
823                             const char *_dfs_entry_path /* [in] [charset(UTF16)] */,
824                             const char *_servername /* [in] [unique,charset(UTF16)] */,
825                             const char *_sharename /* [in] [unique,charset(UTF16)] */,
826                             uint32_t _level /* [in]  */,
827                             union dfs_Info *_info /* [in] [ref,switch_is(level)] */,
828                             WERROR *result)
829 {
830         struct dfs_SetInfo r;
831         NTSTATUS status;
832
833         /* In parameters */
834         r.in.dfs_entry_path = _dfs_entry_path;
835         r.in.servername = _servername;
836         r.in.sharename = _sharename;
837         r.in.level = _level;
838         r.in.info = _info;
839
840         status = dcerpc_dfs_SetInfo_r(h, mem_ctx, &r);
841         if (!NT_STATUS_IS_OK(status)) {
842                 return status;
843         }
844
845         /* Return variables */
846
847         /* Return result */
848         *result = r.out.result;
849
850         return NT_STATUS_OK;
851 }
852
853 struct dcerpc_dfs_GetInfo_r_state {
854         TALLOC_CTX *out_mem_ctx;
855 };
856
857 static void dcerpc_dfs_GetInfo_r_done(struct tevent_req *subreq);
858
859 struct tevent_req *dcerpc_dfs_GetInfo_r_send(TALLOC_CTX *mem_ctx,
860         struct tevent_context *ev,
861         struct dcerpc_binding_handle *h,
862         struct dfs_GetInfo *r)
863 {
864         struct tevent_req *req;
865         struct dcerpc_dfs_GetInfo_r_state *state;
866         struct tevent_req *subreq;
867
868         req = tevent_req_create(mem_ctx, &state,
869                                 struct dcerpc_dfs_GetInfo_r_state);
870         if (req == NULL) {
871                 return NULL;
872         }
873
874         state->out_mem_ctx = talloc_new(state);
875         if (tevent_req_nomem(state->out_mem_ctx, req)) {
876                 return tevent_req_post(req, ev);
877         }
878
879         subreq = dcerpc_binding_handle_call_send(state, ev, h,
880                         NULL, &ndr_table_netdfs,
881                         NDR_DFS_GETINFO, state->out_mem_ctx, r);
882         if (tevent_req_nomem(subreq, req)) {
883                 return tevent_req_post(req, ev);
884         }
885         tevent_req_set_callback(subreq, dcerpc_dfs_GetInfo_r_done, req);
886
887         return req;
888 }
889
890 static void dcerpc_dfs_GetInfo_r_done(struct tevent_req *subreq)
891 {
892         struct tevent_req *req =
893                 tevent_req_callback_data(subreq,
894                 struct tevent_req);
895         NTSTATUS status;
896
897         status = dcerpc_binding_handle_call_recv(subreq);
898         TALLOC_FREE(subreq);
899         if (tevent_req_nterror(req, status)) {
900                 return;
901         }
902
903         tevent_req_done(req);
904 }
905
906 NTSTATUS dcerpc_dfs_GetInfo_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
907 {
908         struct dcerpc_dfs_GetInfo_r_state *state =
909                 tevent_req_data(req,
910                 struct dcerpc_dfs_GetInfo_r_state);
911         NTSTATUS status;
912
913         if (tevent_req_is_nterror(req, &status)) {
914                 tevent_req_received(req);
915                 return status;
916         }
917
918         talloc_steal(mem_ctx, state->out_mem_ctx);
919
920         tevent_req_received(req);
921         return NT_STATUS_OK;
922 }
923
924 NTSTATUS dcerpc_dfs_GetInfo_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct dfs_GetInfo *r)
925 {
926         NTSTATUS status;
927
928         status = dcerpc_binding_handle_call(h,
929                         NULL, &ndr_table_netdfs,
930                         NDR_DFS_GETINFO, mem_ctx, r);
931
932         return status;
933 }
934
935 struct dcerpc_dfs_GetInfo_state {
936         struct dfs_GetInfo orig;
937         struct dfs_GetInfo tmp;
938         TALLOC_CTX *out_mem_ctx;
939 };
940
941 static void dcerpc_dfs_GetInfo_done(struct tevent_req *subreq);
942
943 struct tevent_req *dcerpc_dfs_GetInfo_send(TALLOC_CTX *mem_ctx,
944                                            struct tevent_context *ev,
945                                            struct dcerpc_binding_handle *h,
946                                            const char *_dfs_entry_path /* [in] [charset(UTF16)] */,
947                                            const char *_servername /* [in] [unique,charset(UTF16)] */,
948                                            const char *_sharename /* [in] [unique,charset(UTF16)] */,
949                                            uint32_t _level /* [in]  */,
950                                            union dfs_Info *_info /* [out] [ref,switch_is(level)] */)
951 {
952         struct tevent_req *req;
953         struct dcerpc_dfs_GetInfo_state *state;
954         struct tevent_req *subreq;
955
956         req = tevent_req_create(mem_ctx, &state,
957                                 struct dcerpc_dfs_GetInfo_state);
958         if (req == NULL) {
959                 return NULL;
960         }
961         state->out_mem_ctx = NULL;
962
963         /* In parameters */
964         state->orig.in.dfs_entry_path = _dfs_entry_path;
965         state->orig.in.servername = _servername;
966         state->orig.in.sharename = _sharename;
967         state->orig.in.level = _level;
968
969         /* Out parameters */
970         state->orig.out.info = _info;
971
972         /* Result */
973         ZERO_STRUCT(state->orig.out.result);
974
975         state->out_mem_ctx = talloc_named_const(state, 0,
976                              "dcerpc_dfs_GetInfo_out_memory");
977         if (tevent_req_nomem(state->out_mem_ctx, req)) {
978                 return tevent_req_post(req, ev);
979         }
980
981         /* make a temporary copy, that we pass to the dispatch function */
982         state->tmp = state->orig;
983
984         subreq = dcerpc_dfs_GetInfo_r_send(state, ev, h, &state->tmp);
985         if (tevent_req_nomem(subreq, req)) {
986                 return tevent_req_post(req, ev);
987         }
988         tevent_req_set_callback(subreq, dcerpc_dfs_GetInfo_done, req);
989         return req;
990 }
991
992 static void dcerpc_dfs_GetInfo_done(struct tevent_req *subreq)
993 {
994         struct tevent_req *req = tevent_req_callback_data(
995                 subreq, struct tevent_req);
996         struct dcerpc_dfs_GetInfo_state *state = tevent_req_data(
997                 req, struct dcerpc_dfs_GetInfo_state);
998         NTSTATUS status;
999         TALLOC_CTX *mem_ctx;
1000
1001         if (state->out_mem_ctx) {
1002                 mem_ctx = state->out_mem_ctx;
1003         } else {
1004                 mem_ctx = state;
1005         }
1006
1007         status = dcerpc_dfs_GetInfo_r_recv(subreq, mem_ctx);
1008         TALLOC_FREE(subreq);
1009         if (tevent_req_nterror(req, status)) {
1010                 return;
1011         }
1012
1013         /* Copy out parameters */
1014         *state->orig.out.info = *state->tmp.out.info;
1015
1016         /* Copy result */
1017         state->orig.out.result = state->tmp.out.result;
1018
1019         /* Reset temporary structure */
1020         ZERO_STRUCT(state->tmp);
1021
1022         tevent_req_done(req);
1023 }
1024
1025 NTSTATUS dcerpc_dfs_GetInfo_recv(struct tevent_req *req,
1026                                  TALLOC_CTX *mem_ctx,
1027                                  WERROR *result)
1028 {
1029         struct dcerpc_dfs_GetInfo_state *state = tevent_req_data(
1030                 req, struct dcerpc_dfs_GetInfo_state);
1031         NTSTATUS status;
1032
1033         if (tevent_req_is_nterror(req, &status)) {
1034                 tevent_req_received(req);
1035                 return status;
1036         }
1037
1038         /* Steal possible out parameters to the callers context */
1039         talloc_steal(mem_ctx, state->out_mem_ctx);
1040
1041         /* Return result */
1042         *result = state->orig.out.result;
1043
1044         tevent_req_received(req);
1045         return NT_STATUS_OK;
1046 }
1047
1048 NTSTATUS dcerpc_dfs_GetInfo(struct dcerpc_binding_handle *h,
1049                             TALLOC_CTX *mem_ctx,
1050                             const char *_dfs_entry_path /* [in] [charset(UTF16)] */,
1051                             const char *_servername /* [in] [unique,charset(UTF16)] */,
1052                             const char *_sharename /* [in] [unique,charset(UTF16)] */,
1053                             uint32_t _level /* [in]  */,
1054                             union dfs_Info *_info /* [out] [ref,switch_is(level)] */,
1055                             WERROR *result)
1056 {
1057         struct dfs_GetInfo r;
1058         NTSTATUS status;
1059
1060         /* In parameters */
1061         r.in.dfs_entry_path = _dfs_entry_path;
1062         r.in.servername = _servername;
1063         r.in.sharename = _sharename;
1064         r.in.level = _level;
1065
1066         status = dcerpc_dfs_GetInfo_r(h, mem_ctx, &r);
1067         if (!NT_STATUS_IS_OK(status)) {
1068                 return status;
1069         }
1070
1071         /* Return variables */
1072         *_info = *r.out.info;
1073
1074         /* Return result */
1075         *result = r.out.result;
1076
1077         return NT_STATUS_OK;
1078 }
1079
1080 struct dcerpc_dfs_Enum_r_state {
1081         TALLOC_CTX *out_mem_ctx;
1082 };
1083
1084 static void dcerpc_dfs_Enum_r_done(struct tevent_req *subreq);
1085
1086 struct tevent_req *dcerpc_dfs_Enum_r_send(TALLOC_CTX *mem_ctx,
1087         struct tevent_context *ev,
1088         struct dcerpc_binding_handle *h,
1089         struct dfs_Enum *r)
1090 {
1091         struct tevent_req *req;
1092         struct dcerpc_dfs_Enum_r_state *state;
1093         struct tevent_req *subreq;
1094
1095         req = tevent_req_create(mem_ctx, &state,
1096                                 struct dcerpc_dfs_Enum_r_state);
1097         if (req == NULL) {
1098                 return NULL;
1099         }
1100
1101         state->out_mem_ctx = talloc_new(state);
1102         if (tevent_req_nomem(state->out_mem_ctx, req)) {
1103                 return tevent_req_post(req, ev);
1104         }
1105
1106         subreq = dcerpc_binding_handle_call_send(state, ev, h,
1107                         NULL, &ndr_table_netdfs,
1108                         NDR_DFS_ENUM, state->out_mem_ctx, r);
1109         if (tevent_req_nomem(subreq, req)) {
1110                 return tevent_req_post(req, ev);
1111         }
1112         tevent_req_set_callback(subreq, dcerpc_dfs_Enum_r_done, req);
1113
1114         return req;
1115 }
1116
1117 static void dcerpc_dfs_Enum_r_done(struct tevent_req *subreq)
1118 {
1119         struct tevent_req *req =
1120                 tevent_req_callback_data(subreq,
1121                 struct tevent_req);
1122         NTSTATUS status;
1123
1124         status = dcerpc_binding_handle_call_recv(subreq);
1125         TALLOC_FREE(subreq);
1126         if (tevent_req_nterror(req, status)) {
1127                 return;
1128         }
1129
1130         tevent_req_done(req);
1131 }
1132
1133 NTSTATUS dcerpc_dfs_Enum_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
1134 {
1135         struct dcerpc_dfs_Enum_r_state *state =
1136                 tevent_req_data(req,
1137                 struct dcerpc_dfs_Enum_r_state);
1138         NTSTATUS status;
1139
1140         if (tevent_req_is_nterror(req, &status)) {
1141                 tevent_req_received(req);
1142                 return status;
1143         }
1144
1145         talloc_steal(mem_ctx, state->out_mem_ctx);
1146
1147         tevent_req_received(req);
1148         return NT_STATUS_OK;
1149 }
1150
1151 NTSTATUS dcerpc_dfs_Enum_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct dfs_Enum *r)
1152 {
1153         NTSTATUS status;
1154
1155         status = dcerpc_binding_handle_call(h,
1156                         NULL, &ndr_table_netdfs,
1157                         NDR_DFS_ENUM, mem_ctx, r);
1158
1159         return status;
1160 }
1161
1162 struct dcerpc_dfs_Enum_state {
1163         struct dfs_Enum orig;
1164         struct dfs_Enum tmp;
1165         TALLOC_CTX *out_mem_ctx;
1166 };
1167
1168 static void dcerpc_dfs_Enum_done(struct tevent_req *subreq);
1169
1170 struct tevent_req *dcerpc_dfs_Enum_send(TALLOC_CTX *mem_ctx,
1171                                         struct tevent_context *ev,
1172                                         struct dcerpc_binding_handle *h,
1173                                         uint32_t _level /* [in]  */,
1174                                         uint32_t _bufsize /* [in]  */,
1175                                         struct dfs_EnumStruct *_info /* [in,out] [unique] */,
1176                                         uint32_t *_total /* [in,out] [unique] */)
1177 {
1178         struct tevent_req *req;
1179         struct dcerpc_dfs_Enum_state *state;
1180         struct tevent_req *subreq;
1181
1182         req = tevent_req_create(mem_ctx, &state,
1183                                 struct dcerpc_dfs_Enum_state);
1184         if (req == NULL) {
1185                 return NULL;
1186         }
1187         state->out_mem_ctx = NULL;
1188
1189         /* In parameters */
1190         state->orig.in.level = _level;
1191         state->orig.in.bufsize = _bufsize;
1192         state->orig.in.info = _info;
1193         state->orig.in.total = _total;
1194
1195         /* Out parameters */
1196         state->orig.out.info = _info;
1197         state->orig.out.total = _total;
1198
1199         /* Result */
1200         ZERO_STRUCT(state->orig.out.result);
1201
1202         state->out_mem_ctx = talloc_named_const(state, 0,
1203                              "dcerpc_dfs_Enum_out_memory");
1204         if (tevent_req_nomem(state->out_mem_ctx, req)) {
1205                 return tevent_req_post(req, ev);
1206         }
1207
1208         /* make a temporary copy, that we pass to the dispatch function */
1209         state->tmp = state->orig;
1210
1211         subreq = dcerpc_dfs_Enum_r_send(state, ev, h, &state->tmp);
1212         if (tevent_req_nomem(subreq, req)) {
1213                 return tevent_req_post(req, ev);
1214         }
1215         tevent_req_set_callback(subreq, dcerpc_dfs_Enum_done, req);
1216         return req;
1217 }
1218
1219 static void dcerpc_dfs_Enum_done(struct tevent_req *subreq)
1220 {
1221         struct tevent_req *req = tevent_req_callback_data(
1222                 subreq, struct tevent_req);
1223         struct dcerpc_dfs_Enum_state *state = tevent_req_data(
1224                 req, struct dcerpc_dfs_Enum_state);
1225         NTSTATUS status;
1226         TALLOC_CTX *mem_ctx;
1227
1228         if (state->out_mem_ctx) {
1229                 mem_ctx = state->out_mem_ctx;
1230         } else {
1231                 mem_ctx = state;
1232         }
1233
1234         status = dcerpc_dfs_Enum_r_recv(subreq, mem_ctx);
1235         TALLOC_FREE(subreq);
1236         if (tevent_req_nterror(req, status)) {
1237                 return;
1238         }
1239
1240         /* Copy out parameters */
1241         if (state->orig.out.info && state->tmp.out.info) {
1242                 *state->orig.out.info = *state->tmp.out.info;
1243         }
1244         if (state->orig.out.total && state->tmp.out.total) {
1245                 *state->orig.out.total = *state->tmp.out.total;
1246         }
1247
1248         /* Copy result */
1249         state->orig.out.result = state->tmp.out.result;
1250
1251         /* Reset temporary structure */
1252         ZERO_STRUCT(state->tmp);
1253
1254         tevent_req_done(req);
1255 }
1256
1257 NTSTATUS dcerpc_dfs_Enum_recv(struct tevent_req *req,
1258                               TALLOC_CTX *mem_ctx,
1259                               WERROR *result)
1260 {
1261         struct dcerpc_dfs_Enum_state *state = tevent_req_data(
1262                 req, struct dcerpc_dfs_Enum_state);
1263         NTSTATUS status;
1264
1265         if (tevent_req_is_nterror(req, &status)) {
1266                 tevent_req_received(req);
1267                 return status;
1268         }
1269
1270         /* Steal possible out parameters to the callers context */
1271         talloc_steal(mem_ctx, state->out_mem_ctx);
1272
1273         /* Return result */
1274         *result = state->orig.out.result;
1275
1276         tevent_req_received(req);
1277         return NT_STATUS_OK;
1278 }
1279
1280 NTSTATUS dcerpc_dfs_Enum(struct dcerpc_binding_handle *h,
1281                          TALLOC_CTX *mem_ctx,
1282                          uint32_t _level /* [in]  */,
1283                          uint32_t _bufsize /* [in]  */,
1284                          struct dfs_EnumStruct *_info /* [in,out] [unique] */,
1285                          uint32_t *_total /* [in,out] [unique] */,
1286                          WERROR *result)
1287 {
1288         struct dfs_Enum r;
1289         NTSTATUS status;
1290
1291         /* In parameters */
1292         r.in.level = _level;
1293         r.in.bufsize = _bufsize;
1294         r.in.info = _info;
1295         r.in.total = _total;
1296
1297         status = dcerpc_dfs_Enum_r(h, mem_ctx, &r);
1298         if (!NT_STATUS_IS_OK(status)) {
1299                 return status;
1300         }
1301
1302         /* Return variables */
1303         if (_info && r.out.info) {
1304                 *_info = *r.out.info;
1305         }
1306         if (_total && r.out.total) {
1307                 *_total = *r.out.total;
1308         }
1309
1310         /* Return result */
1311         *result = r.out.result;
1312
1313         return NT_STATUS_OK;
1314 }
1315
1316 struct dcerpc_dfs_AddFtRoot_r_state {
1317         TALLOC_CTX *out_mem_ctx;
1318 };
1319
1320 static void dcerpc_dfs_AddFtRoot_r_done(struct tevent_req *subreq);
1321
1322 struct tevent_req *dcerpc_dfs_AddFtRoot_r_send(TALLOC_CTX *mem_ctx,
1323         struct tevent_context *ev,
1324         struct dcerpc_binding_handle *h,
1325         struct dfs_AddFtRoot *r)
1326 {
1327         struct tevent_req *req;
1328         struct dcerpc_dfs_AddFtRoot_r_state *state;
1329         struct tevent_req *subreq;
1330
1331         req = tevent_req_create(mem_ctx, &state,
1332                                 struct dcerpc_dfs_AddFtRoot_r_state);
1333         if (req == NULL) {
1334                 return NULL;
1335         }
1336
1337         state->out_mem_ctx = talloc_new(state);
1338         if (tevent_req_nomem(state->out_mem_ctx, req)) {
1339                 return tevent_req_post(req, ev);
1340         }
1341
1342         subreq = dcerpc_binding_handle_call_send(state, ev, h,
1343                         NULL, &ndr_table_netdfs,
1344                         NDR_DFS_ADDFTROOT, state->out_mem_ctx, r);
1345         if (tevent_req_nomem(subreq, req)) {
1346                 return tevent_req_post(req, ev);
1347         }
1348         tevent_req_set_callback(subreq, dcerpc_dfs_AddFtRoot_r_done, req);
1349
1350         return req;
1351 }
1352
1353 static void dcerpc_dfs_AddFtRoot_r_done(struct tevent_req *subreq)
1354 {
1355         struct tevent_req *req =
1356                 tevent_req_callback_data(subreq,
1357                 struct tevent_req);
1358         NTSTATUS status;
1359
1360         status = dcerpc_binding_handle_call_recv(subreq);
1361         TALLOC_FREE(subreq);
1362         if (tevent_req_nterror(req, status)) {
1363                 return;
1364         }
1365
1366         tevent_req_done(req);
1367 }
1368
1369 NTSTATUS dcerpc_dfs_AddFtRoot_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
1370 {
1371         struct dcerpc_dfs_AddFtRoot_r_state *state =
1372                 tevent_req_data(req,
1373                 struct dcerpc_dfs_AddFtRoot_r_state);
1374         NTSTATUS status;
1375
1376         if (tevent_req_is_nterror(req, &status)) {
1377                 tevent_req_received(req);
1378                 return status;
1379         }
1380
1381         talloc_steal(mem_ctx, state->out_mem_ctx);
1382
1383         tevent_req_received(req);
1384         return NT_STATUS_OK;
1385 }
1386
1387 NTSTATUS dcerpc_dfs_AddFtRoot_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct dfs_AddFtRoot *r)
1388 {
1389         NTSTATUS status;
1390
1391         status = dcerpc_binding_handle_call(h,
1392                         NULL, &ndr_table_netdfs,
1393                         NDR_DFS_ADDFTROOT, mem_ctx, r);
1394
1395         return status;
1396 }
1397
1398 struct dcerpc_dfs_AddFtRoot_state {
1399         struct dfs_AddFtRoot orig;
1400         struct dfs_AddFtRoot tmp;
1401         TALLOC_CTX *out_mem_ctx;
1402 };
1403
1404 static void dcerpc_dfs_AddFtRoot_done(struct tevent_req *subreq);
1405
1406 struct tevent_req *dcerpc_dfs_AddFtRoot_send(TALLOC_CTX *mem_ctx,
1407                                              struct tevent_context *ev,
1408                                              struct dcerpc_binding_handle *h,
1409                                              const char *_servername /* [in] [charset(UTF16)] */,
1410                                              const char *_dns_servername /* [in] [charset(UTF16)] */,
1411                                              const char *_dfsname /* [in] [charset(UTF16)] */,
1412                                              const char *_rootshare /* [in] [charset(UTF16)] */,
1413                                              const char *_comment /* [in] [charset(UTF16)] */,
1414                                              const char *_dfs_config_dn /* [in] [charset(UTF16)] */,
1415                                              uint8_t _unknown1 /* [in]  */,
1416                                              uint32_t _flags /* [in]  */,
1417                                              struct dfs_UnknownStruct **_unknown2 /* [in,out] [unique] */)
1418 {
1419         struct tevent_req *req;
1420         struct dcerpc_dfs_AddFtRoot_state *state;
1421         struct tevent_req *subreq;
1422
1423         req = tevent_req_create(mem_ctx, &state,
1424                                 struct dcerpc_dfs_AddFtRoot_state);
1425         if (req == NULL) {
1426                 return NULL;
1427         }
1428         state->out_mem_ctx = NULL;
1429
1430         /* In parameters */
1431         state->orig.in.servername = _servername;
1432         state->orig.in.dns_servername = _dns_servername;
1433         state->orig.in.dfsname = _dfsname;
1434         state->orig.in.rootshare = _rootshare;
1435         state->orig.in.comment = _comment;
1436         state->orig.in.dfs_config_dn = _dfs_config_dn;
1437         state->orig.in.unknown1 = _unknown1;
1438         state->orig.in.flags = _flags;
1439         state->orig.in.unknown2 = _unknown2;
1440
1441         /* Out parameters */
1442         state->orig.out.unknown2 = _unknown2;
1443
1444         /* Result */
1445         ZERO_STRUCT(state->orig.out.result);
1446
1447         state->out_mem_ctx = talloc_named_const(state, 0,
1448                              "dcerpc_dfs_AddFtRoot_out_memory");
1449         if (tevent_req_nomem(state->out_mem_ctx, req)) {
1450                 return tevent_req_post(req, ev);
1451         }
1452
1453         /* make a temporary copy, that we pass to the dispatch function */
1454         state->tmp = state->orig;
1455
1456         subreq = dcerpc_dfs_AddFtRoot_r_send(state, ev, h, &state->tmp);
1457         if (tevent_req_nomem(subreq, req)) {
1458                 return tevent_req_post(req, ev);
1459         }
1460         tevent_req_set_callback(subreq, dcerpc_dfs_AddFtRoot_done, req);
1461         return req;
1462 }
1463
1464 static void dcerpc_dfs_AddFtRoot_done(struct tevent_req *subreq)
1465 {
1466         struct tevent_req *req = tevent_req_callback_data(
1467                 subreq, struct tevent_req);
1468         struct dcerpc_dfs_AddFtRoot_state *state = tevent_req_data(
1469                 req, struct dcerpc_dfs_AddFtRoot_state);
1470         NTSTATUS status;
1471         TALLOC_CTX *mem_ctx;
1472
1473         if (state->out_mem_ctx) {
1474                 mem_ctx = state->out_mem_ctx;
1475         } else {
1476                 mem_ctx = state;
1477         }
1478
1479         status = dcerpc_dfs_AddFtRoot_r_recv(subreq, mem_ctx);
1480         TALLOC_FREE(subreq);
1481         if (tevent_req_nterror(req, status)) {
1482                 return;
1483         }
1484
1485         /* Copy out parameters */
1486         if (state->orig.out.unknown2 && state->tmp.out.unknown2) {
1487                 *state->orig.out.unknown2 = *state->tmp.out.unknown2;
1488         }
1489
1490         /* Copy result */
1491         state->orig.out.result = state->tmp.out.result;
1492
1493         /* Reset temporary structure */
1494         ZERO_STRUCT(state->tmp);
1495
1496         tevent_req_done(req);
1497 }
1498
1499 NTSTATUS dcerpc_dfs_AddFtRoot_recv(struct tevent_req *req,
1500                                    TALLOC_CTX *mem_ctx,
1501                                    WERROR *result)
1502 {
1503         struct dcerpc_dfs_AddFtRoot_state *state = tevent_req_data(
1504                 req, struct dcerpc_dfs_AddFtRoot_state);
1505         NTSTATUS status;
1506
1507         if (tevent_req_is_nterror(req, &status)) {
1508                 tevent_req_received(req);
1509                 return status;
1510         }
1511
1512         /* Steal possible out parameters to the callers context */
1513         talloc_steal(mem_ctx, state->out_mem_ctx);
1514
1515         /* Return result */
1516         *result = state->orig.out.result;
1517
1518         tevent_req_received(req);
1519         return NT_STATUS_OK;
1520 }
1521
1522 NTSTATUS dcerpc_dfs_AddFtRoot(struct dcerpc_binding_handle *h,
1523                               TALLOC_CTX *mem_ctx,
1524                               const char *_servername /* [in] [charset(UTF16)] */,
1525                               const char *_dns_servername /* [in] [charset(UTF16)] */,
1526                               const char *_dfsname /* [in] [charset(UTF16)] */,
1527                               const char *_rootshare /* [in] [charset(UTF16)] */,
1528                               const char *_comment /* [in] [charset(UTF16)] */,
1529                               const char *_dfs_config_dn /* [in] [charset(UTF16)] */,
1530                               uint8_t _unknown1 /* [in]  */,
1531                               uint32_t _flags /* [in]  */,
1532                               struct dfs_UnknownStruct **_unknown2 /* [in,out] [unique] */,
1533                               WERROR *result)
1534 {
1535         struct dfs_AddFtRoot r;
1536         NTSTATUS status;
1537
1538         /* In parameters */
1539         r.in.servername = _servername;
1540         r.in.dns_servername = _dns_servername;
1541         r.in.dfsname = _dfsname;
1542         r.in.rootshare = _rootshare;
1543         r.in.comment = _comment;
1544         r.in.dfs_config_dn = _dfs_config_dn;
1545         r.in.unknown1 = _unknown1;
1546         r.in.flags = _flags;
1547         r.in.unknown2 = _unknown2;
1548
1549         status = dcerpc_dfs_AddFtRoot_r(h, mem_ctx, &r);
1550         if (!NT_STATUS_IS_OK(status)) {
1551                 return status;
1552         }
1553
1554         /* Return variables */
1555         if (_unknown2 && r.out.unknown2) {
1556                 *_unknown2 = *r.out.unknown2;
1557         }
1558
1559         /* Return result */
1560         *result = r.out.result;
1561
1562         return NT_STATUS_OK;
1563 }
1564
1565 struct dcerpc_dfs_RemoveFtRoot_r_state {
1566         TALLOC_CTX *out_mem_ctx;
1567 };
1568
1569 static void dcerpc_dfs_RemoveFtRoot_r_done(struct tevent_req *subreq);
1570
1571 struct tevent_req *dcerpc_dfs_RemoveFtRoot_r_send(TALLOC_CTX *mem_ctx,
1572         struct tevent_context *ev,
1573         struct dcerpc_binding_handle *h,
1574         struct dfs_RemoveFtRoot *r)
1575 {
1576         struct tevent_req *req;
1577         struct dcerpc_dfs_RemoveFtRoot_r_state *state;
1578         struct tevent_req *subreq;
1579
1580         req = tevent_req_create(mem_ctx, &state,
1581                                 struct dcerpc_dfs_RemoveFtRoot_r_state);
1582         if (req == NULL) {
1583                 return NULL;
1584         }
1585
1586         state->out_mem_ctx = talloc_new(state);
1587         if (tevent_req_nomem(state->out_mem_ctx, req)) {
1588                 return tevent_req_post(req, ev);
1589         }
1590
1591         subreq = dcerpc_binding_handle_call_send(state, ev, h,
1592                         NULL, &ndr_table_netdfs,
1593                         NDR_DFS_REMOVEFTROOT, state->out_mem_ctx, r);
1594         if (tevent_req_nomem(subreq, req)) {
1595                 return tevent_req_post(req, ev);
1596         }
1597         tevent_req_set_callback(subreq, dcerpc_dfs_RemoveFtRoot_r_done, req);
1598
1599         return req;
1600 }
1601
1602 static void dcerpc_dfs_RemoveFtRoot_r_done(struct tevent_req *subreq)
1603 {
1604         struct tevent_req *req =
1605                 tevent_req_callback_data(subreq,
1606                 struct tevent_req);
1607         NTSTATUS status;
1608
1609         status = dcerpc_binding_handle_call_recv(subreq);
1610         TALLOC_FREE(subreq);
1611         if (tevent_req_nterror(req, status)) {
1612                 return;
1613         }
1614
1615         tevent_req_done(req);
1616 }
1617
1618 NTSTATUS dcerpc_dfs_RemoveFtRoot_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
1619 {
1620         struct dcerpc_dfs_RemoveFtRoot_r_state *state =
1621                 tevent_req_data(req,
1622                 struct dcerpc_dfs_RemoveFtRoot_r_state);
1623         NTSTATUS status;
1624
1625         if (tevent_req_is_nterror(req, &status)) {
1626                 tevent_req_received(req);
1627                 return status;
1628         }
1629
1630         talloc_steal(mem_ctx, state->out_mem_ctx);
1631
1632         tevent_req_received(req);
1633         return NT_STATUS_OK;
1634 }
1635
1636 NTSTATUS dcerpc_dfs_RemoveFtRoot_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct dfs_RemoveFtRoot *r)
1637 {
1638         NTSTATUS status;
1639
1640         status = dcerpc_binding_handle_call(h,
1641                         NULL, &ndr_table_netdfs,
1642                         NDR_DFS_REMOVEFTROOT, mem_ctx, r);
1643
1644         return status;
1645 }
1646
1647 struct dcerpc_dfs_RemoveFtRoot_state {
1648         struct dfs_RemoveFtRoot orig;
1649         struct dfs_RemoveFtRoot tmp;
1650         TALLOC_CTX *out_mem_ctx;
1651 };
1652
1653 static void dcerpc_dfs_RemoveFtRoot_done(struct tevent_req *subreq);
1654
1655 struct tevent_req *dcerpc_dfs_RemoveFtRoot_send(TALLOC_CTX *mem_ctx,
1656                                                 struct tevent_context *ev,
1657                                                 struct dcerpc_binding_handle *h,
1658                                                 const char *_servername /* [in] [charset(UTF16)] */,
1659                                                 const char *_dns_servername /* [in] [charset(UTF16)] */,
1660                                                 const char *_dfsname /* [in] [charset(UTF16)] */,
1661                                                 const char *_rootshare /* [in] [charset(UTF16)] */,
1662                                                 uint32_t _flags /* [in]  */,
1663                                                 struct dfs_UnknownStruct **_unknown /* [in,out] [unique] */)
1664 {
1665         struct tevent_req *req;
1666         struct dcerpc_dfs_RemoveFtRoot_state *state;
1667         struct tevent_req *subreq;
1668
1669         req = tevent_req_create(mem_ctx, &state,
1670                                 struct dcerpc_dfs_RemoveFtRoot_state);
1671         if (req == NULL) {
1672                 return NULL;
1673         }
1674         state->out_mem_ctx = NULL;
1675
1676         /* In parameters */
1677         state->orig.in.servername = _servername;
1678         state->orig.in.dns_servername = _dns_servername;
1679         state->orig.in.dfsname = _dfsname;
1680         state->orig.in.rootshare = _rootshare;
1681         state->orig.in.flags = _flags;
1682         state->orig.in.unknown = _unknown;
1683
1684         /* Out parameters */
1685         state->orig.out.unknown = _unknown;
1686
1687         /* Result */
1688         ZERO_STRUCT(state->orig.out.result);
1689
1690         state->out_mem_ctx = talloc_named_const(state, 0,
1691                              "dcerpc_dfs_RemoveFtRoot_out_memory");
1692         if (tevent_req_nomem(state->out_mem_ctx, req)) {
1693                 return tevent_req_post(req, ev);
1694         }
1695
1696         /* make a temporary copy, that we pass to the dispatch function */
1697         state->tmp = state->orig;
1698
1699         subreq = dcerpc_dfs_RemoveFtRoot_r_send(state, ev, h, &state->tmp);
1700         if (tevent_req_nomem(subreq, req)) {
1701                 return tevent_req_post(req, ev);
1702         }
1703         tevent_req_set_callback(subreq, dcerpc_dfs_RemoveFtRoot_done, req);
1704         return req;
1705 }
1706
1707 static void dcerpc_dfs_RemoveFtRoot_done(struct tevent_req *subreq)
1708 {
1709         struct tevent_req *req = tevent_req_callback_data(
1710                 subreq, struct tevent_req);
1711         struct dcerpc_dfs_RemoveFtRoot_state *state = tevent_req_data(
1712                 req, struct dcerpc_dfs_RemoveFtRoot_state);
1713         NTSTATUS status;
1714         TALLOC_CTX *mem_ctx;
1715
1716         if (state->out_mem_ctx) {
1717                 mem_ctx = state->out_mem_ctx;
1718         } else {
1719                 mem_ctx = state;
1720         }
1721
1722         status = dcerpc_dfs_RemoveFtRoot_r_recv(subreq, mem_ctx);
1723         TALLOC_FREE(subreq);
1724         if (tevent_req_nterror(req, status)) {
1725                 return;
1726         }
1727
1728         /* Copy out parameters */
1729         if (state->orig.out.unknown && state->tmp.out.unknown) {
1730                 *state->orig.out.unknown = *state->tmp.out.unknown;
1731         }
1732
1733         /* Copy result */
1734         state->orig.out.result = state->tmp.out.result;
1735
1736         /* Reset temporary structure */
1737         ZERO_STRUCT(state->tmp);
1738
1739         tevent_req_done(req);
1740 }
1741
1742 NTSTATUS dcerpc_dfs_RemoveFtRoot_recv(struct tevent_req *req,
1743                                       TALLOC_CTX *mem_ctx,
1744                                       WERROR *result)
1745 {
1746         struct dcerpc_dfs_RemoveFtRoot_state *state = tevent_req_data(
1747                 req, struct dcerpc_dfs_RemoveFtRoot_state);
1748         NTSTATUS status;
1749
1750         if (tevent_req_is_nterror(req, &status)) {
1751                 tevent_req_received(req);
1752                 return status;
1753         }
1754
1755         /* Steal possible out parameters to the callers context */
1756         talloc_steal(mem_ctx, state->out_mem_ctx);
1757
1758         /* Return result */
1759         *result = state->orig.out.result;
1760
1761         tevent_req_received(req);
1762         return NT_STATUS_OK;
1763 }
1764
1765 NTSTATUS dcerpc_dfs_RemoveFtRoot(struct dcerpc_binding_handle *h,
1766                                  TALLOC_CTX *mem_ctx,
1767                                  const char *_servername /* [in] [charset(UTF16)] */,
1768                                  const char *_dns_servername /* [in] [charset(UTF16)] */,
1769                                  const char *_dfsname /* [in] [charset(UTF16)] */,
1770                                  const char *_rootshare /* [in] [charset(UTF16)] */,
1771                                  uint32_t _flags /* [in]  */,
1772                                  struct dfs_UnknownStruct **_unknown /* [in,out] [unique] */,
1773                                  WERROR *result)
1774 {
1775         struct dfs_RemoveFtRoot r;
1776         NTSTATUS status;
1777
1778         /* In parameters */
1779         r.in.servername = _servername;
1780         r.in.dns_servername = _dns_servername;
1781         r.in.dfsname = _dfsname;
1782         r.in.rootshare = _rootshare;
1783         r.in.flags = _flags;
1784         r.in.unknown = _unknown;
1785
1786         status = dcerpc_dfs_RemoveFtRoot_r(h, mem_ctx, &r);
1787         if (!NT_STATUS_IS_OK(status)) {
1788                 return status;
1789         }
1790
1791         /* Return variables */
1792         if (_unknown && r.out.unknown) {
1793                 *_unknown = *r.out.unknown;
1794         }
1795
1796         /* Return result */
1797         *result = r.out.result;
1798
1799         return NT_STATUS_OK;
1800 }
1801
1802 struct dcerpc_dfs_AddStdRoot_r_state {
1803         TALLOC_CTX *out_mem_ctx;
1804 };
1805
1806 static void dcerpc_dfs_AddStdRoot_r_done(struct tevent_req *subreq);
1807
1808 struct tevent_req *dcerpc_dfs_AddStdRoot_r_send(TALLOC_CTX *mem_ctx,
1809         struct tevent_context *ev,
1810         struct dcerpc_binding_handle *h,
1811         struct dfs_AddStdRoot *r)
1812 {
1813         struct tevent_req *req;
1814         struct dcerpc_dfs_AddStdRoot_r_state *state;
1815         struct tevent_req *subreq;
1816
1817         req = tevent_req_create(mem_ctx, &state,
1818                                 struct dcerpc_dfs_AddStdRoot_r_state);
1819         if (req == NULL) {
1820                 return NULL;
1821         }
1822
1823         state->out_mem_ctx = NULL;
1824
1825         subreq = dcerpc_binding_handle_call_send(state, ev, h,
1826                         NULL, &ndr_table_netdfs,
1827                         NDR_DFS_ADDSTDROOT, state, r);
1828         if (tevent_req_nomem(subreq, req)) {
1829                 return tevent_req_post(req, ev);
1830         }
1831         tevent_req_set_callback(subreq, dcerpc_dfs_AddStdRoot_r_done, req);
1832
1833         return req;
1834 }
1835
1836 static void dcerpc_dfs_AddStdRoot_r_done(struct tevent_req *subreq)
1837 {
1838         struct tevent_req *req =
1839                 tevent_req_callback_data(subreq,
1840                 struct tevent_req);
1841         NTSTATUS status;
1842
1843         status = dcerpc_binding_handle_call_recv(subreq);
1844         TALLOC_FREE(subreq);
1845         if (tevent_req_nterror(req, status)) {
1846                 return;
1847         }
1848
1849         tevent_req_done(req);
1850 }
1851
1852 NTSTATUS dcerpc_dfs_AddStdRoot_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
1853 {
1854         struct dcerpc_dfs_AddStdRoot_r_state *state =
1855                 tevent_req_data(req,
1856                 struct dcerpc_dfs_AddStdRoot_r_state);
1857         NTSTATUS status;
1858
1859         if (tevent_req_is_nterror(req, &status)) {
1860                 tevent_req_received(req);
1861                 return status;
1862         }
1863
1864         talloc_steal(mem_ctx, state->out_mem_ctx);
1865
1866         tevent_req_received(req);
1867         return NT_STATUS_OK;
1868 }
1869
1870 NTSTATUS dcerpc_dfs_AddStdRoot_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct dfs_AddStdRoot *r)
1871 {
1872         NTSTATUS status;
1873
1874         status = dcerpc_binding_handle_call(h,
1875                         NULL, &ndr_table_netdfs,
1876                         NDR_DFS_ADDSTDROOT, mem_ctx, r);
1877
1878         return status;
1879 }
1880
1881 struct dcerpc_dfs_AddStdRoot_state {
1882         struct dfs_AddStdRoot orig;
1883         struct dfs_AddStdRoot tmp;
1884         TALLOC_CTX *out_mem_ctx;
1885 };
1886
1887 static void dcerpc_dfs_AddStdRoot_done(struct tevent_req *subreq);
1888
1889 struct tevent_req *dcerpc_dfs_AddStdRoot_send(TALLOC_CTX *mem_ctx,
1890                                               struct tevent_context *ev,
1891                                               struct dcerpc_binding_handle *h,
1892                                               const char *_servername /* [in] [charset(UTF16)] */,
1893                                               const char *_rootshare /* [in] [charset(UTF16)] */,
1894                                               const char *_comment /* [in] [charset(UTF16)] */,
1895                                               uint32_t _flags /* [in]  */)
1896 {
1897         struct tevent_req *req;
1898         struct dcerpc_dfs_AddStdRoot_state *state;
1899         struct tevent_req *subreq;
1900
1901         req = tevent_req_create(mem_ctx, &state,
1902                                 struct dcerpc_dfs_AddStdRoot_state);
1903         if (req == NULL) {
1904                 return NULL;
1905         }
1906         state->out_mem_ctx = NULL;
1907
1908         /* In parameters */
1909         state->orig.in.servername = _servername;
1910         state->orig.in.rootshare = _rootshare;
1911         state->orig.in.comment = _comment;
1912         state->orig.in.flags = _flags;
1913
1914         /* Out parameters */
1915
1916         /* Result */
1917         ZERO_STRUCT(state->orig.out.result);
1918
1919         /* make a temporary copy, that we pass to the dispatch function */
1920         state->tmp = state->orig;
1921
1922         subreq = dcerpc_dfs_AddStdRoot_r_send(state, ev, h, &state->tmp);
1923         if (tevent_req_nomem(subreq, req)) {
1924                 return tevent_req_post(req, ev);
1925         }
1926         tevent_req_set_callback(subreq, dcerpc_dfs_AddStdRoot_done, req);
1927         return req;
1928 }
1929
1930 static void dcerpc_dfs_AddStdRoot_done(struct tevent_req *subreq)
1931 {
1932         struct tevent_req *req = tevent_req_callback_data(
1933                 subreq, struct tevent_req);
1934         struct dcerpc_dfs_AddStdRoot_state *state = tevent_req_data(
1935                 req, struct dcerpc_dfs_AddStdRoot_state);
1936         NTSTATUS status;
1937         TALLOC_CTX *mem_ctx;
1938
1939         if (state->out_mem_ctx) {
1940                 mem_ctx = state->out_mem_ctx;
1941         } else {
1942                 mem_ctx = state;
1943         }
1944
1945         status = dcerpc_dfs_AddStdRoot_r_recv(subreq, mem_ctx);
1946         TALLOC_FREE(subreq);
1947         if (tevent_req_nterror(req, status)) {
1948                 return;
1949         }
1950
1951         /* Copy out parameters */
1952
1953         /* Copy result */
1954         state->orig.out.result = state->tmp.out.result;
1955
1956         /* Reset temporary structure */
1957         ZERO_STRUCT(state->tmp);
1958
1959         tevent_req_done(req);
1960 }
1961
1962 NTSTATUS dcerpc_dfs_AddStdRoot_recv(struct tevent_req *req,
1963                                     TALLOC_CTX *mem_ctx,
1964                                     WERROR *result)
1965 {
1966         struct dcerpc_dfs_AddStdRoot_state *state = tevent_req_data(
1967                 req, struct dcerpc_dfs_AddStdRoot_state);
1968         NTSTATUS status;
1969
1970         if (tevent_req_is_nterror(req, &status)) {
1971                 tevent_req_received(req);
1972                 return status;
1973         }
1974
1975         /* Steal possible out parameters to the callers context */
1976         talloc_steal(mem_ctx, state->out_mem_ctx);
1977
1978         /* Return result */
1979         *result = state->orig.out.result;
1980
1981         tevent_req_received(req);
1982         return NT_STATUS_OK;
1983 }
1984
1985 NTSTATUS dcerpc_dfs_AddStdRoot(struct dcerpc_binding_handle *h,
1986                                TALLOC_CTX *mem_ctx,
1987                                const char *_servername /* [in] [charset(UTF16)] */,
1988                                const char *_rootshare /* [in] [charset(UTF16)] */,
1989                                const char *_comment /* [in] [charset(UTF16)] */,
1990                                uint32_t _flags /* [in]  */,
1991                                WERROR *result)
1992 {
1993         struct dfs_AddStdRoot r;
1994         NTSTATUS status;
1995
1996         /* In parameters */
1997         r.in.servername = _servername;
1998         r.in.rootshare = _rootshare;
1999         r.in.comment = _comment;
2000         r.in.flags = _flags;
2001
2002         status = dcerpc_dfs_AddStdRoot_r(h, mem_ctx, &r);
2003         if (!NT_STATUS_IS_OK(status)) {
2004                 return status;
2005         }
2006
2007         /* Return variables */
2008
2009         /* Return result */
2010         *result = r.out.result;
2011
2012         return NT_STATUS_OK;
2013 }
2014
2015 struct dcerpc_dfs_RemoveStdRoot_r_state {
2016         TALLOC_CTX *out_mem_ctx;
2017 };
2018
2019 static void dcerpc_dfs_RemoveStdRoot_r_done(struct tevent_req *subreq);
2020
2021 struct tevent_req *dcerpc_dfs_RemoveStdRoot_r_send(TALLOC_CTX *mem_ctx,
2022         struct tevent_context *ev,
2023         struct dcerpc_binding_handle *h,
2024         struct dfs_RemoveStdRoot *r)
2025 {
2026         struct tevent_req *req;
2027         struct dcerpc_dfs_RemoveStdRoot_r_state *state;
2028         struct tevent_req *subreq;
2029
2030         req = tevent_req_create(mem_ctx, &state,
2031                                 struct dcerpc_dfs_RemoveStdRoot_r_state);
2032         if (req == NULL) {
2033                 return NULL;
2034         }
2035
2036         state->out_mem_ctx = NULL;
2037
2038         subreq = dcerpc_binding_handle_call_send(state, ev, h,
2039                         NULL, &ndr_table_netdfs,
2040                         NDR_DFS_REMOVESTDROOT, state, r);
2041         if (tevent_req_nomem(subreq, req)) {
2042                 return tevent_req_post(req, ev);
2043         }
2044         tevent_req_set_callback(subreq, dcerpc_dfs_RemoveStdRoot_r_done, req);
2045
2046         return req;
2047 }
2048
2049 static void dcerpc_dfs_RemoveStdRoot_r_done(struct tevent_req *subreq)
2050 {
2051         struct tevent_req *req =
2052                 tevent_req_callback_data(subreq,
2053                 struct tevent_req);
2054         NTSTATUS status;
2055
2056         status = dcerpc_binding_handle_call_recv(subreq);
2057         TALLOC_FREE(subreq);
2058         if (tevent_req_nterror(req, status)) {
2059                 return;
2060         }
2061
2062         tevent_req_done(req);
2063 }
2064
2065 NTSTATUS dcerpc_dfs_RemoveStdRoot_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
2066 {
2067         struct dcerpc_dfs_RemoveStdRoot_r_state *state =
2068                 tevent_req_data(req,
2069                 struct dcerpc_dfs_RemoveStdRoot_r_state);
2070         NTSTATUS status;
2071
2072         if (tevent_req_is_nterror(req, &status)) {
2073                 tevent_req_received(req);
2074                 return status;
2075         }
2076
2077         talloc_steal(mem_ctx, state->out_mem_ctx);
2078
2079         tevent_req_received(req);
2080         return NT_STATUS_OK;
2081 }
2082
2083 NTSTATUS dcerpc_dfs_RemoveStdRoot_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct dfs_RemoveStdRoot *r)
2084 {
2085         NTSTATUS status;
2086
2087         status = dcerpc_binding_handle_call(h,
2088                         NULL, &ndr_table_netdfs,
2089                         NDR_DFS_REMOVESTDROOT, mem_ctx, r);
2090
2091         return status;
2092 }
2093
2094 struct dcerpc_dfs_RemoveStdRoot_state {
2095         struct dfs_RemoveStdRoot orig;
2096         struct dfs_RemoveStdRoot tmp;
2097         TALLOC_CTX *out_mem_ctx;
2098 };
2099
2100 static void dcerpc_dfs_RemoveStdRoot_done(struct tevent_req *subreq);
2101
2102 struct tevent_req *dcerpc_dfs_RemoveStdRoot_send(TALLOC_CTX *mem_ctx,
2103                                                  struct tevent_context *ev,
2104                                                  struct dcerpc_binding_handle *h,
2105                                                  const char *_servername /* [in] [charset(UTF16)] */,
2106                                                  const char *_rootshare /* [in] [charset(UTF16)] */,
2107                                                  uint32_t _flags /* [in]  */)
2108 {
2109         struct tevent_req *req;
2110         struct dcerpc_dfs_RemoveStdRoot_state *state;
2111         struct tevent_req *subreq;
2112
2113         req = tevent_req_create(mem_ctx, &state,
2114                                 struct dcerpc_dfs_RemoveStdRoot_state);
2115         if (req == NULL) {
2116                 return NULL;
2117         }
2118         state->out_mem_ctx = NULL;
2119
2120         /* In parameters */
2121         state->orig.in.servername = _servername;
2122         state->orig.in.rootshare = _rootshare;
2123         state->orig.in.flags = _flags;
2124
2125         /* Out parameters */
2126
2127         /* Result */
2128         ZERO_STRUCT(state->orig.out.result);
2129
2130         /* make a temporary copy, that we pass to the dispatch function */
2131         state->tmp = state->orig;
2132
2133         subreq = dcerpc_dfs_RemoveStdRoot_r_send(state, ev, h, &state->tmp);
2134         if (tevent_req_nomem(subreq, req)) {
2135                 return tevent_req_post(req, ev);
2136         }
2137         tevent_req_set_callback(subreq, dcerpc_dfs_RemoveStdRoot_done, req);
2138         return req;
2139 }
2140
2141 static void dcerpc_dfs_RemoveStdRoot_done(struct tevent_req *subreq)
2142 {
2143         struct tevent_req *req = tevent_req_callback_data(
2144                 subreq, struct tevent_req);
2145         struct dcerpc_dfs_RemoveStdRoot_state *state = tevent_req_data(
2146                 req, struct dcerpc_dfs_RemoveStdRoot_state);
2147         NTSTATUS status;
2148         TALLOC_CTX *mem_ctx;
2149
2150         if (state->out_mem_ctx) {
2151                 mem_ctx = state->out_mem_ctx;
2152         } else {
2153                 mem_ctx = state;
2154         }
2155
2156         status = dcerpc_dfs_RemoveStdRoot_r_recv(subreq, mem_ctx);
2157         TALLOC_FREE(subreq);
2158         if (tevent_req_nterror(req, status)) {
2159                 return;
2160         }
2161
2162         /* Copy out parameters */
2163
2164         /* Copy result */
2165         state->orig.out.result = state->tmp.out.result;
2166
2167         /* Reset temporary structure */
2168         ZERO_STRUCT(state->tmp);
2169
2170         tevent_req_done(req);
2171 }
2172
2173 NTSTATUS dcerpc_dfs_RemoveStdRoot_recv(struct tevent_req *req,
2174                                        TALLOC_CTX *mem_ctx,
2175                                        WERROR *result)
2176 {
2177         struct dcerpc_dfs_RemoveStdRoot_state *state = tevent_req_data(
2178                 req, struct dcerpc_dfs_RemoveStdRoot_state);
2179         NTSTATUS status;
2180
2181         if (tevent_req_is_nterror(req, &status)) {
2182                 tevent_req_received(req);
2183                 return status;
2184         }
2185
2186         /* Steal possible out parameters to the callers context */
2187         talloc_steal(mem_ctx, state->out_mem_ctx);
2188
2189         /* Return result */
2190         *result = state->orig.out.result;
2191
2192         tevent_req_received(req);
2193         return NT_STATUS_OK;
2194 }
2195
2196 NTSTATUS dcerpc_dfs_RemoveStdRoot(struct dcerpc_binding_handle *h,
2197                                   TALLOC_CTX *mem_ctx,
2198                                   const char *_servername /* [in] [charset(UTF16)] */,
2199                                   const char *_rootshare /* [in] [charset(UTF16)] */,
2200                                   uint32_t _flags /* [in]  */,
2201                                   WERROR *result)
2202 {
2203         struct dfs_RemoveStdRoot r;
2204         NTSTATUS status;
2205
2206         /* In parameters */
2207         r.in.servername = _servername;
2208         r.in.rootshare = _rootshare;
2209         r.in.flags = _flags;
2210
2211         status = dcerpc_dfs_RemoveStdRoot_r(h, mem_ctx, &r);
2212         if (!NT_STATUS_IS_OK(status)) {
2213                 return status;
2214         }
2215
2216         /* Return variables */
2217
2218         /* Return result */
2219         *result = r.out.result;
2220
2221         return NT_STATUS_OK;
2222 }
2223
2224 struct dcerpc_dfs_ManagerInitialize_r_state {
2225         TALLOC_CTX *out_mem_ctx;
2226 };
2227
2228 static void dcerpc_dfs_ManagerInitialize_r_done(struct tevent_req *subreq);
2229
2230 struct tevent_req *dcerpc_dfs_ManagerInitialize_r_send(TALLOC_CTX *mem_ctx,
2231         struct tevent_context *ev,
2232         struct dcerpc_binding_handle *h,
2233         struct dfs_ManagerInitialize *r)
2234 {
2235         struct tevent_req *req;
2236         struct dcerpc_dfs_ManagerInitialize_r_state *state;
2237         struct tevent_req *subreq;
2238
2239         req = tevent_req_create(mem_ctx, &state,
2240                                 struct dcerpc_dfs_ManagerInitialize_r_state);
2241         if (req == NULL) {
2242                 return NULL;
2243         }
2244
2245         state->out_mem_ctx = NULL;
2246
2247         subreq = dcerpc_binding_handle_call_send(state, ev, h,
2248                         NULL, &ndr_table_netdfs,
2249                         NDR_DFS_MANAGERINITIALIZE, state, r);
2250         if (tevent_req_nomem(subreq, req)) {
2251                 return tevent_req_post(req, ev);
2252         }
2253         tevent_req_set_callback(subreq, dcerpc_dfs_ManagerInitialize_r_done, req);
2254
2255         return req;
2256 }
2257
2258 static void dcerpc_dfs_ManagerInitialize_r_done(struct tevent_req *subreq)
2259 {
2260         struct tevent_req *req =
2261                 tevent_req_callback_data(subreq,
2262                 struct tevent_req);
2263         NTSTATUS status;
2264
2265         status = dcerpc_binding_handle_call_recv(subreq);
2266         TALLOC_FREE(subreq);
2267         if (tevent_req_nterror(req, status)) {
2268                 return;
2269         }
2270
2271         tevent_req_done(req);
2272 }
2273
2274 NTSTATUS dcerpc_dfs_ManagerInitialize_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
2275 {
2276         struct dcerpc_dfs_ManagerInitialize_r_state *state =
2277                 tevent_req_data(req,
2278                 struct dcerpc_dfs_ManagerInitialize_r_state);
2279         NTSTATUS status;
2280
2281         if (tevent_req_is_nterror(req, &status)) {
2282                 tevent_req_received(req);
2283                 return status;
2284         }
2285
2286         talloc_steal(mem_ctx, state->out_mem_ctx);
2287
2288         tevent_req_received(req);
2289         return NT_STATUS_OK;
2290 }
2291
2292 NTSTATUS dcerpc_dfs_ManagerInitialize_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct dfs_ManagerInitialize *r)
2293 {
2294         NTSTATUS status;
2295
2296         status = dcerpc_binding_handle_call(h,
2297                         NULL, &ndr_table_netdfs,
2298                         NDR_DFS_MANAGERINITIALIZE, mem_ctx, r);
2299
2300         return status;
2301 }
2302
2303 struct dcerpc_dfs_ManagerInitialize_state {
2304         struct dfs_ManagerInitialize orig;
2305         struct dfs_ManagerInitialize tmp;
2306         TALLOC_CTX *out_mem_ctx;
2307 };
2308
2309 static void dcerpc_dfs_ManagerInitialize_done(struct tevent_req *subreq);
2310
2311 struct tevent_req *dcerpc_dfs_ManagerInitialize_send(TALLOC_CTX *mem_ctx,
2312                                                      struct tevent_context *ev,
2313                                                      struct dcerpc_binding_handle *h,
2314                                                      const char *_servername /* [in] [ref,charset(UTF16)] */,
2315                                                      uint32_t _flags /* [in]  */)
2316 {
2317         struct tevent_req *req;
2318         struct dcerpc_dfs_ManagerInitialize_state *state;
2319         struct tevent_req *subreq;
2320
2321         req = tevent_req_create(mem_ctx, &state,
2322                                 struct dcerpc_dfs_ManagerInitialize_state);
2323         if (req == NULL) {
2324                 return NULL;
2325         }
2326         state->out_mem_ctx = NULL;
2327
2328         /* In parameters */
2329         state->orig.in.servername = _servername;
2330         state->orig.in.flags = _flags;
2331
2332         /* Out parameters */
2333
2334         /* Result */
2335         ZERO_STRUCT(state->orig.out.result);
2336
2337         /* make a temporary copy, that we pass to the dispatch function */
2338         state->tmp = state->orig;
2339
2340         subreq = dcerpc_dfs_ManagerInitialize_r_send(state, ev, h, &state->tmp);
2341         if (tevent_req_nomem(subreq, req)) {
2342                 return tevent_req_post(req, ev);
2343         }
2344         tevent_req_set_callback(subreq, dcerpc_dfs_ManagerInitialize_done, req);
2345         return req;
2346 }
2347
2348 static void dcerpc_dfs_ManagerInitialize_done(struct tevent_req *subreq)
2349 {
2350         struct tevent_req *req = tevent_req_callback_data(
2351                 subreq, struct tevent_req);
2352         struct dcerpc_dfs_ManagerInitialize_state *state = tevent_req_data(
2353                 req, struct dcerpc_dfs_ManagerInitialize_state);
2354         NTSTATUS status;
2355         TALLOC_CTX *mem_ctx;
2356
2357         if (state->out_mem_ctx) {
2358                 mem_ctx = state->out_mem_ctx;
2359         } else {
2360                 mem_ctx = state;
2361         }
2362
2363         status = dcerpc_dfs_ManagerInitialize_r_recv(subreq, mem_ctx);
2364         TALLOC_FREE(subreq);
2365         if (tevent_req_nterror(req, status)) {
2366                 return;
2367         }
2368
2369         /* Copy out parameters */
2370
2371         /* Copy result */
2372         state->orig.out.result = state->tmp.out.result;
2373
2374         /* Reset temporary structure */
2375         ZERO_STRUCT(state->tmp);
2376
2377         tevent_req_done(req);
2378 }
2379
2380 NTSTATUS dcerpc_dfs_ManagerInitialize_recv(struct tevent_req *req,
2381                                            TALLOC_CTX *mem_ctx,
2382                                            WERROR *result)
2383 {
2384         struct dcerpc_dfs_ManagerInitialize_state *state = tevent_req_data(
2385                 req, struct dcerpc_dfs_ManagerInitialize_state);
2386         NTSTATUS status;
2387
2388         if (tevent_req_is_nterror(req, &status)) {
2389                 tevent_req_received(req);
2390                 return status;
2391         }
2392
2393         /* Steal possible out parameters to the callers context */
2394         talloc_steal(mem_ctx, state->out_mem_ctx);
2395
2396         /* Return result */
2397         *result = state->orig.out.result;
2398
2399         tevent_req_received(req);
2400         return NT_STATUS_OK;
2401 }
2402
2403 NTSTATUS dcerpc_dfs_ManagerInitialize(struct dcerpc_binding_handle *h,
2404                                       TALLOC_CTX *mem_ctx,
2405                                       const char *_servername /* [in] [ref,charset(UTF16)] */,
2406                                       uint32_t _flags /* [in]  */,
2407                                       WERROR *result)
2408 {
2409         struct dfs_ManagerInitialize r;
2410         NTSTATUS status;
2411
2412         /* In parameters */
2413         r.in.servername = _servername;
2414         r.in.flags = _flags;
2415
2416         status = dcerpc_dfs_ManagerInitialize_r(h, mem_ctx, &r);
2417         if (!NT_STATUS_IS_OK(status)) {
2418                 return status;
2419         }
2420
2421         /* Return variables */
2422
2423         /* Return result */
2424         *result = r.out.result;
2425
2426         return NT_STATUS_OK;
2427 }
2428
2429 struct dcerpc_dfs_AddStdRootForced_r_state {
2430         TALLOC_CTX *out_mem_ctx;
2431 };
2432
2433 static void dcerpc_dfs_AddStdRootForced_r_done(struct tevent_req *subreq);
2434
2435 struct tevent_req *dcerpc_dfs_AddStdRootForced_r_send(TALLOC_CTX *mem_ctx,
2436         struct tevent_context *ev,
2437         struct dcerpc_binding_handle *h,
2438         struct dfs_AddStdRootForced *r)
2439 {
2440         struct tevent_req *req;
2441         struct dcerpc_dfs_AddStdRootForced_r_state *state;
2442         struct tevent_req *subreq;
2443
2444         req = tevent_req_create(mem_ctx, &state,
2445                                 struct dcerpc_dfs_AddStdRootForced_r_state);
2446         if (req == NULL) {
2447                 return NULL;
2448         }
2449
2450         state->out_mem_ctx = NULL;
2451
2452         subreq = dcerpc_binding_handle_call_send(state, ev, h,
2453                         NULL, &ndr_table_netdfs,
2454                         NDR_DFS_ADDSTDROOTFORCED, state, r);
2455         if (tevent_req_nomem(subreq, req)) {
2456                 return tevent_req_post(req, ev);
2457         }
2458         tevent_req_set_callback(subreq, dcerpc_dfs_AddStdRootForced_r_done, req);
2459
2460         return req;
2461 }
2462
2463 static void dcerpc_dfs_AddStdRootForced_r_done(struct tevent_req *subreq)
2464 {
2465         struct tevent_req *req =
2466                 tevent_req_callback_data(subreq,
2467                 struct tevent_req);
2468         NTSTATUS status;
2469
2470         status = dcerpc_binding_handle_call_recv(subreq);
2471         TALLOC_FREE(subreq);
2472         if (tevent_req_nterror(req, status)) {
2473                 return;
2474         }
2475
2476         tevent_req_done(req);
2477 }
2478
2479 NTSTATUS dcerpc_dfs_AddStdRootForced_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
2480 {
2481         struct dcerpc_dfs_AddStdRootForced_r_state *state =
2482                 tevent_req_data(req,
2483                 struct dcerpc_dfs_AddStdRootForced_r_state);
2484         NTSTATUS status;
2485
2486         if (tevent_req_is_nterror(req, &status)) {
2487                 tevent_req_received(req);
2488                 return status;
2489         }
2490
2491         talloc_steal(mem_ctx, state->out_mem_ctx);
2492
2493         tevent_req_received(req);
2494         return NT_STATUS_OK;
2495 }
2496
2497 NTSTATUS dcerpc_dfs_AddStdRootForced_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct dfs_AddStdRootForced *r)
2498 {
2499         NTSTATUS status;
2500
2501         status = dcerpc_binding_handle_call(h,
2502                         NULL, &ndr_table_netdfs,
2503                         NDR_DFS_ADDSTDROOTFORCED, mem_ctx, r);
2504
2505         return status;
2506 }
2507
2508 struct dcerpc_dfs_AddStdRootForced_state {
2509         struct dfs_AddStdRootForced orig;
2510         struct dfs_AddStdRootForced tmp;
2511         TALLOC_CTX *out_mem_ctx;
2512 };
2513
2514 static void dcerpc_dfs_AddStdRootForced_done(struct tevent_req *subreq);
2515
2516 struct tevent_req *dcerpc_dfs_AddStdRootForced_send(TALLOC_CTX *mem_ctx,
2517                                                     struct tevent_context *ev,
2518                                                     struct dcerpc_binding_handle *h,
2519                                                     const char *_servername /* [in] [charset(UTF16)] */,
2520                                                     const char *_rootshare /* [in] [charset(UTF16)] */,
2521                                                     const char *_comment /* [in] [charset(UTF16)] */,
2522                                                     const char *_store /* [in] [charset(UTF16)] */)
2523 {
2524         struct tevent_req *req;
2525         struct dcerpc_dfs_AddStdRootForced_state *state;
2526         struct tevent_req *subreq;
2527
2528         req = tevent_req_create(mem_ctx, &state,
2529                                 struct dcerpc_dfs_AddStdRootForced_state);
2530         if (req == NULL) {
2531                 return NULL;
2532         }
2533         state->out_mem_ctx = NULL;
2534
2535         /* In parameters */
2536         state->orig.in.servername = _servername;
2537         state->orig.in.rootshare = _rootshare;
2538         state->orig.in.comment = _comment;
2539         state->orig.in.store = _store;
2540
2541         /* Out parameters */
2542
2543         /* Result */
2544         ZERO_STRUCT(state->orig.out.result);
2545
2546         /* make a temporary copy, that we pass to the dispatch function */
2547         state->tmp = state->orig;
2548
2549         subreq = dcerpc_dfs_AddStdRootForced_r_send(state, ev, h, &state->tmp);
2550         if (tevent_req_nomem(subreq, req)) {
2551                 return tevent_req_post(req, ev);
2552         }
2553         tevent_req_set_callback(subreq, dcerpc_dfs_AddStdRootForced_done, req);
2554         return req;
2555 }
2556
2557 static void dcerpc_dfs_AddStdRootForced_done(struct tevent_req *subreq)
2558 {
2559         struct tevent_req *req = tevent_req_callback_data(
2560                 subreq, struct tevent_req);
2561         struct dcerpc_dfs_AddStdRootForced_state *state = tevent_req_data(
2562                 req, struct dcerpc_dfs_AddStdRootForced_state);
2563         NTSTATUS status;
2564         TALLOC_CTX *mem_ctx;
2565
2566         if (state->out_mem_ctx) {
2567                 mem_ctx = state->out_mem_ctx;
2568         } else {
2569                 mem_ctx = state;
2570         }
2571
2572         status = dcerpc_dfs_AddStdRootForced_r_recv(subreq, mem_ctx);
2573         TALLOC_FREE(subreq);
2574         if (tevent_req_nterror(req, status)) {
2575                 return;
2576         }
2577
2578         /* Copy out parameters */
2579
2580         /* Copy result */
2581         state->orig.out.result = state->tmp.out.result;
2582
2583         /* Reset temporary structure */
2584         ZERO_STRUCT(state->tmp);
2585
2586         tevent_req_done(req);
2587 }
2588
2589 NTSTATUS dcerpc_dfs_AddStdRootForced_recv(struct tevent_req *req,
2590                                           TALLOC_CTX *mem_ctx,
2591                                           WERROR *result)
2592 {
2593         struct dcerpc_dfs_AddStdRootForced_state *state = tevent_req_data(
2594                 req, struct dcerpc_dfs_AddStdRootForced_state);
2595         NTSTATUS status;
2596
2597         if (tevent_req_is_nterror(req, &status)) {
2598                 tevent_req_received(req);
2599                 return status;
2600         }
2601
2602         /* Steal possible out parameters to the callers context */
2603         talloc_steal(mem_ctx, state->out_mem_ctx);
2604
2605         /* Return result */
2606         *result = state->orig.out.result;
2607
2608         tevent_req_received(req);
2609         return NT_STATUS_OK;
2610 }
2611
2612 NTSTATUS dcerpc_dfs_AddStdRootForced(struct dcerpc_binding_handle *h,
2613                                      TALLOC_CTX *mem_ctx,
2614                                      const char *_servername /* [in] [charset(UTF16)] */,
2615                                      const char *_rootshare /* [in] [charset(UTF16)] */,
2616                                      const char *_comment /* [in] [charset(UTF16)] */,
2617                                      const char *_store /* [in] [charset(UTF16)] */,
2618                                      WERROR *result)
2619 {
2620         struct dfs_AddStdRootForced r;
2621         NTSTATUS status;
2622
2623         /* In parameters */
2624         r.in.servername = _servername;
2625         r.in.rootshare = _rootshare;
2626         r.in.comment = _comment;
2627         r.in.store = _store;
2628
2629         status = dcerpc_dfs_AddStdRootForced_r(h, mem_ctx, &r);
2630         if (!NT_STATUS_IS_OK(status)) {
2631                 return status;
2632         }
2633
2634         /* Return variables */
2635
2636         /* Return result */
2637         *result = r.out.result;
2638
2639         return NT_STATUS_OK;
2640 }
2641
2642 struct dcerpc_dfs_GetDcAddress_r_state {
2643         TALLOC_CTX *out_mem_ctx;
2644 };
2645
2646 static void dcerpc_dfs_GetDcAddress_r_done(struct tevent_req *subreq);
2647
2648 struct tevent_req *dcerpc_dfs_GetDcAddress_r_send(TALLOC_CTX *mem_ctx,
2649         struct tevent_context *ev,
2650         struct dcerpc_binding_handle *h,
2651         struct dfs_GetDcAddress *r)
2652 {
2653         struct tevent_req *req;
2654         struct dcerpc_dfs_GetDcAddress_r_state *state;
2655         struct tevent_req *subreq;
2656
2657         req = tevent_req_create(mem_ctx, &state,
2658                                 struct dcerpc_dfs_GetDcAddress_r_state);
2659         if (req == NULL) {
2660                 return NULL;
2661         }
2662
2663         state->out_mem_ctx = talloc_new(state);
2664         if (tevent_req_nomem(state->out_mem_ctx, req)) {
2665                 return tevent_req_post(req, ev);
2666         }
2667
2668         subreq = dcerpc_binding_handle_call_send(state, ev, h,
2669                         NULL, &ndr_table_netdfs,
2670                         NDR_DFS_GETDCADDRESS, state->out_mem_ctx, r);
2671         if (tevent_req_nomem(subreq, req)) {
2672                 return tevent_req_post(req, ev);
2673         }
2674         tevent_req_set_callback(subreq, dcerpc_dfs_GetDcAddress_r_done, req);
2675
2676         return req;
2677 }
2678
2679 static void dcerpc_dfs_GetDcAddress_r_done(struct tevent_req *subreq)
2680 {
2681         struct tevent_req *req =
2682                 tevent_req_callback_data(subreq,
2683                 struct tevent_req);
2684         NTSTATUS status;
2685
2686         status = dcerpc_binding_handle_call_recv(subreq);
2687         TALLOC_FREE(subreq);
2688         if (tevent_req_nterror(req, status)) {
2689                 return;
2690         }
2691
2692         tevent_req_done(req);
2693 }
2694
2695 NTSTATUS dcerpc_dfs_GetDcAddress_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
2696 {
2697         struct dcerpc_dfs_GetDcAddress_r_state *state =
2698                 tevent_req_data(req,
2699                 struct dcerpc_dfs_GetDcAddress_r_state);
2700         NTSTATUS status;
2701
2702         if (tevent_req_is_nterror(req, &status)) {
2703                 tevent_req_received(req);
2704                 return status;
2705         }
2706
2707         talloc_steal(mem_ctx, state->out_mem_ctx);
2708
2709         tevent_req_received(req);
2710         return NT_STATUS_OK;
2711 }
2712
2713 NTSTATUS dcerpc_dfs_GetDcAddress_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct dfs_GetDcAddress *r)
2714 {
2715         NTSTATUS status;
2716
2717         status = dcerpc_binding_handle_call(h,
2718                         NULL, &ndr_table_netdfs,
2719                         NDR_DFS_GETDCADDRESS, mem_ctx, r);
2720
2721         return status;
2722 }
2723
2724 struct dcerpc_dfs_GetDcAddress_state {
2725         struct dfs_GetDcAddress orig;
2726         struct dfs_GetDcAddress tmp;
2727         TALLOC_CTX *out_mem_ctx;
2728 };
2729
2730 static void dcerpc_dfs_GetDcAddress_done(struct tevent_req *subreq);
2731
2732 struct tevent_req *dcerpc_dfs_GetDcAddress_send(TALLOC_CTX *mem_ctx,
2733                                                 struct tevent_context *ev,
2734                                                 struct dcerpc_binding_handle *h,
2735                                                 const char *_servername /* [in] [charset(UTF16)] */,
2736                                                 const char **_server_fullname /* [in,out] [ref,charset(UTF16)] */,
2737                                                 uint8_t *_is_root /* [in,out] [ref] */,
2738                                                 uint32_t *_ttl /* [in,out] [ref] */)
2739 {
2740         struct tevent_req *req;
2741         struct dcerpc_dfs_GetDcAddress_state *state;
2742         struct tevent_req *subreq;
2743
2744         req = tevent_req_create(mem_ctx, &state,
2745                                 struct dcerpc_dfs_GetDcAddress_state);
2746         if (req == NULL) {
2747                 return NULL;
2748         }
2749         state->out_mem_ctx = NULL;
2750
2751         /* In parameters */
2752         state->orig.in.servername = _servername;
2753         state->orig.in.server_fullname = _server_fullname;
2754         state->orig.in.is_root = _is_root;
2755         state->orig.in.ttl = _ttl;
2756
2757         /* Out parameters */
2758         state->orig.out.server_fullname = _server_fullname;
2759         state->orig.out.is_root = _is_root;
2760         state->orig.out.ttl = _ttl;
2761
2762         /* Result */
2763         ZERO_STRUCT(state->orig.out.result);
2764
2765         state->out_mem_ctx = talloc_named_const(state, 0,
2766                              "dcerpc_dfs_GetDcAddress_out_memory");
2767         if (tevent_req_nomem(state->out_mem_ctx, req)) {
2768                 return tevent_req_post(req, ev);
2769         }
2770
2771         /* make a temporary copy, that we pass to the dispatch function */
2772         state->tmp = state->orig;
2773
2774         subreq = dcerpc_dfs_GetDcAddress_r_send(state, ev, h, &state->tmp);
2775         if (tevent_req_nomem(subreq, req)) {
2776                 return tevent_req_post(req, ev);
2777         }
2778         tevent_req_set_callback(subreq, dcerpc_dfs_GetDcAddress_done, req);
2779         return req;
2780 }
2781
2782 static void dcerpc_dfs_GetDcAddress_done(struct tevent_req *subreq)
2783 {
2784         struct tevent_req *req = tevent_req_callback_data(
2785                 subreq, struct tevent_req);
2786         struct dcerpc_dfs_GetDcAddress_state *state = tevent_req_data(
2787                 req, struct dcerpc_dfs_GetDcAddress_state);
2788         NTSTATUS status;
2789         TALLOC_CTX *mem_ctx;
2790
2791         if (state->out_mem_ctx) {
2792                 mem_ctx = state->out_mem_ctx;
2793         } else {
2794                 mem_ctx = state;
2795         }
2796
2797         status = dcerpc_dfs_GetDcAddress_r_recv(subreq, mem_ctx);
2798         TALLOC_FREE(subreq);
2799         if (tevent_req_nterror(req, status)) {
2800                 return;
2801         }
2802
2803         /* Copy out parameters */
2804         *state->orig.out.server_fullname = *state->tmp.out.server_fullname;
2805         *state->orig.out.is_root = *state->tmp.out.is_root;
2806         *state->orig.out.ttl = *state->tmp.out.ttl;
2807
2808         /* Copy result */
2809         state->orig.out.result = state->tmp.out.result;
2810
2811         /* Reset temporary structure */
2812         ZERO_STRUCT(state->tmp);
2813
2814         tevent_req_done(req);
2815 }
2816
2817 NTSTATUS dcerpc_dfs_GetDcAddress_recv(struct tevent_req *req,
2818                                       TALLOC_CTX *mem_ctx,
2819                                       WERROR *result)
2820 {
2821         struct dcerpc_dfs_GetDcAddress_state *state = tevent_req_data(
2822                 req, struct dcerpc_dfs_GetDcAddress_state);
2823         NTSTATUS status;
2824
2825         if (tevent_req_is_nterror(req, &status)) {
2826                 tevent_req_received(req);
2827                 return status;
2828         }
2829
2830         /* Steal possible out parameters to the callers context */
2831         talloc_steal(mem_ctx, state->out_mem_ctx);
2832
2833         /* Return result */
2834         *result = state->orig.out.result;
2835
2836         tevent_req_received(req);
2837         return NT_STATUS_OK;
2838 }
2839
2840 NTSTATUS dcerpc_dfs_GetDcAddress(struct dcerpc_binding_handle *h,
2841                                  TALLOC_CTX *mem_ctx,
2842                                  const char *_servername /* [in] [charset(UTF16)] */,
2843                                  const char **_server_fullname /* [in,out] [ref,charset(UTF16)] */,
2844                                  uint8_t *_is_root /* [in,out] [ref] */,
2845                                  uint32_t *_ttl /* [in,out] [ref] */,
2846                                  WERROR *result)
2847 {
2848         struct dfs_GetDcAddress r;
2849         NTSTATUS status;
2850
2851         /* In parameters */
2852         r.in.servername = _servername;
2853         r.in.server_fullname = _server_fullname;
2854         r.in.is_root = _is_root;
2855         r.in.ttl = _ttl;
2856
2857         status = dcerpc_dfs_GetDcAddress_r(h, mem_ctx, &r);
2858         if (!NT_STATUS_IS_OK(status)) {
2859                 return status;
2860         }
2861
2862         /* Return variables */
2863         *_server_fullname = *r.out.server_fullname;
2864         *_is_root = *r.out.is_root;
2865         *_ttl = *r.out.ttl;
2866
2867         /* Return result */
2868         *result = r.out.result;
2869
2870         return NT_STATUS_OK;
2871 }
2872
2873 struct dcerpc_dfs_SetDcAddress_r_state {
2874         TALLOC_CTX *out_mem_ctx;
2875 };
2876
2877 static void dcerpc_dfs_SetDcAddress_r_done(struct tevent_req *subreq);
2878
2879 struct tevent_req *dcerpc_dfs_SetDcAddress_r_send(TALLOC_CTX *mem_ctx,
2880         struct tevent_context *ev,
2881         struct dcerpc_binding_handle *h,
2882         struct dfs_SetDcAddress *r)
2883 {
2884         struct tevent_req *req;
2885         struct dcerpc_dfs_SetDcAddress_r_state *state;
2886         struct tevent_req *subreq;
2887
2888         req = tevent_req_create(mem_ctx, &state,
2889                                 struct dcerpc_dfs_SetDcAddress_r_state);
2890         if (req == NULL) {
2891                 return NULL;
2892         }
2893
2894         state->out_mem_ctx = NULL;
2895
2896         subreq = dcerpc_binding_handle_call_send(state, ev, h,
2897                         NULL, &ndr_table_netdfs,
2898                         NDR_DFS_SETDCADDRESS, state, r);
2899         if (tevent_req_nomem(subreq, req)) {
2900                 return tevent_req_post(req, ev);
2901         }
2902         tevent_req_set_callback(subreq, dcerpc_dfs_SetDcAddress_r_done, req);
2903
2904         return req;
2905 }
2906
2907 static void dcerpc_dfs_SetDcAddress_r_done(struct tevent_req *subreq)
2908 {
2909         struct tevent_req *req =
2910                 tevent_req_callback_data(subreq,
2911                 struct tevent_req);
2912         NTSTATUS status;
2913
2914         status = dcerpc_binding_handle_call_recv(subreq);
2915         TALLOC_FREE(subreq);
2916         if (tevent_req_nterror(req, status)) {
2917                 return;
2918         }
2919
2920         tevent_req_done(req);
2921 }
2922
2923 NTSTATUS dcerpc_dfs_SetDcAddress_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
2924 {
2925         struct dcerpc_dfs_SetDcAddress_r_state *state =
2926                 tevent_req_data(req,
2927                 struct dcerpc_dfs_SetDcAddress_r_state);
2928         NTSTATUS status;
2929
2930         if (tevent_req_is_nterror(req, &status)) {
2931                 tevent_req_received(req);
2932                 return status;
2933         }
2934
2935         talloc_steal(mem_ctx, state->out_mem_ctx);
2936
2937         tevent_req_received(req);
2938         return NT_STATUS_OK;
2939 }
2940
2941 NTSTATUS dcerpc_dfs_SetDcAddress_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct dfs_SetDcAddress *r)
2942 {
2943         NTSTATUS status;
2944
2945         status = dcerpc_binding_handle_call(h,
2946                         NULL, &ndr_table_netdfs,
2947                         NDR_DFS_SETDCADDRESS, mem_ctx, r);
2948
2949         return status;
2950 }
2951
2952 struct dcerpc_dfs_SetDcAddress_state {
2953         struct dfs_SetDcAddress orig;
2954         struct dfs_SetDcAddress tmp;
2955         TALLOC_CTX *out_mem_ctx;
2956 };
2957
2958 static void dcerpc_dfs_SetDcAddress_done(struct tevent_req *subreq);
2959
2960 struct tevent_req *dcerpc_dfs_SetDcAddress_send(TALLOC_CTX *mem_ctx,
2961                                                 struct tevent_context *ev,
2962                                                 struct dcerpc_binding_handle *h,
2963                                                 const char *_servername /* [in] [charset(UTF16)] */,
2964                                                 const char *_server_fullname /* [in] [charset(UTF16)] */,
2965                                                 uint32_t _flags /* [in]  */,
2966                                                 uint32_t _ttl /* [in]  */)
2967 {
2968         struct tevent_req *req;
2969         struct dcerpc_dfs_SetDcAddress_state *state;
2970         struct tevent_req *subreq;
2971
2972         req = tevent_req_create(mem_ctx, &state,
2973                                 struct dcerpc_dfs_SetDcAddress_state);
2974         if (req == NULL) {
2975                 return NULL;
2976         }
2977         state->out_mem_ctx = NULL;
2978
2979         /* In parameters */
2980         state->orig.in.servername = _servername;
2981         state->orig.in.server_fullname = _server_fullname;
2982         state->orig.in.flags = _flags;
2983         state->orig.in.ttl = _ttl;
2984
2985         /* Out parameters */
2986
2987         /* Result */
2988         ZERO_STRUCT(state->orig.out.result);
2989
2990         /* make a temporary copy, that we pass to the dispatch function */
2991         state->tmp = state->orig;
2992
2993         subreq = dcerpc_dfs_SetDcAddress_r_send(state, ev, h, &state->tmp);
2994         if (tevent_req_nomem(subreq, req)) {
2995                 return tevent_req_post(req, ev);
2996         }
2997         tevent_req_set_callback(subreq, dcerpc_dfs_SetDcAddress_done, req);
2998         return req;
2999 }
3000
3001 static void dcerpc_dfs_SetDcAddress_done(struct tevent_req *subreq)
3002 {
3003         struct tevent_req *req = tevent_req_callback_data(
3004                 subreq, struct tevent_req);
3005         struct dcerpc_dfs_SetDcAddress_state *state = tevent_req_data(
3006                 req, struct dcerpc_dfs_SetDcAddress_state);
3007         NTSTATUS status;
3008         TALLOC_CTX *mem_ctx;
3009
3010         if (state->out_mem_ctx) {
3011                 mem_ctx = state->out_mem_ctx;
3012         } else {
3013                 mem_ctx = state;
3014         }
3015
3016         status = dcerpc_dfs_SetDcAddress_r_recv(subreq, mem_ctx);
3017         TALLOC_FREE(subreq);
3018         if (tevent_req_nterror(req, status)) {
3019                 return;
3020         }
3021
3022         /* Copy out parameters */
3023
3024         /* Copy result */
3025         state->orig.out.result = state->tmp.out.result;
3026
3027         /* Reset temporary structure */
3028         ZERO_STRUCT(state->tmp);
3029
3030         tevent_req_done(req);
3031 }
3032
3033 NTSTATUS dcerpc_dfs_SetDcAddress_recv(struct tevent_req *req,
3034                                       TALLOC_CTX *mem_ctx,
3035                                       WERROR *result)
3036 {
3037         struct dcerpc_dfs_SetDcAddress_state *state = tevent_req_data(
3038                 req, struct dcerpc_dfs_SetDcAddress_state);
3039         NTSTATUS status;
3040
3041         if (tevent_req_is_nterror(req, &status)) {
3042                 tevent_req_received(req);
3043                 return status;
3044         }
3045
3046         /* Steal possible out parameters to the callers context */
3047         talloc_steal(mem_ctx, state->out_mem_ctx);
3048
3049         /* Return result */
3050         *result = state->orig.out.result;
3051
3052         tevent_req_received(req);
3053         return NT_STATUS_OK;
3054 }
3055
3056 NTSTATUS dcerpc_dfs_SetDcAddress(struct dcerpc_binding_handle *h,
3057                                  TALLOC_CTX *mem_ctx,
3058                                  const char *_servername /* [in] [charset(UTF16)] */,
3059                                  const char *_server_fullname /* [in] [charset(UTF16)] */,
3060                                  uint32_t _flags /* [in]  */,
3061                                  uint32_t _ttl /* [in]  */,
3062                                  WERROR *result)
3063 {
3064         struct dfs_SetDcAddress r;
3065         NTSTATUS status;
3066
3067         /* In parameters */
3068         r.in.servername = _servername;
3069         r.in.server_fullname = _server_fullname;
3070         r.in.flags = _flags;
3071         r.in.ttl = _ttl;
3072
3073         status = dcerpc_dfs_SetDcAddress_r(h, mem_ctx, &r);
3074         if (!NT_STATUS_IS_OK(status)) {
3075                 return status;
3076         }
3077
3078         /* Return variables */
3079
3080         /* Return result */
3081         *result = r.out.result;
3082
3083         return NT_STATUS_OK;
3084 }
3085
3086 struct dcerpc_dfs_FlushFtTable_r_state {
3087         TALLOC_CTX *out_mem_ctx;
3088 };
3089
3090 static void dcerpc_dfs_FlushFtTable_r_done(struct tevent_req *subreq);
3091
3092 struct tevent_req *dcerpc_dfs_FlushFtTable_r_send(TALLOC_CTX *mem_ctx,
3093         struct tevent_context *ev,
3094         struct dcerpc_binding_handle *h,
3095         struct dfs_FlushFtTable *r)
3096 {
3097         struct tevent_req *req;
3098         struct dcerpc_dfs_FlushFtTable_r_state *state;
3099         struct tevent_req *subreq;
3100
3101         req = tevent_req_create(mem_ctx, &state,
3102                                 struct dcerpc_dfs_FlushFtTable_r_state);
3103         if (req == NULL) {
3104                 return NULL;
3105         }
3106
3107         state->out_mem_ctx = NULL;
3108
3109         subreq = dcerpc_binding_handle_call_send(state, ev, h,
3110                         NULL, &ndr_table_netdfs,
3111                         NDR_DFS_FLUSHFTTABLE, state, r);
3112         if (tevent_req_nomem(subreq, req)) {
3113                 return tevent_req_post(req, ev);
3114         }
3115         tevent_req_set_callback(subreq, dcerpc_dfs_FlushFtTable_r_done, req);
3116
3117         return req;
3118 }
3119
3120 static void dcerpc_dfs_FlushFtTable_r_done(struct tevent_req *subreq)
3121 {
3122         struct tevent_req *req =
3123                 tevent_req_callback_data(subreq,
3124                 struct tevent_req);
3125         NTSTATUS status;
3126
3127         status = dcerpc_binding_handle_call_recv(subreq);
3128         TALLOC_FREE(subreq);
3129         if (tevent_req_nterror(req, status)) {
3130                 return;
3131         }
3132
3133         tevent_req_done(req);
3134 }
3135
3136 NTSTATUS dcerpc_dfs_FlushFtTable_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
3137 {
3138         struct dcerpc_dfs_FlushFtTable_r_state *state =
3139                 tevent_req_data(req,
3140                 struct dcerpc_dfs_FlushFtTable_r_state);
3141         NTSTATUS status;
3142
3143         if (tevent_req_is_nterror(req, &status)) {
3144                 tevent_req_received(req);
3145                 return status;
3146         }
3147
3148         talloc_steal(mem_ctx, state->out_mem_ctx);
3149
3150         tevent_req_received(req);
3151         return NT_STATUS_OK;
3152 }
3153
3154 NTSTATUS dcerpc_dfs_FlushFtTable_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct dfs_FlushFtTable *r)
3155 {
3156         NTSTATUS status;
3157
3158         status = dcerpc_binding_handle_call(h,
3159                         NULL, &ndr_table_netdfs,
3160                         NDR_DFS_FLUSHFTTABLE, mem_ctx, r);
3161
3162         return status;
3163 }
3164
3165 struct dcerpc_dfs_FlushFtTable_state {
3166         struct dfs_FlushFtTable orig;
3167         struct dfs_FlushFtTable tmp;
3168         TALLOC_CTX *out_mem_ctx;
3169 };
3170
3171 static void dcerpc_dfs_FlushFtTable_done(struct tevent_req *subreq);
3172
3173 struct tevent_req *dcerpc_dfs_FlushFtTable_send(TALLOC_CTX *mem_ctx,
3174                                                 struct tevent_context *ev,
3175                                                 struct dcerpc_binding_handle *h,
3176                                                 const char *_servername /* [in] [charset(UTF16)] */,
3177                                                 const char *_rootshare /* [in] [charset(UTF16)] */)
3178 {
3179         struct tevent_req *req;
3180         struct dcerpc_dfs_FlushFtTable_state *state;
3181         struct tevent_req *subreq;
3182
3183         req = tevent_req_create(mem_ctx, &state,
3184                                 struct dcerpc_dfs_FlushFtTable_state);
3185         if (req == NULL) {
3186                 return NULL;
3187         }
3188         state->out_mem_ctx = NULL;
3189
3190         /* In parameters */
3191         state->orig.in.servername = _servername;
3192         state->orig.in.rootshare = _rootshare;
3193
3194         /* Out parameters */
3195
3196         /* Result */
3197         ZERO_STRUCT(state->orig.out.result);
3198
3199         /* make a temporary copy, that we pass to the dispatch function */
3200         state->tmp = state->orig;
3201
3202         subreq = dcerpc_dfs_FlushFtTable_r_send(state, ev, h, &state->tmp);
3203         if (tevent_req_nomem(subreq, req)) {
3204                 return tevent_req_post(req, ev);
3205         }
3206         tevent_req_set_callback(subreq, dcerpc_dfs_FlushFtTable_done, req);
3207         return req;
3208 }
3209
3210 static void dcerpc_dfs_FlushFtTable_done(struct tevent_req *subreq)
3211 {
3212         struct tevent_req *req = tevent_req_callback_data(
3213                 subreq, struct tevent_req);
3214         struct dcerpc_dfs_FlushFtTable_state *state = tevent_req_data(
3215                 req, struct dcerpc_dfs_FlushFtTable_state);
3216         NTSTATUS status;
3217         TALLOC_CTX *mem_ctx;
3218
3219         if (state->out_mem_ctx) {
3220                 mem_ctx = state->out_mem_ctx;
3221         } else {
3222                 mem_ctx = state;
3223         }
3224
3225         status = dcerpc_dfs_FlushFtTable_r_recv(subreq, mem_ctx);
3226         TALLOC_FREE(subreq);
3227         if (tevent_req_nterror(req, status)) {
3228                 return;
3229         }
3230
3231         /* Copy out parameters */
3232
3233         /* Copy result */
3234         state->orig.out.result = state->tmp.out.result;
3235
3236         /* Reset temporary structure */
3237         ZERO_STRUCT(state->tmp);
3238
3239         tevent_req_done(req);
3240 }
3241
3242 NTSTATUS dcerpc_dfs_FlushFtTable_recv(struct tevent_req *req,
3243                                       TALLOC_CTX *mem_ctx,
3244                                       WERROR *result)
3245 {
3246         struct dcerpc_dfs_FlushFtTable_state *state = tevent_req_data(
3247                 req, struct dcerpc_dfs_FlushFtTable_state);
3248         NTSTATUS status;
3249
3250         if (tevent_req_is_nterror(req, &status)) {
3251                 tevent_req_received(req);
3252                 return status;
3253         }
3254
3255         /* Steal possible out parameters to the callers context */
3256         talloc_steal(mem_ctx, state->out_mem_ctx);
3257
3258         /* Return result */
3259         *result = state->orig.out.result;
3260
3261         tevent_req_received(req);
3262         return NT_STATUS_OK;
3263 }
3264
3265 NTSTATUS dcerpc_dfs_FlushFtTable(struct dcerpc_binding_handle *h,
3266                                  TALLOC_CTX *mem_ctx,
3267                                  const char *_servername /* [in] [charset(UTF16)] */,
3268                                  const char *_rootshare /* [in] [charset(UTF16)] */,
3269                                  WERROR *result)
3270 {
3271         struct dfs_FlushFtTable r;
3272         NTSTATUS status;
3273
3274         /* In parameters */
3275         r.in.servername = _servername;
3276         r.in.rootshare = _rootshare;
3277
3278         status = dcerpc_dfs_FlushFtTable_r(h, mem_ctx, &r);
3279         if (!NT_STATUS_IS_OK(status)) {
3280                 return status;
3281         }
3282
3283         /* Return variables */
3284
3285         /* Return result */
3286         *result = r.out.result;
3287
3288         return NT_STATUS_OK;
3289 }
3290
3291 struct dcerpc_dfs_EnumEx_r_state {
3292         TALLOC_CTX *out_mem_ctx;
3293 };
3294
3295 static void dcerpc_dfs_EnumEx_r_done(struct tevent_req *subreq);
3296
3297 struct tevent_req *dcerpc_dfs_EnumEx_r_send(TALLOC_CTX *mem_ctx,
3298         struct tevent_context *ev,
3299         struct dcerpc_binding_handle *h,
3300         struct dfs_EnumEx *r)
3301 {
3302         struct tevent_req *req;
3303         struct dcerpc_dfs_EnumEx_r_state *state;
3304         struct tevent_req *subreq;
3305
3306         req = tevent_req_create(mem_ctx, &state,
3307                                 struct dcerpc_dfs_EnumEx_r_state);
3308         if (req == NULL) {
3309                 return NULL;
3310         }
3311
3312         state->out_mem_ctx = talloc_new(state);
3313         if (tevent_req_nomem(state->out_mem_ctx, req)) {
3314                 return tevent_req_post(req, ev);
3315         }
3316
3317         subreq = dcerpc_binding_handle_call_send(state, ev, h,
3318                         NULL, &ndr_table_netdfs,
3319                         NDR_DFS_ENUMEX, state->out_mem_ctx, r);
3320         if (tevent_req_nomem(subreq, req)) {
3321                 return tevent_req_post(req, ev);
3322         }
3323         tevent_req_set_callback(subreq, dcerpc_dfs_EnumEx_r_done, req);
3324
3325         return req;
3326 }
3327
3328 static void dcerpc_dfs_EnumEx_r_done(struct tevent_req *subreq)
3329 {
3330         struct tevent_req *req =
3331                 tevent_req_callback_data(subreq,
3332                 struct tevent_req);
3333         NTSTATUS status;
3334
3335         status = dcerpc_binding_handle_call_recv(subreq);
3336         TALLOC_FREE(subreq);
3337         if (tevent_req_nterror(req, status)) {
3338                 return;
3339         }
3340
3341         tevent_req_done(req);
3342 }
3343
3344 NTSTATUS dcerpc_dfs_EnumEx_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
3345 {
3346         struct dcerpc_dfs_EnumEx_r_state *state =
3347                 tevent_req_data(req,
3348                 struct dcerpc_dfs_EnumEx_r_state);
3349         NTSTATUS status;
3350
3351         if (tevent_req_is_nterror(req, &status)) {
3352                 tevent_req_received(req);
3353                 return status;
3354         }
3355
3356         talloc_steal(mem_ctx, state->out_mem_ctx);
3357
3358         tevent_req_received(req);
3359         return NT_STATUS_OK;
3360 }
3361
3362 NTSTATUS dcerpc_dfs_EnumEx_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct dfs_EnumEx *r)
3363 {
3364         NTSTATUS status;
3365
3366         status = dcerpc_binding_handle_call(h,
3367                         NULL, &ndr_table_netdfs,
3368                         NDR_DFS_ENUMEX, mem_ctx, r);
3369
3370         return status;
3371 }
3372
3373 struct dcerpc_dfs_EnumEx_state {
3374         struct dfs_EnumEx orig;
3375         struct dfs_EnumEx tmp;
3376         TALLOC_CTX *out_mem_ctx;
3377 };
3378
3379 static void dcerpc_dfs_EnumEx_done(struct tevent_req *subreq);
3380
3381 struct tevent_req *dcerpc_dfs_EnumEx_send(TALLOC_CTX *mem_ctx,
3382                                           struct tevent_context *ev,
3383                                           struct dcerpc_binding_handle *h,
3384                                           const char *_dfs_name /* [in] [charset(UTF16)] */,
3385                                           uint32_t _level /* [in]  */,
3386                                           uint32_t _bufsize /* [in]  */,
3387                                           struct dfs_EnumStruct *_info /* [in,out] [unique] */,
3388                                           uint32_t *_total /* [in,out] [unique] */)
3389 {
3390         struct tevent_req *req;
3391         struct dcerpc_dfs_EnumEx_state *state;
3392         struct tevent_req *subreq;
3393
3394         req = tevent_req_create(mem_ctx, &state,
3395                                 struct dcerpc_dfs_EnumEx_state);
3396         if (req == NULL) {
3397                 return NULL;
3398         }
3399         state->out_mem_ctx = NULL;
3400
3401         /* In parameters */
3402         state->orig.in.dfs_name = _dfs_name;
3403         state->orig.in.level = _level;
3404         state->orig.in.bufsize = _bufsize;
3405         state->orig.in.info = _info;
3406         state->orig.in.total = _total;
3407
3408         /* Out parameters */
3409         state->orig.out.info = _info;
3410         state->orig.out.total = _total;
3411
3412         /* Result */
3413         ZERO_STRUCT(state->orig.out.result);
3414
3415         state->out_mem_ctx = talloc_named_const(state, 0,
3416                              "dcerpc_dfs_EnumEx_out_memory");
3417         if (tevent_req_nomem(state->out_mem_ctx, req)) {
3418                 return tevent_req_post(req, ev);
3419         }
3420
3421         /* make a temporary copy, that we pass to the dispatch function */
3422         state->tmp = state->orig;
3423
3424         subreq = dcerpc_dfs_EnumEx_r_send(state, ev, h, &state->tmp);
3425         if (tevent_req_nomem(subreq, req)) {
3426                 return tevent_req_post(req, ev);
3427         }
3428         tevent_req_set_callback(subreq, dcerpc_dfs_EnumEx_done, req);
3429         return req;
3430 }
3431
3432 static void dcerpc_dfs_EnumEx_done(struct tevent_req *subreq)
3433 {
3434         struct tevent_req *req = tevent_req_callback_data(
3435                 subreq, struct tevent_req);
3436         struct dcerpc_dfs_EnumEx_state *state = tevent_req_data(
3437                 req, struct dcerpc_dfs_EnumEx_state);
3438         NTSTATUS status;
3439         TALLOC_CTX *mem_ctx;
3440
3441         if (state->out_mem_ctx) {
3442                 mem_ctx = state->out_mem_ctx;
3443         } else {
3444                 mem_ctx = state;
3445         }
3446
3447         status = dcerpc_dfs_EnumEx_r_recv(subreq, mem_ctx);
3448         TALLOC_FREE(subreq);
3449         if (tevent_req_nterror(req, status)) {
3450                 return;
3451         }
3452
3453         /* Copy out parameters */
3454         if (state->orig.out.info && state->tmp.out.info) {
3455                 *state->orig.out.info = *state->tmp.out.info;
3456         }
3457         if (state->orig.out.total && state->tmp.out.total) {
3458                 *state->orig.out.total = *state->tmp.out.total;
3459         }
3460
3461         /* Copy result */
3462         state->orig.out.result = state->tmp.out.result;
3463
3464         /* Reset temporary structure */
3465         ZERO_STRUCT(state->tmp);
3466
3467         tevent_req_done(req);
3468 }
3469
3470 NTSTATUS dcerpc_dfs_EnumEx_recv(struct tevent_req *req,
3471                                 TALLOC_CTX *mem_ctx,
3472                                 WERROR *result)
3473 {
3474         struct dcerpc_dfs_EnumEx_state *state = tevent_req_data(
3475                 req, struct dcerpc_dfs_EnumEx_state);
3476         NTSTATUS status;
3477
3478         if (tevent_req_is_nterror(req, &status)) {
3479                 tevent_req_received(req);
3480                 return status;
3481         }
3482
3483         /* Steal possible out parameters to the callers context */
3484         talloc_steal(mem_ctx, state->out_mem_ctx);
3485
3486         /* Return result */
3487         *result = state->orig.out.result;
3488
3489         tevent_req_received(req);
3490         return NT_STATUS_OK;
3491 }
3492
3493 NTSTATUS dcerpc_dfs_EnumEx(struct dcerpc_binding_handle *h,
3494                            TALLOC_CTX *mem_ctx,
3495                            const char *_dfs_name /* [in] [charset(UTF16)] */,
3496                            uint32_t _level /* [in]  */,
3497                            uint32_t _bufsize /* [in]  */,
3498                            struct dfs_EnumStruct *_info /* [in,out] [unique] */,
3499                            uint32_t *_total /* [in,out] [unique] */,
3500                            WERROR *result)
3501 {
3502         struct dfs_EnumEx r;
3503         NTSTATUS status;
3504
3505         /* In parameters */
3506         r.in.dfs_name = _dfs_name;
3507         r.in.level = _level;
3508         r.in.bufsize = _bufsize;
3509         r.in.info = _info;
3510         r.in.total = _total;
3511
3512         status = dcerpc_dfs_EnumEx_r(h, mem_ctx, &r);
3513         if (!NT_STATUS_IS_OK(status)) {
3514                 return status;
3515         }
3516
3517         /* Return variables */
3518         if (_info && r.out.info) {
3519                 *_info = *r.out.info;
3520         }
3521         if (_total && r.out.total) {
3522                 *_total = *r.out.total;
3523         }
3524
3525         /* Return result */
3526         *result = r.out.result;
3527
3528         return NT_STATUS_OK;
3529 }
3530