WHATSNEW: Update release notes.
[Samba/bb.git] / librpc / gen_ndr / srv_netlogon.c
blobbe92d4a4dd2b8c039d5c04768a679ed6f6e23932
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_netlogon.h"
9 static bool api_netr_LogonUasLogon(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 netr_LogonUasLogon *r;
18 call = &ndr_table_netlogon.calls[NDR_NETR_LOGONUASLOGON];
20 r = talloc(talloc_tos(), struct netr_LogonUasLogon);
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(netr_LogonUasLogon, r);
47 ZERO_STRUCT(r->out);
48 r->out.info = talloc_zero(r, struct netr_UasInfo *);
49 if (r->out.info == NULL) {
50 talloc_free(r);
51 return false;
54 r->out.result = _netr_LogonUasLogon(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(netr_LogonUasLogon, 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_netr_LogonUasLogoff(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 netr_LogonUasLogoff *r;
98 call = &ndr_table_netlogon.calls[NDR_NETR_LOGONUASLOGOFF];
100 r = talloc(talloc_tos(), struct netr_LogonUasLogoff);
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(netr_LogonUasLogoff, r);
127 ZERO_STRUCT(r->out);
128 r->out.info = talloc_zero(r, struct netr_UasLogoffInfo);
129 if (r->out.info == NULL) {
130 talloc_free(r);
131 return false;
134 r->out.result = _netr_LogonUasLogoff(p, r);
136 if (p->rng_fault_state) {
137 talloc_free(r);
138 /* Return true here, srv_pipe_hnd.c will take care */
139 return true;
142 if (DEBUGLEVEL >= 10) {
143 NDR_PRINT_OUT_DEBUG(netr_LogonUasLogoff, r);
146 push = ndr_push_init_ctx(r, NULL);
147 if (push == NULL) {
148 talloc_free(r);
149 return false;
152 ndr_err = call->ndr_push(push, NDR_OUT, r);
153 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
154 talloc_free(r);
155 return false;
158 blob = ndr_push_blob(push);
159 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
160 talloc_free(r);
161 return false;
164 talloc_free(r);
166 return true;
169 static bool api_netr_LogonSamLogon(pipes_struct *p)
171 const struct ndr_interface_call *call;
172 struct ndr_pull *pull;
173 struct ndr_push *push;
174 enum ndr_err_code ndr_err;
175 DATA_BLOB blob;
176 struct netr_LogonSamLogon *r;
178 call = &ndr_table_netlogon.calls[NDR_NETR_LOGONSAMLOGON];
180 r = talloc(talloc_tos(), struct netr_LogonSamLogon);
181 if (r == NULL) {
182 return false;
185 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
186 talloc_free(r);
187 return false;
190 pull = ndr_pull_init_blob(&blob, r, NULL);
191 if (pull == NULL) {
192 talloc_free(r);
193 return false;
196 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
197 ndr_err = call->ndr_pull(pull, NDR_IN, r);
198 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
199 talloc_free(r);
200 return false;
203 if (DEBUGLEVEL >= 10) {
204 NDR_PRINT_IN_DEBUG(netr_LogonSamLogon, r);
207 ZERO_STRUCT(r->out);
208 r->out.return_authenticator = r->in.return_authenticator;
209 r->out.validation = talloc_zero(r, union netr_Validation);
210 if (r->out.validation == NULL) {
211 talloc_free(r);
212 return false;
215 r->out.authoritative = talloc_zero(r, uint8_t);
216 if (r->out.authoritative == NULL) {
217 talloc_free(r);
218 return false;
221 r->out.result = _netr_LogonSamLogon(p, r);
223 if (p->rng_fault_state) {
224 talloc_free(r);
225 /* Return true here, srv_pipe_hnd.c will take care */
226 return true;
229 if (DEBUGLEVEL >= 10) {
230 NDR_PRINT_OUT_DEBUG(netr_LogonSamLogon, r);
233 push = ndr_push_init_ctx(r, NULL);
234 if (push == NULL) {
235 talloc_free(r);
236 return false;
239 ndr_err = call->ndr_push(push, NDR_OUT, r);
240 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
241 talloc_free(r);
242 return false;
245 blob = ndr_push_blob(push);
246 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
247 talloc_free(r);
248 return false;
251 talloc_free(r);
253 return true;
256 static bool api_netr_LogonSamLogoff(pipes_struct *p)
258 const struct ndr_interface_call *call;
259 struct ndr_pull *pull;
260 struct ndr_push *push;
261 enum ndr_err_code ndr_err;
262 DATA_BLOB blob;
263 struct netr_LogonSamLogoff *r;
265 call = &ndr_table_netlogon.calls[NDR_NETR_LOGONSAMLOGOFF];
267 r = talloc(talloc_tos(), struct netr_LogonSamLogoff);
268 if (r == NULL) {
269 return false;
272 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
273 talloc_free(r);
274 return false;
277 pull = ndr_pull_init_blob(&blob, r, NULL);
278 if (pull == NULL) {
279 talloc_free(r);
280 return false;
283 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
284 ndr_err = call->ndr_pull(pull, NDR_IN, r);
285 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
286 talloc_free(r);
287 return false;
290 if (DEBUGLEVEL >= 10) {
291 NDR_PRINT_IN_DEBUG(netr_LogonSamLogoff, r);
294 ZERO_STRUCT(r->out);
295 r->out.return_authenticator = r->in.return_authenticator;
296 r->out.result = _netr_LogonSamLogoff(p, r);
298 if (p->rng_fault_state) {
299 talloc_free(r);
300 /* Return true here, srv_pipe_hnd.c will take care */
301 return true;
304 if (DEBUGLEVEL >= 10) {
305 NDR_PRINT_OUT_DEBUG(netr_LogonSamLogoff, r);
308 push = ndr_push_init_ctx(r, NULL);
309 if (push == NULL) {
310 talloc_free(r);
311 return false;
314 ndr_err = call->ndr_push(push, NDR_OUT, r);
315 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
316 talloc_free(r);
317 return false;
320 blob = ndr_push_blob(push);
321 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
322 talloc_free(r);
323 return false;
326 talloc_free(r);
328 return true;
331 static bool api_netr_ServerReqChallenge(pipes_struct *p)
333 const struct ndr_interface_call *call;
334 struct ndr_pull *pull;
335 struct ndr_push *push;
336 enum ndr_err_code ndr_err;
337 DATA_BLOB blob;
338 struct netr_ServerReqChallenge *r;
340 call = &ndr_table_netlogon.calls[NDR_NETR_SERVERREQCHALLENGE];
342 r = talloc(talloc_tos(), struct netr_ServerReqChallenge);
343 if (r == NULL) {
344 return false;
347 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
348 talloc_free(r);
349 return false;
352 pull = ndr_pull_init_blob(&blob, r, NULL);
353 if (pull == NULL) {
354 talloc_free(r);
355 return false;
358 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
359 ndr_err = call->ndr_pull(pull, NDR_IN, r);
360 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
361 talloc_free(r);
362 return false;
365 if (DEBUGLEVEL >= 10) {
366 NDR_PRINT_IN_DEBUG(netr_ServerReqChallenge, r);
369 ZERO_STRUCT(r->out);
370 r->out.return_credentials = talloc_zero(r, struct netr_Credential);
371 if (r->out.return_credentials == NULL) {
372 talloc_free(r);
373 return false;
376 r->out.result = _netr_ServerReqChallenge(p, r);
378 if (p->rng_fault_state) {
379 talloc_free(r);
380 /* Return true here, srv_pipe_hnd.c will take care */
381 return true;
384 if (DEBUGLEVEL >= 10) {
385 NDR_PRINT_OUT_DEBUG(netr_ServerReqChallenge, r);
388 push = ndr_push_init_ctx(r, NULL);
389 if (push == NULL) {
390 talloc_free(r);
391 return false;
394 ndr_err = call->ndr_push(push, NDR_OUT, r);
395 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
396 talloc_free(r);
397 return false;
400 blob = ndr_push_blob(push);
401 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
402 talloc_free(r);
403 return false;
406 talloc_free(r);
408 return true;
411 static bool api_netr_ServerAuthenticate(pipes_struct *p)
413 const struct ndr_interface_call *call;
414 struct ndr_pull *pull;
415 struct ndr_push *push;
416 enum ndr_err_code ndr_err;
417 DATA_BLOB blob;
418 struct netr_ServerAuthenticate *r;
420 call = &ndr_table_netlogon.calls[NDR_NETR_SERVERAUTHENTICATE];
422 r = talloc(talloc_tos(), struct netr_ServerAuthenticate);
423 if (r == NULL) {
424 return false;
427 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
428 talloc_free(r);
429 return false;
432 pull = ndr_pull_init_blob(&blob, r, NULL);
433 if (pull == NULL) {
434 talloc_free(r);
435 return false;
438 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
439 ndr_err = call->ndr_pull(pull, NDR_IN, r);
440 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
441 talloc_free(r);
442 return false;
445 if (DEBUGLEVEL >= 10) {
446 NDR_PRINT_IN_DEBUG(netr_ServerAuthenticate, r);
449 ZERO_STRUCT(r->out);
450 r->out.return_credentials = talloc_zero(r, struct netr_Credential);
451 if (r->out.return_credentials == NULL) {
452 talloc_free(r);
453 return false;
456 r->out.result = _netr_ServerAuthenticate(p, r);
458 if (p->rng_fault_state) {
459 talloc_free(r);
460 /* Return true here, srv_pipe_hnd.c will take care */
461 return true;
464 if (DEBUGLEVEL >= 10) {
465 NDR_PRINT_OUT_DEBUG(netr_ServerAuthenticate, r);
468 push = ndr_push_init_ctx(r, NULL);
469 if (push == NULL) {
470 talloc_free(r);
471 return false;
474 ndr_err = call->ndr_push(push, NDR_OUT, r);
475 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
476 talloc_free(r);
477 return false;
480 blob = ndr_push_blob(push);
481 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
482 talloc_free(r);
483 return false;
486 talloc_free(r);
488 return true;
491 static bool api_netr_ServerPasswordSet(pipes_struct *p)
493 const struct ndr_interface_call *call;
494 struct ndr_pull *pull;
495 struct ndr_push *push;
496 enum ndr_err_code ndr_err;
497 DATA_BLOB blob;
498 struct netr_ServerPasswordSet *r;
500 call = &ndr_table_netlogon.calls[NDR_NETR_SERVERPASSWORDSET];
502 r = talloc(talloc_tos(), struct netr_ServerPasswordSet);
503 if (r == NULL) {
504 return false;
507 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
508 talloc_free(r);
509 return false;
512 pull = ndr_pull_init_blob(&blob, r, NULL);
513 if (pull == NULL) {
514 talloc_free(r);
515 return false;
518 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
519 ndr_err = call->ndr_pull(pull, NDR_IN, r);
520 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
521 talloc_free(r);
522 return false;
525 if (DEBUGLEVEL >= 10) {
526 NDR_PRINT_IN_DEBUG(netr_ServerPasswordSet, r);
529 ZERO_STRUCT(r->out);
530 r->out.return_authenticator = talloc_zero(r, struct netr_Authenticator);
531 if (r->out.return_authenticator == NULL) {
532 talloc_free(r);
533 return false;
536 r->out.result = _netr_ServerPasswordSet(p, r);
538 if (p->rng_fault_state) {
539 talloc_free(r);
540 /* Return true here, srv_pipe_hnd.c will take care */
541 return true;
544 if (DEBUGLEVEL >= 10) {
545 NDR_PRINT_OUT_DEBUG(netr_ServerPasswordSet, r);
548 push = ndr_push_init_ctx(r, NULL);
549 if (push == NULL) {
550 talloc_free(r);
551 return false;
554 ndr_err = call->ndr_push(push, NDR_OUT, r);
555 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
556 talloc_free(r);
557 return false;
560 blob = ndr_push_blob(push);
561 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
562 talloc_free(r);
563 return false;
566 talloc_free(r);
568 return true;
571 static bool api_netr_DatabaseDeltas(pipes_struct *p)
573 const struct ndr_interface_call *call;
574 struct ndr_pull *pull;
575 struct ndr_push *push;
576 enum ndr_err_code ndr_err;
577 DATA_BLOB blob;
578 struct netr_DatabaseDeltas *r;
580 call = &ndr_table_netlogon.calls[NDR_NETR_DATABASEDELTAS];
582 r = talloc(talloc_tos(), struct netr_DatabaseDeltas);
583 if (r == NULL) {
584 return false;
587 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
588 talloc_free(r);
589 return false;
592 pull = ndr_pull_init_blob(&blob, r, NULL);
593 if (pull == NULL) {
594 talloc_free(r);
595 return false;
598 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
599 ndr_err = call->ndr_pull(pull, NDR_IN, r);
600 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
601 talloc_free(r);
602 return false;
605 if (DEBUGLEVEL >= 10) {
606 NDR_PRINT_IN_DEBUG(netr_DatabaseDeltas, r);
609 ZERO_STRUCT(r->out);
610 r->out.return_authenticator = r->in.return_authenticator;
611 r->out.sequence_num = r->in.sequence_num;
612 r->out.delta_enum_array = talloc_zero(r, struct netr_DELTA_ENUM_ARRAY *);
613 if (r->out.delta_enum_array == NULL) {
614 talloc_free(r);
615 return false;
618 r->out.result = _netr_DatabaseDeltas(p, r);
620 if (p->rng_fault_state) {
621 talloc_free(r);
622 /* Return true here, srv_pipe_hnd.c will take care */
623 return true;
626 if (DEBUGLEVEL >= 10) {
627 NDR_PRINT_OUT_DEBUG(netr_DatabaseDeltas, r);
630 push = ndr_push_init_ctx(r, NULL);
631 if (push == NULL) {
632 talloc_free(r);
633 return false;
636 ndr_err = call->ndr_push(push, NDR_OUT, r);
637 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
638 talloc_free(r);
639 return false;
642 blob = ndr_push_blob(push);
643 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
644 talloc_free(r);
645 return false;
648 talloc_free(r);
650 return true;
653 static bool api_netr_DatabaseSync(pipes_struct *p)
655 const struct ndr_interface_call *call;
656 struct ndr_pull *pull;
657 struct ndr_push *push;
658 enum ndr_err_code ndr_err;
659 DATA_BLOB blob;
660 struct netr_DatabaseSync *r;
662 call = &ndr_table_netlogon.calls[NDR_NETR_DATABASESYNC];
664 r = talloc(talloc_tos(), struct netr_DatabaseSync);
665 if (r == NULL) {
666 return false;
669 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
670 talloc_free(r);
671 return false;
674 pull = ndr_pull_init_blob(&blob, r, NULL);
675 if (pull == NULL) {
676 talloc_free(r);
677 return false;
680 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
681 ndr_err = call->ndr_pull(pull, NDR_IN, r);
682 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
683 talloc_free(r);
684 return false;
687 if (DEBUGLEVEL >= 10) {
688 NDR_PRINT_IN_DEBUG(netr_DatabaseSync, r);
691 ZERO_STRUCT(r->out);
692 r->out.return_authenticator = r->in.return_authenticator;
693 r->out.sync_context = r->in.sync_context;
694 r->out.delta_enum_array = talloc_zero(r, struct netr_DELTA_ENUM_ARRAY *);
695 if (r->out.delta_enum_array == NULL) {
696 talloc_free(r);
697 return false;
700 r->out.result = _netr_DatabaseSync(p, r);
702 if (p->rng_fault_state) {
703 talloc_free(r);
704 /* Return true here, srv_pipe_hnd.c will take care */
705 return true;
708 if (DEBUGLEVEL >= 10) {
709 NDR_PRINT_OUT_DEBUG(netr_DatabaseSync, r);
712 push = ndr_push_init_ctx(r, NULL);
713 if (push == NULL) {
714 talloc_free(r);
715 return false;
718 ndr_err = call->ndr_push(push, NDR_OUT, r);
719 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
720 talloc_free(r);
721 return false;
724 blob = ndr_push_blob(push);
725 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
726 talloc_free(r);
727 return false;
730 talloc_free(r);
732 return true;
735 static bool api_netr_AccountDeltas(pipes_struct *p)
737 const struct ndr_interface_call *call;
738 struct ndr_pull *pull;
739 struct ndr_push *push;
740 enum ndr_err_code ndr_err;
741 DATA_BLOB blob;
742 struct netr_AccountDeltas *r;
744 call = &ndr_table_netlogon.calls[NDR_NETR_ACCOUNTDELTAS];
746 r = talloc(talloc_tos(), struct netr_AccountDeltas);
747 if (r == NULL) {
748 return false;
751 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
752 talloc_free(r);
753 return false;
756 pull = ndr_pull_init_blob(&blob, r, NULL);
757 if (pull == NULL) {
758 talloc_free(r);
759 return false;
762 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
763 ndr_err = call->ndr_pull(pull, NDR_IN, r);
764 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
765 talloc_free(r);
766 return false;
769 if (DEBUGLEVEL >= 10) {
770 NDR_PRINT_IN_DEBUG(netr_AccountDeltas, r);
773 ZERO_STRUCT(r->out);
774 r->out.return_authenticator = r->in.return_authenticator;
775 r->out.buffer = talloc_zero(r, struct netr_AccountBuffer);
776 if (r->out.buffer == NULL) {
777 talloc_free(r);
778 return false;
781 r->out.count_returned = talloc_zero(r, uint32_t);
782 if (r->out.count_returned == NULL) {
783 talloc_free(r);
784 return false;
787 r->out.total_entries = talloc_zero(r, uint32_t);
788 if (r->out.total_entries == NULL) {
789 talloc_free(r);
790 return false;
793 r->out.recordid = talloc_zero(r, struct netr_UAS_INFO_0);
794 if (r->out.recordid == NULL) {
795 talloc_free(r);
796 return false;
799 r->out.result = _netr_AccountDeltas(p, r);
801 if (p->rng_fault_state) {
802 talloc_free(r);
803 /* Return true here, srv_pipe_hnd.c will take care */
804 return true;
807 if (DEBUGLEVEL >= 10) {
808 NDR_PRINT_OUT_DEBUG(netr_AccountDeltas, r);
811 push = ndr_push_init_ctx(r, NULL);
812 if (push == NULL) {
813 talloc_free(r);
814 return false;
817 ndr_err = call->ndr_push(push, NDR_OUT, r);
818 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
819 talloc_free(r);
820 return false;
823 blob = ndr_push_blob(push);
824 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
825 talloc_free(r);
826 return false;
829 talloc_free(r);
831 return true;
834 static bool api_netr_AccountSync(pipes_struct *p)
836 const struct ndr_interface_call *call;
837 struct ndr_pull *pull;
838 struct ndr_push *push;
839 enum ndr_err_code ndr_err;
840 DATA_BLOB blob;
841 struct netr_AccountSync *r;
843 call = &ndr_table_netlogon.calls[NDR_NETR_ACCOUNTSYNC];
845 r = talloc(talloc_tos(), struct netr_AccountSync);
846 if (r == NULL) {
847 return false;
850 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
851 talloc_free(r);
852 return false;
855 pull = ndr_pull_init_blob(&blob, r, NULL);
856 if (pull == NULL) {
857 talloc_free(r);
858 return false;
861 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
862 ndr_err = call->ndr_pull(pull, NDR_IN, r);
863 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
864 talloc_free(r);
865 return false;
868 if (DEBUGLEVEL >= 10) {
869 NDR_PRINT_IN_DEBUG(netr_AccountSync, r);
872 ZERO_STRUCT(r->out);
873 r->out.return_authenticator = r->in.return_authenticator;
874 r->out.recordid = r->in.recordid;
875 r->out.buffer = talloc_zero(r, struct netr_AccountBuffer);
876 if (r->out.buffer == NULL) {
877 talloc_free(r);
878 return false;
881 r->out.count_returned = talloc_zero(r, uint32_t);
882 if (r->out.count_returned == NULL) {
883 talloc_free(r);
884 return false;
887 r->out.total_entries = talloc_zero(r, uint32_t);
888 if (r->out.total_entries == NULL) {
889 talloc_free(r);
890 return false;
893 r->out.next_reference = talloc_zero(r, uint32_t);
894 if (r->out.next_reference == NULL) {
895 talloc_free(r);
896 return false;
899 r->out.result = _netr_AccountSync(p, r);
901 if (p->rng_fault_state) {
902 talloc_free(r);
903 /* Return true here, srv_pipe_hnd.c will take care */
904 return true;
907 if (DEBUGLEVEL >= 10) {
908 NDR_PRINT_OUT_DEBUG(netr_AccountSync, r);
911 push = ndr_push_init_ctx(r, NULL);
912 if (push == NULL) {
913 talloc_free(r);
914 return false;
917 ndr_err = call->ndr_push(push, NDR_OUT, r);
918 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
919 talloc_free(r);
920 return false;
923 blob = ndr_push_blob(push);
924 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
925 talloc_free(r);
926 return false;
929 talloc_free(r);
931 return true;
934 static bool api_netr_GetDcName(pipes_struct *p)
936 const struct ndr_interface_call *call;
937 struct ndr_pull *pull;
938 struct ndr_push *push;
939 enum ndr_err_code ndr_err;
940 DATA_BLOB blob;
941 struct netr_GetDcName *r;
943 call = &ndr_table_netlogon.calls[NDR_NETR_GETDCNAME];
945 r = talloc(talloc_tos(), struct netr_GetDcName);
946 if (r == NULL) {
947 return false;
950 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
951 talloc_free(r);
952 return false;
955 pull = ndr_pull_init_blob(&blob, r, NULL);
956 if (pull == NULL) {
957 talloc_free(r);
958 return false;
961 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
962 ndr_err = call->ndr_pull(pull, NDR_IN, r);
963 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
964 talloc_free(r);
965 return false;
968 if (DEBUGLEVEL >= 10) {
969 NDR_PRINT_IN_DEBUG(netr_GetDcName, r);
972 ZERO_STRUCT(r->out);
973 r->out.dcname = talloc_zero(r, const char *);
974 if (r->out.dcname == NULL) {
975 talloc_free(r);
976 return false;
979 r->out.result = _netr_GetDcName(p, r);
981 if (p->rng_fault_state) {
982 talloc_free(r);
983 /* Return true here, srv_pipe_hnd.c will take care */
984 return true;
987 if (DEBUGLEVEL >= 10) {
988 NDR_PRINT_OUT_DEBUG(netr_GetDcName, r);
991 push = ndr_push_init_ctx(r, NULL);
992 if (push == NULL) {
993 talloc_free(r);
994 return false;
997 ndr_err = call->ndr_push(push, NDR_OUT, r);
998 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
999 talloc_free(r);
1000 return false;
1003 blob = ndr_push_blob(push);
1004 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1005 talloc_free(r);
1006 return false;
1009 talloc_free(r);
1011 return true;
1014 static bool api_netr_LogonControl(pipes_struct *p)
1016 const struct ndr_interface_call *call;
1017 struct ndr_pull *pull;
1018 struct ndr_push *push;
1019 enum ndr_err_code ndr_err;
1020 DATA_BLOB blob;
1021 struct netr_LogonControl *r;
1023 call = &ndr_table_netlogon.calls[NDR_NETR_LOGONCONTROL];
1025 r = talloc(talloc_tos(), struct netr_LogonControl);
1026 if (r == NULL) {
1027 return false;
1030 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1031 talloc_free(r);
1032 return false;
1035 pull = ndr_pull_init_blob(&blob, r, NULL);
1036 if (pull == NULL) {
1037 talloc_free(r);
1038 return false;
1041 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1042 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1043 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1044 talloc_free(r);
1045 return false;
1048 if (DEBUGLEVEL >= 10) {
1049 NDR_PRINT_IN_DEBUG(netr_LogonControl, r);
1052 ZERO_STRUCT(r->out);
1053 r->out.query = talloc_zero(r, union netr_CONTROL_QUERY_INFORMATION);
1054 if (r->out.query == NULL) {
1055 talloc_free(r);
1056 return false;
1059 r->out.result = _netr_LogonControl(p, r);
1061 if (p->rng_fault_state) {
1062 talloc_free(r);
1063 /* Return true here, srv_pipe_hnd.c will take care */
1064 return true;
1067 if (DEBUGLEVEL >= 10) {
1068 NDR_PRINT_OUT_DEBUG(netr_LogonControl, r);
1071 push = ndr_push_init_ctx(r, NULL);
1072 if (push == NULL) {
1073 talloc_free(r);
1074 return false;
1077 ndr_err = call->ndr_push(push, NDR_OUT, r);
1078 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1079 talloc_free(r);
1080 return false;
1083 blob = ndr_push_blob(push);
1084 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1085 talloc_free(r);
1086 return false;
1089 talloc_free(r);
1091 return true;
1094 static bool api_netr_GetAnyDCName(pipes_struct *p)
1096 const struct ndr_interface_call *call;
1097 struct ndr_pull *pull;
1098 struct ndr_push *push;
1099 enum ndr_err_code ndr_err;
1100 DATA_BLOB blob;
1101 struct netr_GetAnyDCName *r;
1103 call = &ndr_table_netlogon.calls[NDR_NETR_GETANYDCNAME];
1105 r = talloc(talloc_tos(), struct netr_GetAnyDCName);
1106 if (r == NULL) {
1107 return false;
1110 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1111 talloc_free(r);
1112 return false;
1115 pull = ndr_pull_init_blob(&blob, r, NULL);
1116 if (pull == NULL) {
1117 talloc_free(r);
1118 return false;
1121 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1122 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1123 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1124 talloc_free(r);
1125 return false;
1128 if (DEBUGLEVEL >= 10) {
1129 NDR_PRINT_IN_DEBUG(netr_GetAnyDCName, r);
1132 ZERO_STRUCT(r->out);
1133 r->out.dcname = talloc_zero(r, const char *);
1134 if (r->out.dcname == NULL) {
1135 talloc_free(r);
1136 return false;
1139 r->out.result = _netr_GetAnyDCName(p, r);
1141 if (p->rng_fault_state) {
1142 talloc_free(r);
1143 /* Return true here, srv_pipe_hnd.c will take care */
1144 return true;
1147 if (DEBUGLEVEL >= 10) {
1148 NDR_PRINT_OUT_DEBUG(netr_GetAnyDCName, r);
1151 push = ndr_push_init_ctx(r, NULL);
1152 if (push == NULL) {
1153 talloc_free(r);
1154 return false;
1157 ndr_err = call->ndr_push(push, NDR_OUT, r);
1158 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1159 talloc_free(r);
1160 return false;
1163 blob = ndr_push_blob(push);
1164 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1165 talloc_free(r);
1166 return false;
1169 talloc_free(r);
1171 return true;
1174 static bool api_netr_LogonControl2(pipes_struct *p)
1176 const struct ndr_interface_call *call;
1177 struct ndr_pull *pull;
1178 struct ndr_push *push;
1179 enum ndr_err_code ndr_err;
1180 DATA_BLOB blob;
1181 struct netr_LogonControl2 *r;
1183 call = &ndr_table_netlogon.calls[NDR_NETR_LOGONCONTROL2];
1185 r = talloc(talloc_tos(), struct netr_LogonControl2);
1186 if (r == NULL) {
1187 return false;
1190 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1191 talloc_free(r);
1192 return false;
1195 pull = ndr_pull_init_blob(&blob, r, NULL);
1196 if (pull == NULL) {
1197 talloc_free(r);
1198 return false;
1201 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1202 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1203 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1204 talloc_free(r);
1205 return false;
1208 if (DEBUGLEVEL >= 10) {
1209 NDR_PRINT_IN_DEBUG(netr_LogonControl2, r);
1212 ZERO_STRUCT(r->out);
1213 r->out.query = talloc_zero(r, union netr_CONTROL_QUERY_INFORMATION);
1214 if (r->out.query == NULL) {
1215 talloc_free(r);
1216 return false;
1219 r->out.result = _netr_LogonControl2(p, r);
1221 if (p->rng_fault_state) {
1222 talloc_free(r);
1223 /* Return true here, srv_pipe_hnd.c will take care */
1224 return true;
1227 if (DEBUGLEVEL >= 10) {
1228 NDR_PRINT_OUT_DEBUG(netr_LogonControl2, r);
1231 push = ndr_push_init_ctx(r, NULL);
1232 if (push == NULL) {
1233 talloc_free(r);
1234 return false;
1237 ndr_err = call->ndr_push(push, NDR_OUT, r);
1238 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1239 talloc_free(r);
1240 return false;
1243 blob = ndr_push_blob(push);
1244 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1245 talloc_free(r);
1246 return false;
1249 talloc_free(r);
1251 return true;
1254 static bool api_netr_ServerAuthenticate2(pipes_struct *p)
1256 const struct ndr_interface_call *call;
1257 struct ndr_pull *pull;
1258 struct ndr_push *push;
1259 enum ndr_err_code ndr_err;
1260 DATA_BLOB blob;
1261 struct netr_ServerAuthenticate2 *r;
1263 call = &ndr_table_netlogon.calls[NDR_NETR_SERVERAUTHENTICATE2];
1265 r = talloc(talloc_tos(), struct netr_ServerAuthenticate2);
1266 if (r == NULL) {
1267 return false;
1270 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1271 talloc_free(r);
1272 return false;
1275 pull = ndr_pull_init_blob(&blob, r, NULL);
1276 if (pull == NULL) {
1277 talloc_free(r);
1278 return false;
1281 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1282 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1283 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1284 talloc_free(r);
1285 return false;
1288 if (DEBUGLEVEL >= 10) {
1289 NDR_PRINT_IN_DEBUG(netr_ServerAuthenticate2, r);
1292 ZERO_STRUCT(r->out);
1293 r->out.negotiate_flags = r->in.negotiate_flags;
1294 r->out.return_credentials = talloc_zero(r, struct netr_Credential);
1295 if (r->out.return_credentials == NULL) {
1296 talloc_free(r);
1297 return false;
1300 r->out.result = _netr_ServerAuthenticate2(p, r);
1302 if (p->rng_fault_state) {
1303 talloc_free(r);
1304 /* Return true here, srv_pipe_hnd.c will take care */
1305 return true;
1308 if (DEBUGLEVEL >= 10) {
1309 NDR_PRINT_OUT_DEBUG(netr_ServerAuthenticate2, r);
1312 push = ndr_push_init_ctx(r, NULL);
1313 if (push == NULL) {
1314 talloc_free(r);
1315 return false;
1318 ndr_err = call->ndr_push(push, NDR_OUT, r);
1319 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1320 talloc_free(r);
1321 return false;
1324 blob = ndr_push_blob(push);
1325 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1326 talloc_free(r);
1327 return false;
1330 talloc_free(r);
1332 return true;
1335 static bool api_netr_DatabaseSync2(pipes_struct *p)
1337 const struct ndr_interface_call *call;
1338 struct ndr_pull *pull;
1339 struct ndr_push *push;
1340 enum ndr_err_code ndr_err;
1341 DATA_BLOB blob;
1342 struct netr_DatabaseSync2 *r;
1344 call = &ndr_table_netlogon.calls[NDR_NETR_DATABASESYNC2];
1346 r = talloc(talloc_tos(), struct netr_DatabaseSync2);
1347 if (r == NULL) {
1348 return false;
1351 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1352 talloc_free(r);
1353 return false;
1356 pull = ndr_pull_init_blob(&blob, r, NULL);
1357 if (pull == NULL) {
1358 talloc_free(r);
1359 return false;
1362 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1363 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1364 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1365 talloc_free(r);
1366 return false;
1369 if (DEBUGLEVEL >= 10) {
1370 NDR_PRINT_IN_DEBUG(netr_DatabaseSync2, r);
1373 ZERO_STRUCT(r->out);
1374 r->out.return_authenticator = r->in.return_authenticator;
1375 r->out.sync_context = r->in.sync_context;
1376 r->out.delta_enum_array = talloc_zero(r, struct netr_DELTA_ENUM_ARRAY *);
1377 if (r->out.delta_enum_array == NULL) {
1378 talloc_free(r);
1379 return false;
1382 r->out.result = _netr_DatabaseSync2(p, r);
1384 if (p->rng_fault_state) {
1385 talloc_free(r);
1386 /* Return true here, srv_pipe_hnd.c will take care */
1387 return true;
1390 if (DEBUGLEVEL >= 10) {
1391 NDR_PRINT_OUT_DEBUG(netr_DatabaseSync2, r);
1394 push = ndr_push_init_ctx(r, NULL);
1395 if (push == NULL) {
1396 talloc_free(r);
1397 return false;
1400 ndr_err = call->ndr_push(push, NDR_OUT, r);
1401 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1402 talloc_free(r);
1403 return false;
1406 blob = ndr_push_blob(push);
1407 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1408 talloc_free(r);
1409 return false;
1412 talloc_free(r);
1414 return true;
1417 static bool api_netr_DatabaseRedo(pipes_struct *p)
1419 const struct ndr_interface_call *call;
1420 struct ndr_pull *pull;
1421 struct ndr_push *push;
1422 enum ndr_err_code ndr_err;
1423 DATA_BLOB blob;
1424 struct netr_DatabaseRedo *r;
1426 call = &ndr_table_netlogon.calls[NDR_NETR_DATABASEREDO];
1428 r = talloc(talloc_tos(), struct netr_DatabaseRedo);
1429 if (r == NULL) {
1430 return false;
1433 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1434 talloc_free(r);
1435 return false;
1438 pull = ndr_pull_init_blob(&blob, r, NULL);
1439 if (pull == NULL) {
1440 talloc_free(r);
1441 return false;
1444 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1445 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1446 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1447 talloc_free(r);
1448 return false;
1451 if (DEBUGLEVEL >= 10) {
1452 NDR_PRINT_IN_DEBUG(netr_DatabaseRedo, r);
1455 ZERO_STRUCT(r->out);
1456 r->out.return_authenticator = r->in.return_authenticator;
1457 r->out.delta_enum_array = talloc_zero(r, struct netr_DELTA_ENUM_ARRAY *);
1458 if (r->out.delta_enum_array == NULL) {
1459 talloc_free(r);
1460 return false;
1463 r->out.result = _netr_DatabaseRedo(p, r);
1465 if (p->rng_fault_state) {
1466 talloc_free(r);
1467 /* Return true here, srv_pipe_hnd.c will take care */
1468 return true;
1471 if (DEBUGLEVEL >= 10) {
1472 NDR_PRINT_OUT_DEBUG(netr_DatabaseRedo, r);
1475 push = ndr_push_init_ctx(r, NULL);
1476 if (push == NULL) {
1477 talloc_free(r);
1478 return false;
1481 ndr_err = call->ndr_push(push, NDR_OUT, r);
1482 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1483 talloc_free(r);
1484 return false;
1487 blob = ndr_push_blob(push);
1488 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1489 talloc_free(r);
1490 return false;
1493 talloc_free(r);
1495 return true;
1498 static bool api_netr_LogonControl2Ex(pipes_struct *p)
1500 const struct ndr_interface_call *call;
1501 struct ndr_pull *pull;
1502 struct ndr_push *push;
1503 enum ndr_err_code ndr_err;
1504 DATA_BLOB blob;
1505 struct netr_LogonControl2Ex *r;
1507 call = &ndr_table_netlogon.calls[NDR_NETR_LOGONCONTROL2EX];
1509 r = talloc(talloc_tos(), struct netr_LogonControl2Ex);
1510 if (r == NULL) {
1511 return false;
1514 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1515 talloc_free(r);
1516 return false;
1519 pull = ndr_pull_init_blob(&blob, r, NULL);
1520 if (pull == NULL) {
1521 talloc_free(r);
1522 return false;
1525 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1526 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1527 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1528 talloc_free(r);
1529 return false;
1532 if (DEBUGLEVEL >= 10) {
1533 NDR_PRINT_IN_DEBUG(netr_LogonControl2Ex, r);
1536 ZERO_STRUCT(r->out);
1537 r->out.query = talloc_zero(r, union netr_CONTROL_QUERY_INFORMATION);
1538 if (r->out.query == NULL) {
1539 talloc_free(r);
1540 return false;
1543 r->out.result = _netr_LogonControl2Ex(p, r);
1545 if (p->rng_fault_state) {
1546 talloc_free(r);
1547 /* Return true here, srv_pipe_hnd.c will take care */
1548 return true;
1551 if (DEBUGLEVEL >= 10) {
1552 NDR_PRINT_OUT_DEBUG(netr_LogonControl2Ex, r);
1555 push = ndr_push_init_ctx(r, NULL);
1556 if (push == NULL) {
1557 talloc_free(r);
1558 return false;
1561 ndr_err = call->ndr_push(push, NDR_OUT, r);
1562 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1563 talloc_free(r);
1564 return false;
1567 blob = ndr_push_blob(push);
1568 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1569 talloc_free(r);
1570 return false;
1573 talloc_free(r);
1575 return true;
1578 static bool api_netr_NetrEnumerateTrustedDomains(pipes_struct *p)
1580 const struct ndr_interface_call *call;
1581 struct ndr_pull *pull;
1582 struct ndr_push *push;
1583 enum ndr_err_code ndr_err;
1584 DATA_BLOB blob;
1585 struct netr_NetrEnumerateTrustedDomains *r;
1587 call = &ndr_table_netlogon.calls[NDR_NETR_NETRENUMERATETRUSTEDDOMAINS];
1589 r = talloc(talloc_tos(), struct netr_NetrEnumerateTrustedDomains);
1590 if (r == NULL) {
1591 return false;
1594 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1595 talloc_free(r);
1596 return false;
1599 pull = ndr_pull_init_blob(&blob, r, NULL);
1600 if (pull == NULL) {
1601 talloc_free(r);
1602 return false;
1605 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1606 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1607 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1608 talloc_free(r);
1609 return false;
1612 if (DEBUGLEVEL >= 10) {
1613 NDR_PRINT_IN_DEBUG(netr_NetrEnumerateTrustedDomains, r);
1616 ZERO_STRUCT(r->out);
1617 r->out.trusted_domains_blob = talloc_zero(r, struct netr_Blob);
1618 if (r->out.trusted_domains_blob == NULL) {
1619 talloc_free(r);
1620 return false;
1623 r->out.result = _netr_NetrEnumerateTrustedDomains(p, r);
1625 if (p->rng_fault_state) {
1626 talloc_free(r);
1627 /* Return true here, srv_pipe_hnd.c will take care */
1628 return true;
1631 if (DEBUGLEVEL >= 10) {
1632 NDR_PRINT_OUT_DEBUG(netr_NetrEnumerateTrustedDomains, r);
1635 push = ndr_push_init_ctx(r, NULL);
1636 if (push == NULL) {
1637 talloc_free(r);
1638 return false;
1641 ndr_err = call->ndr_push(push, NDR_OUT, r);
1642 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1643 talloc_free(r);
1644 return false;
1647 blob = ndr_push_blob(push);
1648 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1649 talloc_free(r);
1650 return false;
1653 talloc_free(r);
1655 return true;
1658 static bool api_netr_DsRGetDCName(pipes_struct *p)
1660 const struct ndr_interface_call *call;
1661 struct ndr_pull *pull;
1662 struct ndr_push *push;
1663 enum ndr_err_code ndr_err;
1664 DATA_BLOB blob;
1665 struct netr_DsRGetDCName *r;
1667 call = &ndr_table_netlogon.calls[NDR_NETR_DSRGETDCNAME];
1669 r = talloc(talloc_tos(), struct netr_DsRGetDCName);
1670 if (r == NULL) {
1671 return false;
1674 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1675 talloc_free(r);
1676 return false;
1679 pull = ndr_pull_init_blob(&blob, r, NULL);
1680 if (pull == NULL) {
1681 talloc_free(r);
1682 return false;
1685 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1686 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1687 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1688 talloc_free(r);
1689 return false;
1692 if (DEBUGLEVEL >= 10) {
1693 NDR_PRINT_IN_DEBUG(netr_DsRGetDCName, r);
1696 ZERO_STRUCT(r->out);
1697 r->out.info = talloc_zero(r, struct netr_DsRGetDCNameInfo *);
1698 if (r->out.info == NULL) {
1699 talloc_free(r);
1700 return false;
1703 r->out.result = _netr_DsRGetDCName(p, r);
1705 if (p->rng_fault_state) {
1706 talloc_free(r);
1707 /* Return true here, srv_pipe_hnd.c will take care */
1708 return true;
1711 if (DEBUGLEVEL >= 10) {
1712 NDR_PRINT_OUT_DEBUG(netr_DsRGetDCName, r);
1715 push = ndr_push_init_ctx(r, NULL);
1716 if (push == NULL) {
1717 talloc_free(r);
1718 return false;
1721 ndr_err = call->ndr_push(push, NDR_OUT, r);
1722 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1723 talloc_free(r);
1724 return false;
1727 blob = ndr_push_blob(push);
1728 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1729 talloc_free(r);
1730 return false;
1733 talloc_free(r);
1735 return true;
1738 static bool api_netr_LogonGetCapabilities(pipes_struct *p)
1740 const struct ndr_interface_call *call;
1741 struct ndr_pull *pull;
1742 struct ndr_push *push;
1743 enum ndr_err_code ndr_err;
1744 DATA_BLOB blob;
1745 struct netr_LogonGetCapabilities *r;
1747 call = &ndr_table_netlogon.calls[NDR_NETR_LOGONGETCAPABILITIES];
1749 r = talloc(talloc_tos(), struct netr_LogonGetCapabilities);
1750 if (r == NULL) {
1751 return false;
1754 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1755 talloc_free(r);
1756 return false;
1759 pull = ndr_pull_init_blob(&blob, r, NULL);
1760 if (pull == NULL) {
1761 talloc_free(r);
1762 return false;
1765 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1766 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1767 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1768 talloc_free(r);
1769 return false;
1772 if (DEBUGLEVEL >= 10) {
1773 NDR_PRINT_IN_DEBUG(netr_LogonGetCapabilities, r);
1776 ZERO_STRUCT(r->out);
1777 r->out.return_authenticator = r->in.return_authenticator;
1778 r->out.capabilities = talloc_zero(r, union netr_Capabilities);
1779 if (r->out.capabilities == NULL) {
1780 talloc_free(r);
1781 return false;
1784 r->out.result = _netr_LogonGetCapabilities(p, r);
1786 if (p->rng_fault_state) {
1787 talloc_free(r);
1788 /* Return true here, srv_pipe_hnd.c will take care */
1789 return true;
1792 if (DEBUGLEVEL >= 10) {
1793 NDR_PRINT_OUT_DEBUG(netr_LogonGetCapabilities, r);
1796 push = ndr_push_init_ctx(r, NULL);
1797 if (push == NULL) {
1798 talloc_free(r);
1799 return false;
1802 ndr_err = call->ndr_push(push, NDR_OUT, r);
1803 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1804 talloc_free(r);
1805 return false;
1808 blob = ndr_push_blob(push);
1809 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1810 talloc_free(r);
1811 return false;
1814 talloc_free(r);
1816 return true;
1819 static bool api_netr_NETRLOGONSETSERVICEBITS(pipes_struct *p)
1821 const struct ndr_interface_call *call;
1822 struct ndr_pull *pull;
1823 struct ndr_push *push;
1824 enum ndr_err_code ndr_err;
1825 DATA_BLOB blob;
1826 struct netr_NETRLOGONSETSERVICEBITS *r;
1828 call = &ndr_table_netlogon.calls[NDR_NETR_NETRLOGONSETSERVICEBITS];
1830 r = talloc(talloc_tos(), struct netr_NETRLOGONSETSERVICEBITS);
1831 if (r == NULL) {
1832 return false;
1835 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1836 talloc_free(r);
1837 return false;
1840 pull = ndr_pull_init_blob(&blob, r, NULL);
1841 if (pull == NULL) {
1842 talloc_free(r);
1843 return false;
1846 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1847 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1848 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1849 talloc_free(r);
1850 return false;
1853 if (DEBUGLEVEL >= 10) {
1854 NDR_PRINT_IN_DEBUG(netr_NETRLOGONSETSERVICEBITS, r);
1857 r->out.result = _netr_NETRLOGONSETSERVICEBITS(p, r);
1859 if (p->rng_fault_state) {
1860 talloc_free(r);
1861 /* Return true here, srv_pipe_hnd.c will take care */
1862 return true;
1865 if (DEBUGLEVEL >= 10) {
1866 NDR_PRINT_OUT_DEBUG(netr_NETRLOGONSETSERVICEBITS, r);
1869 push = ndr_push_init_ctx(r, NULL);
1870 if (push == NULL) {
1871 talloc_free(r);
1872 return false;
1875 ndr_err = call->ndr_push(push, NDR_OUT, r);
1876 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1877 talloc_free(r);
1878 return false;
1881 blob = ndr_push_blob(push);
1882 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1883 talloc_free(r);
1884 return false;
1887 talloc_free(r);
1889 return true;
1892 static bool api_netr_LogonGetTrustRid(pipes_struct *p)
1894 const struct ndr_interface_call *call;
1895 struct ndr_pull *pull;
1896 struct ndr_push *push;
1897 enum ndr_err_code ndr_err;
1898 DATA_BLOB blob;
1899 struct netr_LogonGetTrustRid *r;
1901 call = &ndr_table_netlogon.calls[NDR_NETR_LOGONGETTRUSTRID];
1903 r = talloc(talloc_tos(), struct netr_LogonGetTrustRid);
1904 if (r == NULL) {
1905 return false;
1908 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1909 talloc_free(r);
1910 return false;
1913 pull = ndr_pull_init_blob(&blob, r, NULL);
1914 if (pull == NULL) {
1915 talloc_free(r);
1916 return false;
1919 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1920 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1921 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1922 talloc_free(r);
1923 return false;
1926 if (DEBUGLEVEL >= 10) {
1927 NDR_PRINT_IN_DEBUG(netr_LogonGetTrustRid, r);
1930 ZERO_STRUCT(r->out);
1931 r->out.rid = talloc_zero(r, uint32_t);
1932 if (r->out.rid == NULL) {
1933 talloc_free(r);
1934 return false;
1937 r->out.result = _netr_LogonGetTrustRid(p, r);
1939 if (p->rng_fault_state) {
1940 talloc_free(r);
1941 /* Return true here, srv_pipe_hnd.c will take care */
1942 return true;
1945 if (DEBUGLEVEL >= 10) {
1946 NDR_PRINT_OUT_DEBUG(netr_LogonGetTrustRid, r);
1949 push = ndr_push_init_ctx(r, NULL);
1950 if (push == NULL) {
1951 talloc_free(r);
1952 return false;
1955 ndr_err = call->ndr_push(push, NDR_OUT, r);
1956 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1957 talloc_free(r);
1958 return false;
1961 blob = ndr_push_blob(push);
1962 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1963 talloc_free(r);
1964 return false;
1967 talloc_free(r);
1969 return true;
1972 static bool api_netr_NETRLOGONCOMPUTESERVERDIGEST(pipes_struct *p)
1974 const struct ndr_interface_call *call;
1975 struct ndr_pull *pull;
1976 struct ndr_push *push;
1977 enum ndr_err_code ndr_err;
1978 DATA_BLOB blob;
1979 struct netr_NETRLOGONCOMPUTESERVERDIGEST *r;
1981 call = &ndr_table_netlogon.calls[NDR_NETR_NETRLOGONCOMPUTESERVERDIGEST];
1983 r = talloc(talloc_tos(), struct netr_NETRLOGONCOMPUTESERVERDIGEST);
1984 if (r == NULL) {
1985 return false;
1988 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1989 talloc_free(r);
1990 return false;
1993 pull = ndr_pull_init_blob(&blob, r, NULL);
1994 if (pull == NULL) {
1995 talloc_free(r);
1996 return false;
1999 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2000 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2001 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2002 talloc_free(r);
2003 return false;
2006 if (DEBUGLEVEL >= 10) {
2007 NDR_PRINT_IN_DEBUG(netr_NETRLOGONCOMPUTESERVERDIGEST, r);
2010 r->out.result = _netr_NETRLOGONCOMPUTESERVERDIGEST(p, r);
2012 if (p->rng_fault_state) {
2013 talloc_free(r);
2014 /* Return true here, srv_pipe_hnd.c will take care */
2015 return true;
2018 if (DEBUGLEVEL >= 10) {
2019 NDR_PRINT_OUT_DEBUG(netr_NETRLOGONCOMPUTESERVERDIGEST, r);
2022 push = ndr_push_init_ctx(r, NULL);
2023 if (push == NULL) {
2024 talloc_free(r);
2025 return false;
2028 ndr_err = call->ndr_push(push, NDR_OUT, r);
2029 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2030 talloc_free(r);
2031 return false;
2034 blob = ndr_push_blob(push);
2035 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2036 talloc_free(r);
2037 return false;
2040 talloc_free(r);
2042 return true;
2045 static bool api_netr_NETRLOGONCOMPUTECLIENTDIGEST(pipes_struct *p)
2047 const struct ndr_interface_call *call;
2048 struct ndr_pull *pull;
2049 struct ndr_push *push;
2050 enum ndr_err_code ndr_err;
2051 DATA_BLOB blob;
2052 struct netr_NETRLOGONCOMPUTECLIENTDIGEST *r;
2054 call = &ndr_table_netlogon.calls[NDR_NETR_NETRLOGONCOMPUTECLIENTDIGEST];
2056 r = talloc(talloc_tos(), struct netr_NETRLOGONCOMPUTECLIENTDIGEST);
2057 if (r == NULL) {
2058 return false;
2061 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2062 talloc_free(r);
2063 return false;
2066 pull = ndr_pull_init_blob(&blob, r, NULL);
2067 if (pull == NULL) {
2068 talloc_free(r);
2069 return false;
2072 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2073 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2074 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2075 talloc_free(r);
2076 return false;
2079 if (DEBUGLEVEL >= 10) {
2080 NDR_PRINT_IN_DEBUG(netr_NETRLOGONCOMPUTECLIENTDIGEST, r);
2083 r->out.result = _netr_NETRLOGONCOMPUTECLIENTDIGEST(p, r);
2085 if (p->rng_fault_state) {
2086 talloc_free(r);
2087 /* Return true here, srv_pipe_hnd.c will take care */
2088 return true;
2091 if (DEBUGLEVEL >= 10) {
2092 NDR_PRINT_OUT_DEBUG(netr_NETRLOGONCOMPUTECLIENTDIGEST, r);
2095 push = ndr_push_init_ctx(r, NULL);
2096 if (push == NULL) {
2097 talloc_free(r);
2098 return false;
2101 ndr_err = call->ndr_push(push, NDR_OUT, r);
2102 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2103 talloc_free(r);
2104 return false;
2107 blob = ndr_push_blob(push);
2108 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2109 talloc_free(r);
2110 return false;
2113 talloc_free(r);
2115 return true;
2118 static bool api_netr_ServerAuthenticate3(pipes_struct *p)
2120 const struct ndr_interface_call *call;
2121 struct ndr_pull *pull;
2122 struct ndr_push *push;
2123 enum ndr_err_code ndr_err;
2124 DATA_BLOB blob;
2125 struct netr_ServerAuthenticate3 *r;
2127 call = &ndr_table_netlogon.calls[NDR_NETR_SERVERAUTHENTICATE3];
2129 r = talloc(talloc_tos(), struct netr_ServerAuthenticate3);
2130 if (r == NULL) {
2131 return false;
2134 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2135 talloc_free(r);
2136 return false;
2139 pull = ndr_pull_init_blob(&blob, r, NULL);
2140 if (pull == NULL) {
2141 talloc_free(r);
2142 return false;
2145 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2146 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2147 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2148 talloc_free(r);
2149 return false;
2152 if (DEBUGLEVEL >= 10) {
2153 NDR_PRINT_IN_DEBUG(netr_ServerAuthenticate3, r);
2156 ZERO_STRUCT(r->out);
2157 r->out.negotiate_flags = r->in.negotiate_flags;
2158 r->out.return_credentials = talloc_zero(r, struct netr_Credential);
2159 if (r->out.return_credentials == NULL) {
2160 talloc_free(r);
2161 return false;
2164 r->out.rid = talloc_zero(r, uint32_t);
2165 if (r->out.rid == NULL) {
2166 talloc_free(r);
2167 return false;
2170 r->out.result = _netr_ServerAuthenticate3(p, r);
2172 if (p->rng_fault_state) {
2173 talloc_free(r);
2174 /* Return true here, srv_pipe_hnd.c will take care */
2175 return true;
2178 if (DEBUGLEVEL >= 10) {
2179 NDR_PRINT_OUT_DEBUG(netr_ServerAuthenticate3, r);
2182 push = ndr_push_init_ctx(r, NULL);
2183 if (push == NULL) {
2184 talloc_free(r);
2185 return false;
2188 ndr_err = call->ndr_push(push, NDR_OUT, r);
2189 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2190 talloc_free(r);
2191 return false;
2194 blob = ndr_push_blob(push);
2195 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2196 talloc_free(r);
2197 return false;
2200 talloc_free(r);
2202 return true;
2205 static bool api_netr_DsRGetDCNameEx(pipes_struct *p)
2207 const struct ndr_interface_call *call;
2208 struct ndr_pull *pull;
2209 struct ndr_push *push;
2210 enum ndr_err_code ndr_err;
2211 DATA_BLOB blob;
2212 struct netr_DsRGetDCNameEx *r;
2214 call = &ndr_table_netlogon.calls[NDR_NETR_DSRGETDCNAMEEX];
2216 r = talloc(talloc_tos(), struct netr_DsRGetDCNameEx);
2217 if (r == NULL) {
2218 return false;
2221 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2222 talloc_free(r);
2223 return false;
2226 pull = ndr_pull_init_blob(&blob, r, NULL);
2227 if (pull == NULL) {
2228 talloc_free(r);
2229 return false;
2232 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2233 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2234 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2235 talloc_free(r);
2236 return false;
2239 if (DEBUGLEVEL >= 10) {
2240 NDR_PRINT_IN_DEBUG(netr_DsRGetDCNameEx, r);
2243 ZERO_STRUCT(r->out);
2244 r->out.info = talloc_zero(r, struct netr_DsRGetDCNameInfo *);
2245 if (r->out.info == NULL) {
2246 talloc_free(r);
2247 return false;
2250 r->out.result = _netr_DsRGetDCNameEx(p, r);
2252 if (p->rng_fault_state) {
2253 talloc_free(r);
2254 /* Return true here, srv_pipe_hnd.c will take care */
2255 return true;
2258 if (DEBUGLEVEL >= 10) {
2259 NDR_PRINT_OUT_DEBUG(netr_DsRGetDCNameEx, r);
2262 push = ndr_push_init_ctx(r, NULL);
2263 if (push == NULL) {
2264 talloc_free(r);
2265 return false;
2268 ndr_err = call->ndr_push(push, NDR_OUT, r);
2269 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2270 talloc_free(r);
2271 return false;
2274 blob = ndr_push_blob(push);
2275 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2276 talloc_free(r);
2277 return false;
2280 talloc_free(r);
2282 return true;
2285 static bool api_netr_DsRGetSiteName(pipes_struct *p)
2287 const struct ndr_interface_call *call;
2288 struct ndr_pull *pull;
2289 struct ndr_push *push;
2290 enum ndr_err_code ndr_err;
2291 DATA_BLOB blob;
2292 struct netr_DsRGetSiteName *r;
2294 call = &ndr_table_netlogon.calls[NDR_NETR_DSRGETSITENAME];
2296 r = talloc(talloc_tos(), struct netr_DsRGetSiteName);
2297 if (r == NULL) {
2298 return false;
2301 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2302 talloc_free(r);
2303 return false;
2306 pull = ndr_pull_init_blob(&blob, r, NULL);
2307 if (pull == NULL) {
2308 talloc_free(r);
2309 return false;
2312 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2313 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2314 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2315 talloc_free(r);
2316 return false;
2319 if (DEBUGLEVEL >= 10) {
2320 NDR_PRINT_IN_DEBUG(netr_DsRGetSiteName, r);
2323 ZERO_STRUCT(r->out);
2324 r->out.site = talloc_zero(r, const char *);
2325 if (r->out.site == NULL) {
2326 talloc_free(r);
2327 return false;
2330 r->out.result = _netr_DsRGetSiteName(p, r);
2332 if (p->rng_fault_state) {
2333 talloc_free(r);
2334 /* Return true here, srv_pipe_hnd.c will take care */
2335 return true;
2338 if (DEBUGLEVEL >= 10) {
2339 NDR_PRINT_OUT_DEBUG(netr_DsRGetSiteName, r);
2342 push = ndr_push_init_ctx(r, NULL);
2343 if (push == NULL) {
2344 talloc_free(r);
2345 return false;
2348 ndr_err = call->ndr_push(push, NDR_OUT, r);
2349 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2350 talloc_free(r);
2351 return false;
2354 blob = ndr_push_blob(push);
2355 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2356 talloc_free(r);
2357 return false;
2360 talloc_free(r);
2362 return true;
2365 static bool api_netr_LogonGetDomainInfo(pipes_struct *p)
2367 const struct ndr_interface_call *call;
2368 struct ndr_pull *pull;
2369 struct ndr_push *push;
2370 enum ndr_err_code ndr_err;
2371 DATA_BLOB blob;
2372 struct netr_LogonGetDomainInfo *r;
2374 call = &ndr_table_netlogon.calls[NDR_NETR_LOGONGETDOMAININFO];
2376 r = talloc(talloc_tos(), struct netr_LogonGetDomainInfo);
2377 if (r == NULL) {
2378 return false;
2381 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2382 talloc_free(r);
2383 return false;
2386 pull = ndr_pull_init_blob(&blob, r, NULL);
2387 if (pull == NULL) {
2388 talloc_free(r);
2389 return false;
2392 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2393 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2394 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2395 talloc_free(r);
2396 return false;
2399 if (DEBUGLEVEL >= 10) {
2400 NDR_PRINT_IN_DEBUG(netr_LogonGetDomainInfo, r);
2403 ZERO_STRUCT(r->out);
2404 r->out.return_authenticator = r->in.return_authenticator;
2405 r->out.info = talloc_zero(r, union netr_DomainInfo);
2406 if (r->out.info == NULL) {
2407 talloc_free(r);
2408 return false;
2411 r->out.result = _netr_LogonGetDomainInfo(p, r);
2413 if (p->rng_fault_state) {
2414 talloc_free(r);
2415 /* Return true here, srv_pipe_hnd.c will take care */
2416 return true;
2419 if (DEBUGLEVEL >= 10) {
2420 NDR_PRINT_OUT_DEBUG(netr_LogonGetDomainInfo, r);
2423 push = ndr_push_init_ctx(r, NULL);
2424 if (push == NULL) {
2425 talloc_free(r);
2426 return false;
2429 ndr_err = call->ndr_push(push, NDR_OUT, r);
2430 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2431 talloc_free(r);
2432 return false;
2435 blob = ndr_push_blob(push);
2436 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2437 talloc_free(r);
2438 return false;
2441 talloc_free(r);
2443 return true;
2446 static bool api_netr_ServerPasswordSet2(pipes_struct *p)
2448 const struct ndr_interface_call *call;
2449 struct ndr_pull *pull;
2450 struct ndr_push *push;
2451 enum ndr_err_code ndr_err;
2452 DATA_BLOB blob;
2453 struct netr_ServerPasswordSet2 *r;
2455 call = &ndr_table_netlogon.calls[NDR_NETR_SERVERPASSWORDSET2];
2457 r = talloc(talloc_tos(), struct netr_ServerPasswordSet2);
2458 if (r == NULL) {
2459 return false;
2462 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2463 talloc_free(r);
2464 return false;
2467 pull = ndr_pull_init_blob(&blob, r, NULL);
2468 if (pull == NULL) {
2469 talloc_free(r);
2470 return false;
2473 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2474 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2475 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2476 talloc_free(r);
2477 return false;
2480 if (DEBUGLEVEL >= 10) {
2481 NDR_PRINT_IN_DEBUG(netr_ServerPasswordSet2, r);
2484 ZERO_STRUCT(r->out);
2485 r->out.return_authenticator = talloc_zero(r, struct netr_Authenticator);
2486 if (r->out.return_authenticator == NULL) {
2487 talloc_free(r);
2488 return false;
2491 r->out.result = _netr_ServerPasswordSet2(p, r);
2493 if (p->rng_fault_state) {
2494 talloc_free(r);
2495 /* Return true here, srv_pipe_hnd.c will take care */
2496 return true;
2499 if (DEBUGLEVEL >= 10) {
2500 NDR_PRINT_OUT_DEBUG(netr_ServerPasswordSet2, r);
2503 push = ndr_push_init_ctx(r, NULL);
2504 if (push == NULL) {
2505 talloc_free(r);
2506 return false;
2509 ndr_err = call->ndr_push(push, NDR_OUT, r);
2510 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2511 talloc_free(r);
2512 return false;
2515 blob = ndr_push_blob(push);
2516 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2517 talloc_free(r);
2518 return false;
2521 talloc_free(r);
2523 return true;
2526 static bool api_netr_ServerPasswordGet(pipes_struct *p)
2528 const struct ndr_interface_call *call;
2529 struct ndr_pull *pull;
2530 struct ndr_push *push;
2531 enum ndr_err_code ndr_err;
2532 DATA_BLOB blob;
2533 struct netr_ServerPasswordGet *r;
2535 call = &ndr_table_netlogon.calls[NDR_NETR_SERVERPASSWORDGET];
2537 r = talloc(talloc_tos(), struct netr_ServerPasswordGet);
2538 if (r == NULL) {
2539 return false;
2542 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2543 talloc_free(r);
2544 return false;
2547 pull = ndr_pull_init_blob(&blob, r, NULL);
2548 if (pull == NULL) {
2549 talloc_free(r);
2550 return false;
2553 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2554 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2555 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2556 talloc_free(r);
2557 return false;
2560 if (DEBUGLEVEL >= 10) {
2561 NDR_PRINT_IN_DEBUG(netr_ServerPasswordGet, r);
2564 ZERO_STRUCT(r->out);
2565 r->out.return_authenticator = talloc_zero(r, struct netr_Authenticator);
2566 if (r->out.return_authenticator == NULL) {
2567 talloc_free(r);
2568 return false;
2571 r->out.password = talloc_zero(r, struct samr_Password);
2572 if (r->out.password == NULL) {
2573 talloc_free(r);
2574 return false;
2577 r->out.result = _netr_ServerPasswordGet(p, r);
2579 if (p->rng_fault_state) {
2580 talloc_free(r);
2581 /* Return true here, srv_pipe_hnd.c will take care */
2582 return true;
2585 if (DEBUGLEVEL >= 10) {
2586 NDR_PRINT_OUT_DEBUG(netr_ServerPasswordGet, r);
2589 push = ndr_push_init_ctx(r, NULL);
2590 if (push == NULL) {
2591 talloc_free(r);
2592 return false;
2595 ndr_err = call->ndr_push(push, NDR_OUT, r);
2596 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2597 talloc_free(r);
2598 return false;
2601 blob = ndr_push_blob(push);
2602 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2603 talloc_free(r);
2604 return false;
2607 talloc_free(r);
2609 return true;
2612 static bool api_netr_NETRLOGONSENDTOSAM(pipes_struct *p)
2614 const struct ndr_interface_call *call;
2615 struct ndr_pull *pull;
2616 struct ndr_push *push;
2617 enum ndr_err_code ndr_err;
2618 DATA_BLOB blob;
2619 struct netr_NETRLOGONSENDTOSAM *r;
2621 call = &ndr_table_netlogon.calls[NDR_NETR_NETRLOGONSENDTOSAM];
2623 r = talloc(talloc_tos(), struct netr_NETRLOGONSENDTOSAM);
2624 if (r == NULL) {
2625 return false;
2628 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2629 talloc_free(r);
2630 return false;
2633 pull = ndr_pull_init_blob(&blob, r, NULL);
2634 if (pull == NULL) {
2635 talloc_free(r);
2636 return false;
2639 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2640 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2641 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2642 talloc_free(r);
2643 return false;
2646 if (DEBUGLEVEL >= 10) {
2647 NDR_PRINT_IN_DEBUG(netr_NETRLOGONSENDTOSAM, r);
2650 r->out.result = _netr_NETRLOGONSENDTOSAM(p, r);
2652 if (p->rng_fault_state) {
2653 talloc_free(r);
2654 /* Return true here, srv_pipe_hnd.c will take care */
2655 return true;
2658 if (DEBUGLEVEL >= 10) {
2659 NDR_PRINT_OUT_DEBUG(netr_NETRLOGONSENDTOSAM, r);
2662 push = ndr_push_init_ctx(r, NULL);
2663 if (push == NULL) {
2664 talloc_free(r);
2665 return false;
2668 ndr_err = call->ndr_push(push, NDR_OUT, r);
2669 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2670 talloc_free(r);
2671 return false;
2674 blob = ndr_push_blob(push);
2675 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2676 talloc_free(r);
2677 return false;
2680 talloc_free(r);
2682 return true;
2685 static bool api_netr_DsRAddressToSitenamesW(pipes_struct *p)
2687 const struct ndr_interface_call *call;
2688 struct ndr_pull *pull;
2689 struct ndr_push *push;
2690 enum ndr_err_code ndr_err;
2691 DATA_BLOB blob;
2692 struct netr_DsRAddressToSitenamesW *r;
2694 call = &ndr_table_netlogon.calls[NDR_NETR_DSRADDRESSTOSITENAMESW];
2696 r = talloc(talloc_tos(), struct netr_DsRAddressToSitenamesW);
2697 if (r == NULL) {
2698 return false;
2701 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2702 talloc_free(r);
2703 return false;
2706 pull = ndr_pull_init_blob(&blob, r, NULL);
2707 if (pull == NULL) {
2708 talloc_free(r);
2709 return false;
2712 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2713 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2714 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2715 talloc_free(r);
2716 return false;
2719 if (DEBUGLEVEL >= 10) {
2720 NDR_PRINT_IN_DEBUG(netr_DsRAddressToSitenamesW, r);
2723 ZERO_STRUCT(r->out);
2724 r->out.ctr = talloc_zero(r, struct netr_DsRAddressToSitenamesWCtr *);
2725 if (r->out.ctr == NULL) {
2726 talloc_free(r);
2727 return false;
2730 r->out.result = _netr_DsRAddressToSitenamesW(p, r);
2732 if (p->rng_fault_state) {
2733 talloc_free(r);
2734 /* Return true here, srv_pipe_hnd.c will take care */
2735 return true;
2738 if (DEBUGLEVEL >= 10) {
2739 NDR_PRINT_OUT_DEBUG(netr_DsRAddressToSitenamesW, r);
2742 push = ndr_push_init_ctx(r, NULL);
2743 if (push == NULL) {
2744 talloc_free(r);
2745 return false;
2748 ndr_err = call->ndr_push(push, NDR_OUT, r);
2749 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2750 talloc_free(r);
2751 return false;
2754 blob = ndr_push_blob(push);
2755 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2756 talloc_free(r);
2757 return false;
2760 talloc_free(r);
2762 return true;
2765 static bool api_netr_DsRGetDCNameEx2(pipes_struct *p)
2767 const struct ndr_interface_call *call;
2768 struct ndr_pull *pull;
2769 struct ndr_push *push;
2770 enum ndr_err_code ndr_err;
2771 DATA_BLOB blob;
2772 struct netr_DsRGetDCNameEx2 *r;
2774 call = &ndr_table_netlogon.calls[NDR_NETR_DSRGETDCNAMEEX2];
2776 r = talloc(talloc_tos(), struct netr_DsRGetDCNameEx2);
2777 if (r == NULL) {
2778 return false;
2781 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2782 talloc_free(r);
2783 return false;
2786 pull = ndr_pull_init_blob(&blob, r, NULL);
2787 if (pull == NULL) {
2788 talloc_free(r);
2789 return false;
2792 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2793 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2794 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2795 talloc_free(r);
2796 return false;
2799 if (DEBUGLEVEL >= 10) {
2800 NDR_PRINT_IN_DEBUG(netr_DsRGetDCNameEx2, r);
2803 ZERO_STRUCT(r->out);
2804 r->out.info = talloc_zero(r, struct netr_DsRGetDCNameInfo *);
2805 if (r->out.info == NULL) {
2806 talloc_free(r);
2807 return false;
2810 r->out.result = _netr_DsRGetDCNameEx2(p, r);
2812 if (p->rng_fault_state) {
2813 talloc_free(r);
2814 /* Return true here, srv_pipe_hnd.c will take care */
2815 return true;
2818 if (DEBUGLEVEL >= 10) {
2819 NDR_PRINT_OUT_DEBUG(netr_DsRGetDCNameEx2, r);
2822 push = ndr_push_init_ctx(r, NULL);
2823 if (push == NULL) {
2824 talloc_free(r);
2825 return false;
2828 ndr_err = call->ndr_push(push, NDR_OUT, r);
2829 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2830 talloc_free(r);
2831 return false;
2834 blob = ndr_push_blob(push);
2835 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2836 talloc_free(r);
2837 return false;
2840 talloc_free(r);
2842 return true;
2845 static bool api_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(pipes_struct *p)
2847 const struct ndr_interface_call *call;
2848 struct ndr_pull *pull;
2849 struct ndr_push *push;
2850 enum ndr_err_code ndr_err;
2851 DATA_BLOB blob;
2852 struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN *r;
2854 call = &ndr_table_netlogon.calls[NDR_NETR_NETRLOGONGETTIMESERVICEPARENTDOMAIN];
2856 r = talloc(talloc_tos(), struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN);
2857 if (r == NULL) {
2858 return false;
2861 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2862 talloc_free(r);
2863 return false;
2866 pull = ndr_pull_init_blob(&blob, r, NULL);
2867 if (pull == NULL) {
2868 talloc_free(r);
2869 return false;
2872 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2873 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2874 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2875 talloc_free(r);
2876 return false;
2879 if (DEBUGLEVEL >= 10) {
2880 NDR_PRINT_IN_DEBUG(netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN, r);
2883 r->out.result = _netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(p, r);
2885 if (p->rng_fault_state) {
2886 talloc_free(r);
2887 /* Return true here, srv_pipe_hnd.c will take care */
2888 return true;
2891 if (DEBUGLEVEL >= 10) {
2892 NDR_PRINT_OUT_DEBUG(netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN, r);
2895 push = ndr_push_init_ctx(r, NULL);
2896 if (push == NULL) {
2897 talloc_free(r);
2898 return false;
2901 ndr_err = call->ndr_push(push, NDR_OUT, r);
2902 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2903 talloc_free(r);
2904 return false;
2907 blob = ndr_push_blob(push);
2908 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2909 talloc_free(r);
2910 return false;
2913 talloc_free(r);
2915 return true;
2918 static bool api_netr_NetrEnumerateTrustedDomainsEx(pipes_struct *p)
2920 const struct ndr_interface_call *call;
2921 struct ndr_pull *pull;
2922 struct ndr_push *push;
2923 enum ndr_err_code ndr_err;
2924 DATA_BLOB blob;
2925 struct netr_NetrEnumerateTrustedDomainsEx *r;
2927 call = &ndr_table_netlogon.calls[NDR_NETR_NETRENUMERATETRUSTEDDOMAINSEX];
2929 r = talloc(talloc_tos(), struct netr_NetrEnumerateTrustedDomainsEx);
2930 if (r == NULL) {
2931 return false;
2934 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2935 talloc_free(r);
2936 return false;
2939 pull = ndr_pull_init_blob(&blob, r, NULL);
2940 if (pull == NULL) {
2941 talloc_free(r);
2942 return false;
2945 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2946 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2947 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2948 talloc_free(r);
2949 return false;
2952 if (DEBUGLEVEL >= 10) {
2953 NDR_PRINT_IN_DEBUG(netr_NetrEnumerateTrustedDomainsEx, r);
2956 ZERO_STRUCT(r->out);
2957 r->out.dom_trust_list = talloc_zero(r, struct netr_DomainTrustList);
2958 if (r->out.dom_trust_list == NULL) {
2959 talloc_free(r);
2960 return false;
2963 r->out.result = _netr_NetrEnumerateTrustedDomainsEx(p, r);
2965 if (p->rng_fault_state) {
2966 talloc_free(r);
2967 /* Return true here, srv_pipe_hnd.c will take care */
2968 return true;
2971 if (DEBUGLEVEL >= 10) {
2972 NDR_PRINT_OUT_DEBUG(netr_NetrEnumerateTrustedDomainsEx, r);
2975 push = ndr_push_init_ctx(r, NULL);
2976 if (push == NULL) {
2977 talloc_free(r);
2978 return false;
2981 ndr_err = call->ndr_push(push, NDR_OUT, r);
2982 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2983 talloc_free(r);
2984 return false;
2987 blob = ndr_push_blob(push);
2988 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2989 talloc_free(r);
2990 return false;
2993 talloc_free(r);
2995 return true;
2998 static bool api_netr_DsRAddressToSitenamesExW(pipes_struct *p)
3000 const struct ndr_interface_call *call;
3001 struct ndr_pull *pull;
3002 struct ndr_push *push;
3003 enum ndr_err_code ndr_err;
3004 DATA_BLOB blob;
3005 struct netr_DsRAddressToSitenamesExW *r;
3007 call = &ndr_table_netlogon.calls[NDR_NETR_DSRADDRESSTOSITENAMESEXW];
3009 r = talloc(talloc_tos(), struct netr_DsRAddressToSitenamesExW);
3010 if (r == NULL) {
3011 return false;
3014 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3015 talloc_free(r);
3016 return false;
3019 pull = ndr_pull_init_blob(&blob, r, NULL);
3020 if (pull == NULL) {
3021 talloc_free(r);
3022 return false;
3025 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3026 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3027 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3028 talloc_free(r);
3029 return false;
3032 if (DEBUGLEVEL >= 10) {
3033 NDR_PRINT_IN_DEBUG(netr_DsRAddressToSitenamesExW, r);
3036 ZERO_STRUCT(r->out);
3037 r->out.ctr = talloc_zero(r, struct netr_DsRAddressToSitenamesExWCtr *);
3038 if (r->out.ctr == NULL) {
3039 talloc_free(r);
3040 return false;
3043 r->out.result = _netr_DsRAddressToSitenamesExW(p, r);
3045 if (p->rng_fault_state) {
3046 talloc_free(r);
3047 /* Return true here, srv_pipe_hnd.c will take care */
3048 return true;
3051 if (DEBUGLEVEL >= 10) {
3052 NDR_PRINT_OUT_DEBUG(netr_DsRAddressToSitenamesExW, r);
3055 push = ndr_push_init_ctx(r, NULL);
3056 if (push == NULL) {
3057 talloc_free(r);
3058 return false;
3061 ndr_err = call->ndr_push(push, NDR_OUT, r);
3062 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3063 talloc_free(r);
3064 return false;
3067 blob = ndr_push_blob(push);
3068 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3069 talloc_free(r);
3070 return false;
3073 talloc_free(r);
3075 return true;
3078 static bool api_netr_DsrGetDcSiteCoverageW(pipes_struct *p)
3080 const struct ndr_interface_call *call;
3081 struct ndr_pull *pull;
3082 struct ndr_push *push;
3083 enum ndr_err_code ndr_err;
3084 DATA_BLOB blob;
3085 struct netr_DsrGetDcSiteCoverageW *r;
3087 call = &ndr_table_netlogon.calls[NDR_NETR_DSRGETDCSITECOVERAGEW];
3089 r = talloc(talloc_tos(), struct netr_DsrGetDcSiteCoverageW);
3090 if (r == NULL) {
3091 return false;
3094 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3095 talloc_free(r);
3096 return false;
3099 pull = ndr_pull_init_blob(&blob, r, NULL);
3100 if (pull == NULL) {
3101 talloc_free(r);
3102 return false;
3105 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3106 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3107 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3108 talloc_free(r);
3109 return false;
3112 if (DEBUGLEVEL >= 10) {
3113 NDR_PRINT_IN_DEBUG(netr_DsrGetDcSiteCoverageW, r);
3116 ZERO_STRUCT(r->out);
3117 r->out.ctr = talloc_zero(r, struct DcSitesCtr *);
3118 if (r->out.ctr == NULL) {
3119 talloc_free(r);
3120 return false;
3123 r->out.result = _netr_DsrGetDcSiteCoverageW(p, r);
3125 if (p->rng_fault_state) {
3126 talloc_free(r);
3127 /* Return true here, srv_pipe_hnd.c will take care */
3128 return true;
3131 if (DEBUGLEVEL >= 10) {
3132 NDR_PRINT_OUT_DEBUG(netr_DsrGetDcSiteCoverageW, r);
3135 push = ndr_push_init_ctx(r, NULL);
3136 if (push == NULL) {
3137 talloc_free(r);
3138 return false;
3141 ndr_err = call->ndr_push(push, NDR_OUT, r);
3142 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3143 talloc_free(r);
3144 return false;
3147 blob = ndr_push_blob(push);
3148 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3149 talloc_free(r);
3150 return false;
3153 talloc_free(r);
3155 return true;
3158 static bool api_netr_LogonSamLogonEx(pipes_struct *p)
3160 const struct ndr_interface_call *call;
3161 struct ndr_pull *pull;
3162 struct ndr_push *push;
3163 enum ndr_err_code ndr_err;
3164 DATA_BLOB blob;
3165 struct netr_LogonSamLogonEx *r;
3167 call = &ndr_table_netlogon.calls[NDR_NETR_LOGONSAMLOGONEX];
3169 r = talloc(talloc_tos(), struct netr_LogonSamLogonEx);
3170 if (r == NULL) {
3171 return false;
3174 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3175 talloc_free(r);
3176 return false;
3179 pull = ndr_pull_init_blob(&blob, r, NULL);
3180 if (pull == NULL) {
3181 talloc_free(r);
3182 return false;
3185 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3186 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3187 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3188 talloc_free(r);
3189 return false;
3192 if (DEBUGLEVEL >= 10) {
3193 NDR_PRINT_IN_DEBUG(netr_LogonSamLogonEx, r);
3196 ZERO_STRUCT(r->out);
3197 r->out.flags = r->in.flags;
3198 r->out.validation = talloc_zero(r, union netr_Validation);
3199 if (r->out.validation == NULL) {
3200 talloc_free(r);
3201 return false;
3204 r->out.authoritative = talloc_zero(r, uint8_t);
3205 if (r->out.authoritative == NULL) {
3206 talloc_free(r);
3207 return false;
3210 r->out.result = _netr_LogonSamLogonEx(p, r);
3212 if (p->rng_fault_state) {
3213 talloc_free(r);
3214 /* Return true here, srv_pipe_hnd.c will take care */
3215 return true;
3218 if (DEBUGLEVEL >= 10) {
3219 NDR_PRINT_OUT_DEBUG(netr_LogonSamLogonEx, r);
3222 push = ndr_push_init_ctx(r, NULL);
3223 if (push == NULL) {
3224 talloc_free(r);
3225 return false;
3228 ndr_err = call->ndr_push(push, NDR_OUT, r);
3229 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3230 talloc_free(r);
3231 return false;
3234 blob = ndr_push_blob(push);
3235 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3236 talloc_free(r);
3237 return false;
3240 talloc_free(r);
3242 return true;
3245 static bool api_netr_DsrEnumerateDomainTrusts(pipes_struct *p)
3247 const struct ndr_interface_call *call;
3248 struct ndr_pull *pull;
3249 struct ndr_push *push;
3250 enum ndr_err_code ndr_err;
3251 DATA_BLOB blob;
3252 struct netr_DsrEnumerateDomainTrusts *r;
3254 call = &ndr_table_netlogon.calls[NDR_NETR_DSRENUMERATEDOMAINTRUSTS];
3256 r = talloc(talloc_tos(), struct netr_DsrEnumerateDomainTrusts);
3257 if (r == NULL) {
3258 return false;
3261 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3262 talloc_free(r);
3263 return false;
3266 pull = ndr_pull_init_blob(&blob, r, NULL);
3267 if (pull == NULL) {
3268 talloc_free(r);
3269 return false;
3272 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3273 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3274 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3275 talloc_free(r);
3276 return false;
3279 if (DEBUGLEVEL >= 10) {
3280 NDR_PRINT_IN_DEBUG(netr_DsrEnumerateDomainTrusts, r);
3283 ZERO_STRUCT(r->out);
3284 r->out.trusts = talloc_zero(r, struct netr_DomainTrustList);
3285 if (r->out.trusts == NULL) {
3286 talloc_free(r);
3287 return false;
3290 r->out.result = _netr_DsrEnumerateDomainTrusts(p, r);
3292 if (p->rng_fault_state) {
3293 talloc_free(r);
3294 /* Return true here, srv_pipe_hnd.c will take care */
3295 return true;
3298 if (DEBUGLEVEL >= 10) {
3299 NDR_PRINT_OUT_DEBUG(netr_DsrEnumerateDomainTrusts, r);
3302 push = ndr_push_init_ctx(r, NULL);
3303 if (push == NULL) {
3304 talloc_free(r);
3305 return false;
3308 ndr_err = call->ndr_push(push, NDR_OUT, r);
3309 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3310 talloc_free(r);
3311 return false;
3314 blob = ndr_push_blob(push);
3315 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3316 talloc_free(r);
3317 return false;
3320 talloc_free(r);
3322 return true;
3325 static bool api_netr_DsrDeregisterDNSHostRecords(pipes_struct *p)
3327 const struct ndr_interface_call *call;
3328 struct ndr_pull *pull;
3329 struct ndr_push *push;
3330 enum ndr_err_code ndr_err;
3331 DATA_BLOB blob;
3332 struct netr_DsrDeregisterDNSHostRecords *r;
3334 call = &ndr_table_netlogon.calls[NDR_NETR_DSRDEREGISTERDNSHOSTRECORDS];
3336 r = talloc(talloc_tos(), struct netr_DsrDeregisterDNSHostRecords);
3337 if (r == NULL) {
3338 return false;
3341 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3342 talloc_free(r);
3343 return false;
3346 pull = ndr_pull_init_blob(&blob, r, NULL);
3347 if (pull == NULL) {
3348 talloc_free(r);
3349 return false;
3352 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3353 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3354 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3355 talloc_free(r);
3356 return false;
3359 if (DEBUGLEVEL >= 10) {
3360 NDR_PRINT_IN_DEBUG(netr_DsrDeregisterDNSHostRecords, r);
3363 r->out.result = _netr_DsrDeregisterDNSHostRecords(p, r);
3365 if (p->rng_fault_state) {
3366 talloc_free(r);
3367 /* Return true here, srv_pipe_hnd.c will take care */
3368 return true;
3371 if (DEBUGLEVEL >= 10) {
3372 NDR_PRINT_OUT_DEBUG(netr_DsrDeregisterDNSHostRecords, r);
3375 push = ndr_push_init_ctx(r, NULL);
3376 if (push == NULL) {
3377 talloc_free(r);
3378 return false;
3381 ndr_err = call->ndr_push(push, NDR_OUT, r);
3382 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3383 talloc_free(r);
3384 return false;
3387 blob = ndr_push_blob(push);
3388 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3389 talloc_free(r);
3390 return false;
3393 talloc_free(r);
3395 return true;
3398 static bool api_netr_ServerTrustPasswordsGet(pipes_struct *p)
3400 const struct ndr_interface_call *call;
3401 struct ndr_pull *pull;
3402 struct ndr_push *push;
3403 enum ndr_err_code ndr_err;
3404 DATA_BLOB blob;
3405 struct netr_ServerTrustPasswordsGet *r;
3407 call = &ndr_table_netlogon.calls[NDR_NETR_SERVERTRUSTPASSWORDSGET];
3409 r = talloc(talloc_tos(), struct netr_ServerTrustPasswordsGet);
3410 if (r == NULL) {
3411 return false;
3414 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3415 talloc_free(r);
3416 return false;
3419 pull = ndr_pull_init_blob(&blob, r, NULL);
3420 if (pull == NULL) {
3421 talloc_free(r);
3422 return false;
3425 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3426 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3427 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3428 talloc_free(r);
3429 return false;
3432 if (DEBUGLEVEL >= 10) {
3433 NDR_PRINT_IN_DEBUG(netr_ServerTrustPasswordsGet, r);
3436 ZERO_STRUCT(r->out);
3437 r->out.return_authenticator = talloc_zero(r, struct netr_Authenticator);
3438 if (r->out.return_authenticator == NULL) {
3439 talloc_free(r);
3440 return false;
3443 r->out.password = talloc_zero(r, struct samr_Password);
3444 if (r->out.password == NULL) {
3445 talloc_free(r);
3446 return false;
3449 r->out.password2 = talloc_zero(r, struct samr_Password);
3450 if (r->out.password2 == NULL) {
3451 talloc_free(r);
3452 return false;
3455 r->out.result = _netr_ServerTrustPasswordsGet(p, r);
3457 if (p->rng_fault_state) {
3458 talloc_free(r);
3459 /* Return true here, srv_pipe_hnd.c will take care */
3460 return true;
3463 if (DEBUGLEVEL >= 10) {
3464 NDR_PRINT_OUT_DEBUG(netr_ServerTrustPasswordsGet, r);
3467 push = ndr_push_init_ctx(r, NULL);
3468 if (push == NULL) {
3469 talloc_free(r);
3470 return false;
3473 ndr_err = call->ndr_push(push, NDR_OUT, r);
3474 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3475 talloc_free(r);
3476 return false;
3479 blob = ndr_push_blob(push);
3480 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3481 talloc_free(r);
3482 return false;
3485 talloc_free(r);
3487 return true;
3490 static bool api_netr_DsRGetForestTrustInformation(pipes_struct *p)
3492 const struct ndr_interface_call *call;
3493 struct ndr_pull *pull;
3494 struct ndr_push *push;
3495 enum ndr_err_code ndr_err;
3496 DATA_BLOB blob;
3497 struct netr_DsRGetForestTrustInformation *r;
3499 call = &ndr_table_netlogon.calls[NDR_NETR_DSRGETFORESTTRUSTINFORMATION];
3501 r = talloc(talloc_tos(), struct netr_DsRGetForestTrustInformation);
3502 if (r == NULL) {
3503 return false;
3506 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3507 talloc_free(r);
3508 return false;
3511 pull = ndr_pull_init_blob(&blob, r, NULL);
3512 if (pull == NULL) {
3513 talloc_free(r);
3514 return false;
3517 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3518 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3519 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3520 talloc_free(r);
3521 return false;
3524 if (DEBUGLEVEL >= 10) {
3525 NDR_PRINT_IN_DEBUG(netr_DsRGetForestTrustInformation, r);
3528 ZERO_STRUCT(r->out);
3529 r->out.forest_trust_info = talloc_zero(r, struct lsa_ForestTrustInformation *);
3530 if (r->out.forest_trust_info == NULL) {
3531 talloc_free(r);
3532 return false;
3535 r->out.result = _netr_DsRGetForestTrustInformation(p, r);
3537 if (p->rng_fault_state) {
3538 talloc_free(r);
3539 /* Return true here, srv_pipe_hnd.c will take care */
3540 return true;
3543 if (DEBUGLEVEL >= 10) {
3544 NDR_PRINT_OUT_DEBUG(netr_DsRGetForestTrustInformation, r);
3547 push = ndr_push_init_ctx(r, NULL);
3548 if (push == NULL) {
3549 talloc_free(r);
3550 return false;
3553 ndr_err = call->ndr_push(push, NDR_OUT, r);
3554 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3555 talloc_free(r);
3556 return false;
3559 blob = ndr_push_blob(push);
3560 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3561 talloc_free(r);
3562 return false;
3565 talloc_free(r);
3567 return true;
3570 static bool api_netr_GetForestTrustInformation(pipes_struct *p)
3572 const struct ndr_interface_call *call;
3573 struct ndr_pull *pull;
3574 struct ndr_push *push;
3575 enum ndr_err_code ndr_err;
3576 DATA_BLOB blob;
3577 struct netr_GetForestTrustInformation *r;
3579 call = &ndr_table_netlogon.calls[NDR_NETR_GETFORESTTRUSTINFORMATION];
3581 r = talloc(talloc_tos(), struct netr_GetForestTrustInformation);
3582 if (r == NULL) {
3583 return false;
3586 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3587 talloc_free(r);
3588 return false;
3591 pull = ndr_pull_init_blob(&blob, r, NULL);
3592 if (pull == NULL) {
3593 talloc_free(r);
3594 return false;
3597 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3598 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3599 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3600 talloc_free(r);
3601 return false;
3604 if (DEBUGLEVEL >= 10) {
3605 NDR_PRINT_IN_DEBUG(netr_GetForestTrustInformation, r);
3608 ZERO_STRUCT(r->out);
3609 r->out.return_authenticator = talloc_zero(r, struct netr_Authenticator);
3610 if (r->out.return_authenticator == NULL) {
3611 talloc_free(r);
3612 return false;
3615 r->out.forest_trust_info = talloc_zero(r, struct lsa_ForestTrustInformation *);
3616 if (r->out.forest_trust_info == NULL) {
3617 talloc_free(r);
3618 return false;
3621 r->out.result = _netr_GetForestTrustInformation(p, r);
3623 if (p->rng_fault_state) {
3624 talloc_free(r);
3625 /* Return true here, srv_pipe_hnd.c will take care */
3626 return true;
3629 if (DEBUGLEVEL >= 10) {
3630 NDR_PRINT_OUT_DEBUG(netr_GetForestTrustInformation, r);
3633 push = ndr_push_init_ctx(r, NULL);
3634 if (push == NULL) {
3635 talloc_free(r);
3636 return false;
3639 ndr_err = call->ndr_push(push, NDR_OUT, r);
3640 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3641 talloc_free(r);
3642 return false;
3645 blob = ndr_push_blob(push);
3646 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3647 talloc_free(r);
3648 return false;
3651 talloc_free(r);
3653 return true;
3656 static bool api_netr_LogonSamLogonWithFlags(pipes_struct *p)
3658 const struct ndr_interface_call *call;
3659 struct ndr_pull *pull;
3660 struct ndr_push *push;
3661 enum ndr_err_code ndr_err;
3662 DATA_BLOB blob;
3663 struct netr_LogonSamLogonWithFlags *r;
3665 call = &ndr_table_netlogon.calls[NDR_NETR_LOGONSAMLOGONWITHFLAGS];
3667 r = talloc(talloc_tos(), struct netr_LogonSamLogonWithFlags);
3668 if (r == NULL) {
3669 return false;
3672 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3673 talloc_free(r);
3674 return false;
3677 pull = ndr_pull_init_blob(&blob, r, NULL);
3678 if (pull == NULL) {
3679 talloc_free(r);
3680 return false;
3683 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3684 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3685 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3686 talloc_free(r);
3687 return false;
3690 if (DEBUGLEVEL >= 10) {
3691 NDR_PRINT_IN_DEBUG(netr_LogonSamLogonWithFlags, r);
3694 ZERO_STRUCT(r->out);
3695 r->out.return_authenticator = r->in.return_authenticator;
3696 r->out.flags = r->in.flags;
3697 r->out.validation = talloc_zero(r, union netr_Validation);
3698 if (r->out.validation == NULL) {
3699 talloc_free(r);
3700 return false;
3703 r->out.authoritative = talloc_zero(r, uint8_t);
3704 if (r->out.authoritative == NULL) {
3705 talloc_free(r);
3706 return false;
3709 r->out.result = _netr_LogonSamLogonWithFlags(p, r);
3711 if (p->rng_fault_state) {
3712 talloc_free(r);
3713 /* Return true here, srv_pipe_hnd.c will take care */
3714 return true;
3717 if (DEBUGLEVEL >= 10) {
3718 NDR_PRINT_OUT_DEBUG(netr_LogonSamLogonWithFlags, r);
3721 push = ndr_push_init_ctx(r, NULL);
3722 if (push == NULL) {
3723 talloc_free(r);
3724 return false;
3727 ndr_err = call->ndr_push(push, NDR_OUT, r);
3728 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3729 talloc_free(r);
3730 return false;
3733 blob = ndr_push_blob(push);
3734 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3735 talloc_free(r);
3736 return false;
3739 talloc_free(r);
3741 return true;
3744 static bool api_netr_ServerGetTrustInfo(pipes_struct *p)
3746 const struct ndr_interface_call *call;
3747 struct ndr_pull *pull;
3748 struct ndr_push *push;
3749 enum ndr_err_code ndr_err;
3750 DATA_BLOB blob;
3751 struct netr_ServerGetTrustInfo *r;
3753 call = &ndr_table_netlogon.calls[NDR_NETR_SERVERGETTRUSTINFO];
3755 r = talloc(talloc_tos(), struct netr_ServerGetTrustInfo);
3756 if (r == NULL) {
3757 return false;
3760 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3761 talloc_free(r);
3762 return false;
3765 pull = ndr_pull_init_blob(&blob, r, NULL);
3766 if (pull == NULL) {
3767 talloc_free(r);
3768 return false;
3771 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3772 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3773 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3774 talloc_free(r);
3775 return false;
3778 if (DEBUGLEVEL >= 10) {
3779 NDR_PRINT_IN_DEBUG(netr_ServerGetTrustInfo, r);
3782 ZERO_STRUCT(r->out);
3783 r->out.return_authenticator = talloc_zero(r, struct netr_Authenticator);
3784 if (r->out.return_authenticator == NULL) {
3785 talloc_free(r);
3786 return false;
3789 r->out.new_owf_password = talloc_zero(r, struct samr_Password);
3790 if (r->out.new_owf_password == NULL) {
3791 talloc_free(r);
3792 return false;
3795 r->out.old_owf_password = talloc_zero(r, struct samr_Password);
3796 if (r->out.old_owf_password == NULL) {
3797 talloc_free(r);
3798 return false;
3801 r->out.trust_info = talloc_zero(r, struct netr_TrustInfo *);
3802 if (r->out.trust_info == NULL) {
3803 talloc_free(r);
3804 return false;
3807 r->out.result = _netr_ServerGetTrustInfo(p, r);
3809 if (p->rng_fault_state) {
3810 talloc_free(r);
3811 /* Return true here, srv_pipe_hnd.c will take care */
3812 return true;
3815 if (DEBUGLEVEL >= 10) {
3816 NDR_PRINT_OUT_DEBUG(netr_ServerGetTrustInfo, r);
3819 push = ndr_push_init_ctx(r, NULL);
3820 if (push == NULL) {
3821 talloc_free(r);
3822 return false;
3825 ndr_err = call->ndr_push(push, NDR_OUT, r);
3826 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3827 talloc_free(r);
3828 return false;
3831 blob = ndr_push_blob(push);
3832 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3833 talloc_free(r);
3834 return false;
3837 talloc_free(r);
3839 return true;
3843 /* Tables */
3844 static struct api_struct api_netlogon_cmds[] =
3846 {"NETR_LOGONUASLOGON", NDR_NETR_LOGONUASLOGON, api_netr_LogonUasLogon},
3847 {"NETR_LOGONUASLOGOFF", NDR_NETR_LOGONUASLOGOFF, api_netr_LogonUasLogoff},
3848 {"NETR_LOGONSAMLOGON", NDR_NETR_LOGONSAMLOGON, api_netr_LogonSamLogon},
3849 {"NETR_LOGONSAMLOGOFF", NDR_NETR_LOGONSAMLOGOFF, api_netr_LogonSamLogoff},
3850 {"NETR_SERVERREQCHALLENGE", NDR_NETR_SERVERREQCHALLENGE, api_netr_ServerReqChallenge},
3851 {"NETR_SERVERAUTHENTICATE", NDR_NETR_SERVERAUTHENTICATE, api_netr_ServerAuthenticate},
3852 {"NETR_SERVERPASSWORDSET", NDR_NETR_SERVERPASSWORDSET, api_netr_ServerPasswordSet},
3853 {"NETR_DATABASEDELTAS", NDR_NETR_DATABASEDELTAS, api_netr_DatabaseDeltas},
3854 {"NETR_DATABASESYNC", NDR_NETR_DATABASESYNC, api_netr_DatabaseSync},
3855 {"NETR_ACCOUNTDELTAS", NDR_NETR_ACCOUNTDELTAS, api_netr_AccountDeltas},
3856 {"NETR_ACCOUNTSYNC", NDR_NETR_ACCOUNTSYNC, api_netr_AccountSync},
3857 {"NETR_GETDCNAME", NDR_NETR_GETDCNAME, api_netr_GetDcName},
3858 {"NETR_LOGONCONTROL", NDR_NETR_LOGONCONTROL, api_netr_LogonControl},
3859 {"NETR_GETANYDCNAME", NDR_NETR_GETANYDCNAME, api_netr_GetAnyDCName},
3860 {"NETR_LOGONCONTROL2", NDR_NETR_LOGONCONTROL2, api_netr_LogonControl2},
3861 {"NETR_SERVERAUTHENTICATE2", NDR_NETR_SERVERAUTHENTICATE2, api_netr_ServerAuthenticate2},
3862 {"NETR_DATABASESYNC2", NDR_NETR_DATABASESYNC2, api_netr_DatabaseSync2},
3863 {"NETR_DATABASEREDO", NDR_NETR_DATABASEREDO, api_netr_DatabaseRedo},
3864 {"NETR_LOGONCONTROL2EX", NDR_NETR_LOGONCONTROL2EX, api_netr_LogonControl2Ex},
3865 {"NETR_NETRENUMERATETRUSTEDDOMAINS", NDR_NETR_NETRENUMERATETRUSTEDDOMAINS, api_netr_NetrEnumerateTrustedDomains},
3866 {"NETR_DSRGETDCNAME", NDR_NETR_DSRGETDCNAME, api_netr_DsRGetDCName},
3867 {"NETR_LOGONGETCAPABILITIES", NDR_NETR_LOGONGETCAPABILITIES, api_netr_LogonGetCapabilities},
3868 {"NETR_NETRLOGONSETSERVICEBITS", NDR_NETR_NETRLOGONSETSERVICEBITS, api_netr_NETRLOGONSETSERVICEBITS},
3869 {"NETR_LOGONGETTRUSTRID", NDR_NETR_LOGONGETTRUSTRID, api_netr_LogonGetTrustRid},
3870 {"NETR_NETRLOGONCOMPUTESERVERDIGEST", NDR_NETR_NETRLOGONCOMPUTESERVERDIGEST, api_netr_NETRLOGONCOMPUTESERVERDIGEST},
3871 {"NETR_NETRLOGONCOMPUTECLIENTDIGEST", NDR_NETR_NETRLOGONCOMPUTECLIENTDIGEST, api_netr_NETRLOGONCOMPUTECLIENTDIGEST},
3872 {"NETR_SERVERAUTHENTICATE3", NDR_NETR_SERVERAUTHENTICATE3, api_netr_ServerAuthenticate3},
3873 {"NETR_DSRGETDCNAMEEX", NDR_NETR_DSRGETDCNAMEEX, api_netr_DsRGetDCNameEx},
3874 {"NETR_DSRGETSITENAME", NDR_NETR_DSRGETSITENAME, api_netr_DsRGetSiteName},
3875 {"NETR_LOGONGETDOMAININFO", NDR_NETR_LOGONGETDOMAININFO, api_netr_LogonGetDomainInfo},
3876 {"NETR_SERVERPASSWORDSET2", NDR_NETR_SERVERPASSWORDSET2, api_netr_ServerPasswordSet2},
3877 {"NETR_SERVERPASSWORDGET", NDR_NETR_SERVERPASSWORDGET, api_netr_ServerPasswordGet},
3878 {"NETR_NETRLOGONSENDTOSAM", NDR_NETR_NETRLOGONSENDTOSAM, api_netr_NETRLOGONSENDTOSAM},
3879 {"NETR_DSRADDRESSTOSITENAMESW", NDR_NETR_DSRADDRESSTOSITENAMESW, api_netr_DsRAddressToSitenamesW},
3880 {"NETR_DSRGETDCNAMEEX2", NDR_NETR_DSRGETDCNAMEEX2, api_netr_DsRGetDCNameEx2},
3881 {"NETR_NETRLOGONGETTIMESERVICEPARENTDOMAIN", NDR_NETR_NETRLOGONGETTIMESERVICEPARENTDOMAIN, api_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN},
3882 {"NETR_NETRENUMERATETRUSTEDDOMAINSEX", NDR_NETR_NETRENUMERATETRUSTEDDOMAINSEX, api_netr_NetrEnumerateTrustedDomainsEx},
3883 {"NETR_DSRADDRESSTOSITENAMESEXW", NDR_NETR_DSRADDRESSTOSITENAMESEXW, api_netr_DsRAddressToSitenamesExW},
3884 {"NETR_DSRGETDCSITECOVERAGEW", NDR_NETR_DSRGETDCSITECOVERAGEW, api_netr_DsrGetDcSiteCoverageW},
3885 {"NETR_LOGONSAMLOGONEX", NDR_NETR_LOGONSAMLOGONEX, api_netr_LogonSamLogonEx},
3886 {"NETR_DSRENUMERATEDOMAINTRUSTS", NDR_NETR_DSRENUMERATEDOMAINTRUSTS, api_netr_DsrEnumerateDomainTrusts},
3887 {"NETR_DSRDEREGISTERDNSHOSTRECORDS", NDR_NETR_DSRDEREGISTERDNSHOSTRECORDS, api_netr_DsrDeregisterDNSHostRecords},
3888 {"NETR_SERVERTRUSTPASSWORDSGET", NDR_NETR_SERVERTRUSTPASSWORDSGET, api_netr_ServerTrustPasswordsGet},
3889 {"NETR_DSRGETFORESTTRUSTINFORMATION", NDR_NETR_DSRGETFORESTTRUSTINFORMATION, api_netr_DsRGetForestTrustInformation},
3890 {"NETR_GETFORESTTRUSTINFORMATION", NDR_NETR_GETFORESTTRUSTINFORMATION, api_netr_GetForestTrustInformation},
3891 {"NETR_LOGONSAMLOGONWITHFLAGS", NDR_NETR_LOGONSAMLOGONWITHFLAGS, api_netr_LogonSamLogonWithFlags},
3892 {"NETR_SERVERGETTRUSTINFO", NDR_NETR_SERVERGETTRUSTINFO, api_netr_ServerGetTrustInfo},
3895 void netlogon_get_pipe_fns(struct api_struct **fns, int *n_fns)
3897 *fns = api_netlogon_cmds;
3898 *n_fns = sizeof(api_netlogon_cmds) / sizeof(struct api_struct);
3901 NTSTATUS rpc_netlogon_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const struct ndr_interface_table *table, uint32_t opnum, void *_r)
3903 if (cli->pipes_struct == NULL) {
3904 return NT_STATUS_INVALID_PARAMETER;
3907 switch (opnum)
3909 case NDR_NETR_LOGONUASLOGON: {
3910 struct netr_LogonUasLogon *r = (struct netr_LogonUasLogon *)_r;
3911 ZERO_STRUCT(r->out);
3912 r->out.info = talloc_zero(mem_ctx, struct netr_UasInfo *);
3913 if (r->out.info == NULL) {
3914 return NT_STATUS_NO_MEMORY;
3917 r->out.result = _netr_LogonUasLogon(cli->pipes_struct, r);
3918 return NT_STATUS_OK;
3921 case NDR_NETR_LOGONUASLOGOFF: {
3922 struct netr_LogonUasLogoff *r = (struct netr_LogonUasLogoff *)_r;
3923 ZERO_STRUCT(r->out);
3924 r->out.info = talloc_zero(mem_ctx, struct netr_UasLogoffInfo);
3925 if (r->out.info == NULL) {
3926 return NT_STATUS_NO_MEMORY;
3929 r->out.result = _netr_LogonUasLogoff(cli->pipes_struct, r);
3930 return NT_STATUS_OK;
3933 case NDR_NETR_LOGONSAMLOGON: {
3934 struct netr_LogonSamLogon *r = (struct netr_LogonSamLogon *)_r;
3935 ZERO_STRUCT(r->out);
3936 r->out.return_authenticator = r->in.return_authenticator;
3937 r->out.validation = talloc_zero(mem_ctx, union netr_Validation);
3938 if (r->out.validation == NULL) {
3939 return NT_STATUS_NO_MEMORY;
3942 r->out.authoritative = talloc_zero(mem_ctx, uint8_t);
3943 if (r->out.authoritative == NULL) {
3944 return NT_STATUS_NO_MEMORY;
3947 r->out.result = _netr_LogonSamLogon(cli->pipes_struct, r);
3948 return NT_STATUS_OK;
3951 case NDR_NETR_LOGONSAMLOGOFF: {
3952 struct netr_LogonSamLogoff *r = (struct netr_LogonSamLogoff *)_r;
3953 ZERO_STRUCT(r->out);
3954 r->out.return_authenticator = r->in.return_authenticator;
3955 r->out.result = _netr_LogonSamLogoff(cli->pipes_struct, r);
3956 return NT_STATUS_OK;
3959 case NDR_NETR_SERVERREQCHALLENGE: {
3960 struct netr_ServerReqChallenge *r = (struct netr_ServerReqChallenge *)_r;
3961 ZERO_STRUCT(r->out);
3962 r->out.return_credentials = talloc_zero(mem_ctx, struct netr_Credential);
3963 if (r->out.return_credentials == NULL) {
3964 return NT_STATUS_NO_MEMORY;
3967 r->out.result = _netr_ServerReqChallenge(cli->pipes_struct, r);
3968 return NT_STATUS_OK;
3971 case NDR_NETR_SERVERAUTHENTICATE: {
3972 struct netr_ServerAuthenticate *r = (struct netr_ServerAuthenticate *)_r;
3973 ZERO_STRUCT(r->out);
3974 r->out.return_credentials = talloc_zero(mem_ctx, struct netr_Credential);
3975 if (r->out.return_credentials == NULL) {
3976 return NT_STATUS_NO_MEMORY;
3979 r->out.result = _netr_ServerAuthenticate(cli->pipes_struct, r);
3980 return NT_STATUS_OK;
3983 case NDR_NETR_SERVERPASSWORDSET: {
3984 struct netr_ServerPasswordSet *r = (struct netr_ServerPasswordSet *)_r;
3985 ZERO_STRUCT(r->out);
3986 r->out.return_authenticator = talloc_zero(mem_ctx, struct netr_Authenticator);
3987 if (r->out.return_authenticator == NULL) {
3988 return NT_STATUS_NO_MEMORY;
3991 r->out.result = _netr_ServerPasswordSet(cli->pipes_struct, r);
3992 return NT_STATUS_OK;
3995 case NDR_NETR_DATABASEDELTAS: {
3996 struct netr_DatabaseDeltas *r = (struct netr_DatabaseDeltas *)_r;
3997 ZERO_STRUCT(r->out);
3998 r->out.return_authenticator = r->in.return_authenticator;
3999 r->out.sequence_num = r->in.sequence_num;
4000 r->out.delta_enum_array = talloc_zero(mem_ctx, struct netr_DELTA_ENUM_ARRAY *);
4001 if (r->out.delta_enum_array == NULL) {
4002 return NT_STATUS_NO_MEMORY;
4005 r->out.result = _netr_DatabaseDeltas(cli->pipes_struct, r);
4006 return NT_STATUS_OK;
4009 case NDR_NETR_DATABASESYNC: {
4010 struct netr_DatabaseSync *r = (struct netr_DatabaseSync *)_r;
4011 ZERO_STRUCT(r->out);
4012 r->out.return_authenticator = r->in.return_authenticator;
4013 r->out.sync_context = r->in.sync_context;
4014 r->out.delta_enum_array = talloc_zero(mem_ctx, struct netr_DELTA_ENUM_ARRAY *);
4015 if (r->out.delta_enum_array == NULL) {
4016 return NT_STATUS_NO_MEMORY;
4019 r->out.result = _netr_DatabaseSync(cli->pipes_struct, r);
4020 return NT_STATUS_OK;
4023 case NDR_NETR_ACCOUNTDELTAS: {
4024 struct netr_AccountDeltas *r = (struct netr_AccountDeltas *)_r;
4025 ZERO_STRUCT(r->out);
4026 r->out.return_authenticator = r->in.return_authenticator;
4027 r->out.buffer = talloc_zero(mem_ctx, struct netr_AccountBuffer);
4028 if (r->out.buffer == NULL) {
4029 return NT_STATUS_NO_MEMORY;
4032 r->out.count_returned = talloc_zero(mem_ctx, uint32_t);
4033 if (r->out.count_returned == NULL) {
4034 return NT_STATUS_NO_MEMORY;
4037 r->out.total_entries = talloc_zero(mem_ctx, uint32_t);
4038 if (r->out.total_entries == NULL) {
4039 return NT_STATUS_NO_MEMORY;
4042 r->out.recordid = talloc_zero(mem_ctx, struct netr_UAS_INFO_0);
4043 if (r->out.recordid == NULL) {
4044 return NT_STATUS_NO_MEMORY;
4047 r->out.result = _netr_AccountDeltas(cli->pipes_struct, r);
4048 return NT_STATUS_OK;
4051 case NDR_NETR_ACCOUNTSYNC: {
4052 struct netr_AccountSync *r = (struct netr_AccountSync *)_r;
4053 ZERO_STRUCT(r->out);
4054 r->out.return_authenticator = r->in.return_authenticator;
4055 r->out.recordid = r->in.recordid;
4056 r->out.buffer = talloc_zero(mem_ctx, struct netr_AccountBuffer);
4057 if (r->out.buffer == NULL) {
4058 return NT_STATUS_NO_MEMORY;
4061 r->out.count_returned = talloc_zero(mem_ctx, uint32_t);
4062 if (r->out.count_returned == NULL) {
4063 return NT_STATUS_NO_MEMORY;
4066 r->out.total_entries = talloc_zero(mem_ctx, uint32_t);
4067 if (r->out.total_entries == NULL) {
4068 return NT_STATUS_NO_MEMORY;
4071 r->out.next_reference = talloc_zero(mem_ctx, uint32_t);
4072 if (r->out.next_reference == NULL) {
4073 return NT_STATUS_NO_MEMORY;
4076 r->out.result = _netr_AccountSync(cli->pipes_struct, r);
4077 return NT_STATUS_OK;
4080 case NDR_NETR_GETDCNAME: {
4081 struct netr_GetDcName *r = (struct netr_GetDcName *)_r;
4082 ZERO_STRUCT(r->out);
4083 r->out.dcname = talloc_zero(mem_ctx, const char *);
4084 if (r->out.dcname == NULL) {
4085 return NT_STATUS_NO_MEMORY;
4088 r->out.result = _netr_GetDcName(cli->pipes_struct, r);
4089 return NT_STATUS_OK;
4092 case NDR_NETR_LOGONCONTROL: {
4093 struct netr_LogonControl *r = (struct netr_LogonControl *)_r;
4094 ZERO_STRUCT(r->out);
4095 r->out.query = talloc_zero(mem_ctx, union netr_CONTROL_QUERY_INFORMATION);
4096 if (r->out.query == NULL) {
4097 return NT_STATUS_NO_MEMORY;
4100 r->out.result = _netr_LogonControl(cli->pipes_struct, r);
4101 return NT_STATUS_OK;
4104 case NDR_NETR_GETANYDCNAME: {
4105 struct netr_GetAnyDCName *r = (struct netr_GetAnyDCName *)_r;
4106 ZERO_STRUCT(r->out);
4107 r->out.dcname = talloc_zero(mem_ctx, const char *);
4108 if (r->out.dcname == NULL) {
4109 return NT_STATUS_NO_MEMORY;
4112 r->out.result = _netr_GetAnyDCName(cli->pipes_struct, r);
4113 return NT_STATUS_OK;
4116 case NDR_NETR_LOGONCONTROL2: {
4117 struct netr_LogonControl2 *r = (struct netr_LogonControl2 *)_r;
4118 ZERO_STRUCT(r->out);
4119 r->out.query = talloc_zero(mem_ctx, union netr_CONTROL_QUERY_INFORMATION);
4120 if (r->out.query == NULL) {
4121 return NT_STATUS_NO_MEMORY;
4124 r->out.result = _netr_LogonControl2(cli->pipes_struct, r);
4125 return NT_STATUS_OK;
4128 case NDR_NETR_SERVERAUTHENTICATE2: {
4129 struct netr_ServerAuthenticate2 *r = (struct netr_ServerAuthenticate2 *)_r;
4130 ZERO_STRUCT(r->out);
4131 r->out.negotiate_flags = r->in.negotiate_flags;
4132 r->out.return_credentials = talloc_zero(mem_ctx, struct netr_Credential);
4133 if (r->out.return_credentials == NULL) {
4134 return NT_STATUS_NO_MEMORY;
4137 r->out.result = _netr_ServerAuthenticate2(cli->pipes_struct, r);
4138 return NT_STATUS_OK;
4141 case NDR_NETR_DATABASESYNC2: {
4142 struct netr_DatabaseSync2 *r = (struct netr_DatabaseSync2 *)_r;
4143 ZERO_STRUCT(r->out);
4144 r->out.return_authenticator = r->in.return_authenticator;
4145 r->out.sync_context = r->in.sync_context;
4146 r->out.delta_enum_array = talloc_zero(mem_ctx, struct netr_DELTA_ENUM_ARRAY *);
4147 if (r->out.delta_enum_array == NULL) {
4148 return NT_STATUS_NO_MEMORY;
4151 r->out.result = _netr_DatabaseSync2(cli->pipes_struct, r);
4152 return NT_STATUS_OK;
4155 case NDR_NETR_DATABASEREDO: {
4156 struct netr_DatabaseRedo *r = (struct netr_DatabaseRedo *)_r;
4157 ZERO_STRUCT(r->out);
4158 r->out.return_authenticator = r->in.return_authenticator;
4159 r->out.delta_enum_array = talloc_zero(mem_ctx, struct netr_DELTA_ENUM_ARRAY *);
4160 if (r->out.delta_enum_array == NULL) {
4161 return NT_STATUS_NO_MEMORY;
4164 r->out.result = _netr_DatabaseRedo(cli->pipes_struct, r);
4165 return NT_STATUS_OK;
4168 case NDR_NETR_LOGONCONTROL2EX: {
4169 struct netr_LogonControl2Ex *r = (struct netr_LogonControl2Ex *)_r;
4170 ZERO_STRUCT(r->out);
4171 r->out.query = talloc_zero(mem_ctx, union netr_CONTROL_QUERY_INFORMATION);
4172 if (r->out.query == NULL) {
4173 return NT_STATUS_NO_MEMORY;
4176 r->out.result = _netr_LogonControl2Ex(cli->pipes_struct, r);
4177 return NT_STATUS_OK;
4180 case NDR_NETR_NETRENUMERATETRUSTEDDOMAINS: {
4181 struct netr_NetrEnumerateTrustedDomains *r = (struct netr_NetrEnumerateTrustedDomains *)_r;
4182 ZERO_STRUCT(r->out);
4183 r->out.trusted_domains_blob = talloc_zero(mem_ctx, struct netr_Blob);
4184 if (r->out.trusted_domains_blob == NULL) {
4185 return NT_STATUS_NO_MEMORY;
4188 r->out.result = _netr_NetrEnumerateTrustedDomains(cli->pipes_struct, r);
4189 return NT_STATUS_OK;
4192 case NDR_NETR_DSRGETDCNAME: {
4193 struct netr_DsRGetDCName *r = (struct netr_DsRGetDCName *)_r;
4194 ZERO_STRUCT(r->out);
4195 r->out.info = talloc_zero(mem_ctx, struct netr_DsRGetDCNameInfo *);
4196 if (r->out.info == NULL) {
4197 return NT_STATUS_NO_MEMORY;
4200 r->out.result = _netr_DsRGetDCName(cli->pipes_struct, r);
4201 return NT_STATUS_OK;
4204 case NDR_NETR_LOGONGETCAPABILITIES: {
4205 struct netr_LogonGetCapabilities *r = (struct netr_LogonGetCapabilities *)_r;
4206 ZERO_STRUCT(r->out);
4207 r->out.return_authenticator = r->in.return_authenticator;
4208 r->out.capabilities = talloc_zero(mem_ctx, union netr_Capabilities);
4209 if (r->out.capabilities == NULL) {
4210 return NT_STATUS_NO_MEMORY;
4213 r->out.result = _netr_LogonGetCapabilities(cli->pipes_struct, r);
4214 return NT_STATUS_OK;
4217 case NDR_NETR_NETRLOGONSETSERVICEBITS: {
4218 struct netr_NETRLOGONSETSERVICEBITS *r = (struct netr_NETRLOGONSETSERVICEBITS *)_r;
4219 r->out.result = _netr_NETRLOGONSETSERVICEBITS(cli->pipes_struct, r);
4220 return NT_STATUS_OK;
4223 case NDR_NETR_LOGONGETTRUSTRID: {
4224 struct netr_LogonGetTrustRid *r = (struct netr_LogonGetTrustRid *)_r;
4225 ZERO_STRUCT(r->out);
4226 r->out.rid = talloc_zero(mem_ctx, uint32_t);
4227 if (r->out.rid == NULL) {
4228 return NT_STATUS_NO_MEMORY;
4231 r->out.result = _netr_LogonGetTrustRid(cli->pipes_struct, r);
4232 return NT_STATUS_OK;
4235 case NDR_NETR_NETRLOGONCOMPUTESERVERDIGEST: {
4236 struct netr_NETRLOGONCOMPUTESERVERDIGEST *r = (struct netr_NETRLOGONCOMPUTESERVERDIGEST *)_r;
4237 r->out.result = _netr_NETRLOGONCOMPUTESERVERDIGEST(cli->pipes_struct, r);
4238 return NT_STATUS_OK;
4241 case NDR_NETR_NETRLOGONCOMPUTECLIENTDIGEST: {
4242 struct netr_NETRLOGONCOMPUTECLIENTDIGEST *r = (struct netr_NETRLOGONCOMPUTECLIENTDIGEST *)_r;
4243 r->out.result = _netr_NETRLOGONCOMPUTECLIENTDIGEST(cli->pipes_struct, r);
4244 return NT_STATUS_OK;
4247 case NDR_NETR_SERVERAUTHENTICATE3: {
4248 struct netr_ServerAuthenticate3 *r = (struct netr_ServerAuthenticate3 *)_r;
4249 ZERO_STRUCT(r->out);
4250 r->out.negotiate_flags = r->in.negotiate_flags;
4251 r->out.return_credentials = talloc_zero(mem_ctx, struct netr_Credential);
4252 if (r->out.return_credentials == NULL) {
4253 return NT_STATUS_NO_MEMORY;
4256 r->out.rid = talloc_zero(mem_ctx, uint32_t);
4257 if (r->out.rid == NULL) {
4258 return NT_STATUS_NO_MEMORY;
4261 r->out.result = _netr_ServerAuthenticate3(cli->pipes_struct, r);
4262 return NT_STATUS_OK;
4265 case NDR_NETR_DSRGETDCNAMEEX: {
4266 struct netr_DsRGetDCNameEx *r = (struct netr_DsRGetDCNameEx *)_r;
4267 ZERO_STRUCT(r->out);
4268 r->out.info = talloc_zero(mem_ctx, struct netr_DsRGetDCNameInfo *);
4269 if (r->out.info == NULL) {
4270 return NT_STATUS_NO_MEMORY;
4273 r->out.result = _netr_DsRGetDCNameEx(cli->pipes_struct, r);
4274 return NT_STATUS_OK;
4277 case NDR_NETR_DSRGETSITENAME: {
4278 struct netr_DsRGetSiteName *r = (struct netr_DsRGetSiteName *)_r;
4279 ZERO_STRUCT(r->out);
4280 r->out.site = talloc_zero(mem_ctx, const char *);
4281 if (r->out.site == NULL) {
4282 return NT_STATUS_NO_MEMORY;
4285 r->out.result = _netr_DsRGetSiteName(cli->pipes_struct, r);
4286 return NT_STATUS_OK;
4289 case NDR_NETR_LOGONGETDOMAININFO: {
4290 struct netr_LogonGetDomainInfo *r = (struct netr_LogonGetDomainInfo *)_r;
4291 ZERO_STRUCT(r->out);
4292 r->out.return_authenticator = r->in.return_authenticator;
4293 r->out.info = talloc_zero(mem_ctx, union netr_DomainInfo);
4294 if (r->out.info == NULL) {
4295 return NT_STATUS_NO_MEMORY;
4298 r->out.result = _netr_LogonGetDomainInfo(cli->pipes_struct, r);
4299 return NT_STATUS_OK;
4302 case NDR_NETR_SERVERPASSWORDSET2: {
4303 struct netr_ServerPasswordSet2 *r = (struct netr_ServerPasswordSet2 *)_r;
4304 ZERO_STRUCT(r->out);
4305 r->out.return_authenticator = talloc_zero(mem_ctx, struct netr_Authenticator);
4306 if (r->out.return_authenticator == NULL) {
4307 return NT_STATUS_NO_MEMORY;
4310 r->out.result = _netr_ServerPasswordSet2(cli->pipes_struct, r);
4311 return NT_STATUS_OK;
4314 case NDR_NETR_SERVERPASSWORDGET: {
4315 struct netr_ServerPasswordGet *r = (struct netr_ServerPasswordGet *)_r;
4316 ZERO_STRUCT(r->out);
4317 r->out.return_authenticator = talloc_zero(mem_ctx, struct netr_Authenticator);
4318 if (r->out.return_authenticator == NULL) {
4319 return NT_STATUS_NO_MEMORY;
4322 r->out.password = talloc_zero(mem_ctx, struct samr_Password);
4323 if (r->out.password == NULL) {
4324 return NT_STATUS_NO_MEMORY;
4327 r->out.result = _netr_ServerPasswordGet(cli->pipes_struct, r);
4328 return NT_STATUS_OK;
4331 case NDR_NETR_NETRLOGONSENDTOSAM: {
4332 struct netr_NETRLOGONSENDTOSAM *r = (struct netr_NETRLOGONSENDTOSAM *)_r;
4333 r->out.result = _netr_NETRLOGONSENDTOSAM(cli->pipes_struct, r);
4334 return NT_STATUS_OK;
4337 case NDR_NETR_DSRADDRESSTOSITENAMESW: {
4338 struct netr_DsRAddressToSitenamesW *r = (struct netr_DsRAddressToSitenamesW *)_r;
4339 ZERO_STRUCT(r->out);
4340 r->out.ctr = talloc_zero(mem_ctx, struct netr_DsRAddressToSitenamesWCtr *);
4341 if (r->out.ctr == NULL) {
4342 return NT_STATUS_NO_MEMORY;
4345 r->out.result = _netr_DsRAddressToSitenamesW(cli->pipes_struct, r);
4346 return NT_STATUS_OK;
4349 case NDR_NETR_DSRGETDCNAMEEX2: {
4350 struct netr_DsRGetDCNameEx2 *r = (struct netr_DsRGetDCNameEx2 *)_r;
4351 ZERO_STRUCT(r->out);
4352 r->out.info = talloc_zero(mem_ctx, struct netr_DsRGetDCNameInfo *);
4353 if (r->out.info == NULL) {
4354 return NT_STATUS_NO_MEMORY;
4357 r->out.result = _netr_DsRGetDCNameEx2(cli->pipes_struct, r);
4358 return NT_STATUS_OK;
4361 case NDR_NETR_NETRLOGONGETTIMESERVICEPARENTDOMAIN: {
4362 struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN *r = (struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN *)_r;
4363 r->out.result = _netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(cli->pipes_struct, r);
4364 return NT_STATUS_OK;
4367 case NDR_NETR_NETRENUMERATETRUSTEDDOMAINSEX: {
4368 struct netr_NetrEnumerateTrustedDomainsEx *r = (struct netr_NetrEnumerateTrustedDomainsEx *)_r;
4369 ZERO_STRUCT(r->out);
4370 r->out.dom_trust_list = talloc_zero(mem_ctx, struct netr_DomainTrustList);
4371 if (r->out.dom_trust_list == NULL) {
4372 return NT_STATUS_NO_MEMORY;
4375 r->out.result = _netr_NetrEnumerateTrustedDomainsEx(cli->pipes_struct, r);
4376 return NT_STATUS_OK;
4379 case NDR_NETR_DSRADDRESSTOSITENAMESEXW: {
4380 struct netr_DsRAddressToSitenamesExW *r = (struct netr_DsRAddressToSitenamesExW *)_r;
4381 ZERO_STRUCT(r->out);
4382 r->out.ctr = talloc_zero(mem_ctx, struct netr_DsRAddressToSitenamesExWCtr *);
4383 if (r->out.ctr == NULL) {
4384 return NT_STATUS_NO_MEMORY;
4387 r->out.result = _netr_DsRAddressToSitenamesExW(cli->pipes_struct, r);
4388 return NT_STATUS_OK;
4391 case NDR_NETR_DSRGETDCSITECOVERAGEW: {
4392 struct netr_DsrGetDcSiteCoverageW *r = (struct netr_DsrGetDcSiteCoverageW *)_r;
4393 ZERO_STRUCT(r->out);
4394 r->out.ctr = talloc_zero(mem_ctx, struct DcSitesCtr *);
4395 if (r->out.ctr == NULL) {
4396 return NT_STATUS_NO_MEMORY;
4399 r->out.result = _netr_DsrGetDcSiteCoverageW(cli->pipes_struct, r);
4400 return NT_STATUS_OK;
4403 case NDR_NETR_LOGONSAMLOGONEX: {
4404 struct netr_LogonSamLogonEx *r = (struct netr_LogonSamLogonEx *)_r;
4405 ZERO_STRUCT(r->out);
4406 r->out.flags = r->in.flags;
4407 r->out.validation = talloc_zero(mem_ctx, union netr_Validation);
4408 if (r->out.validation == NULL) {
4409 return NT_STATUS_NO_MEMORY;
4412 r->out.authoritative = talloc_zero(mem_ctx, uint8_t);
4413 if (r->out.authoritative == NULL) {
4414 return NT_STATUS_NO_MEMORY;
4417 r->out.result = _netr_LogonSamLogonEx(cli->pipes_struct, r);
4418 return NT_STATUS_OK;
4421 case NDR_NETR_DSRENUMERATEDOMAINTRUSTS: {
4422 struct netr_DsrEnumerateDomainTrusts *r = (struct netr_DsrEnumerateDomainTrusts *)_r;
4423 ZERO_STRUCT(r->out);
4424 r->out.trusts = talloc_zero(mem_ctx, struct netr_DomainTrustList);
4425 if (r->out.trusts == NULL) {
4426 return NT_STATUS_NO_MEMORY;
4429 r->out.result = _netr_DsrEnumerateDomainTrusts(cli->pipes_struct, r);
4430 return NT_STATUS_OK;
4433 case NDR_NETR_DSRDEREGISTERDNSHOSTRECORDS: {
4434 struct netr_DsrDeregisterDNSHostRecords *r = (struct netr_DsrDeregisterDNSHostRecords *)_r;
4435 r->out.result = _netr_DsrDeregisterDNSHostRecords(cli->pipes_struct, r);
4436 return NT_STATUS_OK;
4439 case NDR_NETR_SERVERTRUSTPASSWORDSGET: {
4440 struct netr_ServerTrustPasswordsGet *r = (struct netr_ServerTrustPasswordsGet *)_r;
4441 ZERO_STRUCT(r->out);
4442 r->out.return_authenticator = talloc_zero(mem_ctx, struct netr_Authenticator);
4443 if (r->out.return_authenticator == NULL) {
4444 return NT_STATUS_NO_MEMORY;
4447 r->out.password = talloc_zero(mem_ctx, struct samr_Password);
4448 if (r->out.password == NULL) {
4449 return NT_STATUS_NO_MEMORY;
4452 r->out.password2 = talloc_zero(mem_ctx, struct samr_Password);
4453 if (r->out.password2 == NULL) {
4454 return NT_STATUS_NO_MEMORY;
4457 r->out.result = _netr_ServerTrustPasswordsGet(cli->pipes_struct, r);
4458 return NT_STATUS_OK;
4461 case NDR_NETR_DSRGETFORESTTRUSTINFORMATION: {
4462 struct netr_DsRGetForestTrustInformation *r = (struct netr_DsRGetForestTrustInformation *)_r;
4463 ZERO_STRUCT(r->out);
4464 r->out.forest_trust_info = talloc_zero(mem_ctx, struct lsa_ForestTrustInformation *);
4465 if (r->out.forest_trust_info == NULL) {
4466 return NT_STATUS_NO_MEMORY;
4469 r->out.result = _netr_DsRGetForestTrustInformation(cli->pipes_struct, r);
4470 return NT_STATUS_OK;
4473 case NDR_NETR_GETFORESTTRUSTINFORMATION: {
4474 struct netr_GetForestTrustInformation *r = (struct netr_GetForestTrustInformation *)_r;
4475 ZERO_STRUCT(r->out);
4476 r->out.return_authenticator = talloc_zero(mem_ctx, struct netr_Authenticator);
4477 if (r->out.return_authenticator == NULL) {
4478 return NT_STATUS_NO_MEMORY;
4481 r->out.forest_trust_info = talloc_zero(mem_ctx, struct lsa_ForestTrustInformation *);
4482 if (r->out.forest_trust_info == NULL) {
4483 return NT_STATUS_NO_MEMORY;
4486 r->out.result = _netr_GetForestTrustInformation(cli->pipes_struct, r);
4487 return NT_STATUS_OK;
4490 case NDR_NETR_LOGONSAMLOGONWITHFLAGS: {
4491 struct netr_LogonSamLogonWithFlags *r = (struct netr_LogonSamLogonWithFlags *)_r;
4492 ZERO_STRUCT(r->out);
4493 r->out.return_authenticator = r->in.return_authenticator;
4494 r->out.flags = r->in.flags;
4495 r->out.validation = talloc_zero(mem_ctx, union netr_Validation);
4496 if (r->out.validation == NULL) {
4497 return NT_STATUS_NO_MEMORY;
4500 r->out.authoritative = talloc_zero(mem_ctx, uint8_t);
4501 if (r->out.authoritative == NULL) {
4502 return NT_STATUS_NO_MEMORY;
4505 r->out.result = _netr_LogonSamLogonWithFlags(cli->pipes_struct, r);
4506 return NT_STATUS_OK;
4509 case NDR_NETR_SERVERGETTRUSTINFO: {
4510 struct netr_ServerGetTrustInfo *r = (struct netr_ServerGetTrustInfo *)_r;
4511 ZERO_STRUCT(r->out);
4512 r->out.return_authenticator = talloc_zero(mem_ctx, struct netr_Authenticator);
4513 if (r->out.return_authenticator == NULL) {
4514 return NT_STATUS_NO_MEMORY;
4517 r->out.new_owf_password = talloc_zero(mem_ctx, struct samr_Password);
4518 if (r->out.new_owf_password == NULL) {
4519 return NT_STATUS_NO_MEMORY;
4522 r->out.old_owf_password = talloc_zero(mem_ctx, struct samr_Password);
4523 if (r->out.old_owf_password == NULL) {
4524 return NT_STATUS_NO_MEMORY;
4527 r->out.trust_info = talloc_zero(mem_ctx, struct netr_TrustInfo *);
4528 if (r->out.trust_info == NULL) {
4529 return NT_STATUS_NO_MEMORY;
4532 r->out.result = _netr_ServerGetTrustInfo(cli->pipes_struct, r);
4533 return NT_STATUS_OK;
4536 default:
4537 return NT_STATUS_NOT_IMPLEMENTED;
4541 NTSTATUS rpc_netlogon_init(void)
4543 return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "netlogon", "netlogon", &ndr_table_netlogon, api_netlogon_cmds, sizeof(api_netlogon_cmds) / sizeof(struct api_struct));