summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/smbsrv/smbinfo.h
blob: 01404f3a559b493aa87218f1baa4c094bdbc479f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
/*
 * CDDL HEADER START
 *
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License (the "License").
 * You may not use this file except in compliance with the License.
 *
 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
 * or http://www.opensolaris.org/os/licensing.
 * See the License for the specific language governing permissions
 * and limitations under the License.
 *
 * When distributing Covered Code, include this CDDL HEADER in each
 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
 * If applicable, add the following below this CDDL HEADER, with the
 * fields enclosed by brackets "[]" replaced with your own identifying
 * information: Portions Copyright [yyyy] [name of copyright owner]
 *
 * CDDL HEADER END
 */
/*
 * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
 * Use is subject to license terms.
 */

#ifndef	_SMBSRV_SMBINFO_H
#define	_SMBSRV_SMBINFO_H

#pragma ident	"%Z%%M%	%I%	%E% SMI"

#include <sys/types.h>

#ifdef __cplusplus
extern "C" {
#endif

/*
 * Native OS types used in SmbSessionSetupX.
 */
#ifndef NATIVE_OS_DEFINED
#define	NATIVE_OS_DEFINED

#define	NATIVE_OS_UNKNOWN	0x00000000
#define	NATIVE_OS_NT4_0		0x00000001
#define	NATIVE_OS_WIN95		0x00000002
#define	NATIVE_OS_OTHER		0x00000003
#define	NATIVE_OS_NT5_0		0x00000004
#define	NATIVE_OS_NT5_1		0x00000005
#define	NATIVE_OS_MACOS		0x00000006

/*
 * Backward compatibility aliases.
 */
#define	NATIVE_OS_WINNT		NATIVE_OS_NT4_0
#define	NATIVE_OS_WIN2000	NATIVE_OS_NT5_0
#define	NATIVE_OS_WINXP		NATIVE_OS_NT5_1

#endif /* NATIVE_OS_DEFINED */


/*
 * Native lanman types in SmbSessionSetupX. Note that these values
 * are not directly related to the negotiated protocol dialect.
 */
#ifndef NATIVE_LANMAN_DEFINED
#define	NATIVE_LANMAN_DEFINED

#define	NATIVE_LM_NONE		0x00000000
#define	NATIVE_LM_NT		0x00000001
#define	NATIVE_LM_WIN2000	0x00000002

#endif /* NATIVE_LANMAN_DEFINED */


/* PDC types to be used in user authentication process */

#define	PDC_UNKNOWN		0
#define	PDC_WINNT		1
#define	PDC_WIN2000		2
#define	PDC_WINXP		3
#define	PDC_SAMBA		4

/*
 * Please replace the use of MAX_NETWORKS with SMB_PI_MAX_NETWORKS if
 * you find it used in conjunction with smbparm_info and maybe one day
 * there will be just a single definition (here) throughout the code.
 */
#ifndef MAX_NETWORKS
#define	MAX_NETWORKS		36
#endif /* MAX_NETWORKS */

#define	SMB_PI_MAX_NETWORKS	36
#define	SMB_PI_MAX_WINS		2

#define	SMB_SECMODE_WORKGRP	1
#define	SMB_SECMODE_DOMAIN	2

#define	SMB_PI_MAX_HOST		48
#define	SMB_PI_MAX_DOMAIN	48
#define	SMB_PI_MAX_SCOPE	16
#define	SMB_PI_MAX_COMMENT	58
#define	SMB_PI_MAX_USERNAME	40
#define	SMB_PI_MAX_PASSWD	40
#define	SMB_PI_MAX_NATIVE_OS	32
#define	SMB_PI_MAX_LANMAN	32


#define	SMB_PI_UNKNOWN_DOMAIN		0
#define	SMB_PI_RESOURCE_DOMAIN		1

/*
 * K.L. The keep alive time out use to default to 900
 * seconds. It is not long enough for some applications
 * i.e. MS Access. We currently use 5400 seconds.
 */
#define	SMB_PI_KEEP_ALIVE_MIN		(90 * 60)
#define	SMB_LM_COMPATIBILITY_DEFAULT_LEV 3

/*
 * This is max networks multiply by canonical address for IPv4
 * This needs a fix for IPv4
 */
#define	MAX_EXCLUDE_LIST_LEN	(SMB_PI_MAX_NETWORKS * INET_ADDRSTRLEN)

typedef struct smb_kmod_cfg {
	uint32_t skc_maxbufsize;
	uint32_t skc_maxworkers;
	uint32_t skc_maxconnections;
	uint32_t skc_keepalive;
	uint32_t skc_oplock_timeout;
	int32_t skc_restrict_anon;
	int32_t skc_signing_enable;
	int32_t skc_signing_required;
	int32_t skc_signing_check;
	int32_t skc_oplock_enable;
	int32_t skc_flush_required;
	int32_t skc_sync_enable;
	int32_t skc_dirsymlink_enable;
	int32_t skc_announce_quota;
	int32_t skc_secmode;

	char skc_resource_domain[SMB_PI_MAX_DOMAIN];
	char skc_hostname[SMB_PI_MAX_HOST];
	char skc_system_comment[SMB_PI_MAX_COMMENT];
} smb_kmod_cfg_t;

#define	SMB_VERSION_MAJOR  4
#define	SMB_VERSION_MINOR  0

int smbnative_os_value(char *native_os);
int smbnative_lm_value(char *native_lm);
int smbnative_pdc_value(char *native_lm);

/*
 * Support for passthrough authentication.
 */
#define	AUTH_USER_GRANT			0x00000000
#define	AUTH_GUEST_GRANT		0x00000001
#define	AUTH_IPC_ONLY_GRANT		0x00000002
#define	AUTH_CONEXUS_GRANT		0x00000004

#define	SMBD_DOOR_NAME		"/var/run/smbd_door_old"
#define	SMBD_DOOR_VERSION	1

#define	SMBD_DOOR_COOKIE	((void*)(0xdeadbeef^SMBD_DOOR_VERSION))
#define	SMBD_DOOR_SIZE		256

#define	SMBD_DOOR_SRV_SUCCESS	0
#define	SMBD_DOOR_SRV_ERROR	-1

#define	SMBD_DOOR_JOIN				1
#define	SMBD_DOOR_PARAM_GET			2
#define	SMBD_DOOR_PARAM_SET			3
#define	SMBD_DOOR_NETBIOS_RECONFIG		4

#ifdef __cplusplus
}
#endif

#endif /* _SMBSRV_SMBINFO_H */