source: branches/samba-3.3.x/source/lib/netapi/netapi.h

Last change on this file was 206, checked in by Herwig Bauernfeind, 16 years ago

Import Samba 3.3 branch at 3.0.0 level (psmedley's port)

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