xref: /illumos-gate/usr/src/uts/common/smbsrv/smbinfo.h (revision 2850d85b7b93f31e578520dc3b3feb24db609c62)
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 2008 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 #ifndef	_SMBSRV_SMBINFO_H
27 #define	_SMBSRV_SMBINFO_H
28 
29 #pragma ident	"%Z%%M%	%I%	%E% SMI"
30 
31 #include <sys/types.h>
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
37 /*
38  * Native OS types used in SmbSessionSetupX.
39  */
40 #ifndef NATIVE_OS_DEFINED
41 #define	NATIVE_OS_DEFINED
42 
43 #define	NATIVE_OS_UNKNOWN	0x00000000
44 #define	NATIVE_OS_NT4_0		0x00000001
45 #define	NATIVE_OS_WIN95		0x00000002
46 #define	NATIVE_OS_OTHER		0x00000003
47 #define	NATIVE_OS_NT5_0		0x00000004
48 #define	NATIVE_OS_NT5_1		0x00000005
49 #define	NATIVE_OS_MACOS		0x00000006
50 
51 /*
52  * Backward compatibility aliases.
53  */
54 #define	NATIVE_OS_WINNT		NATIVE_OS_NT4_0
55 #define	NATIVE_OS_WIN2000	NATIVE_OS_NT5_0
56 #define	NATIVE_OS_WINXP		NATIVE_OS_NT5_1
57 
58 #endif /* NATIVE_OS_DEFINED */
59 
60 
61 /*
62  * Native lanman types in SmbSessionSetupX. Note that these values
63  * are not directly related to the negotiated protocol dialect.
64  */
65 #ifndef NATIVE_LANMAN_DEFINED
66 #define	NATIVE_LANMAN_DEFINED
67 
68 #define	NATIVE_LM_NONE		0x00000000
69 #define	NATIVE_LM_NT		0x00000001
70 #define	NATIVE_LM_WIN2000	0x00000002
71 
72 #endif /* NATIVE_LANMAN_DEFINED */
73 
74 
75 /* PDC types to be used in user authentication process */
76 
77 #define	PDC_UNKNOWN		0
78 #define	PDC_WINNT		1
79 #define	PDC_WIN2000		2
80 #define	PDC_WINXP		3
81 #define	PDC_SAMBA		4
82 
83 /*
84  * Please replace the use of MAX_NETWORKS with SMB_PI_MAX_NETWORKS if
85  * you find it used in conjunction with smbparm_info and maybe one day
86  * there will be just a single definition (here) throughout the code.
87  */
88 #ifndef MAX_NETWORKS
89 #define	MAX_NETWORKS		36
90 #endif /* MAX_NETWORKS */
91 
92 #define	SMB_PI_MAX_NETWORKS	36
93 #define	SMB_PI_MAX_WINS		2
94 
95 #define	SMB_SECMODE_WORKGRP	1
96 #define	SMB_SECMODE_DOMAIN	2
97 
98 #define	SMB_PI_MAX_HOST		48
99 #define	SMB_PI_MAX_DOMAIN	48
100 #define	SMB_PI_MAX_SCOPE	16
101 #define	SMB_PI_MAX_COMMENT	58
102 #define	SMB_PI_MAX_USERNAME	40
103 #define	SMB_PI_MAX_PASSWD	40
104 #define	SMB_PI_MAX_NATIVE_OS	32
105 #define	SMB_PI_MAX_LANMAN	32
106 
107 
108 #define	SMB_PI_UNKNOWN_DOMAIN		0
109 #define	SMB_PI_RESOURCE_DOMAIN		1
110 
111 /*
112  * K.L. The keep alive time out use to default to 900
113  * seconds. It is not long enough for some applications
114  * i.e. MS Access. We currently use 5400 seconds.
115  */
116 #define	SMB_PI_KEEP_ALIVE_MIN		(90 * 60)
117 #define	SMB_LM_COMPATIBILITY_DEFAULT_LEV 3
118 
119 /*
120  * This is max networks multiply by canonical address for IPv4
121  * This needs a fix for IPv4
122  */
123 #define	MAX_EXCLUDE_LIST_LEN	(SMB_PI_MAX_NETWORKS * INET_ADDRSTRLEN)
124 
125 typedef struct smb_kmod_cfg {
126 	uint32_t skc_maxbufsize;
127 	uint32_t skc_maxworkers;
128 	uint32_t skc_maxconnections;
129 	uint32_t skc_keepalive;
130 	uint32_t skc_oplock_timeout;
131 	int32_t skc_restrict_anon;
132 	int32_t skc_signing_enable;
133 	int32_t skc_signing_required;
134 	int32_t skc_signing_check;
135 	int32_t skc_oplock_enable;
136 	int32_t skc_flush_required;
137 	int32_t skc_sync_enable;
138 	int32_t skc_dirsymlink_enable;
139 	int32_t skc_announce_quota;
140 	int32_t skc_secmode;
141 
142 	char skc_resource_domain[SMB_PI_MAX_DOMAIN];
143 	char skc_hostname[SMB_PI_MAX_HOST];
144 	char skc_system_comment[SMB_PI_MAX_COMMENT];
145 } smb_kmod_cfg_t;
146 
147 #define	SMB_VERSION_MAJOR  4
148 #define	SMB_VERSION_MINOR  0
149 
150 int smbnative_os_value(char *native_os);
151 int smbnative_lm_value(char *native_lm);
152 int smbnative_pdc_value(char *native_lm);
153 
154 /*
155  * Support for passthrough authentication.
156  */
157 #define	AUTH_USER_GRANT			0x00000000
158 #define	AUTH_GUEST_GRANT		0x00000001
159 #define	AUTH_IPC_ONLY_GRANT		0x00000002
160 #define	AUTH_CONEXUS_GRANT		0x00000004
161 
162 #define	SMBD_DOOR_NAME		"/var/run/smbd_door_old"
163 #define	SMBD_DOOR_VERSION	1
164 
165 #define	SMBD_DOOR_COOKIE	((void*)(0xdeadbeef^SMBD_DOOR_VERSION))
166 #define	SMBD_DOOR_SIZE		256
167 
168 #define	SMBD_DOOR_SRV_SUCCESS	0
169 #define	SMBD_DOOR_SRV_ERROR	-1
170 
171 #define	SMBD_DOOR_JOIN				1
172 #define	SMBD_DOOR_PARAM_GET			2
173 #define	SMBD_DOOR_PARAM_SET			3
174 #define	SMBD_DOOR_NETBIOS_RECONFIG		4
175 
176 #ifdef __cplusplus
177 }
178 #endif
179 
180 #endif /* _SMBSRV_SMBINFO_H */
181