netapi: add NetLocalGroup*Member calls to public headers.
[jra/samba/.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 /****************************************************************
24  NET_API_STATUS
25 ****************************************************************/
26 typedef enum {
27         NET_API_STATUS_SUCCESS = 0
28 } NET_API_STATUS;
29
30 #define ERROR_MORE_DATA ( 234L )
31
32 /****************************************************************
33 ****************************************************************/
34
35 #ifndef _HEADER_misc
36
37 struct GUID {
38         uint32_t time_low;
39         uint16_t time_mid;
40         uint16_t time_hi_and_version;
41         uint8_t clock_seq[2];
42         uint8_t node[6];
43 };
44
45 #endif /* _HEADER_misc */
46
47 #ifndef _HEADER_libnetapi
48
49 #ifndef MAXSUBAUTHS
50 #define MAXSUBAUTHS 15 /* max sub authorities in a SID */
51 #endif
52
53 struct domsid {
54         uint8_t   sid_rev_num;
55         uint8_t   num_auths;
56         uint8_t   id_auth[6];
57         uint32_t  sub_auths[MAXSUBAUTHS];
58 };
59
60 struct DOMAIN_CONTROLLER_INFO {
61         const char * domain_controller_name;
62         const char * domain_controller_address;
63         uint32_t domain_controller_address_type;
64         struct GUID domain_guid;
65         const char * domain_name;
66         const char * dns_forest_name;
67         uint32_t flags;
68         const char * dc_site_name;
69         const char * client_site_name;
70 };
71
72 #define FILTER_TEMP_DUPLICATE_ACCOUNT   ( 0x0001 )
73 #define FILTER_NORMAL_ACCOUNT   ( 0x0002 )
74 #define FILTER_INTERDOMAIN_TRUST_ACCOUNT        ( 0x0008 )
75 #define FILTER_WORKSTATION_TRUST_ACCOUNT        ( 0x0010 )
76 #define FILTER_SERVER_TRUST_ACCOUNT     ( 0x0020 )
77
78 #define TIMEQ_FOREVER  ( (uint32_t)-1L )
79
80 struct SERVER_INFO_1005 {
81         const char * sv1005_comment;
82 };
83
84 struct USER_INFO_0 {
85         const char * usri0_name;
86 };
87
88 struct USER_INFO_1 {
89         const char * usri1_name;
90         const char * usri1_password;
91         uint32_t usri1_password_age;
92         uint32_t usri1_priv;
93         const char * usri1_home_dir;
94         const char * usri1_comment;
95         uint32_t usri1_flags;
96         const char * usri1_script_path;
97 };
98
99 struct USER_INFO_2 {
100         const char * usri2_name;
101         const char * usri2_password;
102         uint32_t usri2_password_age;
103         uint32_t usri2_priv;
104         const char * usri2_home_dir;
105         const char * usri2_comment;
106         uint32_t usri2_flags;
107         const char * usri2_script_path;
108         uint32_t usri2_auth_flags;
109         const char * usri2_full_name;
110         const char * usri2_usr_comment;
111         const char * usri2_parms;
112         const char * usri2_workstations;
113         uint32_t usri2_last_logon;
114         uint32_t usri2_last_logoff;
115         uint32_t usri2_acct_expires;
116         uint32_t usri2_max_storage;
117         uint32_t usri2_units_per_week;
118         uint8_t *usri2_logon_hours;/* [unique] */
119         uint32_t usri2_bad_pw_count;
120         uint32_t usri2_num_logons;
121         const char * usri2_logon_server;
122         uint32_t usri2_country_code;
123         uint32_t usri2_code_page;
124 };
125
126 struct USER_INFO_3 {
127         const char * usri3_name;
128         uint32_t usri3_password_age;
129         uint32_t usri3_priv;
130         const char * usri3_home_dir;
131         const char * usri3_comment;
132         uint32_t usri3_flags;
133         const char * usri3_script_path;
134         uint32_t usri3_auth_flags;
135         const char * usri3_full_name;
136         const char * usri3_usr_comment;
137         const char * usri3_parms;
138         const char * usri3_workstations;
139         uint32_t usri3_last_logon;
140         uint32_t usri3_last_logoff;
141         uint32_t usri3_acct_expires;
142         uint32_t usri3_max_storage;
143         uint32_t usri3_units_per_week;
144         uint8_t *usri3_logon_hours;/* [unique] */
145         uint32_t usri3_bad_pw_count;
146         uint32_t usri3_num_logons;
147         const char * usri3_logon_server;
148         uint32_t usri3_country_code;
149         uint32_t usri3_code_page;
150         uint32_t usri3_user_id;
151         uint32_t usri3_primary_group_id;
152         const char * usri3_profile;
153         const char * usri3_home_dir_drive;
154         uint32_t usri3_password_expired;
155 };
156
157 struct USER_INFO_4 {
158         const char * usri4_name;
159         const char * usri4_password;
160         uint32_t usri4_password_age;
161         uint32_t usri4_priv;
162         const char * usri4_home_dir;
163         const char * usri4_comment;
164         uint32_t usri4_flags;
165         const char * usri4_script_path;
166         uint32_t usri4_auth_flags;
167         const char * usri4_full_name;
168         const char * usri4_usr_comment;
169         const char * usri4_parms;
170         const char * usri4_workstations;
171         uint32_t usri4_last_logon;
172         uint32_t usri4_last_logoff;
173         uint32_t usri4_acct_expires;
174         uint32_t usri4_max_storage;
175         uint32_t usri4_units_per_week;
176         uint8_t *usri4_logon_hours;/* [unique] */
177         uint32_t usri4_bad_pw_count;
178         uint32_t usri4_num_logons;
179         const char * usri4_logon_server;
180         uint32_t usri4_country_code;
181         uint32_t usri4_code_page;
182         struct dom_sid *usri4_user_sid;/* [unique] */
183         uint32_t usri4_primary_group_id;
184         const char * usri4_profile;
185         const char * usri4_home_dir_drive;
186         uint32_t usri4_password_expired;
187 };
188
189 struct USER_INFO_10 {
190         const char * usri10_name;
191         const char * usri10_comment;
192         const char * usri10_usr_comment;
193         const char * usri10_full_name;
194 };
195
196 struct USER_INFO_11 {
197         const char * usri11_name;
198         const char * usri11_comment;
199         const char * usri11_usr_comment;
200         const char * usri11_full_name;
201         uint32_t usri11_priv;
202         uint32_t usri11_auth_flags;
203         uint32_t usri11_password_age;
204         const char * usri11_home_dir;
205         const char * usri11_parms;
206         uint32_t usri11_last_logon;
207         uint32_t usri11_last_logoff;
208         uint32_t usri11_bad_pw_count;
209         uint32_t usri11_num_logons;
210         const char * usri11_logon_server;
211         uint32_t usri11_country_code;
212         const char * usri11_workstations;
213         uint32_t usri11_max_storage;
214         uint32_t usri11_units_per_week;
215         uint8_t *usri11_logon_hours;/* [unique] */
216         uint32_t usri11_code_page;
217 };
218
219 struct USER_INFO_20 {
220         const char * usri20_name;
221         const char * usri20_full_name;
222         const char * usri20_comment;
223         uint32_t usri20_flags;
224         uint32_t usri20_user_id;
225 };
226
227 struct USER_INFO_23 {
228         const char * usri23_name;
229         const char * usri23_full_name;
230         const char * usri23_comment;
231         uint32_t usri23_flags;
232         struct domsid *usri23_user_sid;/* [unique] */
233 };
234
235 struct USER_INFO_1007 {
236         const char * usri1007_comment;
237 };
238
239 struct USER_MODALS_INFO_0 {
240         uint32_t usrmod0_min_passwd_len;
241         uint32_t usrmod0_max_passwd_age;
242         uint32_t usrmod0_min_passwd_age;
243         uint32_t usrmod0_force_logoff;
244         uint32_t usrmod0_password_hist_len;
245 };
246
247 struct USER_MODALS_INFO_1 {
248         uint32_t usrmod1_role;
249         const char * usrmod1_primary;
250 };
251
252 struct USER_MODALS_INFO_2 {
253         const char * usrmod2_domain_name;
254         struct domsid *usrmod2_domain_id;/* [unique] */
255 };
256
257 struct USER_MODALS_INFO_3 {
258         uint32_t usrmod3_lockout_duration;
259         uint32_t usrmod3_lockout_observation_window;
260         uint32_t usrmod3_lockout_threshold;
261 };
262
263 struct USER_MODALS_INFO_1001 {
264         uint32_t usrmod1001_min_passwd_len;
265 };
266
267 struct USER_MODALS_INFO_1002 {
268         uint32_t usrmod1002_max_passwd_age;
269 };
270
271 struct USER_MODALS_INFO_1003 {
272         uint32_t usrmod1003_min_passwd_age;
273 };
274
275 struct USER_MODALS_INFO_1004 {
276         uint32_t usrmod1004_force_logoff;
277 };
278
279 struct USER_MODALS_INFO_1005 {
280         uint32_t usrmod1005_password_hist_len;
281 };
282
283 struct USER_MODALS_INFO_1006 {
284         uint32_t usrmod1006_role;
285 };
286
287 struct USER_MODALS_INFO_1007 {
288         const char * usrmod1007_primary;
289 };
290
291 struct NET_DISPLAY_USER {
292         const char * usri1_name;
293         const char * usri1_comment;
294         uint32_t usri1_flags;
295         const char * usri1_full_name;
296         uint32_t usri1_user_id;
297         uint32_t usri1_next_index;
298 };
299
300 struct NET_DISPLAY_MACHINE {
301         const char * usri2_name;
302         const char * usri2_comment;
303         uint32_t usri2_flags;
304         uint32_t usri2_user_id;
305         uint32_t usri2_next_index;
306 };
307
308 struct NET_DISPLAY_GROUP {
309         const char * grpi3_name;
310         const char * grpi3_comment;
311         uint32_t grpi3_group_id;
312         uint32_t grpi3_attributes;
313         uint32_t grpi3_next_index;
314 };
315
316 struct GROUP_INFO_0 {
317         const char * grpi0_name;
318 };
319
320 struct GROUP_INFO_1 {
321         const char * grpi1_name;
322         const char * grpi1_comment;
323 };
324
325 struct GROUP_INFO_2 {
326         const char * grpi2_name;
327         const char * grpi2_comment;
328         uint32_t grpi2_group_id;
329         uint32_t grpi2_attributes;
330 };
331
332 struct GROUP_INFO_3 {
333         const char * grpi3_name;
334         const char * grpi3_comment;
335         struct domsid * grpi3_group_sid;
336         uint32_t grpi3_attributes;
337 };
338
339 struct GROUP_INFO_1002 {
340         const char * grpi1002_comment;
341 };
342
343 struct GROUP_INFO_1005 {
344         uint32_t grpi1005_attributes;
345 };
346
347 struct GROUP_USERS_INFO_0 {
348         const char * grui0_name;
349 };
350
351 struct GROUP_USERS_INFO_1 {
352         const char * grui1_name;
353         uint32_t grui1_attributes;
354 };
355
356 struct LOCALGROUP_INFO_0 {
357         const char * lgrpi0_name;
358 };
359
360 struct LOCALGROUP_INFO_1 {
361         const char * lgrpi1_name;
362         const char * lgrpi1_comment;
363 };
364
365 struct LOCALGROUP_INFO_1002 {
366         const char * lgrpi1002_comment;
367 };
368
369 enum SID_NAME_USE {
370         SidTypeUser=1,
371         SidTypeGroup=2,
372         SidTypeDomain=3,
373         SidTypeAlias=4,
374         SidTypeWellKnownGroup=5,
375         SidTypeDeletedAccount=6,
376         SidTypeInvalid=7,
377         SidTypeUnknown=8,
378         SidTypeComputer=9,
379         SidTypeLabel=10
380 };
381
382 struct LOCALGROUP_MEMBERS_INFO_0 {
383         struct domsid *lgrmi0_sid;/* [unique] */
384 };
385
386 struct LOCALGROUP_MEMBERS_INFO_1 {
387         struct domsid *lgrmi1_sid;/* [unique] */
388         enum SID_NAME_USE lgrmi1_sidusage;
389         const char * lgrmi1_name;
390 };
391
392 struct LOCALGROUP_MEMBERS_INFO_2 {
393         struct domsid *lgrmi2_sid;/* [unique] */
394         enum SID_NAME_USE lgrmi2_sidusage;
395         const char * lgrmi2_domainandname;
396 };
397
398 struct LOCALGROUP_MEMBERS_INFO_3 {
399         const char * lgrmi3_domainandname;
400 };
401
402 struct TIME_OF_DAY_INFO {
403         uint32_t tod_elapsedt;
404         uint32_t tod_msecs;
405         uint32_t tod_hours;
406         uint32_t tod_mins;
407         uint32_t tod_secs;
408         uint32_t tod_hunds;
409         int32_t tod_timezone;
410         uint32_t tod_tinterval;
411         uint32_t tod_day;
412         uint32_t tod_month;
413         uint32_t tod_year;
414         uint32_t tod_weekday;
415 };
416
417 #endif /* _HEADER_libnetapi */
418
419 /****************************************************************
420 ****************************************************************/
421
422 struct libnetapi_ctx {
423         char *debuglevel;
424         char *error_string;
425         char *username;
426         char *workgroup;
427         char *password;
428         char *krb5_cc_env;
429         int use_kerberos;
430         int disable_policy_handle_cache;
431
432         void *private_data;
433 };
434
435 /****************************************************************
436 ****************************************************************/
437
438 NET_API_STATUS libnetapi_init(struct libnetapi_ctx **ctx);
439
440 /****************************************************************
441 ****************************************************************/
442
443 NET_API_STATUS libnetapi_free(struct libnetapi_ctx *ctx);
444
445 /****************************************************************
446 ****************************************************************/
447
448 NET_API_STATUS libnetapi_getctx(struct libnetapi_ctx **ctx);
449
450 /****************************************************************
451 ****************************************************************/
452
453 NET_API_STATUS libnetapi_set_debuglevel(struct libnetapi_ctx *ctx,
454                                         const char *debuglevel);
455
456 /****************************************************************
457 ****************************************************************/
458
459 NET_API_STATUS libnetapi_set_username(struct libnetapi_ctx *ctx,
460                                       const char *username);
461
462 /****************************************************************
463 ****************************************************************/
464
465 NET_API_STATUS libnetapi_set_password(struct libnetapi_ctx *ctx,
466                                       const char *password);
467
468 /****************************************************************
469 ****************************************************************/
470
471 NET_API_STATUS libnetapi_set_workgroup(struct libnetapi_ctx *ctx,
472                                        const char *workgroup);
473
474 /****************************************************************
475 ****************************************************************/
476
477 NET_API_STATUS libnetapi_set_use_kerberos(struct libnetapi_ctx *ctx);
478
479 /****************************************************************
480 ****************************************************************/
481
482 const char *libnetapi_errstr(NET_API_STATUS status);
483
484 /****************************************************************
485 ****************************************************************/
486
487 const char *libnetapi_get_error_string(struct libnetapi_ctx *ctx,
488                                        NET_API_STATUS status);
489
490 /****************************************************************
491  NetApiBufferAllocate
492 ****************************************************************/
493
494 NET_API_STATUS NetApiBufferAllocate(uint32_t byte_count,
495                                     void **buffer);
496
497 /****************************************************************
498  NetApiBufferFree
499 ****************************************************************/
500
501 NET_API_STATUS NetApiBufferFree(void *buffer);
502
503 /************************************************************//**
504  *
505  * ConvertSidToStringSid
506  *
507  * @brief Convert a domain sid into a string
508  *
509  * @param[in] sid A pointer to a sid structure
510  * @param[in] sid_string A pointer that holds a pointer to a sid string. Caller
511  * needs to free with free(3)
512  * @return bool
513  ***************************************************************/
514
515 int  ConvertSidToStringSid(const struct domsid *sid,
516                            char **sid_string);
517
518 /************************************************************//**
519  *
520  * ConvertStringSidToSid
521  *
522  * @brief Convert a string into a domain sid
523  *
524  * @param[in] sid_string A pointer to a sid string.
525  * @param[in] sid A pointer that holds a pointer to a sid structure.
526  * Caller needs to free with free(3)
527  * @return bool
528  ***************************************************************/
529
530 int ConvertStringSidToSid(const char *sid_string,
531                           struct domsid **sid);
532
533 /************************************************************//**
534  *
535  * NetJoinDomain
536  *
537  * @brief Join a computer to a domain or workgroup
538  *
539  * @param[in] server The server name to connect to
540  * @param[in] domain The domain or workgroup to join
541  * @param[in] account_ou The organizational Unit to create the computer account
542  * in (AD only)
543  * @param[in] account The domain account used for joining a domain
544  * @param[in] password The domain account's password used for joining a domain
545  * @param[in] join_flags Bitmask field to define specific join features
546  * @return NET_API_STATUS
547  *
548  * example netdomjoin/netdomjoin.c
549  ***************************************************************/
550
551 NET_API_STATUS NetJoinDomain(const char * server /* [in] */,
552                              const char * domain /* [in] [ref] */,
553                              const char * account_ou /* [in] */,
554                              const char * account /* [in] */,
555                              const char * password /* [in] */,
556                              uint32_t join_flags /* [in] */);
557
558 /************************************************************//**
559  *
560  * NetUnjoinDomain
561  *
562  * @brief Unjoin a computer from a domain or workgroup
563  *
564  * @param[in] server_name The server name to connect to
565  * @param[in] account The domain account used for unjoining a domain
566  * @param[in] password The domain account's password used for unjoining a domain
567  * @param[in] unjoin_flags Bitmask field to define specific unjoin features
568  * @return NET_API_STATUS
569  *
570  ***************************************************************/
571
572 NET_API_STATUS NetUnjoinDomain(const char * server_name /* [in] */,
573                                const char * account /* [in] */,
574                                const char * password /* [in] */,
575                                uint32_t unjoin_flags /* [in] */);
576
577 /************************************************************//**
578  *
579  * NetGetJoinInformation
580  *
581  * @brief Unjoin a computer from a domain or workgroup
582  *
583  * @param[in] server_name The server name to connect to
584  * @param[out] name_buffer Returns the name of the workgroup or domain
585  * @param[out] name_type  Returns the type of that name
586  * @return NET_API_STATUS
587  *
588  * example netdomjoin-gui/netdomjoin-gui.c
589  *
590  ***************************************************************/
591
592 NET_API_STATUS NetGetJoinInformation(const char * server_name /* [in] */,
593                                      const char * *name_buffer /* [out] [ref] */,
594                                      uint16_t *name_type /* [out] [ref] */);
595
596 /************************************************************//**
597  *
598  * NetGetJoinableOUs
599  *
600  * @brief Query for the list of joinable organizational Units that can be used
601  * for joining AD
602  *
603  * @param[in] server_name The server name to connect to
604  * @param[in] domain The AD domain to query
605  * @param[in] account The domain account used for the query
606  * @param[in] password The domain account's password used for the query
607  * @param[out] ou_count The number of ous returned
608  * @param[out] ous Returned string array containing the ous
609  * @return NET_API_STATUS
610  *
611  * example netdomjoin-gui/netdomjoin-gui.c
612  *
613  ***************************************************************/
614
615 NET_API_STATUS NetGetJoinableOUs(const char * server_name /* [in] */,
616                                  const char * domain /* [in] [ref] */,
617                                  const char * account /* [in] */,
618                                  const char * password /* [in] */,
619                                  uint32_t *ou_count /* [out] [ref] */,
620                                  const char * **ous /* [out] [ref] */);
621
622 /************************************************************//**
623  *
624  * NetServerGetInfo
625  *
626  * @brief Get Information on a server
627  *
628  * @param[in] server_name The server name to connect to
629  * @param[in] level The level to define which information is requested
630  * @param[out] buffer The returned buffer carrying the SERVER_INFO structure
631  * @return NET_API_STATUS
632  *
633  ***************************************************************/
634
635 NET_API_STATUS NetServerGetInfo(const char * server_name /* [in] */,
636                                 uint32_t level /* [in] */,
637                                 uint8_t **buffer /* [out] [ref] */);
638
639 /************************************************************//**
640  *
641  * NetServerSetInfo
642  *
643  * @brief Get Information on a server
644  *
645  * @param[in] server_name The server name to connect to
646  * @param[in] level The level to define which information is set
647  * @param[in] buffer The buffer carrying the SERVER_INFO structure
648  * @param[out] parm_error On failure returns the invalid SERVER_INFO member
649  * @return NET_API_STATUS
650  *
651  ***************************************************************/
652
653 NET_API_STATUS NetServerSetInfo(const char * server_name /* [in] */,
654                                 uint32_t level /* [in] */,
655                                 uint8_t *buffer /* [in] [ref] */,
656                                 uint32_t *parm_error /* [out] [ref] */);
657
658 /************************************************************//**
659  *
660  * NetGetDCName
661  *
662  * @brief Query for the PDC for a given domain
663  *
664  * @param[in] server_name The server name to connect to
665  * @param[in] domain_name The name of the domain to lookup
666  * @param[out] buffer The name of the domain to lookup
667  * @return NET_API_STATUS
668  *
669  * example getdc/getdc.c
670  ***************************************************************/
671
672 NET_API_STATUS NetGetDCName(const char * server_name /* [in] */,
673                             const char * domain_name /* [in] */,
674                             uint8_t **buffer /* [out] [ref] */);
675
676 /************************************************************//**
677  *
678  * NetGetAnyDCName
679  *
680  * @brief Query for any DC for a given domain
681  *
682  * @param[in] server_name The server name to connect to
683  * @param[in] domain_name The name of the domain to lookup
684  * @param[out] buffer The name of the domain to lookup
685  * @return NET_API_STATUS
686  *
687  * example getdc/getdc.c
688  ***************************************************************/
689
690 NET_API_STATUS NetGetAnyDCName(const char * server_name /* [in] */,
691                                const char * domain_name /* [in] */,
692                                uint8_t **buffer /* [out] [ref] */);
693
694
695 /************************************************************//**
696  *
697  * DsGetDcName
698  *
699  * @brief Lookup a DC for a given domain and return information structure
700  *
701  * @param[in] server_name The server name to connect to
702  * @param[in] domain_name The name of the domain to lookup (cannot be NULL)
703  * @param[in] domain_guid The GUID of the domain to lookup (optional)
704  * @param[in] site_name The name of the site the DC should reside in
705  * @param[in] flags A bitmask to request specific features supported by the DC
706  * @param[out] dc_info Pointer to a DOMAIN_CONTROLLER_INFO structure
707  * @return NET_API_STATUS
708  *
709  * example dsgetdc/dsgetdc.c
710  ***************************************************************/
711
712 NET_API_STATUS DsGetDcName(const char * server_name /* [in] [unique] */,
713                            const char * domain_name /* [in] [ref] */,
714                            struct GUID *domain_guid /* [in] [unique] */,
715                            const char * site_name /* [in] [unique] */,
716                            uint32_t flags /* [in] */,
717                            struct DOMAIN_CONTROLLER_INFO **dc_info /* [out] [ref] */);
718
719 /************************************************************//**
720  *
721  * NetUserAdd
722  *
723  * @brief Create a user on a given server
724  *
725  * @param[in] server_name The server name to connect to
726  * @param[in] level The level of the USER_INFO structure passed in (Currently
727  * only level 1 is supported)
728  * @param[in] buffer The buffer carrying the USER_INFO structure
729  * @param[out] parm_error In case of error returns the failing member of the
730  * structure
731  * @return NET_API_STATUS
732  *
733  * example user/user_add.c
734  ***************************************************************/
735
736 NET_API_STATUS NetUserAdd(const char * server_name /* [in] */,
737                           uint32_t level /* [in] */,
738                           uint8_t *buffer /* [in] [ref] */,
739                           uint32_t *parm_error /* [out] [ref] */);
740
741 /************************************************************//**
742  *
743  * NetUserDel
744  *
745  * @brief Delete a user on a given server
746  *
747  * @param[in] server_name The server name to connect to
748  * @param[in] user_name The user account to delete
749  * @return NET_API_STATUS
750  *
751  * example user/user_del.c
752  ***************************************************************/
753
754 NET_API_STATUS NetUserDel(const char * server_name /* [in] */,
755                           const char * user_name /* [in] */);
756
757 /************************************************************//**
758  *
759  * NetUserEnum
760  *
761  * @brief Enumerate accounts on a server
762  *
763  * @param[in] server_name The server name to connect to
764  * @param[in] level The enumeration level used for the query (Currently only
765  * level 0 is supported)
766  * @param[in] filter The account flags filter used for the query
767  * @param[out] buffer The returned enumeration buffer
768  * @param[in] prefmaxlen The requested maximal buffer size
769  * @param[out] entries_read The number of returned entries
770  * @param[out] total_entries The number of total entries
771  * @param[in,out] resume_handle A handle passed in and returned for resuming
772  * operations
773  * @return NET_API_STATUS
774  *
775  * example user/user_enum.c
776  ***************************************************************/
777
778 NET_API_STATUS NetUserEnum(const char * server_name /* [in] */,
779                            uint32_t level /* [in] */,
780                            uint32_t filter /* [in] */,
781                            uint8_t **buffer /* [out] [ref] */,
782                            uint32_t prefmaxlen /* [in] */,
783                            uint32_t *entries_read /* [out] [ref] */,
784                            uint32_t *total_entries /* [out] [ref] */,
785                            uint32_t *resume_handle /* [in,out] [ref] */);
786
787 /************************************************************//**
788  *
789  * NetUserChangePassword
790  *
791  * @brief Change the password for a user on a given server or in a given domain
792  *
793  * @param[in] domain_name The server or domain name to connect to
794  * @param[in] user_name The user account to change the password for
795  * @param[in] old_password The user account's old password
796  * @param[in] new_password The user account's new password
797  * @return NET_API_STATUS
798  *
799  * example user/user_chgpwd.c
800  ***************************************************************/
801
802 NET_API_STATUS NetUserChangePassword(const char * domain_name /* [in] */,
803                                      const char * user_name /* [in] */,
804                                      const char * old_password /* [in] */,
805                                      const char * new_password /* [in] */);
806
807 /************************************************************//**
808  *
809  * NetUserGetInfo
810  *
811  * @brief Get User Information
812  *
813  * @param[in] server_name The server name to connect to
814  * @param[in] user_name The name of the user that is going to be queried
815  * @param[in] level The level defining the requested USER_INFO_X structure
816  * @param[out] buffer The buffer containing a USER_INFO_X structure
817  * @return NET_API_STATUS
818  *
819  * example user/user_getinfo.c
820  ***************************************************************/
821
822 NET_API_STATUS NetUserGetInfo(const char * server_name /* [in] */,
823                               const char * user_name /* [in] */,
824                               uint32_t level /* [in] */,
825                               uint8_t **buffer /* [out] [ref] */);
826
827 /************************************************************//**
828  *
829  * NetUserSetInfo
830  *
831  * @brief Set User Information
832  *
833  * @param[in] server_name The server name to connect to
834  * @param[in] user_name The name of the user that is going to be modified
835  * @param[in] level The level defining the requested USER_INFO_X structure
836  * @param[in] buf The buffer containing a USER_INFO_X structure
837  * @param[out] parm_err The returned parameter error number if any
838  * @return NET_API_STATUS
839  *
840  * example user/user_setinfo.c
841  ***************************************************************/
842
843 NET_API_STATUS NetUserSetInfo(const char * server_name /* [in] */,
844                               const char * user_name /* [in] */,
845                               uint32_t level /* [in] */,
846                               uint8_t *buffer /* [in] [ref] */,
847                               uint32_t *parm_err /* [out] [ref] */);
848
849 NET_API_STATUS NetUserModalsGet(const char * server_name /* [in] */,
850                                 uint32_t level /* [in] */,
851                                 uint8_t **buffer /* [out] [ref] */);
852 NET_API_STATUS NetUserModalsSet(const char * server_name /* [in] */,
853                                 uint32_t level /* [in] */,
854                                 uint8_t *buffer /* [in] [ref] */,
855                                 uint32_t *parm_err /* [out] [ref] */);
856
857 /************************************************************//**
858  *
859  * NetQueryDisplayInformation
860  *
861  * @brief Enumerate accounts on a server
862  *
863  * @param[in] server_name The server name to connect to
864  * @param[in] level The enumeration level used for the query
865  * @param[in] idx The index to start the the display enumeration at
866  * @param[in] entries_requested The number of entries requested
867  * @param[in] prefmaxlen The requested maximal buffer size
868  * @param[out] entries_read The number of returned entries
869  * @param[out] buffer The returned display information buffer
870  * @return NET_API_STATUS
871  *
872  * example user/user_dispinfo.c
873  ***************************************************************/
874
875 NET_API_STATUS NetQueryDisplayInformation(const char * server_name /* [in] [unique] */,
876                                           uint32_t level /* [in] */,
877                                           uint32_t idx /* [in] */,
878                                           uint32_t entries_requested /* [in] */,
879                                           uint32_t prefmaxlen /* [in] */,
880                                           uint32_t *entries_read /* [out] [ref] */,
881                                           void **buffer /* [out] [noprint,ref] */);
882
883 /************************************************************//**
884  *
885  * NetGroupAdd
886  *
887  * @brief Create Domain Group
888  *
889  * @param[in] server_name The server name to connect to
890  * @param[in] level The level used for the new group creation
891  * @param[in] buf The buffer containing the group structure
892  * @param[out] parm_err The returned parameter error number if any
893  * @return NET_API_STATUS
894  *
895  * example group/group_add.c
896  ***************************************************************/
897
898 NET_API_STATUS NetGroupAdd(const char * server_name /* [in] */,
899                            uint32_t level /* [in] */,
900                            uint8_t *buf /* [in] [ref] */,
901                            uint32_t *parm_err /* [out] [ref] */);
902
903 /************************************************************//**
904  *
905  * NetGroupDel
906  *
907  * @brief Delete Domain Group
908  *
909  * @param[in] server_name The server name to connect to
910  * @param[in] group_name The name of the group that is going to be deleted
911  * @return NET_API_STATUS
912  *
913  * example group/group_del.c
914  ***************************************************************/
915
916 NET_API_STATUS NetGroupDel(const char * server_name /* [in] */,
917                            const char * group_name /* [in] */);
918
919 /************************************************************//**
920  *
921  * NetGroupEnum
922  *
923  * @brief Enumerate groups on a server
924  *
925  * @param[in] server_name The server name to connect to
926  * @param[in] level The enumeration level used for the query (Currently only
927  * level 0 is supported)
928  * @param[out] buffer The returned enumeration buffer
929  * @param[in] prefmaxlen The requested maximal buffer size
930  * @param[out] entries_read The number of returned entries
931  * @param[out] total_entries The number of total entries
932  * @param[in,out] resume_handle A handle passed in and returned for resuming
933  * operations
934  * @return NET_API_STATUS
935  *
936  * example group/group_enum.c
937  ***************************************************************/
938
939 NET_API_STATUS NetGroupEnum(const char * server_name /* [in] */,
940                             uint32_t level /* [in] */,
941                             uint8_t **buffer /* [out] [ref] */,
942                             uint32_t prefmaxlen /* [in] */,
943                             uint32_t *entries_read /* [out] [ref] */,
944                             uint32_t *total_entries /* [out] [ref] */,
945                             uint32_t *resume_handle /* [in,out] [ref] */);
946
947 /************************************************************//**
948  *
949  * NetGroupSetInfo
950  *
951  * @brief Set Domain Group Information
952  *
953  * @param[in] server_name The server name to connect to
954  * @param[in] group_name The name of the group that is going to be modified
955  * @param[in] level The level defining the structure type in buf
956  * @param[in] buf The buffer containing a GROUP_INFO_X structure
957  * @param[out] parm_err The returned parameter error number if any
958  * @return NET_API_STATUS
959  *
960  * example group/group_setinfo.c
961  ***************************************************************/
962
963 NET_API_STATUS NetGroupSetInfo(const char * server_name /* [in] */,
964                                const char * group_name /* [in] */,
965                                uint32_t level /* [in] */,
966                                uint8_t *buf /* [in] [ref] */,
967                                uint32_t *parm_err /* [out] [ref] */);
968
969 /************************************************************//**
970  *
971  * NetGroupGetInfo
972  *
973  * @brief Get Domain Group Information
974  *
975  * @param[in] server_name The server name to connect to
976  * @param[in] group_name The name of the group that is going to be queried
977  * @param[in] level The level defining the requested GROUP_INFO_X structure
978  * @param[out] buf The buffer containing a GROUP_INFO_X structure
979  * @return NET_API_STATUS
980  *
981  * example group/group_getinfo.c
982  ***************************************************************/
983
984 NET_API_STATUS NetGroupGetInfo(const char * server_name /* [in] */,
985                                const char * group_name /* [in] */,
986                                uint32_t level /* [in] */,
987                                uint8_t **buf /* [out] [ref] */);
988
989 /************************************************************//**
990  *
991  * NetGroupAddUser
992  *
993  * @brief Add existing User to existing Domain Group
994  *
995  * @param[in] server_name The server name to connect to
996  * @param[in] group_name The name of the group that is going to be modified
997  * @param[in] user_name The name of the user that is going to be added to the
998  * group
999  * @return NET_API_STATUS
1000  *
1001  * example group/group_adduser.c
1002  ***************************************************************/
1003
1004 NET_API_STATUS NetGroupAddUser(const char * server_name /* [in] */,
1005                                const char * group_name /* [in] */,
1006                                const char * user_name /* [in] */);
1007
1008 /************************************************************//**
1009  *
1010  * NetGroupDelUser
1011  *
1012  * @brief Remove User from Domain Group
1013  *
1014  * @param[in] server_name The server name to connect to
1015  * @param[in] group_name The name of the group that is going to be modified
1016  * @param[in] user_name The name of the user that is going to be removed from
1017  * the group
1018  * @return NET_API_STATUS
1019  *
1020  * example group/group_deluser.c
1021  ***************************************************************/
1022
1023 NET_API_STATUS NetGroupDelUser(const char * server_name /* [in] */,
1024                                const char * group_name /* [in] */,
1025                                const char * user_name /* [in] */);
1026
1027 /************************************************************//**
1028  *
1029  * NetGroupGetUsers
1030  *
1031  * @brief Get Users for a group on a server
1032  *
1033  * @param[in] server_name The server name to connect to
1034  * @param[in] group_name The group name to enumerate users for
1035  * @param[in] level The enumeration level used for the query
1036  * @param[out] buffer The returned enumeration buffer
1037  * @param[in] prefmaxlen The requested maximal buffer size
1038  * @param[out] entries_read The number of returned entries
1039  * @param[out] total_entries The number of total entries
1040  * @param[in,out] resume_handle A handle passed in and returned for resuming
1041  * operations
1042  * @return NET_API_STATUS
1043  *
1044  * example group/group_getusers.c
1045  ***************************************************************/
1046
1047 NET_API_STATUS NetGroupGetUsers(const char * server_name /* [in] */,
1048                                 const char * group_name /* [in] */,
1049                                 uint32_t level /* [in] */,
1050                                 uint8_t **buffer /* [out] [ref] */,
1051                                 uint32_t prefmaxlen /* [in] */,
1052                                 uint32_t *entries_read /* [out] [ref] */,
1053                                 uint32_t *total_entries /* [out] [ref] */,
1054                                 uint32_t *resume_handle /* [in,out] [ref] */);
1055
1056 /************************************************************//**
1057  *
1058  * NetLocalGroupAdd
1059  *
1060  * @brief Create Local Group
1061  *
1062  * @param[in] server_name The server name to connect to
1063  * @param[in] level The level used for the new group creation
1064  * @param[in] buf The buffer containing the group structure
1065  * @param[out] parm_err The returned parameter error number if any
1066  * @return NET_API_STATUS
1067  *
1068  * example localgroup/localgroup_add.c
1069  ***************************************************************/
1070
1071 NET_API_STATUS NetLocalGroupAdd(const char * server_name /* [in] */,
1072                                 uint32_t level /* [in] */,
1073                                 uint8_t *buf /* [in] [ref] */,
1074                                 uint32_t *parm_err /* [out] [ref] */);
1075
1076 /************************************************************//**
1077  *
1078  * NetLocalGroupDel
1079  *
1080  * @brief Delete Local Group
1081  *
1082  * @param[in] server_name The server name to connect to
1083  * @param[in] group_name The name of the group that is going to be deleted
1084  * @return NET_API_STATUS
1085  *
1086  * example localgroup/localgroup_del.c
1087  ***************************************************************/
1088
1089
1090 NET_API_STATUS NetLocalGroupDel(const char * server_name /* [in] */,
1091                                 const char * group_name /* [in] */);
1092
1093 /************************************************************//**
1094  *
1095  * NetLocalGroupGetInfo
1096  *
1097  * @brief Get Local Group Information
1098  *
1099  * @param[in] server_name The server name to connect to
1100  * @param[in] group_name The name of the group that is going to be queried
1101  * @param[in] level The level defining the requested LOCALGROUP_INFO_X structure
1102  * @param[out] buf The buffer containing a LOCALGROUP_INFO_X structure
1103  * @return NET_API_STATUS
1104  *
1105  * example localgroup/localgroup_getinfo.c
1106  ***************************************************************/
1107
1108 NET_API_STATUS NetLocalGroupGetInfo(const char * server_name /* [in] */,
1109                                     const char * group_name /* [in] */,
1110                                     uint32_t level /* [in] */,
1111                                     uint8_t **buf /* [out] [ref] */);
1112
1113 /************************************************************//**
1114  *
1115  * NetLocalGroupSetInfo
1116  *
1117  * @brief Set Local Group Information
1118  *
1119  * @param[in] server_name The server name to connect to
1120  * @param[in] group_name The name of the group that is going to be modified
1121  * @param[in] level The level defining the requested LOCALGROUP_INFO_X structure
1122  * @param[in] buf The buffer containing a LOCALGROUP_INFO_X structure
1123  * @param[out] parm_err The returned parameter error number if any
1124  * @return NET_API_STATUS
1125  *
1126  * example localgroup/localgroup_setinfo.c
1127  ***************************************************************/
1128
1129
1130 NET_API_STATUS NetLocalGroupSetInfo(const char * server_name /* [in] */,
1131                                     const char * group_name /* [in] */,
1132                                     uint32_t level /* [in] */,
1133                                     uint8_t *buf /* [in] [ref] */,
1134                                     uint32_t *parm_err /* [out] [ref] */);
1135
1136 /************************************************************//**
1137  *
1138  * NetLocalGroupEnum
1139  *
1140  * @brief Enumerate local groups on a server
1141  *
1142  * @param[in] server_name The server name to connect to
1143  * @param[in] level The enumeration level used for the query (Currently only
1144  * level 0 is supported)
1145  * @param[out] buffer The returned enumeration buffer
1146  * @param[in] prefmaxlen The requested maximal buffer size
1147  * @param[out] entries_read The number of returned entries
1148  * @param[out] total_entries The number of total entries
1149  * @param[in,out] resume_handle A handle passed in and returned for resuming
1150  * operations
1151  * @return NET_API_STATUS
1152  *
1153  * example localgroup/localgroup_enum.c
1154  ***************************************************************/
1155
1156 NET_API_STATUS NetLocalGroupEnum(const char * server_name /* [in] */,
1157                                  uint32_t level /* [in] */,
1158                                  uint8_t **buffer /* [out] [ref] */,
1159                                  uint32_t prefmaxlen /* [in] */,
1160                                  uint32_t *entries_read /* [out] [ref] */,
1161                                  uint32_t *total_entries /* [out] [ref] */,
1162                                  uint32_t *resume_handle /* [in,out] [ref] */);
1163
1164 NET_API_STATUS NetLocalGroupAddMembers(const char * server_name /* [in] */,
1165                                        const char * group_name /* [in] */,
1166                                        uint32_t level /* [in] */,
1167                                        uint8_t *buffer /* [in] [ref] */,
1168                                        uint32_t total_entries /* [in] */);
1169 NET_API_STATUS NetLocalGroupDelMembers(const char * server_name /* [in] */,
1170                                        const char * group_name /* [in] */,
1171                                        uint32_t level /* [in] */,
1172                                        uint8_t *buffer /* [in] [ref] */,
1173                                        uint32_t total_entries /* [in] */);
1174 NET_API_STATUS NetLocalGroupGetMembers(const char * server_name /* [in] */,
1175                                        const char * local_group_name /* [in] */,
1176                                        uint32_t level /* [in] */,
1177                                        uint8_t **buffer /* [out] [ref] */,
1178                                        uint32_t prefmaxlen /* [in] */,
1179                                        uint32_t *entries_read /* [out] [ref] */,
1180                                        uint32_t *total_entries /* [out] [ref] */,
1181                                        uint32_t *resume_handle /* [in,out] [ref] */);
1182 NET_API_STATUS NetLocalGroupSetMembers(const char * server_name /* [in] */,
1183                                        const char * group_name /* [in] */,
1184                                        uint32_t level /* [in] */,
1185                                        uint8_t *buffer /* [in] [ref] */,
1186                                        uint32_t total_entries /* [in] */);
1187
1188 /************************************************************//**
1189  *
1190  * NetRemoteTOD
1191  *
1192  * @brief Query remote Time of Day
1193  *
1194  * @param[in] server_name The server name to connect to
1195  * @param[out] buf The buffer containing a TIME_OF_DAY_INFO structure
1196  * @return NET_API_STATUS
1197  *
1198  * example server/remote_tod.c
1199  ***************************************************************/
1200
1201 NET_API_STATUS NetRemoteTOD(const char * server_name /* [in] */,
1202                             uint8_t **buf /* [out] [ref] */);
1203
1204 #endif