xref: /titanic_50/usr/src/lib/smbsrv/libmlsvc/common/mlsvc.h (revision c9a6ea2e938727c95af7108c5e00eee4c890c7ae)
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 (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
23  */
24 
25 #ifndef _SMBSRV_MLSVC_H
26 #define	_SMBSRV_MLSVC_H
27 
28 #include <cups/cups.h>
29 #include <smbsrv/smb_share.h>
30 #include <smbsrv/ndl/netlogon.ndl>
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 int smb_dclocator_init(void);
37 void dssetup_initialize(void);
38 void srvsvc_initialize(void);
39 void wkssvc_initialize(void);
40 void lsarpc_initialize(void);
41 void logr_initialize(void);
42 void netr_initialize(void);
43 void samr_initialize(void);
44 void svcctl_initialize(void);
45 void winreg_initialize(void);
46 int srvsvc_gettime(unsigned long *);
47 void msgsvcsend_initialize(void);
48 void spoolss_initialize(void);
49 void netdfs_initialize(void);
50 
51 void logr_finalize(void);
52 void svcctl_finalize(void);
53 void spoolss_finalize(void);
54 void netdfs_finalize(void);
55 
56 int netr_open(char *, char *, mlsvc_handle_t *);
57 int netr_close(mlsvc_handle_t *);
58 DWORD netlogon_auth(char *, mlsvc_handle_t *, DWORD);
59 int netr_setup_authenticator(netr_info_t *, struct netr_authenticator *,
60     struct netr_authenticator *);
61 DWORD netr_validate_chain(netr_info_t *, struct netr_authenticator *);
62 
63 void ndr_srvsvc_timecheck(char *, char *);
64 
65 /* Generic functions to get/set windows Security Descriptors */
66 uint32_t srvsvc_sd_get(smb_share_t *, uint8_t *, uint32_t *);
67 uint32_t srvsvc_sd_set(smb_share_t *, uint8_t *);
68 
69 uint32_t smb_logon_init(void);
70 void smb_logon_fini(void);
71 
72 /* Locking for process-wide settings (i.e. privileges) */
73 void smb_proc_initsem(void);	/* init (or re-init in child) */
74 int  smb_proc_takesem(void);	/* parent before */
75 void smb_proc_givesem(void);	/* parent after */
76 
77 /* Quota */
78 void smb_quota_init(void);
79 void smb_quota_fini(void);
80 void smb_quota_add_fs(const char *);
81 void smb_quota_remove_fs(const char *);
82 
83 typedef struct smb_cups_ops {
84 	void *cups_hdl;
85 	cups_lang_t *(*cupsLangDefault)();
86 	const char *(*cupsLangEncoding)(cups_lang_t *);
87 	void (*cupsLangFree)(cups_lang_t *);
88 	ipp_status_t (*cupsLastError)();
89 	int (*cupsGetDests)(cups_dest_t **);
90 	void (*cupsFreeDests)(int, cups_dest_t *);
91 	ipp_t *(*cupsDoFileRequest)(http_t *, ipp_t *, const char *,
92 	    const char *);
93 	ipp_t *(*ippNew)();
94 	void (*ippDelete)();
95 	char *(*ippErrorString)();
96 	ipp_attribute_t *(*ippAddString)();
97 	void (*httpClose)(http_t *);
98 	http_t *(*httpConnect)(const char *, int);
99 } smb_cups_ops_t;
100 
101 smb_cups_ops_t *spoolss_cups_ops(void);
102 
103 #ifdef __cplusplus
104 }
105 #endif
106 
107 
108 #endif /* _SMBSRV_MLSVC_H */
109