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