Revert "re-run make idl."
[tprouty/samba.git] / source / librpc / gen_ndr / cli_netlogon.c
1 /*
2  * Unix SMB/CIFS implementation.
3  * client auto-generated by pidl. DO NOT MODIFY!
4  */
5
6 #include "includes.h"
7 #include "librpc/gen_ndr/cli_netlogon.h"
8
9 NTSTATUS rpccli_netr_LogonUasLogon(struct rpc_pipe_client *cli,
10                                    TALLOC_CTX *mem_ctx,
11                                    const char *server_name /* [in] [unique,charset(UTF16)] */,
12                                    const char *account_name /* [in] [charset(UTF16)] */,
13                                    const char *workstation /* [in] [charset(UTF16)] */,
14                                    struct netr_UasInfo *info /* [out] [ref] */,
15                                    WERROR *werror)
16 {
17         struct netr_LogonUasLogon r;
18         NTSTATUS status;
19
20         /* In parameters */
21         r.in.server_name = server_name;
22         r.in.account_name = account_name;
23         r.in.workstation = workstation;
24
25         if (DEBUGLEVEL >= 10) {
26                 NDR_PRINT_IN_DEBUG(netr_LogonUasLogon, &r);
27         }
28
29         status = cli_do_rpc_ndr(cli,
30                                 mem_ctx,
31                                 PI_NETLOGON,
32                                 &ndr_table_netlogon,
33                                 NDR_NETR_LOGONUASLOGON,
34                                 &r);
35
36         if (!NT_STATUS_IS_OK(status)) {
37                 return status;
38         }
39
40         if (DEBUGLEVEL >= 10) {
41                 NDR_PRINT_OUT_DEBUG(netr_LogonUasLogon, &r);
42         }
43
44         if (NT_STATUS_IS_ERR(status)) {
45                 return status;
46         }
47
48         /* Return variables */
49         *info = *r.out.info;
50
51         /* Return result */
52         if (werror) {
53                 *werror = r.out.result;
54         }
55
56         return werror_to_ntstatus(r.out.result);
57 }
58
59 NTSTATUS rpccli_netr_LogonUasLogoff(struct rpc_pipe_client *cli,
60                                     TALLOC_CTX *mem_ctx,
61                                     const char *server_name /* [in] [unique,charset(UTF16)] */,
62                                     const char *account_name /* [in] [charset(UTF16)] */,
63                                     const char *workstation /* [in] [charset(UTF16)] */,
64                                     struct netr_UasLogoffInfo *info /* [out] [ref] */,
65                                     WERROR *werror)
66 {
67         struct netr_LogonUasLogoff r;
68         NTSTATUS status;
69
70         /* In parameters */
71         r.in.server_name = server_name;
72         r.in.account_name = account_name;
73         r.in.workstation = workstation;
74
75         if (DEBUGLEVEL >= 10) {
76                 NDR_PRINT_IN_DEBUG(netr_LogonUasLogoff, &r);
77         }
78
79         status = cli_do_rpc_ndr(cli,
80                                 mem_ctx,
81                                 PI_NETLOGON,
82                                 &ndr_table_netlogon,
83                                 NDR_NETR_LOGONUASLOGOFF,
84                                 &r);
85
86         if (!NT_STATUS_IS_OK(status)) {
87                 return status;
88         }
89
90         if (DEBUGLEVEL >= 10) {
91                 NDR_PRINT_OUT_DEBUG(netr_LogonUasLogoff, &r);
92         }
93
94         if (NT_STATUS_IS_ERR(status)) {
95                 return status;
96         }
97
98         /* Return variables */
99         *info = *r.out.info;
100
101         /* Return result */
102         if (werror) {
103                 *werror = r.out.result;
104         }
105
106         return werror_to_ntstatus(r.out.result);
107 }
108
109 NTSTATUS rpccli_netr_LogonSamLogon(struct rpc_pipe_client *cli,
110                                    TALLOC_CTX *mem_ctx,
111                                    const char *server_name /* [in] [unique,charset(UTF16)] */,
112                                    const char *computer_name /* [in] [unique,charset(UTF16)] */,
113                                    struct netr_Authenticator *credential /* [in] [unique] */,
114                                    struct netr_Authenticator *return_authenticator /* [in,out] [unique] */,
115                                    enum netr_LogonLevel logon_level /* [in]  */,
116                                    union netr_LogonInfo *logon /* [in] [ref,switch_is(logon_level)] */,
117                                    uint16_t validation_level /* [in]  */,
118                                    union netr_Validation *validation /* [out] [ref,switch_is(validation_level)] */,
119                                    uint8_t *authoritative /* [out] [ref] */)
120 {
121         struct netr_LogonSamLogon r;
122         NTSTATUS status;
123
124         /* In parameters */
125         r.in.server_name = server_name;
126         r.in.computer_name = computer_name;
127         r.in.credential = credential;
128         r.in.return_authenticator = return_authenticator;
129         r.in.logon_level = logon_level;
130         r.in.logon = logon;
131         r.in.validation_level = validation_level;
132
133         if (DEBUGLEVEL >= 10) {
134                 NDR_PRINT_IN_DEBUG(netr_LogonSamLogon, &r);
135         }
136
137         status = cli_do_rpc_ndr(cli,
138                                 mem_ctx,
139                                 PI_NETLOGON,
140                                 &ndr_table_netlogon,
141                                 NDR_NETR_LOGONSAMLOGON,
142                                 &r);
143
144         if (!NT_STATUS_IS_OK(status)) {
145                 return status;
146         }
147
148         if (DEBUGLEVEL >= 10) {
149                 NDR_PRINT_OUT_DEBUG(netr_LogonSamLogon, &r);
150         }
151
152         if (NT_STATUS_IS_ERR(status)) {
153                 return status;
154         }
155
156         /* Return variables */
157         if (return_authenticator && r.out.return_authenticator) {
158                 *return_authenticator = *r.out.return_authenticator;
159         }
160         *validation = *r.out.validation;
161         *authoritative = *r.out.authoritative;
162
163         /* Return result */
164         return r.out.result;
165 }
166
167 NTSTATUS rpccli_netr_LogonSamLogoff(struct rpc_pipe_client *cli,
168                                     TALLOC_CTX *mem_ctx,
169                                     const char *server_name /* [in] [unique,charset(UTF16)] */,
170                                     const char *computer_name /* [in] [unique,charset(UTF16)] */,
171                                     struct netr_Authenticator *credential /* [in] [unique] */,
172                                     struct netr_Authenticator *return_authenticator /* [in,out] [unique] */,
173                                     enum netr_LogonLevel logon_level /* [in]  */,
174                                     union netr_LogonInfo logon /* [in] [switch_is(logon_level)] */)
175 {
176         struct netr_LogonSamLogoff r;
177         NTSTATUS status;
178
179         /* In parameters */
180         r.in.server_name = server_name;
181         r.in.computer_name = computer_name;
182         r.in.credential = credential;
183         r.in.return_authenticator = return_authenticator;
184         r.in.logon_level = logon_level;
185         r.in.logon = logon;
186
187         if (DEBUGLEVEL >= 10) {
188                 NDR_PRINT_IN_DEBUG(netr_LogonSamLogoff, &r);
189         }
190
191         status = cli_do_rpc_ndr(cli,
192                                 mem_ctx,
193                                 PI_NETLOGON,
194                                 &ndr_table_netlogon,
195                                 NDR_NETR_LOGONSAMLOGOFF,
196                                 &r);
197
198         if (!NT_STATUS_IS_OK(status)) {
199                 return status;
200         }
201
202         if (DEBUGLEVEL >= 10) {
203                 NDR_PRINT_OUT_DEBUG(netr_LogonSamLogoff, &r);
204         }
205
206         if (NT_STATUS_IS_ERR(status)) {
207                 return status;
208         }
209
210         /* Return variables */
211         if (return_authenticator && r.out.return_authenticator) {
212                 *return_authenticator = *r.out.return_authenticator;
213         }
214
215         /* Return result */
216         return r.out.result;
217 }
218
219 NTSTATUS rpccli_netr_ServerReqChallenge(struct rpc_pipe_client *cli,
220                                         TALLOC_CTX *mem_ctx,
221                                         const char *server_name /* [in] [unique,charset(UTF16)] */,
222                                         const char *computer_name /* [in] [charset(UTF16)] */,
223                                         struct netr_Credential *credentials /* [in] [ref] */,
224                                         struct netr_Credential *return_credentials /* [out] [ref] */)
225 {
226         struct netr_ServerReqChallenge r;
227         NTSTATUS status;
228
229         /* In parameters */
230         r.in.server_name = server_name;
231         r.in.computer_name = computer_name;
232         r.in.credentials = credentials;
233
234         if (DEBUGLEVEL >= 10) {
235                 NDR_PRINT_IN_DEBUG(netr_ServerReqChallenge, &r);
236         }
237
238         status = cli_do_rpc_ndr(cli,
239                                 mem_ctx,
240                                 PI_NETLOGON,
241                                 &ndr_table_netlogon,
242                                 NDR_NETR_SERVERREQCHALLENGE,
243                                 &r);
244
245         if (!NT_STATUS_IS_OK(status)) {
246                 return status;
247         }
248
249         if (DEBUGLEVEL >= 10) {
250                 NDR_PRINT_OUT_DEBUG(netr_ServerReqChallenge, &r);
251         }
252
253         if (NT_STATUS_IS_ERR(status)) {
254                 return status;
255         }
256
257         /* Return variables */
258         *return_credentials = *r.out.return_credentials;
259
260         /* Return result */
261         return r.out.result;
262 }
263
264 NTSTATUS rpccli_netr_ServerAuthenticate(struct rpc_pipe_client *cli,
265                                         TALLOC_CTX *mem_ctx,
266                                         const char *server_name /* [in] [unique,charset(UTF16)] */,
267                                         const char *account_name /* [in] [charset(UTF16)] */,
268                                         enum netr_SchannelType secure_channel_type /* [in]  */,
269                                         const char *computer_name /* [in] [charset(UTF16)] */,
270                                         struct netr_Credential *credentials /* [in] [ref] */,
271                                         struct netr_Credential *return_credentials /* [out] [ref] */)
272 {
273         struct netr_ServerAuthenticate r;
274         NTSTATUS status;
275
276         /* In parameters */
277         r.in.server_name = server_name;
278         r.in.account_name = account_name;
279         r.in.secure_channel_type = secure_channel_type;
280         r.in.computer_name = computer_name;
281         r.in.credentials = credentials;
282
283         if (DEBUGLEVEL >= 10) {
284                 NDR_PRINT_IN_DEBUG(netr_ServerAuthenticate, &r);
285         }
286
287         status = cli_do_rpc_ndr(cli,
288                                 mem_ctx,
289                                 PI_NETLOGON,
290                                 &ndr_table_netlogon,
291                                 NDR_NETR_SERVERAUTHENTICATE,
292                                 &r);
293
294         if (!NT_STATUS_IS_OK(status)) {
295                 return status;
296         }
297
298         if (DEBUGLEVEL >= 10) {
299                 NDR_PRINT_OUT_DEBUG(netr_ServerAuthenticate, &r);
300         }
301
302         if (NT_STATUS_IS_ERR(status)) {
303                 return status;
304         }
305
306         /* Return variables */
307         *return_credentials = *r.out.return_credentials;
308
309         /* Return result */
310         return r.out.result;
311 }
312
313 NTSTATUS rpccli_netr_ServerPasswordSet(struct rpc_pipe_client *cli,
314                                        TALLOC_CTX *mem_ctx,
315                                        const char *server_name /* [in] [unique,charset(UTF16)] */,
316                                        const char *account_name /* [in] [charset(UTF16)] */,
317                                        enum netr_SchannelType secure_channel_type /* [in]  */,
318                                        const char *computer_name /* [in] [charset(UTF16)] */,
319                                        struct netr_Authenticator *credential /* [in] [ref] */,
320                                        struct netr_Authenticator *return_authenticator /* [out] [ref] */,
321                                        struct samr_Password *new_password /* [in] [ref] */)
322 {
323         struct netr_ServerPasswordSet r;
324         NTSTATUS status;
325
326         /* In parameters */
327         r.in.server_name = server_name;
328         r.in.account_name = account_name;
329         r.in.secure_channel_type = secure_channel_type;
330         r.in.computer_name = computer_name;
331         r.in.credential = credential;
332         r.in.new_password = new_password;
333
334         if (DEBUGLEVEL >= 10) {
335                 NDR_PRINT_IN_DEBUG(netr_ServerPasswordSet, &r);
336         }
337
338         status = cli_do_rpc_ndr(cli,
339                                 mem_ctx,
340                                 PI_NETLOGON,
341                                 &ndr_table_netlogon,
342                                 NDR_NETR_SERVERPASSWORDSET,
343                                 &r);
344
345         if (!NT_STATUS_IS_OK(status)) {
346                 return status;
347         }
348
349         if (DEBUGLEVEL >= 10) {
350                 NDR_PRINT_OUT_DEBUG(netr_ServerPasswordSet, &r);
351         }
352
353         if (NT_STATUS_IS_ERR(status)) {
354                 return status;
355         }
356
357         /* Return variables */
358         *return_authenticator = *r.out.return_authenticator;
359
360         /* Return result */
361         return r.out.result;
362 }
363
364 NTSTATUS rpccli_netr_DatabaseDeltas(struct rpc_pipe_client *cli,
365                                     TALLOC_CTX *mem_ctx,
366                                     const char *logon_server /* [in] [charset(UTF16)] */,
367                                     const char *computername /* [in] [charset(UTF16)] */,
368                                     struct netr_Authenticator *credential /* [in] [ref] */,
369                                     struct netr_Authenticator *return_authenticator /* [in,out] [ref] */,
370                                     enum netr_SamDatabaseID database_id /* [in]  */,
371                                     uint64_t *sequence_num /* [in,out] [ref] */,
372                                     struct netr_DELTA_ENUM_ARRAY **delta_enum_array /* [out] [ref] */,
373                                     uint32_t preferredmaximumlength /* [in]  */)
374 {
375         struct netr_DatabaseDeltas r;
376         NTSTATUS status;
377
378         /* In parameters */
379         r.in.logon_server = logon_server;
380         r.in.computername = computername;
381         r.in.credential = credential;
382         r.in.return_authenticator = return_authenticator;
383         r.in.database_id = database_id;
384         r.in.sequence_num = sequence_num;
385         r.in.preferredmaximumlength = preferredmaximumlength;
386
387         if (DEBUGLEVEL >= 10) {
388                 NDR_PRINT_IN_DEBUG(netr_DatabaseDeltas, &r);
389         }
390
391         status = cli_do_rpc_ndr(cli,
392                                 mem_ctx,
393                                 PI_NETLOGON,
394                                 &ndr_table_netlogon,
395                                 NDR_NETR_DATABASEDELTAS,
396                                 &r);
397
398         if (!NT_STATUS_IS_OK(status)) {
399                 return status;
400         }
401
402         if (DEBUGLEVEL >= 10) {
403                 NDR_PRINT_OUT_DEBUG(netr_DatabaseDeltas, &r);
404         }
405
406         if (NT_STATUS_IS_ERR(status)) {
407                 return status;
408         }
409
410         /* Return variables */
411         *return_authenticator = *r.out.return_authenticator;
412         *sequence_num = *r.out.sequence_num;
413         *delta_enum_array = *r.out.delta_enum_array;
414
415         /* Return result */
416         return r.out.result;
417 }
418
419 NTSTATUS rpccli_netr_DatabaseSync(struct rpc_pipe_client *cli,
420                                   TALLOC_CTX *mem_ctx,
421                                   const char *logon_server /* [in] [charset(UTF16)] */,
422                                   const char *computername /* [in] [charset(UTF16)] */,
423                                   struct netr_Authenticator credential /* [in]  */,
424                                   struct netr_Authenticator *return_authenticator /* [in,out] [ref] */,
425                                   enum netr_SamDatabaseID database_id /* [in]  */,
426                                   uint32_t *sync_context /* [in,out] [ref] */,
427                                   uint32_t preferredmaximumlength /* [in]  */,
428                                   struct netr_DELTA_ENUM_ARRAY *delta_enum_array /* [out] [ref] */)
429 {
430         struct netr_DatabaseSync r;
431         NTSTATUS status;
432
433         /* In parameters */
434         r.in.logon_server = logon_server;
435         r.in.computername = computername;
436         r.in.credential = credential;
437         r.in.return_authenticator = return_authenticator;
438         r.in.database_id = database_id;
439         r.in.sync_context = sync_context;
440         r.in.preferredmaximumlength = preferredmaximumlength;
441
442         if (DEBUGLEVEL >= 10) {
443                 NDR_PRINT_IN_DEBUG(netr_DatabaseSync, &r);
444         }
445
446         status = cli_do_rpc_ndr(cli,
447                                 mem_ctx,
448                                 PI_NETLOGON,
449                                 &ndr_table_netlogon,
450                                 NDR_NETR_DATABASESYNC,
451                                 &r);
452
453         if (!NT_STATUS_IS_OK(status)) {
454                 return status;
455         }
456
457         if (DEBUGLEVEL >= 10) {
458                 NDR_PRINT_OUT_DEBUG(netr_DatabaseSync, &r);
459         }
460
461         if (NT_STATUS_IS_ERR(status)) {
462                 return status;
463         }
464
465         /* Return variables */
466         *return_authenticator = *r.out.return_authenticator;
467         *sync_context = *r.out.sync_context;
468         *delta_enum_array = *r.out.delta_enum_array;
469
470         /* Return result */
471         return r.out.result;
472 }
473
474 NTSTATUS rpccli_netr_AccountDeltas(struct rpc_pipe_client *cli,
475                                    TALLOC_CTX *mem_ctx,
476                                    const char *logon_server /* [in] [unique,charset(UTF16)] */,
477                                    const char *computername /* [in] [charset(UTF16)] */,
478                                    struct netr_Authenticator credential /* [in]  */,
479                                    struct netr_Authenticator *return_authenticator /* [in,out] [ref] */,
480                                    struct netr_UAS_INFO_0 uas /* [in]  */,
481                                    uint32_t count /* [in]  */,
482                                    uint32_t level /* [in]  */,
483                                    uint32_t buffersize /* [in]  */,
484                                    struct netr_AccountBuffer *buffer /* [out] [ref,subcontext(4)] */,
485                                    uint32_t *count_returned /* [out] [ref] */,
486                                    uint32_t *total_entries /* [out] [ref] */,
487                                    struct netr_UAS_INFO_0 *recordid /* [out] [ref] */)
488 {
489         struct netr_AccountDeltas r;
490         NTSTATUS status;
491
492         /* In parameters */
493         r.in.logon_server = logon_server;
494         r.in.computername = computername;
495         r.in.credential = credential;
496         r.in.return_authenticator = return_authenticator;
497         r.in.uas = uas;
498         r.in.count = count;
499         r.in.level = level;
500         r.in.buffersize = buffersize;
501
502         if (DEBUGLEVEL >= 10) {
503                 NDR_PRINT_IN_DEBUG(netr_AccountDeltas, &r);
504         }
505
506         status = cli_do_rpc_ndr(cli,
507                                 mem_ctx,
508                                 PI_NETLOGON,
509                                 &ndr_table_netlogon,
510                                 NDR_NETR_ACCOUNTDELTAS,
511                                 &r);
512
513         if (!NT_STATUS_IS_OK(status)) {
514                 return status;
515         }
516
517         if (DEBUGLEVEL >= 10) {
518                 NDR_PRINT_OUT_DEBUG(netr_AccountDeltas, &r);
519         }
520
521         if (NT_STATUS_IS_ERR(status)) {
522                 return status;
523         }
524
525         /* Return variables */
526         *return_authenticator = *r.out.return_authenticator;
527         *buffer = *r.out.buffer;
528         *count_returned = *r.out.count_returned;
529         *total_entries = *r.out.total_entries;
530         *recordid = *r.out.recordid;
531
532         /* Return result */
533         return r.out.result;
534 }
535
536 NTSTATUS rpccli_netr_AccountSync(struct rpc_pipe_client *cli,
537                                  TALLOC_CTX *mem_ctx,
538                                  const char *logon_server /* [in] [unique,charset(UTF16)] */,
539                                  const char *computername /* [in] [charset(UTF16)] */,
540                                  struct netr_Authenticator credential /* [in]  */,
541                                  struct netr_Authenticator *return_authenticator /* [in,out] [ref] */,
542                                  uint32_t reference /* [in]  */,
543                                  uint32_t level /* [in]  */,
544                                  uint32_t buffersize /* [in]  */,
545                                  struct netr_AccountBuffer *buffer /* [out] [ref,subcontext(4)] */,
546                                  uint32_t *count_returned /* [out] [ref] */,
547                                  uint32_t *total_entries /* [out] [ref] */,
548                                  uint32_t *next_reference /* [out] [ref] */,
549                                  struct netr_UAS_INFO_0 *recordid /* [in,out] [ref] */)
550 {
551         struct netr_AccountSync r;
552         NTSTATUS status;
553
554         /* In parameters */
555         r.in.logon_server = logon_server;
556         r.in.computername = computername;
557         r.in.credential = credential;
558         r.in.return_authenticator = return_authenticator;
559         r.in.reference = reference;
560         r.in.level = level;
561         r.in.buffersize = buffersize;
562         r.in.recordid = recordid;
563
564         if (DEBUGLEVEL >= 10) {
565                 NDR_PRINT_IN_DEBUG(netr_AccountSync, &r);
566         }
567
568         status = cli_do_rpc_ndr(cli,
569                                 mem_ctx,
570                                 PI_NETLOGON,
571                                 &ndr_table_netlogon,
572                                 NDR_NETR_ACCOUNTSYNC,
573                                 &r);
574
575         if (!NT_STATUS_IS_OK(status)) {
576                 return status;
577         }
578
579         if (DEBUGLEVEL >= 10) {
580                 NDR_PRINT_OUT_DEBUG(netr_AccountSync, &r);
581         }
582
583         if (NT_STATUS_IS_ERR(status)) {
584                 return status;
585         }
586
587         /* Return variables */
588         *return_authenticator = *r.out.return_authenticator;
589         *buffer = *r.out.buffer;
590         *count_returned = *r.out.count_returned;
591         *total_entries = *r.out.total_entries;
592         *next_reference = *r.out.next_reference;
593         *recordid = *r.out.recordid;
594
595         /* Return result */
596         return r.out.result;
597 }
598
599 NTSTATUS rpccli_netr_GetDcName(struct rpc_pipe_client *cli,
600                                TALLOC_CTX *mem_ctx,
601                                const char *logon_server /* [in] [charset(UTF16)] */,
602                                const char *domainname /* [in] [unique,charset(UTF16)] */,
603                                const char **dcname /* [out] [ref,charset(UTF16)] */,
604                                WERROR *werror)
605 {
606         struct netr_GetDcName r;
607         NTSTATUS status;
608
609         /* In parameters */
610         r.in.logon_server = logon_server;
611         r.in.domainname = domainname;
612
613         if (DEBUGLEVEL >= 10) {
614                 NDR_PRINT_IN_DEBUG(netr_GetDcName, &r);
615         }
616
617         status = cli_do_rpc_ndr(cli,
618                                 mem_ctx,
619                                 PI_NETLOGON,
620                                 &ndr_table_netlogon,
621                                 NDR_NETR_GETDCNAME,
622                                 &r);
623
624         if (!NT_STATUS_IS_OK(status)) {
625                 return status;
626         }
627
628         if (DEBUGLEVEL >= 10) {
629                 NDR_PRINT_OUT_DEBUG(netr_GetDcName, &r);
630         }
631
632         if (NT_STATUS_IS_ERR(status)) {
633                 return status;
634         }
635
636         /* Return variables */
637         *dcname = *r.out.dcname;
638
639         /* Return result */
640         if (werror) {
641                 *werror = r.out.result;
642         }
643
644         return werror_to_ntstatus(r.out.result);
645 }
646
647 NTSTATUS rpccli_netr_LogonControl(struct rpc_pipe_client *cli,
648                                   TALLOC_CTX *mem_ctx,
649                                   const char *logon_server /* [in] [unique,charset(UTF16)] */,
650                                   enum netr_LogonControlCode function_code /* [in]  */,
651                                   uint32_t level /* [in]  */,
652                                   union netr_CONTROL_QUERY_INFORMATION *info /* [out] [ref,switch_is(level)] */,
653                                   WERROR *werror)
654 {
655         struct netr_LogonControl r;
656         NTSTATUS status;
657
658         /* In parameters */
659         r.in.logon_server = logon_server;
660         r.in.function_code = function_code;
661         r.in.level = level;
662
663         if (DEBUGLEVEL >= 10) {
664                 NDR_PRINT_IN_DEBUG(netr_LogonControl, &r);
665         }
666
667         status = cli_do_rpc_ndr(cli,
668                                 mem_ctx,
669                                 PI_NETLOGON,
670                                 &ndr_table_netlogon,
671                                 NDR_NETR_LOGONCONTROL,
672                                 &r);
673
674         if (!NT_STATUS_IS_OK(status)) {
675                 return status;
676         }
677
678         if (DEBUGLEVEL >= 10) {
679                 NDR_PRINT_OUT_DEBUG(netr_LogonControl, &r);
680         }
681
682         if (NT_STATUS_IS_ERR(status)) {
683                 return status;
684         }
685
686         /* Return variables */
687         *info = *r.out.info;
688
689         /* Return result */
690         if (werror) {
691                 *werror = r.out.result;
692         }
693
694         return werror_to_ntstatus(r.out.result);
695 }
696
697 NTSTATUS rpccli_netr_GetAnyDCName(struct rpc_pipe_client *cli,
698                                   TALLOC_CTX *mem_ctx,
699                                   const char *logon_server /* [in] [unique,charset(UTF16)] */,
700                                   const char *domainname /* [in] [unique,charset(UTF16)] */,
701                                   const char **dcname /* [out] [ref,charset(UTF16)] */,
702                                   WERROR *werror)
703 {
704         struct netr_GetAnyDCName r;
705         NTSTATUS status;
706
707         /* In parameters */
708         r.in.logon_server = logon_server;
709         r.in.domainname = domainname;
710
711         if (DEBUGLEVEL >= 10) {
712                 NDR_PRINT_IN_DEBUG(netr_GetAnyDCName, &r);
713         }
714
715         status = cli_do_rpc_ndr(cli,
716                                 mem_ctx,
717                                 PI_NETLOGON,
718                                 &ndr_table_netlogon,
719                                 NDR_NETR_GETANYDCNAME,
720                                 &r);
721
722         if (!NT_STATUS_IS_OK(status)) {
723                 return status;
724         }
725
726         if (DEBUGLEVEL >= 10) {
727                 NDR_PRINT_OUT_DEBUG(netr_GetAnyDCName, &r);
728         }
729
730         if (NT_STATUS_IS_ERR(status)) {
731                 return status;
732         }
733
734         /* Return variables */
735         *dcname = *r.out.dcname;
736
737         /* Return result */
738         if (werror) {
739                 *werror = r.out.result;
740         }
741
742         return werror_to_ntstatus(r.out.result);
743 }
744
745 NTSTATUS rpccli_netr_LogonControl2(struct rpc_pipe_client *cli,
746                                    TALLOC_CTX *mem_ctx,
747                                    const char *logon_server /* [in] [unique,charset(UTF16)] */,
748                                    enum netr_LogonControlCode function_code /* [in]  */,
749                                    uint32_t level /* [in]  */,
750                                    union netr_CONTROL_DATA_INFORMATION *data /* [in] [ref,switch_is(function_code)] */,
751                                    union netr_CONTROL_QUERY_INFORMATION *query /* [out] [ref,switch_is(level)] */,
752                                    WERROR *werror)
753 {
754         struct netr_LogonControl2 r;
755         NTSTATUS status;
756
757         /* In parameters */
758         r.in.logon_server = logon_server;
759         r.in.function_code = function_code;
760         r.in.level = level;
761         r.in.data = data;
762
763         if (DEBUGLEVEL >= 10) {
764                 NDR_PRINT_IN_DEBUG(netr_LogonControl2, &r);
765         }
766
767         status = cli_do_rpc_ndr(cli,
768                                 mem_ctx,
769                                 PI_NETLOGON,
770                                 &ndr_table_netlogon,
771                                 NDR_NETR_LOGONCONTROL2,
772                                 &r);
773
774         if (!NT_STATUS_IS_OK(status)) {
775                 return status;
776         }
777
778         if (DEBUGLEVEL >= 10) {
779                 NDR_PRINT_OUT_DEBUG(netr_LogonControl2, &r);
780         }
781
782         if (NT_STATUS_IS_ERR(status)) {
783                 return status;
784         }
785
786         /* Return variables */
787         *query = *r.out.query;
788
789         /* Return result */
790         if (werror) {
791                 *werror = r.out.result;
792         }
793
794         return werror_to_ntstatus(r.out.result);
795 }
796
797 NTSTATUS rpccli_netr_ServerAuthenticate2(struct rpc_pipe_client *cli,
798                                          TALLOC_CTX *mem_ctx,
799                                          const char *server_name /* [in] [unique,charset(UTF16)] */,
800                                          const char *account_name /* [in] [charset(UTF16)] */,
801                                          enum netr_SchannelType secure_channel_type /* [in]  */,
802                                          const char *computer_name /* [in] [charset(UTF16)] */,
803                                          struct netr_Credential *credentials /* [in] [ref] */,
804                                          struct netr_Credential *return_credentials /* [out] [ref] */,
805                                          uint32_t *negotiate_flags /* [in,out] [ref] */)
806 {
807         struct netr_ServerAuthenticate2 r;
808         NTSTATUS status;
809
810         /* In parameters */
811         r.in.server_name = server_name;
812         r.in.account_name = account_name;
813         r.in.secure_channel_type = secure_channel_type;
814         r.in.computer_name = computer_name;
815         r.in.credentials = credentials;
816         r.in.negotiate_flags = negotiate_flags;
817
818         if (DEBUGLEVEL >= 10) {
819                 NDR_PRINT_IN_DEBUG(netr_ServerAuthenticate2, &r);
820         }
821
822         status = cli_do_rpc_ndr(cli,
823                                 mem_ctx,
824                                 PI_NETLOGON,
825                                 &ndr_table_netlogon,
826                                 NDR_NETR_SERVERAUTHENTICATE2,
827                                 &r);
828
829         if (!NT_STATUS_IS_OK(status)) {
830                 return status;
831         }
832
833         if (DEBUGLEVEL >= 10) {
834                 NDR_PRINT_OUT_DEBUG(netr_ServerAuthenticate2, &r);
835         }
836
837         if (NT_STATUS_IS_ERR(status)) {
838                 return status;
839         }
840
841         /* Return variables */
842         *return_credentials = *r.out.return_credentials;
843         *negotiate_flags = *r.out.negotiate_flags;
844
845         /* Return result */
846         return r.out.result;
847 }
848
849 NTSTATUS rpccli_netr_DatabaseSync2(struct rpc_pipe_client *cli,
850                                    TALLOC_CTX *mem_ctx,
851                                    const char *logon_server /* [in] [charset(UTF16)] */,
852                                    const char *computername /* [in] [charset(UTF16)] */,
853                                    struct netr_Authenticator *credential /* [in] [ref] */,
854                                    struct netr_Authenticator *return_authenticator /* [in,out] [ref] */,
855                                    enum netr_SamDatabaseID database_id /* [in]  */,
856                                    uint16_t restart_state /* [in]  */,
857                                    uint32_t *sync_context /* [in,out] [ref] */,
858                                    struct netr_DELTA_ENUM_ARRAY **delta_enum_array /* [out] [ref] */,
859                                    uint32_t preferredmaximumlength /* [in]  */)
860 {
861         struct netr_DatabaseSync2 r;
862         NTSTATUS status;
863
864         /* In parameters */
865         r.in.logon_server = logon_server;
866         r.in.computername = computername;
867         r.in.credential = credential;
868         r.in.return_authenticator = return_authenticator;
869         r.in.database_id = database_id;
870         r.in.restart_state = restart_state;
871         r.in.sync_context = sync_context;
872         r.in.preferredmaximumlength = preferredmaximumlength;
873
874         if (DEBUGLEVEL >= 10) {
875                 NDR_PRINT_IN_DEBUG(netr_DatabaseSync2, &r);
876         }
877
878         status = cli_do_rpc_ndr(cli,
879                                 mem_ctx,
880                                 PI_NETLOGON,
881                                 &ndr_table_netlogon,
882                                 NDR_NETR_DATABASESYNC2,
883                                 &r);
884
885         if (!NT_STATUS_IS_OK(status)) {
886                 return status;
887         }
888
889         if (DEBUGLEVEL >= 10) {
890                 NDR_PRINT_OUT_DEBUG(netr_DatabaseSync2, &r);
891         }
892
893         if (NT_STATUS_IS_ERR(status)) {
894                 return status;
895         }
896
897         /* Return variables */
898         *return_authenticator = *r.out.return_authenticator;
899         *sync_context = *r.out.sync_context;
900         *delta_enum_array = *r.out.delta_enum_array;
901
902         /* Return result */
903         return r.out.result;
904 }
905
906 NTSTATUS rpccli_netr_DatabaseRedo(struct rpc_pipe_client *cli,
907                                   TALLOC_CTX *mem_ctx,
908                                   const char *logon_server /* [in] [charset(UTF16)] */,
909                                   const char *computername /* [in] [charset(UTF16)] */,
910                                   struct netr_Authenticator credential /* [in]  */,
911                                   struct netr_Authenticator *return_authenticator /* [in,out] [ref] */,
912                                   uint8_t *change_log_entry /* [in] [unique,size_is(change_log_entry_size)] */,
913                                   uint32_t change_log_entry_size /* [in]  */,
914                                   struct netr_DELTA_ENUM_ARRAY *delta_enum_array /* [out] [ref] */)
915 {
916         struct netr_DatabaseRedo r;
917         NTSTATUS status;
918
919         /* In parameters */
920         r.in.logon_server = logon_server;
921         r.in.computername = computername;
922         r.in.credential = credential;
923         r.in.return_authenticator = return_authenticator;
924         r.in.change_log_entry = change_log_entry;
925         r.in.change_log_entry_size = change_log_entry_size;
926
927         if (DEBUGLEVEL >= 10) {
928                 NDR_PRINT_IN_DEBUG(netr_DatabaseRedo, &r);
929         }
930
931         status = cli_do_rpc_ndr(cli,
932                                 mem_ctx,
933                                 PI_NETLOGON,
934                                 &ndr_table_netlogon,
935                                 NDR_NETR_DATABASEREDO,
936                                 &r);
937
938         if (!NT_STATUS_IS_OK(status)) {
939                 return status;
940         }
941
942         if (DEBUGLEVEL >= 10) {
943                 NDR_PRINT_OUT_DEBUG(netr_DatabaseRedo, &r);
944         }
945
946         if (NT_STATUS_IS_ERR(status)) {
947                 return status;
948         }
949
950         /* Return variables */
951         *return_authenticator = *r.out.return_authenticator;
952         *delta_enum_array = *r.out.delta_enum_array;
953
954         /* Return result */
955         return r.out.result;
956 }
957
958 NTSTATUS rpccli_netr_LogonControl2Ex(struct rpc_pipe_client *cli,
959                                      TALLOC_CTX *mem_ctx,
960                                      const char *logon_server /* [in] [unique,charset(UTF16)] */,
961                                      uint32_t function_code /* [in]  */,
962                                      uint32_t level /* [in]  */,
963                                      union netr_CONTROL_DATA_INFORMATION data /* [in] [switch_is(function_code)] */,
964                                      union netr_CONTROL_QUERY_INFORMATION *query /* [out] [ref,switch_is(level)] */,
965                                      WERROR *werror)
966 {
967         struct netr_LogonControl2Ex r;
968         NTSTATUS status;
969
970         /* In parameters */
971         r.in.logon_server = logon_server;
972         r.in.function_code = function_code;
973         r.in.level = level;
974         r.in.data = data;
975
976         if (DEBUGLEVEL >= 10) {
977                 NDR_PRINT_IN_DEBUG(netr_LogonControl2Ex, &r);
978         }
979
980         status = cli_do_rpc_ndr(cli,
981                                 mem_ctx,
982                                 PI_NETLOGON,
983                                 &ndr_table_netlogon,
984                                 NDR_NETR_LOGONCONTROL2EX,
985                                 &r);
986
987         if (!NT_STATUS_IS_OK(status)) {
988                 return status;
989         }
990
991         if (DEBUGLEVEL >= 10) {
992                 NDR_PRINT_OUT_DEBUG(netr_LogonControl2Ex, &r);
993         }
994
995         if (NT_STATUS_IS_ERR(status)) {
996                 return status;
997         }
998
999         /* Return variables */
1000         *query = *r.out.query;
1001
1002         /* Return result */
1003         if (werror) {
1004                 *werror = r.out.result;
1005         }
1006
1007         return werror_to_ntstatus(r.out.result);
1008 }
1009
1010 NTSTATUS rpccli_netr_NetrEnumerateTrustedDomains(struct rpc_pipe_client *cli,
1011                                                  TALLOC_CTX *mem_ctx,
1012                                                  const char *server_name /* [in] [unique,charset(UTF16)] */,
1013                                                  struct netr_Blob *trusted_domains_blob /* [out] [ref] */,
1014                                                  WERROR *werror)
1015 {
1016         struct netr_NetrEnumerateTrustedDomains r;
1017         NTSTATUS status;
1018
1019         /* In parameters */
1020         r.in.server_name = server_name;
1021
1022         if (DEBUGLEVEL >= 10) {
1023                 NDR_PRINT_IN_DEBUG(netr_NetrEnumerateTrustedDomains, &r);
1024         }
1025
1026         status = cli_do_rpc_ndr(cli,
1027                                 mem_ctx,
1028                                 PI_NETLOGON,
1029                                 &ndr_table_netlogon,
1030                                 NDR_NETR_NETRENUMERATETRUSTEDDOMAINS,
1031                                 &r);
1032
1033         if (!NT_STATUS_IS_OK(status)) {
1034                 return status;
1035         }
1036
1037         if (DEBUGLEVEL >= 10) {
1038                 NDR_PRINT_OUT_DEBUG(netr_NetrEnumerateTrustedDomains, &r);
1039         }
1040
1041         if (NT_STATUS_IS_ERR(status)) {
1042                 return status;
1043         }
1044
1045         /* Return variables */
1046         *trusted_domains_blob = *r.out.trusted_domains_blob;
1047
1048         /* Return result */
1049         if (werror) {
1050                 *werror = r.out.result;
1051         }
1052
1053         return werror_to_ntstatus(r.out.result);
1054 }
1055
1056 NTSTATUS rpccli_netr_DsRGetDCName(struct rpc_pipe_client *cli,
1057                                   TALLOC_CTX *mem_ctx,
1058                                   const char *server_unc /* [in] [unique,charset(UTF16)] */,
1059                                   const char *domain_name /* [in] [unique,charset(UTF16)] */,
1060                                   struct GUID *domain_guid /* [in] [unique] */,
1061                                   struct GUID *site_guid /* [in] [unique] */,
1062                                   uint32_t flags /* [in]  */,
1063                                   struct netr_DsRGetDCNameInfo **info /* [out] [ref] */,
1064                                   WERROR *werror)
1065 {
1066         struct netr_DsRGetDCName r;
1067         NTSTATUS status;
1068
1069         /* In parameters */
1070         r.in.server_unc = server_unc;
1071         r.in.domain_name = domain_name;
1072         r.in.domain_guid = domain_guid;
1073         r.in.site_guid = site_guid;
1074         r.in.flags = flags;
1075
1076         if (DEBUGLEVEL >= 10) {
1077                 NDR_PRINT_IN_DEBUG(netr_DsRGetDCName, &r);
1078         }
1079
1080         status = cli_do_rpc_ndr(cli,
1081                                 mem_ctx,
1082                                 PI_NETLOGON,
1083                                 &ndr_table_netlogon,
1084                                 NDR_NETR_DSRGETDCNAME,
1085                                 &r);
1086
1087         if (!NT_STATUS_IS_OK(status)) {
1088                 return status;
1089         }
1090
1091         if (DEBUGLEVEL >= 10) {
1092                 NDR_PRINT_OUT_DEBUG(netr_DsRGetDCName, &r);
1093         }
1094
1095         if (NT_STATUS_IS_ERR(status)) {
1096                 return status;
1097         }
1098
1099         /* Return variables */
1100         *info = *r.out.info;
1101
1102         /* Return result */
1103         if (werror) {
1104                 *werror = r.out.result;
1105         }
1106
1107         return werror_to_ntstatus(r.out.result);
1108 }
1109
1110 NTSTATUS rpccli_netr_NETRLOGONDUMMYROUTINE1(struct rpc_pipe_client *cli,
1111                                             TALLOC_CTX *mem_ctx,
1112                                             WERROR *werror)
1113 {
1114         struct netr_NETRLOGONDUMMYROUTINE1 r;
1115         NTSTATUS status;
1116
1117         /* In parameters */
1118
1119         if (DEBUGLEVEL >= 10) {
1120                 NDR_PRINT_IN_DEBUG(netr_NETRLOGONDUMMYROUTINE1, &r);
1121         }
1122
1123         status = cli_do_rpc_ndr(cli,
1124                                 mem_ctx,
1125                                 PI_NETLOGON,
1126                                 &ndr_table_netlogon,
1127                                 NDR_NETR_NETRLOGONDUMMYROUTINE1,
1128                                 &r);
1129
1130         if (!NT_STATUS_IS_OK(status)) {
1131                 return status;
1132         }
1133
1134         if (DEBUGLEVEL >= 10) {
1135                 NDR_PRINT_OUT_DEBUG(netr_NETRLOGONDUMMYROUTINE1, &r);
1136         }
1137
1138         if (NT_STATUS_IS_ERR(status)) {
1139                 return status;
1140         }
1141
1142         /* Return variables */
1143
1144         /* Return result */
1145         if (werror) {
1146                 *werror = r.out.result;
1147         }
1148
1149         return werror_to_ntstatus(r.out.result);
1150 }
1151
1152 NTSTATUS rpccli_netr_NETRLOGONSETSERVICEBITS(struct rpc_pipe_client *cli,
1153                                              TALLOC_CTX *mem_ctx,
1154                                              WERROR *werror)
1155 {
1156         struct netr_NETRLOGONSETSERVICEBITS r;
1157         NTSTATUS status;
1158
1159         /* In parameters */
1160
1161         if (DEBUGLEVEL >= 10) {
1162                 NDR_PRINT_IN_DEBUG(netr_NETRLOGONSETSERVICEBITS, &r);
1163         }
1164
1165         status = cli_do_rpc_ndr(cli,
1166                                 mem_ctx,
1167                                 PI_NETLOGON,
1168                                 &ndr_table_netlogon,
1169                                 NDR_NETR_NETRLOGONSETSERVICEBITS,
1170                                 &r);
1171
1172         if (!NT_STATUS_IS_OK(status)) {
1173                 return status;
1174         }
1175
1176         if (DEBUGLEVEL >= 10) {
1177                 NDR_PRINT_OUT_DEBUG(netr_NETRLOGONSETSERVICEBITS, &r);
1178         }
1179
1180         if (NT_STATUS_IS_ERR(status)) {
1181                 return status;
1182         }
1183
1184         /* Return variables */
1185
1186         /* Return result */
1187         if (werror) {
1188                 *werror = r.out.result;
1189         }
1190
1191         return werror_to_ntstatus(r.out.result);
1192 }
1193
1194 NTSTATUS rpccli_netr_LogonGetTrustRid(struct rpc_pipe_client *cli,
1195                                       TALLOC_CTX *mem_ctx,
1196                                       const char *server_name /* [in] [unique,charset(UTF16)] */,
1197                                       const char *domain_name /* [in] [unique,charset(UTF16)] */,
1198                                       uint32_t *rid /* [out] [ref] */,
1199                                       WERROR *werror)
1200 {
1201         struct netr_LogonGetTrustRid r;
1202         NTSTATUS status;
1203
1204         /* In parameters */
1205         r.in.server_name = server_name;
1206         r.in.domain_name = domain_name;
1207
1208         if (DEBUGLEVEL >= 10) {
1209                 NDR_PRINT_IN_DEBUG(netr_LogonGetTrustRid, &r);
1210         }
1211
1212         status = cli_do_rpc_ndr(cli,
1213                                 mem_ctx,
1214                                 PI_NETLOGON,
1215                                 &ndr_table_netlogon,
1216                                 NDR_NETR_LOGONGETTRUSTRID,
1217                                 &r);
1218
1219         if (!NT_STATUS_IS_OK(status)) {
1220                 return status;
1221         }
1222
1223         if (DEBUGLEVEL >= 10) {
1224                 NDR_PRINT_OUT_DEBUG(netr_LogonGetTrustRid, &r);
1225         }
1226
1227         if (NT_STATUS_IS_ERR(status)) {
1228                 return status;
1229         }
1230
1231         /* Return variables */
1232         *rid = *r.out.rid;
1233
1234         /* Return result */
1235         if (werror) {
1236                 *werror = r.out.result;
1237         }
1238
1239         return werror_to_ntstatus(r.out.result);
1240 }
1241
1242 NTSTATUS rpccli_netr_NETRLOGONCOMPUTESERVERDIGEST(struct rpc_pipe_client *cli,
1243                                                   TALLOC_CTX *mem_ctx,
1244                                                   WERROR *werror)
1245 {
1246         struct netr_NETRLOGONCOMPUTESERVERDIGEST r;
1247         NTSTATUS status;
1248
1249         /* In parameters */
1250
1251         if (DEBUGLEVEL >= 10) {
1252                 NDR_PRINT_IN_DEBUG(netr_NETRLOGONCOMPUTESERVERDIGEST, &r);
1253         }
1254
1255         status = cli_do_rpc_ndr(cli,
1256                                 mem_ctx,
1257                                 PI_NETLOGON,
1258                                 &ndr_table_netlogon,
1259                                 NDR_NETR_NETRLOGONCOMPUTESERVERDIGEST,
1260                                 &r);
1261
1262         if (!NT_STATUS_IS_OK(status)) {
1263                 return status;
1264         }
1265
1266         if (DEBUGLEVEL >= 10) {
1267                 NDR_PRINT_OUT_DEBUG(netr_NETRLOGONCOMPUTESERVERDIGEST, &r);
1268         }
1269
1270         if (NT_STATUS_IS_ERR(status)) {
1271                 return status;
1272         }
1273
1274         /* Return variables */
1275
1276         /* Return result */
1277         if (werror) {
1278                 *werror = r.out.result;
1279         }
1280
1281         return werror_to_ntstatus(r.out.result);
1282 }
1283
1284 NTSTATUS rpccli_netr_NETRLOGONCOMPUTECLIENTDIGEST(struct rpc_pipe_client *cli,
1285                                                   TALLOC_CTX *mem_ctx,
1286                                                   WERROR *werror)
1287 {
1288         struct netr_NETRLOGONCOMPUTECLIENTDIGEST r;
1289         NTSTATUS status;
1290
1291         /* In parameters */
1292
1293         if (DEBUGLEVEL >= 10) {
1294                 NDR_PRINT_IN_DEBUG(netr_NETRLOGONCOMPUTECLIENTDIGEST, &r);
1295         }
1296
1297         status = cli_do_rpc_ndr(cli,
1298                                 mem_ctx,
1299                                 PI_NETLOGON,
1300                                 &ndr_table_netlogon,
1301                                 NDR_NETR_NETRLOGONCOMPUTECLIENTDIGEST,
1302                                 &r);
1303
1304         if (!NT_STATUS_IS_OK(status)) {
1305                 return status;
1306         }
1307
1308         if (DEBUGLEVEL >= 10) {
1309                 NDR_PRINT_OUT_DEBUG(netr_NETRLOGONCOMPUTECLIENTDIGEST, &r);
1310         }
1311
1312         if (NT_STATUS_IS_ERR(status)) {
1313                 return status;
1314         }
1315
1316         /* Return variables */
1317
1318         /* Return result */
1319         if (werror) {
1320                 *werror = r.out.result;
1321         }
1322
1323         return werror_to_ntstatus(r.out.result);
1324 }
1325
1326 NTSTATUS rpccli_netr_ServerAuthenticate3(struct rpc_pipe_client *cli,
1327                                          TALLOC_CTX *mem_ctx,
1328                                          const char *server_name /* [in] [unique,charset(UTF16)] */,
1329                                          const char *account_name /* [in] [charset(UTF16)] */,
1330                                          enum netr_SchannelType secure_channel_type /* [in]  */,
1331                                          const char *computer_name /* [in] [charset(UTF16)] */,
1332                                          struct netr_Credential *credentials /* [in,out] [ref] */,
1333                                          uint32_t *negotiate_flags /* [in,out] [ref] */,
1334                                          uint32_t *rid /* [out] [ref] */)
1335 {
1336         struct netr_ServerAuthenticate3 r;
1337         NTSTATUS status;
1338
1339         /* In parameters */
1340         r.in.server_name = server_name;
1341         r.in.account_name = account_name;
1342         r.in.secure_channel_type = secure_channel_type;
1343         r.in.computer_name = computer_name;
1344         r.in.credentials = credentials;
1345         r.in.negotiate_flags = negotiate_flags;
1346
1347         if (DEBUGLEVEL >= 10) {
1348                 NDR_PRINT_IN_DEBUG(netr_ServerAuthenticate3, &r);
1349         }
1350
1351         status = cli_do_rpc_ndr(cli,
1352                                 mem_ctx,
1353                                 PI_NETLOGON,
1354                                 &ndr_table_netlogon,
1355                                 NDR_NETR_SERVERAUTHENTICATE3,
1356                                 &r);
1357
1358         if (!NT_STATUS_IS_OK(status)) {
1359                 return status;
1360         }
1361
1362         if (DEBUGLEVEL >= 10) {
1363                 NDR_PRINT_OUT_DEBUG(netr_ServerAuthenticate3, &r);
1364         }
1365
1366         if (NT_STATUS_IS_ERR(status)) {
1367                 return status;
1368         }
1369
1370         /* Return variables */
1371         *credentials = *r.out.credentials;
1372         *negotiate_flags = *r.out.negotiate_flags;
1373         *rid = *r.out.rid;
1374
1375         /* Return result */
1376         return r.out.result;
1377 }
1378
1379 NTSTATUS rpccli_netr_DsRGetDCNameEx(struct rpc_pipe_client *cli,
1380                                     TALLOC_CTX *mem_ctx,
1381                                     const char *server_unc /* [in] [unique,charset(UTF16)] */,
1382                                     const char *domain_name /* [in] [unique,charset(UTF16)] */,
1383                                     struct GUID *domain_guid /* [in] [unique] */,
1384                                     const char *site_name /* [in] [unique,charset(UTF16)] */,
1385                                     uint32_t flags /* [in]  */,
1386                                     struct netr_DsRGetDCNameInfo **info /* [out] [ref] */,
1387                                     WERROR *werror)
1388 {
1389         struct netr_DsRGetDCNameEx r;
1390         NTSTATUS status;
1391
1392         /* In parameters */
1393         r.in.server_unc = server_unc;
1394         r.in.domain_name = domain_name;
1395         r.in.domain_guid = domain_guid;
1396         r.in.site_name = site_name;
1397         r.in.flags = flags;
1398
1399         if (DEBUGLEVEL >= 10) {
1400                 NDR_PRINT_IN_DEBUG(netr_DsRGetDCNameEx, &r);
1401         }
1402
1403         status = cli_do_rpc_ndr(cli,
1404                                 mem_ctx,
1405                                 PI_NETLOGON,
1406                                 &ndr_table_netlogon,
1407                                 NDR_NETR_DSRGETDCNAMEEX,
1408                                 &r);
1409
1410         if (!NT_STATUS_IS_OK(status)) {
1411                 return status;
1412         }
1413
1414         if (DEBUGLEVEL >= 10) {
1415                 NDR_PRINT_OUT_DEBUG(netr_DsRGetDCNameEx, &r);
1416         }
1417
1418         if (NT_STATUS_IS_ERR(status)) {
1419                 return status;
1420         }
1421
1422         /* Return variables */
1423         *info = *r.out.info;
1424
1425         /* Return result */
1426         if (werror) {
1427                 *werror = r.out.result;
1428         }
1429
1430         return werror_to_ntstatus(r.out.result);
1431 }
1432
1433 NTSTATUS rpccli_netr_DsRGetSiteName(struct rpc_pipe_client *cli,
1434                                     TALLOC_CTX *mem_ctx,
1435                                     const char *computer_name /* [in] [unique,charset(UTF16)] */,
1436                                     const char **site /* [out] [ref,charset(UTF16)] */,
1437                                     WERROR *werror)
1438 {
1439         struct netr_DsRGetSiteName r;
1440         NTSTATUS status;
1441
1442         /* In parameters */
1443         r.in.computer_name = computer_name;
1444
1445         if (DEBUGLEVEL >= 10) {
1446                 NDR_PRINT_IN_DEBUG(netr_DsRGetSiteName, &r);
1447         }
1448
1449         status = cli_do_rpc_ndr(cli,
1450                                 mem_ctx,
1451                                 PI_NETLOGON,
1452                                 &ndr_table_netlogon,
1453                                 NDR_NETR_DSRGETSITENAME,
1454                                 &r);
1455
1456         if (!NT_STATUS_IS_OK(status)) {
1457                 return status;
1458         }
1459
1460         if (DEBUGLEVEL >= 10) {
1461                 NDR_PRINT_OUT_DEBUG(netr_DsRGetSiteName, &r);
1462         }
1463
1464         if (NT_STATUS_IS_ERR(status)) {
1465                 return status;
1466         }
1467
1468         /* Return variables */
1469         *site = *r.out.site;
1470
1471         /* Return result */
1472         if (werror) {
1473                 *werror = r.out.result;
1474         }
1475
1476         return werror_to_ntstatus(r.out.result);
1477 }
1478
1479 NTSTATUS rpccli_netr_LogonGetDomainInfo(struct rpc_pipe_client *cli,
1480                                         TALLOC_CTX *mem_ctx,
1481                                         const char *server_name /* [in] [charset(UTF16)] */,
1482                                         const char *computer_name /* [in] [unique,charset(UTF16)] */,
1483                                         struct netr_Authenticator *credential /* [in] [ref] */,
1484                                         struct netr_Authenticator *return_authenticator /* [in,out] [ref] */,
1485                                         uint32_t level /* [in]  */,
1486                                         union netr_DomainQuery query /* [in] [switch_is(level)] */,
1487                                         union netr_DomainInfo *info /* [out] [ref,switch_is(level)] */)
1488 {
1489         struct netr_LogonGetDomainInfo r;
1490         NTSTATUS status;
1491
1492         /* In parameters */
1493         r.in.server_name = server_name;
1494         r.in.computer_name = computer_name;
1495         r.in.credential = credential;
1496         r.in.return_authenticator = return_authenticator;
1497         r.in.level = level;
1498         r.in.query = query;
1499
1500         if (DEBUGLEVEL >= 10) {
1501                 NDR_PRINT_IN_DEBUG(netr_LogonGetDomainInfo, &r);
1502         }
1503
1504         status = cli_do_rpc_ndr(cli,
1505                                 mem_ctx,
1506                                 PI_NETLOGON,
1507                                 &ndr_table_netlogon,
1508                                 NDR_NETR_LOGONGETDOMAININFO,
1509                                 &r);
1510
1511         if (!NT_STATUS_IS_OK(status)) {
1512                 return status;
1513         }
1514
1515         if (DEBUGLEVEL >= 10) {
1516                 NDR_PRINT_OUT_DEBUG(netr_LogonGetDomainInfo, &r);
1517         }
1518
1519         if (NT_STATUS_IS_ERR(status)) {
1520                 return status;
1521         }
1522
1523         /* Return variables */
1524         *return_authenticator = *r.out.return_authenticator;
1525         *info = *r.out.info;
1526
1527         /* Return result */
1528         return r.out.result;
1529 }
1530
1531 NTSTATUS rpccli_netr_ServerPasswordSet2(struct rpc_pipe_client *cli,
1532                                         TALLOC_CTX *mem_ctx,
1533                                         const char *server_name /* [in] [unique,charset(UTF16)] */,
1534                                         const char *account_name /* [in] [charset(UTF16)] */,
1535                                         enum netr_SchannelType secure_channel_type /* [in]  */,
1536                                         const char *computer_name /* [in] [charset(UTF16)] */,
1537                                         struct netr_Authenticator credential /* [in]  */,
1538                                         struct netr_CryptPassword new_password /* [in]  */,
1539                                         struct netr_Authenticator *return_authenticator /* [out] [ref] */)
1540 {
1541         struct netr_ServerPasswordSet2 r;
1542         NTSTATUS status;
1543
1544         /* In parameters */
1545         r.in.server_name = server_name;
1546         r.in.account_name = account_name;
1547         r.in.secure_channel_type = secure_channel_type;
1548         r.in.computer_name = computer_name;
1549         r.in.credential = credential;
1550         r.in.new_password = new_password;
1551
1552         if (DEBUGLEVEL >= 10) {
1553                 NDR_PRINT_IN_DEBUG(netr_ServerPasswordSet2, &r);
1554         }
1555
1556         status = cli_do_rpc_ndr(cli,
1557                                 mem_ctx,
1558                                 PI_NETLOGON,
1559                                 &ndr_table_netlogon,
1560                                 NDR_NETR_SERVERPASSWORDSET2,
1561                                 &r);
1562
1563         if (!NT_STATUS_IS_OK(status)) {
1564                 return status;
1565         }
1566
1567         if (DEBUGLEVEL >= 10) {
1568                 NDR_PRINT_OUT_DEBUG(netr_ServerPasswordSet2, &r);
1569         }
1570
1571         if (NT_STATUS_IS_ERR(status)) {
1572                 return status;
1573         }
1574
1575         /* Return variables */
1576         *return_authenticator = *r.out.return_authenticator;
1577
1578         /* Return result */
1579         return r.out.result;
1580 }
1581
1582 NTSTATUS rpccli_netr_ServerPasswordGet(struct rpc_pipe_client *cli,
1583                                        TALLOC_CTX *mem_ctx,
1584                                        const char *server_name /* [in] [unique,charset(UTF16)] */,
1585                                        const char *account_name /* [in] [charset(UTF16)] */,
1586                                        enum netr_SchannelType secure_channel_type /* [in]  */,
1587                                        const char *computer_name /* [in] [charset(UTF16)] */,
1588                                        struct netr_Authenticator *credential /* [in] [ref] */,
1589                                        struct netr_Authenticator *return_authenticator /* [out] [ref] */,
1590                                        struct samr_Password *password /* [out] [ref] */,
1591                                        WERROR *werror)
1592 {
1593         struct netr_ServerPasswordGet r;
1594         NTSTATUS status;
1595
1596         /* In parameters */
1597         r.in.server_name = server_name;
1598         r.in.account_name = account_name;
1599         r.in.secure_channel_type = secure_channel_type;
1600         r.in.computer_name = computer_name;
1601         r.in.credential = credential;
1602
1603         if (DEBUGLEVEL >= 10) {
1604                 NDR_PRINT_IN_DEBUG(netr_ServerPasswordGet, &r);
1605         }
1606
1607         status = cli_do_rpc_ndr(cli,
1608                                 mem_ctx,
1609                                 PI_NETLOGON,
1610                                 &ndr_table_netlogon,
1611                                 NDR_NETR_SERVERPASSWORDGET,
1612                                 &r);
1613
1614         if (!NT_STATUS_IS_OK(status)) {
1615                 return status;
1616         }
1617
1618         if (DEBUGLEVEL >= 10) {
1619                 NDR_PRINT_OUT_DEBUG(netr_ServerPasswordGet, &r);
1620         }
1621
1622         if (NT_STATUS_IS_ERR(status)) {
1623                 return status;
1624         }
1625
1626         /* Return variables */
1627         *return_authenticator = *r.out.return_authenticator;
1628         *password = *r.out.password;
1629
1630         /* Return result */
1631         if (werror) {
1632                 *werror = r.out.result;
1633         }
1634
1635         return werror_to_ntstatus(r.out.result);
1636 }
1637
1638 NTSTATUS rpccli_netr_NETRLOGONSENDTOSAM(struct rpc_pipe_client *cli,
1639                                         TALLOC_CTX *mem_ctx,
1640                                         WERROR *werror)
1641 {
1642         struct netr_NETRLOGONSENDTOSAM r;
1643         NTSTATUS status;
1644
1645         /* In parameters */
1646
1647         if (DEBUGLEVEL >= 10) {
1648                 NDR_PRINT_IN_DEBUG(netr_NETRLOGONSENDTOSAM, &r);
1649         }
1650
1651         status = cli_do_rpc_ndr(cli,
1652                                 mem_ctx,
1653                                 PI_NETLOGON,
1654                                 &ndr_table_netlogon,
1655                                 NDR_NETR_NETRLOGONSENDTOSAM,
1656                                 &r);
1657
1658         if (!NT_STATUS_IS_OK(status)) {
1659                 return status;
1660         }
1661
1662         if (DEBUGLEVEL >= 10) {
1663                 NDR_PRINT_OUT_DEBUG(netr_NETRLOGONSENDTOSAM, &r);
1664         }
1665
1666         if (NT_STATUS_IS_ERR(status)) {
1667                 return status;
1668         }
1669
1670         /* Return variables */
1671
1672         /* Return result */
1673         if (werror) {
1674                 *werror = r.out.result;
1675         }
1676
1677         return werror_to_ntstatus(r.out.result);
1678 }
1679
1680 NTSTATUS rpccli_netr_DsRAddressToSitenamesW(struct rpc_pipe_client *cli,
1681                                             TALLOC_CTX *mem_ctx,
1682                                             const char *server_name /* [in] [unique,charset(UTF16)] */,
1683                                             uint32_t count /* [in] [range(0,32000)] */,
1684                                             struct netr_DsRAddress *addresses /* [in] [ref,size_is(count)] */,
1685                                             struct netr_DsRAddressToSitenamesWCtr **ctr /* [out] [ref] */,
1686                                             WERROR *werror)
1687 {
1688         struct netr_DsRAddressToSitenamesW r;
1689         NTSTATUS status;
1690
1691         /* In parameters */
1692         r.in.server_name = server_name;
1693         r.in.count = count;
1694         r.in.addresses = addresses;
1695
1696         if (DEBUGLEVEL >= 10) {
1697                 NDR_PRINT_IN_DEBUG(netr_DsRAddressToSitenamesW, &r);
1698         }
1699
1700         status = cli_do_rpc_ndr(cli,
1701                                 mem_ctx,
1702                                 PI_NETLOGON,
1703                                 &ndr_table_netlogon,
1704                                 NDR_NETR_DSRADDRESSTOSITENAMESW,
1705                                 &r);
1706
1707         if (!NT_STATUS_IS_OK(status)) {
1708                 return status;
1709         }
1710
1711         if (DEBUGLEVEL >= 10) {
1712                 NDR_PRINT_OUT_DEBUG(netr_DsRAddressToSitenamesW, &r);
1713         }
1714
1715         if (NT_STATUS_IS_ERR(status)) {
1716                 return status;
1717         }
1718
1719         /* Return variables */
1720         *ctr = *r.out.ctr;
1721
1722         /* Return result */
1723         if (werror) {
1724                 *werror = r.out.result;
1725         }
1726
1727         return werror_to_ntstatus(r.out.result);
1728 }
1729
1730 NTSTATUS rpccli_netr_DsRGetDCNameEx2(struct rpc_pipe_client *cli,
1731                                      TALLOC_CTX *mem_ctx,
1732                                      const char *server_unc /* [in] [unique,charset(UTF16)] */,
1733                                      const char *client_account /* [in] [unique,charset(UTF16)] */,
1734                                      uint32_t mask /* [in]  */,
1735                                      const char *domain_name /* [in] [unique,charset(UTF16)] */,
1736                                      struct GUID *domain_guid /* [in] [unique] */,
1737                                      const char *site_name /* [in] [unique,charset(UTF16)] */,
1738                                      uint32_t flags /* [in]  */,
1739                                      struct netr_DsRGetDCNameInfo **info /* [out] [ref] */,
1740                                      WERROR *werror)
1741 {
1742         struct netr_DsRGetDCNameEx2 r;
1743         NTSTATUS status;
1744
1745         /* In parameters */
1746         r.in.server_unc = server_unc;
1747         r.in.client_account = client_account;
1748         r.in.mask = mask;
1749         r.in.domain_name = domain_name;
1750         r.in.domain_guid = domain_guid;
1751         r.in.site_name = site_name;
1752         r.in.flags = flags;
1753
1754         if (DEBUGLEVEL >= 10) {
1755                 NDR_PRINT_IN_DEBUG(netr_DsRGetDCNameEx2, &r);
1756         }
1757
1758         status = cli_do_rpc_ndr(cli,
1759                                 mem_ctx,
1760                                 PI_NETLOGON,
1761                                 &ndr_table_netlogon,
1762                                 NDR_NETR_DSRGETDCNAMEEX2,
1763                                 &r);
1764
1765         if (!NT_STATUS_IS_OK(status)) {
1766                 return status;
1767         }
1768
1769         if (DEBUGLEVEL >= 10) {
1770                 NDR_PRINT_OUT_DEBUG(netr_DsRGetDCNameEx2, &r);
1771         }
1772
1773         if (NT_STATUS_IS_ERR(status)) {
1774                 return status;
1775         }
1776
1777         /* Return variables */
1778         *info = *r.out.info;
1779
1780         /* Return result */
1781         if (werror) {
1782                 *werror = r.out.result;
1783         }
1784
1785         return werror_to_ntstatus(r.out.result);
1786 }
1787
1788 NTSTATUS rpccli_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(struct rpc_pipe_client *cli,
1789                                                          TALLOC_CTX *mem_ctx,
1790                                                          WERROR *werror)
1791 {
1792         struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN r;
1793         NTSTATUS status;
1794
1795         /* In parameters */
1796
1797         if (DEBUGLEVEL >= 10) {
1798                 NDR_PRINT_IN_DEBUG(netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN, &r);
1799         }
1800
1801         status = cli_do_rpc_ndr(cli,
1802                                 mem_ctx,
1803                                 PI_NETLOGON,
1804                                 &ndr_table_netlogon,
1805                                 NDR_NETR_NETRLOGONGETTIMESERVICEPARENTDOMAIN,
1806                                 &r);
1807
1808         if (!NT_STATUS_IS_OK(status)) {
1809                 return status;
1810         }
1811
1812         if (DEBUGLEVEL >= 10) {
1813                 NDR_PRINT_OUT_DEBUG(netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN, &r);
1814         }
1815
1816         if (NT_STATUS_IS_ERR(status)) {
1817                 return status;
1818         }
1819
1820         /* Return variables */
1821
1822         /* Return result */
1823         if (werror) {
1824                 *werror = r.out.result;
1825         }
1826
1827         return werror_to_ntstatus(r.out.result);
1828 }
1829
1830 NTSTATUS rpccli_netr_NetrEnumerateTrustedDomainsEx(struct rpc_pipe_client *cli,
1831                                                    TALLOC_CTX *mem_ctx,
1832                                                    const char *server_name /* [in] [unique,charset(UTF16)] */,
1833                                                    struct netr_DomainTrustList *dom_trust_list /* [out] [ref] */,
1834                                                    WERROR *werror)
1835 {
1836         struct netr_NetrEnumerateTrustedDomainsEx r;
1837         NTSTATUS status;
1838
1839         /* In parameters */
1840         r.in.server_name = server_name;
1841
1842         if (DEBUGLEVEL >= 10) {
1843                 NDR_PRINT_IN_DEBUG(netr_NetrEnumerateTrustedDomainsEx, &r);
1844         }
1845
1846         status = cli_do_rpc_ndr(cli,
1847                                 mem_ctx,
1848                                 PI_NETLOGON,
1849                                 &ndr_table_netlogon,
1850                                 NDR_NETR_NETRENUMERATETRUSTEDDOMAINSEX,
1851                                 &r);
1852
1853         if (!NT_STATUS_IS_OK(status)) {
1854                 return status;
1855         }
1856
1857         if (DEBUGLEVEL >= 10) {
1858                 NDR_PRINT_OUT_DEBUG(netr_NetrEnumerateTrustedDomainsEx, &r);
1859         }
1860
1861         if (NT_STATUS_IS_ERR(status)) {
1862                 return status;
1863         }
1864
1865         /* Return variables */
1866         *dom_trust_list = *r.out.dom_trust_list;
1867
1868         /* Return result */
1869         if (werror) {
1870                 *werror = r.out.result;
1871         }
1872
1873         return werror_to_ntstatus(r.out.result);
1874 }
1875
1876 NTSTATUS rpccli_netr_DsRAddressToSitenamesExW(struct rpc_pipe_client *cli,
1877                                               TALLOC_CTX *mem_ctx,
1878                                               const char *server_name /* [in] [unique,charset(UTF16)] */,
1879                                               uint32_t count /* [in] [range(0,32000)] */,
1880                                               struct netr_DsRAddress *addresses /* [in] [ref,size_is(count)] */,
1881                                               struct netr_DsRAddressToSitenamesExWCtr **ctr /* [out] [ref] */,
1882                                               WERROR *werror)
1883 {
1884         struct netr_DsRAddressToSitenamesExW r;
1885         NTSTATUS status;
1886
1887         /* In parameters */
1888         r.in.server_name = server_name;
1889         r.in.count = count;
1890         r.in.addresses = addresses;
1891
1892         if (DEBUGLEVEL >= 10) {
1893                 NDR_PRINT_IN_DEBUG(netr_DsRAddressToSitenamesExW, &r);
1894         }
1895
1896         status = cli_do_rpc_ndr(cli,
1897                                 mem_ctx,
1898                                 PI_NETLOGON,
1899                                 &ndr_table_netlogon,
1900                                 NDR_NETR_DSRADDRESSTOSITENAMESEXW,
1901                                 &r);
1902
1903         if (!NT_STATUS_IS_OK(status)) {
1904                 return status;
1905         }
1906
1907         if (DEBUGLEVEL >= 10) {
1908                 NDR_PRINT_OUT_DEBUG(netr_DsRAddressToSitenamesExW, &r);
1909         }
1910
1911         if (NT_STATUS_IS_ERR(status)) {
1912                 return status;
1913         }
1914
1915         /* Return variables */
1916         *ctr = *r.out.ctr;
1917
1918         /* Return result */
1919         if (werror) {
1920                 *werror = r.out.result;
1921         }
1922
1923         return werror_to_ntstatus(r.out.result);
1924 }
1925
1926 NTSTATUS rpccli_netr_DsrGetDcSiteCoverageW(struct rpc_pipe_client *cli,
1927                                            TALLOC_CTX *mem_ctx,
1928                                            const char *server_name /* [in] [unique,charset(UTF16)] */,
1929                                            struct DcSitesCtr *ctr /* [out] [ref] */,
1930                                            WERROR *werror)
1931 {
1932         struct netr_DsrGetDcSiteCoverageW r;
1933         NTSTATUS status;
1934
1935         /* In parameters */
1936         r.in.server_name = server_name;
1937
1938         if (DEBUGLEVEL >= 10) {
1939                 NDR_PRINT_IN_DEBUG(netr_DsrGetDcSiteCoverageW, &r);
1940         }
1941
1942         status = cli_do_rpc_ndr(cli,
1943                                 mem_ctx,
1944                                 PI_NETLOGON,
1945                                 &ndr_table_netlogon,
1946                                 NDR_NETR_DSRGETDCSITECOVERAGEW,
1947                                 &r);
1948
1949         if (!NT_STATUS_IS_OK(status)) {
1950                 return status;
1951         }
1952
1953         if (DEBUGLEVEL >= 10) {
1954                 NDR_PRINT_OUT_DEBUG(netr_DsrGetDcSiteCoverageW, &r);
1955         }
1956
1957         if (NT_STATUS_IS_ERR(status)) {
1958                 return status;
1959         }
1960
1961         /* Return variables */
1962         *ctr = *r.out.ctr;
1963
1964         /* Return result */
1965         if (werror) {
1966                 *werror = r.out.result;
1967         }
1968
1969         return werror_to_ntstatus(r.out.result);
1970 }
1971
1972 NTSTATUS rpccli_netr_LogonSamLogonEx(struct rpc_pipe_client *cli,
1973                                      TALLOC_CTX *mem_ctx,
1974                                      const char *server_name /* [in] [unique,charset(UTF16)] */,
1975                                      const char *computer_name /* [in] [unique,charset(UTF16)] */,
1976                                      enum netr_LogonLevel logon_level /* [in]  */,
1977                                      union netr_LogonInfo *logon /* [in] [ref,switch_is(logon_level)] */,
1978                                      uint16_t validation_level /* [in]  */,
1979                                      union netr_Validation *validation /* [out] [ref,switch_is(validation_level)] */,
1980                                      uint8_t *authoritative /* [out] [ref] */,
1981                                      uint32_t *flags /* [in,out] [ref] */)
1982 {
1983         struct netr_LogonSamLogonEx r;
1984         NTSTATUS status;
1985
1986         /* In parameters */
1987         r.in.server_name = server_name;
1988         r.in.computer_name = computer_name;
1989         r.in.logon_level = logon_level;
1990         r.in.logon = logon;
1991         r.in.validation_level = validation_level;
1992         r.in.flags = flags;
1993
1994         if (DEBUGLEVEL >= 10) {
1995                 NDR_PRINT_IN_DEBUG(netr_LogonSamLogonEx, &r);
1996         }
1997
1998         status = cli_do_rpc_ndr(cli,
1999                                 mem_ctx,
2000                                 PI_NETLOGON,
2001                                 &ndr_table_netlogon,
2002                                 NDR_NETR_LOGONSAMLOGONEX,
2003                                 &r);
2004
2005         if (!NT_STATUS_IS_OK(status)) {
2006                 return status;
2007         }
2008
2009         if (DEBUGLEVEL >= 10) {
2010                 NDR_PRINT_OUT_DEBUG(netr_LogonSamLogonEx, &r);
2011         }
2012
2013         if (NT_STATUS_IS_ERR(status)) {
2014                 return status;
2015         }
2016
2017         /* Return variables */
2018         *validation = *r.out.validation;
2019         *authoritative = *r.out.authoritative;
2020         *flags = *r.out.flags;
2021
2022         /* Return result */
2023         return r.out.result;
2024 }
2025
2026 NTSTATUS rpccli_netr_DsrEnumerateDomainTrusts(struct rpc_pipe_client *cli,
2027                                               TALLOC_CTX *mem_ctx,
2028                                               const char *server_name /* [in] [unique,charset(UTF16)] */,
2029                                               uint32_t trust_flags /* [in]  */,
2030                                               struct netr_DomainTrustList *trusts /* [out] [ref] */,
2031                                               WERROR *werror)
2032 {
2033         struct netr_DsrEnumerateDomainTrusts r;
2034         NTSTATUS status;
2035
2036         /* In parameters */
2037         r.in.server_name = server_name;
2038         r.in.trust_flags = trust_flags;
2039
2040         if (DEBUGLEVEL >= 10) {
2041                 NDR_PRINT_IN_DEBUG(netr_DsrEnumerateDomainTrusts, &r);
2042         }
2043
2044         status = cli_do_rpc_ndr(cli,
2045                                 mem_ctx,
2046                                 PI_NETLOGON,
2047                                 &ndr_table_netlogon,
2048                                 NDR_NETR_DSRENUMERATEDOMAINTRUSTS,
2049                                 &r);
2050
2051         if (!NT_STATUS_IS_OK(status)) {
2052                 return status;
2053         }
2054
2055         if (DEBUGLEVEL >= 10) {
2056                 NDR_PRINT_OUT_DEBUG(netr_DsrEnumerateDomainTrusts, &r);
2057         }
2058
2059         if (NT_STATUS_IS_ERR(status)) {
2060                 return status;
2061         }
2062
2063         /* Return variables */
2064         *trusts = *r.out.trusts;
2065
2066         /* Return result */
2067         if (werror) {
2068                 *werror = r.out.result;
2069         }
2070
2071         return werror_to_ntstatus(r.out.result);
2072 }
2073
2074 NTSTATUS rpccli_netr_DsrDeregisterDNSHostRecords(struct rpc_pipe_client *cli,
2075                                                  TALLOC_CTX *mem_ctx,
2076                                                  const char *server_name /* [in] [unique,charset(UTF16)] */,
2077                                                  const char *domain /* [in] [unique,charset(UTF16)] */,
2078                                                  struct GUID *domain_guid /* [in] [unique] */,
2079                                                  struct GUID *dsa_guid /* [in] [unique] */,
2080                                                  const char *dns_host /* [in] [ref,charset(UTF16)] */,
2081                                                  WERROR *werror)
2082 {
2083         struct netr_DsrDeregisterDNSHostRecords r;
2084         NTSTATUS status;
2085
2086         /* In parameters */
2087         r.in.server_name = server_name;
2088         r.in.domain = domain;
2089         r.in.domain_guid = domain_guid;
2090         r.in.dsa_guid = dsa_guid;
2091         r.in.dns_host = dns_host;
2092
2093         if (DEBUGLEVEL >= 10) {
2094                 NDR_PRINT_IN_DEBUG(netr_DsrDeregisterDNSHostRecords, &r);
2095         }
2096
2097         status = cli_do_rpc_ndr(cli,
2098                                 mem_ctx,
2099                                 PI_NETLOGON,
2100                                 &ndr_table_netlogon,
2101                                 NDR_NETR_DSRDEREGISTERDNSHOSTRECORDS,
2102                                 &r);
2103
2104         if (!NT_STATUS_IS_OK(status)) {
2105                 return status;
2106         }
2107
2108         if (DEBUGLEVEL >= 10) {
2109                 NDR_PRINT_OUT_DEBUG(netr_DsrDeregisterDNSHostRecords, &r);
2110         }
2111
2112         if (NT_STATUS_IS_ERR(status)) {
2113                 return status;
2114         }
2115
2116         /* Return variables */
2117
2118         /* Return result */
2119         if (werror) {
2120                 *werror = r.out.result;
2121         }
2122
2123         return werror_to_ntstatus(r.out.result);
2124 }
2125
2126 NTSTATUS rpccli_netr_ServerTrustPasswordsGet(struct rpc_pipe_client *cli,
2127                                              TALLOC_CTX *mem_ctx,
2128                                              const char *server_name /* [in] [unique,charset(UTF16)] */,
2129                                              const char *account_name /* [in] [charset(UTF16)] */,
2130                                              enum netr_SchannelType secure_channel_type /* [in]  */,
2131                                              const char *computer_name /* [in] [charset(UTF16)] */,
2132                                              struct netr_Authenticator *credential /* [in] [ref] */,
2133                                              struct netr_Authenticator *return_authenticator /* [out] [ref] */,
2134                                              struct samr_Password *password /* [out] [ref] */,
2135                                              struct samr_Password *password2 /* [out] [ref] */)
2136 {
2137         struct netr_ServerTrustPasswordsGet r;
2138         NTSTATUS status;
2139
2140         /* In parameters */
2141         r.in.server_name = server_name;
2142         r.in.account_name = account_name;
2143         r.in.secure_channel_type = secure_channel_type;
2144         r.in.computer_name = computer_name;
2145         r.in.credential = credential;
2146
2147         if (DEBUGLEVEL >= 10) {
2148                 NDR_PRINT_IN_DEBUG(netr_ServerTrustPasswordsGet, &r);
2149         }
2150
2151         status = cli_do_rpc_ndr(cli,
2152                                 mem_ctx,
2153                                 PI_NETLOGON,
2154                                 &ndr_table_netlogon,
2155                                 NDR_NETR_SERVERTRUSTPASSWORDSGET,
2156                                 &r);
2157
2158         if (!NT_STATUS_IS_OK(status)) {
2159                 return status;
2160         }
2161
2162         if (DEBUGLEVEL >= 10) {
2163                 NDR_PRINT_OUT_DEBUG(netr_ServerTrustPasswordsGet, &r);
2164         }
2165
2166         if (NT_STATUS_IS_ERR(status)) {
2167                 return status;
2168         }
2169
2170         /* Return variables */
2171         *return_authenticator = *r.out.return_authenticator;
2172         *password = *r.out.password;
2173         *password2 = *r.out.password2;
2174
2175         /* Return result */
2176         return r.out.result;
2177 }
2178
2179 NTSTATUS rpccli_netr_DsRGetForestTrustInformation(struct rpc_pipe_client *cli,
2180                                                   TALLOC_CTX *mem_ctx,
2181                                                   const char *server_name /* [in] [unique,charset(UTF16)] */,
2182                                                   const char *trusted_domain_name /* [in] [unique,charset(UTF16)] */,
2183                                                   uint32_t flags /* [in]  */,
2184                                                   struct lsa_ForestTrustInformation **forest_trust_info /* [out] [ref] */,
2185                                                   WERROR *werror)
2186 {
2187         struct netr_DsRGetForestTrustInformation r;
2188         NTSTATUS status;
2189
2190         /* In parameters */
2191         r.in.server_name = server_name;
2192         r.in.trusted_domain_name = trusted_domain_name;
2193         r.in.flags = flags;
2194
2195         if (DEBUGLEVEL >= 10) {
2196                 NDR_PRINT_IN_DEBUG(netr_DsRGetForestTrustInformation, &r);
2197         }
2198
2199         status = cli_do_rpc_ndr(cli,
2200                                 mem_ctx,
2201                                 PI_NETLOGON,
2202                                 &ndr_table_netlogon,
2203                                 NDR_NETR_DSRGETFORESTTRUSTINFORMATION,
2204                                 &r);
2205
2206         if (!NT_STATUS_IS_OK(status)) {
2207                 return status;
2208         }
2209
2210         if (DEBUGLEVEL >= 10) {
2211                 NDR_PRINT_OUT_DEBUG(netr_DsRGetForestTrustInformation, &r);
2212         }
2213
2214         if (NT_STATUS_IS_ERR(status)) {
2215                 return status;
2216         }
2217
2218         /* Return variables */
2219         *forest_trust_info = *r.out.forest_trust_info;
2220
2221         /* Return result */
2222         if (werror) {
2223                 *werror = r.out.result;
2224         }
2225
2226         return werror_to_ntstatus(r.out.result);
2227 }
2228
2229 NTSTATUS rpccli_netr_GetForestTrustInformation(struct rpc_pipe_client *cli,
2230                                                TALLOC_CTX *mem_ctx,
2231                                                const char *server_name /* [in] [unique,charset(UTF16)] */,
2232                                                const char *trusted_domain_name /* [in] [ref,charset(UTF16)] */,
2233                                                struct netr_Authenticator *credential /* [in] [ref] */,
2234                                                struct netr_Authenticator *return_authenticator /* [out] [ref] */,
2235                                                uint32_t flags /* [in]  */,
2236                                                struct lsa_ForestTrustInformation **forest_trust_info /* [out] [ref] */,
2237                                                WERROR *werror)
2238 {
2239         struct netr_GetForestTrustInformation r;
2240         NTSTATUS status;
2241
2242         /* In parameters */
2243         r.in.server_name = server_name;
2244         r.in.trusted_domain_name = trusted_domain_name;
2245         r.in.credential = credential;
2246         r.in.flags = flags;
2247
2248         if (DEBUGLEVEL >= 10) {
2249                 NDR_PRINT_IN_DEBUG(netr_GetForestTrustInformation, &r);
2250         }
2251
2252         status = cli_do_rpc_ndr(cli,
2253                                 mem_ctx,
2254                                 PI_NETLOGON,
2255                                 &ndr_table_netlogon,
2256                                 NDR_NETR_GETFORESTTRUSTINFORMATION,
2257                                 &r);
2258
2259         if (!NT_STATUS_IS_OK(status)) {
2260                 return status;
2261         }
2262
2263         if (DEBUGLEVEL >= 10) {
2264                 NDR_PRINT_OUT_DEBUG(netr_GetForestTrustInformation, &r);
2265         }
2266
2267         if (NT_STATUS_IS_ERR(status)) {
2268                 return status;
2269         }
2270
2271         /* Return variables */
2272         *return_authenticator = *r.out.return_authenticator;
2273         *forest_trust_info = *r.out.forest_trust_info;
2274
2275         /* Return result */
2276         if (werror) {
2277                 *werror = r.out.result;
2278         }
2279
2280         return werror_to_ntstatus(r.out.result);
2281 }
2282
2283 NTSTATUS rpccli_netr_LogonSamLogonWithFlags(struct rpc_pipe_client *cli,
2284                                             TALLOC_CTX *mem_ctx,
2285                                             const char *server_name /* [in] [unique,charset(UTF16)] */,
2286                                             const char *computer_name /* [in] [unique,charset(UTF16)] */,
2287                                             struct netr_Authenticator *credential /* [in] [unique] */,
2288                                             struct netr_Authenticator *return_authenticator /* [in,out] [unique] */,
2289                                             enum netr_LogonLevel logon_level /* [in]  */,
2290                                             union netr_LogonInfo logon /* [in] [switch_is(logon_level)] */,
2291                                             uint16_t validation_level /* [in]  */,
2292                                             union netr_Validation *validation /* [out] [ref,switch_is(validation_level)] */,
2293                                             uint8_t *authoritative /* [out] [ref] */,
2294                                             uint32_t *flags /* [in,out] [ref] */)
2295 {
2296         struct netr_LogonSamLogonWithFlags r;
2297         NTSTATUS status;
2298
2299         /* In parameters */
2300         r.in.server_name = server_name;
2301         r.in.computer_name = computer_name;
2302         r.in.credential = credential;
2303         r.in.return_authenticator = return_authenticator;
2304         r.in.logon_level = logon_level;
2305         r.in.logon = logon;
2306         r.in.validation_level = validation_level;
2307         r.in.flags = flags;
2308
2309         if (DEBUGLEVEL >= 10) {
2310                 NDR_PRINT_IN_DEBUG(netr_LogonSamLogonWithFlags, &r);
2311         }
2312
2313         status = cli_do_rpc_ndr(cli,
2314                                 mem_ctx,
2315                                 PI_NETLOGON,
2316                                 &ndr_table_netlogon,
2317                                 NDR_NETR_LOGONSAMLOGONWITHFLAGS,
2318                                 &r);
2319
2320         if (!NT_STATUS_IS_OK(status)) {
2321                 return status;
2322         }
2323
2324         if (DEBUGLEVEL >= 10) {
2325                 NDR_PRINT_OUT_DEBUG(netr_LogonSamLogonWithFlags, &r);
2326         }
2327
2328         if (NT_STATUS_IS_ERR(status)) {
2329                 return status;
2330         }
2331
2332         /* Return variables */
2333         if (return_authenticator && r.out.return_authenticator) {
2334                 *return_authenticator = *r.out.return_authenticator;
2335         }
2336         *validation = *r.out.validation;
2337         *authoritative = *r.out.authoritative;
2338         *flags = *r.out.flags;
2339
2340         /* Return result */
2341         return r.out.result;
2342 }
2343
2344 NTSTATUS rpccli_netr_NETRSERVERGETTRUSTINFO(struct rpc_pipe_client *cli,
2345                                             TALLOC_CTX *mem_ctx,
2346                                             WERROR *werror)
2347 {
2348         struct netr_NETRSERVERGETTRUSTINFO r;
2349         NTSTATUS status;
2350
2351         /* In parameters */
2352
2353         if (DEBUGLEVEL >= 10) {
2354                 NDR_PRINT_IN_DEBUG(netr_NETRSERVERGETTRUSTINFO, &r);
2355         }
2356
2357         status = cli_do_rpc_ndr(cli,
2358                                 mem_ctx,
2359                                 PI_NETLOGON,
2360                                 &ndr_table_netlogon,
2361                                 NDR_NETR_NETRSERVERGETTRUSTINFO,
2362                                 &r);
2363
2364         if (!NT_STATUS_IS_OK(status)) {
2365                 return status;
2366         }
2367
2368         if (DEBUGLEVEL >= 10) {
2369                 NDR_PRINT_OUT_DEBUG(netr_NETRSERVERGETTRUSTINFO, &r);
2370         }
2371
2372         if (NT_STATUS_IS_ERR(status)) {
2373                 return status;
2374         }
2375
2376         /* Return variables */
2377
2378         /* Return result */
2379         if (werror) {
2380                 *werror = r.out.result;
2381         }
2382
2383         return werror_to_ntstatus(r.out.result);
2384 }
2385