Print this page
12513 SMB 3.1.1 support for server
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/common/smbsrv/smbinfo.h
+++ new/usr/src/uts/common/smbsrv/smbinfo.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
↓ open down ↓ |
13 lines elided |
↑ open up ↑ |
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21 /*
22 22 * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
23 23 * Copyright 2018 Nexenta Systems, Inc. All rights reserved.
24 + * Copyright 2020 RackTop Systems, Inc.
24 25 */
25 26
26 27 #ifndef _SMBSRV_SMBINFO_H
27 28 #define _SMBSRV_SMBINFO_H
28 29
29 30 #include <sys/types.h>
30 31 #include <sys/uuid.h>
31 32 #include <smbsrv/netbios.h>
32 33 #include <netinet/in.h>
33 34 #include <smbsrv/smb_inet.h>
34 35
35 36 #ifdef __cplusplus
36 37 extern "C" {
37 38 #endif
38 39
39 40 /*
40 41 * Native OS types used in SmbSessionSetupX.
41 42 */
42 43 #ifndef NATIVE_OS_DEFINED
43 44 #define NATIVE_OS_DEFINED
44 45
45 46 #define NATIVE_OS_UNKNOWN 0x00000000
46 47 #define NATIVE_OS_WINNT 0x00000001
47 48 #define NATIVE_OS_WIN95 0x00000002
48 49 #define NATIVE_OS_MACOS 0x00000003
49 50 #define NATIVE_OS_WIN2000 0x00000004
50 51
51 52 #endif /* NATIVE_OS_DEFINED */
52 53
53 54
54 55 /*
55 56 * Native lanman types in SmbSessionSetupX. Note that these values
56 57 * are not directly related to the negotiated protocol dialect.
57 58 */
58 59 #ifndef NATIVE_LANMAN_DEFINED
59 60 #define NATIVE_LANMAN_DEFINED
60 61
61 62 #define NATIVE_LM_NONE 0x00000000
62 63 #define NATIVE_LM_NT 0x00000001
63 64 #define NATIVE_LM_WIN2000 0x00000002
64 65
65 66 #endif /* NATIVE_LANMAN_DEFINED */
66 67
67 68
68 69 /* PDC types to be used in user authentication process */
69 70
70 71 #define PDC_UNKNOWN 0
71 72 #define PDC_WINNT 1
72 73 #define PDC_WIN2000 2
73 74 #define PDC_WINXP 3
74 75 #define PDC_SAMBA 4
75 76
76 77 /*
77 78 * Please replace the use of MAX_NETWORKS with SMB_PI_MAX_NETWORKS if
78 79 * you find it used in conjunction with smbparm_info and maybe one day
79 80 * there will be just a single definition (here) throughout the code.
80 81 */
81 82 #ifndef MAX_NETWORKS
82 83 #define MAX_NETWORKS 36
83 84 #endif /* MAX_NETWORKS */
84 85
85 86 #define SMB_PI_MAX_NETWORKS 36
86 87 #define SMB_PI_MAX_WINS 2
87 88
88 89 #define SMB_SECMODE_WORKGRP 1
89 90 #define SMB_SECMODE_DOMAIN 2
90 91
91 92 #define SMB_PI_MAX_HOST 48
92 93 #define SMB_PI_MAX_DOMAIN 256
93 94 #define SMB_PI_MAX_SCOPE 16
94 95 #define SMB_PI_MAX_COMMENT 58
95 96 #define SMB_PI_MAX_NATIVE_OS 32
96 97 #define SMB_PI_MAX_LANMAN 32
97 98 #define SMB_PI_MAX_NEGTOK 256 /* GUID and SMB negotiate token */
98 99
99 100 #define SMB_PI_KEEP_ALIVE_MIN (90 * 60)
100 101 /*
101 102 * Some older clients (Windows 98) only handle the low byte
102 103 * of the max workers value. If the low byte is less than
103 104 * SMB_PI_MAX_WORKERS_MIN we set it to SMB_PI_MAX_WORKERS_MIN.
104 105 * SMB_PI_MAX_WORKERS_MIN must therefore be < 256
105 106 */
106 107 #define SMB_PI_MAX_WORKERS_MIN 64
107 108 #define SMB_PI_MAX_WORKERS_DEF 1024
108 109 #define SMB_PI_MAX_WORKERS_MAX 16384
109 110
110 111 /*
111 112 * Min/max initial credit grant and credit limit we allow to be
112 113 * configured via SMB_CI_INITIAL_CREDITS, SMB_CI_MAXIMUM_CREDITS
113 114 */
114 115 #define SMB_PI_INITIAL_CREDITS_MIN 16
115 116 #define SMB_PI_INITIAL_CREDITS_DEF 20
116 117 #define SMB_PI_INITIAL_CREDITS_MAX 256
117 118
118 119 #define SMB_PI_MAXIMUM_CREDITS_MIN 64
119 120 #define SMB_PI_MAXIMUM_CREDITS_DEF 1000
120 121 #define SMB_PI_MAXIMUM_CREDITS_MAX 1024
121 122
122 123 /*
123 124 * sv_size is used by the RPC services and should be set to
124 125 * sizeof (smb_version_t).
125 126 */
126 127 typedef struct smb_version {
127 128 uint32_t sv_size;
128 129 uint32_t sv_major;
129 130 uint32_t sv_minor;
130 131 uint32_t sv_build_number;
131 132 uint32_t sv_platform_id;
132 133 } smb_version_t;
133 134
134 135 typedef enum smb_cfg_val {
135 136 SMB_CONFIG_DISABLED = 0,
136 137 SMB_CONFIG_ENABLED = 1,
137 138 SMB_CONFIG_REQUIRED = 2
138 139 } smb_cfg_val_t;
139 140
140 141 void smb_cfg_set_require(const char *, smb_cfg_val_t *);
141 142
142 143 /* See also: smb_ioc_cfg_t */
143 144 typedef struct smb_kmod_cfg {
144 145 uint32_t skc_maxworkers;
145 146 uint32_t skc_maxconnections;
146 147 uint32_t skc_keepalive;
147 148 int32_t skc_restrict_anon;
148 149 int32_t skc_signing_enable;
149 150 int32_t skc_signing_required;
↓ open down ↓ |
116 lines elided |
↑ open up ↑ |
150 151 int32_t skc_oplock_enable;
151 152 int32_t skc_sync_enable;
152 153 int32_t skc_secmode;
153 154 int32_t skc_netbios_enable;
154 155 int32_t skc_ipv6_enable;
155 156 int32_t skc_print_enable;
156 157 int32_t skc_traverse_mounts;
157 158 uint32_t skc_max_protocol; /* SMB_VERS_... */
158 159 uint32_t skc_min_protocol; /* SMB_VERS_... */
159 160 smb_cfg_val_t skc_encrypt; /* EncryptData and RejectUnencryptedAccess */
161 + uint16_t skc_encrypt_cipher; /* 3.1.1 encryption cipher */
160 162 uint32_t skc_execflags;
161 163 uint32_t skc_negtok_len;
162 164 smb_version_t skc_version;
163 165 uint16_t skc_initial_credits;
164 166 uint16_t skc_maximum_credits;
165 167 uuid_t skc_machine_uuid;
166 168 uchar_t skc_negtok[SMB_PI_MAX_NEGTOK];
167 169 char skc_native_os[SMB_PI_MAX_NATIVE_OS];
168 170 char skc_native_lm[SMB_PI_MAX_LANMAN];
169 171 char skc_nbdomain[NETBIOS_NAME_SZ];
170 172 char skc_fqdn[SMB_PI_MAX_DOMAIN];
171 173 char skc_hostname[SMB_PI_MAX_HOST];
172 174 char skc_system_comment[SMB_PI_MAX_COMMENT];
173 175 } smb_kmod_cfg_t;
174 176
175 177 #define SMB_EXEC_MAP 0x01
176 178 #define SMB_EXEC_UNMAP 0x02
177 179 #define SMB_EXEC_TERM 0x04
178 180
179 181 #define SMB_EXEC_DISP_CONTINUE "continue"
180 182 #define SMB_EXEC_DISP_TERMINATE "terminate"
181 183
182 184 /*
183 185 * Major version numbers
184 186 */
185 187 #define SMB_MAJOR_NT 4 /* Windows 95/98/Me, Windows NT4.0 */
186 188 #define SMB_MAJOR_2000 5
187 189 #define SMB_MAJOR_XP 5
188 190 #define SMB_MAJOR_2003 5
189 191 #define SMB_MAJOR_VISTA 6
190 192 #define SMB_MAJOR_2008 6
191 193 #define SMB_MAJOR_2008R2 6
192 194 #define SMB_MAJOR_7 6
193 195
194 196 /*
195 197 * Minor version numbers
196 198 */
197 199 #define SMB_MINOR_NT 0
198 200 #define SMB_MINOR_2000 0
199 201 #define SMB_MINOR_XP 1
200 202 #define SMB_MINOR_2003 2
201 203 #define SMB_MINOR_VISTA 0
202 204 #define SMB_MINOR_2008 0
203 205 #define SMB_MINOR_2008R2 1
204 206 #define SMB_MINOR_7 1
205 207
206 208 /*
207 209 * Max version length in string format
208 210 */
209 211 #define SMB_VERSTR_LEN 8
210 212
211 213 int smbnative_os_value(const char *);
212 214 int smbnative_lm_value(const char *);
213 215 int smbnative_pdc_value(const char *);
214 216 const char *smbnative_os_str(smb_version_t *);
215 217 const char *smbnative_lm_str(smb_version_t *);
216 218
217 219 /*
218 220 * Support for passthrough authentication.
219 221 */
220 222 #define AUTH_USER_GRANT 0x00000000
221 223 #define AUTH_GUEST_GRANT 0x00000001
222 224 #define AUTH_IPC_ONLY_GRANT 0x00000002
223 225
↓ open down ↓ |
54 lines elided |
↑ open up ↑ |
224 226 /*
225 227 * Defined SMB1, SMB2(+) protocol versions, as returned by
226 228 * smb_config_get_max_protocol()
227 229 */
228 230 #define SMB_VERS_1 1 /* arbitrary value < 0x200 */
229 231 #define SMB_VERS_2_BASE 0x200 /* for (SMB2 or higher?) tests */
230 232 #define SMB_VERS_2_002 0x202 /* "2.002" */
231 233 #define SMB_VERS_2_1 0x210 /* "2.1" */
232 234 #define SMB_VERS_3_0 0x300 /* "3.0" */
233 235 #define SMB_VERS_3_02 0x302 /* "3.02" */
236 +#define SMB_VERS_3_11 0x311 /* "3.11" */
237 +
238 +#define SMB3_HASH_SHA512 1
239 +
240 +#define SMB3_CIPHER_NONE 0
241 +#define SMB3_CIPHER_AES128_CCM 1
242 +#define SMB3_CIPHER_AES128_GCM 2
234 243
235 244 #ifdef __cplusplus
236 245 }
237 246 #endif
238 247
239 248 #endif /* _SMBSRV_SMBINFO_H */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX