8322 nl: misleading-indentation
[unleashed/tickless.git] / usr / src / uts / common / smbsrv / smbinfo.h
blobe513eb5e4392cac8afc5447f515a7f804b7b15c1
1 /*
2 * CDDL HEADER START
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.
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.
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]
19 * CDDL HEADER END
22 * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
23 * Copyright 2015 Nexenta Systems, Inc. All rights reserved.
26 #ifndef _SMBSRV_SMBINFO_H
27 #define _SMBSRV_SMBINFO_H
29 #include <sys/types.h>
30 #include <sys/uuid.h>
31 #include <smbsrv/netbios.h>
32 #include <netinet/in.h>
33 #include <smbsrv/smb_inet.h>
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
40 * Native OS types used in SmbSessionSetupX.
42 #ifndef NATIVE_OS_DEFINED
43 #define NATIVE_OS_DEFINED
45 #define NATIVE_OS_UNKNOWN 0x00000000
46 #define NATIVE_OS_WINNT 0x00000001
47 #define NATIVE_OS_WIN95 0x00000002
48 #define NATIVE_OS_MACOS 0x00000003
49 #define NATIVE_OS_WIN2000 0x00000004
51 #endif /* NATIVE_OS_DEFINED */
55 * Native lanman types in SmbSessionSetupX. Note that these values
56 * are not directly related to the negotiated protocol dialect.
58 #ifndef NATIVE_LANMAN_DEFINED
59 #define NATIVE_LANMAN_DEFINED
61 #define NATIVE_LM_NONE 0x00000000
62 #define NATIVE_LM_NT 0x00000001
63 #define NATIVE_LM_WIN2000 0x00000002
65 #endif /* NATIVE_LANMAN_DEFINED */
68 /* PDC types to be used in user authentication process */
70 #define PDC_UNKNOWN 0
71 #define PDC_WINNT 1
72 #define PDC_WIN2000 2
73 #define PDC_WINXP 3
74 #define PDC_SAMBA 4
77 * Please replace the use of MAX_NETWORKS with SMB_PI_MAX_NETWORKS if
78 * you find it used in conjunction with smbparm_info and maybe one day
79 * there will be just a single definition (here) throughout the code.
81 #ifndef MAX_NETWORKS
82 #define MAX_NETWORKS 36
83 #endif /* MAX_NETWORKS */
85 #define SMB_PI_MAX_NETWORKS 36
86 #define SMB_PI_MAX_WINS 2
88 #define SMB_SECMODE_WORKGRP 1
89 #define SMB_SECMODE_DOMAIN 2
91 #define SMB_PI_MAX_HOST 48
92 #define SMB_PI_MAX_DOMAIN 256
93 #define SMB_PI_MAX_SCOPE 16
94 #define SMB_PI_MAX_COMMENT 58
95 #define SMB_PI_MAX_NATIVE_OS 32
96 #define SMB_PI_MAX_LANMAN 32
97 #define SMB_PI_MAX_NEGTOK 256 /* GUID and SMB negotiate token */
99 #define SMB_PI_KEEP_ALIVE_MIN (90 * 60)
101 * Some older clients (Windows 98) only handle the low byte
102 * of the max workers value. If the low byte is less than
103 * SMB_PI_MAX_WORKERS_MIN we set it to SMB_PI_MAX_WORKERS_MIN.
104 * SMB_PI_MAX_WORKERS_MIN must therefore be < 256
106 #define SMB_PI_MAX_WORKERS_MIN 64
107 #define SMB_PI_MAX_WORKERS_DEF 1024
108 #define SMB_PI_MAX_WORKERS_MAX 16384
111 * Min/max initial credit grant and credit limit we allow to be
112 * configured via SMB_CI_INITIAL_CREDITS, SMB_CI_MAXIMUM_CREDITS
114 #define SMB_PI_INITIAL_CREDITS_MIN 16
115 #define SMB_PI_INITIAL_CREDITS_DEF 20
116 #define SMB_PI_INITIAL_CREDITS_MAX 256
118 #define SMB_PI_MAXIMUM_CREDITS_MIN 64
119 #define SMB_PI_MAXIMUM_CREDITS_DEF 1000
120 #define SMB_PI_MAXIMUM_CREDITS_MAX 1024
123 * sv_size is used by the RPC services and should be set to
124 * sizeof (smb_version_t).
126 typedef struct smb_version {
127 uint32_t sv_size;
128 uint32_t sv_major;
129 uint32_t sv_minor;
130 uint32_t sv_build_number;
131 uint32_t sv_platform_id;
132 } smb_version_t;
134 /* See also: smb_ioc_cfg_t */
135 typedef struct smb_kmod_cfg {
136 uint32_t skc_maxworkers;
137 uint32_t skc_maxconnections;
138 uint32_t skc_keepalive;
139 int32_t skc_restrict_anon;
140 int32_t skc_signing_enable;
141 int32_t skc_signing_required;
142 int32_t skc_oplock_enable;
143 int32_t skc_sync_enable;
144 int32_t skc_secmode;
145 int32_t skc_netbios_enable;
146 int32_t skc_ipv6_enable;
147 int32_t skc_print_enable;
148 int32_t skc_traverse_mounts;
149 uint32_t skc_max_protocol; /* SMB_VERS_... */
150 uint32_t skc_execflags;
151 uint32_t skc_negtok_len;
152 smb_version_t skc_version;
153 uint16_t skc_initial_credits;
154 uint16_t skc_maximum_credits;
155 uuid_t skc_machine_uuid;
156 uchar_t skc_negtok[SMB_PI_MAX_NEGTOK];
157 char skc_native_os[SMB_PI_MAX_NATIVE_OS];
158 char skc_native_lm[SMB_PI_MAX_LANMAN];
159 char skc_nbdomain[NETBIOS_NAME_SZ];
160 char skc_fqdn[SMB_PI_MAX_DOMAIN];
161 char skc_hostname[SMB_PI_MAX_HOST];
162 char skc_system_comment[SMB_PI_MAX_COMMENT];
163 } smb_kmod_cfg_t;
165 #define SMB_EXEC_MAP 0x01
166 #define SMB_EXEC_UNMAP 0x02
167 #define SMB_EXEC_TERM 0x04
169 #define SMB_EXEC_DISP_CONTINUE "continue"
170 #define SMB_EXEC_DISP_TERMINATE "terminate"
173 * Major version numbers
175 #define SMB_MAJOR_NT 4 /* Windows 95/98/Me, Windows NT4.0 */
176 #define SMB_MAJOR_2000 5
177 #define SMB_MAJOR_XP 5
178 #define SMB_MAJOR_2003 5
179 #define SMB_MAJOR_VISTA 6
180 #define SMB_MAJOR_2008 6
181 #define SMB_MAJOR_2008R2 6
182 #define SMB_MAJOR_7 6
185 * Minor version numbers
187 #define SMB_MINOR_NT 0
188 #define SMB_MINOR_2000 0
189 #define SMB_MINOR_XP 1
190 #define SMB_MINOR_2003 2
191 #define SMB_MINOR_VISTA 0
192 #define SMB_MINOR_2008 0
193 #define SMB_MINOR_2008R2 1
194 #define SMB_MINOR_7 1
197 * Max version length in string format
199 #define SMB_VERSTR_LEN 8
201 int smbnative_os_value(const char *);
202 int smbnative_lm_value(const char *);
203 int smbnative_pdc_value(const char *);
204 const char *smbnative_os_str(smb_version_t *);
205 const char *smbnative_lm_str(smb_version_t *);
208 * Support for passthrough authentication.
210 #define AUTH_USER_GRANT 0x00000000
211 #define AUTH_GUEST_GRANT 0x00000001
212 #define AUTH_IPC_ONLY_GRANT 0x00000002
215 * Defined SMB1, SMB2(+) protocol versions, as returned by
216 * smb_config_get_max_protocol()
218 #define SMB_VERS_1 1 /* arbitrary value < 0x200 */
219 #define SMB_VERS_2_BASE 0x200 /* for (SMB2 or higher?) tests */
220 #define SMB_VERS_2_002 0x202 /* "2.002" */
221 #define SMB_VERS_2_1 0x210 /* "2.1" */
222 #define SMB_VERS_3_0 0x300 /* "3.0" */
224 #ifdef __cplusplus
226 #endif
228 #endif /* _SMBSRV_SMBINFO_H */