r18526: Use generated server for unixinfo RPC interface.
[Samba.git] / source / librpc / gen_ndr / srv_dfs.c
blobbd4503248d821e5e1ea2afdcdc34cd4cf1308299
1 /*
2 * Unix SMB/CIFS implementation.
3 * server auto-generated by pidl. DO NOT MODIFY!
4 */
6 #include "includes.h"
7 #include "librpc/gen_ndr/srv_dfs.h"
9 static BOOL api_dfs_GetManagerVersion(pipes_struct *p)
11 struct ndr_pull *pull;
12 struct ndr_push *push;
13 NTSTATUS status;
14 DATA_BLOB blob;
15 struct dfs_GetManagerVersion r;
16 TALLOC_CTX *mem_ctx = talloc_init("api_dfs_GetManagerVersion");
18 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
19 talloc_free(mem_ctx);
20 return False;
23 pull = ndr_pull_init_blob(&blob, mem_ctx);
24 if (pull == NULL)
25 return False;
27 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
28 status = ndr_pull_dfs_GetManagerVersion(pull, NDR_IN, &r);
29 if (NT_STATUS_IS_ERR(status)) {
30 talloc_free(mem_ctx);
31 return False;
34 r.out.exist_flag = talloc_size(mem_ctx, sizeof(*r.out.exist_flag));
35 if (r.out.exist_flag == NULL) {
36 talloc_free(mem_ctx);
37 return False;
40 _dfs_GetManagerVersion(p, r.out.exist_flag);
42 push = ndr_push_init_ctx(mem_ctx);
43 if (push == NULL) {
44 talloc_free(mem_ctx);
45 return False;
48 status = ndr_push_dfs_GetManagerVersion(push, NDR_OUT, &r);
49 if (NT_STATUS_IS_ERR(status)) {
50 talloc_free(mem_ctx);
51 return False;
54 blob = ndr_push_blob(push);
55 if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) {
56 talloc_free(mem_ctx);
57 return False;
60 talloc_free(mem_ctx);
62 return True;
65 static BOOL api_dfs_Add(pipes_struct *p)
67 struct ndr_pull *pull;
68 struct ndr_push *push;
69 NTSTATUS status;
70 DATA_BLOB blob;
71 struct dfs_Add r;
72 TALLOC_CTX *mem_ctx = talloc_init("api_dfs_Add");
74 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
75 talloc_free(mem_ctx);
76 return False;
79 pull = ndr_pull_init_blob(&blob, mem_ctx);
80 if (pull == NULL)
81 return False;
83 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
84 status = ndr_pull_dfs_Add(pull, NDR_IN, &r);
85 if (NT_STATUS_IS_ERR(status)) {
86 talloc_free(mem_ctx);
87 return False;
90 r.out.result = _dfs_Add(p, r.in.path, r.in.server, r.in.share, r.in.comment, r.in.flags);
92 push = ndr_push_init_ctx(mem_ctx);
93 if (push == NULL) {
94 talloc_free(mem_ctx);
95 return False;
98 status = ndr_push_dfs_Add(push, NDR_OUT, &r);
99 if (NT_STATUS_IS_ERR(status)) {
100 talloc_free(mem_ctx);
101 return False;
104 blob = ndr_push_blob(push);
105 if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) {
106 talloc_free(mem_ctx);
107 return False;
110 talloc_free(mem_ctx);
112 return True;
115 static BOOL api_dfs_Remove(pipes_struct *p)
117 struct ndr_pull *pull;
118 struct ndr_push *push;
119 NTSTATUS status;
120 DATA_BLOB blob;
121 struct dfs_Remove r;
122 TALLOC_CTX *mem_ctx = talloc_init("api_dfs_Remove");
124 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
125 talloc_free(mem_ctx);
126 return False;
129 pull = ndr_pull_init_blob(&blob, mem_ctx);
130 if (pull == NULL)
131 return False;
133 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
134 status = ndr_pull_dfs_Remove(pull, NDR_IN, &r);
135 if (NT_STATUS_IS_ERR(status)) {
136 talloc_free(mem_ctx);
137 return False;
140 r.out.result = _dfs_Remove(p, r.in.path, r.in.server, r.in.share);
142 push = ndr_push_init_ctx(mem_ctx);
143 if (push == NULL) {
144 talloc_free(mem_ctx);
145 return False;
148 status = ndr_push_dfs_Remove(push, NDR_OUT, &r);
149 if (NT_STATUS_IS_ERR(status)) {
150 talloc_free(mem_ctx);
151 return False;
154 blob = ndr_push_blob(push);
155 if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) {
156 talloc_free(mem_ctx);
157 return False;
160 talloc_free(mem_ctx);
162 return True;
165 static BOOL api_dfs_SetInfo(pipes_struct *p)
167 struct ndr_pull *pull;
168 struct ndr_push *push;
169 NTSTATUS status;
170 DATA_BLOB blob;
171 struct dfs_SetInfo r;
172 TALLOC_CTX *mem_ctx = talloc_init("api_dfs_SetInfo");
174 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
175 talloc_free(mem_ctx);
176 return False;
179 pull = ndr_pull_init_blob(&blob, mem_ctx);
180 if (pull == NULL)
181 return False;
183 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
184 status = ndr_pull_dfs_SetInfo(pull, NDR_IN, &r);
185 if (NT_STATUS_IS_ERR(status)) {
186 talloc_free(mem_ctx);
187 return False;
190 r.out.result = _dfs_SetInfo(p);
192 push = ndr_push_init_ctx(mem_ctx);
193 if (push == NULL) {
194 talloc_free(mem_ctx);
195 return False;
198 status = ndr_push_dfs_SetInfo(push, NDR_OUT, &r);
199 if (NT_STATUS_IS_ERR(status)) {
200 talloc_free(mem_ctx);
201 return False;
204 blob = ndr_push_blob(push);
205 if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) {
206 talloc_free(mem_ctx);
207 return False;
210 talloc_free(mem_ctx);
212 return True;
215 static BOOL api_dfs_GetInfo(pipes_struct *p)
217 struct ndr_pull *pull;
218 struct ndr_push *push;
219 NTSTATUS status;
220 DATA_BLOB blob;
221 struct dfs_GetInfo r;
222 TALLOC_CTX *mem_ctx = talloc_init("api_dfs_GetInfo");
224 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
225 talloc_free(mem_ctx);
226 return False;
229 pull = ndr_pull_init_blob(&blob, mem_ctx);
230 if (pull == NULL)
231 return False;
233 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
234 status = ndr_pull_dfs_GetInfo(pull, NDR_IN, &r);
235 if (NT_STATUS_IS_ERR(status)) {
236 talloc_free(mem_ctx);
237 return False;
240 r.out.info = talloc_size(mem_ctx, sizeof(*r.out.info));
241 if (r.out.info == NULL) {
242 talloc_free(mem_ctx);
243 return False;
246 r.out.result = _dfs_GetInfo(p, r.in.path, r.in.server, r.in.share, r.in.level, r.out.info);
248 push = ndr_push_init_ctx(mem_ctx);
249 if (push == NULL) {
250 talloc_free(mem_ctx);
251 return False;
254 status = ndr_push_dfs_GetInfo(push, NDR_OUT, &r);
255 if (NT_STATUS_IS_ERR(status)) {
256 talloc_free(mem_ctx);
257 return False;
260 blob = ndr_push_blob(push);
261 if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) {
262 talloc_free(mem_ctx);
263 return False;
266 talloc_free(mem_ctx);
268 return True;
271 static BOOL api_dfs_Enum(pipes_struct *p)
273 struct ndr_pull *pull;
274 struct ndr_push *push;
275 NTSTATUS status;
276 DATA_BLOB blob;
277 struct dfs_Enum r;
278 TALLOC_CTX *mem_ctx = talloc_init("api_dfs_Enum");
280 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
281 talloc_free(mem_ctx);
282 return False;
285 pull = ndr_pull_init_blob(&blob, mem_ctx);
286 if (pull == NULL)
287 return False;
289 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
290 status = ndr_pull_dfs_Enum(pull, NDR_IN, &r);
291 if (NT_STATUS_IS_ERR(status)) {
292 talloc_free(mem_ctx);
293 return False;
296 r.out.info = r.in.info;
297 r.out.total = r.in.total;
298 r.out.result = _dfs_Enum(p, r.in.level, r.in.bufsize, r.in.info, r.in.unknown, r.in.total);
300 push = ndr_push_init_ctx(mem_ctx);
301 if (push == NULL) {
302 talloc_free(mem_ctx);
303 return False;
306 status = ndr_push_dfs_Enum(push, NDR_OUT, &r);
307 if (NT_STATUS_IS_ERR(status)) {
308 talloc_free(mem_ctx);
309 return False;
312 blob = ndr_push_blob(push);
313 if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) {
314 talloc_free(mem_ctx);
315 return False;
318 talloc_free(mem_ctx);
320 return True;
323 static BOOL api_dfs_Rename(pipes_struct *p)
325 struct ndr_pull *pull;
326 struct ndr_push *push;
327 NTSTATUS status;
328 DATA_BLOB blob;
329 struct dfs_Rename r;
330 TALLOC_CTX *mem_ctx = talloc_init("api_dfs_Rename");
332 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
333 talloc_free(mem_ctx);
334 return False;
337 pull = ndr_pull_init_blob(&blob, mem_ctx);
338 if (pull == NULL)
339 return False;
341 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
342 status = ndr_pull_dfs_Rename(pull, NDR_IN, &r);
343 if (NT_STATUS_IS_ERR(status)) {
344 talloc_free(mem_ctx);
345 return False;
348 r.out.result = _dfs_Rename(p);
350 push = ndr_push_init_ctx(mem_ctx);
351 if (push == NULL) {
352 talloc_free(mem_ctx);
353 return False;
356 status = ndr_push_dfs_Rename(push, NDR_OUT, &r);
357 if (NT_STATUS_IS_ERR(status)) {
358 talloc_free(mem_ctx);
359 return False;
362 blob = ndr_push_blob(push);
363 if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) {
364 talloc_free(mem_ctx);
365 return False;
368 talloc_free(mem_ctx);
370 return True;
373 static BOOL api_dfs_Move(pipes_struct *p)
375 struct ndr_pull *pull;
376 struct ndr_push *push;
377 NTSTATUS status;
378 DATA_BLOB blob;
379 struct dfs_Move r;
380 TALLOC_CTX *mem_ctx = talloc_init("api_dfs_Move");
382 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
383 talloc_free(mem_ctx);
384 return False;
387 pull = ndr_pull_init_blob(&blob, mem_ctx);
388 if (pull == NULL)
389 return False;
391 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
392 status = ndr_pull_dfs_Move(pull, NDR_IN, &r);
393 if (NT_STATUS_IS_ERR(status)) {
394 talloc_free(mem_ctx);
395 return False;
398 r.out.result = _dfs_Move(p);
400 push = ndr_push_init_ctx(mem_ctx);
401 if (push == NULL) {
402 talloc_free(mem_ctx);
403 return False;
406 status = ndr_push_dfs_Move(push, NDR_OUT, &r);
407 if (NT_STATUS_IS_ERR(status)) {
408 talloc_free(mem_ctx);
409 return False;
412 blob = ndr_push_blob(push);
413 if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) {
414 talloc_free(mem_ctx);
415 return False;
418 talloc_free(mem_ctx);
420 return True;
423 static BOOL api_dfs_ManagerGetConfigInfo(pipes_struct *p)
425 struct ndr_pull *pull;
426 struct ndr_push *push;
427 NTSTATUS status;
428 DATA_BLOB blob;
429 struct dfs_ManagerGetConfigInfo r;
430 TALLOC_CTX *mem_ctx = talloc_init("api_dfs_ManagerGetConfigInfo");
432 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
433 talloc_free(mem_ctx);
434 return False;
437 pull = ndr_pull_init_blob(&blob, mem_ctx);
438 if (pull == NULL)
439 return False;
441 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
442 status = ndr_pull_dfs_ManagerGetConfigInfo(pull, NDR_IN, &r);
443 if (NT_STATUS_IS_ERR(status)) {
444 talloc_free(mem_ctx);
445 return False;
448 r.out.result = _dfs_ManagerGetConfigInfo(p);
450 push = ndr_push_init_ctx(mem_ctx);
451 if (push == NULL) {
452 talloc_free(mem_ctx);
453 return False;
456 status = ndr_push_dfs_ManagerGetConfigInfo(push, NDR_OUT, &r);
457 if (NT_STATUS_IS_ERR(status)) {
458 talloc_free(mem_ctx);
459 return False;
462 blob = ndr_push_blob(push);
463 if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) {
464 talloc_free(mem_ctx);
465 return False;
468 talloc_free(mem_ctx);
470 return True;
473 static BOOL api_dfs_ManagerSendSiteInfo(pipes_struct *p)
475 struct ndr_pull *pull;
476 struct ndr_push *push;
477 NTSTATUS status;
478 DATA_BLOB blob;
479 struct dfs_ManagerSendSiteInfo r;
480 TALLOC_CTX *mem_ctx = talloc_init("api_dfs_ManagerSendSiteInfo");
482 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
483 talloc_free(mem_ctx);
484 return False;
487 pull = ndr_pull_init_blob(&blob, mem_ctx);
488 if (pull == NULL)
489 return False;
491 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
492 status = ndr_pull_dfs_ManagerSendSiteInfo(pull, NDR_IN, &r);
493 if (NT_STATUS_IS_ERR(status)) {
494 talloc_free(mem_ctx);
495 return False;
498 r.out.result = _dfs_ManagerSendSiteInfo(p);
500 push = ndr_push_init_ctx(mem_ctx);
501 if (push == NULL) {
502 talloc_free(mem_ctx);
503 return False;
506 status = ndr_push_dfs_ManagerSendSiteInfo(push, NDR_OUT, &r);
507 if (NT_STATUS_IS_ERR(status)) {
508 talloc_free(mem_ctx);
509 return False;
512 blob = ndr_push_blob(push);
513 if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) {
514 talloc_free(mem_ctx);
515 return False;
518 talloc_free(mem_ctx);
520 return True;
523 static BOOL api_dfs_AddFtRoot(pipes_struct *p)
525 struct ndr_pull *pull;
526 struct ndr_push *push;
527 NTSTATUS status;
528 DATA_BLOB blob;
529 struct dfs_AddFtRoot r;
530 TALLOC_CTX *mem_ctx = talloc_init("api_dfs_AddFtRoot");
532 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
533 talloc_free(mem_ctx);
534 return False;
537 pull = ndr_pull_init_blob(&blob, mem_ctx);
538 if (pull == NULL)
539 return False;
541 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
542 status = ndr_pull_dfs_AddFtRoot(pull, NDR_IN, &r);
543 if (NT_STATUS_IS_ERR(status)) {
544 talloc_free(mem_ctx);
545 return False;
548 r.out.result = _dfs_AddFtRoot(p);
550 push = ndr_push_init_ctx(mem_ctx);
551 if (push == NULL) {
552 talloc_free(mem_ctx);
553 return False;
556 status = ndr_push_dfs_AddFtRoot(push, NDR_OUT, &r);
557 if (NT_STATUS_IS_ERR(status)) {
558 talloc_free(mem_ctx);
559 return False;
562 blob = ndr_push_blob(push);
563 if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) {
564 talloc_free(mem_ctx);
565 return False;
568 talloc_free(mem_ctx);
570 return True;
573 static BOOL api_dfs_RemoveFtRoot(pipes_struct *p)
575 struct ndr_pull *pull;
576 struct ndr_push *push;
577 NTSTATUS status;
578 DATA_BLOB blob;
579 struct dfs_RemoveFtRoot r;
580 TALLOC_CTX *mem_ctx = talloc_init("api_dfs_RemoveFtRoot");
582 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
583 talloc_free(mem_ctx);
584 return False;
587 pull = ndr_pull_init_blob(&blob, mem_ctx);
588 if (pull == NULL)
589 return False;
591 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
592 status = ndr_pull_dfs_RemoveFtRoot(pull, NDR_IN, &r);
593 if (NT_STATUS_IS_ERR(status)) {
594 talloc_free(mem_ctx);
595 return False;
598 r.out.result = _dfs_RemoveFtRoot(p);
600 push = ndr_push_init_ctx(mem_ctx);
601 if (push == NULL) {
602 talloc_free(mem_ctx);
603 return False;
606 status = ndr_push_dfs_RemoveFtRoot(push, NDR_OUT, &r);
607 if (NT_STATUS_IS_ERR(status)) {
608 talloc_free(mem_ctx);
609 return False;
612 blob = ndr_push_blob(push);
613 if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) {
614 talloc_free(mem_ctx);
615 return False;
618 talloc_free(mem_ctx);
620 return True;
623 static BOOL api_dfs_AddStdRoot(pipes_struct *p)
625 struct ndr_pull *pull;
626 struct ndr_push *push;
627 NTSTATUS status;
628 DATA_BLOB blob;
629 struct dfs_AddStdRoot r;
630 TALLOC_CTX *mem_ctx = talloc_init("api_dfs_AddStdRoot");
632 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
633 talloc_free(mem_ctx);
634 return False;
637 pull = ndr_pull_init_blob(&blob, mem_ctx);
638 if (pull == NULL)
639 return False;
641 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
642 status = ndr_pull_dfs_AddStdRoot(pull, NDR_IN, &r);
643 if (NT_STATUS_IS_ERR(status)) {
644 talloc_free(mem_ctx);
645 return False;
648 r.out.result = _dfs_AddStdRoot(p);
650 push = ndr_push_init_ctx(mem_ctx);
651 if (push == NULL) {
652 talloc_free(mem_ctx);
653 return False;
656 status = ndr_push_dfs_AddStdRoot(push, NDR_OUT, &r);
657 if (NT_STATUS_IS_ERR(status)) {
658 talloc_free(mem_ctx);
659 return False;
662 blob = ndr_push_blob(push);
663 if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) {
664 talloc_free(mem_ctx);
665 return False;
668 talloc_free(mem_ctx);
670 return True;
673 static BOOL api_dfs_RemoveStdRoot(pipes_struct *p)
675 struct ndr_pull *pull;
676 struct ndr_push *push;
677 NTSTATUS status;
678 DATA_BLOB blob;
679 struct dfs_RemoveStdRoot r;
680 TALLOC_CTX *mem_ctx = talloc_init("api_dfs_RemoveStdRoot");
682 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
683 talloc_free(mem_ctx);
684 return False;
687 pull = ndr_pull_init_blob(&blob, mem_ctx);
688 if (pull == NULL)
689 return False;
691 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
692 status = ndr_pull_dfs_RemoveStdRoot(pull, NDR_IN, &r);
693 if (NT_STATUS_IS_ERR(status)) {
694 talloc_free(mem_ctx);
695 return False;
698 r.out.result = _dfs_RemoveStdRoot(p);
700 push = ndr_push_init_ctx(mem_ctx);
701 if (push == NULL) {
702 talloc_free(mem_ctx);
703 return False;
706 status = ndr_push_dfs_RemoveStdRoot(push, NDR_OUT, &r);
707 if (NT_STATUS_IS_ERR(status)) {
708 talloc_free(mem_ctx);
709 return False;
712 blob = ndr_push_blob(push);
713 if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) {
714 talloc_free(mem_ctx);
715 return False;
718 talloc_free(mem_ctx);
720 return True;
723 static BOOL api_dfs_ManagerInitialize(pipes_struct *p)
725 struct ndr_pull *pull;
726 struct ndr_push *push;
727 NTSTATUS status;
728 DATA_BLOB blob;
729 struct dfs_ManagerInitialize r;
730 TALLOC_CTX *mem_ctx = talloc_init("api_dfs_ManagerInitialize");
732 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
733 talloc_free(mem_ctx);
734 return False;
737 pull = ndr_pull_init_blob(&blob, mem_ctx);
738 if (pull == NULL)
739 return False;
741 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
742 status = ndr_pull_dfs_ManagerInitialize(pull, NDR_IN, &r);
743 if (NT_STATUS_IS_ERR(status)) {
744 talloc_free(mem_ctx);
745 return False;
748 r.out.result = _dfs_ManagerInitialize(p);
750 push = ndr_push_init_ctx(mem_ctx);
751 if (push == NULL) {
752 talloc_free(mem_ctx);
753 return False;
756 status = ndr_push_dfs_ManagerInitialize(push, NDR_OUT, &r);
757 if (NT_STATUS_IS_ERR(status)) {
758 talloc_free(mem_ctx);
759 return False;
762 blob = ndr_push_blob(push);
763 if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) {
764 talloc_free(mem_ctx);
765 return False;
768 talloc_free(mem_ctx);
770 return True;
773 static BOOL api_dfs_AddStdRootForced(pipes_struct *p)
775 struct ndr_pull *pull;
776 struct ndr_push *push;
777 NTSTATUS status;
778 DATA_BLOB blob;
779 struct dfs_AddStdRootForced r;
780 TALLOC_CTX *mem_ctx = talloc_init("api_dfs_AddStdRootForced");
782 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
783 talloc_free(mem_ctx);
784 return False;
787 pull = ndr_pull_init_blob(&blob, mem_ctx);
788 if (pull == NULL)
789 return False;
791 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
792 status = ndr_pull_dfs_AddStdRootForced(pull, NDR_IN, &r);
793 if (NT_STATUS_IS_ERR(status)) {
794 talloc_free(mem_ctx);
795 return False;
798 r.out.result = _dfs_AddStdRootForced(p);
800 push = ndr_push_init_ctx(mem_ctx);
801 if (push == NULL) {
802 talloc_free(mem_ctx);
803 return False;
806 status = ndr_push_dfs_AddStdRootForced(push, NDR_OUT, &r);
807 if (NT_STATUS_IS_ERR(status)) {
808 talloc_free(mem_ctx);
809 return False;
812 blob = ndr_push_blob(push);
813 if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) {
814 talloc_free(mem_ctx);
815 return False;
818 talloc_free(mem_ctx);
820 return True;
823 static BOOL api_dfs_GetDcAddress(pipes_struct *p)
825 struct ndr_pull *pull;
826 struct ndr_push *push;
827 NTSTATUS status;
828 DATA_BLOB blob;
829 struct dfs_GetDcAddress r;
830 TALLOC_CTX *mem_ctx = talloc_init("api_dfs_GetDcAddress");
832 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
833 talloc_free(mem_ctx);
834 return False;
837 pull = ndr_pull_init_blob(&blob, mem_ctx);
838 if (pull == NULL)
839 return False;
841 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
842 status = ndr_pull_dfs_GetDcAddress(pull, NDR_IN, &r);
843 if (NT_STATUS_IS_ERR(status)) {
844 talloc_free(mem_ctx);
845 return False;
848 r.out.result = _dfs_GetDcAddress(p);
850 push = ndr_push_init_ctx(mem_ctx);
851 if (push == NULL) {
852 talloc_free(mem_ctx);
853 return False;
856 status = ndr_push_dfs_GetDcAddress(push, NDR_OUT, &r);
857 if (NT_STATUS_IS_ERR(status)) {
858 talloc_free(mem_ctx);
859 return False;
862 blob = ndr_push_blob(push);
863 if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) {
864 talloc_free(mem_ctx);
865 return False;
868 talloc_free(mem_ctx);
870 return True;
873 static BOOL api_dfs_SetDcAddress(pipes_struct *p)
875 struct ndr_pull *pull;
876 struct ndr_push *push;
877 NTSTATUS status;
878 DATA_BLOB blob;
879 struct dfs_SetDcAddress r;
880 TALLOC_CTX *mem_ctx = talloc_init("api_dfs_SetDcAddress");
882 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
883 talloc_free(mem_ctx);
884 return False;
887 pull = ndr_pull_init_blob(&blob, mem_ctx);
888 if (pull == NULL)
889 return False;
891 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
892 status = ndr_pull_dfs_SetDcAddress(pull, NDR_IN, &r);
893 if (NT_STATUS_IS_ERR(status)) {
894 talloc_free(mem_ctx);
895 return False;
898 r.out.result = _dfs_SetDcAddress(p);
900 push = ndr_push_init_ctx(mem_ctx);
901 if (push == NULL) {
902 talloc_free(mem_ctx);
903 return False;
906 status = ndr_push_dfs_SetDcAddress(push, NDR_OUT, &r);
907 if (NT_STATUS_IS_ERR(status)) {
908 talloc_free(mem_ctx);
909 return False;
912 blob = ndr_push_blob(push);
913 if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) {
914 talloc_free(mem_ctx);
915 return False;
918 talloc_free(mem_ctx);
920 return True;
923 static BOOL api_dfs_FlushFtTable(pipes_struct *p)
925 struct ndr_pull *pull;
926 struct ndr_push *push;
927 NTSTATUS status;
928 DATA_BLOB blob;
929 struct dfs_FlushFtTable r;
930 TALLOC_CTX *mem_ctx = talloc_init("api_dfs_FlushFtTable");
932 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
933 talloc_free(mem_ctx);
934 return False;
937 pull = ndr_pull_init_blob(&blob, mem_ctx);
938 if (pull == NULL)
939 return False;
941 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
942 status = ndr_pull_dfs_FlushFtTable(pull, NDR_IN, &r);
943 if (NT_STATUS_IS_ERR(status)) {
944 talloc_free(mem_ctx);
945 return False;
948 r.out.result = _dfs_FlushFtTable(p);
950 push = ndr_push_init_ctx(mem_ctx);
951 if (push == NULL) {
952 talloc_free(mem_ctx);
953 return False;
956 status = ndr_push_dfs_FlushFtTable(push, NDR_OUT, &r);
957 if (NT_STATUS_IS_ERR(status)) {
958 talloc_free(mem_ctx);
959 return False;
962 blob = ndr_push_blob(push);
963 if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) {
964 talloc_free(mem_ctx);
965 return False;
968 talloc_free(mem_ctx);
970 return True;
973 static BOOL api_dfs_Add2(pipes_struct *p)
975 struct ndr_pull *pull;
976 struct ndr_push *push;
977 NTSTATUS status;
978 DATA_BLOB blob;
979 struct dfs_Add2 r;
980 TALLOC_CTX *mem_ctx = talloc_init("api_dfs_Add2");
982 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
983 talloc_free(mem_ctx);
984 return False;
987 pull = ndr_pull_init_blob(&blob, mem_ctx);
988 if (pull == NULL)
989 return False;
991 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
992 status = ndr_pull_dfs_Add2(pull, NDR_IN, &r);
993 if (NT_STATUS_IS_ERR(status)) {
994 talloc_free(mem_ctx);
995 return False;
998 r.out.result = _dfs_Add2(p);
1000 push = ndr_push_init_ctx(mem_ctx);
1001 if (push == NULL) {
1002 talloc_free(mem_ctx);
1003 return False;
1006 status = ndr_push_dfs_Add2(push, NDR_OUT, &r);
1007 if (NT_STATUS_IS_ERR(status)) {
1008 talloc_free(mem_ctx);
1009 return False;
1012 blob = ndr_push_blob(push);
1013 if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) {
1014 talloc_free(mem_ctx);
1015 return False;
1018 talloc_free(mem_ctx);
1020 return True;
1023 static BOOL api_dfs_Remove2(pipes_struct *p)
1025 struct ndr_pull *pull;
1026 struct ndr_push *push;
1027 NTSTATUS status;
1028 DATA_BLOB blob;
1029 struct dfs_Remove2 r;
1030 TALLOC_CTX *mem_ctx = talloc_init("api_dfs_Remove2");
1032 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
1033 talloc_free(mem_ctx);
1034 return False;
1037 pull = ndr_pull_init_blob(&blob, mem_ctx);
1038 if (pull == NULL)
1039 return False;
1041 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1042 status = ndr_pull_dfs_Remove2(pull, NDR_IN, &r);
1043 if (NT_STATUS_IS_ERR(status)) {
1044 talloc_free(mem_ctx);
1045 return False;
1048 r.out.result = _dfs_Remove2(p);
1050 push = ndr_push_init_ctx(mem_ctx);
1051 if (push == NULL) {
1052 talloc_free(mem_ctx);
1053 return False;
1056 status = ndr_push_dfs_Remove2(push, NDR_OUT, &r);
1057 if (NT_STATUS_IS_ERR(status)) {
1058 talloc_free(mem_ctx);
1059 return False;
1062 blob = ndr_push_blob(push);
1063 if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) {
1064 talloc_free(mem_ctx);
1065 return False;
1068 talloc_free(mem_ctx);
1070 return True;
1073 static BOOL api_dfs_EnumEx(pipes_struct *p)
1075 struct ndr_pull *pull;
1076 struct ndr_push *push;
1077 NTSTATUS status;
1078 DATA_BLOB blob;
1079 struct dfs_EnumEx r;
1080 TALLOC_CTX *mem_ctx = talloc_init("api_dfs_EnumEx");
1082 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
1083 talloc_free(mem_ctx);
1084 return False;
1087 pull = ndr_pull_init_blob(&blob, mem_ctx);
1088 if (pull == NULL)
1089 return False;
1091 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1092 status = ndr_pull_dfs_EnumEx(pull, NDR_IN, &r);
1093 if (NT_STATUS_IS_ERR(status)) {
1094 talloc_free(mem_ctx);
1095 return False;
1098 r.out.info = r.in.info;
1099 r.out.total = r.in.total;
1100 r.out.result = _dfs_EnumEx(p, r.in.name, r.in.level, r.in.bufsize, r.in.info, r.in.total);
1102 push = ndr_push_init_ctx(mem_ctx);
1103 if (push == NULL) {
1104 talloc_free(mem_ctx);
1105 return False;
1108 status = ndr_push_dfs_EnumEx(push, NDR_OUT, &r);
1109 if (NT_STATUS_IS_ERR(status)) {
1110 talloc_free(mem_ctx);
1111 return False;
1114 blob = ndr_push_blob(push);
1115 if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) {
1116 talloc_free(mem_ctx);
1117 return False;
1120 talloc_free(mem_ctx);
1122 return True;
1125 static BOOL api_dfs_SetInfo2(pipes_struct *p)
1127 struct ndr_pull *pull;
1128 struct ndr_push *push;
1129 NTSTATUS status;
1130 DATA_BLOB blob;
1131 struct dfs_SetInfo2 r;
1132 TALLOC_CTX *mem_ctx = talloc_init("api_dfs_SetInfo2");
1134 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
1135 talloc_free(mem_ctx);
1136 return False;
1139 pull = ndr_pull_init_blob(&blob, mem_ctx);
1140 if (pull == NULL)
1141 return False;
1143 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1144 status = ndr_pull_dfs_SetInfo2(pull, NDR_IN, &r);
1145 if (NT_STATUS_IS_ERR(status)) {
1146 talloc_free(mem_ctx);
1147 return False;
1150 r.out.result = _dfs_SetInfo2(p);
1152 push = ndr_push_init_ctx(mem_ctx);
1153 if (push == NULL) {
1154 talloc_free(mem_ctx);
1155 return False;
1158 status = ndr_push_dfs_SetInfo2(push, NDR_OUT, &r);
1159 if (NT_STATUS_IS_ERR(status)) {
1160 talloc_free(mem_ctx);
1161 return False;
1164 blob = ndr_push_blob(push);
1165 if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) {
1166 talloc_free(mem_ctx);
1167 return False;
1170 talloc_free(mem_ctx);
1172 return True;
1176 /* Tables */
1177 static struct api_struct api_netdfs_cmds[] =
1179 {"DFS_GETMANAGERVERSION", DCERPC_DFS_GETMANAGERVERSION, api_dfs_GetManagerVersion},
1180 {"DFS_ADD", DCERPC_DFS_ADD, api_dfs_Add},
1181 {"DFS_REMOVE", DCERPC_DFS_REMOVE, api_dfs_Remove},
1182 {"DFS_SETINFO", DCERPC_DFS_SETINFO, api_dfs_SetInfo},
1183 {"DFS_GETINFO", DCERPC_DFS_GETINFO, api_dfs_GetInfo},
1184 {"DFS_ENUM", DCERPC_DFS_ENUM, api_dfs_Enum},
1185 {"DFS_RENAME", DCERPC_DFS_RENAME, api_dfs_Rename},
1186 {"DFS_MOVE", DCERPC_DFS_MOVE, api_dfs_Move},
1187 {"DFS_MANAGERGETCONFIGINFO", DCERPC_DFS_MANAGERGETCONFIGINFO, api_dfs_ManagerGetConfigInfo},
1188 {"DFS_MANAGERSENDSITEINFO", DCERPC_DFS_MANAGERSENDSITEINFO, api_dfs_ManagerSendSiteInfo},
1189 {"DFS_ADDFTROOT", DCERPC_DFS_ADDFTROOT, api_dfs_AddFtRoot},
1190 {"DFS_REMOVEFTROOT", DCERPC_DFS_REMOVEFTROOT, api_dfs_RemoveFtRoot},
1191 {"DFS_ADDSTDROOT", DCERPC_DFS_ADDSTDROOT, api_dfs_AddStdRoot},
1192 {"DFS_REMOVESTDROOT", DCERPC_DFS_REMOVESTDROOT, api_dfs_RemoveStdRoot},
1193 {"DFS_MANAGERINITIALIZE", DCERPC_DFS_MANAGERINITIALIZE, api_dfs_ManagerInitialize},
1194 {"DFS_ADDSTDROOTFORCED", DCERPC_DFS_ADDSTDROOTFORCED, api_dfs_AddStdRootForced},
1195 {"DFS_GETDCADDRESS", DCERPC_DFS_GETDCADDRESS, api_dfs_GetDcAddress},
1196 {"DFS_SETDCADDRESS", DCERPC_DFS_SETDCADDRESS, api_dfs_SetDcAddress},
1197 {"DFS_FLUSHFTTABLE", DCERPC_DFS_FLUSHFTTABLE, api_dfs_FlushFtTable},
1198 {"DFS_ADD2", DCERPC_DFS_ADD2, api_dfs_Add2},
1199 {"DFS_REMOVE2", DCERPC_DFS_REMOVE2, api_dfs_Remove2},
1200 {"DFS_ENUMEX", DCERPC_DFS_ENUMEX, api_dfs_EnumEx},
1201 {"DFS_SETINFO2", DCERPC_DFS_SETINFO2, api_dfs_SetInfo2},
1204 void netdfs_get_pipe_fns(struct api_struct **fns, int *n_fns)
1206 *fns = api_netdfs_cmds;
1207 *n_fns = sizeof(api_netdfs_cmds) / sizeof(struct api_struct);
1210 NTSTATUS rpc_netdfs_init(void)
1212 return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "netdfs", "netdfs", api_netdfs_cmds, sizeof(api_netdfs_cmds) / sizeof(struct api_struct));