997e83ecb8108a6c54032ef48958cbf59a9cada7
[metze/samba/wb-ndr.git] / source / librpc / idl / winbind_protocol.idl
1 /*
2  * Winbind (NDR-based) Protocol
3  */
4
5 import "security.idl";
6
7 [ uuid("b6608c99-0407-401b-96d3-7bcda67232af"),
8   version(1.0),
9   pointer_default(unique)
10 ] interface winbind_protocol
11 {
12         const uint32 WINBIND_MAX_LENGTH_PRIVILEGED      = 0x0FFFFFFF;
13         const uint32 WINBIND_MAX_LENGTH_UNPRIVILEGED    = 0x00020000;
14
15         typedef [public,v1_enum] enum {
16                 WINBIND_STATUS_OK                       = 0x00000000,
17                 WINBIND_STATUS_UNKNOWN_ERROR            = 0x57420001,
18                 WINBIND_STATUS_NOT_IMPLEMENTED          = 0x57420002,
19                 WINBIND_STATUS_NOT_SUPPORTED            = 0x57420003,
20                 WINBIND_STATUS_NO_MEMORY                = 0x57420004,
21                 WINBIND_STATUS_INVALID_PARAMETER        = 0x57420005,
22                 WINBIND_STATUS_INVALID_LEVEL            = 0x57420006,
23                 WINBIND_STATUS_UNKNOWN_LEVEL            = 0x57420007,
24                 WINBIND_STATUS_DOMAIN_OFFLINE           = 0x57420008
25         } winbind_status;
26
27         const uint32 WINBIND_STATUS_FOOBAR              = WINBIND_STATUS_UNKNOWN_ERROR;
28
29         typedef [bitmap16bit] bitmap {
30                 WINBIND_HEADER_VERSION          = 0x0001
31         } winbind_header_version;
32
33         typedef [bitmap32bit] bitmap {
34                 WINBIND_HEADER_FLAGS_RESPONSE   = 0x00000001,
35                 WINBIND_HEADER_FLAGS_ERROR      = 0x00000002
36         } winbind_header_flags;
37
38         const uint32 WINBIND_HEADER_SIZE        = 0x10;
39         [public] struct winbind_header {
40                 uint32 length;
41                 [charset(DOS),value("WBPT")] uint8 magic[4];
42                 [value(WINBIND_HEADER_VERSION)] winbind_header_version version;
43                 uint16 opnum;
44                 winbind_header_flags flags;
45         };
46
47         /*
48          * Just tell me winbindd is running
49          */
50         winbind_status winbind_ping();
51
52         /*
53          * - Get the interface version
54          * - Find the location of the privileged pipe
55          */
56         winbind_status winbind_interface_details(/*TODO*/);
57
58         /*
59          * Get users and groups
60          */
61         winbind_status winbind_getpwnam(/*TODO*/);
62         winbind_status winbind_getpwuid(/*TODO*/);
63
64         winbind_status winbind_getgrnam(/*TODO*/);
65         winbind_status winbind_getgrgid(/*TODO*/);
66
67         winbind_status winbind_getgroups(/*TODO*/);
68
69         /*
70          * Enumerate users and groups
71          */
72         winbind_status winbind_setpwent(/*TODO*/);
73         winbind_status winbind_endpwent(/*TODO*/);
74         winbind_status winbind_getpwent(/*TODO*/);
75
76         winbind_status winbind_setgrent(/*TODO*/);
77         winbind_status winbind_endgrent(/*TODO*/);
78         winbind_status winbind_getgrent(/*TODO*/);
79
80         /*
81          * PAM authenticate and password change
82          */
83         winbind_status winbind_pam_auth(/*TODO*/);
84         winbind_status winbind_pam_auth_crap(/*TODO*/);
85         winbind_status winbind_pam_chauthtok(/*TODO*/);
86         winbind_status winbind_pam_logoff(/*TODO*/);
87         winbind_status winbind_pam_chng_paswd_auth_crap(/*TODO*/);
88
89         /*
90          * List various things
91          */
92
93         /* List w/o rid->id mapping */
94         winbind_status winbind_list_users(/*TODO*/);
95
96         /* List w/o rid->id mapping */
97         winbind_status winbind_list_groups(/*TODO*/);
98
99         winbind_status winbind_list_trustdom(/*TODO*/);
100
101         /*
102          * Lookup functions
103          */
104
105         winbind_status winbind_lookup_sid(/*TODO*/);
106         winbind_status winbind_lookup_name(/*TODO*/);
107         winbind_status winbind_lookup_rids(/*TODO*/);
108
109         /*
110          * SID conversion
111          */
112         typedef [v1_enum] enum {
113                 WINBIND_IDMAP_LEVEL_SID_TO_UID          = 1,
114                 WINBIND_IDMAP_LEVEL_SID_TO_GID          = 2,
115                 WINBIND_IDMAP_LEVEL_UID_TO_SID          = 3,
116                 WINBIND_IDMAP_LEVEL_GID_TO_SID          = 4
117         } winbind_get_idmap_level;
118
119         typedef [switch_type(winbind_get_idmap_level)] union {
120         [case(WINBIND_IDMAP_LEVEL_SID_TO_UID)]
121 /*TODO          [ref]*/ dom_sid *sid;
122         [case(WINBIND_IDMAP_LEVEL_SID_TO_GID)]
123 /*TODO          [ref]*/ dom_sid *sid;
124         [case(WINBIND_IDMAP_LEVEL_UID_TO_SID)]
125                 hyper uid;
126         [case(WINBIND_IDMAP_LEVEL_GID_TO_SID)]
127                 hyper gid;
128         } winbind_get_idmap_req;
129
130         typedef [switch_type(winbind_get_idmap_level)] union {
131         [case(WINBIND_IDMAP_LEVEL_SID_TO_UID)]
132                 hyper uid;
133         [case(WINBIND_IDMAP_LEVEL_SID_TO_GID)]
134                 hyper gid;
135         [case(WINBIND_IDMAP_LEVEL_UID_TO_SID)]
136 /*TODO          [ref]*/ dom_sid *sid;
137         [case(WINBIND_IDMAP_LEVEL_GID_TO_SID)]
138 /*TODO          [ref]*/ dom_sid *sid;
139         } winbind_get_idmap_rep;
140
141         winbind_status winbind_get_idmap(
142                 [in,out] winbind_get_idmap_level *level,
143                 [in,switch_is(*level)] winbind_get_idmap_req req,
144                 [out,switch_is(*level)] winbind_get_idmap_rep *rep
145         );
146
147         typedef [v1_enum] enum {
148                 WINBIND_SET_IDMAP_LEVEL_ALLOCATE_UID            = 1,
149                 WINBIND_SET_IDMAP_LEVEL_ALLOCATE_GID            = 2,
150                 WINBIND_SET_IDMAP_LEVEL_SET_MAPPING             = 3,
151                 WINBIND_SET_IDMAP_LEVEL_SET_HWM                 = 4
152         } winbind_set_idmap_level;
153
154         typedef [switch_type(winbind_set_idmap_level)] union {
155         [case(WINBIND_SET_IDMAP_LEVEL_ALLOCATE_UID)];
156         [case(WINBIND_SET_IDMAP_LEVEL_ALLOCATE_GID)];
157         [case(WINBIND_SET_IDMAP_LEVEL_SET_MAPPING)]
158                 id_map mapping;
159         [case(WINBIND_SET_IDMAP_LEVEL_SET_HWM)]
160                 unixid hwm;
161         } winbind_set_idmap_req;
162
163         typedef [switch_type(winbind_set_idmap_level)] union {
164         [case(WINBIND_SET_IDMAP_LEVEL_ALLOCATE_UID)]
165                 hyper uid;
166         [case(WINBIND_SET_IDMAP_LEVEL_ALLOCATE_GID)]
167                 hyper gid;
168         [case(WINBIND_SET_IDMAP_LEVEL_SET_MAPPING)];
169         [case(WINBIND_SET_IDMAP_LEVEL_SET_HWM)];
170         } winbind_set_idmap_rep;
171
172         winbind_status winbind_set_idmap(
173                 [in,out] winbind_set_idmap_level *level,
174                 [in,switch_is(*level)] winbind_set_idmap_req req,
175                 [out,switch_is(*level)] winbind_set_idmap_rep *rep
176         );
177
178         /* Check machine account pw works */
179         winbind_status winbind_check_machcc(/*TODO*/);
180         /* Various bit of info.  Currently just tidbits */
181         winbind_status winbind_info_fixname(/*TODO*/);
182         /* The domain this winbind server is a member of (lp_workgroup()) */
183         winbind_status winbind_domain_name(/*TODO*/);
184
185         /* Most of what we know from struct winbind_domain */
186         struct winbind_domain_info_compat {
187                 [string,charset(UTF8)] uint8    netbios_name[];
188                 [string,charset(UTF8)] uint8    *dns_name;
189                 [ref] dom_sid                   *sid;
190                 boolean32                       is_native_mode;
191                 boolean32                       is_active_directory;
192                 boolean32                       is_primary;
193         };
194
195         typedef [v1_enum] enum {
196                 WINBIND_DOMAIN_INFO_LEVEL_COMPAT = 1,
197                 WINBIND_DOMAIN_INFO_LEVEL_SEQNUM = 2
198         } winbind_domain_info_level;
199
200         typedef [switch_type(winbind_domain_info_level)] union {
201         [case(WINBIND_DOMAIN_INFO_LEVEL_COMPAT)]
202                 struct winbind_domain_info_compat compat;
203         [case(WINBIND_DOMAIN_INFO_LEVEL_SEQNUM)]
204                 hyper seqnum;
205         } winbind_domain_info;
206
207         winbind_status winbind_get_domain_info(
208                 [in,string,charset(UTF8)] uint8 domain_name[],
209                 [in,unique,string,charset(UTF8)] uint8 *dc_name,
210                 [in,out] winbind_domain_info_level *level,
211                 [out,switch_is(*level)] winbind_domain_info *domain_info
212         );
213
214         /* Issue a GetDCName or DsGetDCName Request */
215         typedef [v1_enum] enum {
216                 WINBIND_DC_INFO_LEVEL_COMPAT_NT4        = 1,
217                 WINBIND_DC_INFO_LEVEL_COMPAT_DS         = 2
218         } winbind_dc_info_level;
219
220         typedef [switch_type(winbind_dc_info_level)] union {
221         [case(WINBIND_DC_INFO_LEVEL_COMPAT_NT4)];
222         [case(WINBIND_DC_INFO_LEVEL_COMPAT_DS)]
223                 uint32 flags;
224         } winbind_dc_info_params;
225
226         typedef [switch_type(winbind_dc_info_level)] union {
227         [case(WINBIND_DC_INFO_LEVEL_COMPAT_NT4)]
228                 [string,charset(UTF8)] uint8 *name;
229         [case(WINBIND_DC_INFO_LEVEL_COMPAT_DS)]
230                 [string,charset(UTF8)] uint8 *name;
231         } winbind_dc_info;
232
233         winbind_status winbind_get_dc_info(
234                 [in,string,charset(UTF8)] uint8 domain_name[],
235                 [in,out] winbind_dc_info_level *level,
236                 [in,switch_is(*level)] winbind_dc_info_params params,
237                 [out,switch_is(*level)] winbind_dc_info *dc_info
238         );
239
240         /*
241          * WINS commands
242          */
243
244         winbind_status winbind_wins_byip(/*TODO*/);
245         winbind_status winbind_wins_byname(/*TODO*/);
246
247         /* this is like GETGRENT but gives an empty group list */
248         winbind_status winbind_getgrlist(/*TODO*/);
249
250         /* The netbios name of the server */
251         winbind_status winbind_netbios_name(/*TODO*/);
252
253
254         /* return a list of group sids for a user sid */
255         winbind_status winbind_getusersids(/*TODO*/);
256
257         /* Various group queries */
258         winbind_status winbind_getuserdomgroups(/*TODO*/);
259
260         /*
261          * Wrapper around possibly blocking unix nss calls
262          */
263
264         winbind_status winbind_dual_userinfo(/*TODO*/);
265         winbind_status winbind_dual_getsidaliases(/*TODO*/);
266
267         /*
268          * Complete the challenge phase of the NTLM authentication
269          * protocol using cached password.
270          */
271         winbind_status winbind_ccache_ntlmauth(/*TODO*/);
272 }