wb-ndr: add idl for winbindd_get_dc_info() with compat levels
[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
113         winbind_status winbind_sid_to_uid(/*TODO*/);
114         winbind_status winbind_sid_to_gid(/*TODO*/);
115         winbind_status winbind_uid_to_sid(/*TODO*/);
116         winbind_status winbind_gid_to_sid(/*TODO*/);
117
118         winbind_status winbind_allocate_uid(/*TODO*/);
119         winbind_status winbind_allocate_gid(/*TODO*/);
120         winbind_status winbind_set_mapping(/*TODO*/);
121         winbind_status winbind_set_hwm(/*TODO*/);
122
123         /*
124          * Miscellaneous other stuff
125          */
126
127         /* Check machine account pw works */
128         winbind_status winbind_check_machcc(/*TODO*/);
129         /* Various bit of info.  Currently just tidbits */
130         winbind_status winbind_info_fixname(/*TODO*/);
131         /* The domain this winbind server is a member of (lp_workgroup()) */
132         winbind_status winbind_domain_name(/*TODO*/);
133
134         /* Most of what we know from struct winbind_domain */
135         struct winbind_domain_info_compat {
136                 [string,charset(UTF8)] uint8    netbios_name[];
137                 [string,charset(UTF8)] uint8    *dns_name;
138                 [ref] dom_sid                   *sid;
139                 boolean32                       is_native_mode;
140                 boolean32                       is_active_directory;
141                 boolean32                       is_primary;
142         };
143
144         typedef [v1_enum] enum {
145                 WINBIND_DOMAIN_INFO_LEVEL_COMPAT = 1
146         } winbind_domain_info_level;
147
148         typedef [switch_type(winbind_domain_info_level)] union {
149         [case(WINBIND_DOMAIN_INFO_LEVEL_COMPAT)]
150                 struct winbind_domain_info_compat compat;
151         } winbind_domain_info;
152
153         winbind_status winbind_get_domain_info(
154                 [in,string,charset(UTF8)] uint8 domain_name[],
155                 [in,unique,string,charset(UTF8)] uint8 *dc_name,
156                 [in,out] winbind_domain_info_level *level,
157                 [out,switch_is(*level)] winbind_domain_info *domain_info
158         );
159
160         /* Issue a GetDCName or DsGetDCName Request */
161         typedef [v1_enum] enum {
162                 WINBIND_DC_INFO_LEVEL_COMPAT_NT4        = 1,
163                 WINBIND_DC_INFO_LEVEL_COMPAT_DS         = 2
164         } winbind_dc_info_level;
165
166         typedef [switch_type(winbind_dc_info_level)] union {
167         [case(WINBIND_DC_INFO_LEVEL_COMPAT_NT4)];
168         [case(WINBIND_DC_INFO_LEVEL_COMPAT_DS)]
169                 uint32 flags;
170         } winbind_dc_info_params;
171
172         typedef [switch_type(winbind_dc_info_level)] union {
173         [case(WINBIND_DC_INFO_LEVEL_COMPAT_NT4)]
174                 [string,charset(UTF8)] uint8 *name;
175         [case(WINBIND_DC_INFO_LEVEL_COMPAT_DS)]
176                 [string,charset(UTF8)] uint8 *name;
177         } winbind_dc_info;
178
179         winbind_status winbind_get_dc_info(
180                 [in,string,charset(UTF8)] uint8 domain_name[],
181                 [in,out] winbind_dc_info_level *level,
182                 [in,switch_is(*level)] winbind_dc_info_params params,
183                 [out,switch_is(*level)] winbind_dc_info *dc_info
184         );
185
186         /* display sequence numbers of domains */
187         winbind_status winbind_show_sequence(/*TODO*/);
188
189         /*
190          * WINS commands
191          */
192
193         winbind_status winbind_wins_byip(/*TODO*/);
194         winbind_status winbind_wins_byname(/*TODO*/);
195
196         /* this is like GETGRENT but gives an empty group list */
197         winbind_status winbind_getgrlist(/*TODO*/);
198
199         /* The netbios name of the server */
200         winbind_status winbind_netbios_name(/*TODO*/);
201
202
203         /* return a list of group sids for a user sid */
204         winbind_status winbind_getusersids(/*TODO*/);
205
206         /* Various group queries */
207         winbind_status winbind_getuserdomgroups(/*TODO*/);
208
209         /*
210          * Blocking calls that are not allowed on the main winbind pipe, only
211          * between parent and children
212          */
213         winbind_status winbind_dual_sid2gid(/*TODO*/);
214         winbind_status winbind_dual_sid2uid(/*TODO*/);
215         winbind_status winbind_dual_uid2sid(/*TODO*/);
216         winbind_status winbind_dual_gid2sid(/*TODO*/);
217         winbind_status winbind_dual_set_mapping(/*TODO*/);
218         winbind_status winbind_dual_set_hwm(/*TODO*/);
219
220         /*
221          * Wrapper around possibly blocking unix nss calls
222          */
223
224         winbind_status winbind_dual_userinfo(/*TODO*/);
225         winbind_status winbind_dual_getsidaliases(/*TODO*/);
226
227         /*
228          * Complete the challenge phase of the NTLM authentication
229          * protocol using cached password.
230          */
231         winbind_status winbind_ccache_ntlmauth(/*TODO*/);
232 }