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/>.
21 #include "librpc/gen_ndr/libnetapi.h"
22 #include "lib/netapi/netapi.h"
23 #include "lib/netapi/netapi_private.h"
24 #include "lib/netapi/libnetapi.h"
25 #include "librpc/gen_ndr/ndr_libnetapi.h"
27 /****************************************************************
29 ****************************************************************/
31 NET_API_STATUS
NetJoinDomain(const char * server
/* [in] [unique] */,
32 const char * domain
/* [in] [ref] */,
33 const char * account_ou
/* [in] [unique] */,
34 const char * account
/* [in] [unique] */,
35 const char * password
/* [in] [unique] */,
36 uint32_t join_flags
/* [in] */)
38 struct NetJoinDomain r
;
39 struct libnetapi_ctx
*ctx
= NULL
;
40 NET_API_STATUS status
;
42 TALLOC_CTX
*frame
= talloc_stackframe();
44 status
= libnetapi_getctx(&ctx
);
53 r
.in
.account_ou
= account_ou
;
54 r
.in
.account
= account
;
55 r
.in
.password
= password
;
56 r
.in
.join_flags
= join_flags
;
60 if (DEBUGLEVEL
>= 10) {
61 NDR_PRINT_IN_DEBUG(NetJoinDomain
, &r
);
64 if (LIBNETAPI_LOCAL_SERVER(server
)) {
65 werr
= NetJoinDomain_l(ctx
, &r
);
67 werr
= NetJoinDomain_r(ctx
, &r
);
70 r
.out
.result
= W_ERROR_V(werr
);
72 if (DEBUGLEVEL
>= 10) {
73 NDR_PRINT_OUT_DEBUG(NetJoinDomain
, &r
);
77 return (NET_API_STATUS
)r
.out
.result
;
80 /****************************************************************
82 ****************************************************************/
84 NET_API_STATUS
NetUnjoinDomain(const char * server_name
/* [in] [unique] */,
85 const char * account
/* [in] [unique] */,
86 const char * password
/* [in] [unique] */,
87 uint32_t unjoin_flags
/* [in] */)
89 struct NetUnjoinDomain r
;
90 struct libnetapi_ctx
*ctx
= NULL
;
91 NET_API_STATUS status
;
93 TALLOC_CTX
*frame
= talloc_stackframe();
95 status
= libnetapi_getctx(&ctx
);
102 r
.in
.server_name
= server_name
;
103 r
.in
.account
= account
;
104 r
.in
.password
= password
;
105 r
.in
.unjoin_flags
= unjoin_flags
;
109 if (DEBUGLEVEL
>= 10) {
110 NDR_PRINT_IN_DEBUG(NetUnjoinDomain
, &r
);
113 if (LIBNETAPI_LOCAL_SERVER(server_name
)) {
114 werr
= NetUnjoinDomain_l(ctx
, &r
);
116 werr
= NetUnjoinDomain_r(ctx
, &r
);
119 r
.out
.result
= W_ERROR_V(werr
);
121 if (DEBUGLEVEL
>= 10) {
122 NDR_PRINT_OUT_DEBUG(NetUnjoinDomain
, &r
);
126 return (NET_API_STATUS
)r
.out
.result
;
129 /****************************************************************
130 NetGetJoinInformation
131 ****************************************************************/
133 NET_API_STATUS
NetGetJoinInformation(const char * server_name
/* [in] [unique] */,
134 const char * *name_buffer
/* [out] [ref] */,
135 uint16_t *name_type
/* [out] [ref] */)
137 struct NetGetJoinInformation r
;
138 struct libnetapi_ctx
*ctx
= NULL
;
139 NET_API_STATUS status
;
141 TALLOC_CTX
*frame
= talloc_stackframe();
143 status
= libnetapi_getctx(&ctx
);
150 r
.in
.server_name
= server_name
;
153 r
.out
.name_buffer
= name_buffer
;
154 r
.out
.name_type
= name_type
;
156 if (DEBUGLEVEL
>= 10) {
157 NDR_PRINT_IN_DEBUG(NetGetJoinInformation
, &r
);
160 if (LIBNETAPI_LOCAL_SERVER(server_name
)) {
161 werr
= NetGetJoinInformation_l(ctx
, &r
);
163 werr
= NetGetJoinInformation_r(ctx
, &r
);
166 r
.out
.result
= W_ERROR_V(werr
);
168 if (DEBUGLEVEL
>= 10) {
169 NDR_PRINT_OUT_DEBUG(NetGetJoinInformation
, &r
);
173 return (NET_API_STATUS
)r
.out
.result
;
176 /****************************************************************
178 ****************************************************************/
180 NET_API_STATUS
NetGetJoinableOUs(const char * server_name
/* [in] [unique] */,
181 const char * domain
/* [in] [ref] */,
182 const char * account
/* [in] [unique] */,
183 const char * password
/* [in] [unique] */,
184 uint32_t *ou_count
/* [out] [ref] */,
185 const char * **ous
/* [out] [ref] */)
187 struct NetGetJoinableOUs r
;
188 struct libnetapi_ctx
*ctx
= NULL
;
189 NET_API_STATUS status
;
191 TALLOC_CTX
*frame
= talloc_stackframe();
193 status
= libnetapi_getctx(&ctx
);
200 r
.in
.server_name
= server_name
;
201 r
.in
.domain
= domain
;
202 r
.in
.account
= account
;
203 r
.in
.password
= password
;
206 r
.out
.ou_count
= ou_count
;
209 if (DEBUGLEVEL
>= 10) {
210 NDR_PRINT_IN_DEBUG(NetGetJoinableOUs
, &r
);
213 if (LIBNETAPI_LOCAL_SERVER(server_name
)) {
214 werr
= NetGetJoinableOUs_l(ctx
, &r
);
216 werr
= NetGetJoinableOUs_r(ctx
, &r
);
219 r
.out
.result
= W_ERROR_V(werr
);
221 if (DEBUGLEVEL
>= 10) {
222 NDR_PRINT_OUT_DEBUG(NetGetJoinableOUs
, &r
);
226 return (NET_API_STATUS
)r
.out
.result
;
229 /****************************************************************
230 NetRenameMachineInDomain
231 ****************************************************************/
233 NET_API_STATUS
NetRenameMachineInDomain(const char * server_name
/* [in] */,
234 const char * new_machine_name
/* [in] */,
235 const char * account
/* [in] */,
236 const char * password
/* [in] */,
237 uint32_t rename_options
/* [in] */)
239 struct NetRenameMachineInDomain r
;
240 struct libnetapi_ctx
*ctx
= NULL
;
241 NET_API_STATUS status
;
243 TALLOC_CTX
*frame
= talloc_stackframe();
245 status
= libnetapi_getctx(&ctx
);
252 r
.in
.server_name
= server_name
;
253 r
.in
.new_machine_name
= new_machine_name
;
254 r
.in
.account
= account
;
255 r
.in
.password
= password
;
256 r
.in
.rename_options
= rename_options
;
260 if (DEBUGLEVEL
>= 10) {
261 NDR_PRINT_IN_DEBUG(NetRenameMachineInDomain
, &r
);
264 if (LIBNETAPI_LOCAL_SERVER(server_name
)) {
265 werr
= NetRenameMachineInDomain_l(ctx
, &r
);
267 werr
= NetRenameMachineInDomain_r(ctx
, &r
);
270 r
.out
.result
= W_ERROR_V(werr
);
272 if (DEBUGLEVEL
>= 10) {
273 NDR_PRINT_OUT_DEBUG(NetRenameMachineInDomain
, &r
);
277 return (NET_API_STATUS
)r
.out
.result
;
280 /****************************************************************
282 ****************************************************************/
284 NET_API_STATUS
NetServerGetInfo(const char * server_name
/* [in] [unique] */,
285 uint32_t level
/* [in] */,
286 uint8_t **buffer
/* [out] [ref] */)
288 struct NetServerGetInfo r
;
289 struct libnetapi_ctx
*ctx
= NULL
;
290 NET_API_STATUS status
;
292 TALLOC_CTX
*frame
= talloc_stackframe();
294 status
= libnetapi_getctx(&ctx
);
301 r
.in
.server_name
= server_name
;
305 r
.out
.buffer
= buffer
;
307 if (DEBUGLEVEL
>= 10) {
308 NDR_PRINT_IN_DEBUG(NetServerGetInfo
, &r
);
311 if (LIBNETAPI_LOCAL_SERVER(server_name
)) {
312 werr
= NetServerGetInfo_l(ctx
, &r
);
314 werr
= NetServerGetInfo_r(ctx
, &r
);
317 r
.out
.result
= W_ERROR_V(werr
);
319 if (DEBUGLEVEL
>= 10) {
320 NDR_PRINT_OUT_DEBUG(NetServerGetInfo
, &r
);
324 return (NET_API_STATUS
)r
.out
.result
;
327 /****************************************************************
329 ****************************************************************/
331 NET_API_STATUS
NetServerSetInfo(const char * server_name
/* [in] [unique] */,
332 uint32_t level
/* [in] */,
333 uint8_t *buffer
/* [in] [ref] */,
334 uint32_t *parm_error
/* [out] [ref] */)
336 struct NetServerSetInfo r
;
337 struct libnetapi_ctx
*ctx
= NULL
;
338 NET_API_STATUS status
;
340 TALLOC_CTX
*frame
= talloc_stackframe();
342 status
= libnetapi_getctx(&ctx
);
349 r
.in
.server_name
= server_name
;
351 r
.in
.buffer
= buffer
;
354 r
.out
.parm_error
= parm_error
;
356 if (DEBUGLEVEL
>= 10) {
357 NDR_PRINT_IN_DEBUG(NetServerSetInfo
, &r
);
360 if (LIBNETAPI_LOCAL_SERVER(server_name
)) {
361 werr
= NetServerSetInfo_l(ctx
, &r
);
363 werr
= NetServerSetInfo_r(ctx
, &r
);
366 r
.out
.result
= W_ERROR_V(werr
);
368 if (DEBUGLEVEL
>= 10) {
369 NDR_PRINT_OUT_DEBUG(NetServerSetInfo
, &r
);
373 return (NET_API_STATUS
)r
.out
.result
;
376 /****************************************************************
378 ****************************************************************/
380 NET_API_STATUS
NetGetDCName(const char * server_name
/* [in] [unique] */,
381 const char * domain_name
/* [in] [unique] */,
382 uint8_t **buffer
/* [out] [ref] */)
384 struct NetGetDCName r
;
385 struct libnetapi_ctx
*ctx
= NULL
;
386 NET_API_STATUS status
;
388 TALLOC_CTX
*frame
= talloc_stackframe();
390 status
= libnetapi_getctx(&ctx
);
397 r
.in
.server_name
= server_name
;
398 r
.in
.domain_name
= domain_name
;
401 r
.out
.buffer
= buffer
;
403 if (DEBUGLEVEL
>= 10) {
404 NDR_PRINT_IN_DEBUG(NetGetDCName
, &r
);
407 if (LIBNETAPI_LOCAL_SERVER(server_name
)) {
408 werr
= NetGetDCName_l(ctx
, &r
);
410 werr
= NetGetDCName_r(ctx
, &r
);
413 r
.out
.result
= W_ERROR_V(werr
);
415 if (DEBUGLEVEL
>= 10) {
416 NDR_PRINT_OUT_DEBUG(NetGetDCName
, &r
);
420 return (NET_API_STATUS
)r
.out
.result
;
423 /****************************************************************
425 ****************************************************************/
427 NET_API_STATUS
NetGetAnyDCName(const char * server_name
/* [in] [unique] */,
428 const char * domain_name
/* [in] [unique] */,
429 uint8_t **buffer
/* [out] [ref] */)
431 struct NetGetAnyDCName r
;
432 struct libnetapi_ctx
*ctx
= NULL
;
433 NET_API_STATUS status
;
435 TALLOC_CTX
*frame
= talloc_stackframe();
437 status
= libnetapi_getctx(&ctx
);
444 r
.in
.server_name
= server_name
;
445 r
.in
.domain_name
= domain_name
;
448 r
.out
.buffer
= buffer
;
450 if (DEBUGLEVEL
>= 10) {
451 NDR_PRINT_IN_DEBUG(NetGetAnyDCName
, &r
);
454 if (LIBNETAPI_LOCAL_SERVER(server_name
)) {
455 werr
= NetGetAnyDCName_l(ctx
, &r
);
457 werr
= NetGetAnyDCName_r(ctx
, &r
);
460 r
.out
.result
= W_ERROR_V(werr
);
462 if (DEBUGLEVEL
>= 10) {
463 NDR_PRINT_OUT_DEBUG(NetGetAnyDCName
, &r
);
467 return (NET_API_STATUS
)r
.out
.result
;
470 /****************************************************************
472 ****************************************************************/
474 NET_API_STATUS
DsGetDcName(const char * server_name
/* [in] [unique] */,
475 const char * domain_name
/* [in] [ref] */,
476 struct GUID
*domain_guid
/* [in] [unique] */,
477 const char * site_name
/* [in] [unique] */,
478 uint32_t flags
/* [in] */,
479 struct DOMAIN_CONTROLLER_INFO
**dc_info
/* [out] [ref] */)
481 struct DsGetDcName r
;
482 struct libnetapi_ctx
*ctx
= NULL
;
483 NET_API_STATUS status
;
485 TALLOC_CTX
*frame
= talloc_stackframe();
487 status
= libnetapi_getctx(&ctx
);
494 r
.in
.server_name
= server_name
;
495 r
.in
.domain_name
= domain_name
;
496 r
.in
.domain_guid
= domain_guid
;
497 r
.in
.site_name
= site_name
;
501 r
.out
.dc_info
= dc_info
;
503 if (DEBUGLEVEL
>= 10) {
504 NDR_PRINT_IN_DEBUG(DsGetDcName
, &r
);
507 if (LIBNETAPI_LOCAL_SERVER(server_name
)) {
508 werr
= DsGetDcName_l(ctx
, &r
);
510 werr
= DsGetDcName_r(ctx
, &r
);
513 r
.out
.result
= W_ERROR_V(werr
);
515 if (DEBUGLEVEL
>= 10) {
516 NDR_PRINT_OUT_DEBUG(DsGetDcName
, &r
);
520 return (NET_API_STATUS
)r
.out
.result
;
523 /****************************************************************
525 ****************************************************************/
527 NET_API_STATUS
NetUserAdd(const char * server_name
/* [in] [unique] */,
528 uint32_t level
/* [in] */,
529 uint8_t *buffer
/* [in] [ref] */,
530 uint32_t *parm_error
/* [out] [ref] */)
533 struct libnetapi_ctx
*ctx
= NULL
;
534 NET_API_STATUS status
;
536 TALLOC_CTX
*frame
= talloc_stackframe();
538 status
= libnetapi_getctx(&ctx
);
545 r
.in
.server_name
= server_name
;
547 r
.in
.buffer
= buffer
;
550 r
.out
.parm_error
= parm_error
;
552 if (DEBUGLEVEL
>= 10) {
553 NDR_PRINT_IN_DEBUG(NetUserAdd
, &r
);
556 if (LIBNETAPI_LOCAL_SERVER(server_name
)) {
557 werr
= NetUserAdd_l(ctx
, &r
);
559 werr
= NetUserAdd_r(ctx
, &r
);
562 r
.out
.result
= W_ERROR_V(werr
);
564 if (DEBUGLEVEL
>= 10) {
565 NDR_PRINT_OUT_DEBUG(NetUserAdd
, &r
);
569 return (NET_API_STATUS
)r
.out
.result
;
572 /****************************************************************
574 ****************************************************************/
576 NET_API_STATUS
NetUserDel(const char * server_name
/* [in] [unique] */,
577 const char * user_name
/* [in] [ref] */)
580 struct libnetapi_ctx
*ctx
= NULL
;
581 NET_API_STATUS status
;
583 TALLOC_CTX
*frame
= talloc_stackframe();
585 status
= libnetapi_getctx(&ctx
);
592 r
.in
.server_name
= server_name
;
593 r
.in
.user_name
= user_name
;
597 if (DEBUGLEVEL
>= 10) {
598 NDR_PRINT_IN_DEBUG(NetUserDel
, &r
);
601 if (LIBNETAPI_LOCAL_SERVER(server_name
)) {
602 werr
= NetUserDel_l(ctx
, &r
);
604 werr
= NetUserDel_r(ctx
, &r
);
607 r
.out
.result
= W_ERROR_V(werr
);
609 if (DEBUGLEVEL
>= 10) {
610 NDR_PRINT_OUT_DEBUG(NetUserDel
, &r
);
614 return (NET_API_STATUS
)r
.out
.result
;
617 /****************************************************************
619 ****************************************************************/
621 NET_API_STATUS
NetUserEnum(const char * server_name
/* [in] [unique] */,
622 uint32_t level
/* [in] */,
623 uint32_t filter
/* [in] */,
624 uint8_t **buffer
/* [out] [ref] */,
625 uint32_t prefmaxlen
/* [in] */,
626 uint32_t *entries_read
/* [out] [ref] */,
627 uint32_t *total_entries
/* [out] [ref] */,
628 uint32_t *resume_handle
/* [in,out] [ref] */)
630 struct NetUserEnum r
;
631 struct libnetapi_ctx
*ctx
= NULL
;
632 NET_API_STATUS status
;
634 TALLOC_CTX
*frame
= talloc_stackframe();
636 status
= libnetapi_getctx(&ctx
);
643 r
.in
.server_name
= server_name
;
645 r
.in
.filter
= filter
;
646 r
.in
.prefmaxlen
= prefmaxlen
;
647 r
.in
.resume_handle
= resume_handle
;
650 r
.out
.buffer
= buffer
;
651 r
.out
.entries_read
= entries_read
;
652 r
.out
.total_entries
= total_entries
;
653 r
.out
.resume_handle
= resume_handle
;
655 if (DEBUGLEVEL
>= 10) {
656 NDR_PRINT_IN_DEBUG(NetUserEnum
, &r
);
659 if (LIBNETAPI_LOCAL_SERVER(server_name
)) {
660 werr
= NetUserEnum_l(ctx
, &r
);
662 werr
= NetUserEnum_r(ctx
, &r
);
665 r
.out
.result
= W_ERROR_V(werr
);
667 if (DEBUGLEVEL
>= 10) {
668 NDR_PRINT_OUT_DEBUG(NetUserEnum
, &r
);
672 return (NET_API_STATUS
)r
.out
.result
;
675 /****************************************************************
676 NetUserChangePassword
677 ****************************************************************/
679 NET_API_STATUS
NetUserChangePassword(const char * domain_name
/* [in] */,
680 const char * user_name
/* [in] */,
681 const char * old_password
/* [in] */,
682 const char * new_password
/* [in] */)
684 struct NetUserChangePassword r
;
685 struct libnetapi_ctx
*ctx
= NULL
;
686 NET_API_STATUS status
;
688 TALLOC_CTX
*frame
= talloc_stackframe();
690 status
= libnetapi_getctx(&ctx
);
697 r
.in
.domain_name
= domain_name
;
698 r
.in
.user_name
= user_name
;
699 r
.in
.old_password
= old_password
;
700 r
.in
.new_password
= new_password
;
704 if (DEBUGLEVEL
>= 10) {
705 NDR_PRINT_IN_DEBUG(NetUserChangePassword
, &r
);
708 if (LIBNETAPI_LOCAL_SERVER(domain_name
)) {
709 werr
= NetUserChangePassword_l(ctx
, &r
);
711 werr
= NetUserChangePassword_r(ctx
, &r
);
714 r
.out
.result
= W_ERROR_V(werr
);
716 if (DEBUGLEVEL
>= 10) {
717 NDR_PRINT_OUT_DEBUG(NetUserChangePassword
, &r
);
721 return (NET_API_STATUS
)r
.out
.result
;
724 /****************************************************************
726 ****************************************************************/
728 NET_API_STATUS
NetUserGetInfo(const char * server_name
/* [in] */,
729 const char * user_name
/* [in] */,
730 uint32_t level
/* [in] */,
731 uint8_t **buffer
/* [out] [ref] */)
733 struct NetUserGetInfo r
;
734 struct libnetapi_ctx
*ctx
= NULL
;
735 NET_API_STATUS status
;
737 TALLOC_CTX
*frame
= talloc_stackframe();
739 status
= libnetapi_getctx(&ctx
);
746 r
.in
.server_name
= server_name
;
747 r
.in
.user_name
= user_name
;
751 r
.out
.buffer
= buffer
;
753 if (DEBUGLEVEL
>= 10) {
754 NDR_PRINT_IN_DEBUG(NetUserGetInfo
, &r
);
757 if (LIBNETAPI_LOCAL_SERVER(server_name
)) {
758 werr
= NetUserGetInfo_l(ctx
, &r
);
760 werr
= NetUserGetInfo_r(ctx
, &r
);
763 r
.out
.result
= W_ERROR_V(werr
);
765 if (DEBUGLEVEL
>= 10) {
766 NDR_PRINT_OUT_DEBUG(NetUserGetInfo
, &r
);
770 return (NET_API_STATUS
)r
.out
.result
;
773 /****************************************************************
775 ****************************************************************/
777 NET_API_STATUS
NetUserSetInfo(const char * server_name
/* [in] */,
778 const char * user_name
/* [in] */,
779 uint32_t level
/* [in] */,
780 uint8_t *buffer
/* [in] [ref] */,
781 uint32_t *parm_err
/* [out] [ref] */)
783 struct NetUserSetInfo r
;
784 struct libnetapi_ctx
*ctx
= NULL
;
785 NET_API_STATUS status
;
787 TALLOC_CTX
*frame
= talloc_stackframe();
789 status
= libnetapi_getctx(&ctx
);
796 r
.in
.server_name
= server_name
;
797 r
.in
.user_name
= user_name
;
799 r
.in
.buffer
= buffer
;
802 r
.out
.parm_err
= parm_err
;
804 if (DEBUGLEVEL
>= 10) {
805 NDR_PRINT_IN_DEBUG(NetUserSetInfo
, &r
);
808 if (LIBNETAPI_LOCAL_SERVER(server_name
)) {
809 werr
= NetUserSetInfo_l(ctx
, &r
);
811 werr
= NetUserSetInfo_r(ctx
, &r
);
814 r
.out
.result
= W_ERROR_V(werr
);
816 if (DEBUGLEVEL
>= 10) {
817 NDR_PRINT_OUT_DEBUG(NetUserSetInfo
, &r
);
821 return (NET_API_STATUS
)r
.out
.result
;
824 /****************************************************************
826 ****************************************************************/
828 NET_API_STATUS
NetUserGetGroups(const char * server_name
/* [in] */,
829 const char * user_name
/* [in] */,
830 uint32_t level
/* [in] */,
831 uint8_t **buffer
/* [out] [ref] */,
832 uint32_t prefmaxlen
/* [in] */,
833 uint32_t *entries_read
/* [out] [ref] */,
834 uint32_t *total_entries
/* [out] [ref] */)
836 struct NetUserGetGroups r
;
837 struct libnetapi_ctx
*ctx
= NULL
;
838 NET_API_STATUS status
;
840 TALLOC_CTX
*frame
= talloc_stackframe();
842 status
= libnetapi_getctx(&ctx
);
849 r
.in
.server_name
= server_name
;
850 r
.in
.user_name
= user_name
;
852 r
.in
.prefmaxlen
= prefmaxlen
;
855 r
.out
.buffer
= buffer
;
856 r
.out
.entries_read
= entries_read
;
857 r
.out
.total_entries
= total_entries
;
859 if (DEBUGLEVEL
>= 10) {
860 NDR_PRINT_IN_DEBUG(NetUserGetGroups
, &r
);
863 if (LIBNETAPI_LOCAL_SERVER(server_name
)) {
864 werr
= NetUserGetGroups_l(ctx
, &r
);
866 werr
= NetUserGetGroups_r(ctx
, &r
);
869 r
.out
.result
= W_ERROR_V(werr
);
871 if (DEBUGLEVEL
>= 10) {
872 NDR_PRINT_OUT_DEBUG(NetUserGetGroups
, &r
);
876 return (NET_API_STATUS
)r
.out
.result
;
879 /****************************************************************
881 ****************************************************************/
883 NET_API_STATUS
NetUserSetGroups(const char * server_name
/* [in] */,
884 const char * user_name
/* [in] */,
885 uint32_t level
/* [in] */,
886 uint8_t *buffer
/* [in] [ref] */,
887 uint32_t num_entries
/* [in] */)
889 struct NetUserSetGroups r
;
890 struct libnetapi_ctx
*ctx
= NULL
;
891 NET_API_STATUS status
;
893 TALLOC_CTX
*frame
= talloc_stackframe();
895 status
= libnetapi_getctx(&ctx
);
902 r
.in
.server_name
= server_name
;
903 r
.in
.user_name
= user_name
;
905 r
.in
.buffer
= buffer
;
906 r
.in
.num_entries
= num_entries
;
910 if (DEBUGLEVEL
>= 10) {
911 NDR_PRINT_IN_DEBUG(NetUserSetGroups
, &r
);
914 if (LIBNETAPI_LOCAL_SERVER(server_name
)) {
915 werr
= NetUserSetGroups_l(ctx
, &r
);
917 werr
= NetUserSetGroups_r(ctx
, &r
);
920 r
.out
.result
= W_ERROR_V(werr
);
922 if (DEBUGLEVEL
>= 10) {
923 NDR_PRINT_OUT_DEBUG(NetUserSetGroups
, &r
);
927 return (NET_API_STATUS
)r
.out
.result
;
930 /****************************************************************
931 NetUserGetLocalGroups
932 ****************************************************************/
934 NET_API_STATUS
NetUserGetLocalGroups(const char * server_name
/* [in] */,
935 const char * user_name
/* [in] */,
936 uint32_t level
/* [in] */,
937 uint32_t flags
/* [in] */,
938 uint8_t **buffer
/* [out] [ref] */,
939 uint32_t prefmaxlen
/* [in] */,
940 uint32_t *entries_read
/* [out] [ref] */,
941 uint32_t *total_entries
/* [out] [ref] */)
943 struct NetUserGetLocalGroups r
;
944 struct libnetapi_ctx
*ctx
= NULL
;
945 NET_API_STATUS status
;
947 TALLOC_CTX
*frame
= talloc_stackframe();
949 status
= libnetapi_getctx(&ctx
);
956 r
.in
.server_name
= server_name
;
957 r
.in
.user_name
= user_name
;
960 r
.in
.prefmaxlen
= prefmaxlen
;
963 r
.out
.buffer
= buffer
;
964 r
.out
.entries_read
= entries_read
;
965 r
.out
.total_entries
= total_entries
;
967 if (DEBUGLEVEL
>= 10) {
968 NDR_PRINT_IN_DEBUG(NetUserGetLocalGroups
, &r
);
971 if (LIBNETAPI_LOCAL_SERVER(server_name
)) {
972 werr
= NetUserGetLocalGroups_l(ctx
, &r
);
974 werr
= NetUserGetLocalGroups_r(ctx
, &r
);
977 r
.out
.result
= W_ERROR_V(werr
);
979 if (DEBUGLEVEL
>= 10) {
980 NDR_PRINT_OUT_DEBUG(NetUserGetLocalGroups
, &r
);
984 return (NET_API_STATUS
)r
.out
.result
;
987 /****************************************************************
989 ****************************************************************/
991 NET_API_STATUS
NetUserModalsGet(const char * server_name
/* [in] */,
992 uint32_t level
/* [in] */,
993 uint8_t **buffer
/* [out] [ref] */)
995 struct NetUserModalsGet r
;
996 struct libnetapi_ctx
*ctx
= NULL
;
997 NET_API_STATUS status
;
999 TALLOC_CTX
*frame
= talloc_stackframe();
1001 status
= libnetapi_getctx(&ctx
);
1008 r
.in
.server_name
= server_name
;
1011 /* Out parameters */
1012 r
.out
.buffer
= buffer
;
1014 if (DEBUGLEVEL
>= 10) {
1015 NDR_PRINT_IN_DEBUG(NetUserModalsGet
, &r
);
1018 if (LIBNETAPI_LOCAL_SERVER(server_name
)) {
1019 werr
= NetUserModalsGet_l(ctx
, &r
);
1021 werr
= NetUserModalsGet_r(ctx
, &r
);
1024 r
.out
.result
= W_ERROR_V(werr
);
1026 if (DEBUGLEVEL
>= 10) {
1027 NDR_PRINT_OUT_DEBUG(NetUserModalsGet
, &r
);
1031 return (NET_API_STATUS
)r
.out
.result
;
1034 /****************************************************************
1036 ****************************************************************/
1038 NET_API_STATUS
NetUserModalsSet(const char * server_name
/* [in] */,
1039 uint32_t level
/* [in] */,
1040 uint8_t *buffer
/* [in] [ref] */,
1041 uint32_t *parm_err
/* [out] [ref] */)
1043 struct NetUserModalsSet r
;
1044 struct libnetapi_ctx
*ctx
= NULL
;
1045 NET_API_STATUS status
;
1047 TALLOC_CTX
*frame
= talloc_stackframe();
1049 status
= libnetapi_getctx(&ctx
);
1056 r
.in
.server_name
= server_name
;
1058 r
.in
.buffer
= buffer
;
1060 /* Out parameters */
1061 r
.out
.parm_err
= parm_err
;
1063 if (DEBUGLEVEL
>= 10) {
1064 NDR_PRINT_IN_DEBUG(NetUserModalsSet
, &r
);
1067 if (LIBNETAPI_LOCAL_SERVER(server_name
)) {
1068 werr
= NetUserModalsSet_l(ctx
, &r
);
1070 werr
= NetUserModalsSet_r(ctx
, &r
);
1073 r
.out
.result
= W_ERROR_V(werr
);
1075 if (DEBUGLEVEL
>= 10) {
1076 NDR_PRINT_OUT_DEBUG(NetUserModalsSet
, &r
);
1080 return (NET_API_STATUS
)r
.out
.result
;
1083 /****************************************************************
1084 NetQueryDisplayInformation
1085 ****************************************************************/
1087 NET_API_STATUS
NetQueryDisplayInformation(const char * server_name
/* [in] [unique] */,
1088 uint32_t level
/* [in] */,
1089 uint32_t idx
/* [in] */,
1090 uint32_t entries_requested
/* [in] */,
1091 uint32_t prefmaxlen
/* [in] */,
1092 uint32_t *entries_read
/* [out] [ref] */,
1093 void **buffer
/* [out] [noprint,ref] */)
1095 struct NetQueryDisplayInformation r
;
1096 struct libnetapi_ctx
*ctx
= NULL
;
1097 NET_API_STATUS status
;
1099 TALLOC_CTX
*frame
= talloc_stackframe();
1101 status
= libnetapi_getctx(&ctx
);
1108 r
.in
.server_name
= server_name
;
1111 r
.in
.entries_requested
= entries_requested
;
1112 r
.in
.prefmaxlen
= prefmaxlen
;
1114 /* Out parameters */
1115 r
.out
.entries_read
= entries_read
;
1116 r
.out
.buffer
= buffer
;
1118 if (DEBUGLEVEL
>= 10) {
1119 NDR_PRINT_IN_DEBUG(NetQueryDisplayInformation
, &r
);
1122 if (LIBNETAPI_LOCAL_SERVER(server_name
)) {
1123 werr
= NetQueryDisplayInformation_l(ctx
, &r
);
1125 werr
= NetQueryDisplayInformation_r(ctx
, &r
);
1128 r
.out
.result
= W_ERROR_V(werr
);
1130 if (DEBUGLEVEL
>= 10) {
1131 NDR_PRINT_OUT_DEBUG(NetQueryDisplayInformation
, &r
);
1135 return (NET_API_STATUS
)r
.out
.result
;
1138 /****************************************************************
1140 ****************************************************************/
1142 NET_API_STATUS
NetGroupAdd(const char * server_name
/* [in] */,
1143 uint32_t level
/* [in] */,
1144 uint8_t *buffer
/* [in] [ref] */,
1145 uint32_t *parm_err
/* [out] [ref] */)
1147 struct NetGroupAdd r
;
1148 struct libnetapi_ctx
*ctx
= NULL
;
1149 NET_API_STATUS status
;
1151 TALLOC_CTX
*frame
= talloc_stackframe();
1153 status
= libnetapi_getctx(&ctx
);
1160 r
.in
.server_name
= server_name
;
1162 r
.in
.buffer
= buffer
;
1164 /* Out parameters */
1165 r
.out
.parm_err
= parm_err
;
1167 if (DEBUGLEVEL
>= 10) {
1168 NDR_PRINT_IN_DEBUG(NetGroupAdd
, &r
);
1171 if (LIBNETAPI_LOCAL_SERVER(server_name
)) {
1172 werr
= NetGroupAdd_l(ctx
, &r
);
1174 werr
= NetGroupAdd_r(ctx
, &r
);
1177 r
.out
.result
= W_ERROR_V(werr
);
1179 if (DEBUGLEVEL
>= 10) {
1180 NDR_PRINT_OUT_DEBUG(NetGroupAdd
, &r
);
1184 return (NET_API_STATUS
)r
.out
.result
;
1187 /****************************************************************
1189 ****************************************************************/
1191 NET_API_STATUS
NetGroupDel(const char * server_name
/* [in] */,
1192 const char * group_name
/* [in] */)
1194 struct NetGroupDel r
;
1195 struct libnetapi_ctx
*ctx
= NULL
;
1196 NET_API_STATUS status
;
1198 TALLOC_CTX
*frame
= talloc_stackframe();
1200 status
= libnetapi_getctx(&ctx
);
1207 r
.in
.server_name
= server_name
;
1208 r
.in
.group_name
= group_name
;
1210 /* Out parameters */
1212 if (DEBUGLEVEL
>= 10) {
1213 NDR_PRINT_IN_DEBUG(NetGroupDel
, &r
);
1216 if (LIBNETAPI_LOCAL_SERVER(server_name
)) {
1217 werr
= NetGroupDel_l(ctx
, &r
);
1219 werr
= NetGroupDel_r(ctx
, &r
);
1222 r
.out
.result
= W_ERROR_V(werr
);
1224 if (DEBUGLEVEL
>= 10) {
1225 NDR_PRINT_OUT_DEBUG(NetGroupDel
, &r
);
1229 return (NET_API_STATUS
)r
.out
.result
;
1232 /****************************************************************
1234 ****************************************************************/
1236 NET_API_STATUS
NetGroupEnum(const char * server_name
/* [in] */,
1237 uint32_t level
/* [in] */,
1238 uint8_t **buffer
/* [out] [ref] */,
1239 uint32_t prefmaxlen
/* [in] */,
1240 uint32_t *entries_read
/* [out] [ref] */,
1241 uint32_t *total_entries
/* [out] [ref] */,
1242 uint32_t *resume_handle
/* [in,out] [ref] */)
1244 struct NetGroupEnum r
;
1245 struct libnetapi_ctx
*ctx
= NULL
;
1246 NET_API_STATUS status
;
1248 TALLOC_CTX
*frame
= talloc_stackframe();
1250 status
= libnetapi_getctx(&ctx
);
1257 r
.in
.server_name
= server_name
;
1259 r
.in
.prefmaxlen
= prefmaxlen
;
1260 r
.in
.resume_handle
= resume_handle
;
1262 /* Out parameters */
1263 r
.out
.buffer
= buffer
;
1264 r
.out
.entries_read
= entries_read
;
1265 r
.out
.total_entries
= total_entries
;
1266 r
.out
.resume_handle
= resume_handle
;
1268 if (DEBUGLEVEL
>= 10) {
1269 NDR_PRINT_IN_DEBUG(NetGroupEnum
, &r
);
1272 if (LIBNETAPI_LOCAL_SERVER(server_name
)) {
1273 werr
= NetGroupEnum_l(ctx
, &r
);
1275 werr
= NetGroupEnum_r(ctx
, &r
);
1278 r
.out
.result
= W_ERROR_V(werr
);
1280 if (DEBUGLEVEL
>= 10) {
1281 NDR_PRINT_OUT_DEBUG(NetGroupEnum
, &r
);
1285 return (NET_API_STATUS
)r
.out
.result
;
1288 /****************************************************************
1290 ****************************************************************/
1292 NET_API_STATUS
NetGroupSetInfo(const char * server_name
/* [in] */,
1293 const char * group_name
/* [in] */,
1294 uint32_t level
/* [in] */,
1295 uint8_t *buffer
/* [in] [ref] */,
1296 uint32_t *parm_err
/* [out] [ref] */)
1298 struct NetGroupSetInfo r
;
1299 struct libnetapi_ctx
*ctx
= NULL
;
1300 NET_API_STATUS status
;
1302 TALLOC_CTX
*frame
= talloc_stackframe();
1304 status
= libnetapi_getctx(&ctx
);
1311 r
.in
.server_name
= server_name
;
1312 r
.in
.group_name
= group_name
;
1314 r
.in
.buffer
= buffer
;
1316 /* Out parameters */
1317 r
.out
.parm_err
= parm_err
;
1319 if (DEBUGLEVEL
>= 10) {
1320 NDR_PRINT_IN_DEBUG(NetGroupSetInfo
, &r
);
1323 if (LIBNETAPI_LOCAL_SERVER(server_name
)) {
1324 werr
= NetGroupSetInfo_l(ctx
, &r
);
1326 werr
= NetGroupSetInfo_r(ctx
, &r
);
1329 r
.out
.result
= W_ERROR_V(werr
);
1331 if (DEBUGLEVEL
>= 10) {
1332 NDR_PRINT_OUT_DEBUG(NetGroupSetInfo
, &r
);
1336 return (NET_API_STATUS
)r
.out
.result
;
1339 /****************************************************************
1341 ****************************************************************/
1343 NET_API_STATUS
NetGroupGetInfo(const char * server_name
/* [in] */,
1344 const char * group_name
/* [in] */,
1345 uint32_t level
/* [in] */,
1346 uint8_t **buffer
/* [out] [ref] */)
1348 struct NetGroupGetInfo r
;
1349 struct libnetapi_ctx
*ctx
= NULL
;
1350 NET_API_STATUS status
;
1352 TALLOC_CTX
*frame
= talloc_stackframe();
1354 status
= libnetapi_getctx(&ctx
);
1361 r
.in
.server_name
= server_name
;
1362 r
.in
.group_name
= group_name
;
1365 /* Out parameters */
1366 r
.out
.buffer
= buffer
;
1368 if (DEBUGLEVEL
>= 10) {
1369 NDR_PRINT_IN_DEBUG(NetGroupGetInfo
, &r
);
1372 if (LIBNETAPI_LOCAL_SERVER(server_name
)) {
1373 werr
= NetGroupGetInfo_l(ctx
, &r
);
1375 werr
= NetGroupGetInfo_r(ctx
, &r
);
1378 r
.out
.result
= W_ERROR_V(werr
);
1380 if (DEBUGLEVEL
>= 10) {
1381 NDR_PRINT_OUT_DEBUG(NetGroupGetInfo
, &r
);
1385 return (NET_API_STATUS
)r
.out
.result
;
1388 /****************************************************************
1390 ****************************************************************/
1392 NET_API_STATUS
NetGroupAddUser(const char * server_name
/* [in] */,
1393 const char * group_name
/* [in] */,
1394 const char * user_name
/* [in] */)
1396 struct NetGroupAddUser r
;
1397 struct libnetapi_ctx
*ctx
= NULL
;
1398 NET_API_STATUS status
;
1400 TALLOC_CTX
*frame
= talloc_stackframe();
1402 status
= libnetapi_getctx(&ctx
);
1409 r
.in
.server_name
= server_name
;
1410 r
.in
.group_name
= group_name
;
1411 r
.in
.user_name
= user_name
;
1413 /* Out parameters */
1415 if (DEBUGLEVEL
>= 10) {
1416 NDR_PRINT_IN_DEBUG(NetGroupAddUser
, &r
);
1419 if (LIBNETAPI_LOCAL_SERVER(server_name
)) {
1420 werr
= NetGroupAddUser_l(ctx
, &r
);
1422 werr
= NetGroupAddUser_r(ctx
, &r
);
1425 r
.out
.result
= W_ERROR_V(werr
);
1427 if (DEBUGLEVEL
>= 10) {
1428 NDR_PRINT_OUT_DEBUG(NetGroupAddUser
, &r
);
1432 return (NET_API_STATUS
)r
.out
.result
;
1435 /****************************************************************
1437 ****************************************************************/
1439 NET_API_STATUS
NetGroupDelUser(const char * server_name
/* [in] */,
1440 const char * group_name
/* [in] */,
1441 const char * user_name
/* [in] */)
1443 struct NetGroupDelUser r
;
1444 struct libnetapi_ctx
*ctx
= NULL
;
1445 NET_API_STATUS status
;
1447 TALLOC_CTX
*frame
= talloc_stackframe();
1449 status
= libnetapi_getctx(&ctx
);
1456 r
.in
.server_name
= server_name
;
1457 r
.in
.group_name
= group_name
;
1458 r
.in
.user_name
= user_name
;
1460 /* Out parameters */
1462 if (DEBUGLEVEL
>= 10) {
1463 NDR_PRINT_IN_DEBUG(NetGroupDelUser
, &r
);
1466 if (LIBNETAPI_LOCAL_SERVER(server_name
)) {
1467 werr
= NetGroupDelUser_l(ctx
, &r
);
1469 werr
= NetGroupDelUser_r(ctx
, &r
);
1472 r
.out
.result
= W_ERROR_V(werr
);
1474 if (DEBUGLEVEL
>= 10) {
1475 NDR_PRINT_OUT_DEBUG(NetGroupDelUser
, &r
);
1479 return (NET_API_STATUS
)r
.out
.result
;
1482 /****************************************************************
1484 ****************************************************************/
1486 NET_API_STATUS
NetGroupGetUsers(const char * server_name
/* [in] */,
1487 const char * group_name
/* [in] */,
1488 uint32_t level
/* [in] */,
1489 uint8_t **buffer
/* [out] [ref] */,
1490 uint32_t prefmaxlen
/* [in] */,
1491 uint32_t *entries_read
/* [out] [ref] */,
1492 uint32_t *total_entries
/* [out] [ref] */,
1493 uint32_t *resume_handle
/* [in,out] [ref] */)
1495 struct NetGroupGetUsers r
;
1496 struct libnetapi_ctx
*ctx
= NULL
;
1497 NET_API_STATUS status
;
1499 TALLOC_CTX
*frame
= talloc_stackframe();
1501 status
= libnetapi_getctx(&ctx
);
1508 r
.in
.server_name
= server_name
;
1509 r
.in
.group_name
= group_name
;
1511 r
.in
.prefmaxlen
= prefmaxlen
;
1512 r
.in
.resume_handle
= resume_handle
;
1514 /* Out parameters */
1515 r
.out
.buffer
= buffer
;
1516 r
.out
.entries_read
= entries_read
;
1517 r
.out
.total_entries
= total_entries
;
1518 r
.out
.resume_handle
= resume_handle
;
1520 if (DEBUGLEVEL
>= 10) {
1521 NDR_PRINT_IN_DEBUG(NetGroupGetUsers
, &r
);
1524 if (LIBNETAPI_LOCAL_SERVER(server_name
)) {
1525 werr
= NetGroupGetUsers_l(ctx
, &r
);
1527 werr
= NetGroupGetUsers_r(ctx
, &r
);
1530 r
.out
.result
= W_ERROR_V(werr
);
1532 if (DEBUGLEVEL
>= 10) {
1533 NDR_PRINT_OUT_DEBUG(NetGroupGetUsers
, &r
);
1537 return (NET_API_STATUS
)r
.out
.result
;
1540 /****************************************************************
1542 ****************************************************************/
1544 NET_API_STATUS
NetGroupSetUsers(const char * server_name
/* [in] */,
1545 const char * group_name
/* [in] */,
1546 uint32_t level
/* [in] */,
1547 uint8_t *buffer
/* [in] [ref] */,
1548 uint32_t num_entries
/* [in] */)
1550 struct NetGroupSetUsers r
;
1551 struct libnetapi_ctx
*ctx
= NULL
;
1552 NET_API_STATUS status
;
1554 TALLOC_CTX
*frame
= talloc_stackframe();
1556 status
= libnetapi_getctx(&ctx
);
1563 r
.in
.server_name
= server_name
;
1564 r
.in
.group_name
= group_name
;
1566 r
.in
.buffer
= buffer
;
1567 r
.in
.num_entries
= num_entries
;
1569 /* Out parameters */
1571 if (DEBUGLEVEL
>= 10) {
1572 NDR_PRINT_IN_DEBUG(NetGroupSetUsers
, &r
);
1575 if (LIBNETAPI_LOCAL_SERVER(server_name
)) {
1576 werr
= NetGroupSetUsers_l(ctx
, &r
);
1578 werr
= NetGroupSetUsers_r(ctx
, &r
);
1581 r
.out
.result
= W_ERROR_V(werr
);
1583 if (DEBUGLEVEL
>= 10) {
1584 NDR_PRINT_OUT_DEBUG(NetGroupSetUsers
, &r
);
1588 return (NET_API_STATUS
)r
.out
.result
;
1591 /****************************************************************
1593 ****************************************************************/
1595 NET_API_STATUS
NetLocalGroupAdd(const char * server_name
/* [in] */,
1596 uint32_t level
/* [in] */,
1597 uint8_t *buffer
/* [in] [ref] */,
1598 uint32_t *parm_err
/* [out] [ref] */)
1600 struct NetLocalGroupAdd r
;
1601 struct libnetapi_ctx
*ctx
= NULL
;
1602 NET_API_STATUS status
;
1604 TALLOC_CTX
*frame
= talloc_stackframe();
1606 status
= libnetapi_getctx(&ctx
);
1613 r
.in
.server_name
= server_name
;
1615 r
.in
.buffer
= buffer
;
1617 /* Out parameters */
1618 r
.out
.parm_err
= parm_err
;
1620 if (DEBUGLEVEL
>= 10) {
1621 NDR_PRINT_IN_DEBUG(NetLocalGroupAdd
, &r
);
1624 if (LIBNETAPI_LOCAL_SERVER(server_name
)) {
1625 werr
= NetLocalGroupAdd_l(ctx
, &r
);
1627 werr
= NetLocalGroupAdd_r(ctx
, &r
);
1630 r
.out
.result
= W_ERROR_V(werr
);
1632 if (DEBUGLEVEL
>= 10) {
1633 NDR_PRINT_OUT_DEBUG(NetLocalGroupAdd
, &r
);
1637 return (NET_API_STATUS
)r
.out
.result
;
1640 /****************************************************************
1642 ****************************************************************/
1644 NET_API_STATUS
NetLocalGroupDel(const char * server_name
/* [in] */,
1645 const char * group_name
/* [in] */)
1647 struct NetLocalGroupDel r
;
1648 struct libnetapi_ctx
*ctx
= NULL
;
1649 NET_API_STATUS status
;
1651 TALLOC_CTX
*frame
= talloc_stackframe();
1653 status
= libnetapi_getctx(&ctx
);
1660 r
.in
.server_name
= server_name
;
1661 r
.in
.group_name
= group_name
;
1663 /* Out parameters */
1665 if (DEBUGLEVEL
>= 10) {
1666 NDR_PRINT_IN_DEBUG(NetLocalGroupDel
, &r
);
1669 if (LIBNETAPI_LOCAL_SERVER(server_name
)) {
1670 werr
= NetLocalGroupDel_l(ctx
, &r
);
1672 werr
= NetLocalGroupDel_r(ctx
, &r
);
1675 r
.out
.result
= W_ERROR_V(werr
);
1677 if (DEBUGLEVEL
>= 10) {
1678 NDR_PRINT_OUT_DEBUG(NetLocalGroupDel
, &r
);
1682 return (NET_API_STATUS
)r
.out
.result
;
1685 /****************************************************************
1686 NetLocalGroupGetInfo
1687 ****************************************************************/
1689 NET_API_STATUS
NetLocalGroupGetInfo(const char * server_name
/* [in] */,
1690 const char * group_name
/* [in] */,
1691 uint32_t level
/* [in] */,
1692 uint8_t **buffer
/* [out] [ref] */)
1694 struct NetLocalGroupGetInfo r
;
1695 struct libnetapi_ctx
*ctx
= NULL
;
1696 NET_API_STATUS status
;
1698 TALLOC_CTX
*frame
= talloc_stackframe();
1700 status
= libnetapi_getctx(&ctx
);
1707 r
.in
.server_name
= server_name
;
1708 r
.in
.group_name
= group_name
;
1711 /* Out parameters */
1712 r
.out
.buffer
= buffer
;
1714 if (DEBUGLEVEL
>= 10) {
1715 NDR_PRINT_IN_DEBUG(NetLocalGroupGetInfo
, &r
);
1718 if (LIBNETAPI_LOCAL_SERVER(server_name
)) {
1719 werr
= NetLocalGroupGetInfo_l(ctx
, &r
);
1721 werr
= NetLocalGroupGetInfo_r(ctx
, &r
);
1724 r
.out
.result
= W_ERROR_V(werr
);
1726 if (DEBUGLEVEL
>= 10) {
1727 NDR_PRINT_OUT_DEBUG(NetLocalGroupGetInfo
, &r
);
1731 return (NET_API_STATUS
)r
.out
.result
;
1734 /****************************************************************
1735 NetLocalGroupSetInfo
1736 ****************************************************************/
1738 NET_API_STATUS
NetLocalGroupSetInfo(const char * server_name
/* [in] */,
1739 const char * group_name
/* [in] */,
1740 uint32_t level
/* [in] */,
1741 uint8_t *buffer
/* [in] [ref] */,
1742 uint32_t *parm_err
/* [out] [ref] */)
1744 struct NetLocalGroupSetInfo r
;
1745 struct libnetapi_ctx
*ctx
= NULL
;
1746 NET_API_STATUS status
;
1748 TALLOC_CTX
*frame
= talloc_stackframe();
1750 status
= libnetapi_getctx(&ctx
);
1757 r
.in
.server_name
= server_name
;
1758 r
.in
.group_name
= group_name
;
1760 r
.in
.buffer
= buffer
;
1762 /* Out parameters */
1763 r
.out
.parm_err
= parm_err
;
1765 if (DEBUGLEVEL
>= 10) {
1766 NDR_PRINT_IN_DEBUG(NetLocalGroupSetInfo
, &r
);
1769 if (LIBNETAPI_LOCAL_SERVER(server_name
)) {
1770 werr
= NetLocalGroupSetInfo_l(ctx
, &r
);
1772 werr
= NetLocalGroupSetInfo_r(ctx
, &r
);
1775 r
.out
.result
= W_ERROR_V(werr
);
1777 if (DEBUGLEVEL
>= 10) {
1778 NDR_PRINT_OUT_DEBUG(NetLocalGroupSetInfo
, &r
);
1782 return (NET_API_STATUS
)r
.out
.result
;
1785 /****************************************************************
1787 ****************************************************************/
1789 NET_API_STATUS
NetLocalGroupEnum(const char * server_name
/* [in] */,
1790 uint32_t level
/* [in] */,
1791 uint8_t **buffer
/* [out] [ref] */,
1792 uint32_t prefmaxlen
/* [in] */,
1793 uint32_t *entries_read
/* [out] [ref] */,
1794 uint32_t *total_entries
/* [out] [ref] */,
1795 uint32_t *resume_handle
/* [in,out] [ref] */)
1797 struct NetLocalGroupEnum r
;
1798 struct libnetapi_ctx
*ctx
= NULL
;
1799 NET_API_STATUS status
;
1801 TALLOC_CTX
*frame
= talloc_stackframe();
1803 status
= libnetapi_getctx(&ctx
);
1810 r
.in
.server_name
= server_name
;
1812 r
.in
.prefmaxlen
= prefmaxlen
;
1813 r
.in
.resume_handle
= resume_handle
;
1815 /* Out parameters */
1816 r
.out
.buffer
= buffer
;
1817 r
.out
.entries_read
= entries_read
;
1818 r
.out
.total_entries
= total_entries
;
1819 r
.out
.resume_handle
= resume_handle
;
1821 if (DEBUGLEVEL
>= 10) {
1822 NDR_PRINT_IN_DEBUG(NetLocalGroupEnum
, &r
);
1825 if (LIBNETAPI_LOCAL_SERVER(server_name
)) {
1826 werr
= NetLocalGroupEnum_l(ctx
, &r
);
1828 werr
= NetLocalGroupEnum_r(ctx
, &r
);
1831 r
.out
.result
= W_ERROR_V(werr
);
1833 if (DEBUGLEVEL
>= 10) {
1834 NDR_PRINT_OUT_DEBUG(NetLocalGroupEnum
, &r
);
1838 return (NET_API_STATUS
)r
.out
.result
;
1841 /****************************************************************
1842 NetLocalGroupAddMembers
1843 ****************************************************************/
1845 NET_API_STATUS
NetLocalGroupAddMembers(const char * server_name
/* [in] */,
1846 const char * group_name
/* [in] */,
1847 uint32_t level
/* [in] */,
1848 uint8_t *buffer
/* [in] [ref] */,
1849 uint32_t total_entries
/* [in] */)
1851 struct NetLocalGroupAddMembers r
;
1852 struct libnetapi_ctx
*ctx
= NULL
;
1853 NET_API_STATUS status
;
1855 TALLOC_CTX
*frame
= talloc_stackframe();
1857 status
= libnetapi_getctx(&ctx
);
1864 r
.in
.server_name
= server_name
;
1865 r
.in
.group_name
= group_name
;
1867 r
.in
.buffer
= buffer
;
1868 r
.in
.total_entries
= total_entries
;
1870 /* Out parameters */
1872 if (DEBUGLEVEL
>= 10) {
1873 NDR_PRINT_IN_DEBUG(NetLocalGroupAddMembers
, &r
);
1876 if (LIBNETAPI_LOCAL_SERVER(server_name
)) {
1877 werr
= NetLocalGroupAddMembers_l(ctx
, &r
);
1879 werr
= NetLocalGroupAddMembers_r(ctx
, &r
);
1882 r
.out
.result
= W_ERROR_V(werr
);
1884 if (DEBUGLEVEL
>= 10) {
1885 NDR_PRINT_OUT_DEBUG(NetLocalGroupAddMembers
, &r
);
1889 return (NET_API_STATUS
)r
.out
.result
;
1892 /****************************************************************
1893 NetLocalGroupDelMembers
1894 ****************************************************************/
1896 NET_API_STATUS
NetLocalGroupDelMembers(const char * server_name
/* [in] */,
1897 const char * group_name
/* [in] */,
1898 uint32_t level
/* [in] */,
1899 uint8_t *buffer
/* [in] [ref] */,
1900 uint32_t total_entries
/* [in] */)
1902 struct NetLocalGroupDelMembers r
;
1903 struct libnetapi_ctx
*ctx
= NULL
;
1904 NET_API_STATUS status
;
1906 TALLOC_CTX
*frame
= talloc_stackframe();
1908 status
= libnetapi_getctx(&ctx
);
1915 r
.in
.server_name
= server_name
;
1916 r
.in
.group_name
= group_name
;
1918 r
.in
.buffer
= buffer
;
1919 r
.in
.total_entries
= total_entries
;
1921 /* Out parameters */
1923 if (DEBUGLEVEL
>= 10) {
1924 NDR_PRINT_IN_DEBUG(NetLocalGroupDelMembers
, &r
);
1927 if (LIBNETAPI_LOCAL_SERVER(server_name
)) {
1928 werr
= NetLocalGroupDelMembers_l(ctx
, &r
);
1930 werr
= NetLocalGroupDelMembers_r(ctx
, &r
);
1933 r
.out
.result
= W_ERROR_V(werr
);
1935 if (DEBUGLEVEL
>= 10) {
1936 NDR_PRINT_OUT_DEBUG(NetLocalGroupDelMembers
, &r
);
1940 return (NET_API_STATUS
)r
.out
.result
;
1943 /****************************************************************
1944 NetLocalGroupGetMembers
1945 ****************************************************************/
1947 NET_API_STATUS
NetLocalGroupGetMembers(const char * server_name
/* [in] */,
1948 const char * local_group_name
/* [in] */,
1949 uint32_t level
/* [in] */,
1950 uint8_t **buffer
/* [out] [ref] */,
1951 uint32_t prefmaxlen
/* [in] */,
1952 uint32_t *entries_read
/* [out] [ref] */,
1953 uint32_t *total_entries
/* [out] [ref] */,
1954 uint32_t *resume_handle
/* [in,out] [ref] */)
1956 struct NetLocalGroupGetMembers r
;
1957 struct libnetapi_ctx
*ctx
= NULL
;
1958 NET_API_STATUS status
;
1960 TALLOC_CTX
*frame
= talloc_stackframe();
1962 status
= libnetapi_getctx(&ctx
);
1969 r
.in
.server_name
= server_name
;
1970 r
.in
.local_group_name
= local_group_name
;
1972 r
.in
.prefmaxlen
= prefmaxlen
;
1973 r
.in
.resume_handle
= resume_handle
;
1975 /* Out parameters */
1976 r
.out
.buffer
= buffer
;
1977 r
.out
.entries_read
= entries_read
;
1978 r
.out
.total_entries
= total_entries
;
1979 r
.out
.resume_handle
= resume_handle
;
1981 if (DEBUGLEVEL
>= 10) {
1982 NDR_PRINT_IN_DEBUG(NetLocalGroupGetMembers
, &r
);
1985 if (LIBNETAPI_LOCAL_SERVER(server_name
)) {
1986 werr
= NetLocalGroupGetMembers_l(ctx
, &r
);
1988 werr
= NetLocalGroupGetMembers_r(ctx
, &r
);
1991 r
.out
.result
= W_ERROR_V(werr
);
1993 if (DEBUGLEVEL
>= 10) {
1994 NDR_PRINT_OUT_DEBUG(NetLocalGroupGetMembers
, &r
);
1998 return (NET_API_STATUS
)r
.out
.result
;
2001 /****************************************************************
2002 NetLocalGroupSetMembers
2003 ****************************************************************/
2005 NET_API_STATUS
NetLocalGroupSetMembers(const char * server_name
/* [in] */,
2006 const char * group_name
/* [in] */,
2007 uint32_t level
/* [in] */,
2008 uint8_t *buffer
/* [in] [ref] */,
2009 uint32_t total_entries
/* [in] */)
2011 struct NetLocalGroupSetMembers r
;
2012 struct libnetapi_ctx
*ctx
= NULL
;
2013 NET_API_STATUS status
;
2015 TALLOC_CTX
*frame
= talloc_stackframe();
2017 status
= libnetapi_getctx(&ctx
);
2024 r
.in
.server_name
= server_name
;
2025 r
.in
.group_name
= group_name
;
2027 r
.in
.buffer
= buffer
;
2028 r
.in
.total_entries
= total_entries
;
2030 /* Out parameters */
2032 if (DEBUGLEVEL
>= 10) {
2033 NDR_PRINT_IN_DEBUG(NetLocalGroupSetMembers
, &r
);
2036 if (LIBNETAPI_LOCAL_SERVER(server_name
)) {
2037 werr
= NetLocalGroupSetMembers_l(ctx
, &r
);
2039 werr
= NetLocalGroupSetMembers_r(ctx
, &r
);
2042 r
.out
.result
= W_ERROR_V(werr
);
2044 if (DEBUGLEVEL
>= 10) {
2045 NDR_PRINT_OUT_DEBUG(NetLocalGroupSetMembers
, &r
);
2049 return (NET_API_STATUS
)r
.out
.result
;
2052 /****************************************************************
2054 ****************************************************************/
2056 NET_API_STATUS
NetRemoteTOD(const char * server_name
/* [in] */,
2057 uint8_t **buffer
/* [out] [ref] */)
2059 struct NetRemoteTOD r
;
2060 struct libnetapi_ctx
*ctx
= NULL
;
2061 NET_API_STATUS status
;
2063 TALLOC_CTX
*frame
= talloc_stackframe();
2065 status
= libnetapi_getctx(&ctx
);
2072 r
.in
.server_name
= server_name
;
2074 /* Out parameters */
2075 r
.out
.buffer
= buffer
;
2077 if (DEBUGLEVEL
>= 10) {
2078 NDR_PRINT_IN_DEBUG(NetRemoteTOD
, &r
);
2081 if (LIBNETAPI_LOCAL_SERVER(server_name
)) {
2082 werr
= NetRemoteTOD_l(ctx
, &r
);
2084 werr
= NetRemoteTOD_r(ctx
, &r
);
2087 r
.out
.result
= W_ERROR_V(werr
);
2089 if (DEBUGLEVEL
>= 10) {
2090 NDR_PRINT_OUT_DEBUG(NetRemoteTOD
, &r
);
2094 return (NET_API_STATUS
)r
.out
.result
;
2097 /****************************************************************
2099 ****************************************************************/
2101 NET_API_STATUS
NetShareAdd(const char * server_name
/* [in] */,
2102 uint32_t level
/* [in] */,
2103 uint8_t *buffer
/* [in] [ref] */,
2104 uint32_t *parm_err
/* [out] [ref] */)
2106 struct NetShareAdd r
;
2107 struct libnetapi_ctx
*ctx
= NULL
;
2108 NET_API_STATUS status
;
2110 TALLOC_CTX
*frame
= talloc_stackframe();
2112 status
= libnetapi_getctx(&ctx
);
2119 r
.in
.server_name
= server_name
;
2121 r
.in
.buffer
= buffer
;
2123 /* Out parameters */
2124 r
.out
.parm_err
= parm_err
;
2126 if (DEBUGLEVEL
>= 10) {
2127 NDR_PRINT_IN_DEBUG(NetShareAdd
, &r
);
2130 if (LIBNETAPI_LOCAL_SERVER(server_name
)) {
2131 werr
= NetShareAdd_l(ctx
, &r
);
2133 werr
= NetShareAdd_r(ctx
, &r
);
2136 r
.out
.result
= W_ERROR_V(werr
);
2138 if (DEBUGLEVEL
>= 10) {
2139 NDR_PRINT_OUT_DEBUG(NetShareAdd
, &r
);
2143 return (NET_API_STATUS
)r
.out
.result
;
2146 /****************************************************************
2148 ****************************************************************/
2150 NET_API_STATUS
NetShareDel(const char * server_name
/* [in] */,
2151 const char * net_name
/* [in] */,
2152 uint32_t reserved
/* [in] */)
2154 struct NetShareDel r
;
2155 struct libnetapi_ctx
*ctx
= NULL
;
2156 NET_API_STATUS status
;
2158 TALLOC_CTX
*frame
= talloc_stackframe();
2160 status
= libnetapi_getctx(&ctx
);
2167 r
.in
.server_name
= server_name
;
2168 r
.in
.net_name
= net_name
;
2169 r
.in
.reserved
= reserved
;
2171 /* Out parameters */
2173 if (DEBUGLEVEL
>= 10) {
2174 NDR_PRINT_IN_DEBUG(NetShareDel
, &r
);
2177 if (LIBNETAPI_LOCAL_SERVER(server_name
)) {
2178 werr
= NetShareDel_l(ctx
, &r
);
2180 werr
= NetShareDel_r(ctx
, &r
);
2183 r
.out
.result
= W_ERROR_V(werr
);
2185 if (DEBUGLEVEL
>= 10) {
2186 NDR_PRINT_OUT_DEBUG(NetShareDel
, &r
);
2190 return (NET_API_STATUS
)r
.out
.result
;
2193 /****************************************************************
2195 ****************************************************************/
2197 NET_API_STATUS
NetShareEnum(const char * server_name
/* [in] */,
2198 uint32_t level
/* [in] */,
2199 uint8_t **buffer
/* [out] [ref] */,
2200 uint32_t prefmaxlen
/* [in] */,
2201 uint32_t *entries_read
/* [out] [ref] */,
2202 uint32_t *total_entries
/* [out] [ref] */,
2203 uint32_t *resume_handle
/* [in,out] [ref] */)
2205 struct NetShareEnum r
;
2206 struct libnetapi_ctx
*ctx
= NULL
;
2207 NET_API_STATUS status
;
2209 TALLOC_CTX
*frame
= talloc_stackframe();
2211 status
= libnetapi_getctx(&ctx
);
2218 r
.in
.server_name
= server_name
;
2220 r
.in
.prefmaxlen
= prefmaxlen
;
2221 r
.in
.resume_handle
= resume_handle
;
2223 /* Out parameters */
2224 r
.out
.buffer
= buffer
;
2225 r
.out
.entries_read
= entries_read
;
2226 r
.out
.total_entries
= total_entries
;
2227 r
.out
.resume_handle
= resume_handle
;
2229 if (DEBUGLEVEL
>= 10) {
2230 NDR_PRINT_IN_DEBUG(NetShareEnum
, &r
);
2233 if (LIBNETAPI_LOCAL_SERVER(server_name
)) {
2234 werr
= NetShareEnum_l(ctx
, &r
);
2236 werr
= NetShareEnum_r(ctx
, &r
);
2239 r
.out
.result
= W_ERROR_V(werr
);
2241 if (DEBUGLEVEL
>= 10) {
2242 NDR_PRINT_OUT_DEBUG(NetShareEnum
, &r
);
2246 return (NET_API_STATUS
)r
.out
.result
;
2249 /****************************************************************
2251 ****************************************************************/
2253 NET_API_STATUS
NetShareGetInfo(const char * server_name
/* [in] */,
2254 const char * net_name
/* [in] */,
2255 uint32_t level
/* [in] */,
2256 uint8_t **buffer
/* [out] [ref] */)
2258 struct NetShareGetInfo r
;
2259 struct libnetapi_ctx
*ctx
= NULL
;
2260 NET_API_STATUS status
;
2262 TALLOC_CTX
*frame
= talloc_stackframe();
2264 status
= libnetapi_getctx(&ctx
);
2271 r
.in
.server_name
= server_name
;
2272 r
.in
.net_name
= net_name
;
2275 /* Out parameters */
2276 r
.out
.buffer
= buffer
;
2278 if (DEBUGLEVEL
>= 10) {
2279 NDR_PRINT_IN_DEBUG(NetShareGetInfo
, &r
);
2282 if (LIBNETAPI_LOCAL_SERVER(server_name
)) {
2283 werr
= NetShareGetInfo_l(ctx
, &r
);
2285 werr
= NetShareGetInfo_r(ctx
, &r
);
2288 r
.out
.result
= W_ERROR_V(werr
);
2290 if (DEBUGLEVEL
>= 10) {
2291 NDR_PRINT_OUT_DEBUG(NetShareGetInfo
, &r
);
2295 return (NET_API_STATUS
)r
.out
.result
;
2298 /****************************************************************
2300 ****************************************************************/
2302 NET_API_STATUS
NetShareSetInfo(const char * server_name
/* [in] */,
2303 const char * net_name
/* [in] */,
2304 uint32_t level
/* [in] */,
2305 uint8_t *buffer
/* [in] [ref] */,
2306 uint32_t *parm_err
/* [out] [ref] */)
2308 struct NetShareSetInfo r
;
2309 struct libnetapi_ctx
*ctx
= NULL
;
2310 NET_API_STATUS status
;
2312 TALLOC_CTX
*frame
= talloc_stackframe();
2314 status
= libnetapi_getctx(&ctx
);
2321 r
.in
.server_name
= server_name
;
2322 r
.in
.net_name
= net_name
;
2324 r
.in
.buffer
= buffer
;
2326 /* Out parameters */
2327 r
.out
.parm_err
= parm_err
;
2329 if (DEBUGLEVEL
>= 10) {
2330 NDR_PRINT_IN_DEBUG(NetShareSetInfo
, &r
);
2333 if (LIBNETAPI_LOCAL_SERVER(server_name
)) {
2334 werr
= NetShareSetInfo_l(ctx
, &r
);
2336 werr
= NetShareSetInfo_r(ctx
, &r
);
2339 r
.out
.result
= W_ERROR_V(werr
);
2341 if (DEBUGLEVEL
>= 10) {
2342 NDR_PRINT_OUT_DEBUG(NetShareSetInfo
, &r
);
2346 return (NET_API_STATUS
)r
.out
.result
;
2349 /****************************************************************
2351 ****************************************************************/
2353 NET_API_STATUS
NetFileClose(const char * server_name
/* [in] */,
2354 uint32_t fileid
/* [in] */)
2356 struct NetFileClose r
;
2357 struct libnetapi_ctx
*ctx
= NULL
;
2358 NET_API_STATUS status
;
2360 TALLOC_CTX
*frame
= talloc_stackframe();
2362 status
= libnetapi_getctx(&ctx
);
2369 r
.in
.server_name
= server_name
;
2370 r
.in
.fileid
= fileid
;
2372 /* Out parameters */
2374 if (DEBUGLEVEL
>= 10) {
2375 NDR_PRINT_IN_DEBUG(NetFileClose
, &r
);
2378 if (LIBNETAPI_LOCAL_SERVER(server_name
)) {
2379 werr
= NetFileClose_l(ctx
, &r
);
2381 werr
= NetFileClose_r(ctx
, &r
);
2384 r
.out
.result
= W_ERROR_V(werr
);
2386 if (DEBUGLEVEL
>= 10) {
2387 NDR_PRINT_OUT_DEBUG(NetFileClose
, &r
);
2391 return (NET_API_STATUS
)r
.out
.result
;
2394 /****************************************************************
2396 ****************************************************************/
2398 NET_API_STATUS
NetFileGetInfo(const char * server_name
/* [in] */,
2399 uint32_t fileid
/* [in] */,
2400 uint32_t level
/* [in] */,
2401 uint8_t **buffer
/* [out] [ref] */)
2403 struct NetFileGetInfo r
;
2404 struct libnetapi_ctx
*ctx
= NULL
;
2405 NET_API_STATUS status
;
2407 TALLOC_CTX
*frame
= talloc_stackframe();
2409 status
= libnetapi_getctx(&ctx
);
2416 r
.in
.server_name
= server_name
;
2417 r
.in
.fileid
= fileid
;
2420 /* Out parameters */
2421 r
.out
.buffer
= buffer
;
2423 if (DEBUGLEVEL
>= 10) {
2424 NDR_PRINT_IN_DEBUG(NetFileGetInfo
, &r
);
2427 if (LIBNETAPI_LOCAL_SERVER(server_name
)) {
2428 werr
= NetFileGetInfo_l(ctx
, &r
);
2430 werr
= NetFileGetInfo_r(ctx
, &r
);
2433 r
.out
.result
= W_ERROR_V(werr
);
2435 if (DEBUGLEVEL
>= 10) {
2436 NDR_PRINT_OUT_DEBUG(NetFileGetInfo
, &r
);
2440 return (NET_API_STATUS
)r
.out
.result
;
2443 /****************************************************************
2445 ****************************************************************/
2447 NET_API_STATUS
NetFileEnum(const char * server_name
/* [in] */,
2448 const char * base_path
/* [in] */,
2449 const char * user_name
/* [in] */,
2450 uint32_t level
/* [in] */,
2451 uint8_t **buffer
/* [out] [ref] */,
2452 uint32_t prefmaxlen
/* [in] */,
2453 uint32_t *entries_read
/* [out] [ref] */,
2454 uint32_t *total_entries
/* [out] [ref] */,
2455 uint32_t *resume_handle
/* [in,out] [ref] */)
2457 struct NetFileEnum r
;
2458 struct libnetapi_ctx
*ctx
= NULL
;
2459 NET_API_STATUS status
;
2461 TALLOC_CTX
*frame
= talloc_stackframe();
2463 status
= libnetapi_getctx(&ctx
);
2470 r
.in
.server_name
= server_name
;
2471 r
.in
.base_path
= base_path
;
2472 r
.in
.user_name
= user_name
;
2474 r
.in
.prefmaxlen
= prefmaxlen
;
2475 r
.in
.resume_handle
= resume_handle
;
2477 /* Out parameters */
2478 r
.out
.buffer
= buffer
;
2479 r
.out
.entries_read
= entries_read
;
2480 r
.out
.total_entries
= total_entries
;
2481 r
.out
.resume_handle
= resume_handle
;
2483 if (DEBUGLEVEL
>= 10) {
2484 NDR_PRINT_IN_DEBUG(NetFileEnum
, &r
);
2487 if (LIBNETAPI_LOCAL_SERVER(server_name
)) {
2488 werr
= NetFileEnum_l(ctx
, &r
);
2490 werr
= NetFileEnum_r(ctx
, &r
);
2493 r
.out
.result
= W_ERROR_V(werr
);
2495 if (DEBUGLEVEL
>= 10) {
2496 NDR_PRINT_OUT_DEBUG(NetFileEnum
, &r
);
2500 return (NET_API_STATUS
)r
.out
.result
;
2503 /****************************************************************
2505 ****************************************************************/
2507 NET_API_STATUS
NetShutdownInit(const char * server_name
/* [in] */,
2508 const char * message
/* [in] */,
2509 uint32_t timeout
/* [in] */,
2510 uint8_t force_apps
/* [in] */,
2511 uint8_t do_reboot
/* [in] */)
2513 struct NetShutdownInit r
;
2514 struct libnetapi_ctx
*ctx
= NULL
;
2515 NET_API_STATUS status
;
2517 TALLOC_CTX
*frame
= talloc_stackframe();
2519 status
= libnetapi_getctx(&ctx
);
2526 r
.in
.server_name
= server_name
;
2527 r
.in
.message
= message
;
2528 r
.in
.timeout
= timeout
;
2529 r
.in
.force_apps
= force_apps
;
2530 r
.in
.do_reboot
= do_reboot
;
2532 /* Out parameters */
2534 if (DEBUGLEVEL
>= 10) {
2535 NDR_PRINT_IN_DEBUG(NetShutdownInit
, &r
);
2538 if (LIBNETAPI_LOCAL_SERVER(server_name
)) {
2539 werr
= NetShutdownInit_l(ctx
, &r
);
2541 werr
= NetShutdownInit_r(ctx
, &r
);
2544 r
.out
.result
= W_ERROR_V(werr
);
2546 if (DEBUGLEVEL
>= 10) {
2547 NDR_PRINT_OUT_DEBUG(NetShutdownInit
, &r
);
2551 return (NET_API_STATUS
)r
.out
.result
;
2554 /****************************************************************
2556 ****************************************************************/
2558 NET_API_STATUS
NetShutdownAbort(const char * server_name
/* [in] */)
2560 struct NetShutdownAbort r
;
2561 struct libnetapi_ctx
*ctx
= NULL
;
2562 NET_API_STATUS status
;
2564 TALLOC_CTX
*frame
= talloc_stackframe();
2566 status
= libnetapi_getctx(&ctx
);
2573 r
.in
.server_name
= server_name
;
2575 /* Out parameters */
2577 if (DEBUGLEVEL
>= 10) {
2578 NDR_PRINT_IN_DEBUG(NetShutdownAbort
, &r
);
2581 if (LIBNETAPI_LOCAL_SERVER(server_name
)) {
2582 werr
= NetShutdownAbort_l(ctx
, &r
);
2584 werr
= NetShutdownAbort_r(ctx
, &r
);
2587 r
.out
.result
= W_ERROR_V(werr
);
2589 if (DEBUGLEVEL
>= 10) {
2590 NDR_PRINT_OUT_DEBUG(NetShutdownAbort
, &r
);
2594 return (NET_API_STATUS
)r
.out
.result
;
2597 /****************************************************************
2599 ****************************************************************/
2601 NET_API_STATUS
I_NetLogonControl(const char * server_name
/* [in] */,
2602 uint32_t function_code
/* [in] */,
2603 uint32_t query_level
/* [in] */,
2604 uint8_t **buffer
/* [out] [ref] */)
2606 struct I_NetLogonControl r
;
2607 struct libnetapi_ctx
*ctx
= NULL
;
2608 NET_API_STATUS status
;
2610 TALLOC_CTX
*frame
= talloc_stackframe();
2612 status
= libnetapi_getctx(&ctx
);
2619 r
.in
.server_name
= server_name
;
2620 r
.in
.function_code
= function_code
;
2621 r
.in
.query_level
= query_level
;
2623 /* Out parameters */
2624 r
.out
.buffer
= buffer
;
2626 if (DEBUGLEVEL
>= 10) {
2627 NDR_PRINT_IN_DEBUG(I_NetLogonControl
, &r
);
2630 if (LIBNETAPI_LOCAL_SERVER(server_name
)) {
2631 werr
= I_NetLogonControl_l(ctx
, &r
);
2633 werr
= I_NetLogonControl_r(ctx
, &r
);
2636 r
.out
.result
= W_ERROR_V(werr
);
2638 if (DEBUGLEVEL
>= 10) {
2639 NDR_PRINT_OUT_DEBUG(I_NetLogonControl
, &r
);
2643 return (NET_API_STATUS
)r
.out
.result
;
2646 /****************************************************************
2648 ****************************************************************/
2650 NET_API_STATUS
I_NetLogonControl2(const char * server_name
/* [in] */,
2651 uint32_t function_code
/* [in] */,
2652 uint32_t query_level
/* [in] */,
2653 uint8_t *data
/* [in] [ref] */,
2654 uint8_t **buffer
/* [out] [ref] */)
2656 struct I_NetLogonControl2 r
;
2657 struct libnetapi_ctx
*ctx
= NULL
;
2658 NET_API_STATUS status
;
2660 TALLOC_CTX
*frame
= talloc_stackframe();
2662 status
= libnetapi_getctx(&ctx
);
2669 r
.in
.server_name
= server_name
;
2670 r
.in
.function_code
= function_code
;
2671 r
.in
.query_level
= query_level
;
2674 /* Out parameters */
2675 r
.out
.buffer
= buffer
;
2677 if (DEBUGLEVEL
>= 10) {
2678 NDR_PRINT_IN_DEBUG(I_NetLogonControl2
, &r
);
2681 if (LIBNETAPI_LOCAL_SERVER(server_name
)) {
2682 werr
= I_NetLogonControl2_l(ctx
, &r
);
2684 werr
= I_NetLogonControl2_r(ctx
, &r
);
2687 r
.out
.result
= W_ERROR_V(werr
);
2689 if (DEBUGLEVEL
>= 10) {
2690 NDR_PRINT_OUT_DEBUG(I_NetLogonControl2
, &r
);
2694 return (NET_API_STATUS
)r
.out
.result
;