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