spoolss: fix spoolss_PrinterData size calculation.
[Samba/bb.git] / librpc / gen_ndr / srv_dfs.c
blob623df13cccc39a5c28393f253c818821b8729e23
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 const struct ndr_interface_call *call;
12 struct ndr_pull *pull;
13 struct ndr_push *push;
14 enum ndr_err_code ndr_err;
15 DATA_BLOB blob;
16 struct dfs_GetManagerVersion *r;
18 call = &ndr_table_netdfs.calls[NDR_DFS_GETMANAGERVERSION];
20 r = talloc(talloc_tos(), struct dfs_GetManagerVersion);
21 if (r == NULL) {
22 return false;
25 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
26 talloc_free(r);
27 return false;
30 pull = ndr_pull_init_blob(&blob, r, NULL);
31 if (pull == NULL) {
32 talloc_free(r);
33 return false;
36 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
37 ndr_err = call->ndr_pull(pull, NDR_IN, r);
38 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
39 talloc_free(r);
40 return false;
43 if (DEBUGLEVEL >= 10) {
44 NDR_PRINT_IN_DEBUG(dfs_GetManagerVersion, r);
47 ZERO_STRUCT(r->out);
48 r->out.version = talloc_zero(r, enum dfs_ManagerVersion);
49 if (r->out.version == NULL) {
50 talloc_free(r);
51 return false;
54 _dfs_GetManagerVersion(p, r);
56 if (p->rng_fault_state) {
57 talloc_free(r);
58 /* Return true here, srv_pipe_hnd.c will take care */
59 return true;
62 if (DEBUGLEVEL >= 10) {
63 NDR_PRINT_OUT_DEBUG(dfs_GetManagerVersion, r);
66 push = ndr_push_init_ctx(r, NULL);
67 if (push == NULL) {
68 talloc_free(r);
69 return false;
72 ndr_err = call->ndr_push(push, NDR_OUT, r);
73 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
74 talloc_free(r);
75 return false;
78 blob = ndr_push_blob(push);
79 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
80 talloc_free(r);
81 return false;
84 talloc_free(r);
86 return true;
89 static bool api_dfs_Add(pipes_struct *p)
91 const struct ndr_interface_call *call;
92 struct ndr_pull *pull;
93 struct ndr_push *push;
94 enum ndr_err_code ndr_err;
95 DATA_BLOB blob;
96 struct dfs_Add *r;
98 call = &ndr_table_netdfs.calls[NDR_DFS_ADD];
100 r = talloc(talloc_tos(), struct dfs_Add);
101 if (r == NULL) {
102 return false;
105 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
106 talloc_free(r);
107 return false;
110 pull = ndr_pull_init_blob(&blob, r, NULL);
111 if (pull == NULL) {
112 talloc_free(r);
113 return false;
116 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
117 ndr_err = call->ndr_pull(pull, NDR_IN, r);
118 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
119 talloc_free(r);
120 return false;
123 if (DEBUGLEVEL >= 10) {
124 NDR_PRINT_IN_DEBUG(dfs_Add, r);
127 r->out.result = _dfs_Add(p, r);
129 if (p->rng_fault_state) {
130 talloc_free(r);
131 /* Return true here, srv_pipe_hnd.c will take care */
132 return true;
135 if (DEBUGLEVEL >= 10) {
136 NDR_PRINT_OUT_DEBUG(dfs_Add, r);
139 push = ndr_push_init_ctx(r, NULL);
140 if (push == NULL) {
141 talloc_free(r);
142 return false;
145 ndr_err = call->ndr_push(push, NDR_OUT, r);
146 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
147 talloc_free(r);
148 return false;
151 blob = ndr_push_blob(push);
152 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
153 talloc_free(r);
154 return false;
157 talloc_free(r);
159 return true;
162 static bool api_dfs_Remove(pipes_struct *p)
164 const struct ndr_interface_call *call;
165 struct ndr_pull *pull;
166 struct ndr_push *push;
167 enum ndr_err_code ndr_err;
168 DATA_BLOB blob;
169 struct dfs_Remove *r;
171 call = &ndr_table_netdfs.calls[NDR_DFS_REMOVE];
173 r = talloc(talloc_tos(), struct dfs_Remove);
174 if (r == NULL) {
175 return false;
178 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
179 talloc_free(r);
180 return false;
183 pull = ndr_pull_init_blob(&blob, r, NULL);
184 if (pull == NULL) {
185 talloc_free(r);
186 return false;
189 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
190 ndr_err = call->ndr_pull(pull, NDR_IN, r);
191 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
192 talloc_free(r);
193 return false;
196 if (DEBUGLEVEL >= 10) {
197 NDR_PRINT_IN_DEBUG(dfs_Remove, r);
200 r->out.result = _dfs_Remove(p, r);
202 if (p->rng_fault_state) {
203 talloc_free(r);
204 /* Return true here, srv_pipe_hnd.c will take care */
205 return true;
208 if (DEBUGLEVEL >= 10) {
209 NDR_PRINT_OUT_DEBUG(dfs_Remove, r);
212 push = ndr_push_init_ctx(r, NULL);
213 if (push == NULL) {
214 talloc_free(r);
215 return false;
218 ndr_err = call->ndr_push(push, NDR_OUT, r);
219 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
220 talloc_free(r);
221 return false;
224 blob = ndr_push_blob(push);
225 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
226 talloc_free(r);
227 return false;
230 talloc_free(r);
232 return true;
235 static bool api_dfs_SetInfo(pipes_struct *p)
237 const struct ndr_interface_call *call;
238 struct ndr_pull *pull;
239 struct ndr_push *push;
240 enum ndr_err_code ndr_err;
241 DATA_BLOB blob;
242 struct dfs_SetInfo *r;
244 call = &ndr_table_netdfs.calls[NDR_DFS_SETINFO];
246 r = talloc(talloc_tos(), struct dfs_SetInfo);
247 if (r == NULL) {
248 return false;
251 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
252 talloc_free(r);
253 return false;
256 pull = ndr_pull_init_blob(&blob, r, NULL);
257 if (pull == NULL) {
258 talloc_free(r);
259 return false;
262 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
263 ndr_err = call->ndr_pull(pull, NDR_IN, r);
264 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
265 talloc_free(r);
266 return false;
269 if (DEBUGLEVEL >= 10) {
270 NDR_PRINT_IN_DEBUG(dfs_SetInfo, r);
273 r->out.result = _dfs_SetInfo(p, r);
275 if (p->rng_fault_state) {
276 talloc_free(r);
277 /* Return true here, srv_pipe_hnd.c will take care */
278 return true;
281 if (DEBUGLEVEL >= 10) {
282 NDR_PRINT_OUT_DEBUG(dfs_SetInfo, r);
285 push = ndr_push_init_ctx(r, NULL);
286 if (push == NULL) {
287 talloc_free(r);
288 return false;
291 ndr_err = call->ndr_push(push, NDR_OUT, r);
292 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
293 talloc_free(r);
294 return false;
297 blob = ndr_push_blob(push);
298 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
299 talloc_free(r);
300 return false;
303 talloc_free(r);
305 return true;
308 static bool api_dfs_GetInfo(pipes_struct *p)
310 const struct ndr_interface_call *call;
311 struct ndr_pull *pull;
312 struct ndr_push *push;
313 enum ndr_err_code ndr_err;
314 DATA_BLOB blob;
315 struct dfs_GetInfo *r;
317 call = &ndr_table_netdfs.calls[NDR_DFS_GETINFO];
319 r = talloc(talloc_tos(), struct dfs_GetInfo);
320 if (r == NULL) {
321 return false;
324 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
325 talloc_free(r);
326 return false;
329 pull = ndr_pull_init_blob(&blob, r, NULL);
330 if (pull == NULL) {
331 talloc_free(r);
332 return false;
335 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
336 ndr_err = call->ndr_pull(pull, NDR_IN, r);
337 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
338 talloc_free(r);
339 return false;
342 if (DEBUGLEVEL >= 10) {
343 NDR_PRINT_IN_DEBUG(dfs_GetInfo, r);
346 ZERO_STRUCT(r->out);
347 r->out.info = talloc_zero(r, union dfs_Info);
348 if (r->out.info == NULL) {
349 talloc_free(r);
350 return false;
353 r->out.result = _dfs_GetInfo(p, r);
355 if (p->rng_fault_state) {
356 talloc_free(r);
357 /* Return true here, srv_pipe_hnd.c will take care */
358 return true;
361 if (DEBUGLEVEL >= 10) {
362 NDR_PRINT_OUT_DEBUG(dfs_GetInfo, r);
365 push = ndr_push_init_ctx(r, NULL);
366 if (push == NULL) {
367 talloc_free(r);
368 return false;
371 ndr_err = call->ndr_push(push, NDR_OUT, r);
372 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
373 talloc_free(r);
374 return false;
377 blob = ndr_push_blob(push);
378 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
379 talloc_free(r);
380 return false;
383 talloc_free(r);
385 return true;
388 static bool api_dfs_Enum(pipes_struct *p)
390 const struct ndr_interface_call *call;
391 struct ndr_pull *pull;
392 struct ndr_push *push;
393 enum ndr_err_code ndr_err;
394 DATA_BLOB blob;
395 struct dfs_Enum *r;
397 call = &ndr_table_netdfs.calls[NDR_DFS_ENUM];
399 r = talloc(talloc_tos(), struct dfs_Enum);
400 if (r == NULL) {
401 return false;
404 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
405 talloc_free(r);
406 return false;
409 pull = ndr_pull_init_blob(&blob, r, NULL);
410 if (pull == NULL) {
411 talloc_free(r);
412 return false;
415 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
416 ndr_err = call->ndr_pull(pull, NDR_IN, r);
417 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
418 talloc_free(r);
419 return false;
422 if (DEBUGLEVEL >= 10) {
423 NDR_PRINT_IN_DEBUG(dfs_Enum, r);
426 ZERO_STRUCT(r->out);
427 r->out.info = r->in.info;
428 r->out.total = r->in.total;
429 r->out.result = _dfs_Enum(p, r);
431 if (p->rng_fault_state) {
432 talloc_free(r);
433 /* Return true here, srv_pipe_hnd.c will take care */
434 return true;
437 if (DEBUGLEVEL >= 10) {
438 NDR_PRINT_OUT_DEBUG(dfs_Enum, r);
441 push = ndr_push_init_ctx(r, NULL);
442 if (push == NULL) {
443 talloc_free(r);
444 return false;
447 ndr_err = call->ndr_push(push, NDR_OUT, r);
448 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
449 talloc_free(r);
450 return false;
453 blob = ndr_push_blob(push);
454 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
455 talloc_free(r);
456 return false;
459 talloc_free(r);
461 return true;
464 static bool api_dfs_Rename(pipes_struct *p)
466 const struct ndr_interface_call *call;
467 struct ndr_pull *pull;
468 struct ndr_push *push;
469 enum ndr_err_code ndr_err;
470 DATA_BLOB blob;
471 struct dfs_Rename *r;
473 call = &ndr_table_netdfs.calls[NDR_DFS_RENAME];
475 r = talloc(talloc_tos(), struct dfs_Rename);
476 if (r == NULL) {
477 return false;
480 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
481 talloc_free(r);
482 return false;
485 pull = ndr_pull_init_blob(&blob, r, NULL);
486 if (pull == NULL) {
487 talloc_free(r);
488 return false;
491 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
492 ndr_err = call->ndr_pull(pull, NDR_IN, r);
493 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
494 talloc_free(r);
495 return false;
498 if (DEBUGLEVEL >= 10) {
499 NDR_PRINT_IN_DEBUG(dfs_Rename, r);
502 r->out.result = _dfs_Rename(p, r);
504 if (p->rng_fault_state) {
505 talloc_free(r);
506 /* Return true here, srv_pipe_hnd.c will take care */
507 return true;
510 if (DEBUGLEVEL >= 10) {
511 NDR_PRINT_OUT_DEBUG(dfs_Rename, r);
514 push = ndr_push_init_ctx(r, NULL);
515 if (push == NULL) {
516 talloc_free(r);
517 return false;
520 ndr_err = call->ndr_push(push, NDR_OUT, r);
521 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
522 talloc_free(r);
523 return false;
526 blob = ndr_push_blob(push);
527 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
528 talloc_free(r);
529 return false;
532 talloc_free(r);
534 return true;
537 static bool api_dfs_Move(pipes_struct *p)
539 const struct ndr_interface_call *call;
540 struct ndr_pull *pull;
541 struct ndr_push *push;
542 enum ndr_err_code ndr_err;
543 DATA_BLOB blob;
544 struct dfs_Move *r;
546 call = &ndr_table_netdfs.calls[NDR_DFS_MOVE];
548 r = talloc(talloc_tos(), struct dfs_Move);
549 if (r == NULL) {
550 return false;
553 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
554 talloc_free(r);
555 return false;
558 pull = ndr_pull_init_blob(&blob, r, NULL);
559 if (pull == NULL) {
560 talloc_free(r);
561 return false;
564 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
565 ndr_err = call->ndr_pull(pull, NDR_IN, r);
566 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
567 talloc_free(r);
568 return false;
571 if (DEBUGLEVEL >= 10) {
572 NDR_PRINT_IN_DEBUG(dfs_Move, r);
575 r->out.result = _dfs_Move(p, r);
577 if (p->rng_fault_state) {
578 talloc_free(r);
579 /* Return true here, srv_pipe_hnd.c will take care */
580 return true;
583 if (DEBUGLEVEL >= 10) {
584 NDR_PRINT_OUT_DEBUG(dfs_Move, r);
587 push = ndr_push_init_ctx(r, NULL);
588 if (push == NULL) {
589 talloc_free(r);
590 return false;
593 ndr_err = call->ndr_push(push, NDR_OUT, r);
594 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
595 talloc_free(r);
596 return false;
599 blob = ndr_push_blob(push);
600 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
601 talloc_free(r);
602 return false;
605 talloc_free(r);
607 return true;
610 static bool api_dfs_ManagerGetConfigInfo(pipes_struct *p)
612 const struct ndr_interface_call *call;
613 struct ndr_pull *pull;
614 struct ndr_push *push;
615 enum ndr_err_code ndr_err;
616 DATA_BLOB blob;
617 struct dfs_ManagerGetConfigInfo *r;
619 call = &ndr_table_netdfs.calls[NDR_DFS_MANAGERGETCONFIGINFO];
621 r = talloc(talloc_tos(), struct dfs_ManagerGetConfigInfo);
622 if (r == NULL) {
623 return false;
626 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
627 talloc_free(r);
628 return false;
631 pull = ndr_pull_init_blob(&blob, r, NULL);
632 if (pull == NULL) {
633 talloc_free(r);
634 return false;
637 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
638 ndr_err = call->ndr_pull(pull, NDR_IN, r);
639 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
640 talloc_free(r);
641 return false;
644 if (DEBUGLEVEL >= 10) {
645 NDR_PRINT_IN_DEBUG(dfs_ManagerGetConfigInfo, r);
648 r->out.result = _dfs_ManagerGetConfigInfo(p, r);
650 if (p->rng_fault_state) {
651 talloc_free(r);
652 /* Return true here, srv_pipe_hnd.c will take care */
653 return true;
656 if (DEBUGLEVEL >= 10) {
657 NDR_PRINT_OUT_DEBUG(dfs_ManagerGetConfigInfo, r);
660 push = ndr_push_init_ctx(r, NULL);
661 if (push == NULL) {
662 talloc_free(r);
663 return false;
666 ndr_err = call->ndr_push(push, NDR_OUT, r);
667 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
668 talloc_free(r);
669 return false;
672 blob = ndr_push_blob(push);
673 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
674 talloc_free(r);
675 return false;
678 talloc_free(r);
680 return true;
683 static bool api_dfs_ManagerSendSiteInfo(pipes_struct *p)
685 const struct ndr_interface_call *call;
686 struct ndr_pull *pull;
687 struct ndr_push *push;
688 enum ndr_err_code ndr_err;
689 DATA_BLOB blob;
690 struct dfs_ManagerSendSiteInfo *r;
692 call = &ndr_table_netdfs.calls[NDR_DFS_MANAGERSENDSITEINFO];
694 r = talloc(talloc_tos(), struct dfs_ManagerSendSiteInfo);
695 if (r == NULL) {
696 return false;
699 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
700 talloc_free(r);
701 return false;
704 pull = ndr_pull_init_blob(&blob, r, NULL);
705 if (pull == NULL) {
706 talloc_free(r);
707 return false;
710 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
711 ndr_err = call->ndr_pull(pull, NDR_IN, r);
712 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
713 talloc_free(r);
714 return false;
717 if (DEBUGLEVEL >= 10) {
718 NDR_PRINT_IN_DEBUG(dfs_ManagerSendSiteInfo, r);
721 r->out.result = _dfs_ManagerSendSiteInfo(p, r);
723 if (p->rng_fault_state) {
724 talloc_free(r);
725 /* Return true here, srv_pipe_hnd.c will take care */
726 return true;
729 if (DEBUGLEVEL >= 10) {
730 NDR_PRINT_OUT_DEBUG(dfs_ManagerSendSiteInfo, r);
733 push = ndr_push_init_ctx(r, NULL);
734 if (push == NULL) {
735 talloc_free(r);
736 return false;
739 ndr_err = call->ndr_push(push, NDR_OUT, r);
740 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
741 talloc_free(r);
742 return false;
745 blob = ndr_push_blob(push);
746 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
747 talloc_free(r);
748 return false;
751 talloc_free(r);
753 return true;
756 static bool api_dfs_AddFtRoot(pipes_struct *p)
758 const struct ndr_interface_call *call;
759 struct ndr_pull *pull;
760 struct ndr_push *push;
761 enum ndr_err_code ndr_err;
762 DATA_BLOB blob;
763 struct dfs_AddFtRoot *r;
765 call = &ndr_table_netdfs.calls[NDR_DFS_ADDFTROOT];
767 r = talloc(talloc_tos(), struct dfs_AddFtRoot);
768 if (r == NULL) {
769 return false;
772 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
773 talloc_free(r);
774 return false;
777 pull = ndr_pull_init_blob(&blob, r, NULL);
778 if (pull == NULL) {
779 talloc_free(r);
780 return false;
783 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
784 ndr_err = call->ndr_pull(pull, NDR_IN, r);
785 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
786 talloc_free(r);
787 return false;
790 if (DEBUGLEVEL >= 10) {
791 NDR_PRINT_IN_DEBUG(dfs_AddFtRoot, r);
794 ZERO_STRUCT(r->out);
795 r->out.unknown2 = r->in.unknown2;
796 r->out.result = _dfs_AddFtRoot(p, r);
798 if (p->rng_fault_state) {
799 talloc_free(r);
800 /* Return true here, srv_pipe_hnd.c will take care */
801 return true;
804 if (DEBUGLEVEL >= 10) {
805 NDR_PRINT_OUT_DEBUG(dfs_AddFtRoot, r);
808 push = ndr_push_init_ctx(r, NULL);
809 if (push == NULL) {
810 talloc_free(r);
811 return false;
814 ndr_err = call->ndr_push(push, NDR_OUT, r);
815 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
816 talloc_free(r);
817 return false;
820 blob = ndr_push_blob(push);
821 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
822 talloc_free(r);
823 return false;
826 talloc_free(r);
828 return true;
831 static bool api_dfs_RemoveFtRoot(pipes_struct *p)
833 const struct ndr_interface_call *call;
834 struct ndr_pull *pull;
835 struct ndr_push *push;
836 enum ndr_err_code ndr_err;
837 DATA_BLOB blob;
838 struct dfs_RemoveFtRoot *r;
840 call = &ndr_table_netdfs.calls[NDR_DFS_REMOVEFTROOT];
842 r = talloc(talloc_tos(), struct dfs_RemoveFtRoot);
843 if (r == NULL) {
844 return false;
847 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
848 talloc_free(r);
849 return false;
852 pull = ndr_pull_init_blob(&blob, r, NULL);
853 if (pull == NULL) {
854 talloc_free(r);
855 return false;
858 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
859 ndr_err = call->ndr_pull(pull, NDR_IN, r);
860 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
861 talloc_free(r);
862 return false;
865 if (DEBUGLEVEL >= 10) {
866 NDR_PRINT_IN_DEBUG(dfs_RemoveFtRoot, r);
869 ZERO_STRUCT(r->out);
870 r->out.unknown = r->in.unknown;
871 r->out.result = _dfs_RemoveFtRoot(p, r);
873 if (p->rng_fault_state) {
874 talloc_free(r);
875 /* Return true here, srv_pipe_hnd.c will take care */
876 return true;
879 if (DEBUGLEVEL >= 10) {
880 NDR_PRINT_OUT_DEBUG(dfs_RemoveFtRoot, r);
883 push = ndr_push_init_ctx(r, NULL);
884 if (push == NULL) {
885 talloc_free(r);
886 return false;
889 ndr_err = call->ndr_push(push, NDR_OUT, r);
890 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
891 talloc_free(r);
892 return false;
895 blob = ndr_push_blob(push);
896 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
897 talloc_free(r);
898 return false;
901 talloc_free(r);
903 return true;
906 static bool api_dfs_AddStdRoot(pipes_struct *p)
908 const struct ndr_interface_call *call;
909 struct ndr_pull *pull;
910 struct ndr_push *push;
911 enum ndr_err_code ndr_err;
912 DATA_BLOB blob;
913 struct dfs_AddStdRoot *r;
915 call = &ndr_table_netdfs.calls[NDR_DFS_ADDSTDROOT];
917 r = talloc(talloc_tos(), struct dfs_AddStdRoot);
918 if (r == NULL) {
919 return false;
922 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
923 talloc_free(r);
924 return false;
927 pull = ndr_pull_init_blob(&blob, r, NULL);
928 if (pull == NULL) {
929 talloc_free(r);
930 return false;
933 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
934 ndr_err = call->ndr_pull(pull, NDR_IN, r);
935 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
936 talloc_free(r);
937 return false;
940 if (DEBUGLEVEL >= 10) {
941 NDR_PRINT_IN_DEBUG(dfs_AddStdRoot, r);
944 r->out.result = _dfs_AddStdRoot(p, r);
946 if (p->rng_fault_state) {
947 talloc_free(r);
948 /* Return true here, srv_pipe_hnd.c will take care */
949 return true;
952 if (DEBUGLEVEL >= 10) {
953 NDR_PRINT_OUT_DEBUG(dfs_AddStdRoot, r);
956 push = ndr_push_init_ctx(r, NULL);
957 if (push == NULL) {
958 talloc_free(r);
959 return false;
962 ndr_err = call->ndr_push(push, NDR_OUT, r);
963 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
964 talloc_free(r);
965 return false;
968 blob = ndr_push_blob(push);
969 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
970 talloc_free(r);
971 return false;
974 talloc_free(r);
976 return true;
979 static bool api_dfs_RemoveStdRoot(pipes_struct *p)
981 const struct ndr_interface_call *call;
982 struct ndr_pull *pull;
983 struct ndr_push *push;
984 enum ndr_err_code ndr_err;
985 DATA_BLOB blob;
986 struct dfs_RemoveStdRoot *r;
988 call = &ndr_table_netdfs.calls[NDR_DFS_REMOVESTDROOT];
990 r = talloc(talloc_tos(), struct dfs_RemoveStdRoot);
991 if (r == NULL) {
992 return false;
995 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
996 talloc_free(r);
997 return false;
1000 pull = ndr_pull_init_blob(&blob, r, NULL);
1001 if (pull == NULL) {
1002 talloc_free(r);
1003 return false;
1006 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1007 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1008 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1009 talloc_free(r);
1010 return false;
1013 if (DEBUGLEVEL >= 10) {
1014 NDR_PRINT_IN_DEBUG(dfs_RemoveStdRoot, r);
1017 r->out.result = _dfs_RemoveStdRoot(p, r);
1019 if (p->rng_fault_state) {
1020 talloc_free(r);
1021 /* Return true here, srv_pipe_hnd.c will take care */
1022 return true;
1025 if (DEBUGLEVEL >= 10) {
1026 NDR_PRINT_OUT_DEBUG(dfs_RemoveStdRoot, r);
1029 push = ndr_push_init_ctx(r, NULL);
1030 if (push == NULL) {
1031 talloc_free(r);
1032 return false;
1035 ndr_err = call->ndr_push(push, NDR_OUT, r);
1036 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1037 talloc_free(r);
1038 return false;
1041 blob = ndr_push_blob(push);
1042 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1043 talloc_free(r);
1044 return false;
1047 talloc_free(r);
1049 return true;
1052 static bool api_dfs_ManagerInitialize(pipes_struct *p)
1054 const struct ndr_interface_call *call;
1055 struct ndr_pull *pull;
1056 struct ndr_push *push;
1057 enum ndr_err_code ndr_err;
1058 DATA_BLOB blob;
1059 struct dfs_ManagerInitialize *r;
1061 call = &ndr_table_netdfs.calls[NDR_DFS_MANAGERINITIALIZE];
1063 r = talloc(talloc_tos(), struct dfs_ManagerInitialize);
1064 if (r == NULL) {
1065 return false;
1068 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1069 talloc_free(r);
1070 return false;
1073 pull = ndr_pull_init_blob(&blob, r, NULL);
1074 if (pull == NULL) {
1075 talloc_free(r);
1076 return false;
1079 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1080 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1081 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1082 talloc_free(r);
1083 return false;
1086 if (DEBUGLEVEL >= 10) {
1087 NDR_PRINT_IN_DEBUG(dfs_ManagerInitialize, r);
1090 r->out.result = _dfs_ManagerInitialize(p, r);
1092 if (p->rng_fault_state) {
1093 talloc_free(r);
1094 /* Return true here, srv_pipe_hnd.c will take care */
1095 return true;
1098 if (DEBUGLEVEL >= 10) {
1099 NDR_PRINT_OUT_DEBUG(dfs_ManagerInitialize, r);
1102 push = ndr_push_init_ctx(r, NULL);
1103 if (push == NULL) {
1104 talloc_free(r);
1105 return false;
1108 ndr_err = call->ndr_push(push, NDR_OUT, r);
1109 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1110 talloc_free(r);
1111 return false;
1114 blob = ndr_push_blob(push);
1115 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1116 talloc_free(r);
1117 return false;
1120 talloc_free(r);
1122 return true;
1125 static bool api_dfs_AddStdRootForced(pipes_struct *p)
1127 const struct ndr_interface_call *call;
1128 struct ndr_pull *pull;
1129 struct ndr_push *push;
1130 enum ndr_err_code ndr_err;
1131 DATA_BLOB blob;
1132 struct dfs_AddStdRootForced *r;
1134 call = &ndr_table_netdfs.calls[NDR_DFS_ADDSTDROOTFORCED];
1136 r = talloc(talloc_tos(), struct dfs_AddStdRootForced);
1137 if (r == NULL) {
1138 return false;
1141 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1142 talloc_free(r);
1143 return false;
1146 pull = ndr_pull_init_blob(&blob, r, NULL);
1147 if (pull == NULL) {
1148 talloc_free(r);
1149 return false;
1152 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1153 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1154 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1155 talloc_free(r);
1156 return false;
1159 if (DEBUGLEVEL >= 10) {
1160 NDR_PRINT_IN_DEBUG(dfs_AddStdRootForced, r);
1163 r->out.result = _dfs_AddStdRootForced(p, r);
1165 if (p->rng_fault_state) {
1166 talloc_free(r);
1167 /* Return true here, srv_pipe_hnd.c will take care */
1168 return true;
1171 if (DEBUGLEVEL >= 10) {
1172 NDR_PRINT_OUT_DEBUG(dfs_AddStdRootForced, r);
1175 push = ndr_push_init_ctx(r, NULL);
1176 if (push == NULL) {
1177 talloc_free(r);
1178 return false;
1181 ndr_err = call->ndr_push(push, NDR_OUT, r);
1182 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1183 talloc_free(r);
1184 return false;
1187 blob = ndr_push_blob(push);
1188 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1189 talloc_free(r);
1190 return false;
1193 talloc_free(r);
1195 return true;
1198 static bool api_dfs_GetDcAddress(pipes_struct *p)
1200 const struct ndr_interface_call *call;
1201 struct ndr_pull *pull;
1202 struct ndr_push *push;
1203 enum ndr_err_code ndr_err;
1204 DATA_BLOB blob;
1205 struct dfs_GetDcAddress *r;
1207 call = &ndr_table_netdfs.calls[NDR_DFS_GETDCADDRESS];
1209 r = talloc(talloc_tos(), struct dfs_GetDcAddress);
1210 if (r == NULL) {
1211 return false;
1214 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1215 talloc_free(r);
1216 return false;
1219 pull = ndr_pull_init_blob(&blob, r, NULL);
1220 if (pull == NULL) {
1221 talloc_free(r);
1222 return false;
1225 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1226 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1227 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1228 talloc_free(r);
1229 return false;
1232 if (DEBUGLEVEL >= 10) {
1233 NDR_PRINT_IN_DEBUG(dfs_GetDcAddress, r);
1236 ZERO_STRUCT(r->out);
1237 r->out.server_fullname = r->in.server_fullname;
1238 r->out.is_root = r->in.is_root;
1239 r->out.ttl = r->in.ttl;
1240 r->out.result = _dfs_GetDcAddress(p, r);
1242 if (p->rng_fault_state) {
1243 talloc_free(r);
1244 /* Return true here, srv_pipe_hnd.c will take care */
1245 return true;
1248 if (DEBUGLEVEL >= 10) {
1249 NDR_PRINT_OUT_DEBUG(dfs_GetDcAddress, r);
1252 push = ndr_push_init_ctx(r, NULL);
1253 if (push == NULL) {
1254 talloc_free(r);
1255 return false;
1258 ndr_err = call->ndr_push(push, NDR_OUT, r);
1259 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1260 talloc_free(r);
1261 return false;
1264 blob = ndr_push_blob(push);
1265 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1266 talloc_free(r);
1267 return false;
1270 talloc_free(r);
1272 return true;
1275 static bool api_dfs_SetDcAddress(pipes_struct *p)
1277 const struct ndr_interface_call *call;
1278 struct ndr_pull *pull;
1279 struct ndr_push *push;
1280 enum ndr_err_code ndr_err;
1281 DATA_BLOB blob;
1282 struct dfs_SetDcAddress *r;
1284 call = &ndr_table_netdfs.calls[NDR_DFS_SETDCADDRESS];
1286 r = talloc(talloc_tos(), struct dfs_SetDcAddress);
1287 if (r == NULL) {
1288 return false;
1291 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1292 talloc_free(r);
1293 return false;
1296 pull = ndr_pull_init_blob(&blob, r, NULL);
1297 if (pull == NULL) {
1298 talloc_free(r);
1299 return false;
1302 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1303 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1304 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1305 talloc_free(r);
1306 return false;
1309 if (DEBUGLEVEL >= 10) {
1310 NDR_PRINT_IN_DEBUG(dfs_SetDcAddress, r);
1313 r->out.result = _dfs_SetDcAddress(p, r);
1315 if (p->rng_fault_state) {
1316 talloc_free(r);
1317 /* Return true here, srv_pipe_hnd.c will take care */
1318 return true;
1321 if (DEBUGLEVEL >= 10) {
1322 NDR_PRINT_OUT_DEBUG(dfs_SetDcAddress, r);
1325 push = ndr_push_init_ctx(r, NULL);
1326 if (push == NULL) {
1327 talloc_free(r);
1328 return false;
1331 ndr_err = call->ndr_push(push, NDR_OUT, r);
1332 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1333 talloc_free(r);
1334 return false;
1337 blob = ndr_push_blob(push);
1338 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1339 talloc_free(r);
1340 return false;
1343 talloc_free(r);
1345 return true;
1348 static bool api_dfs_FlushFtTable(pipes_struct *p)
1350 const struct ndr_interface_call *call;
1351 struct ndr_pull *pull;
1352 struct ndr_push *push;
1353 enum ndr_err_code ndr_err;
1354 DATA_BLOB blob;
1355 struct dfs_FlushFtTable *r;
1357 call = &ndr_table_netdfs.calls[NDR_DFS_FLUSHFTTABLE];
1359 r = talloc(talloc_tos(), struct dfs_FlushFtTable);
1360 if (r == NULL) {
1361 return false;
1364 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1365 talloc_free(r);
1366 return false;
1369 pull = ndr_pull_init_blob(&blob, r, NULL);
1370 if (pull == NULL) {
1371 talloc_free(r);
1372 return false;
1375 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1376 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1377 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1378 talloc_free(r);
1379 return false;
1382 if (DEBUGLEVEL >= 10) {
1383 NDR_PRINT_IN_DEBUG(dfs_FlushFtTable, r);
1386 r->out.result = _dfs_FlushFtTable(p, r);
1388 if (p->rng_fault_state) {
1389 talloc_free(r);
1390 /* Return true here, srv_pipe_hnd.c will take care */
1391 return true;
1394 if (DEBUGLEVEL >= 10) {
1395 NDR_PRINT_OUT_DEBUG(dfs_FlushFtTable, r);
1398 push = ndr_push_init_ctx(r, NULL);
1399 if (push == NULL) {
1400 talloc_free(r);
1401 return false;
1404 ndr_err = call->ndr_push(push, NDR_OUT, r);
1405 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1406 talloc_free(r);
1407 return false;
1410 blob = ndr_push_blob(push);
1411 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1412 talloc_free(r);
1413 return false;
1416 talloc_free(r);
1418 return true;
1421 static bool api_dfs_Add2(pipes_struct *p)
1423 const struct ndr_interface_call *call;
1424 struct ndr_pull *pull;
1425 struct ndr_push *push;
1426 enum ndr_err_code ndr_err;
1427 DATA_BLOB blob;
1428 struct dfs_Add2 *r;
1430 call = &ndr_table_netdfs.calls[NDR_DFS_ADD2];
1432 r = talloc(talloc_tos(), struct dfs_Add2);
1433 if (r == NULL) {
1434 return false;
1437 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1438 talloc_free(r);
1439 return false;
1442 pull = ndr_pull_init_blob(&blob, r, NULL);
1443 if (pull == NULL) {
1444 talloc_free(r);
1445 return false;
1448 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1449 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1450 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1451 talloc_free(r);
1452 return false;
1455 if (DEBUGLEVEL >= 10) {
1456 NDR_PRINT_IN_DEBUG(dfs_Add2, r);
1459 r->out.result = _dfs_Add2(p, r);
1461 if (p->rng_fault_state) {
1462 talloc_free(r);
1463 /* Return true here, srv_pipe_hnd.c will take care */
1464 return true;
1467 if (DEBUGLEVEL >= 10) {
1468 NDR_PRINT_OUT_DEBUG(dfs_Add2, r);
1471 push = ndr_push_init_ctx(r, NULL);
1472 if (push == NULL) {
1473 talloc_free(r);
1474 return false;
1477 ndr_err = call->ndr_push(push, NDR_OUT, r);
1478 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1479 talloc_free(r);
1480 return false;
1483 blob = ndr_push_blob(push);
1484 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1485 talloc_free(r);
1486 return false;
1489 talloc_free(r);
1491 return true;
1494 static bool api_dfs_Remove2(pipes_struct *p)
1496 const struct ndr_interface_call *call;
1497 struct ndr_pull *pull;
1498 struct ndr_push *push;
1499 enum ndr_err_code ndr_err;
1500 DATA_BLOB blob;
1501 struct dfs_Remove2 *r;
1503 call = &ndr_table_netdfs.calls[NDR_DFS_REMOVE2];
1505 r = talloc(talloc_tos(), struct dfs_Remove2);
1506 if (r == NULL) {
1507 return false;
1510 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1511 talloc_free(r);
1512 return false;
1515 pull = ndr_pull_init_blob(&blob, r, NULL);
1516 if (pull == NULL) {
1517 talloc_free(r);
1518 return false;
1521 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1522 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1523 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1524 talloc_free(r);
1525 return false;
1528 if (DEBUGLEVEL >= 10) {
1529 NDR_PRINT_IN_DEBUG(dfs_Remove2, r);
1532 r->out.result = _dfs_Remove2(p, r);
1534 if (p->rng_fault_state) {
1535 talloc_free(r);
1536 /* Return true here, srv_pipe_hnd.c will take care */
1537 return true;
1540 if (DEBUGLEVEL >= 10) {
1541 NDR_PRINT_OUT_DEBUG(dfs_Remove2, r);
1544 push = ndr_push_init_ctx(r, NULL);
1545 if (push == NULL) {
1546 talloc_free(r);
1547 return false;
1550 ndr_err = call->ndr_push(push, NDR_OUT, r);
1551 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1552 talloc_free(r);
1553 return false;
1556 blob = ndr_push_blob(push);
1557 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1558 talloc_free(r);
1559 return false;
1562 talloc_free(r);
1564 return true;
1567 static bool api_dfs_EnumEx(pipes_struct *p)
1569 const struct ndr_interface_call *call;
1570 struct ndr_pull *pull;
1571 struct ndr_push *push;
1572 enum ndr_err_code ndr_err;
1573 DATA_BLOB blob;
1574 struct dfs_EnumEx *r;
1576 call = &ndr_table_netdfs.calls[NDR_DFS_ENUMEX];
1578 r = talloc(talloc_tos(), struct dfs_EnumEx);
1579 if (r == NULL) {
1580 return false;
1583 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1584 talloc_free(r);
1585 return false;
1588 pull = ndr_pull_init_blob(&blob, r, NULL);
1589 if (pull == NULL) {
1590 talloc_free(r);
1591 return false;
1594 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1595 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1596 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1597 talloc_free(r);
1598 return false;
1601 if (DEBUGLEVEL >= 10) {
1602 NDR_PRINT_IN_DEBUG(dfs_EnumEx, r);
1605 ZERO_STRUCT(r->out);
1606 r->out.info = r->in.info;
1607 r->out.total = r->in.total;
1608 r->out.result = _dfs_EnumEx(p, r);
1610 if (p->rng_fault_state) {
1611 talloc_free(r);
1612 /* Return true here, srv_pipe_hnd.c will take care */
1613 return true;
1616 if (DEBUGLEVEL >= 10) {
1617 NDR_PRINT_OUT_DEBUG(dfs_EnumEx, r);
1620 push = ndr_push_init_ctx(r, NULL);
1621 if (push == NULL) {
1622 talloc_free(r);
1623 return false;
1626 ndr_err = call->ndr_push(push, NDR_OUT, r);
1627 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1628 talloc_free(r);
1629 return false;
1632 blob = ndr_push_blob(push);
1633 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1634 talloc_free(r);
1635 return false;
1638 talloc_free(r);
1640 return true;
1643 static bool api_dfs_SetInfo2(pipes_struct *p)
1645 const struct ndr_interface_call *call;
1646 struct ndr_pull *pull;
1647 struct ndr_push *push;
1648 enum ndr_err_code ndr_err;
1649 DATA_BLOB blob;
1650 struct dfs_SetInfo2 *r;
1652 call = &ndr_table_netdfs.calls[NDR_DFS_SETINFO2];
1654 r = talloc(talloc_tos(), struct dfs_SetInfo2);
1655 if (r == NULL) {
1656 return false;
1659 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1660 talloc_free(r);
1661 return false;
1664 pull = ndr_pull_init_blob(&blob, r, NULL);
1665 if (pull == NULL) {
1666 talloc_free(r);
1667 return false;
1670 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1671 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1672 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1673 talloc_free(r);
1674 return false;
1677 if (DEBUGLEVEL >= 10) {
1678 NDR_PRINT_IN_DEBUG(dfs_SetInfo2, r);
1681 r->out.result = _dfs_SetInfo2(p, r);
1683 if (p->rng_fault_state) {
1684 talloc_free(r);
1685 /* Return true here, srv_pipe_hnd.c will take care */
1686 return true;
1689 if (DEBUGLEVEL >= 10) {
1690 NDR_PRINT_OUT_DEBUG(dfs_SetInfo2, r);
1693 push = ndr_push_init_ctx(r, NULL);
1694 if (push == NULL) {
1695 talloc_free(r);
1696 return false;
1699 ndr_err = call->ndr_push(push, NDR_OUT, r);
1700 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1701 talloc_free(r);
1702 return false;
1705 blob = ndr_push_blob(push);
1706 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1707 talloc_free(r);
1708 return false;
1711 talloc_free(r);
1713 return true;
1717 /* Tables */
1718 static struct api_struct api_netdfs_cmds[] =
1720 {"DFS_GETMANAGERVERSION", NDR_DFS_GETMANAGERVERSION, api_dfs_GetManagerVersion},
1721 {"DFS_ADD", NDR_DFS_ADD, api_dfs_Add},
1722 {"DFS_REMOVE", NDR_DFS_REMOVE, api_dfs_Remove},
1723 {"DFS_SETINFO", NDR_DFS_SETINFO, api_dfs_SetInfo},
1724 {"DFS_GETINFO", NDR_DFS_GETINFO, api_dfs_GetInfo},
1725 {"DFS_ENUM", NDR_DFS_ENUM, api_dfs_Enum},
1726 {"DFS_RENAME", NDR_DFS_RENAME, api_dfs_Rename},
1727 {"DFS_MOVE", NDR_DFS_MOVE, api_dfs_Move},
1728 {"DFS_MANAGERGETCONFIGINFO", NDR_DFS_MANAGERGETCONFIGINFO, api_dfs_ManagerGetConfigInfo},
1729 {"DFS_MANAGERSENDSITEINFO", NDR_DFS_MANAGERSENDSITEINFO, api_dfs_ManagerSendSiteInfo},
1730 {"DFS_ADDFTROOT", NDR_DFS_ADDFTROOT, api_dfs_AddFtRoot},
1731 {"DFS_REMOVEFTROOT", NDR_DFS_REMOVEFTROOT, api_dfs_RemoveFtRoot},
1732 {"DFS_ADDSTDROOT", NDR_DFS_ADDSTDROOT, api_dfs_AddStdRoot},
1733 {"DFS_REMOVESTDROOT", NDR_DFS_REMOVESTDROOT, api_dfs_RemoveStdRoot},
1734 {"DFS_MANAGERINITIALIZE", NDR_DFS_MANAGERINITIALIZE, api_dfs_ManagerInitialize},
1735 {"DFS_ADDSTDROOTFORCED", NDR_DFS_ADDSTDROOTFORCED, api_dfs_AddStdRootForced},
1736 {"DFS_GETDCADDRESS", NDR_DFS_GETDCADDRESS, api_dfs_GetDcAddress},
1737 {"DFS_SETDCADDRESS", NDR_DFS_SETDCADDRESS, api_dfs_SetDcAddress},
1738 {"DFS_FLUSHFTTABLE", NDR_DFS_FLUSHFTTABLE, api_dfs_FlushFtTable},
1739 {"DFS_ADD2", NDR_DFS_ADD2, api_dfs_Add2},
1740 {"DFS_REMOVE2", NDR_DFS_REMOVE2, api_dfs_Remove2},
1741 {"DFS_ENUMEX", NDR_DFS_ENUMEX, api_dfs_EnumEx},
1742 {"DFS_SETINFO2", NDR_DFS_SETINFO2, api_dfs_SetInfo2},
1745 void netdfs_get_pipe_fns(struct api_struct **fns, int *n_fns)
1747 *fns = api_netdfs_cmds;
1748 *n_fns = sizeof(api_netdfs_cmds) / sizeof(struct api_struct);
1751 NTSTATUS rpc_netdfs_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const struct ndr_interface_table *table, uint32_t opnum, void *_r)
1753 if (cli->pipes_struct == NULL) {
1754 return NT_STATUS_INVALID_PARAMETER;
1757 switch (opnum)
1759 case NDR_DFS_GETMANAGERVERSION: {
1760 struct dfs_GetManagerVersion *r = (struct dfs_GetManagerVersion *)_r;
1761 ZERO_STRUCT(r->out);
1762 r->out.version = talloc_zero(mem_ctx, enum dfs_ManagerVersion);
1763 if (r->out.version == NULL) {
1764 return NT_STATUS_NO_MEMORY;
1767 _dfs_GetManagerVersion(cli->pipes_struct, r);
1768 return NT_STATUS_OK;
1771 case NDR_DFS_ADD: {
1772 struct dfs_Add *r = (struct dfs_Add *)_r;
1773 r->out.result = _dfs_Add(cli->pipes_struct, r);
1774 return NT_STATUS_OK;
1777 case NDR_DFS_REMOVE: {
1778 struct dfs_Remove *r = (struct dfs_Remove *)_r;
1779 r->out.result = _dfs_Remove(cli->pipes_struct, r);
1780 return NT_STATUS_OK;
1783 case NDR_DFS_SETINFO: {
1784 struct dfs_SetInfo *r = (struct dfs_SetInfo *)_r;
1785 r->out.result = _dfs_SetInfo(cli->pipes_struct, r);
1786 return NT_STATUS_OK;
1789 case NDR_DFS_GETINFO: {
1790 struct dfs_GetInfo *r = (struct dfs_GetInfo *)_r;
1791 ZERO_STRUCT(r->out);
1792 r->out.info = talloc_zero(mem_ctx, union dfs_Info);
1793 if (r->out.info == NULL) {
1794 return NT_STATUS_NO_MEMORY;
1797 r->out.result = _dfs_GetInfo(cli->pipes_struct, r);
1798 return NT_STATUS_OK;
1801 case NDR_DFS_ENUM: {
1802 struct dfs_Enum *r = (struct dfs_Enum *)_r;
1803 ZERO_STRUCT(r->out);
1804 r->out.info = r->in.info;
1805 r->out.total = r->in.total;
1806 r->out.result = _dfs_Enum(cli->pipes_struct, r);
1807 return NT_STATUS_OK;
1810 case NDR_DFS_RENAME: {
1811 struct dfs_Rename *r = (struct dfs_Rename *)_r;
1812 r->out.result = _dfs_Rename(cli->pipes_struct, r);
1813 return NT_STATUS_OK;
1816 case NDR_DFS_MOVE: {
1817 struct dfs_Move *r = (struct dfs_Move *)_r;
1818 r->out.result = _dfs_Move(cli->pipes_struct, r);
1819 return NT_STATUS_OK;
1822 case NDR_DFS_MANAGERGETCONFIGINFO: {
1823 struct dfs_ManagerGetConfigInfo *r = (struct dfs_ManagerGetConfigInfo *)_r;
1824 r->out.result = _dfs_ManagerGetConfigInfo(cli->pipes_struct, r);
1825 return NT_STATUS_OK;
1828 case NDR_DFS_MANAGERSENDSITEINFO: {
1829 struct dfs_ManagerSendSiteInfo *r = (struct dfs_ManagerSendSiteInfo *)_r;
1830 r->out.result = _dfs_ManagerSendSiteInfo(cli->pipes_struct, r);
1831 return NT_STATUS_OK;
1834 case NDR_DFS_ADDFTROOT: {
1835 struct dfs_AddFtRoot *r = (struct dfs_AddFtRoot *)_r;
1836 ZERO_STRUCT(r->out);
1837 r->out.unknown2 = r->in.unknown2;
1838 r->out.result = _dfs_AddFtRoot(cli->pipes_struct, r);
1839 return NT_STATUS_OK;
1842 case NDR_DFS_REMOVEFTROOT: {
1843 struct dfs_RemoveFtRoot *r = (struct dfs_RemoveFtRoot *)_r;
1844 ZERO_STRUCT(r->out);
1845 r->out.unknown = r->in.unknown;
1846 r->out.result = _dfs_RemoveFtRoot(cli->pipes_struct, r);
1847 return NT_STATUS_OK;
1850 case NDR_DFS_ADDSTDROOT: {
1851 struct dfs_AddStdRoot *r = (struct dfs_AddStdRoot *)_r;
1852 r->out.result = _dfs_AddStdRoot(cli->pipes_struct, r);
1853 return NT_STATUS_OK;
1856 case NDR_DFS_REMOVESTDROOT: {
1857 struct dfs_RemoveStdRoot *r = (struct dfs_RemoveStdRoot *)_r;
1858 r->out.result = _dfs_RemoveStdRoot(cli->pipes_struct, r);
1859 return NT_STATUS_OK;
1862 case NDR_DFS_MANAGERINITIALIZE: {
1863 struct dfs_ManagerInitialize *r = (struct dfs_ManagerInitialize *)_r;
1864 r->out.result = _dfs_ManagerInitialize(cli->pipes_struct, r);
1865 return NT_STATUS_OK;
1868 case NDR_DFS_ADDSTDROOTFORCED: {
1869 struct dfs_AddStdRootForced *r = (struct dfs_AddStdRootForced *)_r;
1870 r->out.result = _dfs_AddStdRootForced(cli->pipes_struct, r);
1871 return NT_STATUS_OK;
1874 case NDR_DFS_GETDCADDRESS: {
1875 struct dfs_GetDcAddress *r = (struct dfs_GetDcAddress *)_r;
1876 ZERO_STRUCT(r->out);
1877 r->out.server_fullname = r->in.server_fullname;
1878 r->out.is_root = r->in.is_root;
1879 r->out.ttl = r->in.ttl;
1880 r->out.result = _dfs_GetDcAddress(cli->pipes_struct, r);
1881 return NT_STATUS_OK;
1884 case NDR_DFS_SETDCADDRESS: {
1885 struct dfs_SetDcAddress *r = (struct dfs_SetDcAddress *)_r;
1886 r->out.result = _dfs_SetDcAddress(cli->pipes_struct, r);
1887 return NT_STATUS_OK;
1890 case NDR_DFS_FLUSHFTTABLE: {
1891 struct dfs_FlushFtTable *r = (struct dfs_FlushFtTable *)_r;
1892 r->out.result = _dfs_FlushFtTable(cli->pipes_struct, r);
1893 return NT_STATUS_OK;
1896 case NDR_DFS_ADD2: {
1897 struct dfs_Add2 *r = (struct dfs_Add2 *)_r;
1898 r->out.result = _dfs_Add2(cli->pipes_struct, r);
1899 return NT_STATUS_OK;
1902 case NDR_DFS_REMOVE2: {
1903 struct dfs_Remove2 *r = (struct dfs_Remove2 *)_r;
1904 r->out.result = _dfs_Remove2(cli->pipes_struct, r);
1905 return NT_STATUS_OK;
1908 case NDR_DFS_ENUMEX: {
1909 struct dfs_EnumEx *r = (struct dfs_EnumEx *)_r;
1910 ZERO_STRUCT(r->out);
1911 r->out.info = r->in.info;
1912 r->out.total = r->in.total;
1913 r->out.result = _dfs_EnumEx(cli->pipes_struct, r);
1914 return NT_STATUS_OK;
1917 case NDR_DFS_SETINFO2: {
1918 struct dfs_SetInfo2 *r = (struct dfs_SetInfo2 *)_r;
1919 r->out.result = _dfs_SetInfo2(cli->pipes_struct, r);
1920 return NT_STATUS_OK;
1923 default:
1924 return NT_STATUS_NOT_IMPLEMENTED;
1928 NTSTATUS rpc_netdfs_init(void)
1930 return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "netdfs", "netdfs", &ndr_table_netdfs, api_netdfs_cmds, sizeof(api_netdfs_cmds) / sizeof(struct api_struct));