xref: /onnv-gate/usr/src/uts/common/smbsrv/smbinfo.h (revision 12508:edb7861a1533)
15331Samw /*
25331Samw  * CDDL HEADER START
35331Samw  *
45331Samw  * The contents of this file are subject to the terms of the
55331Samw  * Common Development and Distribution License (the "License").
65331Samw  * You may not use this file except in compliance with the License.
75331Samw  *
85331Samw  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
95331Samw  * or http://www.opensolaris.org/os/licensing.
105331Samw  * See the License for the specific language governing permissions
115331Samw  * and limitations under the License.
125331Samw  *
135331Samw  * When distributing Covered Code, include this CDDL HEADER in each
145331Samw  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
155331Samw  * If applicable, add the following below this CDDL HEADER, with the
165331Samw  * fields enclosed by brackets "[]" replaced with your own identifying
175331Samw  * information: Portions Copyright [yyyy] [name of copyright owner]
185331Samw  *
195331Samw  * CDDL HEADER END
205331Samw  */
215331Samw /*
22*12508Samw@Sun.COM  * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
235331Samw  */
245331Samw 
255331Samw #ifndef	_SMBSRV_SMBINFO_H
265331Samw #define	_SMBSRV_SMBINFO_H
275331Samw 
285331Samw #include <sys/types.h>
297961SNatalie.Li@Sun.COM #include <smbsrv/netbios.h>
308670SJose.Borrego@Sun.COM #include <netinet/in.h>
318670SJose.Borrego@Sun.COM #include <smbsrv/smb_inet.h>
325331Samw 
335331Samw #ifdef __cplusplus
345331Samw extern "C" {
355331Samw #endif
365331Samw 
375331Samw /*
385331Samw  * Native OS types used in SmbSessionSetupX.
395331Samw  */
405331Samw #ifndef NATIVE_OS_DEFINED
415331Samw #define	NATIVE_OS_DEFINED
425331Samw 
435331Samw #define	NATIVE_OS_UNKNOWN	0x00000000
4410717Samw@Sun.COM #define	NATIVE_OS_WINNT		0x00000001
455331Samw #define	NATIVE_OS_WIN95		0x00000002
4610717Samw@Sun.COM #define	NATIVE_OS_MACOS		0x00000003
4710717Samw@Sun.COM #define	NATIVE_OS_WIN2000	0x00000004
485331Samw 
495331Samw #endif /* NATIVE_OS_DEFINED */
505331Samw 
515331Samw 
525331Samw /*
535331Samw  * Native lanman types in SmbSessionSetupX. Note that these values
545331Samw  * are not directly related to the negotiated protocol dialect.
555331Samw  */
565331Samw #ifndef NATIVE_LANMAN_DEFINED
575331Samw #define	NATIVE_LANMAN_DEFINED
585331Samw 
595331Samw #define	NATIVE_LM_NONE		0x00000000
605331Samw #define	NATIVE_LM_NT		0x00000001
615331Samw #define	NATIVE_LM_WIN2000	0x00000002
625331Samw 
635331Samw #endif /* NATIVE_LANMAN_DEFINED */
645331Samw 
655331Samw 
665331Samw /* PDC types to be used in user authentication process */
675331Samw 
685331Samw #define	PDC_UNKNOWN		0
695331Samw #define	PDC_WINNT		1
705331Samw #define	PDC_WIN2000		2
715331Samw #define	PDC_WINXP		3
725331Samw #define	PDC_SAMBA		4
735331Samw 
745331Samw /*
755331Samw  * Please replace the use of MAX_NETWORKS with SMB_PI_MAX_NETWORKS if
765331Samw  * you find it used in conjunction with smbparm_info and maybe one day
775331Samw  * there will be just a single definition (here) throughout the code.
785331Samw  */
795331Samw #ifndef MAX_NETWORKS
805331Samw #define	MAX_NETWORKS		36
815331Samw #endif /* MAX_NETWORKS */
825331Samw 
835331Samw #define	SMB_PI_MAX_NETWORKS	36
845331Samw #define	SMB_PI_MAX_WINS		2
855331Samw 
865331Samw #define	SMB_SECMODE_WORKGRP	1
875331Samw #define	SMB_SECMODE_DOMAIN	2
885331Samw 
895331Samw #define	SMB_PI_MAX_HOST		48
907961SNatalie.Li@Sun.COM #define	SMB_PI_MAX_DOMAIN	256
915331Samw #define	SMB_PI_MAX_SCOPE	16
925331Samw #define	SMB_PI_MAX_COMMENT	58
935331Samw #define	SMB_PI_MAX_NATIVE_OS	32
945331Samw #define	SMB_PI_MAX_LANMAN	32
955331Samw 
965331Samw #define	SMB_PI_KEEP_ALIVE_MIN		(90 * 60)
979343SAfshin.Ardakani@Sun.COM /*
989343SAfshin.Ardakani@Sun.COM  * Some older clients (Windows 98) only handle the low byte
999343SAfshin.Ardakani@Sun.COM  * of the max workers value. If the low byte is less than
1009343SAfshin.Ardakani@Sun.COM  * SMB_PI_MAX_WORKERS_MIN we set it to SMB_PI_MAX_WORKERS_MIN.
1019343SAfshin.Ardakani@Sun.COM  * SMB_PI_MAX_WORKERS_MIN must therefore be < 256
1029343SAfshin.Ardakani@Sun.COM  */
1039343SAfshin.Ardakani@Sun.COM #define	SMB_PI_MAX_WORKERS_MIN		64
10411963SAfshin.Ardakani@Sun.COM 
10511963SAfshin.Ardakani@Sun.COM typedef struct smb_version {
10611963SAfshin.Ardakani@Sun.COM 	uint8_t sv_major;
10711963SAfshin.Ardakani@Sun.COM 	uint8_t sv_minor;
10811963SAfshin.Ardakani@Sun.COM } smb_version_t;
1095331Samw 
1105331Samw typedef struct smb_kmod_cfg {
1115331Samw 	uint32_t skc_maxworkers;
1125331Samw 	uint32_t skc_maxconnections;
1135331Samw 	uint32_t skc_keepalive;
1145772Sas200622 	int32_t skc_restrict_anon;
1155772Sas200622 	int32_t skc_signing_enable;
1165772Sas200622 	int32_t skc_signing_required;
1175772Sas200622 	int32_t skc_oplock_enable;
1185772Sas200622 	int32_t skc_sync_enable;
1195772Sas200622 	int32_t skc_secmode;
1208670SJose.Borrego@Sun.COM 	int32_t skc_ipv6_enable;
121*12508Samw@Sun.COM 	uint32_t skc_execflags;
12211963SAfshin.Ardakani@Sun.COM 	smb_version_t skc_version;
1237961SNatalie.Li@Sun.COM 	char skc_nbdomain[NETBIOS_NAME_SZ];
1247961SNatalie.Li@Sun.COM 	char skc_fqdn[SMB_PI_MAX_DOMAIN];
1255331Samw 	char skc_hostname[SMB_PI_MAX_HOST];
1265331Samw 	char skc_system_comment[SMB_PI_MAX_COMMENT];
1275331Samw } smb_kmod_cfg_t;
1285331Samw 
129*12508Samw@Sun.COM #define	SMB_EXEC_MAP	0x01
130*12508Samw@Sun.COM #define	SMB_EXEC_UNMAP	0x02
131*12508Samw@Sun.COM #define	SMB_EXEC_TERM	0x04
132*12508Samw@Sun.COM 
133*12508Samw@Sun.COM #define	SMB_EXEC_DISP_CONTINUE	"continue"
134*12508Samw@Sun.COM #define	SMB_EXEC_DISP_TERMINATE	"terminate"
135*12508Samw@Sun.COM 
13611963SAfshin.Ardakani@Sun.COM /*
13711963SAfshin.Ardakani@Sun.COM  * Major version numbers
13811963SAfshin.Ardakani@Sun.COM  */
13911963SAfshin.Ardakani@Sun.COM #define	SMB_MAJOR_NT		4
14011963SAfshin.Ardakani@Sun.COM #define	SMB_MAJOR_2000		5
14111963SAfshin.Ardakani@Sun.COM #define	SMB_MAJOR_XP		5
14211963SAfshin.Ardakani@Sun.COM #define	SMB_MAJOR_2003		5
14311963SAfshin.Ardakani@Sun.COM #define	SMB_MAJOR_VISTA		6
14411963SAfshin.Ardakani@Sun.COM #define	SMB_MAJOR_2008		6
14511963SAfshin.Ardakani@Sun.COM #define	SMB_MAJOR_2008R2	6
14611963SAfshin.Ardakani@Sun.COM 
14711963SAfshin.Ardakani@Sun.COM /*
14811963SAfshin.Ardakani@Sun.COM  * Minor version numbers
14911963SAfshin.Ardakani@Sun.COM  */
15011963SAfshin.Ardakani@Sun.COM #define	SMB_MINOR_NT		0
15111963SAfshin.Ardakani@Sun.COM #define	SMB_MINOR_2000		0
15211963SAfshin.Ardakani@Sun.COM #define	SMB_MINOR_XP		1
15311963SAfshin.Ardakani@Sun.COM #define	SMB_MINOR_2003		2
15411963SAfshin.Ardakani@Sun.COM #define	SMB_MINOR_VISTA		0
15511963SAfshin.Ardakani@Sun.COM #define	SMB_MINOR_2008		0
15611963SAfshin.Ardakani@Sun.COM #define	SMB_MINOR_2008R2	1
15711963SAfshin.Ardakani@Sun.COM 
15811963SAfshin.Ardakani@Sun.COM /*
15911963SAfshin.Ardakani@Sun.COM  * Max version length in string format
16011963SAfshin.Ardakani@Sun.COM  */
16111963SAfshin.Ardakani@Sun.COM #define	SMB_VERSTR_LEN		8
1625331Samw 
1639021Samw@Sun.COM int smbnative_os_value(const char *);
1649021Samw@Sun.COM int smbnative_lm_value(const char *);
1659021Samw@Sun.COM int smbnative_pdc_value(const char *);
16611963SAfshin.Ardakani@Sun.COM const char *smbnative_os_str(smb_version_t *);
16711963SAfshin.Ardakani@Sun.COM const char *smbnative_lm_str(smb_version_t *);
1685331Samw 
1695331Samw /*
1705331Samw  * Support for passthrough authentication.
1715331Samw  */
1725331Samw #define	AUTH_USER_GRANT			0x00000000
1735331Samw #define	AUTH_GUEST_GRANT		0x00000001
1745331Samw #define	AUTH_IPC_ONLY_GRANT		0x00000002
1755331Samw 
1765331Samw #ifdef __cplusplus
1775331Samw }
1785331Samw #endif
1795331Samw 
1805331Samw #endif /* _SMBSRV_SMBINFO_H */
181