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