2 * Unix SMB/CIFS implementation.
4 * Copyright (C) Guenther Deschner 2007-2008
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.
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.
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/>.
20 #ifndef __LIB_NETAPI_H__
21 #define __LIB_NETAPI_H__
23 /****************************************************************
25 ****************************************************************/
27 NET_API_STATUS_SUCCESS = 0
30 #define ERROR_MORE_DATA ( 234L )
32 /****************************************************************
33 ****************************************************************/
40 uint16_t time_hi_and_version;
45 #endif /* _HEADER_misc */
47 #ifndef _HEADER_libnetapi
50 #define MAXSUBAUTHS 15 /* max sub authorities in a SID */
57 uint32_t sub_auths[MAXSUBAUTHS];
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;
68 const char * dc_site_name;
69 const char * client_site_name;
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 )
78 #define TIMEQ_FOREVER ( (uint32_t)-1L )
80 struct SERVER_INFO_1005 {
81 const char * sv1005_comment;
85 const char * usri0_name;
89 const char * usri1_name;
90 const char * usri1_password;
91 uint32_t usri1_password_age;
93 const char * usri1_home_dir;
94 const char * usri1_comment;
96 const char * usri1_script_path;
100 const char * usri2_name;
101 const char * usri2_password;
102 uint32_t usri2_password_age;
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;
127 const char * usri3_name;
128 uint32_t usri3_password_age;
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;
158 const char * usri4_name;
159 const char * usri4_password;
160 uint32_t usri4_password_age;
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;
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;
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;
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;
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] */
235 struct USER_INFO_1007 {
236 const char * usri1007_comment;
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;
247 struct USER_MODALS_INFO_1 {
248 uint32_t usrmod1_role;
249 const char * usrmod1_primary;
252 struct USER_MODALS_INFO_2 {
253 const char * usrmod2_domain_name;
254 struct domsid *usrmod2_domain_id;/* [unique] */
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;
263 struct USER_MODALS_INFO_1001 {
264 uint32_t usrmod1001_min_passwd_len;
267 struct USER_MODALS_INFO_1002 {
268 uint32_t usrmod1002_max_passwd_age;
271 struct USER_MODALS_INFO_1003 {
272 uint32_t usrmod1003_min_passwd_age;
275 struct USER_MODALS_INFO_1004 {
276 uint32_t usrmod1004_force_logoff;
279 struct USER_MODALS_INFO_1005 {
280 uint32_t usrmod1005_password_hist_len;
283 struct USER_MODALS_INFO_1006 {
284 uint32_t usrmod1006_role;
287 struct USER_MODALS_INFO_1007 {
288 const char * usrmod1007_primary;
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;
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;
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;
316 struct GROUP_INFO_0 {
317 const char * grpi0_name;
320 struct GROUP_INFO_1 {
321 const char * grpi1_name;
322 const char * grpi1_comment;
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;
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;
339 struct GROUP_INFO_1002 {
340 const char * grpi1002_comment;
343 struct GROUP_INFO_1005 {
344 uint32_t grpi1005_attributes;
347 struct GROUP_USERS_INFO_0 {
348 const char * grui0_name;
351 struct GROUP_USERS_INFO_1 {
352 const char * grui1_name;
353 uint32_t grui1_attributes;
356 struct LOCALGROUP_INFO_0 {
357 const char * lgrpi0_name;
360 struct LOCALGROUP_INFO_1 {
361 const char * lgrpi1_name;
362 const char * lgrpi1_comment;
365 struct LOCALGROUP_INFO_1002 {
366 const char * lgrpi1002_comment;
374 SidTypeWellKnownGroup=5,
375 SidTypeDeletedAccount=6,
382 struct LOCALGROUP_MEMBERS_INFO_0 {
383 struct domsid *lgrmi0_sid;/* [unique] */
386 struct LOCALGROUP_MEMBERS_INFO_1 {
387 struct domsid *lgrmi1_sid;/* [unique] */
388 enum SID_NAME_USE lgrmi1_sidusage;
389 const char * lgrmi1_name;
392 struct LOCALGROUP_MEMBERS_INFO_2 {
393 struct domsid *lgrmi2_sid;/* [unique] */
394 enum SID_NAME_USE lgrmi2_sidusage;
395 const char * lgrmi2_domainandname;
398 struct LOCALGROUP_MEMBERS_INFO_3 {
399 const char * lgrmi3_domainandname;
402 struct TIME_OF_DAY_INFO {
403 uint32_t tod_elapsedt;
409 int32_t tod_timezone;
410 uint32_t tod_tinterval;
414 uint32_t tod_weekday;
417 #endif /* _HEADER_libnetapi */
419 /****************************************************************
420 ****************************************************************/
422 struct libnetapi_ctx {
430 int disable_policy_handle_cache;
435 /****************************************************************
436 ****************************************************************/
438 NET_API_STATUS libnetapi_init(struct libnetapi_ctx **ctx);
440 /****************************************************************
441 ****************************************************************/
443 NET_API_STATUS libnetapi_free(struct libnetapi_ctx *ctx);
445 /****************************************************************
446 ****************************************************************/
448 NET_API_STATUS libnetapi_getctx(struct libnetapi_ctx **ctx);
450 /****************************************************************
451 ****************************************************************/
453 NET_API_STATUS libnetapi_set_debuglevel(struct libnetapi_ctx *ctx,
454 const char *debuglevel);
456 /****************************************************************
457 ****************************************************************/
459 NET_API_STATUS libnetapi_set_username(struct libnetapi_ctx *ctx,
460 const char *username);
462 /****************************************************************
463 ****************************************************************/
465 NET_API_STATUS libnetapi_set_password(struct libnetapi_ctx *ctx,
466 const char *password);
468 /****************************************************************
469 ****************************************************************/
471 NET_API_STATUS libnetapi_set_workgroup(struct libnetapi_ctx *ctx,
472 const char *workgroup);
474 /****************************************************************
475 ****************************************************************/
477 NET_API_STATUS libnetapi_set_use_kerberos(struct libnetapi_ctx *ctx);
479 /****************************************************************
480 ****************************************************************/
482 const char *libnetapi_errstr(NET_API_STATUS status);
484 /****************************************************************
485 ****************************************************************/
487 const char *libnetapi_get_error_string(struct libnetapi_ctx *ctx,
488 NET_API_STATUS status);
490 /****************************************************************
492 ****************************************************************/
494 NET_API_STATUS NetApiBufferAllocate(uint32_t byte_count,
497 /****************************************************************
499 ****************************************************************/
501 NET_API_STATUS NetApiBufferFree(void *buffer);
503 /************************************************************//**
505 * ConvertSidToStringSid
507 * @brief Convert a domain sid into a string
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)
513 ***************************************************************/
515 int ConvertSidToStringSid(const struct domsid *sid,
518 /************************************************************//**
520 * ConvertStringSidToSid
522 * @brief Convert a string into a domain sid
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)
528 ***************************************************************/
530 int ConvertStringSidToSid(const char *sid_string,
531 struct domsid **sid);
533 /************************************************************//**
537 * @brief Join a computer to a domain or workgroup
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
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
548 * example netdomjoin/netdomjoin.c
549 ***************************************************************/
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] */);
558 /************************************************************//**
562 * @brief Unjoin a computer from a domain or workgroup
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
570 ***************************************************************/
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] */);
577 /************************************************************//**
579 * NetGetJoinInformation
581 * @brief Unjoin a computer from a domain or workgroup
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
588 * example netdomjoin-gui/netdomjoin-gui.c
590 ***************************************************************/
592 NET_API_STATUS NetGetJoinInformation(const char * server_name /* [in] */,
593 const char * *name_buffer /* [out] [ref] */,
594 uint16_t *name_type /* [out] [ref] */);
596 /************************************************************//**
600 * @brief Query for the list of joinable organizational Units that can be used
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
611 * example netdomjoin-gui/netdomjoin-gui.c
613 ***************************************************************/
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] */);
622 /************************************************************//**
626 * @brief Get Information on a server
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
633 ***************************************************************/
635 NET_API_STATUS NetServerGetInfo(const char * server_name /* [in] */,
636 uint32_t level /* [in] */,
637 uint8_t **buffer /* [out] [ref] */);
639 /************************************************************//**
643 * @brief Get Information on a server
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
651 ***************************************************************/
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] */);
658 /************************************************************//**
662 * @brief Query for the PDC for a given domain
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
669 * example getdc/getdc.c
670 ***************************************************************/
672 NET_API_STATUS NetGetDCName(const char * server_name /* [in] */,
673 const char * domain_name /* [in] */,
674 uint8_t **buffer /* [out] [ref] */);
676 /************************************************************//**
680 * @brief Query for any DC for a given domain
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
687 * example getdc/getdc.c
688 ***************************************************************/
690 NET_API_STATUS NetGetAnyDCName(const char * server_name /* [in] */,
691 const char * domain_name /* [in] */,
692 uint8_t **buffer /* [out] [ref] */);
695 /************************************************************//**
699 * @brief Lookup a DC for a given domain and return information structure
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
709 * example dsgetdc/dsgetdc.c
710 ***************************************************************/
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] */);
719 /************************************************************//**
723 * @brief Create a user on a given server
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
731 * @return NET_API_STATUS
733 * example user/user_add.c
734 ***************************************************************/
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] */);
741 /************************************************************//**
745 * @brief Delete a user on a given server
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
751 * example user/user_del.c
752 ***************************************************************/
754 NET_API_STATUS NetUserDel(const char * server_name /* [in] */,
755 const char * user_name /* [in] */);
757 /************************************************************//**
761 * @brief Enumerate accounts on a server
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
773 * @return NET_API_STATUS
775 * example user/user_enum.c
776 ***************************************************************/
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] */);
787 /************************************************************//**
789 * NetUserChangePassword
791 * @brief Change the password for a user on a given server or in a given domain
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
799 * example user/user_chgpwd.c
800 ***************************************************************/
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] */);
807 /************************************************************//**
811 * @brief Get User Information
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
819 * example user/user_getinfo.c
820 ***************************************************************/
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] */);
827 /************************************************************//**
831 * @brief Set User Information
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
840 * example user/user_setinfo.c
841 ***************************************************************/
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] */);
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] */);
857 /************************************************************//**
859 * NetQueryDisplayInformation
861 * @brief Enumerate accounts on a server
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
872 * example user/user_dispinfo.c
873 ***************************************************************/
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] */);
883 /************************************************************//**
887 * @brief Create Domain Group
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
895 * example group/group_add.c
896 ***************************************************************/
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] */);
903 /************************************************************//**
907 * @brief Delete Domain Group
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
913 * example group/group_del.c
914 ***************************************************************/
916 NET_API_STATUS NetGroupDel(const char * server_name /* [in] */,
917 const char * group_name /* [in] */);
919 /************************************************************//**
923 * @brief Enumerate groups on a server
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
934 * @return NET_API_STATUS
936 * example group/group_enum.c
937 ***************************************************************/
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] */);
947 /************************************************************//**
951 * @brief Set Domain Group Information
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
960 * example group/group_setinfo.c
961 ***************************************************************/
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] */);
969 /************************************************************//**
973 * @brief Get Domain Group Information
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
981 * example group/group_getinfo.c
982 ***************************************************************/
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] */);
989 /************************************************************//**
993 * @brief Add existing User to existing Domain Group
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
999 * @return NET_API_STATUS
1001 * example group/group_adduser.c
1002 ***************************************************************/
1004 NET_API_STATUS NetGroupAddUser(const char * server_name /* [in] */,
1005 const char * group_name /* [in] */,
1006 const char * user_name /* [in] */);
1008 /************************************************************//**
1012 * @brief Remove User from Domain Group
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
1018 * @return NET_API_STATUS
1020 * example group/group_deluser.c
1021 ***************************************************************/
1023 NET_API_STATUS NetGroupDelUser(const char * server_name /* [in] */,
1024 const char * group_name /* [in] */,
1025 const char * user_name /* [in] */);
1027 /************************************************************//**
1031 * @brief Get Users for a group on a server
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
1042 * @return NET_API_STATUS
1044 * example group/group_getusers.c
1045 ***************************************************************/
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] */);
1056 /************************************************************//**
1060 * @brief Create Local Group
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
1068 * example localgroup/localgroup_add.c
1069 ***************************************************************/
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] */);
1076 /************************************************************//**
1080 * @brief Delete Local Group
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
1086 * example localgroup/localgroup_del.c
1087 ***************************************************************/
1090 NET_API_STATUS NetLocalGroupDel(const char * server_name /* [in] */,
1091 const char * group_name /* [in] */);
1093 /************************************************************//**
1095 * NetLocalGroupGetInfo
1097 * @brief Get Local Group Information
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
1105 * example localgroup/localgroup_getinfo.c
1106 ***************************************************************/
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] */);
1113 /************************************************************//**
1115 * NetLocalGroupSetInfo
1117 * @brief Set Local Group Information
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
1126 * example localgroup/localgroup_setinfo.c
1127 ***************************************************************/
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] */);
1136 /************************************************************//**
1140 * @brief Enumerate local groups on a server
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
1151 * @return NET_API_STATUS
1153 * example localgroup/localgroup_enum.c
1154 ***************************************************************/
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] */);
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] */);
1188 /************************************************************//**
1192 * @brief Query remote Time of Day
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
1198 * example server/remote_tod.c
1199 ***************************************************************/
1201 NET_API_STATUS NetRemoteTOD(const char * server_name /* [in] */,
1202 uint8_t **buf /* [out] [ref] */);