e9670bb16e37b94753ce08cf4dc5746237d2a214
[metze/samba/wip.git] / source3 / lib / netapi / netapi.h
1 /*
2  *  Unix SMB/CIFS implementation.
3  *  NetApi Support
4  *  Copyright (C) Guenther Deschner 2007-2008
5  *
6  *  This program is free software; you can redistribute it and/or modify
7  *  it under the terms of the GNU General Public License as published by
8  *  the Free Software Foundation; either version 3 of the License, or
9  *  (at your option) any later version.
10  *
11  *  This program is distributed in the hope that it will be useful,
12  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  *  GNU General Public License for more details.
15  *
16  *  You should have received a copy of the GNU General Public License
17  *  along with this program; if not, see <http://www.gnu.org/licenses/>.
18  */
19
20 #ifndef __LIB_NETAPI_H__
21 #define __LIB_NETAPI_H__
22
23 #ifdef __cplusplus
24 extern "C" {
25 #endif /* __cplusplus */
26
27 /****************************************************************
28  NET_API_STATUS
29 ****************************************************************/
30 typedef enum {
31         NET_API_STATUS_SUCCESS = 0
32 } NET_API_STATUS;
33
34 #define ERROR_MORE_DATA ( 234L )
35
36 #define ENCRYPTED_PWLEN ( 16 )
37
38 /****************************************************************
39 ****************************************************************/
40
41 #ifndef _HEADER_misc
42
43 struct GUID {
44         uint32_t time_low;
45         uint16_t time_mid;
46         uint16_t time_hi_and_version;
47         uint8_t clock_seq[2];
48         uint8_t node[6];
49 };
50
51 #endif /* _HEADER_misc */
52
53 #ifndef _HEADER_libnetapi
54
55 #ifndef MAXSUBAUTHS
56 #define MAXSUBAUTHS 15 /* max sub authorities in a SID */
57 #endif
58
59 struct domsid {
60         uint8_t   sid_rev_num;
61         uint8_t   num_auths;
62         uint8_t   id_auth[6];
63         uint32_t  sub_auths[MAXSUBAUTHS];
64 };
65
66 struct DOMAIN_CONTROLLER_INFO {
67         const char * domain_controller_name;
68         const char * domain_controller_address;
69         uint32_t domain_controller_address_type;
70         struct GUID domain_guid;
71         const char * domain_name;
72         const char * dns_forest_name;
73         uint32_t flags;
74         const char * dc_site_name;
75         const char * client_site_name;
76 };
77
78 /* bitmap NetJoinFlags */
79 #define NETSETUP_JOIN_DOMAIN ( 0x00000001 )
80 #define NETSETUP_ACCT_CREATE ( 0x00000002 )
81 #define NETSETUP_ACCT_DELETE ( 0x00000004 )
82 #define NETSETUP_WIN9X_UPGRADE ( 0x00000010 )
83 #define NETSETUP_DOMAIN_JOIN_IF_JOINED ( 0x00000020 )
84 #define NETSETUP_JOIN_UNSECURE ( 0x00000040 )
85 #define NETSETUP_MACHINE_PWD_PASSED ( 0x00000080 )
86 #define NETSETUP_DEFER_SPN_SET ( 0x00000100 )
87 #define NETSETUP_JOIN_DC_ACCOUNT ( 0x00000200 )
88 #define NETSETUP_JOIN_WITH_NEW_NAME ( 0x00000400 )
89 #define NETSETUP_INSTALL_INVOCATION ( 0x00040000 )
90 #define NETSETUP_IGNORE_UNSUPPORTED_FLAGS ( 0x10000000 )
91
92 #define FILTER_TEMP_DUPLICATE_ACCOUNT   ( 0x0001 )
93 #define FILTER_NORMAL_ACCOUNT   ( 0x0002 )
94 #define FILTER_INTERDOMAIN_TRUST_ACCOUNT        ( 0x0008 )
95 #define FILTER_WORKSTATION_TRUST_ACCOUNT        ( 0x0010 )
96 #define FILTER_SERVER_TRUST_ACCOUNT     ( 0x0020 )
97
98 #define TIMEQ_FOREVER  ( (uint32_t)-1L )
99
100 enum NETSETUP_JOIN_STATUS {
101         NetSetupUnknownStatus=0,
102         NetSetupUnjoined=1,
103         NetSetupWorkgroupName=2,
104         NetSetupDomainName=3
105 };
106
107 struct SERVER_INFO_100 {
108         uint32_t sv100_platform_id;
109         const char * sv100_name;
110 };
111
112 struct SERVER_INFO_101 {
113         uint32_t sv101_platform_id;
114         const char * sv101_name;
115         uint32_t sv101_version_major;
116         uint32_t sv101_version_minor;
117         uint32_t sv101_type;
118         const char * sv101_comment;
119 };
120
121 struct SERVER_INFO_102 {
122         uint32_t sv102_platform_id;
123         const char * sv102_name;
124         uint32_t sv102_version_major;
125         uint32_t sv102_version_minor;
126         uint32_t sv102_type;
127         const char * sv102_comment;
128         uint32_t sv102_users;
129         uint32_t sv102_disc;
130         uint8_t sv102_hidden;
131         uint32_t sv102_announce;
132         uint32_t sv102_anndelta;
133         uint32_t sv102_licenses;
134         const char * sv102_userpath;
135 };
136
137
138 struct SERVER_INFO_1005 {
139         const char * sv1005_comment;
140 };
141
142 struct USER_INFO_0 {
143         const char * usri0_name;
144 };
145
146 #define USER_PRIV_GUEST ( 0 )
147 #define USER_PRIV_USER  ( 1 )
148 #define USER_PRIV_ADMIN ( 2 )
149
150 struct USER_INFO_1 {
151         const char * usri1_name;
152         const char * usri1_password;
153         uint32_t usri1_password_age;
154         uint32_t usri1_priv;
155         const char * usri1_home_dir;
156         const char * usri1_comment;
157         uint32_t usri1_flags;
158         const char * usri1_script_path;
159 };
160
161 #define AF_OP_PRINT     ( 0x1 )
162 #define AF_OP_COMM      ( 0x2 )
163 #define AF_OP_SERVER    ( 0x4 )
164 #define AF_OP_ACCOUNTS  ( 0x8 )
165
166 struct USER_INFO_2 {
167         const char * usri2_name;
168         const char * usri2_password;
169         uint32_t usri2_password_age;
170         uint32_t usri2_priv;
171         const char * usri2_home_dir;
172         const char * usri2_comment;
173         uint32_t usri2_flags;
174         const char * usri2_script_path;
175         uint32_t usri2_auth_flags;
176         const char * usri2_full_name;
177         const char * usri2_usr_comment;
178         const char * usri2_parms;
179         const char * usri2_workstations;
180         uint32_t usri2_last_logon;
181         uint32_t usri2_last_logoff;
182         uint32_t usri2_acct_expires;
183         uint32_t usri2_max_storage;
184         uint32_t usri2_units_per_week;
185         uint8_t *usri2_logon_hours;/* [unique] */
186         uint32_t usri2_bad_pw_count;
187         uint32_t usri2_num_logons;
188         const char * usri2_logon_server;
189         uint32_t usri2_country_code;
190         uint32_t usri2_code_page;
191 };
192
193 struct USER_INFO_3 {
194         const char * usri3_name;
195         uint32_t usri3_password_age;
196         uint32_t usri3_priv;
197         const char * usri3_home_dir;
198         const char * usri3_comment;
199         uint32_t usri3_flags;
200         const char * usri3_script_path;
201         uint32_t usri3_auth_flags;
202         const char * usri3_full_name;
203         const char * usri3_usr_comment;
204         const char * usri3_parms;
205         const char * usri3_workstations;
206         uint32_t usri3_last_logon;
207         uint32_t usri3_last_logoff;
208         uint32_t usri3_acct_expires;
209         uint32_t usri3_max_storage;
210         uint32_t usri3_units_per_week;
211         uint8_t *usri3_logon_hours;/* [unique] */
212         uint32_t usri3_bad_pw_count;
213         uint32_t usri3_num_logons;
214         const char * usri3_logon_server;
215         uint32_t usri3_country_code;
216         uint32_t usri3_code_page;
217         uint32_t usri3_user_id;
218         uint32_t usri3_primary_group_id;
219         const char * usri3_profile;
220         const char * usri3_home_dir_drive;
221         uint32_t usri3_password_expired;
222 };
223
224 struct USER_INFO_4 {
225         const char * usri4_name;
226         const char * usri4_password;
227         uint32_t usri4_password_age;
228         uint32_t usri4_priv;
229         const char * usri4_home_dir;
230         const char * usri4_comment;
231         uint32_t usri4_flags;
232         const char * usri4_script_path;
233         uint32_t usri4_auth_flags;
234         const char * usri4_full_name;
235         const char * usri4_usr_comment;
236         const char * usri4_parms;
237         const char * usri4_workstations;
238         uint32_t usri4_last_logon;
239         uint32_t usri4_last_logoff;
240         uint32_t usri4_acct_expires;
241         uint32_t usri4_max_storage;
242         uint32_t usri4_units_per_week;
243         uint8_t *usri4_logon_hours;/* [unique] */
244         uint32_t usri4_bad_pw_count;
245         uint32_t usri4_num_logons;
246         const char * usri4_logon_server;
247         uint32_t usri4_country_code;
248         uint32_t usri4_code_page;
249         struct domsid *usri4_user_sid;/* [unique] */
250         uint32_t usri4_primary_group_id;
251         const char * usri4_profile;
252         const char * usri4_home_dir_drive;
253         uint32_t usri4_password_expired;
254 };
255
256 struct USER_INFO_10 {
257         const char * usri10_name;
258         const char * usri10_comment;
259         const char * usri10_usr_comment;
260         const char * usri10_full_name;
261 };
262
263 struct USER_INFO_11 {
264         const char * usri11_name;
265         const char * usri11_comment;
266         const char * usri11_usr_comment;
267         const char * usri11_full_name;
268         uint32_t usri11_priv;
269         uint32_t usri11_auth_flags;
270         uint32_t usri11_password_age;
271         const char * usri11_home_dir;
272         const char * usri11_parms;
273         uint32_t usri11_last_logon;
274         uint32_t usri11_last_logoff;
275         uint32_t usri11_bad_pw_count;
276         uint32_t usri11_num_logons;
277         const char * usri11_logon_server;
278         uint32_t usri11_country_code;
279         const char * usri11_workstations;
280         uint32_t usri11_max_storage;
281         uint32_t usri11_units_per_week;
282         uint8_t *usri11_logon_hours;/* [unique] */
283         uint32_t usri11_code_page;
284 };
285
286 struct USER_INFO_20 {
287         const char * usri20_name;
288         const char * usri20_full_name;
289         const char * usri20_comment;
290         uint32_t usri20_flags;
291         uint32_t usri20_user_id;
292 };
293
294 struct USER_INFO_21 {
295         uint8_t *usri21_password;
296 };
297
298 struct USER_INFO_22 {
299         const char * usri22_name;
300         uint8_t *usri22_password;
301         uint32_t usri22_password_age;
302         uint32_t usri22_priv;
303         const char * usri22_home_dir;
304         const char * usri22_comment;
305         uint32_t usri22_flags;
306         uint32_t usri22_script_path;
307         uint32_t usri22_auth_flags;
308         const char * usri22_full_name;
309         const char * usri22_usr_comment;
310         const char * usri22_parms;
311         const char * usri22_workstations;
312         uint32_t usri22_last_logon;
313         uint32_t usri22_last_logoff;
314         uint32_t usri22_acct_expires;
315         uint32_t usri22_max_storage;
316         uint32_t usri22_units_per_week;
317         uint8_t *usri22_logon_hours;/* [unique] */
318         uint32_t usri22_bad_pw_count;
319         uint32_t usri22_num_logons;
320         const char * usri22_logon_server;
321         uint32_t usri22_country_code;
322         uint32_t usri22_code_page;
323 };
324
325 struct USER_INFO_23 {
326         const char * usri23_name;
327         const char * usri23_full_name;
328         const char * usri23_comment;
329         uint32_t usri23_flags;
330         struct domsid *usri23_user_sid;/* [unique] */
331 };
332
333 struct USER_INFO_1003 {
334         const char * usri1003_password;
335 };
336
337 struct USER_INFO_1005 {
338         uint32_t usri1005_priv;
339 };
340
341 struct USER_INFO_1006 {
342         const char * usri1006_home_dir;
343 };
344
345 struct USER_INFO_1007 {
346         const char * usri1007_comment;
347 };
348
349 struct USER_INFO_1008 {
350         uint32_t usri1008_flags;
351 };
352
353 struct USER_INFO_1009 {
354         const char * usri1009_script_path;
355 };
356
357 struct USER_INFO_1010 {
358         uint32_t usri1010_auth_flags;
359 };
360
361 struct USER_INFO_1011 {
362         const char * usri1011_full_name;
363 };
364
365 struct USER_INFO_1012 {
366         const char * usri1012_usr_comment;
367 };
368
369 struct USER_INFO_1013 {
370         const char * usri1013_parms;
371 };
372
373 struct USER_INFO_1014 {
374         const char * usri1014_workstations;
375 };
376
377 struct USER_INFO_1017 {
378         uint32_t usri1017_acct_expires;
379 };
380
381 struct USER_INFO_1018 {
382         uint32_t usri1018_max_storage;
383 };
384
385 struct USER_INFO_1020 {
386         uint32_t usri1020_units_per_week;
387         uint8_t *usri1020_logon_hours;/* [unique] */
388 };
389
390 struct USER_INFO_1023 {
391         const char * usri1023_logon_server;
392 };
393
394 struct USER_INFO_1024 {
395         uint32_t usri1024_country_code;
396 };
397
398 struct USER_INFO_1025 {
399         uint32_t usri1025_code_page;
400 };
401
402 struct USER_INFO_1051 {
403         uint32_t usri1051_primary_group_id;
404 };
405
406 struct USER_INFO_1052 {
407         const char * usri1052_profile;
408 };
409
410 struct USER_INFO_1053 {
411         const char * usri1053_home_dir_drive;
412 };
413
414 struct USER_MODALS_INFO_0 {
415         uint32_t usrmod0_min_passwd_len;
416         uint32_t usrmod0_max_passwd_age;
417         uint32_t usrmod0_min_passwd_age;
418         uint32_t usrmod0_force_logoff;
419         uint32_t usrmod0_password_hist_len;
420 };
421
422 struct USER_MODALS_INFO_1 {
423         uint32_t usrmod1_role;
424         const char * usrmod1_primary;
425 };
426
427 struct USER_MODALS_INFO_2 {
428         const char * usrmod2_domain_name;
429         struct domsid *usrmod2_domain_id;/* [unique] */
430 };
431
432 struct USER_MODALS_INFO_3 {
433         uint32_t usrmod3_lockout_duration;
434         uint32_t usrmod3_lockout_observation_window;
435         uint32_t usrmod3_lockout_threshold;
436 };
437
438 struct USER_MODALS_INFO_1001 {
439         uint32_t usrmod1001_min_passwd_len;
440 };
441
442 struct USER_MODALS_INFO_1002 {
443         uint32_t usrmod1002_max_passwd_age;
444 };
445
446 struct USER_MODALS_INFO_1003 {
447         uint32_t usrmod1003_min_passwd_age;
448 };
449
450 struct USER_MODALS_INFO_1004 {
451         uint32_t usrmod1004_force_logoff;
452 };
453
454 struct USER_MODALS_INFO_1005 {
455         uint32_t usrmod1005_password_hist_len;
456 };
457
458 struct USER_MODALS_INFO_1006 {
459         uint32_t usrmod1006_role;
460 };
461
462 struct USER_MODALS_INFO_1007 {
463         const char * usrmod1007_primary;
464 };
465
466 struct NET_DISPLAY_USER {
467         const char * usri1_name;
468         const char * usri1_comment;
469         uint32_t usri1_flags;
470         const char * usri1_full_name;
471         uint32_t usri1_user_id;
472         uint32_t usri1_next_index;
473 };
474
475 struct NET_DISPLAY_MACHINE {
476         const char * usri2_name;
477         const char * usri2_comment;
478         uint32_t usri2_flags;
479         uint32_t usri2_user_id;
480         uint32_t usri2_next_index;
481 };
482
483 struct NET_DISPLAY_GROUP {
484         const char * grpi3_name;
485         const char * grpi3_comment;
486         uint32_t grpi3_group_id;
487         uint32_t grpi3_attributes;
488         uint32_t grpi3_next_index;
489 };
490
491 struct GROUP_INFO_0 {
492         const char * grpi0_name;
493 };
494
495 struct GROUP_INFO_1 {
496         const char * grpi1_name;
497         const char * grpi1_comment;
498 };
499
500 struct GROUP_INFO_2 {
501         const char * grpi2_name;
502         const char * grpi2_comment;
503         uint32_t grpi2_group_id;
504         uint32_t grpi2_attributes;
505 };
506
507 struct GROUP_INFO_3 {
508         const char * grpi3_name;
509         const char * grpi3_comment;
510         struct domsid * grpi3_group_sid;
511         uint32_t grpi3_attributes;
512 };
513
514 struct GROUP_INFO_1002 {
515         const char * grpi1002_comment;
516 };
517
518 struct GROUP_INFO_1005 {
519         uint32_t grpi1005_attributes;
520 };
521
522 struct GROUP_USERS_INFO_0 {
523         const char * grui0_name;
524 };
525
526 struct GROUP_USERS_INFO_1 {
527         const char * grui1_name;
528         uint32_t grui1_attributes;
529 };
530
531 struct LOCALGROUP_INFO_0 {
532         const char * lgrpi0_name;
533 };
534
535 struct LOCALGROUP_INFO_1 {
536         const char * lgrpi1_name;
537         const char * lgrpi1_comment;
538 };
539
540 struct LOCALGROUP_INFO_1002 {
541         const char * lgrpi1002_comment;
542 };
543
544 enum SID_NAME_USE {
545         SidTypeUser=1,
546         SidTypeGroup=2,
547         SidTypeDomain=3,
548         SidTypeAlias=4,
549         SidTypeWellKnownGroup=5,
550         SidTypeDeletedAccount=6,
551         SidTypeInvalid=7,
552         SidTypeUnknown=8,
553         SidTypeComputer=9,
554         SidTypeLabel=10
555 };
556
557 struct LOCALGROUP_MEMBERS_INFO_0 {
558         struct domsid *lgrmi0_sid;/* [unique] */
559 };
560
561 struct LOCALGROUP_MEMBERS_INFO_1 {
562         struct domsid *lgrmi1_sid;/* [unique] */
563         enum SID_NAME_USE lgrmi1_sidusage;
564         const char * lgrmi1_name;
565 };
566
567 struct LOCALGROUP_MEMBERS_INFO_2 {
568         struct domsid *lgrmi2_sid;/* [unique] */
569         enum SID_NAME_USE lgrmi2_sidusage;
570         const char * lgrmi2_domainandname;
571 };
572
573 struct LOCALGROUP_MEMBERS_INFO_3 {
574         const char * lgrmi3_domainandname;
575 };
576
577 struct TIME_OF_DAY_INFO {
578         uint32_t tod_elapsedt;
579         uint32_t tod_msecs;
580         uint32_t tod_hours;
581         uint32_t tod_mins;
582         uint32_t tod_secs;
583         uint32_t tod_hunds;
584         int32_t tod_timezone;
585         uint32_t tod_tinterval;
586         uint32_t tod_day;
587         uint32_t tod_month;
588         uint32_t tod_year;
589         uint32_t tod_weekday;
590 };
591
592 struct SHARE_INFO_0 {
593         const char * shi0_netname;
594 };
595
596 struct SHARE_INFO_1 {
597         const char * shi1_netname;
598         uint32_t shi1_type;
599         const char * shi1_remark;
600 };
601
602 struct SHARE_INFO_2 {
603         const char * shi2_netname;
604         uint32_t shi2_type;
605         const char * shi2_remark;
606         uint32_t shi2_permissions;
607         uint32_t shi2_max_uses;
608         uint32_t shi2_current_uses;
609         const char * shi2_path;
610         const char * shi2_passwd;
611 };
612
613 struct SHARE_INFO_501 {
614         const char * shi501_netname;
615         uint32_t shi501_type;
616         const char * shi501_remark;
617         uint32_t shi501_flags;
618 };
619
620 struct SHARE_INFO_1004 {
621         const char * shi1004_remark;
622 };
623
624 struct SHARE_INFO_1005 {
625         uint32_t shi1005_flags;
626 };
627
628 struct SHARE_INFO_1006 {
629         uint32_t shi1006_max_uses;
630 };
631
632 #endif /* _HEADER_libnetapi */
633
634 /****************************************************************
635 ****************************************************************/
636
637 struct libnetapi_ctx {
638         char *debuglevel;
639         char *error_string;
640         char *username;
641         char *workgroup;
642         char *password;
643         char *krb5_cc_env;
644         int use_kerberos;
645         int disable_policy_handle_cache;
646
647         void *private_data;
648 };
649
650 /****************************************************************
651 ****************************************************************/
652
653 NET_API_STATUS libnetapi_init(struct libnetapi_ctx **ctx);
654
655 /****************************************************************
656 ****************************************************************/
657
658 NET_API_STATUS libnetapi_free(struct libnetapi_ctx *ctx);
659
660 /****************************************************************
661 ****************************************************************/
662
663 NET_API_STATUS libnetapi_getctx(struct libnetapi_ctx **ctx);
664
665 /****************************************************************
666 ****************************************************************/
667
668 NET_API_STATUS libnetapi_set_debuglevel(struct libnetapi_ctx *ctx,
669                                         const char *debuglevel);
670
671 /****************************************************************
672 ****************************************************************/
673
674 NET_API_STATUS libnetapi_set_username(struct libnetapi_ctx *ctx,
675                                       const char *username);
676
677 /****************************************************************
678 ****************************************************************/
679
680 NET_API_STATUS libnetapi_set_password(struct libnetapi_ctx *ctx,
681                                       const char *password);
682
683 /****************************************************************
684 ****************************************************************/
685
686 NET_API_STATUS libnetapi_set_workgroup(struct libnetapi_ctx *ctx,
687                                        const char *workgroup);
688
689 /****************************************************************
690 ****************************************************************/
691
692 NET_API_STATUS libnetapi_set_use_kerberos(struct libnetapi_ctx *ctx);
693
694 /****************************************************************
695 ****************************************************************/
696
697 const char *libnetapi_errstr(NET_API_STATUS status);
698
699 /****************************************************************
700 ****************************************************************/
701
702 const char *libnetapi_get_error_string(struct libnetapi_ctx *ctx,
703                                        NET_API_STATUS status);
704
705 /****************************************************************
706  NetApiBufferAllocate
707 ****************************************************************/
708
709 NET_API_STATUS NetApiBufferAllocate(uint32_t byte_count,
710                                     void **buffer);
711
712 /****************************************************************
713  NetApiBufferFree
714 ****************************************************************/
715
716 NET_API_STATUS NetApiBufferFree(void *buffer);
717
718 /************************************************************//**
719  *
720  * ConvertSidToStringSid
721  *
722  * @brief Convert a domain sid into a string
723  *
724  * @param[in] sid A pointer to a sid structure
725  * @param[in,out] sid_string A pointer that holds a pointer to a sid string. Caller
726  * needs to free with free(3)
727  * @return bool
728  ***************************************************************/
729
730 int  ConvertSidToStringSid(const struct domsid *sid,
731                            char **sid_string);
732
733 /************************************************************//**
734  *
735  * ConvertStringSidToSid
736  *
737  * @brief Convert a string into a domain sid
738  *
739  * @param[in] sid_string A pointer to a sid string.
740  * @param[in,out] sid A pointer that holds a pointer to a sid structure.
741  * Caller needs to free with free(3)
742  * @return bool
743  ***************************************************************/
744
745 int ConvertStringSidToSid(const char *sid_string,
746                           struct domsid **sid);
747
748 /************************************************************//**
749  *
750  * NetJoinDomain
751  *
752  * @brief Join a computer to a domain or workgroup
753  *
754  * @param[in] server The server name to connect to
755  * @param[in] domain The domain or workgroup to join
756  * @param[in] account_ou The organizational Unit to create the computer account
757  * in (AD only)
758  * @param[in] account The domain account used for joining a domain
759  * @param[in] password The domain account's password used for joining a domain
760  * @param[in] join_flags Bitmask field to define specific join features
761  * @return NET_API_STATUS
762  *
763  * example netdomjoin/netdomjoin.c
764  ***************************************************************/
765
766 NET_API_STATUS NetJoinDomain(const char * server /* [in] */,
767                              const char * domain /* [in] [ref] */,
768                              const char * account_ou /* [in] */,
769                              const char * account /* [in] */,
770                              const char * password /* [in] */,
771                              uint32_t join_flags /* [in] */);
772
773 /************************************************************//**
774  *
775  * NetUnjoinDomain
776  *
777  * @brief Unjoin a computer from a domain or workgroup
778  *
779  * @param[in] server_name The server name to connect to
780  * @param[in] account The domain account used for unjoining a domain
781  * @param[in] password The domain account's password used for unjoining a domain
782  * @param[in] unjoin_flags Bitmask field to define specific unjoin features
783  * @return NET_API_STATUS
784  *
785  ***************************************************************/
786
787 NET_API_STATUS NetUnjoinDomain(const char * server_name /* [in] */,
788                                const char * account /* [in] */,
789                                const char * password /* [in] */,
790                                uint32_t unjoin_flags /* [in] */);
791
792 /************************************************************//**
793  *
794  * NetGetJoinInformation
795  *
796  * @brief Unjoin a computer from a domain or workgroup
797  *
798  * @param[in] server_name The server name to connect to
799  * @param[out] name_buffer Returns the name of the workgroup or domain
800  * @param[out] name_type  Returns the type of that name
801  * @return NET_API_STATUS
802  *
803  * example netdomjoin-gui/netdomjoin-gui.c
804  *
805  ***************************************************************/
806
807 NET_API_STATUS NetGetJoinInformation(const char * server_name /* [in] */,
808                                      const char * *name_buffer /* [out] [ref] */,
809                                      uint16_t *name_type /* [out] [ref] */);
810
811 /************************************************************//**
812  *
813  * NetGetJoinableOUs
814  *
815  * @brief Query for the list of joinable organizational Units that can be used
816  * for joining AD
817  *
818  * @param[in] server_name The server name to connect to
819  * @param[in] domain The AD domain to query
820  * @param[in] account The domain account used for the query
821  * @param[in] password The domain account's password used for the query
822  * @param[out] ou_count The number of ous returned
823  * @param[out] ous Returned string array containing the ous
824  * @return NET_API_STATUS
825  *
826  * example netdomjoin-gui/netdomjoin-gui.c
827  *
828  ***************************************************************/
829
830 NET_API_STATUS NetGetJoinableOUs(const char * server_name /* [in] */,
831                                  const char * domain /* [in] [ref] */,
832                                  const char * account /* [in] */,
833                                  const char * password /* [in] */,
834                                  uint32_t *ou_count /* [out] [ref] */,
835                                  const char * **ous /* [out] [ref] */);
836
837 /************************************************************//**
838  *
839  * NetRenameMachineInDomain
840  *
841  * @brief Rename a machine in a domain
842  *
843  * @param[in] server_name The server name to connect to
844  * @param[in] new_machine_name The new machine name
845  * @param[in] account The domain account used for the query
846  * @param[in] password The domain account's password used for the query
847  * @param[in] rename_options Options used for the rename operation
848  * @return NET_API_STATUS
849  *
850  * example join/rename_machine.c
851  *
852  ***************************************************************/
853
854 NET_API_STATUS NetRenameMachineInDomain(const char * server_name /* [in] */,
855                                         const char * new_machine_name /* [in] */,
856                                         const char * account /* [in] */,
857                                         const char * password /* [in] */,
858                                         uint32_t rename_options /* [in] */);
859
860 /************************************************************//**
861  *
862  * NetServerGetInfo
863  *
864  * @brief Get Information on a server
865  *
866  * @param[in] server_name The server name to connect to
867  * @param[in] level The level to define which information is requested
868  * @param[out] buffer The returned buffer carrying the SERVER_INFO structure
869  * @return NET_API_STATUS
870  *
871  ***************************************************************/
872
873 NET_API_STATUS NetServerGetInfo(const char * server_name /* [in] */,
874                                 uint32_t level /* [in] */,
875                                 uint8_t **buffer /* [out] [ref] */);
876
877 /************************************************************//**
878  *
879  * NetServerSetInfo
880  *
881  * @brief Get Information on a server
882  *
883  * @param[in] server_name The server name to connect to
884  * @param[in] level The level to define which information is set
885  * @param[in] buffer The buffer carrying the SERVER_INFO structure
886  * @param[out] parm_error On failure returns the invalid SERVER_INFO member
887  * @return NET_API_STATUS
888  *
889  ***************************************************************/
890
891 NET_API_STATUS NetServerSetInfo(const char * server_name /* [in] */,
892                                 uint32_t level /* [in] */,
893                                 uint8_t *buffer /* [in] [ref] */,
894                                 uint32_t *parm_error /* [out] [ref] */);
895
896 /************************************************************//**
897  *
898  * NetGetDCName
899  *
900  * @brief Query for the PDC for a given domain
901  *
902  * @param[in] server_name The server name to connect to
903  * @param[in] domain_name The name of the domain to lookup
904  * @param[out] buffer The name of the domain to lookup
905  * @return NET_API_STATUS
906  *
907  * example getdc/getdc.c
908  ***************************************************************/
909
910 NET_API_STATUS NetGetDCName(const char * server_name /* [in] */,
911                             const char * domain_name /* [in] */,
912                             uint8_t **buffer /* [out] [ref] */);
913
914 /************************************************************//**
915  *
916  * NetGetAnyDCName
917  *
918  * @brief Query for any DC for a given domain
919  *
920  * @param[in] server_name The server name to connect to
921  * @param[in] domain_name The name of the domain to lookup
922  * @param[out] buffer The name of the domain to lookup
923  * @return NET_API_STATUS
924  *
925  * example getdc/getdc.c
926  ***************************************************************/
927
928 NET_API_STATUS NetGetAnyDCName(const char * server_name /* [in] */,
929                                const char * domain_name /* [in] */,
930                                uint8_t **buffer /* [out] [ref] */);
931
932
933 /************************************************************//**
934  *
935  * DsGetDcName
936  *
937  * @brief Lookup a DC for a given domain and return information structure
938  *
939  * @param[in] server_name The server name to connect to
940  * @param[in] domain_name The name of the domain to lookup (cannot be NULL)
941  * @param[in] domain_guid The GUID of the domain to lookup (optional)
942  * @param[in] site_name The name of the site the DC should reside in
943  * @param[in] flags A bitmask to request specific features supported by the DC
944  * @param[out] dc_info Pointer to a DOMAIN_CONTROLLER_INFO structure
945  * @return NET_API_STATUS
946  *
947  * example dsgetdc/dsgetdc.c
948  ***************************************************************/
949
950 NET_API_STATUS DsGetDcName(const char * server_name /* [in] [unique] */,
951                            const char * domain_name /* [in] [ref] */,
952                            struct GUID *domain_guid /* [in] [unique] */,
953                            const char * site_name /* [in] [unique] */,
954                            uint32_t flags /* [in] */,
955                            struct DOMAIN_CONTROLLER_INFO **dc_info /* [out] [ref] */);
956
957 /************************************************************//**
958  *
959  * NetUserAdd
960  *
961  * @brief Create a user on a given server
962  *
963  * @param[in] server_name The server name to connect to
964  * @param[in] level The level of the USER_INFO structure passed in (Currently
965  * only level 1 is supported)
966  * @param[in] buffer The buffer carrying the USER_INFO structure
967  * @param[out] parm_error In case of error returns the failing member of the
968  * structure
969  * @return NET_API_STATUS
970  *
971  * example user/user_add.c
972  ***************************************************************/
973
974 NET_API_STATUS NetUserAdd(const char * server_name /* [in] */,
975                           uint32_t level /* [in] */,
976                           uint8_t *buffer /* [in] [ref] */,
977                           uint32_t *parm_error /* [out] [ref] */);
978
979 /************************************************************//**
980  *
981  * NetUserDel
982  *
983  * @brief Delete a user on a given server
984  *
985  * @param[in] server_name The server name to connect to
986  * @param[in] user_name The user account to delete
987  * @return NET_API_STATUS
988  *
989  * example user/user_del.c
990  ***************************************************************/
991
992 NET_API_STATUS NetUserDel(const char * server_name /* [in] */,
993                           const char * user_name /* [in] */);
994
995 /************************************************************//**
996  *
997  * NetUserEnum
998  *
999  * @brief Enumerate accounts on a server
1000  *
1001  * @param[in] server_name The server name to connect to
1002  * @param[in] level The enumeration level used for the query (Currently only
1003  * level 0 is supported)
1004  * @param[in] filter The account flags filter used for the query
1005  * @param[out] buffer The returned enumeration buffer
1006  * @param[in] prefmaxlen The requested maximal buffer size
1007  * @param[out] entries_read The number of returned entries
1008  * @param[out] total_entries The number of total entries
1009  * @param[in,out] resume_handle A handle passed in and returned for resuming
1010  * operations
1011  * @return NET_API_STATUS
1012  *
1013  * example user/user_enum.c
1014  ***************************************************************/
1015
1016 NET_API_STATUS NetUserEnum(const char * server_name /* [in] */,
1017                            uint32_t level /* [in] */,
1018                            uint32_t filter /* [in] */,
1019                            uint8_t **buffer /* [out] [ref] */,
1020                            uint32_t prefmaxlen /* [in] */,
1021                            uint32_t *entries_read /* [out] [ref] */,
1022                            uint32_t *total_entries /* [out] [ref] */,
1023                            uint32_t *resume_handle /* [in,out] [ref] */);
1024
1025 /************************************************************//**
1026  *
1027  * NetUserChangePassword
1028  *
1029  * @brief Change the password for a user on a given server or in a given domain
1030  *
1031  * @param[in] domain_name The server or domain name to connect to
1032  * @param[in] user_name The user account to change the password for
1033  * @param[in] old_password The user account's old password
1034  * @param[in] new_password The user account's new password
1035  * @return NET_API_STATUS
1036  *
1037  * example user/user_chgpwd.c
1038  ***************************************************************/
1039
1040 NET_API_STATUS NetUserChangePassword(const char * domain_name /* [in] */,
1041                                      const char * user_name /* [in] */,
1042                                      const char * old_password /* [in] */,
1043                                      const char * new_password /* [in] */);
1044
1045 /************************************************************//**
1046  *
1047  * NetUserGetInfo
1048  *
1049  * @brief Get User Information
1050  *
1051  * @param[in] server_name The server name to connect to
1052  * @param[in] user_name The name of the user that is going to be queried
1053  * @param[in] level The level defining the requested USER_INFO_X structure
1054  * @param[out] buffer The buffer containing a USER_INFO_X structure
1055  * @return NET_API_STATUS
1056  *
1057  * example user/user_getinfo.c
1058  ***************************************************************/
1059
1060 NET_API_STATUS NetUserGetInfo(const char * server_name /* [in] */,
1061                               const char * user_name /* [in] */,
1062                               uint32_t level /* [in] */,
1063                               uint8_t **buffer /* [out] [ref] */);
1064
1065 /************************************************************//**
1066  *
1067  * NetUserSetInfo
1068  *
1069  * @brief Set User Information
1070  *
1071  * @param[in] server_name The server name to connect to
1072  * @param[in] user_name The name of the user that is going to be modified
1073  * @param[in] level The level defining the requested USER_INFO_X structure
1074  * @param[in] buffer The buffer containing a USER_INFO_X structure
1075  * @param[out] parm_err The returned parameter error number if any
1076  * @return NET_API_STATUS
1077  *
1078  * example user/user_setinfo.c
1079  ***************************************************************/
1080
1081 NET_API_STATUS NetUserSetInfo(const char * server_name /* [in] */,
1082                               const char * user_name /* [in] */,
1083                               uint32_t level /* [in] */,
1084                               uint8_t *buffer /* [in] [ref] */,
1085                               uint32_t *parm_err /* [out] [ref] */);
1086
1087 /************************************************************//**
1088  *
1089  * NetUserModalsGet
1090  *
1091  * @brief Get SAM domain and password information
1092  *
1093  * @param[in] server_name The server name to connect to
1094  * @param[in] level The level defining which USER_MODALS_INFO_X buffer to query
1095  * @param[out] buffer The returned USER_MODALS_INFO_X buffer
1096  * @return NET_API_STATUS
1097  *
1098  * example user/user_modalsget.c
1099  ***************************************************************/
1100
1101 NET_API_STATUS NetUserModalsGet(const char * server_name /* [in] */,
1102                                 uint32_t level /* [in] */,
1103                                 uint8_t **buffer /* [out] [ref] */);
1104
1105 /************************************************************//**
1106  *
1107  * NetUserModalsSet
1108  *
1109  * @brief Set SAM domain and password information
1110  *
1111  * @param[in] server_name The server name to connect to
1112  * @param[in] level The level defining which USER_MODALS_INFO_X buffer to query
1113  * @param[out] buffer The buffer conntaing a USER_MODALS_INFO_X structure
1114  * @param[out] parm_err The returned parameter error number if any
1115  * @return NET_API_STATUS
1116  *
1117  * example user/user_modalsset.c
1118  ***************************************************************/
1119
1120 NET_API_STATUS NetUserModalsSet(const char * server_name /* [in] */,
1121                                 uint32_t level /* [in] */,
1122                                 uint8_t *buffer /* [in] [ref] */,
1123                                 uint32_t *parm_err /* [out] [ref] */);
1124
1125 /************************************************************//**
1126  *
1127  * NetUserGetGroups
1128  *
1129  * @brief Enumerate grouplist of a user on a server
1130  *
1131  * @param[in] server_name The server name to connect to
1132  * @param[in] user_name The user name to query
1133  * @param[in] level The enumeration level used for the query (Currently only
1134  * level 0 is supported)
1135  * @param[out] buffer The returned enumeration buffer
1136  * @param[in] prefmaxlen The requested maximal buffer size
1137  * @param[out] entries_read The number of returned entries
1138  * @param[out] total_entries The number of total entries
1139  * @return NET_API_STATUS
1140  *
1141  * example user/user_getgroups.c
1142  ***************************************************************/
1143
1144 NET_API_STATUS NetUserGetGroups(const char * server_name /* [in] */,
1145                                 const char * user_name /* [in] */,
1146                                 uint32_t level /* [in] */,
1147                                 uint8_t **buffer /* [out] [ref] */,
1148                                 uint32_t prefmaxlen /* [in] */,
1149                                 uint32_t *entries_read /* [out] [ref] */,
1150                                 uint32_t *total_entries /* [out] [ref] */);
1151
1152 /************************************************************//**
1153  *
1154  * NetQueryDisplayInformation
1155  *
1156  * @brief Enumerate accounts on a server
1157  *
1158  * @param[in] server_name The server name to connect to
1159  * @param[in] level The enumeration level used for the query
1160  * @param[in] idx The index to start the the display enumeration at
1161  * @param[in] entries_requested The number of entries requested
1162  * @param[in] prefmaxlen The requested maximal buffer size
1163  * @param[out] entries_read The number of returned entries
1164  * @param[out] buffer The returned display information buffer
1165  * @return NET_API_STATUS
1166  *
1167  * example user/user_dispinfo.c
1168  ***************************************************************/
1169
1170 NET_API_STATUS NetQueryDisplayInformation(const char * server_name /* [in] [unique] */,
1171                                           uint32_t level /* [in] */,
1172                                           uint32_t idx /* [in] */,
1173                                           uint32_t entries_requested /* [in] */,
1174                                           uint32_t prefmaxlen /* [in] */,
1175                                           uint32_t *entries_read /* [out] [ref] */,
1176                                           void **buffer /* [out] [noprint,ref] */);
1177
1178 /************************************************************//**
1179  *
1180  * NetGroupAdd
1181  *
1182  * @brief Create Domain Group
1183  *
1184  * @param[in] server_name The server name to connect to
1185  * @param[in] level The level used for the new group creation
1186  * @param[in] buf The buffer containing the group structure
1187  * @param[out] parm_err The returned parameter error number if any
1188  * @return NET_API_STATUS
1189  *
1190  * example group/group_add.c
1191  ***************************************************************/
1192
1193 NET_API_STATUS NetGroupAdd(const char * server_name /* [in] */,
1194                            uint32_t level /* [in] */,
1195                            uint8_t *buf /* [in] [ref] */,
1196                            uint32_t *parm_err /* [out] [ref] */);
1197
1198 /************************************************************//**
1199  *
1200  * NetGroupDel
1201  *
1202  * @brief Delete Domain Group
1203  *
1204  * @param[in] server_name The server name to connect to
1205  * @param[in] group_name The name of the group that is going to be deleted
1206  * @return NET_API_STATUS
1207  *
1208  * example group/group_del.c
1209  ***************************************************************/
1210
1211 NET_API_STATUS NetGroupDel(const char * server_name /* [in] */,
1212                            const char * group_name /* [in] */);
1213
1214 /************************************************************//**
1215  *
1216  * NetGroupEnum
1217  *
1218  * @brief Enumerate groups on a server
1219  *
1220  * @param[in] server_name The server name to connect to
1221  * @param[in] level The enumeration level used for the query (Currently only
1222  * level 0 is supported)
1223  * @param[out] buffer The returned enumeration buffer
1224  * @param[in] prefmaxlen The requested maximal buffer size
1225  * @param[out] entries_read The number of returned entries
1226  * @param[out] total_entries The number of total entries
1227  * @param[in,out] resume_handle A handle passed in and returned for resuming
1228  * operations
1229  * @return NET_API_STATUS
1230  *
1231  * example group/group_enum.c
1232  ***************************************************************/
1233
1234 NET_API_STATUS NetGroupEnum(const char * server_name /* [in] */,
1235                             uint32_t level /* [in] */,
1236                             uint8_t **buffer /* [out] [ref] */,
1237                             uint32_t prefmaxlen /* [in] */,
1238                             uint32_t *entries_read /* [out] [ref] */,
1239                             uint32_t *total_entries /* [out] [ref] */,
1240                             uint32_t *resume_handle /* [in,out] [ref] */);
1241
1242 /************************************************************//**
1243  *
1244  * NetGroupSetInfo
1245  *
1246  * @brief Set Domain Group Information
1247  *
1248  * @param[in] server_name The server name to connect to
1249  * @param[in] group_name The name of the group that is going to be modified
1250  * @param[in] level The level defining the structure type in buf
1251  * @param[in] buf The buffer containing a GROUP_INFO_X structure
1252  * @param[out] parm_err The returned parameter error number if any
1253  * @return NET_API_STATUS
1254  *
1255  * example group/group_setinfo.c
1256  ***************************************************************/
1257
1258 NET_API_STATUS NetGroupSetInfo(const char * server_name /* [in] */,
1259                                const char * group_name /* [in] */,
1260                                uint32_t level /* [in] */,
1261                                uint8_t *buf /* [in] [ref] */,
1262                                uint32_t *parm_err /* [out] [ref] */);
1263
1264 /************************************************************//**
1265  *
1266  * NetGroupGetInfo
1267  *
1268  * @brief Get Domain Group Information
1269  *
1270  * @param[in] server_name The server name to connect to
1271  * @param[in] group_name The name of the group that is going to be queried
1272  * @param[in] level The level defining the requested GROUP_INFO_X structure
1273  * @param[out] buf The buffer containing a GROUP_INFO_X structure
1274  * @return NET_API_STATUS
1275  *
1276  * example group/group_getinfo.c
1277  ***************************************************************/
1278
1279 NET_API_STATUS NetGroupGetInfo(const char * server_name /* [in] */,
1280                                const char * group_name /* [in] */,
1281                                uint32_t level /* [in] */,
1282                                uint8_t **buf /* [out] [ref] */);
1283
1284 /************************************************************//**
1285  *
1286  * NetGroupAddUser
1287  *
1288  * @brief Add existing User to existing Domain Group
1289  *
1290  * @param[in] server_name The server name to connect to
1291  * @param[in] group_name The name of the group that is going to be modified
1292  * @param[in] user_name The name of the user that is going to be added to the
1293  * group
1294  * @return NET_API_STATUS
1295  *
1296  * example group/group_adduser.c
1297  ***************************************************************/
1298
1299 NET_API_STATUS NetGroupAddUser(const char * server_name /* [in] */,
1300                                const char * group_name /* [in] */,
1301                                const char * user_name /* [in] */);
1302
1303 /************************************************************//**
1304  *
1305  * NetGroupDelUser
1306  *
1307  * @brief Remove User from Domain Group
1308  *
1309  * @param[in] server_name The server name to connect to
1310  * @param[in] group_name The name of the group that is going to be modified
1311  * @param[in] user_name The name of the user that is going to be removed from
1312  * the group
1313  * @return NET_API_STATUS
1314  *
1315  * example group/group_deluser.c
1316  ***************************************************************/
1317
1318 NET_API_STATUS NetGroupDelUser(const char * server_name /* [in] */,
1319                                const char * group_name /* [in] */,
1320                                const char * user_name /* [in] */);
1321
1322 /************************************************************//**
1323  *
1324  * NetGroupGetUsers
1325  *
1326  * @brief Get Users for a group on a server
1327  *
1328  * @param[in] server_name The server name to connect to
1329  * @param[in] group_name The group name to enumerate users for
1330  * @param[in] level The enumeration level used for the query
1331  * @param[out] buffer The returned enumeration buffer
1332  * @param[in] prefmaxlen The requested maximal buffer size
1333  * @param[out] entries_read The number of returned entries
1334  * @param[out] total_entries The number of total entries
1335  * @param[in,out] resume_handle A handle passed in and returned for resuming
1336  * operations
1337  * @return NET_API_STATUS
1338  *
1339  * example group/group_getusers.c
1340  ***************************************************************/
1341
1342 NET_API_STATUS NetGroupGetUsers(const char * server_name /* [in] */,
1343                                 const char * group_name /* [in] */,
1344                                 uint32_t level /* [in] */,
1345                                 uint8_t **buffer /* [out] [ref] */,
1346                                 uint32_t prefmaxlen /* [in] */,
1347                                 uint32_t *entries_read /* [out] [ref] */,
1348                                 uint32_t *total_entries /* [out] [ref] */,
1349                                 uint32_t *resume_handle /* [in,out] [ref] */);
1350
1351 /************************************************************//**
1352  *
1353  * NetLocalGroupAdd
1354  *
1355  * @brief Create Local Group
1356  *
1357  * @param[in] server_name The server name to connect to
1358  * @param[in] level The level used for the new group creation
1359  * @param[in] buf The buffer containing the group structure
1360  * @param[out] parm_err The returned parameter error number if any
1361  * @return NET_API_STATUS
1362  *
1363  * example localgroup/localgroup_add.c
1364  ***************************************************************/
1365
1366 NET_API_STATUS NetLocalGroupAdd(const char * server_name /* [in] */,
1367                                 uint32_t level /* [in] */,
1368                                 uint8_t *buf /* [in] [ref] */,
1369                                 uint32_t *parm_err /* [out] [ref] */);
1370
1371 /************************************************************//**
1372  *
1373  * NetLocalGroupDel
1374  *
1375  * @brief Delete Local Group
1376  *
1377  * @param[in] server_name The server name to connect to
1378  * @param[in] group_name The name of the group that is going to be deleted
1379  * @return NET_API_STATUS
1380  *
1381  * example localgroup/localgroup_del.c
1382  ***************************************************************/
1383
1384
1385 NET_API_STATUS NetLocalGroupDel(const char * server_name /* [in] */,
1386                                 const char * group_name /* [in] */);
1387
1388 /************************************************************//**
1389  *
1390  * NetLocalGroupGetInfo
1391  *
1392  * @brief Get Local Group Information
1393  *
1394  * @param[in] server_name The server name to connect to
1395  * @param[in] group_name The name of the group that is going to be queried
1396  * @param[in] level The level defining the requested LOCALGROUP_INFO_X structure
1397  * @param[out] buf The buffer containing a LOCALGROUP_INFO_X structure
1398  * @return NET_API_STATUS
1399  *
1400  * example localgroup/localgroup_getinfo.c
1401  ***************************************************************/
1402
1403 NET_API_STATUS NetLocalGroupGetInfo(const char * server_name /* [in] */,
1404                                     const char * group_name /* [in] */,
1405                                     uint32_t level /* [in] */,
1406                                     uint8_t **buf /* [out] [ref] */);
1407
1408 /************************************************************//**
1409  *
1410  * NetLocalGroupSetInfo
1411  *
1412  * @brief Set Local Group Information
1413  *
1414  * @param[in] server_name The server name to connect to
1415  * @param[in] group_name The name of the group that is going to be modified
1416  * @param[in] level The level defining the requested LOCALGROUP_INFO_X structure
1417  * @param[in] buf The buffer containing a LOCALGROUP_INFO_X structure
1418  * @param[out] parm_err The returned parameter error number if any
1419  * @return NET_API_STATUS
1420  *
1421  * example localgroup/localgroup_setinfo.c
1422  ***************************************************************/
1423
1424
1425 NET_API_STATUS NetLocalGroupSetInfo(const char * server_name /* [in] */,
1426                                     const char * group_name /* [in] */,
1427                                     uint32_t level /* [in] */,
1428                                     uint8_t *buf /* [in] [ref] */,
1429                                     uint32_t *parm_err /* [out] [ref] */);
1430
1431 /************************************************************//**
1432  *
1433  * NetLocalGroupEnum
1434  *
1435  * @brief Enumerate local groups on a server
1436  *
1437  * @param[in] server_name The server name to connect to
1438  * @param[in] level The enumeration level used for the query (Currently only
1439  * level 0 is supported)
1440  * @param[out] buffer The returned enumeration buffer
1441  * @param[in] prefmaxlen The requested maximal buffer size
1442  * @param[out] entries_read The number of returned entries
1443  * @param[out] total_entries The number of total entries
1444  * @param[in,out] resume_handle A handle passed in and returned for resuming
1445  * operations
1446  * @return NET_API_STATUS
1447  *
1448  * example localgroup/localgroup_enum.c
1449  ***************************************************************/
1450
1451 NET_API_STATUS NetLocalGroupEnum(const char * server_name /* [in] */,
1452                                  uint32_t level /* [in] */,
1453                                  uint8_t **buffer /* [out] [ref] */,
1454                                  uint32_t prefmaxlen /* [in] */,
1455                                  uint32_t *entries_read /* [out] [ref] */,
1456                                  uint32_t *total_entries /* [out] [ref] */,
1457                                  uint32_t *resume_handle /* [in,out] [ref] */);
1458
1459 /************************************************************//**
1460  *
1461  * NetLocalGroupAddMembers
1462  *
1463  * @brief Add Members to a Local Group
1464  *
1465  * @param[in] server_name The server name to connect to
1466  * @param[in] group_name The name of the group that is going to modified
1467  * @param[in] level The level defining the LOCALGROUP_MEMBERS_INFO_X structure
1468  * @param[in] buffer The buffer containing a LOCALGROUP_MEMBERS_INFO_X structure
1469  * @param[in] total_entries The number of LOCALGROUP_MEMBERS_INFO_X entries in
1470  * the buffer
1471  * @return NET_API_STATUS
1472  *
1473  * example localgroup/localgroup_addmembers.c
1474  ***************************************************************/
1475
1476 NET_API_STATUS NetLocalGroupAddMembers(const char * server_name /* [in] */,
1477                                        const char * group_name /* [in] */,
1478                                        uint32_t level /* [in] */,
1479                                        uint8_t *buffer /* [in] [ref] */,
1480                                        uint32_t total_entries /* [in] */);
1481
1482 /************************************************************//**
1483  *
1484  * NetLocalGroupDelMembers
1485  *
1486  * @brief Delete Members from a Local Group
1487  *
1488  * @param[in] server_name The server name to connect to
1489  * @param[in] group_name The name of the group that is going to modified
1490  * @param[in] level The level defining the LOCALGROUP_MEMBERS_INFO_X structure
1491  * @param[in] buffer The buffer containing a LOCALGROUP_MEMBERS_INFO_X structure
1492  * @param[in] total_entries The number of LOCALGROUP_MEMBERS_INFO_X entries in
1493  * the buffer
1494  * @return NET_API_STATUS
1495  *
1496  * example localgroup/localgroup_delmembers.c
1497  ***************************************************************/
1498
1499 NET_API_STATUS NetLocalGroupDelMembers(const char * server_name /* [in] */,
1500                                        const char * group_name /* [in] */,
1501                                        uint32_t level /* [in] */,
1502                                        uint8_t *buffer /* [in] [ref] */,
1503                                        uint32_t total_entries /* [in] */);
1504
1505 /************************************************************//**
1506  *
1507  * NetLocalGroupGetMembers
1508  *
1509  * @brief Enumerate Members in a local group
1510  *
1511  * @param[in] server_name The server name to connect to
1512  * @param[in] local_group_name The localgroup that is going to be queried
1513  * @param[in] level The level defining the LOCALGROUP_MEMBERS_INFO_X structure
1514  * @param[out] buffer The buffer containing a LOCALGROUP_MEMBERS_INFO_X
1515  * structure
1516  * @param[in] prefmaxlen The requested maximal buffer size
1517  * @param[out] entries_read The number of LOCALGROUP_MEMBERS_INFO_X entries in the buffer
1518  * @param[out] total_entries The total number of LOCALGROUP_MEMBERS_INFO_X entries for that group
1519  * @param[in,out] resume_handle A handle passed in and returned for resuming
1520  * operations
1521  * @return NET_API_STATUS
1522  *
1523  * example localgroup/localgroup_getmembers.c
1524  ***************************************************************/
1525
1526 NET_API_STATUS NetLocalGroupGetMembers(const char * server_name /* [in] */,
1527                                        const char * local_group_name /* [in] */,
1528                                        uint32_t level /* [in] */,
1529                                        uint8_t **buffer /* [out] [ref] */,
1530                                        uint32_t prefmaxlen /* [in] */,
1531                                        uint32_t *entries_read /* [out] [ref] */,
1532                                        uint32_t *total_entries /* [out] [ref] */,
1533                                        uint32_t *resume_handle /* [in,out] [ref] */);
1534
1535 /************************************************************//**
1536  *
1537  * NetLocalGroupSetMembers
1538  *
1539  * @brief Set Members in a Local Group
1540  *
1541  * @param[in] server_name The server name to connect to
1542  * @param[in] group_name The name of the group that is going to modified
1543  * @param[in] level The level defining the LOCALGROUP_MEMBERS_INFO_X structure
1544  * @param[in] buffer The buffer containing a LOCALGROUP_MEMBERS_INFO_X structure
1545  * @param[in] total_entries The number of LOCALGROUP_MEMBERS_INFO_X entries in
1546  * the buffer
1547  * @return NET_API_STATUS
1548  *
1549  * example localgroup/localgroup_setmembers.c
1550  ***************************************************************/
1551
1552 NET_API_STATUS NetLocalGroupSetMembers(const char * server_name /* [in] */,
1553                                        const char * group_name /* [in] */,
1554                                        uint32_t level /* [in] */,
1555                                        uint8_t *buffer /* [in] [ref] */,
1556                                        uint32_t total_entries /* [in] */);
1557
1558 /************************************************************//**
1559  *
1560  * NetRemoteTOD
1561  *
1562  * @brief Query remote Time of Day
1563  *
1564  * @param[in] server_name The server name to connect to
1565  * @param[out] buf The buffer containing a TIME_OF_DAY_INFO structure
1566  * @return NET_API_STATUS
1567  *
1568  * example server/remote_tod.c
1569  ***************************************************************/
1570
1571 NET_API_STATUS NetRemoteTOD(const char * server_name /* [in] */,
1572                             uint8_t **buf /* [out] [ref] */);
1573
1574 /************************************************************//**
1575  *
1576  * NetShareAdd
1577  *
1578  * @brief Add Share
1579  *
1580  * @param[in] server_name The server name to connect to
1581  * @param[in] level The level defining the requested SHARE_INFO_X structure
1582  * @param[in] buf The buffer containing a SHARE_INFO_X structure
1583  * @param[out] parm_err The returned parameter error number if any
1584  * @return NET_API_STATUS
1585  *
1586  * example share/share_add.c
1587  ***************************************************************/
1588
1589 NET_API_STATUS NetShareAdd(const char * server_name /* [in] */,
1590                            uint32_t level /* [in] */,
1591                            uint8_t *buffer /* [in] [ref] */,
1592                            uint32_t *parm_err /* [out] [ref] */);
1593
1594 /************************************************************//**
1595  *
1596  * NetShareDel
1597  *
1598  * @brief Delete Share
1599  *
1600  * @param[in] server_name The server name to connect to
1601  * @param[in] net_name The name of the share to delete
1602  * @param[in] reserved
1603  * @return NET_API_STATUS
1604  *
1605  * example share/share_del.c
1606  ***************************************************************/
1607
1608 NET_API_STATUS NetShareDel(const char * server_name /* [in] */,
1609                            const char * net_name /* [in] */,
1610                            uint32_t reserved /* [in] */);
1611
1612 /************************************************************//**
1613  *
1614  * NetShareEnum
1615  *
1616  * @brief Enumerate Shares
1617  *
1618  * @param[in] server_name The server name to connect to
1619  * @param[in] level The level defining the SHARE_INFO_X structure
1620  * @param[out] buffer The buffer containing a SHARE_INFO_X structure
1621  * @param[in] prefmaxlen The requested maximal buffer size
1622  * @param[out] entries_read The number of SHARE_INFO_X entries in the buffer
1623  * @param[out] total_entries The total number of SHARE_INFO_X entries
1624  * @param[in,out] resume_handle A handle passed in and returned for resuming
1625  * operations
1626  * @return NET_API_STATUS
1627  *
1628  * example share/share_enum.c
1629  ***************************************************************/
1630
1631 NET_API_STATUS NetShareEnum(const char * server_name /* [in] */,
1632                             uint32_t level /* [in] */,
1633                             uint8_t **buffer /* [out] [ref] */,
1634                             uint32_t prefmaxlen /* [in] */,
1635                             uint32_t *entries_read /* [out] [ref] */,
1636                             uint32_t *total_entries /* [out] [ref] */,
1637                             uint32_t *resume_handle /* [in,out] [ref] */);
1638
1639 /************************************************************//**
1640  *
1641  * NetShareGetInfo
1642  *
1643  * @brief Get Share Info
1644  *
1645  * @param[in] server_name The server name to connect to
1646  * @param[in] net_name The name of the share to query
1647  * @param[in] level The level defining the SHARE_INFO_X structure
1648  * @param[out] buffer The buffer containing a SHARE_INFO_X structure
1649  * @return NET_API_STATUS
1650  *
1651  * example share/share_getinfo.c
1652  ***************************************************************/
1653
1654 NET_API_STATUS NetShareGetInfo(const char * server_name /* [in] */,
1655                                const char * net_name /* [in] */,
1656                                uint32_t level /* [in] */,
1657                                uint8_t **buffer /* [out] [ref] */);
1658
1659 /************************************************************//**
1660  *
1661  * NetShareSetInfo
1662  *
1663  * @brief Set Share Info
1664  *
1665  * @param[in] server_name The server name to connect to
1666  * @param[in] net_name The name of the share to query
1667  * @param[in] level The level defining the SHARE_INFO_X structure
1668  * @param[in] buffer The buffer containing a SHARE_INFO_X structure
1669  * @param[out] parm_err The returned parameter error number if any
1670  * @return NET_API_STATUS
1671  *
1672  * example share/share_setinfo.c
1673  ***************************************************************/
1674
1675 NET_API_STATUS NetShareSetInfo(const char * server_name /* [in] */,
1676                                const char * net_name /* [in] */,
1677                                uint32_t level /* [in] */,
1678                                uint8_t *buffer /* [in] [ref] */,
1679                                uint32_t *parm_err /* [out] [ref] */);
1680
1681 #ifdef __cplusplus
1682 }
1683 #endif /* __cplusplus */
1684
1685 #endif /* __LIB_NETAPI_H__ */