xref: /illumos-gate/usr/src/lib/smbsrv/libmlsvc/common/lsalib.h (revision 48edc7cf07b5dccc3ad84bf2dafe4150bd666d60)
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 uint32_t lsa_lookup_name(char *, uint16_t, smb_account_t *);
56 uint32_t lsa_lookup_sid(smb_sid_t *, smb_account_t *);
57 DWORD lsa_query_primary_domain_info(char *, char *, smb_domain_t *);
58 DWORD lsa_query_account_domain_info(char *, char *, smb_domain_t *);
59 DWORD lsa_query_dns_domain_info(char *, char *, smb_domain_t *);
60 DWORD lsa_enum_trusted_domains(char *, char *, smb_trusted_domains_t *);
61 DWORD lsa_enum_trusted_domains_ex(char *, char *, smb_trusted_domains_t *);
62 
63 /*
64  * lsar_open.c
65  */
66 DWORD lsar_open(char *, char *, char *, mlsvc_handle_t *);
67 DWORD lsar_open_policy2(char *, char *, char *, mlsvc_handle_t *);
68 int lsar_open_account(mlsvc_handle_t *, struct mslsa_sid *, mlsvc_handle_t *);
69 int lsar_close(mlsvc_handle_t *);
70 
71 /*
72  * lsar_lookup.c
73  */
74 int lsar_query_security_desc(mlsvc_handle_t *);
75 DWORD lsar_query_info_policy(mlsvc_handle_t *, WORD, smb_domain_t *);
76 uint32_t lsar_lookup_names(mlsvc_handle_t *, char *, smb_account_t *);
77 uint32_t lsar_lookup_sids(mlsvc_handle_t *, smb_sid_t *, smb_account_t *);
78 
79 DWORD lsar_enum_accounts(mlsvc_handle_t *, DWORD *,
80     struct mslsa_EnumAccountBuf *);
81 DWORD lsar_enum_trusted_domains(mlsvc_handle_t *, DWORD *,
82     smb_trusted_domains_t *);
83 DWORD lsar_enum_trusted_domains_ex(mlsvc_handle_t *, DWORD *,
84     smb_trusted_domains_t *);
85 int lsar_enum_privs_account(mlsvc_handle_t *, smb_account_t *);
86 int lsar_lookup_priv_value(mlsvc_handle_t *, char *, struct  ms_luid *);
87 int lsar_lookup_priv_name(mlsvc_handle_t *, struct  ms_luid *, char *, int);
88 DWORD lsar_lookup_priv_display_name(mlsvc_handle_t *, char *, char *, int);
89 
90 #ifdef __cplusplus
91 }
92 #endif
93 
94 #endif /* _LSALIB_H */
95