xref: /titanic_41/usr/src/uts/common/smbsrv/smbinfo.h (revision 3afe87ebb25691cb6d158edaa34a6fb9b703a691)
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 
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 #define	SMB_PI_KEEP_ALIVE_MIN		(90 * 60)
105 #define	SMB_LM_COMPATIBILITY_DEFAULT_LEV 3
106 
107 typedef struct smb_kmod_cfg {
108 	uint32_t skc_maxworkers;
109 	uint32_t skc_maxconnections;
110 	uint32_t skc_keepalive;
111 	int32_t skc_restrict_anon;
112 	int32_t skc_signing_enable;
113 	int32_t skc_signing_required;
114 	int32_t skc_oplock_enable;
115 	int32_t skc_sync_enable;
116 	int32_t skc_secmode;
117 	char skc_nbdomain[NETBIOS_NAME_SZ];
118 	char skc_fqdn[SMB_PI_MAX_DOMAIN];
119 	char skc_hostname[SMB_PI_MAX_HOST];
120 	char skc_system_comment[SMB_PI_MAX_COMMENT];
121 } smb_kmod_cfg_t;
122 
123 #define	SMB_VERSION_MAJOR  4
124 #define	SMB_VERSION_MINOR  0
125 
126 int smbnative_os_value(char *native_os);
127 int smbnative_lm_value(char *native_lm);
128 int smbnative_pdc_value(char *native_lm);
129 
130 /*
131  * Support for passthrough authentication.
132  */
133 #define	AUTH_USER_GRANT			0x00000000
134 #define	AUTH_GUEST_GRANT		0x00000001
135 #define	AUTH_IPC_ONLY_GRANT		0x00000002
136 #define	AUTH_CONEXUS_GRANT		0x00000004
137 
138 #ifdef __cplusplus
139 }
140 #endif
141 
142 #endif /* _SMBSRV_SMBINFO_H */
143