xref: /onnv-gate/usr/src/uts/common/smbsrv/smbinfo.h (revision 13082:81ec56bf6147)
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 /*
2212508Samw@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 
105*13082SJoyce.McIntosh@Sun.COM /*
106*13082SJoyce.McIntosh@Sun.COM  * sv_size is used by the RPC services and should be set to
107*13082SJoyce.McIntosh@Sun.COM  * sizeof (smb_version_t).
108*13082SJoyce.McIntosh@Sun.COM  */
10911963SAfshin.Ardakani@Sun.COM typedef struct smb_version {
110*13082SJoyce.McIntosh@Sun.COM 	uint32_t	sv_size;
111*13082SJoyce.McIntosh@Sun.COM 	uint32_t	sv_major;
112*13082SJoyce.McIntosh@Sun.COM 	uint32_t	sv_minor;
113*13082SJoyce.McIntosh@Sun.COM 	uint32_t	sv_build_number;
114*13082SJoyce.McIntosh@Sun.COM 	uint32_t	sv_platform_id;
11511963SAfshin.Ardakani@Sun.COM } smb_version_t;
1165331Samw 
1175331Samw typedef struct smb_kmod_cfg {
1185331Samw 	uint32_t skc_maxworkers;
1195331Samw 	uint32_t skc_maxconnections;
1205331Samw 	uint32_t skc_keepalive;
1215772Sas200622 	int32_t skc_restrict_anon;
1225772Sas200622 	int32_t skc_signing_enable;
1235772Sas200622 	int32_t skc_signing_required;
1245772Sas200622 	int32_t skc_oplock_enable;
1255772Sas200622 	int32_t skc_sync_enable;
1265772Sas200622 	int32_t skc_secmode;
1278670SJose.Borrego@Sun.COM 	int32_t skc_ipv6_enable;
12812890SJoyce.McIntosh@Sun.COM 	int32_t skc_print_enable;
12912508Samw@Sun.COM 	uint32_t skc_execflags;
13011963SAfshin.Ardakani@Sun.COM 	smb_version_t skc_version;
1317961SNatalie.Li@Sun.COM 	char skc_nbdomain[NETBIOS_NAME_SZ];
1327961SNatalie.Li@Sun.COM 	char skc_fqdn[SMB_PI_MAX_DOMAIN];
1335331Samw 	char skc_hostname[SMB_PI_MAX_HOST];
1345331Samw 	char skc_system_comment[SMB_PI_MAX_COMMENT];
1355331Samw } smb_kmod_cfg_t;
1365331Samw 
13712508Samw@Sun.COM #define	SMB_EXEC_MAP	0x01
13812508Samw@Sun.COM #define	SMB_EXEC_UNMAP	0x02
13912508Samw@Sun.COM #define	SMB_EXEC_TERM	0x04
14012508Samw@Sun.COM 
14112508Samw@Sun.COM #define	SMB_EXEC_DISP_CONTINUE	"continue"
14212508Samw@Sun.COM #define	SMB_EXEC_DISP_TERMINATE	"terminate"
14312508Samw@Sun.COM 
14411963SAfshin.Ardakani@Sun.COM /*
14511963SAfshin.Ardakani@Sun.COM  * Major version numbers
14611963SAfshin.Ardakani@Sun.COM  */
147*13082SJoyce.McIntosh@Sun.COM #define	SMB_MAJOR_NT		4	/* Windows 95/98/Me, Windows NT4.0 */
14811963SAfshin.Ardakani@Sun.COM #define	SMB_MAJOR_2000		5
14911963SAfshin.Ardakani@Sun.COM #define	SMB_MAJOR_XP		5
15011963SAfshin.Ardakani@Sun.COM #define	SMB_MAJOR_2003		5
15111963SAfshin.Ardakani@Sun.COM #define	SMB_MAJOR_VISTA		6
15211963SAfshin.Ardakani@Sun.COM #define	SMB_MAJOR_2008		6
15311963SAfshin.Ardakani@Sun.COM #define	SMB_MAJOR_2008R2	6
154*13082SJoyce.McIntosh@Sun.COM #define	SMB_MAJOR_7		6
15511963SAfshin.Ardakani@Sun.COM 
15611963SAfshin.Ardakani@Sun.COM /*
15711963SAfshin.Ardakani@Sun.COM  * Minor version numbers
15811963SAfshin.Ardakani@Sun.COM  */
15911963SAfshin.Ardakani@Sun.COM #define	SMB_MINOR_NT		0
16011963SAfshin.Ardakani@Sun.COM #define	SMB_MINOR_2000		0
16111963SAfshin.Ardakani@Sun.COM #define	SMB_MINOR_XP		1
16211963SAfshin.Ardakani@Sun.COM #define	SMB_MINOR_2003		2
16311963SAfshin.Ardakani@Sun.COM #define	SMB_MINOR_VISTA		0
16411963SAfshin.Ardakani@Sun.COM #define	SMB_MINOR_2008		0
16511963SAfshin.Ardakani@Sun.COM #define	SMB_MINOR_2008R2	1
166*13082SJoyce.McIntosh@Sun.COM #define	SMB_MINOR_7		1
16711963SAfshin.Ardakani@Sun.COM 
16811963SAfshin.Ardakani@Sun.COM /*
16911963SAfshin.Ardakani@Sun.COM  * Max version length in string format
17011963SAfshin.Ardakani@Sun.COM  */
17111963SAfshin.Ardakani@Sun.COM #define	SMB_VERSTR_LEN		8
1725331Samw 
1739021Samw@Sun.COM int smbnative_os_value(const char *);
1749021Samw@Sun.COM int smbnative_lm_value(const char *);
1759021Samw@Sun.COM int smbnative_pdc_value(const char *);
17611963SAfshin.Ardakani@Sun.COM const char *smbnative_os_str(smb_version_t *);
17711963SAfshin.Ardakani@Sun.COM const char *smbnative_lm_str(smb_version_t *);
1785331Samw 
1795331Samw /*
1805331Samw  * Support for passthrough authentication.
1815331Samw  */
1825331Samw #define	AUTH_USER_GRANT			0x00000000
1835331Samw #define	AUTH_GUEST_GRANT		0x00000001
1845331Samw #define	AUTH_IPC_ONLY_GRANT		0x00000002
1855331Samw 
1865331Samw #ifdef __cplusplus
1875331Samw }
1885331Samw #endif
1895331Samw 
1905331Samw #endif /* _SMBSRV_SMBINFO_H */
191