netapi: cosmetics, use "buffer" everywhere.
[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         [public] typedef struct {
165                 string usri2_name;
166                 string usri2_password;
167                 uint32 usri2_password_age;
168                 uint32 usri2_priv;
169                 string usri2_home_dir;
170                 string usri2_comment;
171                 uint32 usri2_flags;
172                 string usri2_script_path;
173                 uint32 usri2_auth_flags;
174                 string usri2_full_name;
175                 string usri2_usr_comment;
176                 string usri2_parms;
177                 string usri2_workstations;
178                 uint32 usri2_last_logon;
179                 uint32 usri2_last_logoff;
180                 uint32 usri2_acct_expires;
181                 uint32 usri2_max_storage;
182                 uint32 usri2_units_per_week;
183                 uint8 *usri2_logon_hours;
184                 uint32 usri2_bad_pw_count;
185                 uint32 usri2_num_logons;
186                 string usri2_logon_server;
187                 uint32 usri2_country_code;
188                 uint32 usri2_code_page;
189         } USER_INFO_2;
190
191         [public] typedef struct {
192                 string usri3_name;
193                 uint32 usri3_password_age;
194                 uint32 usri3_priv;
195                 string usri3_home_dir;
196                 string usri3_comment;
197                 uint32 usri3_flags;
198                 string usri3_script_path;
199                 uint32 usri3_auth_flags;
200                 string usri3_full_name;
201                 string usri3_usr_comment;
202                 string usri3_parms;
203                 string usri3_workstations;
204                 uint32 usri3_last_logon;
205                 uint32 usri3_last_logoff;
206                 uint32 usri3_acct_expires;
207                 uint32 usri3_max_storage;
208                 uint32 usri3_units_per_week;
209                 uint8 *usri3_logon_hours;
210                 uint32 usri3_bad_pw_count;
211                 uint32 usri3_num_logons;
212                 string usri3_logon_server;
213                 uint32 usri3_country_code;
214                 uint32 usri3_code_page;
215                 uint32 usri3_user_id;
216                 uint32 usri3_primary_group_id;
217                 string usri3_profile;
218                 string usri3_home_dir_drive;
219                 uint32 usri3_password_expired;
220         } USER_INFO_3;
221
222         [public] typedef struct {
223                 string usri4_name;
224                 string usri4_password;
225                 uint32 usri4_password_age;
226                 uint32 usri4_priv;
227                 string usri4_home_dir;
228                 string usri4_comment;
229                 uint32 usri4_flags;
230                 string usri4_script_path;
231                 uint32 usri4_auth_flags;
232                 string usri4_full_name;
233                 string usri4_usr_comment;
234                 string usri4_parms;
235                 string usri4_workstations;
236                 uint32 usri4_last_logon;
237                 uint32 usri4_last_logoff;
238                 uint32 usri4_acct_expires;
239                 uint32 usri4_max_storage;
240                 uint32 usri4_units_per_week;
241                 uint8 *usri4_logon_hours;
242                 uint32 usri4_bad_pw_count;
243                 uint32 usri4_num_logons;
244                 string usri4_logon_server;
245                 uint32 usri4_country_code;
246                 uint32 usri4_code_page;
247                 dom_sid *usri4_user_sid;
248                 uint32 usri4_primary_group_id;
249                 string usri4_profile;
250                 string usri4_home_dir_drive;
251                 uint32 usri4_password_expired;
252         } USER_INFO_4;
253
254         [public] typedef struct {
255                 string usri10_name;
256                 string usri10_comment;
257                 string usri10_usr_comment;
258                 string usri10_full_name;
259         } USER_INFO_10;
260
261         [public] typedef struct {
262                 string usri11_name;
263                 string usri11_comment;
264                 string usri11_usr_comment;
265                 string usri11_full_name;
266                 uint32 usri11_priv;
267                 uint32 usri11_auth_flags;
268                 uint32 usri11_password_age;
269                 string usri11_home_dir;
270                 string usri11_parms;
271                 uint32 usri11_last_logon;
272                 uint32 usri11_last_logoff;
273                 uint32 usri11_bad_pw_count;
274                 uint32 usri11_num_logons;
275                 string usri11_logon_server;
276                 uint32 usri11_country_code;
277                 string usri11_workstations;
278                 uint32 usri11_max_storage;
279                 uint32 usri11_units_per_week;
280                 uint8 *usri11_logon_hours;
281                 uint32 usri11_code_page;
282         } USER_INFO_11;
283
284         [public] typedef struct {
285                 string usri20_name;
286                 string usri20_full_name;
287                 string usri20_comment;
288                 uint32 usri20_flags;
289                 uint32 usri20_user_id;
290         } USER_INFO_20;
291
292         [public] typedef struct {
293                 string usri23_name;
294                 string usri23_full_name;
295                 string usri23_comment;
296                 uint32 usri23_flags;
297                 domsid *usri23_user_sid;
298         } USER_INFO_23;
299
300         [public] typedef struct {
301                 string usri1007_comment;
302         } USER_INFO_1007;
303
304         [public] typedef struct {
305                 string usriX_name;
306                 string usriX_password;
307                 uint32 usriX_password_age;
308                 uint32 usriX_priv;
309                 string usriX_home_dir;
310                 string usriX_comment;
311                 uint32 usriX_flags;
312                 string usriX_script_path;
313                 uint32 usriX_auth_flags;
314                 string usriX_full_name;
315                 string usriX_usr_comment;
316                 string usriX_parms;
317                 string usriX_workstations;
318                 uint32 usriX_last_logon;
319                 uint32 usriX_last_logoff;
320                 uint32 usriX_acct_expires;
321                 uint32 usriX_max_storage;
322                 uint32 usriX_units_per_week;
323                 uint8 *usriX_logon_hours;
324                 uint32 usriX_bad_pw_count;
325                 uint32 usriX_num_logons;
326                 string usriX_logon_server;
327                 uint32 usriX_country_code;
328                 uint32 usriX_code_page;
329         } USER_INFO_X;
330
331         [nopush,nopull] NET_API_STATUS NetUserAdd(
332                 [in,unique] string *server_name,
333                 [in] uint32 level,
334                 [in,ref] uint8 *buffer,
335                 [out,ref] uint32 *parm_error
336                 );
337
338         /*******************************************/
339         /* NetUserDel                              */
340         /*******************************************/
341
342         [nopush,nopull] NET_API_STATUS NetUserDel(
343                 [in,unique] string *server_name,
344                 [in,ref] string *user_name
345                 );
346
347         /*******************************************/
348         /* NetUserEnum                             */
349         /*******************************************/
350
351         const int FILTER_TEMP_DUPLICATE_ACCOUNT = 0x0001;
352         const int FILTER_NORMAL_ACCOUNT = 0x0002;
353         const int FILTER_INTERDOMAIN_TRUST_ACCOUNT = 0x0008;
354         const int FILTER_WORKSTATION_TRUST_ACCOUNT = 0x0010;
355         const int FILTER_SERVER_TRUST_ACCOUNT = 0x0020;
356
357         [nopush,nopull] NET_API_STATUS NetUserEnum(
358                 [in,unique] string *server_name,
359                 [in] uint32 level,
360                 [in] uint32 filter,
361                 [out,ref] uint8 **buffer,
362                 [in] uint32 prefmaxlen,
363                 [out,ref] uint32 *entries_read,
364                 [out,ref] uint32 *total_entries,
365                 [in,out,ref] uint32 *resume_handle
366                 );
367
368         /*******************************************/
369         /* NetUserChangePassword                   */
370         /*******************************************/
371
372         [nopush,nopull] NET_API_STATUS NetUserChangePassword(
373                 [in] string domain_name,
374                 [in] string user_name,
375                 [in] string old_password,
376                 [in] string new_password
377                 );
378
379         /*******************************************/
380         /* NetUserGetInfo                          */
381         /*******************************************/
382
383         [nopush,nopull] NET_API_STATUS NetUserGetInfo(
384                 [in] string server_name,
385                 [in] string user_name,
386                 [in] uint32 level,
387                 [out] uint8 **buffer
388                 );
389
390         /*******************************************/
391         /* NetUserSetInfo                          */
392         /*******************************************/
393
394         [nopush,nopull] NET_API_STATUS NetUserSetInfo(
395                 [in] string server_name,
396                 [in] string user_name,
397                 [in] uint32 level,
398                 [in] uint8 *buffer,
399                 [out] uint32 *parm_err
400                 );
401
402         /*******************************************/
403         /* NetQueryDisplayInformation              */
404         /*******************************************/
405
406         [public] typedef struct {
407                 string usri1_name;
408                 string usri1_comment;
409                 uint32 usri1_flags;
410                 string usri1_full_name;
411                 uint32 usri1_user_id;
412                 uint32 usri1_next_index;
413         } NET_DISPLAY_USER;
414
415         [public] typedef struct {
416                 string usri2_name;
417                 string usri2_comment;
418                 uint32 usri2_flags;
419                 uint32 usri2_user_id;
420                 uint32 usri2_next_index;
421         } NET_DISPLAY_MACHINE;
422
423         [public] typedef struct {
424                 string grpi3_name;
425                 string grpi3_comment;
426                 uint32 grpi3_group_id;
427                 uint32 grpi3_attributes;
428                 uint32 grpi3_next_index;
429         } NET_DISPLAY_GROUP;
430
431         [nopush,nopull] NET_API_STATUS NetQueryDisplayInformation(
432                 [in,unique] string *server_name,
433                 [in] uint32 level,
434                 [in] uint32 idx,
435                 [in] uint32 entries_requested,
436                 [in] uint32 prefmaxlen,
437                 [out,ref] uint32 *entries_read,
438                 [out,ref,noprint] void **buffer
439                 );
440
441         /*******************************************/
442         /* NetGroupAdd                             */
443         /*******************************************/
444
445         typedef struct {
446                 string grpi0_name;
447         } GROUP_INFO_0;
448
449         typedef struct {
450                 string grpi1_name;
451                 string grpi1_comment;
452         } GROUP_INFO_1;
453
454         typedef struct {
455                 string grpi2_name;
456                 string grpi2_comment;
457                 uint32 grpi2_group_id;
458                 uint32 grpi2_attributes;
459         } GROUP_INFO_2;
460
461         typedef struct {
462                 string grpi3_name;
463                 string grpi3_comment;
464                 domsid *grpi3_group_sid;
465                 uint32 grpi3_attributes;
466         } GROUP_INFO_3;
467
468         typedef struct {
469                 string grpi1002_comment;
470         } GROUP_INFO_1002;
471
472         typedef struct {
473                 uint32 grpi1005_attributes;
474         } GROUP_INFO_1005;
475
476         [nopush,nopull] NET_API_STATUS NetGroupAdd(
477                 [in] string server_name,
478                 [in] uint32 level,
479                 [in] uint8 *buffer,
480                 [out] uint32 *parm_err
481                 );
482
483         /*******************************************/
484         /* NetGroupDel                             */
485         /*******************************************/
486
487         [nopush,nopull] NET_API_STATUS NetGroupDel(
488                 [in] string server_name,
489                 [in] string group_name
490                 );
491
492         /*******************************************/
493         /* NetGroupEnum                            */
494         /*******************************************/
495
496         [nopush,nopull] NET_API_STATUS NetGroupEnum(
497                 [in] string server_name,
498                 [in] uint32 level,
499                 [out,ref] uint8 **buffer,
500                 [in] uint32 prefmaxlen,
501                 [out,ref] uint32 *entries_read,
502                 [out,ref] uint32 *total_entries,
503                 [in,out,ref] uint32 *resume_handle
504                 );
505
506         /*******************************************/
507         /* NetGroupSetInfo                         */
508         /*******************************************/
509
510         [nopush,nopull] NET_API_STATUS NetGroupSetInfo(
511                 [in] string server_name,
512                 [in] string group_name,
513                 [in] uint32 level,
514                 [in] uint8 *buffer,
515                 [out] uint32 *parm_err
516                 );
517
518         /*******************************************/
519         /* NetGroupGetInfo                         */
520         /*******************************************/
521
522         [nopush,nopull] NET_API_STATUS NetGroupGetInfo(
523                 [in] string server_name,
524                 [in] string group_name,
525                 [in] uint32 level,
526                 [out] uint8 **buffer
527                 );
528
529         /*******************************************/
530         /* NetGroupAddUser                         */
531         /*******************************************/
532
533         [nopush,nopull] NET_API_STATUS NetGroupAddUser(
534                 [in] string server_name,
535                 [in] string group_name,
536                 [in] string user_name
537                 );
538
539         /*******************************************/
540         /* NetGroupDelUser                         */
541         /*******************************************/
542
543         [nopush,nopull] NET_API_STATUS NetGroupDelUser(
544                 [in] string server_name,
545                 [in] string group_name,
546                 [in] string user_name
547                 );
548
549         /*******************************************/
550         /* NetLocalGroupAdd                        */
551         /*******************************************/
552
553         typedef struct {
554                 string lgrpi0_name;
555         } LOCALGROUP_INFO_0;
556
557         typedef struct {
558                 string lgrpi1_name;
559                 string lgrpi1_comment;
560         } LOCALGROUP_INFO_1;
561
562         typedef struct {
563                 string lgrpi1002_comment;
564         } LOCALGROUP_INFO_1002;
565
566         [nopush,nopull] NET_API_STATUS NetLocalGroupAdd(
567                 [in] string server_name,
568                 [in] uint32 level,
569                 [in] uint8 *buffer,
570                 [out,ref] uint32 *parm_err
571                 );
572
573         /*******************************************/
574         /* NetLocalGroupDel                        */
575         /*******************************************/
576
577         [nopush,nopull] NET_API_STATUS NetLocalGroupDel(
578                 [in] string server_name,
579                 [in] string group_name
580                 );
581
582         /*******************************************/
583         /* NetLocalGroupGetInfo                    */
584         /*******************************************/
585
586         [nopush,nopull] NET_API_STATUS NetLocalGroupGetInfo(
587                 [in] string server_name,
588                 [in] string group_name,
589                 [in] uint32 level,
590                 [out,ref] uint8 **buffer
591                 );
592
593         /*******************************************/
594         /* NetLocalGroupSetInfo                    */
595         /*******************************************/
596
597         [nopush,nopull] NET_API_STATUS NetLocalGroupSetInfo(
598                 [in] string server_name,
599                 [in] string group_name,
600                 [in] uint32 level,
601                 [in,ref] uint8 *buffer,
602                 [out,ref] uint32 *parm_err
603                 );
604
605         /*******************************************/
606         /* NetLocalGroupEnum                       */
607         /*******************************************/
608
609         [nopush,nopull] NET_API_STATUS NetLocalGroupEnum(
610                 [in] string server_name,
611                 [in] uint32 level,
612                 [out,ref] uint8 **buffer,
613                 [in] uint32 prefmaxlen,
614                 [out,ref] uint32 *entries_read,
615                 [out,ref] uint32 *total_entries,
616                 [in,out,ref] uint32 *resume_handle
617                 );
618
619         /*******************************************/
620         /* NetRemoteTOD                            */
621         /*******************************************/
622
623         typedef struct {
624                 uint32 tod_elapsedt;
625                 uint32 tod_msecs;
626                 uint32 tod_hours;
627                 uint32 tod_mins;
628                 uint32 tod_secs;
629                 uint32 tod_hunds;
630                 int32 tod_timezone;
631                 uint32 tod_tinterval;
632                 uint32 tod_day;
633                 uint32 tod_month;
634                 uint32 tod_year;
635                 uint32 tod_weekday;
636         } TIME_OF_DAY_INFO;
637
638         [nopush,nopull] NET_API_STATUS NetRemoteTOD(
639                 [in] string server_name,
640                 [out,ref] uint8 **buffer
641                 );
642 }