Simplify the logic - remove extraneous argument and calls to set_close_write_time().
[Samba/fernandojvsilva.git] / librpc / gen_ndr / srv_dssetup.c
blob813eaf629fa4a4b6101725e34accc605605c4aa4
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_dssetup.h"
9 static bool api_dssetup_DsRoleGetPrimaryDomainInformation(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 dssetup_DsRoleGetPrimaryDomainInformation *r;
18 call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLEGETPRIMARYDOMAININFORMATION];
20 r = talloc(talloc_tos(), struct dssetup_DsRoleGetPrimaryDomainInformation);
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(dssetup_DsRoleGetPrimaryDomainInformation, r);
47 ZERO_STRUCT(r->out);
48 r->out.info = talloc_zero(r, union dssetup_DsRoleInfo);
49 if (r->out.info == NULL) {
50 talloc_free(r);
51 return false;
54 r->out.result = _dssetup_DsRoleGetPrimaryDomainInformation(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(dssetup_DsRoleGetPrimaryDomainInformation, 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_dssetup_DsRoleDnsNameToFlatName(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 dssetup_DsRoleDnsNameToFlatName *r;
98 call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLEDNSNAMETOFLATNAME];
100 r = talloc(talloc_tos(), struct dssetup_DsRoleDnsNameToFlatName);
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(dssetup_DsRoleDnsNameToFlatName, r);
127 r->out.result = _dssetup_DsRoleDnsNameToFlatName(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(dssetup_DsRoleDnsNameToFlatName, 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_dssetup_DsRoleDcAsDc(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 dssetup_DsRoleDcAsDc *r;
171 call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLEDCASDC];
173 r = talloc(talloc_tos(), struct dssetup_DsRoleDcAsDc);
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(dssetup_DsRoleDcAsDc, r);
200 r->out.result = _dssetup_DsRoleDcAsDc(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(dssetup_DsRoleDcAsDc, 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_dssetup_DsRoleDcAsReplica(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 dssetup_DsRoleDcAsReplica *r;
244 call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLEDCASREPLICA];
246 r = talloc(talloc_tos(), struct dssetup_DsRoleDcAsReplica);
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(dssetup_DsRoleDcAsReplica, r);
273 r->out.result = _dssetup_DsRoleDcAsReplica(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(dssetup_DsRoleDcAsReplica, 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_dssetup_DsRoleDemoteDc(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 dssetup_DsRoleDemoteDc *r;
317 call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLEDEMOTEDC];
319 r = talloc(talloc_tos(), struct dssetup_DsRoleDemoteDc);
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(dssetup_DsRoleDemoteDc, r);
346 r->out.result = _dssetup_DsRoleDemoteDc(p, r);
348 if (p->rng_fault_state) {
349 talloc_free(r);
350 /* Return true here, srv_pipe_hnd.c will take care */
351 return true;
354 if (DEBUGLEVEL >= 10) {
355 NDR_PRINT_OUT_DEBUG(dssetup_DsRoleDemoteDc, r);
358 push = ndr_push_init_ctx(r, NULL);
359 if (push == NULL) {
360 talloc_free(r);
361 return false;
364 ndr_err = call->ndr_push(push, NDR_OUT, r);
365 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
366 talloc_free(r);
367 return false;
370 blob = ndr_push_blob(push);
371 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
372 talloc_free(r);
373 return false;
376 talloc_free(r);
378 return true;
381 static bool api_dssetup_DsRoleGetDcOperationProgress(pipes_struct *p)
383 const struct ndr_interface_call *call;
384 struct ndr_pull *pull;
385 struct ndr_push *push;
386 enum ndr_err_code ndr_err;
387 DATA_BLOB blob;
388 struct dssetup_DsRoleGetDcOperationProgress *r;
390 call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLEGETDCOPERATIONPROGRESS];
392 r = talloc(talloc_tos(), struct dssetup_DsRoleGetDcOperationProgress);
393 if (r == NULL) {
394 return false;
397 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
398 talloc_free(r);
399 return false;
402 pull = ndr_pull_init_blob(&blob, r, NULL);
403 if (pull == NULL) {
404 talloc_free(r);
405 return false;
408 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
409 ndr_err = call->ndr_pull(pull, NDR_IN, r);
410 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
411 talloc_free(r);
412 return false;
415 if (DEBUGLEVEL >= 10) {
416 NDR_PRINT_IN_DEBUG(dssetup_DsRoleGetDcOperationProgress, r);
419 r->out.result = _dssetup_DsRoleGetDcOperationProgress(p, r);
421 if (p->rng_fault_state) {
422 talloc_free(r);
423 /* Return true here, srv_pipe_hnd.c will take care */
424 return true;
427 if (DEBUGLEVEL >= 10) {
428 NDR_PRINT_OUT_DEBUG(dssetup_DsRoleGetDcOperationProgress, r);
431 push = ndr_push_init_ctx(r, NULL);
432 if (push == NULL) {
433 talloc_free(r);
434 return false;
437 ndr_err = call->ndr_push(push, NDR_OUT, r);
438 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
439 talloc_free(r);
440 return false;
443 blob = ndr_push_blob(push);
444 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
445 talloc_free(r);
446 return false;
449 talloc_free(r);
451 return true;
454 static bool api_dssetup_DsRoleGetDcOperationResults(pipes_struct *p)
456 const struct ndr_interface_call *call;
457 struct ndr_pull *pull;
458 struct ndr_push *push;
459 enum ndr_err_code ndr_err;
460 DATA_BLOB blob;
461 struct dssetup_DsRoleGetDcOperationResults *r;
463 call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLEGETDCOPERATIONRESULTS];
465 r = talloc(talloc_tos(), struct dssetup_DsRoleGetDcOperationResults);
466 if (r == NULL) {
467 return false;
470 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
471 talloc_free(r);
472 return false;
475 pull = ndr_pull_init_blob(&blob, r, NULL);
476 if (pull == NULL) {
477 talloc_free(r);
478 return false;
481 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
482 ndr_err = call->ndr_pull(pull, NDR_IN, r);
483 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
484 talloc_free(r);
485 return false;
488 if (DEBUGLEVEL >= 10) {
489 NDR_PRINT_IN_DEBUG(dssetup_DsRoleGetDcOperationResults, r);
492 r->out.result = _dssetup_DsRoleGetDcOperationResults(p, r);
494 if (p->rng_fault_state) {
495 talloc_free(r);
496 /* Return true here, srv_pipe_hnd.c will take care */
497 return true;
500 if (DEBUGLEVEL >= 10) {
501 NDR_PRINT_OUT_DEBUG(dssetup_DsRoleGetDcOperationResults, r);
504 push = ndr_push_init_ctx(r, NULL);
505 if (push == NULL) {
506 talloc_free(r);
507 return false;
510 ndr_err = call->ndr_push(push, NDR_OUT, r);
511 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
512 talloc_free(r);
513 return false;
516 blob = ndr_push_blob(push);
517 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
518 talloc_free(r);
519 return false;
522 talloc_free(r);
524 return true;
527 static bool api_dssetup_DsRoleCancel(pipes_struct *p)
529 const struct ndr_interface_call *call;
530 struct ndr_pull *pull;
531 struct ndr_push *push;
532 enum ndr_err_code ndr_err;
533 DATA_BLOB blob;
534 struct dssetup_DsRoleCancel *r;
536 call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLECANCEL];
538 r = talloc(talloc_tos(), struct dssetup_DsRoleCancel);
539 if (r == NULL) {
540 return false;
543 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
544 talloc_free(r);
545 return false;
548 pull = ndr_pull_init_blob(&blob, r, NULL);
549 if (pull == NULL) {
550 talloc_free(r);
551 return false;
554 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
555 ndr_err = call->ndr_pull(pull, NDR_IN, r);
556 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
557 talloc_free(r);
558 return false;
561 if (DEBUGLEVEL >= 10) {
562 NDR_PRINT_IN_DEBUG(dssetup_DsRoleCancel, r);
565 r->out.result = _dssetup_DsRoleCancel(p, r);
567 if (p->rng_fault_state) {
568 talloc_free(r);
569 /* Return true here, srv_pipe_hnd.c will take care */
570 return true;
573 if (DEBUGLEVEL >= 10) {
574 NDR_PRINT_OUT_DEBUG(dssetup_DsRoleCancel, r);
577 push = ndr_push_init_ctx(r, NULL);
578 if (push == NULL) {
579 talloc_free(r);
580 return false;
583 ndr_err = call->ndr_push(push, NDR_OUT, r);
584 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
585 talloc_free(r);
586 return false;
589 blob = ndr_push_blob(push);
590 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
591 talloc_free(r);
592 return false;
595 talloc_free(r);
597 return true;
600 static bool api_dssetup_DsRoleServerSaveStateForUpgrade(pipes_struct *p)
602 const struct ndr_interface_call *call;
603 struct ndr_pull *pull;
604 struct ndr_push *push;
605 enum ndr_err_code ndr_err;
606 DATA_BLOB blob;
607 struct dssetup_DsRoleServerSaveStateForUpgrade *r;
609 call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLESERVERSAVESTATEFORUPGRADE];
611 r = talloc(talloc_tos(), struct dssetup_DsRoleServerSaveStateForUpgrade);
612 if (r == NULL) {
613 return false;
616 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
617 talloc_free(r);
618 return false;
621 pull = ndr_pull_init_blob(&blob, r, NULL);
622 if (pull == NULL) {
623 talloc_free(r);
624 return false;
627 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
628 ndr_err = call->ndr_pull(pull, NDR_IN, r);
629 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
630 talloc_free(r);
631 return false;
634 if (DEBUGLEVEL >= 10) {
635 NDR_PRINT_IN_DEBUG(dssetup_DsRoleServerSaveStateForUpgrade, r);
638 r->out.result = _dssetup_DsRoleServerSaveStateForUpgrade(p, r);
640 if (p->rng_fault_state) {
641 talloc_free(r);
642 /* Return true here, srv_pipe_hnd.c will take care */
643 return true;
646 if (DEBUGLEVEL >= 10) {
647 NDR_PRINT_OUT_DEBUG(dssetup_DsRoleServerSaveStateForUpgrade, r);
650 push = ndr_push_init_ctx(r, NULL);
651 if (push == NULL) {
652 talloc_free(r);
653 return false;
656 ndr_err = call->ndr_push(push, NDR_OUT, r);
657 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
658 talloc_free(r);
659 return false;
662 blob = ndr_push_blob(push);
663 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
664 talloc_free(r);
665 return false;
668 talloc_free(r);
670 return true;
673 static bool api_dssetup_DsRoleUpgradeDownlevelServer(pipes_struct *p)
675 const struct ndr_interface_call *call;
676 struct ndr_pull *pull;
677 struct ndr_push *push;
678 enum ndr_err_code ndr_err;
679 DATA_BLOB blob;
680 struct dssetup_DsRoleUpgradeDownlevelServer *r;
682 call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLEUPGRADEDOWNLEVELSERVER];
684 r = talloc(talloc_tos(), struct dssetup_DsRoleUpgradeDownlevelServer);
685 if (r == NULL) {
686 return false;
689 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
690 talloc_free(r);
691 return false;
694 pull = ndr_pull_init_blob(&blob, r, NULL);
695 if (pull == NULL) {
696 talloc_free(r);
697 return false;
700 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
701 ndr_err = call->ndr_pull(pull, NDR_IN, r);
702 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
703 talloc_free(r);
704 return false;
707 if (DEBUGLEVEL >= 10) {
708 NDR_PRINT_IN_DEBUG(dssetup_DsRoleUpgradeDownlevelServer, r);
711 r->out.result = _dssetup_DsRoleUpgradeDownlevelServer(p, r);
713 if (p->rng_fault_state) {
714 talloc_free(r);
715 /* Return true here, srv_pipe_hnd.c will take care */
716 return true;
719 if (DEBUGLEVEL >= 10) {
720 NDR_PRINT_OUT_DEBUG(dssetup_DsRoleUpgradeDownlevelServer, r);
723 push = ndr_push_init_ctx(r, NULL);
724 if (push == NULL) {
725 talloc_free(r);
726 return false;
729 ndr_err = call->ndr_push(push, NDR_OUT, r);
730 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
731 talloc_free(r);
732 return false;
735 blob = ndr_push_blob(push);
736 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
737 talloc_free(r);
738 return false;
741 talloc_free(r);
743 return true;
746 static bool api_dssetup_DsRoleAbortDownlevelServerUpgrade(pipes_struct *p)
748 const struct ndr_interface_call *call;
749 struct ndr_pull *pull;
750 struct ndr_push *push;
751 enum ndr_err_code ndr_err;
752 DATA_BLOB blob;
753 struct dssetup_DsRoleAbortDownlevelServerUpgrade *r;
755 call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLEABORTDOWNLEVELSERVERUPGRADE];
757 r = talloc(talloc_tos(), struct dssetup_DsRoleAbortDownlevelServerUpgrade);
758 if (r == NULL) {
759 return false;
762 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
763 talloc_free(r);
764 return false;
767 pull = ndr_pull_init_blob(&blob, r, NULL);
768 if (pull == NULL) {
769 talloc_free(r);
770 return false;
773 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
774 ndr_err = call->ndr_pull(pull, NDR_IN, r);
775 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
776 talloc_free(r);
777 return false;
780 if (DEBUGLEVEL >= 10) {
781 NDR_PRINT_IN_DEBUG(dssetup_DsRoleAbortDownlevelServerUpgrade, r);
784 r->out.result = _dssetup_DsRoleAbortDownlevelServerUpgrade(p, r);
786 if (p->rng_fault_state) {
787 talloc_free(r);
788 /* Return true here, srv_pipe_hnd.c will take care */
789 return true;
792 if (DEBUGLEVEL >= 10) {
793 NDR_PRINT_OUT_DEBUG(dssetup_DsRoleAbortDownlevelServerUpgrade, r);
796 push = ndr_push_init_ctx(r, NULL);
797 if (push == NULL) {
798 talloc_free(r);
799 return false;
802 ndr_err = call->ndr_push(push, NDR_OUT, r);
803 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
804 talloc_free(r);
805 return false;
808 blob = ndr_push_blob(push);
809 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
810 talloc_free(r);
811 return false;
814 talloc_free(r);
816 return true;
820 /* Tables */
821 static struct api_struct api_dssetup_cmds[] =
823 {"DSSETUP_DSROLEGETPRIMARYDOMAININFORMATION", NDR_DSSETUP_DSROLEGETPRIMARYDOMAININFORMATION, api_dssetup_DsRoleGetPrimaryDomainInformation},
824 {"DSSETUP_DSROLEDNSNAMETOFLATNAME", NDR_DSSETUP_DSROLEDNSNAMETOFLATNAME, api_dssetup_DsRoleDnsNameToFlatName},
825 {"DSSETUP_DSROLEDCASDC", NDR_DSSETUP_DSROLEDCASDC, api_dssetup_DsRoleDcAsDc},
826 {"DSSETUP_DSROLEDCASREPLICA", NDR_DSSETUP_DSROLEDCASREPLICA, api_dssetup_DsRoleDcAsReplica},
827 {"DSSETUP_DSROLEDEMOTEDC", NDR_DSSETUP_DSROLEDEMOTEDC, api_dssetup_DsRoleDemoteDc},
828 {"DSSETUP_DSROLEGETDCOPERATIONPROGRESS", NDR_DSSETUP_DSROLEGETDCOPERATIONPROGRESS, api_dssetup_DsRoleGetDcOperationProgress},
829 {"DSSETUP_DSROLEGETDCOPERATIONRESULTS", NDR_DSSETUP_DSROLEGETDCOPERATIONRESULTS, api_dssetup_DsRoleGetDcOperationResults},
830 {"DSSETUP_DSROLECANCEL", NDR_DSSETUP_DSROLECANCEL, api_dssetup_DsRoleCancel},
831 {"DSSETUP_DSROLESERVERSAVESTATEFORUPGRADE", NDR_DSSETUP_DSROLESERVERSAVESTATEFORUPGRADE, api_dssetup_DsRoleServerSaveStateForUpgrade},
832 {"DSSETUP_DSROLEUPGRADEDOWNLEVELSERVER", NDR_DSSETUP_DSROLEUPGRADEDOWNLEVELSERVER, api_dssetup_DsRoleUpgradeDownlevelServer},
833 {"DSSETUP_DSROLEABORTDOWNLEVELSERVERUPGRADE", NDR_DSSETUP_DSROLEABORTDOWNLEVELSERVERUPGRADE, api_dssetup_DsRoleAbortDownlevelServerUpgrade},
836 void dssetup_get_pipe_fns(struct api_struct **fns, int *n_fns)
838 *fns = api_dssetup_cmds;
839 *n_fns = sizeof(api_dssetup_cmds) / sizeof(struct api_struct);
842 NTSTATUS rpc_dssetup_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const struct ndr_interface_table *table, uint32_t opnum, void *_r)
844 if (cli->pipes_struct == NULL) {
845 return NT_STATUS_INVALID_PARAMETER;
848 switch (opnum)
850 case NDR_DSSETUP_DSROLEGETPRIMARYDOMAININFORMATION: {
851 struct dssetup_DsRoleGetPrimaryDomainInformation *r = (struct dssetup_DsRoleGetPrimaryDomainInformation *)_r;
852 ZERO_STRUCT(r->out);
853 r->out.info = talloc_zero(mem_ctx, union dssetup_DsRoleInfo);
854 if (r->out.info == NULL) {
855 return NT_STATUS_NO_MEMORY;
858 r->out.result = _dssetup_DsRoleGetPrimaryDomainInformation(cli->pipes_struct, r);
859 return NT_STATUS_OK;
862 case NDR_DSSETUP_DSROLEDNSNAMETOFLATNAME: {
863 struct dssetup_DsRoleDnsNameToFlatName *r = (struct dssetup_DsRoleDnsNameToFlatName *)_r;
864 r->out.result = _dssetup_DsRoleDnsNameToFlatName(cli->pipes_struct, r);
865 return NT_STATUS_OK;
868 case NDR_DSSETUP_DSROLEDCASDC: {
869 struct dssetup_DsRoleDcAsDc *r = (struct dssetup_DsRoleDcAsDc *)_r;
870 r->out.result = _dssetup_DsRoleDcAsDc(cli->pipes_struct, r);
871 return NT_STATUS_OK;
874 case NDR_DSSETUP_DSROLEDCASREPLICA: {
875 struct dssetup_DsRoleDcAsReplica *r = (struct dssetup_DsRoleDcAsReplica *)_r;
876 r->out.result = _dssetup_DsRoleDcAsReplica(cli->pipes_struct, r);
877 return NT_STATUS_OK;
880 case NDR_DSSETUP_DSROLEDEMOTEDC: {
881 struct dssetup_DsRoleDemoteDc *r = (struct dssetup_DsRoleDemoteDc *)_r;
882 r->out.result = _dssetup_DsRoleDemoteDc(cli->pipes_struct, r);
883 return NT_STATUS_OK;
886 case NDR_DSSETUP_DSROLEGETDCOPERATIONPROGRESS: {
887 struct dssetup_DsRoleGetDcOperationProgress *r = (struct dssetup_DsRoleGetDcOperationProgress *)_r;
888 r->out.result = _dssetup_DsRoleGetDcOperationProgress(cli->pipes_struct, r);
889 return NT_STATUS_OK;
892 case NDR_DSSETUP_DSROLEGETDCOPERATIONRESULTS: {
893 struct dssetup_DsRoleGetDcOperationResults *r = (struct dssetup_DsRoleGetDcOperationResults *)_r;
894 r->out.result = _dssetup_DsRoleGetDcOperationResults(cli->pipes_struct, r);
895 return NT_STATUS_OK;
898 case NDR_DSSETUP_DSROLECANCEL: {
899 struct dssetup_DsRoleCancel *r = (struct dssetup_DsRoleCancel *)_r;
900 r->out.result = _dssetup_DsRoleCancel(cli->pipes_struct, r);
901 return NT_STATUS_OK;
904 case NDR_DSSETUP_DSROLESERVERSAVESTATEFORUPGRADE: {
905 struct dssetup_DsRoleServerSaveStateForUpgrade *r = (struct dssetup_DsRoleServerSaveStateForUpgrade *)_r;
906 r->out.result = _dssetup_DsRoleServerSaveStateForUpgrade(cli->pipes_struct, r);
907 return NT_STATUS_OK;
910 case NDR_DSSETUP_DSROLEUPGRADEDOWNLEVELSERVER: {
911 struct dssetup_DsRoleUpgradeDownlevelServer *r = (struct dssetup_DsRoleUpgradeDownlevelServer *)_r;
912 r->out.result = _dssetup_DsRoleUpgradeDownlevelServer(cli->pipes_struct, r);
913 return NT_STATUS_OK;
916 case NDR_DSSETUP_DSROLEABORTDOWNLEVELSERVERUPGRADE: {
917 struct dssetup_DsRoleAbortDownlevelServerUpgrade *r = (struct dssetup_DsRoleAbortDownlevelServerUpgrade *)_r;
918 r->out.result = _dssetup_DsRoleAbortDownlevelServerUpgrade(cli->pipes_struct, r);
919 return NT_STATUS_OK;
922 default:
923 return NT_STATUS_NOT_IMPLEMENTED;
927 NTSTATUS rpc_dssetup_init(void)
929 return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "dssetup", "dssetup", &ndr_table_dssetup, api_dssetup_cmds, sizeof(api_dssetup_cmds) / sizeof(struct api_struct));