netapi: make sid in GROUP_INFO_3 a pointer.
[metze/samba/wip.git] / source3 / librpc / idl / libnetapi.idl
1 /*
2   libnetapi interface definition
3 */
4
5 cpp_quote("#define LIBNETAPI_LOCAL_SERVER(x) (!x || is_myname_or_ipaddr(x))")
6 cpp_quote("#ifndef MAXSUBAUTHS")
7 cpp_quote("#define MAXSUBAUTHS 15 /* max sub authorities in a SID */")
8 cpp_quote("#endif")
9
10 [
11         pointer_default(unique)
12 ]
13 interface libnetapi
14 {
15         const int ERROR_MORE_DATA = 234L;
16
17         [public] typedef [v1_enum] enum {
18                 NERR_Success=0
19         } NET_API_STATUS;
20
21         [public] typedef struct {
22                 uint8 sid_rev_num;
23                 uint8 num_auths;
24                 uint8 id_auth[6];
25                 uint32 sub_auths[MAXSUBAUTHS];
26         } domsid;
27
28         /*******************************************/
29         /* NetJoinDomain                           */
30         /*******************************************/
31
32         [nopush,nopull] NET_API_STATUS NetJoinDomain(
33                 [in,unique] string *server,
34                 [in,ref] string *domain,
35                 [in,unique] string *account_ou,
36                 [in,unique] string *account,
37                 [in,unique] string *password,
38                 [in] uint32 join_flags
39                 );
40
41         /*******************************************/
42         /* NetUnjoinDomain                         */
43         /*******************************************/
44
45         [nopush,nopull] NET_API_STATUS NetUnjoinDomain(
46                 [in,unique] string *server_name,
47                 [in,unique] string *account,
48                 [in,unique] string *password,
49                 [in] uint32 unjoin_flags
50                 );
51
52         /*******************************************/
53         /* NetGetJoinInformation                   */
54         /*******************************************/
55
56         [nopush,nopull] NET_API_STATUS NetGetJoinInformation(
57                 [in,unique] string *server_name,
58                 [out] string **name_buffer,
59                 [out] uint16 *name_type
60                 );
61
62         /*******************************************/
63         /* NetGetJoinableOUs                       */
64         /*******************************************/
65
66         [nopush,nopull] NET_API_STATUS NetGetJoinableOUs(
67                 [in,unique] string *server_name,
68                 [in,ref] string *domain,
69                 [in,unique] string *account,
70                 [in,unique] string *password,
71                 [out] uint32 *ou_count,
72                 [out] string ***ous
73                 );
74
75         /*******************************************/
76         /* NetServerGetInfo                        */
77         /*******************************************/
78
79         [public] typedef struct {
80                 string sv1005_comment;
81         } SERVER_INFO_1005;
82
83         [nopush,nopull] NET_API_STATUS NetServerGetInfo(
84                 [in,unique] string *server_name,
85                 [in] uint32 level,
86                 [out] uint8 **buffer
87                 );
88
89         /*******************************************/
90         /* NetServerSetInfo                        */
91         /*******************************************/
92
93         [nopush,nopull] NET_API_STATUS NetServerSetInfo(
94                 [in,unique] string *server_name,
95                 [in] uint32 level,
96                 [in] uint8 *buffer,
97                 [out] uint32 *parm_error
98                 );
99
100         /*******************************************/
101         /* NetGetDCName                            */
102         /*******************************************/
103
104         [nopush,nopull] NET_API_STATUS NetGetDCName(
105                 [in,unique] string *server_name,
106                 [in,unique] string *domain_name,
107                 [out] uint8 **buffer
108                 );
109
110         /*******************************************/
111         /* NetGetAnyDCName                         */
112         /*******************************************/
113
114         [nopush,nopull] NET_API_STATUS NetGetAnyDCName(
115                 [in,unique] string *server_name,
116                 [in,unique] string *domain_name,
117                 [out] uint8 **buffer
118                 );
119
120         /*******************************************/
121         /* DsGetDcName                             */
122         /*******************************************/
123
124         [public] typedef struct {
125                 string domain_controller_name;
126                 string domain_controller_address;
127                 uint32 domain_controller_address_type;
128                 GUID domain_guid;
129                 string domain_name;
130                 string dns_forest_name;
131                 uint32 flags;
132                 string dc_site_name;
133                 string client_site_name;
134         } DOMAIN_CONTROLLER_INFO;
135
136         [nopush,nopull] NET_API_STATUS DsGetDcName(
137                 [in,unique] string *server_name,
138                 [in,ref] string *domain_name,
139                 [in,unique] GUID *domain_guid,
140                 [in,unique] string *site_name,
141                 [in] uint32 flags,
142                 [out,ref] DOMAIN_CONTROLLER_INFO **dc_info
143                 );
144
145         /*******************************************/
146         /* NetUserAdd                              */
147         /*******************************************/
148
149         [public] typedef struct {
150                 string usri0_name;
151         } USER_INFO_0;
152
153         [public] typedef struct {
154                 string usri1_name;
155                 string usri1_password;
156                 uint32 usri1_password_age;
157                 uint32 usri1_priv;
158                 string usri1_home_dir;
159                 string usri1_comment;
160                 uint32 usri1_flags;
161                 string usri1_script_path;
162         } USER_INFO_1;
163
164         [nopush,nopull] NET_API_STATUS NetUserAdd(
165                 [in,unique] string *server_name,
166                 [in] uint32 level,
167                 [in,ref] uint8 *buffer,
168                 [out,ref] uint32 *parm_error
169                 );
170
171         /*******************************************/
172         /* NetUserDel                              */
173         /*******************************************/
174
175         [nopush,nopull] NET_API_STATUS NetUserDel(
176                 [in,unique] string *server_name,
177                 [in,ref] string *user_name
178                 );
179
180         /*******************************************/
181         /* NetUserEnum                             */
182         /*******************************************/
183
184         const int FILTER_TEMP_DUPLICATE_ACCOUNT = 0x0001;
185         const int FILTER_NORMAL_ACCOUNT = 0x0002;
186         const int FILTER_INTERDOMAIN_TRUST_ACCOUNT = 0x0008;
187         const int FILTER_WORKSTATION_TRUST_ACCOUNT = 0x0010;
188         const int FILTER_SERVER_TRUST_ACCOUNT = 0x0020;
189
190         [nopush,nopull] NET_API_STATUS NetUserEnum(
191                 [in,unique] string *server_name,
192                 [in] uint32 level,
193                 [in] uint32 filter,
194                 [out,ref] uint8 **buffer,
195                 [in] uint32 prefmaxlen,
196                 [out,ref] uint32 *entries_read,
197                 [out,ref] uint32 *total_entries,
198                 [in,out,ref] uint32 *resume_handle
199                 );
200
201         /*******************************************/
202         /* NetUserChangePassword                   */
203         /*******************************************/
204
205         [nopush,nopull] NET_API_STATUS NetUserChangePassword(
206                 [in] string domain_name,
207                 [in] string user_name,
208                 [in] string old_password,
209                 [in] string new_password
210                 );
211
212         /*******************************************/
213         /* NetQueryDisplayInformation              */
214         /*******************************************/
215
216         [public] typedef struct {
217                 string usri1_name;
218                 string usri1_comment;
219                 uint32 usri1_flags;
220                 string usri1_full_name;
221                 uint32 usri1_user_id;
222                 uint32 usri1_next_index;
223         } NET_DISPLAY_USER;
224
225         [public] typedef struct {
226                 string usri2_name;
227                 string usri2_comment;
228                 uint32 usri2_flags;
229                 uint32 usri2_user_id;
230                 uint32 usri2_next_index;
231         } NET_DISPLAY_MACHINE;
232
233         [public] typedef struct {
234                 string grpi3_name;
235                 string grpi3_comment;
236                 uint32 grpi3_group_id;
237                 uint32 grpi3_attributes;
238                 uint32 grpi3_next_index;
239         } NET_DISPLAY_GROUP;
240
241         [nopush,nopull] NET_API_STATUS NetQueryDisplayInformation(
242                 [in,unique] string *server_name,
243                 [in] uint32 level,
244                 [in] uint32 idx,
245                 [in] uint32 entries_requested,
246                 [in] uint32 prefmaxlen,
247                 [out,ref] uint32 *entries_read,
248                 [out,ref,noprint] void **buffer
249                 );
250
251         /*******************************************/
252         /* NetGroupAdd                             */
253         /*******************************************/
254
255         typedef struct {
256                 string grpi0_name;
257         } GROUP_INFO_0;
258
259         typedef struct {
260                 string grpi1_name;
261                 string grpi1_comment;
262         } GROUP_INFO_1;
263
264         typedef struct {
265                 string grpi2_name;
266                 string grpi2_comment;
267                 uint32 grpi2_group_id;
268                 uint32 grpi2_attributes;
269         } GROUP_INFO_2;
270
271         typedef struct {
272                 string grpi3_name;
273                 string grpi3_comment;
274                 domsid *grpi3_group_sid;
275                 uint32 grpi3_attributes;
276         } GROUP_INFO_3;
277
278         typedef struct {
279                 string grpi1002_comment;
280         } GROUP_INFO_1002;
281
282         typedef struct {
283                 uint32 grpi1005_attributes;
284         } GROUP_INFO_1005;
285
286         [nopush,nopull] NET_API_STATUS NetGroupAdd(
287                 [in] string server_name,
288                 [in] uint32 level,
289                 [in] uint8 *buf,
290                 [out] uint32 *parm_err
291                 );
292
293         /*******************************************/
294         /* NetGroupDel                             */
295         /*******************************************/
296
297         [nopush,nopull] NET_API_STATUS NetGroupDel(
298                 [in] string server_name,
299                 [in] string group_name
300                 );
301
302         /*******************************************/
303         /* NetGroupEnum                            */
304         /*******************************************/
305
306         [nopush,nopull] NET_API_STATUS NetGroupEnum(
307                 [in] string server_name,
308                 [in] uint32 level,
309                 [out,ref] uint8 **buffer,
310                 [in] uint32 prefmaxlen,
311                 [out,ref] uint32 *entries_read,
312                 [out,ref] uint32 *total_entries,
313                 [in,out,ref] uint32 *resume_handle
314                 );
315
316         /*******************************************/
317         /* NetGroupSetInfo                         */
318         /*******************************************/
319
320         [nopush,nopull] NET_API_STATUS NetGroupSetInfo(
321                 [in] string server_name,
322                 [in] string group_name,
323                 [in] uint32 level,
324                 [in] uint8 *buf,
325                 [out] uint32 *parm_err
326                 );
327
328         /*******************************************/
329         /* NetGroupGetInfo                         */
330         /*******************************************/
331
332         [nopush,nopull] NET_API_STATUS NetGroupGetInfo(
333                 [in] string server_name,
334                 [in] string group_name,
335                 [in] uint32 level,
336                 [out] uint8 **buf
337                 );
338
339         /*******************************************/
340         /* NetGroupAddUser                         */
341         /*******************************************/
342
343         [nopush,nopull] NET_API_STATUS NetGroupAddUser(
344                 [in] string server_name,
345                 [in] string group_name,
346                 [in] string user_name
347                 );
348
349         /*******************************************/
350         /* NetGroupDelUser                         */
351         /*******************************************/
352
353         [nopush,nopull] NET_API_STATUS NetGroupDelUser(
354                 [in] string server_name,
355                 [in] string group_name,
356                 [in] string user_name
357                 );
358
359         /*******************************************/
360         /* NetLocalGroupAdd                        */
361         /*******************************************/
362
363         typedef struct {
364                 string lgrpi0_name;
365         } LOCALGROUP_INFO_0;
366
367         typedef struct {
368                 string lgrpi1_name;
369                 string lgrpi1_comment;
370         } LOCALGROUP_INFO_1;
371
372         typedef struct {
373                 string lgrpi1002_comment;
374         } LOCALGROUP_INFO_1002;
375
376         [nopush,nopull] NET_API_STATUS NetLocalGroupAdd(
377                 [in] string server_name,
378                 [in] uint32 level,
379                 [in] uint8 *buf,
380                 [out,ref] uint32 *parm_err
381                 );
382
383         /*******************************************/
384         /* NetLocalGroupDel                        */
385         /*******************************************/
386
387         [nopush,nopull] NET_API_STATUS NetLocalGroupDel(
388                 [in] string server_name,
389                 [in] string group_name
390                 );
391
392         /*******************************************/
393         /* NetLocalGroupGetInfo                    */
394         /*******************************************/
395
396         [nopush,nopull] NET_API_STATUS NetLocalGroupGetInfo(
397                 [in] string server_name,
398                 [in] string group_name,
399                 [in] uint32 level,
400                 [out,ref] uint8 **buf
401                 );
402
403         /*******************************************/
404         /* NetLocalGroupSetInfo                    */
405         /*******************************************/
406
407         [nopush,nopull] NET_API_STATUS NetLocalGroupSetInfo(
408                 [in] string server_name,
409                 [in] string group_name,
410                 [in] uint32 level,
411                 [in,ref] uint8 *buf,
412                 [out,ref] uint32 *parm_err
413                 );
414
415         /*******************************************/
416         /* NetRemoteTOD                            */
417         /*******************************************/
418
419         typedef struct {
420                 uint32 tod_elapsedt;
421                 uint32 tod_msecs;
422                 uint32 tod_hours;
423                 uint32 tod_mins;
424                 uint32 tod_secs;
425                 uint32 tod_hunds;
426                 int32 tod_timezone;
427                 uint32 tod_tinterval;
428                 uint32 tod_day;
429                 uint32 tod_month;
430                 uint32 tod_year;
431                 uint32 tod_weekday;
432         } TIME_OF_DAY_INFO;
433
434         [nopush,nopull] NET_API_STATUS NetRemoteTOD(
435                 [in] string server_name,
436                 [out,ref] uint8 **buf
437                 );
438 }