xref: /titanic_52/usr/src/uts/common/smbsrv/smbinfo.h (revision fcf3ce441efd61da9bb2884968af01cb7c1452cc)
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	"@(#)smbinfo.h	1.5	08/07/08 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_maxworkers;
127 	uint32_t skc_maxconnections;
128 	uint32_t skc_keepalive;
129 	int32_t skc_restrict_anon;
130 	int32_t skc_signing_enable;
131 	int32_t skc_signing_required;
132 	int32_t skc_oplock_enable;
133 	int32_t skc_sync_enable;
134 	int32_t skc_secmode;
135 
136 	char skc_resource_domain[SMB_PI_MAX_DOMAIN];
137 	char skc_hostname[SMB_PI_MAX_HOST];
138 	char skc_system_comment[SMB_PI_MAX_COMMENT];
139 } smb_kmod_cfg_t;
140 
141 #define	SMB_VERSION_MAJOR  4
142 #define	SMB_VERSION_MINOR  0
143 
144 int smbnative_os_value(char *native_os);
145 int smbnative_lm_value(char *native_lm);
146 int smbnative_pdc_value(char *native_lm);
147 
148 /*
149  * Support for passthrough authentication.
150  */
151 #define	AUTH_USER_GRANT			0x00000000
152 #define	AUTH_GUEST_GRANT		0x00000001
153 #define	AUTH_IPC_ONLY_GRANT		0x00000002
154 #define	AUTH_CONEXUS_GRANT		0x00000004
155 
156 #ifdef __cplusplus
157 }
158 #endif
159 
160 #endif /* _SMBSRV_SMBINFO_H */
161