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