xref: /titanic_44/usr/src/uts/common/smbsrv/smbinfo.h (revision 29bd28862cfb8abbd3a0f0a4b17e08bbc3652836)
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	_SMBSRV_SMBINFO_H
27 #define	_SMBSRV_SMBINFO_H
28 
29 #include <sys/types.h>
30 #include <smbsrv/netbios.h>
31 #include <netinet/in.h>
32 #include <smbsrv/smb_inet.h>
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
38 /*
39  * Native OS types used in SmbSessionSetupX.
40  */
41 #ifndef NATIVE_OS_DEFINED
42 #define	NATIVE_OS_DEFINED
43 
44 #define	NATIVE_OS_UNKNOWN	0x00000000
45 #define	NATIVE_OS_NT4_0		0x00000001
46 #define	NATIVE_OS_WIN95		0x00000002
47 #define	NATIVE_OS_OTHER		0x00000003
48 #define	NATIVE_OS_NT5_0		0x00000004
49 #define	NATIVE_OS_NT5_1		0x00000005
50 #define	NATIVE_OS_MACOS		0x00000006
51 
52 /*
53  * Backward compatibility aliases.
54  */
55 #define	NATIVE_OS_WINNT		NATIVE_OS_NT4_0
56 #define	NATIVE_OS_WIN2000	NATIVE_OS_NT5_0
57 #define	NATIVE_OS_WINXP		NATIVE_OS_NT5_1
58 
59 #endif /* NATIVE_OS_DEFINED */
60 
61 
62 /*
63  * Native lanman types in SmbSessionSetupX. Note that these values
64  * are not directly related to the negotiated protocol dialect.
65  */
66 #ifndef NATIVE_LANMAN_DEFINED
67 #define	NATIVE_LANMAN_DEFINED
68 
69 #define	NATIVE_LM_NONE		0x00000000
70 #define	NATIVE_LM_NT		0x00000001
71 #define	NATIVE_LM_WIN2000	0x00000002
72 
73 #endif /* NATIVE_LANMAN_DEFINED */
74 
75 
76 /* PDC types to be used in user authentication process */
77 
78 #define	PDC_UNKNOWN		0
79 #define	PDC_WINNT		1
80 #define	PDC_WIN2000		2
81 #define	PDC_WINXP		3
82 #define	PDC_SAMBA		4
83 
84 /*
85  * Please replace the use of MAX_NETWORKS with SMB_PI_MAX_NETWORKS if
86  * you find it used in conjunction with smbparm_info and maybe one day
87  * there will be just a single definition (here) throughout the code.
88  */
89 #ifndef MAX_NETWORKS
90 #define	MAX_NETWORKS		36
91 #endif /* MAX_NETWORKS */
92 
93 #define	SMB_PI_MAX_NETWORKS	36
94 #define	SMB_PI_MAX_WINS		2
95 
96 #define	SMB_SECMODE_WORKGRP	1
97 #define	SMB_SECMODE_DOMAIN	2
98 
99 #define	SMB_PI_MAX_HOST		48
100 #define	SMB_PI_MAX_DOMAIN	256
101 #define	SMB_PI_MAX_SCOPE	16
102 #define	SMB_PI_MAX_COMMENT	58
103 #define	SMB_PI_MAX_NATIVE_OS	32
104 #define	SMB_PI_MAX_LANMAN	32
105 
106 #define	SMB_PI_KEEP_ALIVE_MIN		(90 * 60)
107 /*
108  * Some older clients (Windows 98) only handle the low byte
109  * of the max workers value. If the low byte is less than
110  * SMB_PI_MAX_WORKERS_MIN we set it to SMB_PI_MAX_WORKERS_MIN.
111  * SMB_PI_MAX_WORKERS_MIN must therefore be < 256
112  */
113 #define	SMB_PI_MAX_WORKERS_MIN		64
114 #define	SMB_LM_COMPATIBILITY_DEFAULT_LEV 3
115 
116 typedef struct smb_kmod_cfg {
117 	uint32_t skc_maxworkers;
118 	uint32_t skc_maxconnections;
119 	uint32_t skc_keepalive;
120 	int32_t skc_restrict_anon;
121 	int32_t skc_signing_enable;
122 	int32_t skc_signing_required;
123 	int32_t skc_oplock_enable;
124 	int32_t skc_sync_enable;
125 	int32_t skc_secmode;
126 	int32_t skc_ipv6_enable;
127 	char skc_nbdomain[NETBIOS_NAME_SZ];
128 	char skc_fqdn[SMB_PI_MAX_DOMAIN];
129 	char skc_hostname[SMB_PI_MAX_HOST];
130 	char skc_system_comment[SMB_PI_MAX_COMMENT];
131 } smb_kmod_cfg_t;
132 
133 #define	SMB_VERSION_MAJOR  4
134 #define	SMB_VERSION_MINOR  0
135 
136 int smbnative_os_value(const char *);
137 int smbnative_lm_value(const char *);
138 int smbnative_pdc_value(const char *);
139 
140 /*
141  * Support for passthrough authentication.
142  */
143 #define	AUTH_USER_GRANT			0x00000000
144 #define	AUTH_GUEST_GRANT		0x00000001
145 #define	AUTH_IPC_ONLY_GRANT		0x00000002
146 #define	AUTH_CONEXUS_GRANT		0x00000004
147 
148 #ifdef __cplusplus
149 }
150 #endif
151 
152 #endif /* _SMBSRV_SMBINFO_H */
153