xref: /titanic_52/usr/src/lib/smbsrv/libmlsvc/common/lsalib.h (revision 24fe0b3bf671e123467ce1df0b67cadd3614c8e4)
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 /*
49  * lsalib.c
50  */
51 uint32_t lsa_lookup_name(char *, uint16_t, smb_account_t *);
52 uint32_t lsa_lookup_sid(smb_sid_t *, smb_account_t *);
53 DWORD lsa_query_primary_domain_info(char *, char *, nt_domain_t *);
54 DWORD lsa_query_account_domain_info(char *, char *, nt_domain_t *);
55 DWORD lsa_query_dns_domain_info(char *, char *, nt_domain_t *);
56 DWORD lsa_enum_trusted_domains(char *, char *, smb_trusted_domains_t *);
57 DWORD lsa_enum_trusted_domains_ex(char *, char *, smb_trusted_domains_t *);
58 
59 /*
60  * lsar_open.c
61  */
62 int lsar_open(char *, char *, char *, mlsvc_handle_t *);
63 int lsar_open_policy2(char *, char *, char *, mlsvc_handle_t *);
64 int lsar_open_account(mlsvc_handle_t *, struct mslsa_sid *, mlsvc_handle_t *);
65 int lsar_close(mlsvc_handle_t *);
66 
67 /*
68  * lsar_lookup.c
69  */
70 int lsar_query_security_desc(mlsvc_handle_t *);
71 DWORD lsar_query_info_policy(mlsvc_handle_t *, WORD, nt_domain_t *);
72 uint32_t lsar_lookup_names(mlsvc_handle_t *, char *, smb_account_t *);
73 uint32_t lsar_lookup_names2(mlsvc_handle_t *, char *, smb_account_t *);
74 uint32_t lsar_lookup_sids(mlsvc_handle_t *, struct mslsa_sid *,
75     smb_account_t *);
76 uint32_t lsar_lookup_sids2(mlsvc_handle_t *, struct mslsa_sid *,
77     smb_account_t *);
78 
79 int 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