selftest/Samba4: make use of get_cmd_env_vars() to setup all relevant env variables
[samba.git] / librpc / idl / winbind.idl
1 #include "idl_types.h"
2 import "lsa.idl", "netlogon.idl", "samr.idl", "misc.idl", "security.idl", "idmap.idl";
3
4 [
5     uuid("bf09192c-ed60-4928-9dff-d0d7bcb03ed8"),
6     endpoint("ncalrpc:"),
7     pointer_default(unique),
8     version(1.0),
9     helpstring("winbind parent-child protocol"),
10     no_srv_register
11 ]
12 interface winbind
13 {
14   /* Private methods */
15
16     NTSTATUS wbint_Ping(
17         [in] uint32 in_data,
18         [out] uint32 *out_data
19         );
20
21     NTSTATUS wbint_LookupSid(
22         [in] dom_sid *sid,
23         [out] lsa_SidType *type,
24         [out,string,charset(UTF8)] char **domain,
25         [out,string,charset(UTF8)] char **name
26         );
27
28     NTSTATUS wbint_LookupSids(
29         [in] lsa_SidArray *sids,
30         [out,ref] lsa_RefDomainList *domains,
31         [out,ref] lsa_TransNameArray *names
32         );
33
34     NTSTATUS wbint_LookupName(
35         [in,string,charset(UTF8)] char *domain,
36         [in,string,charset(UTF8)] char *name,
37         [in] uint32 flags,
38         [out] lsa_SidType *type,
39         [out] dom_sid *sid
40         );
41
42     typedef struct {
43         id_type type_hint;
44         uint32 domain_index;
45         uint32 rid;
46         unixid xid;
47     } wbint_TransID;
48
49     typedef struct {
50         uint32 num_ids;
51         [size_is(num_ids)] wbint_TransID ids[];
52     } wbint_TransIDArray;
53
54     NTSTATUS wbint_Sids2UnixIDs(
55         [in] lsa_RefDomainList *domains,
56         [in,out] wbint_TransIDArray *ids
57         );
58
59     NTSTATUS wbint_UnixIDs2Sids(
60         [in,string,charset(UTF8)] char *domain_name,
61         [in] dom_sid domain_sid,
62         [in] uint32 num_ids,
63         [in,out] unixid xids[num_ids],
64         [out] dom_sid sids[num_ids]
65         );
66
67     NTSTATUS wbint_AllocateUid(
68         [out] hyper *uid
69         );
70
71     NTSTATUS wbint_AllocateGid(
72         [out] hyper *gid
73         );
74
75     typedef [public] struct {
76         [string,charset(UTF8)] char *domain_name;
77         [string,charset(UTF8)] char *acct_name;
78         [string,charset(UTF8)] char *full_name;
79         [string,charset(UTF8)] char *homedir;
80         [string,charset(UTF8)] char *shell;
81         hyper uid;
82         hyper primary_gid;
83         [string,charset(UTF8)] char *primary_group_name;
84         dom_sid user_sid;
85         dom_sid group_sid;
86     } wbint_userinfo;
87
88     NTSTATUS wbint_GetNssInfo(
89         [in,out] wbint_userinfo *info
90         );
91
92     typedef [public] struct {
93         uint32 num_sids;
94         [size_is(num_sids)] dom_sid sids[];
95     } wbint_SidArray;
96
97     typedef [public] struct {
98         uint32 num_rids;
99         [size_is(num_rids)] uint32 rids[];
100     } wbint_RidArray;
101
102     NTSTATUS wbint_LookupUserAliases(
103         [in] wbint_SidArray *sids,
104         [out] wbint_RidArray *rids
105         );
106
107     NTSTATUS wbint_LookupUserGroups(
108         [in] dom_sid *sid,
109         [out] wbint_SidArray *sids
110         );
111
112     NTSTATUS wbint_QuerySequenceNumber(
113         [out] uint32 *sequence
114         );
115
116     typedef [public] struct {
117         dom_sid sid;
118         lsa_SidType type;
119         [string,charset(UTF8)] char *name;
120     } wbint_Principal;
121
122     typedef [public] struct {
123         uint32 num_principals;
124         [size_is(num_principals)] wbint_Principal principals[];
125     } wbint_Principals;
126
127     NTSTATUS wbint_LookupGroupMembers(
128         [in] dom_sid *sid,
129         [in] lsa_SidType type,
130         [out] wbint_Principals *members
131         );
132
133     NTSTATUS wbint_LookupAliasMembers(
134         [in] dom_sid *sid,
135         [in] lsa_SidType type,
136         [out] wbint_SidArray *sids
137         );
138
139     typedef [public] struct {
140         uint32 num_userinfos;
141         [size_is(num_userinfos)] wbint_userinfo userinfos[];
142     } wbint_userinfos;
143
144     NTSTATUS wbint_QueryGroupList(
145         [out] wbint_Principals *groups
146         );
147
148     NTSTATUS wbint_QueryUserRidList(
149         [out] wbint_RidArray *rids
150         );
151
152     NTSTATUS wbint_DsGetDcName(
153         [in,string,charset(UTF8)]               char *domain_name,
154         [in,unique]                             GUID *domain_guid,
155         [in,string,unique,charset(UTF8)]        char *site_name,
156         [in]                                    uint32 flags,
157         [out]                                   netr_DsRGetDCNameInfo **dc_info
158         );
159
160     NTSTATUS wbint_LookupRids(
161         [in] dom_sid *domain_sid,
162         [in] wbint_RidArray *rids,
163         [out,string,charset(UTF8)] char **domain_name,
164         [out] wbint_Principals *names
165         );
166
167     NTSTATUS wbint_CheckMachineAccount(
168         );
169
170     NTSTATUS wbint_ChangeMachineAccount(
171                 [in,unique,string,charset(UTF8)] char *dcname
172         );
173
174     NTSTATUS wbint_PingDc(
175         [out,string,charset(UTF8)] char **dcname
176         );
177
178     NTSTATUS wbint_ListTrustedDomains(
179         [in,string,charset(UTF8)] char *client_name,
180         [in] hyper client_pid,
181         [out,ref] netr_DomainTrustList *domains
182         );
183
184     typedef [public] struct {
185         uint16 level;
186         [switch_is(level)] netr_Validation *validation;
187         [string,charset(UTF8)] char *krb5ccname;
188     } wbint_Validation;
189
190     typedef [public] struct {
191         [string,charset(UTF8)] char *username;
192         [string,charset(UTF8),flag(NDR_SECRET)] char *password;
193         [string,charset(UTF8)] char *krb5_cc_type;
194         hyper uid;
195     } wbint_AuthUserInfo;
196
197     NTSTATUS wbint_PamAuth(
198         [in,string,charset(UTF8)] char *client_name,
199         [in] hyper client_pid,
200         [in] uint32 flags,
201         [in] wbint_AuthUserInfo *info,
202         [in] wbint_SidArray *require_membership_of_sid,
203         [out,ref] wbint_Validation *validation
204         );
205
206     typedef [public] struct {
207         uint16 level;
208         [switch_is(level)] netr_Validation *validation;
209     } wbint_PamAuthCrapValidation;
210
211     NTSTATUS wbint_PamAuthCrap(
212         [in,string,charset(UTF8)] char *client_name,
213         [in] hyper client_pid,
214         [in] uint32 flags,
215         [in, string,charset(UTF8)] char *user,
216         [in, string,charset(UTF8)] char *domain,
217         [in, string,charset(UTF8)] char *workstation,
218         [in,flag(NDR_SECRET)] DATA_BLOB lm_resp,
219         [in,flag(NDR_SECRET)] DATA_BLOB nt_resp,
220         [in,flag(NDR_SECRET)] DATA_BLOB chal,
221         [in] uint32 logon_parameters,
222         [in] wbint_SidArray *require_membership_of_sid,
223         [out,ref] uint8 *authoritative,
224         [out,ref] wbint_PamAuthCrapValidation *validation
225         );
226
227     NTSTATUS wbint_PamLogOff(
228         [in,string,charset(UTF8)] char *client_name,
229         [in] hyper client_pid,
230         [in] uint32 flags,
231         [in,string,charset(UTF8)] char *user,
232         [in,string,charset(UTF8)] char *krb5ccname,
233         [in] hyper uid
234         );
235
236     NTSTATUS wbint_PamAuthCrapChangePassword(
237         [in,string,charset(UTF8)] char *client_name,
238         [in] hyper client_pid,
239         [in,string,charset(UTF8)] char *user,
240         [in,string,charset(UTF8)] char *domain,
241         [in,flag(NDR_SECRET)] DATA_BLOB new_nt_pswd,
242         [in,flag(NDR_SECRET)] DATA_BLOB old_nt_hash_enc,
243         [in,flag(NDR_SECRET)] DATA_BLOB new_lm_pswd,
244         [in,flag(NDR_SECRET)] DATA_BLOB old_lm_hash_enc
245         );
246
247     NTSTATUS wbint_PamAuthChangePassword(
248         [in,string,charset(UTF8)] char *client_name,
249         [in] hyper client_pid,
250         [in] uint32 flags,
251         [in,string,charset(UTF8)] char *user,
252         [in,string,charset(UTF8),flag(NDR_SECRET)] char *old_password,
253         [in,string,charset(UTF8),flag(NDR_SECRET)] char *new_password,
254         [out,ref] samr_DomInfo1 **dominfo,
255         [out,ref] samPwdChangeReason *reject_reason
256         );
257
258     typedef [enum16bit] enum {
259         WB_DOMINFO_DOMAIN_UNKNOWN = 0x0000,
260         WB_DOMINFO_DOMAIN_NATIVE  = 0x0001,
261         WB_DOMINFO_DOMAIN_AD      = 0x0002,
262         WB_DOMINFO_DOMAIN_PRIMARY = 0x0004,
263         WB_DOMINFO_DOMAIN_OFFLINE = 0x0008
264     } DomainInfoFlags;
265
266     NTSTATUS wbint_InitConnection(
267         [in,string,charset(UTF8)] char *dcname,
268         [out,string,charset(UTF8)] char **name,
269         [out,string,charset(UTF8)] char **alt_name,
270         [out,ref] dom_sid *sid,
271         [out,ref] DomainInfoFlags *flags
272         );
273
274   /* Public methods available via IRPC */
275
276     typedef [switch_type(uint16)] union netr_LogonLevel netr_LogonLevel;
277     typedef [switch_type(uint16)] union netr_Validation netr_Validation;
278
279     /*
280      * do a netr_LogonSamLogon() against the right DC
281      */
282     NTSTATUS winbind_SamLogon(
283         [in]  uint16 logon_level,
284         [in]  [switch_is(logon_level)] netr_LogonLevel logon,
285         [in]  uint16 validation_level,
286         [out] [switch_is(validation_level)] netr_Validation validation,
287         [out] uint8 authoritative
288         );
289
290     NTSTATUS winbind_DsrUpdateReadOnlyServerDnsRecords(
291         [in,unique] [string,charset(UTF16)] uint16 *site_name,
292         [in] uint32 dns_ttl,
293         [in,out,ref] NL_DNS_NAME_INFO_ARRAY *dns_names
294         );
295
296         /*
297          * do a netr_LogonControl2Ex() against the right DC
298          */
299         typedef [v1_enum] enum netr_LogonControlCode netr_LogonControlCode;
300         typedef [switch_type(netr_LogonControlCode)] union netr_CONTROL_DATA_INFORMATION netr_CONTROL_DATA_INFORMATION;
301         typedef [switch_type(uint32)] union netr_CONTROL_QUERY_INFORMATION netr_CONTROL_QUERY_INFORMATION;
302
303         WERROR winbind_LogonControl(
304                 [in]   netr_LogonControlCode function_code,
305                 [in]   uint32 level,
306                 [in,ref][switch_is(function_code)] netr_CONTROL_DATA_INFORMATION  *data,
307                 [out,ref][switch_is(level)] netr_CONTROL_QUERY_INFORMATION *query
308                 );
309
310         /*
311          * do a netr_GetForestTrustInformation() against the right DC
312          */
313         WERROR winbind_GetForestTrustInformation(
314                 [in,unique] [string,charset(UTF16)] uint16 *trusted_domain_name,
315                 [in] uint32 flags,
316                 [out,ref] lsa_ForestTrustInformation **forest_trust_info
317                 );
318
319         NTSTATUS winbind_SendToSam(
320                 [in] netr_SendToSamBase message
321                 );
322
323 }