xref: /titanic_44/usr/src/lib/smbsrv/libmlsvc/common/lsalib.h (revision 726fad2a65f16c200a03969c29cb5c86c2d427db)
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 
26 #ifndef _LSALIB_H
27 #define	_LSALIB_H
28 
29 /*
30  * Prototypes for the LSA library and RPC client side library interface.
31  * There are two levels of interface defined here: lsa_xxx and lsar_xxx.
32  * The lsa_xxx functions provide a high level interface which make
33  * multiple RPC calls and do all the work necessary to obtain and return
34  * the requested information. The lsar_xxx functions provide a low level
35  * interface in which each function maps to a single underlying RPC.
36  */
37 
38 #include <smbsrv/ndl/lsarpc.ndl>
39 #include <smbsrv/libsmb.h>
40 #include <smbsrv/libmlsvc.h>
41 #include <smbsrv/smb_sid.h>
42 
43 
44 #ifdef __cplusplus
45 extern "C" {
46 #endif
47 
48 typedef struct mslsa_sid lsa_sid_t;
49 
50 /*
51  * lsalib.c
52  */
53 uint32_t lsa_lookup_name(char *, uint16_t, smb_account_t *);
54 uint32_t lsa_lookup_sid(smb_sid_t *, smb_account_t *);
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 int lsar_open(char *, char *, char *, mlsvc_handle_t *);
65 int 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 int 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