xref: /illumos-gate/usr/src/lib/smbsrv/libmlsvc/common/lsalib.h (revision 45ede40b2394db7967e59f19288fae9b62efd4aa)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  *
25  * Copyright 2015 Nexenta Systems, Inc.  All rights reserved.
26  */
27 
28 #ifndef _LSALIB_H
29 #define	_LSALIB_H
30 
31 /*
32  * Prototypes for the LSA library and RPC client side library interface.
33  * There are two levels of interface defined here: lsa_xxx and lsar_xxx.
34  * The lsa_xxx functions provide a high level interface which make
35  * multiple RPC calls and do all the work necessary to obtain and return
36  * the requested information. The lsar_xxx functions provide a low level
37  * interface in which each function maps to a single underlying RPC.
38  */
39 
40 #include <smbsrv/ndl/lsarpc.ndl>
41 #include <smbsrv/libsmb.h>
42 #include <smbsrv/libmlsvc.h>
43 #include <smbsrv/smb_sid.h>
44 
45 
46 #ifdef __cplusplus
47 extern "C" {
48 #endif
49 
50 typedef struct mslsa_sid lsa_sid_t;
51 
52 /*
53  * lsalib.c
54  */
55 DWORD lsa_query_primary_domain_info(char *, char *, smb_domain_t *);
56 DWORD lsa_query_account_domain_info(char *, char *, smb_domain_t *);
57 DWORD lsa_query_dns_domain_info(char *, char *, smb_domain_t *);
58 DWORD lsa_enum_trusted_domains(char *, char *, smb_trusted_domains_t *);
59 DWORD lsa_enum_trusted_domains_ex(char *, char *, smb_trusted_domains_t *);
60 
61 /*
62  * lsar_open.c
63  */
64 DWORD lsar_open(char *, char *, char *, mlsvc_handle_t *);
65 DWORD lsar_open_policy2(char *, char *, char *, mlsvc_handle_t *);
66 int lsar_open_account(mlsvc_handle_t *, struct mslsa_sid *, mlsvc_handle_t *);
67 int lsar_close(mlsvc_handle_t *);
68 
69 /*
70  * lsar_lookup.c
71  */
72 int lsar_query_security_desc(mlsvc_handle_t *);
73 DWORD lsar_query_info_policy(mlsvc_handle_t *, WORD, smb_domain_t *);
74 uint32_t lsar_lookup_names(mlsvc_handle_t *, char *, smb_account_t *);
75 uint32_t lsar_lookup_sids(mlsvc_handle_t *, smb_sid_t *, smb_account_t *);
76 
77 DWORD lsar_enum_accounts(mlsvc_handle_t *, DWORD *,
78     struct mslsa_EnumAccountBuf *);
79 DWORD lsar_enum_trusted_domains(mlsvc_handle_t *, DWORD *,
80     smb_trusted_domains_t *);
81 DWORD lsar_enum_trusted_domains_ex(mlsvc_handle_t *, DWORD *,
82     smb_trusted_domains_t *);
83 int lsar_enum_privs_account(mlsvc_handle_t *, smb_account_t *);
84 int lsar_lookup_priv_value(mlsvc_handle_t *, char *, struct  ms_luid *);
85 int lsar_lookup_priv_name(mlsvc_handle_t *, struct  ms_luid *, char *, int);
86 DWORD lsar_lookup_priv_display_name(mlsvc_handle_t *, char *, char *, int);
87 
88 #ifdef __cplusplus
89 }
90 #endif
91 
92 #endif /* _LSALIB_H */
93