xref: /titanic_51/usr/src/uts/common/smbsrv/smb.h (revision a90cf9f29973990687fa61de9f1f6ea22e924e40)
1da6c28aaSamw /*
2da6c28aaSamw  * CDDL HEADER START
3da6c28aaSamw  *
4da6c28aaSamw  * The contents of this file are subject to the terms of the
5da6c28aaSamw  * Common Development and Distribution License (the "License").
6da6c28aaSamw  * You may not use this file except in compliance with the License.
7da6c28aaSamw  *
8da6c28aaSamw  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9da6c28aaSamw  * or http://www.opensolaris.org/os/licensing.
10da6c28aaSamw  * See the License for the specific language governing permissions
11da6c28aaSamw  * and limitations under the License.
12da6c28aaSamw  *
13da6c28aaSamw  * When distributing Covered Code, include this CDDL HEADER in each
14da6c28aaSamw  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15da6c28aaSamw  * If applicable, add the following below this CDDL HEADER, with the
16da6c28aaSamw  * fields enclosed by brackets "[]" replaced with your own identifying
17da6c28aaSamw  * information: Portions Copyright [yyyy] [name of copyright owner]
18da6c28aaSamw  *
19da6c28aaSamw  * CDDL HEADER END
20da6c28aaSamw  */
21148c5f43SAlan Wright 
22da6c28aaSamw /*
23148c5f43SAlan Wright  * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
24b819cea2SGordon Ross  * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
25da6c28aaSamw  */
26da6c28aaSamw 
27da6c28aaSamw #ifndef _SMBSRV_SMB_H
28da6c28aaSamw #define	_SMBSRV_SMB_H
29da6c28aaSamw 
30da6c28aaSamw 
31da6c28aaSamw /*
32bbf6f00cSJordan Brown  * SMB definitions and interfaces, mostly defined in the SMB and CIFS specs.
33da6c28aaSamw  */
34da6c28aaSamw #include <sys/types.h>
35bbf6f00cSJordan Brown #include <smbsrv/string.h>
36da6c28aaSamw #include <smbsrv/msgbuf.h>
37da6c28aaSamw 
38148c5f43SAlan Wright #include <smb/ntstatus.h>
39148c5f43SAlan Wright #include <smb/nterror.h>
40148c5f43SAlan Wright #include <smb/lmerr.h>
41148c5f43SAlan Wright #include <smb/doserror.h>
42bbf6f00cSJordan Brown #include <smbsrv/ntaccess.h>
43bbf6f00cSJordan Brown 
44bbf6f00cSJordan Brown /*
45bbf6f00cSJordan Brown  * Macintosh Extensions for CIFS
46bbf6f00cSJordan Brown  */
47bbf6f00cSJordan Brown #include <smbsrv/mac_cifs.h>
48bbf6f00cSJordan Brown 
49bbf6f00cSJordan Brown /*
50bbf6f00cSJordan Brown  * NT Installable File System (IFS) interface.
51bbf6f00cSJordan Brown  */
52bbf6f00cSJordan Brown #include <smbsrv/ntifs.h>
53da6c28aaSamw 
54da6c28aaSamw #ifdef __cplusplus
55da6c28aaSamw extern "C" {
56da6c28aaSamw #endif
57da6c28aaSamw 
58da6c28aaSamw /*
59da6c28aaSamw  * The msgbuf format and length of an SMB header.
60da6c28aaSamw  */
61da6c28aaSamw #define	SMB_HEADER_DOS_FMT	"Mbbbwbww10.wwww"
62da6c28aaSamw #define	SMB_HEADER_NT_FMT	"Mblbww#c2.wwww"
63da6c28aaSamw #define	SMB_HEADER_LEN		32
64da6c28aaSamw #define	SMB_SIG_SIZE		8	/* SMB signature size */
65da6c28aaSamw 
66bbf6f00cSJordan Brown #define	SMB_HEADER_ED_FMT	"Mbbbwbww8c2.wwww"
67bbf6f00cSJordan Brown #define	SMB_HEADER_ED_LEN	(4+1+1+1+2+1+2+12+2+2+2+2)
68bbf6f00cSJordan Brown #define	SMB_TRANSHDR_ED_FMT	"wwwwb.wl2.wwwwb."
69bbf6f00cSJordan Brown #define	SMB_TRANSHDR_ED_LEN	(2+2+2+2+1+1+2+4+2+2+2+2+2+1+1)
70bbf6f00cSJordan Brown #define	SMB_TRANSSHDR_ED_FMT	"wwwwwwwww"
71bbf6f00cSJordan Brown #define	SMB_TRANSSHDR_ED_LEN	(2+2+2+2+2+2+2+2)
72bbf6f00cSJordan Brown #define	SMB_TRANS2SHDR_ED_FMT	"wwwwwwwww"
73bbf6f00cSJordan Brown #define	SMB_TRANS2SHDR_ED_LEN	(2+2+2+2+2+2+2+2+2)
74bbf6f00cSJordan Brown /* There is something wrong with this. Should be 38 bytes. It is 37 bytes */
75bbf6f00cSJordan Brown #define	SMB_NT_TRANSHDR_ED_FMT	"b2.llllllllbw"
76bbf6f00cSJordan Brown #define	SMB_NT_TRANSHDR_ED_LEN	(1+2+4+4+4+4+4+4+4+4+1+2)
77bbf6f00cSJordan Brown 
78da6c28aaSamw /*
79da6c28aaSamw  * CIFS definition for the SMB header (CIFS Section 3.2). Note that the
80da6c28aaSamw  * pid_high field is not documented in the 1997 CIFS specificaction. This
81da6c28aaSamw  * is a decoded or memory-based definition, which may be padded to align
82da6c28aaSamw  * its elements on word boundaries. See smb_hdrbuf_t for the network
83da6c28aaSamw  * ready structure.
84da6c28aaSamw  */
85da6c28aaSamw typedef struct smb_hdr {
86bbf6f00cSJordan Brown 	uint8_t protocol[4];
87bbf6f00cSJordan Brown 	uint8_t command;
88da6c28aaSamw 
89da6c28aaSamw 	union {
90da6c28aaSamw 		struct {
91bbf6f00cSJordan Brown 			uint8_t error_class;
92bbf6f00cSJordan Brown 			uint8_t reserved;
93bbf6f00cSJordan Brown 			uint16_t error;
94da6c28aaSamw 		} dos_error;
95bbf6f00cSJordan Brown 		uint32_t ntstatus;
96da6c28aaSamw 	} status;
97da6c28aaSamw 
98bbf6f00cSJordan Brown 	uint8_t flags;
99bbf6f00cSJordan Brown 	uint16_t flags2;
100bbf6f00cSJordan Brown 	uint16_t pid_high;
101da6c28aaSamw 
102da6c28aaSamw 	union {
103bbf6f00cSJordan Brown 		uint16_t pad[5];
104da6c28aaSamw 		struct {
105bbf6f00cSJordan Brown 			uint16_t reserved;
106bbf6f00cSJordan Brown 			uint8_t security_sig[SMB_SIG_SIZE];
107da6c28aaSamw 		} extra;
108da6c28aaSamw 	} extra;
109da6c28aaSamw 
110bbf6f00cSJordan Brown 	uint16_t tid;
111bbf6f00cSJordan Brown 	uint16_t pid;
112bbf6f00cSJordan Brown 	uint16_t uid;
113bbf6f00cSJordan Brown 	uint16_t mid;
114da6c28aaSamw } smb_hdr_t;
115da6c28aaSamw 
116da6c28aaSamw /*
117da6c28aaSamw  * Encoded or packed SMB header in network ready format.
118da6c28aaSamw  */
119da6c28aaSamw typedef struct smb_hdrbuf {
120bbf6f00cSJordan Brown 	uint8_t hdr[SMB_HEADER_LEN];
121da6c28aaSamw } smb_hdrbuf_t;
122da6c28aaSamw 
123da6c28aaSamw /*
124da6c28aaSamw  * Protocol magic value as a 32-bit.  This will be 0xff 0x53 0x4d 0x42 on
125da6c28aaSamw  * the wire.
126da6c28aaSamw  */
127da6c28aaSamw 
128da6c28aaSamw #define	SMB_PROTOCOL_MAGIC	0x424d53ff
129*a90cf9f2SGordon Ross #define	SMB2_PROTOCOL_MAGIC	0x424d53fe
130da6c28aaSamw 
131da6c28aaSamw /*
132da6c28aaSamw  * Time and date encoding (CIFS Section 3.6). The date is encoded such
133da6c28aaSamw  * that the year has a range of 0-119, which represents 1980-2099. The
134da6c28aaSamw  * month range is 1-12, and the day range is 1-31.
135da6c28aaSamw  */
136da6c28aaSamw typedef struct smb_date {
137bbf6f00cSJordan Brown 	uint16_t day   : 5;
138bbf6f00cSJordan Brown 	uint16_t month : 4;
139bbf6f00cSJordan Brown 	uint16_t year  : 7;
140da6c28aaSamw } smb_date_t;
141da6c28aaSamw 
142da6c28aaSamw /*
143da6c28aaSamw  * The hours range is 0-23, the minutes range is 0-59 and the two_sec
144da6c28aaSamw  * range is 0-29.
145da6c28aaSamw  */
146da6c28aaSamw typedef struct smb_time {
147bbf6f00cSJordan Brown 	uint16_t two_sec : 5;
148bbf6f00cSJordan Brown 	uint16_t minutes : 6;
149bbf6f00cSJordan Brown 	uint16_t hours    : 5;
150da6c28aaSamw } smb_time_t;
151da6c28aaSamw 
152da6c28aaSamw /*
153da6c28aaSamw  * This is a 64-bit signed absolute time representing 100ns increments.
154da6c28aaSamw  * A positive value represents the absolute time since 1601AD. A
155da6c28aaSamw  * negative value represents a context specific relative time.
156da6c28aaSamw  */
157da6c28aaSamw typedef struct smb_time2 {
158bbf6f00cSJordan Brown 	uint32_t low_time;
159bbf6f00cSJordan Brown 	int32_t high_time;
160da6c28aaSamw } smb_time2_t;
161da6c28aaSamw 
162da6c28aaSamw /*
163da6c28aaSamw  * The number of seconds since Jan 1, 1970, 00:00:00.0.
164da6c28aaSamw  */
165da6c28aaSamw typedef uint32_t smb_utime_t;
166da6c28aaSamw 
167da6c28aaSamw #define	SMB_LM_NEGOTIATE_WORDCNT		13
168da6c28aaSamw #define	SMB_NT_NEGOTIATE_WORDCNT		17
169da6c28aaSamw 
170bbf6f00cSJordan Brown #define	SMB_NAME83_EXTLEN			3
171bbf6f00cSJordan Brown #define	SMB_NAME83_BASELEN			8
172bbf6f00cSJordan Brown #define	SMB_NAME83_LEN				12
173da6c28aaSamw 
174bbf6f00cSJordan Brown /* Share types */
175bbf6f00cSJordan Brown #ifndef _SHARE_TYPES_DEFINED_
176bbf6f00cSJordan Brown #define	_SHARE_TYPES_DEFINED_
177bbf6f00cSJordan Brown #define	STYPE_DISKTREE			0x00000000
178bbf6f00cSJordan Brown #define	STYPE_PRINTQ			0x00000001
179bbf6f00cSJordan Brown #define	STYPE_DEVICE			0x00000002
180bbf6f00cSJordan Brown #define	STYPE_IPC			0x00000003
181bbf6f00cSJordan Brown #define	STYPE_MASK			0x0000000F
182bbf6f00cSJordan Brown #define	STYPE_DFS			0x00000064
183bbf6f00cSJordan Brown #define	STYPE_HIDDEN			0x80000000
184bbf6f00cSJordan Brown #define	STYPE_SPECIAL			0x80000000
185bbf6f00cSJordan Brown #endif /* _SHARE_TYPES_DEFINED_ */
186bbf6f00cSJordan Brown 
187bbf6f00cSJordan Brown #define	STYPE_ISDSK(S)	(((S) & STYPE_MASK) == STYPE_DISKTREE)
188bbf6f00cSJordan Brown #define	STYPE_ISPRN(S)	(((S) & STYPE_MASK) == STYPE_PRINTQ)
189bbf6f00cSJordan Brown #define	STYPE_ISDEV(S)	(((S) & STYPE_MASK) == STYPE_DEVICE)
190bbf6f00cSJordan Brown #define	STYPE_ISIPC(S)	(((S) & STYPE_MASK) == STYPE_IPC)
191da6c28aaSamw 
192da6c28aaSamw /*
193bbf6f00cSJordan Brown  * NtCreateAndX and NtTransactCreate creation flags: defined in CIFS
194bbf6f00cSJordan Brown  * section 4.2.2
195bbf6f00cSJordan Brown  *
196bbf6f00cSJordan Brown  * Creation Flag Name         Value  Description
197bbf6f00cSJordan Brown  * ========================== ====== ==================================
198bbf6f00cSJordan Brown  * NT_CREATE_REQUEST_OPLOCK   0x02   Level I oplock requested
199bbf6f00cSJordan Brown  * NT_CREATE_REQUEST_OPBATCH  0x04   Batch oplock requested
200bbf6f00cSJordan Brown  * NT_CREATE_OPEN_TARGET_DIR  0x08   Target for open is a directory
201da6c28aaSamw  */
202bbf6f00cSJordan Brown #define	NT_CREATE_FLAG_REQUEST_OPLOCK		0x02
203bbf6f00cSJordan Brown #define	NT_CREATE_FLAG_REQUEST_OPBATCH		0x04
204bbf6f00cSJordan Brown #define	NT_CREATE_FLAG_OPEN_TARGET_DIR		0x08
205bbf6f00cSJordan Brown 
206da6c28aaSamw 
207da6c28aaSamw /*
208bbf6f00cSJordan Brown  * Define the filter flags for NtNotifyChangeDirectoryFile
209da6c28aaSamw  */
210bbf6f00cSJordan Brown #define	FILE_NOTIFY_CHANGE_FILE_NAME	0x00000001
211bbf6f00cSJordan Brown #define	FILE_NOTIFY_CHANGE_DIR_NAME	0x00000002
212bbf6f00cSJordan Brown #define	FILE_NOTIFY_CHANGE_NAME		0x00000003
213bbf6f00cSJordan Brown #define	FILE_NOTIFY_CHANGE_ATTRIBUTES	0x00000004
214bbf6f00cSJordan Brown #define	FILE_NOTIFY_CHANGE_SIZE		0x00000008
215bbf6f00cSJordan Brown #define	FILE_NOTIFY_CHANGE_LAST_WRITE	0x00000010
216bbf6f00cSJordan Brown #define	FILE_NOTIFY_CHANGE_LAST_ACCESS	0x00000020
217bbf6f00cSJordan Brown #define	FILE_NOTIFY_CHANGE_CREATION	0x00000040
218bbf6f00cSJordan Brown #define	FILE_NOTIFY_CHANGE_EA		0x00000080
219bbf6f00cSJordan Brown #define	FILE_NOTIFY_CHANGE_SECURITY	0x00000100
220bbf6f00cSJordan Brown #define	FILE_NOTIFY_CHANGE_STREAM_NAME	0x00000200
221bbf6f00cSJordan Brown #define	FILE_NOTIFY_CHANGE_STREAM_SIZE	0x00000400
222bbf6f00cSJordan Brown #define	FILE_NOTIFY_CHANGE_STREAM_WRITE	0x00000800
223bbf6f00cSJordan Brown #define	FILE_NOTIFY_VALID_MASK		0x00000fff
224bbf6f00cSJordan Brown 
225bbf6f00cSJordan Brown 
226bbf6f00cSJordan Brown /*
227bbf6f00cSJordan Brown  * Define the file action type codes for NtNotifyChangeDirectoryFile
228bbf6f00cSJordan Brown  */
229bbf6f00cSJordan Brown #define	FILE_ACTION_ADDED		0x00000001
230bbf6f00cSJordan Brown #define	FILE_ACTION_REMOVED		0x00000002
231bbf6f00cSJordan Brown #define	FILE_ACTION_MODIFIED		0x00000003
232bbf6f00cSJordan Brown #define	FILE_ACTION_RENAMED_OLD_NAME	0x00000004
233bbf6f00cSJordan Brown #define	FILE_ACTION_RENAMED_NEW_NAME	0x00000005
234bbf6f00cSJordan Brown #define	FILE_ACTION_ADDED_STREAM	0x00000006
235bbf6f00cSJordan Brown #define	FILE_ACTION_REMOVED_STREAM	0x00000007
236bbf6f00cSJordan Brown #define	FILE_ACTION_MODIFIED_STREAM	0x00000008
237*a90cf9f2SGordon Ross /*
238*a90cf9f2SGordon Ross  * Note: These action values are not from MS-FSCC.
239*a90cf9f2SGordon Ross  * FILE_ACTION_SUBDIR_CHANGED is used internally for
240*a90cf9f2SGordon Ross  * "watch tree" support, posted to all parents of a
241*a90cf9f2SGordon Ross  * directory that had one of the changes above.
242*a90cf9f2SGordon Ross  * FILE_ACTION_DELETE_PENDING is used internally to tell
243*a90cf9f2SGordon Ross  * notify change requests when the "delete-on-close" flag
244*a90cf9f2SGordon Ross  * has been set on the directory being watched.
245*a90cf9f2SGordon Ross  */
246*a90cf9f2SGordon Ross #define	FILE_ACTION_SUBDIR_CHANGED	0x00000009
247*a90cf9f2SGordon Ross #define	FILE_ACTION_DELETE_PENDING	0x0000000a
248bbf6f00cSJordan Brown 
249bbf6f00cSJordan Brown 
250bbf6f00cSJordan Brown /* Lock type flags */
251bbf6f00cSJordan Brown #define	LOCKING_ANDX_NORMAL_LOCK	0x00
252bbf6f00cSJordan Brown #define	LOCKING_ANDX_SHARED_LOCK	0x01
253bbf6f00cSJordan Brown #define	LOCKING_ANDX_OPLOCK_RELEASE	0x02
254bbf6f00cSJordan Brown #define	LOCKING_ANDX_CHANGE_LOCK_TYPE	0x04
255bbf6f00cSJordan Brown #define	LOCKING_ANDX_CANCEL_LOCK	0x08
256bbf6f00cSJordan Brown #define	LOCKING_ANDX_LARGE_FILES	0x10
257bbf6f00cSJordan Brown 
258bbf6f00cSJordan Brown #define	SMB_COM_CREATE_DIRECTORY	0x00
259bbf6f00cSJordan Brown #define	SMB_COM_DELETE_DIRECTORY	0x01
260bbf6f00cSJordan Brown #define	SMB_COM_OPEN			0x02
261bbf6f00cSJordan Brown #define	SMB_COM_CREATE			0x03
262bbf6f00cSJordan Brown #define	SMB_COM_CLOSE			0x04
263bbf6f00cSJordan Brown #define	SMB_COM_FLUSH			0x05
264bbf6f00cSJordan Brown #define	SMB_COM_DELETE			0x06
265bbf6f00cSJordan Brown #define	SMB_COM_RENAME			0x07
266bbf6f00cSJordan Brown #define	SMB_COM_QUERY_INFORMATION	0x08
267bbf6f00cSJordan Brown #define	SMB_COM_SET_INFORMATION		0x09
268bbf6f00cSJordan Brown #define	SMB_COM_READ			0x0A
269bbf6f00cSJordan Brown #define	SMB_COM_WRITE			0x0B
270bbf6f00cSJordan Brown #define	SMB_COM_LOCK_BYTE_RANGE		0x0C
271bbf6f00cSJordan Brown #define	SMB_COM_UNLOCK_BYTE_RANGE	0x0D
272bbf6f00cSJordan Brown #define	SMB_COM_CREATE_TEMPORARY	0x0E
273bbf6f00cSJordan Brown #define	SMB_COM_CREATE_NEW		0x0F
274bbf6f00cSJordan Brown #define	SMB_COM_CHECK_DIRECTORY		0x10
275bbf6f00cSJordan Brown #define	SMB_COM_PROCESS_EXIT		0x11
276bbf6f00cSJordan Brown #define	SMB_COM_SEEK			0x12
277bbf6f00cSJordan Brown #define	SMB_COM_LOCK_AND_READ		0x13
278bbf6f00cSJordan Brown #define	SMB_COM_WRITE_AND_UNLOCK	0x14
279bbf6f00cSJordan Brown 
280bbf6f00cSJordan Brown #define	SMB_COM_READ_RAW		0x1A
281bbf6f00cSJordan Brown #define	SMB_COM_READ_MPX		0x1B
282bbf6f00cSJordan Brown #define	SMB_COM_READ_MPX_SECONDARY	0x1C
283bbf6f00cSJordan Brown #define	SMB_COM_WRITE_RAW		0x1D
284bbf6f00cSJordan Brown #define	SMB_COM_WRITE_MPX		0x1E
285bbf6f00cSJordan Brown #define	SMB_COM_WRITE_MPX_SECONDARY	0x1F
286bbf6f00cSJordan Brown #define	SMB_COM_WRITE_COMPLETE		0x20
287bbf6f00cSJordan Brown 
288bbf6f00cSJordan Brown #define	SMB_COM_SET_INFORMATION2	0x22
289bbf6f00cSJordan Brown #define	SMB_COM_QUERY_INFORMATION2	0x23
290bbf6f00cSJordan Brown #define	SMB_COM_LOCKING_ANDX		0x24
291bbf6f00cSJordan Brown #define	SMB_COM_TRANSACTION		0x25
292bbf6f00cSJordan Brown #define	SMB_COM_TRANSACTION_SECONDARY	0x26
293bbf6f00cSJordan Brown #define	SMB_COM_IOCTL			0x27
294bbf6f00cSJordan Brown #define	SMB_COM_IOCTL_SECONDARY		0x28
295bbf6f00cSJordan Brown #define	SMB_COM_COPY			0x29
296bbf6f00cSJordan Brown #define	SMB_COM_MOVE			0x2A
297bbf6f00cSJordan Brown #define	SMB_COM_ECHO			0x2B
298bbf6f00cSJordan Brown #define	SMB_COM_WRITE_AND_CLOSE		0x2C
299bbf6f00cSJordan Brown #define	SMB_COM_OPEN_ANDX		0x2D
300bbf6f00cSJordan Brown #define	SMB_COM_READ_ANDX		0x2E
301bbf6f00cSJordan Brown #define	SMB_COM_WRITE_ANDX		0x2F
302bbf6f00cSJordan Brown 
303bbf6f00cSJordan Brown #define	SMB_COM_CLOSE_AND_TREE_DISC	0x31
304bbf6f00cSJordan Brown #define	SMB_COM_TRANSACTION2		0x32
305bbf6f00cSJordan Brown #define	SMB_COM_TRANSACTION2_SECONDARY	0x33
306bbf6f00cSJordan Brown #define	SMB_COM_FIND_CLOSE2		0x34
307bbf6f00cSJordan Brown #define	SMB_COM_FIND_NOTIFY_CLOSE	0x35
308bbf6f00cSJordan Brown 
309bbf6f00cSJordan Brown #define	SMB_COM_TREE_CONNECT		0x70
310bbf6f00cSJordan Brown #define	SMB_COM_TREE_DISCONNECT		0x71
311bbf6f00cSJordan Brown #define	SMB_COM_NEGOTIATE		0x72
312bbf6f00cSJordan Brown #define	SMB_COM_SESSION_SETUP_ANDX	0x73
313bbf6f00cSJordan Brown #define	SMB_COM_LOGOFF_ANDX		0x74
314bbf6f00cSJordan Brown #define	SMB_COM_TREE_CONNECT_ANDX	0x75
315bbf6f00cSJordan Brown 
316bbf6f00cSJordan Brown #define	SMB_COM_QUERY_INFORMATION_DISK	0x80
317bbf6f00cSJordan Brown #define	SMB_COM_SEARCH			0x81
318bbf6f00cSJordan Brown #define	SMB_COM_FIND			0x82
319bbf6f00cSJordan Brown #define	SMB_COM_FIND_UNIQUE		0x83
320bbf6f00cSJordan Brown #define	SMB_COM_FIND_CLOSE		0x84
321bbf6f00cSJordan Brown 
322bbf6f00cSJordan Brown #define	SMB_COM_NT_TRANSACT		0xA0
323bbf6f00cSJordan Brown #define	SMB_COM_NT_TRANSACT_SECONDARY	0xA1
324bbf6f00cSJordan Brown #define	SMB_COM_NT_CREATE_ANDX		0xA2
325bbf6f00cSJordan Brown #define	SMB_COM_NT_CANCEL		0xA4
326bbf6f00cSJordan Brown 
327bbf6f00cSJordan Brown #define	SMB_COM_OPEN_PRINT_FILE		0xC0
328bbf6f00cSJordan Brown #define	SMB_COM_WRITE_PRINT_FILE	0xC1
329bbf6f00cSJordan Brown #define	SMB_COM_CLOSE_PRINT_FILE	0xC2
330bbf6f00cSJordan Brown #define	SMB_COM_GET_PRINT_QUEUE		0xC3
331bbf6f00cSJordan Brown 
332148c5f43SAlan Wright #define	SMB_COM_NUM			0x100
333bbf6f00cSJordan Brown 
334bbf6f00cSJordan Brown /*
335bbf6f00cSJordan Brown  * Flags field of the SMB header. The names in parenthesis represent
336bbf6f00cSJordan Brown  * alternative names for the flags.
337bbf6f00cSJordan Brown  *
338bbf6f00cSJordan Brown  * SMB_FLAGS_LOCK_AND_READ_OK     If the server supports LockAndRead and
339bbf6f00cSJordan Brown  * (SMB_FLAGS_LOCKS_SUBDIALECT)   WriteAndUnlock, it sets this bit in the
340bbf6f00cSJordan Brown  *                                Negotiate response.
341bbf6f00cSJordan Brown  *
342bbf6f00cSJordan Brown  * SMB_FLAGS_SEND_NO_ACK          When on, the client guarantees that there
343bbf6f00cSJordan Brown  * (SMB_FLAGS_RCV_BUF_POSTED)     is a receive buffer posted such that a
344bbf6f00cSJordan Brown  *                                "Send-No-Ack" can be used by the server
345bbf6f00cSJordan Brown  *                                to respond to the client's request.
346bbf6f00cSJordan Brown  *
347bbf6f00cSJordan Brown  * SMB_FLAGS_CASE_INSENSITIVE     This is part of the Flags field of every
348bbf6f00cSJordan Brown  *                                SMB header. If this bit is set, then all
349bbf6f00cSJordan Brown  *                                pathnames in the SMB should be treated as
350bbf6f00cSJordan Brown  *                                case-insensitive. Otherwise pathnames are
351bbf6f00cSJordan Brown  *                                case-sensitive.
352bbf6f00cSJordan Brown  *
353bbf6f00cSJordan Brown  * SMB_FLAGS_CANONICALIZED_PATHS  When on in SessionSetupX, this indicates
354bbf6f00cSJordan Brown  *                                that all paths sent to the server are
355bbf6f00cSJordan Brown  *                                already in OS/2 canonicalized format.
356bbf6f00cSJordan Brown  *
357bbf6f00cSJordan Brown  * OS/2 canonical format means that file/directory names are in upper case,
358bbf6f00cSJordan Brown  * are valid characters, . and .. have been removed and single backslashes
359bbf6f00cSJordan Brown  * are used as separators.
360bbf6f00cSJordan Brown  *
361bbf6f00cSJordan Brown  * SMB_FLAGS_OPLOCK               When set in an open file request SMBs
362bbf6f00cSJordan Brown  *                                (Open, Create, OpenX, etc.) this bit
363bbf6f00cSJordan Brown  *                                indicates a request for an oplock on the
364bbf6f00cSJordan Brown  *                                file. When set in the response, this bit
365bbf6f00cSJordan Brown  *                                indicates that the oplock was granted.
366bbf6f00cSJordan Brown  *
367bbf6f00cSJordan Brown  * SMB_FLAGS_OPLOCK_NOTIFY_ANY    When on, this bit indicates that the server
368bbf6f00cSJordan Brown  *                                should notify the client on any request
369bbf6f00cSJordan Brown  *                                that could cause the file to be changed.
370bbf6f00cSJordan Brown  *                                If not set, the server only notifies the
371bbf6f00cSJordan Brown  *                                client on other open requests on the file.
372bbf6f00cSJordan Brown  *                                This bit is only relevant when
373bbf6f00cSJordan Brown  *                                SMB_FLAGS_OPLOCK is set.
374bbf6f00cSJordan Brown  *
375bbf6f00cSJordan Brown  * SMB_FLAGS_SERVER_TO_REDIR      This bit indicates that the SMB is being
376bbf6f00cSJordan Brown  * (SMB_FLAGS_REPLY)              sent from server to (client) redirector.
377bbf6f00cSJordan Brown  */
378bbf6f00cSJordan Brown #define	SMB_FLAGS_LOCK_AND_READ_OK	0x01
379bbf6f00cSJordan Brown #define	SMB_FLAGS_SEND_NO_ACK		0x02
380bbf6f00cSJordan Brown #define	SMB_FLAGS_RESERVED		0x04
381bbf6f00cSJordan Brown #define	SMB_FLAGS_CASE_INSENSITIVE	0x08
382bbf6f00cSJordan Brown #define	SMB_FLAGS_CANONICALIZED_PATHS	0x10
383bbf6f00cSJordan Brown #define	SMB_FLAGS_OPLOCK		0x20
384bbf6f00cSJordan Brown #define	SMB_FLAGS_OPLOCK_NOTIFY_ANY	0x40
385bbf6f00cSJordan Brown #define	SMB_FLAGS_REPLY			0x80
386bbf6f00cSJordan Brown 
387bbf6f00cSJordan Brown 
388bbf6f00cSJordan Brown /*
389bbf6f00cSJordan Brown  * Flags2 field of the SMB header.
3909fb67ea3Safshin salek ardakani - Sun Microsystems - Irvine United States  *
3919fb67ea3Safshin salek ardakani - Sun Microsystems - Irvine United States  * SMB_FLAGS2_READ_IF_EXECUTE is also known as SMB_FLAGS2_PAGING_IO
392bbf6f00cSJordan Brown  */
393bbf6f00cSJordan Brown #define	SMB_FLAGS2_KNOWS_LONG_NAMES		0x0001
394bbf6f00cSJordan Brown #define	SMB_FLAGS2_KNOWS_EAS			0x0002
395bbf6f00cSJordan Brown #define	SMB_FLAGS2_SMB_SECURITY_SIGNATURE	0x0004
396bbf6f00cSJordan Brown #define	SMB_FLAGS2_IS_LONG_NAME			0x0040
397bbf6f00cSJordan Brown #define	SMB_FLAGS2_REPARSE_PATH			0x0400
398bbf6f00cSJordan Brown #define	SMB_FLAGS2_EXT_SEC			0x0800
399bbf6f00cSJordan Brown #define	SMB_FLAGS2_DFS				0x1000
4009fb67ea3Safshin salek ardakani - Sun Microsystems - Irvine United States #define	SMB_FLAGS2_READ_IF_EXECUTE		0x2000
401bbf6f00cSJordan Brown #define	SMB_FLAGS2_NT_STATUS			0x4000
402bbf6f00cSJordan Brown #define	SMB_FLAGS2_UNICODE			0x8000
403bbf6f00cSJordan Brown 
404bbf6f00cSJordan Brown #define	DIALECT_UNKNOWN		 0
405bbf6f00cSJordan Brown #define	PC_NETWORK_PROGRAM_1_0	 1  /* The original MSNET SMB protocol */
406bbf6f00cSJordan Brown #define	PCLAN1_0		 2  /* Some versions of the original MSNET */
407bbf6f00cSJordan Brown #define	MICROSOFT_NETWORKS_1_03	 3  /* This is used for the MS-NET 1.03 */
408bbf6f00cSJordan Brown #define	MICROSOFT_NETWORKS_3_0	 4  /* This is the  DOS LANMAN 1.0 specific */
409bbf6f00cSJordan Brown #define	LANMAN1_0		 5  /* This is the first version of the full */
410bbf6f00cSJordan Brown #define	LM1_2X002		 6  /* This is the first version of the full */
411bbf6f00cSJordan Brown #define	DOS_LM1_2X002		 7  /* This is the dos equivalent of the */
412bbf6f00cSJordan Brown #define	DOS_LANMAN2_1		 8  /* DOS LANMAN2.1 */
413bbf6f00cSJordan Brown #define	LANMAN2_1		 9  /* OS/2 LANMAN2.1 */
414bbf6f00cSJordan Brown #define	Windows_for_Workgroups_3_1a 10 /* Windows for Workgroups Version 1.0 */
415bbf6f00cSJordan Brown #define	NT_LM_0_12		11  /* The SMB protocol designed for NT */
416*a90cf9f2SGordon Ross #define	DIALECT_SMB2002		12  /* SMB 2.002 (switch to SMB2) */
417*a90cf9f2SGordon Ross #define	DIALECT_SMB2XXX		13  /* SMB 2.??? (switch to SMB2) */
418bbf6f00cSJordan Brown 
419bbf6f00cSJordan Brown /*
420bbf6f00cSJordan Brown  * SMB_TREE_CONNECT_ANDX OptionalSupport flags
421bbf6f00cSJordan Brown  *
422bbf6f00cSJordan Brown  * SMB_SUPPORT_SEARCH_BITS    The server supports SearchAttributes.
423bbf6f00cSJordan Brown  * SMB_SHARE_IS_IN_DFS        The share is managed by DFS.
424bbf6f00cSJordan Brown  * SMB_CSC_MASK               Offline-caching mask - see CSC values.
425bbf6f00cSJordan Brown  * SMB_UNIQUE_FILE_NAME       The server uses long names and does not support
426bbf6f00cSJordan Brown  *                            short names.  This indicates to clients that
427bbf6f00cSJordan Brown  *                            they may perform directory name-space caching.
428bbf6f00cSJordan Brown  * SMB_EXTENDED_SIGNATURES    The server will use signing key protection.
429bbf6f00cSJordan Brown  *
430bbf6f00cSJordan Brown  * SMB_CSC_CACHE_MANUAL_REINT Clients are allowed to cache files for offline
431bbf6f00cSJordan Brown  *                            use as requested by users but automatic
432bbf6f00cSJordan Brown  *                            file-by-file reintegration is not allowed.
433bbf6f00cSJordan Brown  * SMB_CSC_CACHE_AUTO_REINT   Clients are allowed to automatically cache
434bbf6f00cSJordan Brown  *                            files for offline use and file-by-file
435bbf6f00cSJordan Brown  *                            reintegration is allowed.
436bbf6f00cSJordan Brown  * SMB_CSC_CACHE_VDO          Clients are allowed to automatically cache files
437bbf6f00cSJordan Brown  *                            for offline use, file-by-file reintegration is
438bbf6f00cSJordan Brown  *                            allowed and clients are permitted to work from
439bbf6f00cSJordan Brown  *                            their local cache even while offline.
440bbf6f00cSJordan Brown  * SMB_CSC_CACHE_NONE         Client-side caching is disabled for this share.
441bbf6f00cSJordan Brown  *
442bbf6f00cSJordan Brown  * SHI1005_FLAGS_ACCESS_BASED_DIRECTORY_ENUM
443bbf6f00cSJordan Brown  *			      The server will filter directory entries based
444bbf6f00cSJordan Brown  *			      on the access permissions of the client.
445bbf6f00cSJordan Brown  */
446bbf6f00cSJordan Brown #define	SMB_SUPPORT_SEARCH_BITS		0x0001
447bbf6f00cSJordan Brown #define	SMB_SHARE_IS_IN_DFS		0x0002
448bbf6f00cSJordan Brown #define	SMB_CSC_MASK			0x000C
449bbf6f00cSJordan Brown #define	SMB_UNIQUE_FILE_NAME		0x0010
450bbf6f00cSJordan Brown #define	SMB_EXTENDED_SIGNATURES		0x0020
451bbf6f00cSJordan Brown 
452bbf6f00cSJordan Brown #define	SMB_CSC_CACHE_MANUAL_REINT	0x0000
453bbf6f00cSJordan Brown #define	SMB_CSC_CACHE_AUTO_REINT	0x0004
454bbf6f00cSJordan Brown #define	SMB_CSC_CACHE_VDO		0x0008
455bbf6f00cSJordan Brown #define	SMB_CSC_CACHE_NONE		0x000C
456bbf6f00cSJordan Brown 
457bbf6f00cSJordan Brown #define	SHI1005_FLAGS_ACCESS_BASED_DIRECTORY_ENUM	0x0800
458cb174861Sjoyce mcintosh #define	SHI1005_FLAGS_ALLOW_NAMESPACE_CACHING		0x0400
459bbf6f00cSJordan Brown 
460bbf6f00cSJordan Brown /*
461bbf6f00cSJordan Brown  * The subcommand codes, placed in SETUP[0], for named pipe operations are:
462bbf6f00cSJordan Brown  * SubCommand Code	Value Description
463bbf6f00cSJordan Brown  * ===================	===== =========================================
464bbf6f00cSJordan Brown  */
465bbf6f00cSJordan Brown 
466bbf6f00cSJordan Brown #define	CallNamedPipe	0x54	/* open/write/read/close pipe */
467bbf6f00cSJordan Brown #define	WaitNamedPipe	0x53	/* wait for pipe to be nonbusy */
468bbf6f00cSJordan Brown #define	PeekNmPipe	0x23	/* read but don't remove data */
469bbf6f00cSJordan Brown #define	QNmPHandState	0x21	/* query pipe handle modes */
470bbf6f00cSJordan Brown #define	SetNmPHandState	0x01	/* set pipe handle modes */
471bbf6f00cSJordan Brown #define	QNmPipeInfo	0x22	/* query pipe attributes */
472bbf6f00cSJordan Brown #define	TransactNmPipe	0x26	/* write/read operation on pipe */
473bbf6f00cSJordan Brown #define	RawReadNmPipe	0x11	/* read pipe in "raw" (non message mode) */
474bbf6f00cSJordan Brown #define	RawWriteNmPipe	0x31	/* write pipe "raw" (non message mode) */
475bbf6f00cSJordan Brown 
476bbf6f00cSJordan Brown 
477bbf6f00cSJordan Brown 
478bbf6f00cSJordan Brown /*
479bbf6f00cSJordan Brown  * Setup[0] Transaction2       Value  Description
480bbf6f00cSJordan Brown  * Subcommand Code
481bbf6f00cSJordan Brown  * ==========================  =====  =============================
482bbf6f00cSJordan Brown  */
483bbf6f00cSJordan Brown 
484bbf6f00cSJordan Brown #define	TRANS2_OPEN2		0x00	/* Create file, extended attributes */
485bbf6f00cSJordan Brown #define	TRANS2_FIND_FIRST2	0x01	/* Begin search for files */
486bbf6f00cSJordan Brown #define	TRANS2_FIND_NEXT2	0x02	/* Resume search for files */
487bbf6f00cSJordan Brown #define	TRANS2_QUERY_FS_INFORMATION 0x03 /* Get file system information */
4889fb67ea3Safshin salek ardakani - Sun Microsystems - Irvine United States #define	TRANS2_SET_FS_INFORMATION	0x04	/* Set file system info. */
489bbf6f00cSJordan Brown #define	TRANS2_QUERY_PATH_INFORMATION 0x05 /* Get info, named file or dir */
490bbf6f00cSJordan Brown #define	TRANS2_SET_PATH_INFORMATION 0x06 /* Set info, named file or dir */
491bbf6f00cSJordan Brown #define	TRANS2_QUERY_FILE_INFORMATION 0x07 /* Get info, handle */
492bbf6f00cSJordan Brown #define	TRANS2_SET_FILE_INFORMATION 0x08 /* Set info, handle */
493bbf6f00cSJordan Brown #define	TRANS2_FSCTL		0x09	/* Not implemented by NT server */
494bbf6f00cSJordan Brown #define	TRANS2_IOCTL2		0x0A	/* Not implemented by NT server */
495bbf6f00cSJordan Brown #define	TRANS2_FIND_NOTIFY_FIRST 0x0B	/* Not implemented by NT server */
496bbf6f00cSJordan Brown #define	TRANS2_FIND_NOTIFY_NEXT 0x0C	/* Not implemented by NT server */
497bbf6f00cSJordan Brown #define	TRANS2_CREATE_DIRECTORY 0x0D	/* Create dir, extended attributes */
498bbf6f00cSJordan Brown #define	TRANS2_SESSION_SETUP	0x0E	/* Session setup, extended security */
499bbf6f00cSJordan Brown #define	TRANS2_GET_DFS_REFERRAL	0x10	/* Get a Dfs referral */
500bbf6f00cSJordan Brown #define	TRANS2_REPORT_DFS_INCONSISTENCY 0x11 /* Report a Dfs inconsistency */
501bbf6f00cSJordan Brown 
502bbf6f00cSJordan Brown /*
503bbf6f00cSJordan Brown  * Access Mode Encoding (CIFS/1.0 1996 Section 3.8).
504bbf6f00cSJordan Brown  *
505bbf6f00cSJordan Brown  * The desired access mode passed in SmbOpen and SmbOpenAndX has the following
506bbf6f00cSJordan Brown  * mapping:
507bbf6f00cSJordan Brown  *
508bbf6f00cSJordan Brown  *    1111 11
509bbf6f00cSJordan Brown  *    5432 1098 7654 3210
510bbf6f00cSJordan Brown  *    rWrC rLLL rSSS rAAA
511bbf6f00cSJordan Brown  *
512bbf6f00cSJordan Brown  * where:
513bbf6f00cSJordan Brown  *
514bbf6f00cSJordan Brown  *    W - Write through mode.  No read ahead or write behind allowed on
515bbf6f00cSJordan Brown  *        this file or device.  When protocol is returned, data is expected
516bbf6f00cSJordan Brown  *        to be on the disk or device.
517bbf6f00cSJordan Brown  *
518bbf6f00cSJordan Brown  *    S - Sharing mode:
519bbf6f00cSJordan Brown  *        0 - Compatibility mode (as in core open)
520bbf6f00cSJordan Brown  *        1 - Deny read/write/execute (exclusive)
521bbf6f00cSJordan Brown  *        2 - Deny write
522bbf6f00cSJordan Brown  *        3 - Deny read/execute
523bbf6f00cSJordan Brown  *        4 - Deny none
524bbf6f00cSJordan Brown  *
525bbf6f00cSJordan Brown  *    A - Access mode
526bbf6f00cSJordan Brown  *        0 - Open for reading
527bbf6f00cSJordan Brown  *        1 - Open for writing
528bbf6f00cSJordan Brown  *        2 - Open for reading and writing
529bbf6f00cSJordan Brown  *        3 - Open for execute
530bbf6f00cSJordan Brown  *
531bbf6f00cSJordan Brown  *    rSSSrAAA = 11111111 (hex FF) indicates FCB open (as in core protocol)
532bbf6f00cSJordan Brown  *
533bbf6f00cSJordan Brown  *    C - Cache mode
534bbf6f00cSJordan Brown  *        0 - Normal file
535bbf6f00cSJordan Brown  *        1 - Do not cache this file
536bbf6f00cSJordan Brown  *
537bbf6f00cSJordan Brown  *    L - Locality of reference
538bbf6f00cSJordan Brown  *        0 - Locality of reference is unknown
539bbf6f00cSJordan Brown  *        1 - Mainly sequential access
540bbf6f00cSJordan Brown  *        2 - Mainly random access
541bbf6f00cSJordan Brown  *        3 - Random access with some locality
542bbf6f00cSJordan Brown  *        4 to 7 - Currently undefined
543bbf6f00cSJordan Brown  */
544bbf6f00cSJordan Brown 
545bbf6f00cSJordan Brown 
546bbf6f00cSJordan Brown #define	SMB_DA_SHARE_MASK		0x70
547bbf6f00cSJordan Brown #define	SMB_DA_ACCESS_MASK		0x07
548bbf6f00cSJordan Brown #define	SMB_DA_FCB_MASK			(UCHAR)0xFF
549bbf6f00cSJordan Brown 
550bbf6f00cSJordan Brown #define	SMB_DA_ACCESS_READ		0x00
551bbf6f00cSJordan Brown #define	SMB_DA_ACCESS_WRITE		0x01
552bbf6f00cSJordan Brown #define	SMB_DA_ACCESS_READ_WRITE	0x02
553bbf6f00cSJordan Brown #define	SMB_DA_ACCESS_EXECUTE		0x03
554bbf6f00cSJordan Brown 
555bbf6f00cSJordan Brown #define	SMB_DA_SHARE_COMPATIBILITY	0x00
556bbf6f00cSJordan Brown #define	SMB_DA_SHARE_EXCLUSIVE		0x10
557bbf6f00cSJordan Brown #define	SMB_DA_SHARE_DENY_WRITE		0x20
558bbf6f00cSJordan Brown #define	SMB_DA_SHARE_DENY_READ		0x30
559bbf6f00cSJordan Brown #define	SMB_DA_SHARE_DENY_NONE		0x40
560bbf6f00cSJordan Brown 
561bbf6f00cSJordan Brown #define	SMB_DA_FCB			(UCHAR)0xFF
562bbf6f00cSJordan Brown 
563bbf6f00cSJordan Brown #define	SMB_CACHE_NORMAL		0x0000
564bbf6f00cSJordan Brown #define	SMB_DO_NOT_CACHE		0x1000
565bbf6f00cSJordan Brown 
566bbf6f00cSJordan Brown #define	SMB_LR_UNKNOWN			0x0000
567bbf6f00cSJordan Brown #define	SMB_LR_SEQUENTIAL		0x0100
568bbf6f00cSJordan Brown #define	SMB_LR_RANDOM			0x0200
569bbf6f00cSJordan Brown #define	SMB_LR_RANDOM_WITH_LOCALITY	0x0300
570bbf6f00cSJordan Brown #define	SMB_LR_MASK			0x0F00
571bbf6f00cSJordan Brown 
572bbf6f00cSJordan Brown #define	SMB_DA_WRITE_THROUGH		0x4000
573bbf6f00cSJordan Brown 
574bbf6f00cSJordan Brown /*
575bbf6f00cSJordan Brown  * Macros used for share reservation rule checking
576bbf6f00cSJordan Brown  */
577bbf6f00cSJordan Brown 
578bbf6f00cSJordan Brown #define	SMB_DENY_READ(share_access) ((share_access & FILE_SHARE_READ) == 0)
579bbf6f00cSJordan Brown 
580bbf6f00cSJordan Brown #define	SMB_DENY_WRITE(share_access) ((share_access & FILE_SHARE_WRITE) == 0)
581bbf6f00cSJordan Brown 
582bbf6f00cSJordan Brown #define	SMB_DENY_DELETE(share_access) ((share_access & FILE_SHARE_DELETE) == 0)
583bbf6f00cSJordan Brown 
584bbf6f00cSJordan Brown #define	SMB_DENY_RW(share_access) \
585bbf6f00cSJordan Brown 	((share_access & (FILE_SHARE_READ | FILE_SHARE_WRITE)) == 0)
586bbf6f00cSJordan Brown 
587bbf6f00cSJordan Brown #define	SMB_DENY_ALL(share_access) (share_access == 0)
588bbf6f00cSJordan Brown 
589bbf6f00cSJordan Brown #define	SMB_DENY_NONE(share_access) (share_access == FILE_SHARE_ALL)
590bbf6f00cSJordan Brown 
591bbf6f00cSJordan Brown /*
592bbf6f00cSJordan Brown  * The SMB open function determines what action should be taken depending
593bbf6f00cSJordan Brown  * on the existence or lack thereof of files used in the operation.  It
594bbf6f00cSJordan Brown  * has the following mapping:
595bbf6f00cSJordan Brown  *
596bbf6f00cSJordan Brown  *    1111 1
597bbf6f00cSJordan Brown  *    5432 1098 7654 3210
598bbf6f00cSJordan Brown  *    rrrr rrrr rrrC rrOO
599bbf6f00cSJordan Brown  *
600bbf6f00cSJordan Brown  * where:
601bbf6f00cSJordan Brown  *
602bbf6f00cSJordan Brown  *    O - Open (action to be taken if the target file exists)
603bbf6f00cSJordan Brown  *        0 - Fail
604bbf6f00cSJordan Brown  *        1 - Open or Append file
605bbf6f00cSJordan Brown  *        2 - Truncate file
606bbf6f00cSJordan Brown  *
607bbf6f00cSJordan Brown  *    C - Create (action to be taken if the target file does not exist)
608bbf6f00cSJordan Brown  *        0 - Fail
609bbf6f00cSJordan Brown  *        1 - Create file
610bbf6f00cSJordan Brown  */
611bbf6f00cSJordan Brown 
612bbf6f00cSJordan Brown #define	SMB_OFUN_OPEN_MASK		0x3
613bbf6f00cSJordan Brown #define	SMB_OFUN_CREATE_MASK		0x10
614bbf6f00cSJordan Brown 
615bbf6f00cSJordan Brown #define	SMB_OFUN_OPEN_FAIL		0
616bbf6f00cSJordan Brown #define	SMB_OFUN_OPEN_APPEND		1
617bbf6f00cSJordan Brown #define	SMB_OFUN_OPEN_OPEN		1
618bbf6f00cSJordan Brown #define	SMB_OFUN_OPEN_TRUNCATE		2
619bbf6f00cSJordan Brown 
620bbf6f00cSJordan Brown #define	SMB_OFUN_CREATE_FAIL		0x00
621bbf6f00cSJordan Brown #define	SMB_OFUN_CREATE_CREATE		0x10
622bbf6f00cSJordan Brown 
623bbf6f00cSJordan Brown /*
624bbf6f00cSJordan Brown  * The Action field of OpenAndX has the following format:
625bbf6f00cSJordan Brown  *
626bbf6f00cSJordan Brown  *    1111 11
627bbf6f00cSJordan Brown  *    5432 1098 7654 3210
628bbf6f00cSJordan Brown  *    Lrrr rrrr rrrr rrOO
629bbf6f00cSJordan Brown  *
630bbf6f00cSJordan Brown  * where:
631bbf6f00cSJordan Brown  *
632bbf6f00cSJordan Brown  *    L - Opportunistic lock.  1 if lock granted, else 0.
633bbf6f00cSJordan Brown  *
634bbf6f00cSJordan Brown  *    O - Open action:
635bbf6f00cSJordan Brown  *        1 - The file existed and was opened
636bbf6f00cSJordan Brown  *        2 - The file did not exist but was created
637bbf6f00cSJordan Brown  *        3 - The file existed and was truncated
638bbf6f00cSJordan Brown  */
639bbf6f00cSJordan Brown 
640bbf6f00cSJordan Brown #define	SMB_OACT_LOCK			0x8000
641bbf6f00cSJordan Brown #define	SMB_OACT_OPENED			0x01
642bbf6f00cSJordan Brown #define	SMB_OACT_CREATED		0x02
643bbf6f00cSJordan Brown #define	SMB_OACT_TRUNCATED		0x03
644bbf6f00cSJordan Brown 
645bbf6f00cSJordan Brown #define	SMB_OACT_OPLOCK			0x8000
646bbf6f00cSJordan Brown 
647bbf6f00cSJordan Brown #define	SMB_FTYPE_DISK			0
648bbf6f00cSJordan Brown #define	SMB_FTYPE_BYTE_PIPE		1
649bbf6f00cSJordan Brown #define	SMB_FTYPE_MESG_PIPE		2
650bbf6f00cSJordan Brown #define	SMB_FTYPE_PRINTER		3
651bbf6f00cSJordan Brown #define	SMB_FTYPE_UNKNOWN		0xFFFF
652bbf6f00cSJordan Brown 
653bbf6f00cSJordan Brown #define	SMB_DEVST_BLOCKING		0x8000
654bbf6f00cSJordan Brown #define	SMB_DEVST_ENDPOINT		0x4000
655bbf6f00cSJordan Brown #define	SMB_DEVST_TYPE_MASK		0x0C00
656bbf6f00cSJordan Brown #define	SMB_DEVST_TYPE_BYTE_PIPE	0x0000
657bbf6f00cSJordan Brown #define	SMB_DEVST_TYPE_MESG_PIPE	0x0400
658bbf6f00cSJordan Brown #define	SMB_DEVST_RMODE_MASK		0x0300
659bbf6f00cSJordan Brown #define	SMB_DEVST_RMODE_BYTES		0x0000
660bbf6f00cSJordan Brown #define	SMB_DEVST_RMODE_MESGS		0x0100
661bbf6f00cSJordan Brown #define	SMB_DEVST_ICOUNT_MASK		0x00FF		/* not used */
662bbf6f00cSJordan Brown 
663bbf6f00cSJordan Brown #define	SMB_FTYPE_IS_DISK(F)		((F) == SMB_FTYPE_DISK)
664bbf6f00cSJordan Brown #define	SMB_FTYPE_IS_PIPE(F) \
665bbf6f00cSJordan Brown 	(((F) == SMB_FTYPE_BYTE_PIPE) || ((F) == SMB_FTYPE_MESG_PIPE))
666bbf6f00cSJordan Brown #define	SMB_FTYPE_IS_PRINTER(F)		((F) == SMB_FTYPE_PRINTER)
667bbf6f00cSJordan Brown 
668bbf6f00cSJordan Brown /*
669bbf6f00cSJordan Brown  * TRANS2_FIND
670bbf6f00cSJordan Brown  */
671bbf6f00cSJordan Brown #define	SMB_FIND_FILE_DIRECTORY_INFO		0x101
672bbf6f00cSJordan Brown #define	SMB_FIND_FILE_FULL_DIRECTORY_INFO	0x102
673bbf6f00cSJordan Brown #define	SMB_FIND_FILE_NAMES_INFO		0x103
674bbf6f00cSJordan Brown #define	SMB_FIND_FILE_BOTH_DIRECTORY_INFO	0x104
675bbf6f00cSJordan Brown #define	SMB_FIND_FILE_ID_FULL_DIRECTORY_INFO	0x105
676bbf6f00cSJordan Brown #define	SMB_FIND_FILE_ID_BOTH_DIRECTORY_INFO	0x106
677bbf6f00cSJordan Brown #define	SMB_MAC_FIND_BOTH_HFS_INFO		MAC_FIND_BOTH_HFS_INFO
678bbf6f00cSJordan Brown 
679bbf6f00cSJordan Brown 
680bbf6f00cSJordan Brown /*
681bbf6f00cSJordan Brown  * Flags for TRANS2_FIND_FIRST2 and TRANS2_FIND_NEXT2 (NTDDK).
682bbf6f00cSJordan Brown  *
683bbf6f00cSJordan Brown  * If SMB_FIND_RETURN_RESUME_KEYS was set in the request parameters,
684bbf6f00cSJordan Brown  * each entry is preceded by a four-byte resume key.
685bbf6f00cSJordan Brown  */
686bbf6f00cSJordan Brown #define	SMB_FIND_CLOSE_AFTER_REQUEST	0x01
687bbf6f00cSJordan Brown #define	SMB_FIND_CLOSE_AT_EOS		0x02
688bbf6f00cSJordan Brown #define	SMB_FIND_RETURN_RESUME_KEYS	0x04
689bbf6f00cSJordan Brown #define	SMB_FIND_CONTINUE_FROM_LAST	0x08
690bbf6f00cSJordan Brown #define	SMB_FIND_WITH_BACKUP_INTENT	0x10
691bbf6f00cSJordan Brown 
692bbf6f00cSJordan Brown 
693bbf6f00cSJordan Brown /*
694bbf6f00cSJordan Brown  * TRANS2_QUERY_FS_INFORMATION
6959fb67ea3Safshin salek ardakani - Sun Microsystems - Irvine United States  *
6969fb67ea3Safshin salek ardakani - Sun Microsystems - Irvine United States  * SMB_QUERY_FS_QUOTA_INFO, SMB_QUERY_FS_CONTROL_INFO are not used in Windows
6979fb67ea3Safshin salek ardakani - Sun Microsystems - Irvine United States  * NT, and are not used in any post NT Windows operating systems. If a server
6989fb67ea3Safshin salek ardakani - Sun Microsystems - Irvine United States  * receives these information levels from a client, it should handle them as
6999fb67ea3Safshin salek ardakani - Sun Microsystems - Irvine United States  * invalid information levels.
700bbf6f00cSJordan Brown  */
701bbf6f00cSJordan Brown #define	SMB_INFO_ALLOCATION		1
702bbf6f00cSJordan Brown #define	SMB_INFO_VOLUME			2
703bbf6f00cSJordan Brown #define	SMB_QUERY_FS_LABEL_INFO		0x101
704bbf6f00cSJordan Brown #define	SMB_QUERY_FS_VOLUME_INFO	0x102
705bbf6f00cSJordan Brown #define	SMB_QUERY_FS_SIZE_INFO		0x103
706bbf6f00cSJordan Brown #define	SMB_QUERY_FS_DEVICE_INFO	0x104
707bbf6f00cSJordan Brown #define	SMB_QUERY_FS_ATTRIBUTE_INFO	0x105
7089fb67ea3Safshin salek ardakani - Sun Microsystems - Irvine United States #define	SMB_QUERY_FS_QUOTA_INFO		0x106
709bbf6f00cSJordan Brown #define	SMB_QUERY_FS_CONTROL_INFO	0x107
710bbf6f00cSJordan Brown 
7119fb67ea3Safshin salek ardakani - Sun Microsystems - Irvine United States #define	SMB_MAC_QUERY_FS_INFO		MAC_QUERY_FS_INFO
712bbf6f00cSJordan Brown 
713bbf6f00cSJordan Brown /*
714bbf6f00cSJordan Brown  * Internal use only.
715bbf6f00cSJordan Brown  * Define information levels to represent the following requests:
716bbf6f00cSJordan Brown  *    smb_query_information
717bbf6f00cSJordan Brown  *    smb_query_information2
718bbf6f00cSJordan Brown  *    smb_set_information
719bbf6f00cSJordan Brown  *    smb_set_information2
720bbf6f00cSJordan Brown  */
721bbf6f00cSJordan Brown #define	SMB_QUERY_INFORMATION	0x3001
722bbf6f00cSJordan Brown #define	SMB_QUERY_INFORMATION2	0x3002
723bbf6f00cSJordan Brown #define	SMB_SET_INFORMATION	0x3001
724bbf6f00cSJordan Brown #define	SMB_SET_INFORMATION2	0x3002
725bbf6f00cSJordan Brown 
726bbf6f00cSJordan Brown /* TRANS2_QUERY_{PATH,FILE}_INFORMATION */
727bbf6f00cSJordan Brown #define	SMB_INFO_STANDARD		 1	/* query, set */
728bbf6f00cSJordan Brown #define	SMB_INFO_QUERY_EA_SIZE		 2	/* query */
729bbf6f00cSJordan Brown #define	SMB_INFO_SET_EAS		 2	/* set */
730bbf6f00cSJordan Brown #define	SMB_INFO_QUERY_EAS_FROM_LIST	 3	/* query */
731bbf6f00cSJordan Brown #define	SMB_INFO_QUERY_ALL_EAS		 4	/* query */
732bbf6f00cSJordan Brown #define	SMB_INFO_QUERY_FULL_NAME	 5	/* unused */
733bbf6f00cSJordan Brown #define	SMB_INFO_IS_NAME_VALID		 6	/* query */
734bbf6f00cSJordan Brown 
735bbf6f00cSJordan Brown #define	SMB_QUERY_FILE_BASIC_INFO	 0x101
736bbf6f00cSJordan Brown #define	SMB_QUERY_FILE_STANDARD_INFO	 0x102
737bbf6f00cSJordan Brown #define	SMB_QUERY_FILE_EA_INFO		 0x103
738bbf6f00cSJordan Brown #define	SMB_QUERY_FILE_NAME_INFO	 0x104
739bbf6f00cSJordan Brown #define	SMB_QUERY_FILE_ALLOCATION_INFO	 0x105	/* unused */
740bbf6f00cSJordan Brown #define	SMB_QUERY_FILE_END_OF_FILE_INFO	 0x106	/* unused */
741bbf6f00cSJordan Brown #define	SMB_QUERY_FILE_ALL_INFO		 0x107
742bbf6f00cSJordan Brown #define	SMB_QUERY_FILE_ALT_NAME_INFO	 0x108
743bbf6f00cSJordan Brown #define	SMB_QUERY_FILE_STREAM_INFO	 0x109
744bbf6f00cSJordan Brown #define	SMB_QUERY_FILE_COMPRESSION_INFO	 0x10B
745bbf6f00cSJordan Brown 
746bbf6f00cSJordan Brown #define	SMB_MAC_SET_FINDER_INFO		MAC_SET_FINDER_INFO
747bbf6f00cSJordan Brown #define	SMB_MAC_DT_ADD_APPL		MAC_DT_ADD_APPL
748bbf6f00cSJordan Brown #define	SMB_MAC_DT_REMOVE_APPL		MAC_DT_REMOVE_APPL
749bbf6f00cSJordan Brown #define	SMB_MAC_DT_GET_APPL		MAC_DT_GET_APPL
750bbf6f00cSJordan Brown #define	SMB_MAC_DT_GET_ICON		MAC_DT_GET_ICON
751bbf6f00cSJordan Brown #define	SMB_MAC_DT_GET_ICON_INFO	MAC_DT_GET_ICON_INFO
752bbf6f00cSJordan Brown #define	SMB_MAC_DT_ADD_ICON		MAC_DT_ADD_ICON
753bbf6f00cSJordan Brown 
754bbf6f00cSJordan Brown #define	SMB_SET_FILE_BASIC_INFO		0x101
755bbf6f00cSJordan Brown #define	SMB_SET_FILE_DISPOSITION_INFO	0x102
756bbf6f00cSJordan Brown #define	SMB_SET_FILE_ALLOCATION_INFO	0x103
757bbf6f00cSJordan Brown #define	SMB_SET_FILE_END_OF_FILE_INFO	0x104
758bbf6f00cSJordan Brown 
759bbf6f00cSJordan Brown 
760bbf6f00cSJordan Brown /* NT passthrough levels - see ntifs.h FILE_INFORMATION_CLASS */
761bbf6f00cSJordan Brown #define	SMB_FILE_BASIC_INFORMATION		1004
762bbf6f00cSJordan Brown #define	SMB_FILE_STANDARD_INFORMATION		1005
763bbf6f00cSJordan Brown #define	SMB_FILE_INTERNAL_INFORMATION		1006
764bbf6f00cSJordan Brown #define	SMB_FILE_EA_INFORMATION			1007
765bbf6f00cSJordan Brown #define	SMB_FILE_ACCESS_INFORMATION		1008
766bbf6f00cSJordan Brown #define	SMB_FILE_NAME_INFORMATION		1009
767bbf6f00cSJordan Brown #define	SMB_FILE_RENAME_INFORMATION		1010
768bbf6f00cSJordan Brown #define	SMB_FILE_LINK_INFORMATION		1011
769bbf6f00cSJordan Brown #define	SMB_FILE_DISPOSITION_INFORMATION	1013
770bbf6f00cSJordan Brown #define	SMB_FILE_ALL_INFORMATION		1018
771bbf6f00cSJordan Brown #define	SMB_FILE_ALLOCATION_INFORMATION		1019
772bbf6f00cSJordan Brown #define	SMB_FILE_END_OF_FILE_INFORMATION	1020
773bbf6f00cSJordan Brown #define	SMB_FILE_ALT_NAME_INFORMATION		1021
774bbf6f00cSJordan Brown #define	SMB_FILE_STREAM_INFORMATION		1022
775bbf6f00cSJordan Brown #define	SMB_FILE_COMPRESSION_INFORMATION	1028
7769fb67ea3Safshin salek ardakani - Sun Microsystems - Irvine United States #define	SMB_FILE_NETWORK_OPEN_INFORMATION	1034
777bbf6f00cSJordan Brown #define	SMB_FILE_ATTR_TAG_INFORMATION		1035
778bbf6f00cSJordan Brown 
7799fb67ea3Safshin salek ardakani - Sun Microsystems - Irvine United States /* NT passthrough levels - see ntifs.h FILE_FS_INFORMATION_CLASS */
7809fb67ea3Safshin salek ardakani - Sun Microsystems - Irvine United States #define	SMB_FILE_FS_VOLUME_INFORMATION		1001
7819fb67ea3Safshin salek ardakani - Sun Microsystems - Irvine United States #define	SMB_FILE_FS_LABEL_INFORMATION		1002
7829fb67ea3Safshin salek ardakani - Sun Microsystems - Irvine United States #define	SMB_FILE_FS_SIZE_INFORMATION		1003
7839fb67ea3Safshin salek ardakani - Sun Microsystems - Irvine United States #define	SMB_FILE_FS_DEVICE_INFORMATION		1004
7849fb67ea3Safshin salek ardakani - Sun Microsystems - Irvine United States #define	SMB_FILE_FS_ATTRIBUTE_INFORMATION	1005
7859fb67ea3Safshin salek ardakani - Sun Microsystems - Irvine United States #define	SMB_FILE_FS_CONTROL_INFORMATION		1006
7869fb67ea3Safshin salek ardakani - Sun Microsystems - Irvine United States #define	SMB_FILE_FS_FULLSIZE_INFORMATION	1007
7879fb67ea3Safshin salek ardakani - Sun Microsystems - Irvine United States #define	SMB_FILE_FS_OBJECTID_INFORMATION	1008
7889fb67ea3Safshin salek ardakani - Sun Microsystems - Irvine United States #define	SMB_FILE_FS_DRIVERPATH_INFORMATION	1009
7899fb67ea3Safshin salek ardakani - Sun Microsystems - Irvine United States 
790bbf6f00cSJordan Brown /*
791bbf6f00cSJordan Brown  * The following bits may be set in the SecurityMode field of the
792bbf6f00cSJordan Brown  * SMB_COM_NEGOTIATE response.
793bbf6f00cSJordan Brown  *
79412b65585SGordon Ross  * Note: Same as the NTDDK definitions.
795bbf6f00cSJordan Brown  */
79612b65585SGordon Ross #define	NEGOTIATE_USER_SECURITY				0x01
79712b65585SGordon Ross #define	NEGOTIATE_ENCRYPT_PASSWORDS			0x02
798bbf6f00cSJordan Brown #define	NEGOTIATE_SECURITY_SIGNATURES_ENABLED		0x04
799bbf6f00cSJordan Brown #define	NEGOTIATE_SECURITY_SIGNATURES_REQUIRED		0x08
800bbf6f00cSJordan Brown 
801bbf6f00cSJordan Brown 
802bbf6f00cSJordan Brown /*
803bbf6f00cSJordan Brown  * Negotiated Capabilities (CIFS/1.0 section 4.1.1)
804bbf6f00cSJordan Brown  *
805bbf6f00cSJordan Brown  * Capabilities allow the server to tell the client what it supports.
806bbf6f00cSJordan Brown  * Undefined bits MUST be set to zero by servers, and MUST be ignored
807bbf6f00cSJordan Brown  * by clients. The bit definitions are:
808bbf6f00cSJordan Brown  *
809bbf6f00cSJordan Brown  * Capability Name	 Encoding   Meaning
810bbf6f00cSJordan Brown  * ====================	 ========   ==================================
811bbf6f00cSJordan Brown  * CAP_RAW_MODE		 0x0001	    The server supports SMB_COM_READ_RAW and
812bbf6f00cSJordan Brown  *				    SMB_COM_WRITE_RAW (obsolescent)
813bbf6f00cSJordan Brown  * CAP_MPX_MODE		 0x0002	    The server supports SMB_COM_READ_MPX and
814bbf6f00cSJordan Brown  *				    SMB_COM_WRITE_MPX (obsolescent)
815bbf6f00cSJordan Brown  * CAP_UNICODE		 0x0004	    The server supports Unicode strings
816bbf6f00cSJordan Brown  * CAP_LARGE_FILES	 0x0008	    The server supports large files with 64
817bbf6f00cSJordan Brown  *				    bit offsets
818bbf6f00cSJordan Brown  * CAP_NT_SMBS		 0x0010	    The server supports the SMBs particular
819bbf6f00cSJordan Brown  *				    to the NT LM 0.12 dialect.
820bbf6f00cSJordan Brown  *				    Implies CAP_NT_FIND.
821bbf6f00cSJordan Brown  * CAP_RPC_REMOTE_APIS	 0x0020	    The server supports remote admin API
822bbf6f00cSJordan Brown  *				    requests via DCE RPC
823bbf6f00cSJordan Brown  * CAP_STATUS32		 0x0040	    The server can respond with 32 bit
824bbf6f00cSJordan Brown  *				    status codes in Status.Status
825bbf6f00cSJordan Brown  * CAP_LEVEL_II_OPLOCKS	 0x0080	    The server supports level 2 oplocks
826bbf6f00cSJordan Brown  * CAP_LOCK_AND_READ	 0x0100	    The server supports the
827bbf6f00cSJordan Brown  *				    SMB_COM_LOCK_AND_READ SMB
828bbf6f00cSJordan Brown  * CAP_NT_FIND		 0x0200
829bbf6f00cSJordan Brown  * CAP_BULK_TRANSFER	 0x0400
830bbf6f00cSJordan Brown  * CAP_COMPRESSED_BULK	 0x0800
831bbf6f00cSJordan Brown  * CAP_DFS		 0x1000	    The server is DFS aware
8329fb67ea3Safshin salek ardakani - Sun Microsystems - Irvine United States  * CAP_INFOLEVEL_PASSTHRU 0x2000    The server supports passthru information
8339fb67ea3Safshin salek ardakani - Sun Microsystems - Irvine United States  *				    level processing capability.
834bbf6f00cSJordan Brown  * CAP_LARGE_READX	 0x4000	    The server supports large
835bbf6f00cSJordan Brown  *				    SMB_COM_READ_ANDX
836bbf6f00cSJordan Brown  * CAP_LARGE_WRITEX	 0x8000	    The server supports large
837bbf6f00cSJordan Brown  *				    SMB_COM_WRITE_ANDX
838bbf6f00cSJordan Brown  * CAP_RESERVED		 0x02000000 Reserved for future use.
839bbf6f00cSJordan Brown  * CAP_EXTENDED_SECURITY 0x80000000 The server supports extended security
840bbf6f00cSJordan Brown  *				    exchanges.
841bbf6f00cSJordan Brown  *
842bbf6f00cSJordan Brown  * Extended security exchanges provides a means of supporting arbitrary
843bbf6f00cSJordan Brown  * authentication protocols within CIFS. Security blobs are opaque to the
844bbf6f00cSJordan Brown  * CIFS protocol; they are messages in some authentication protocol that
845bbf6f00cSJordan Brown  * has been agreed upon by client and server by some out of band mechanism,
846bbf6f00cSJordan Brown  * for which CIFS merely functions as a transport. When
847bbf6f00cSJordan Brown  * CAP_EXTENDED_SECURITY is negotiated, the server includes a first
848bbf6f00cSJordan Brown  * security blob in its response; subsequent security blobs are exchanged
849bbf6f00cSJordan Brown  * in SMB_COM_SESSION_SETUP_ANDX requests and responses until the
850bbf6f00cSJordan Brown  * authentication protocol terminates.
851bbf6f00cSJordan Brown  */
852bbf6f00cSJordan Brown #define	CAP_RAW_MODE			0x0001
853bbf6f00cSJordan Brown #define	CAP_MPX_MODE			0x0002
854bbf6f00cSJordan Brown #define	CAP_UNICODE			0x0004
855bbf6f00cSJordan Brown #define	CAP_LARGE_FILES			0x0008
856bbf6f00cSJordan Brown #define	CAP_NT_SMBS			0x0010
857bbf6f00cSJordan Brown #define	CAP_RPC_REMOTE_APIS		0x0020
858bbf6f00cSJordan Brown #define	CAP_STATUS32			0x0040
859bbf6f00cSJordan Brown #define	CAP_LEVEL_II_OPLOCKS		0x0080
860bbf6f00cSJordan Brown #define	CAP_LOCK_AND_READ		0x0100
861bbf6f00cSJordan Brown #define	CAP_NT_FIND			0x0200
862bbf6f00cSJordan Brown #define	CAP_BULK_TRANSFER		0x0400
863bbf6f00cSJordan Brown #define	CAP_COMPRESSED_BULK		0x0800
864bbf6f00cSJordan Brown #define	CAP_DFS				0x1000
8659fb67ea3Safshin salek ardakani - Sun Microsystems - Irvine United States #define	CAP_INFOLEVEL_PASSTHRU		0x2000
866bbf6f00cSJordan Brown #define	CAP_LARGE_READX			0x4000
867bbf6f00cSJordan Brown #define	CAP_LARGE_WRITEX		0x8000
868bbf6f00cSJordan Brown #define	CAP_RESERVED			0x02000000
869bbf6f00cSJordan Brown #define	CAP_EXTENDED_SECURITY		0x80000000
870bbf6f00cSJordan Brown 
871bbf6f00cSJordan Brown 
872bbf6f00cSJordan Brown /*
873bbf6f00cSJordan Brown  * Different device types according to NT
874bbf6f00cSJordan Brown  */
875bbf6f00cSJordan Brown #define	FILE_DEVICE_BEEP		0x00000001
876bbf6f00cSJordan Brown #define	FILE_DEVICE_CD_ROM		0x00000002
877bbf6f00cSJordan Brown #define	FILE_DEVICE_CD_ROM_FILE_SYSTEM	0x00000003
878bbf6f00cSJordan Brown #define	FILE_DEVICE_CONTROLLER		0x00000004
879bbf6f00cSJordan Brown #define	FILE_DEVICE_DATALINK		0x00000005
880bbf6f00cSJordan Brown #define	FILE_DEVICE_DFS			0x00000006
881bbf6f00cSJordan Brown #define	FILE_DEVICE_DISK		0x00000007
882bbf6f00cSJordan Brown #define	FILE_DEVICE_DISK_FILE_SYSTEM	0x00000008
883bbf6f00cSJordan Brown #define	FILE_DEVICE_FILE_SYSTEM		0x00000009
884bbf6f00cSJordan Brown #define	FILE_DEVICE_INPORT_PORT		0x0000000a
885bbf6f00cSJordan Brown #define	FILE_DEVICE_KEYBOARD		0x0000000b
886bbf6f00cSJordan Brown #define	FILE_DEVICE_MAILSLOT		0x0000000c
887bbf6f00cSJordan Brown #define	FILE_DEVICE_MIDI_IN		0x0000000d
888bbf6f00cSJordan Brown #define	FILE_DEVICE_MIDI_OUT		0x0000000e
889bbf6f00cSJordan Brown #define	FILE_DEVICE_MOUSE		0x0000000f
890bbf6f00cSJordan Brown #define	FILE_DEVICE_MULTI_UNC_PROVIDER	0x00000010
891bbf6f00cSJordan Brown #define	FILE_DEVICE_NAMED_PIPE		0x00000011
892bbf6f00cSJordan Brown #define	FILE_DEVICE_NETWORK		0x00000012
893bbf6f00cSJordan Brown #define	FILE_DEVICE_NETWORK_BROWSER	0x00000013
894bbf6f00cSJordan Brown #define	FILE_DEVICE_NETWORK_FILE_SYSTEM 0x00000014
895bbf6f00cSJordan Brown #define	FILE_DEVICE_NULL		0x00000015
896bbf6f00cSJordan Brown #define	FILE_DEVICE_PARALLEL_PORT	0x00000016
897bbf6f00cSJordan Brown #define	FILE_DEVICE_PHYSICAL_NETCARD	0x00000017
898bbf6f00cSJordan Brown #define	FILE_DEVICE_PRINTER		0x00000018
899bbf6f00cSJordan Brown #define	FILE_DEVICE_SCANNER		0x00000019
900bbf6f00cSJordan Brown #define	FILE_DEVICE_SERIAL_MOUSE_PORT	0x0000001a
901bbf6f00cSJordan Brown #define	FILE_DEVICE_SERIAL_PORT		0x0000001b
902bbf6f00cSJordan Brown #define	FILE_DEVICE_SCREEN		0x0000001c
903bbf6f00cSJordan Brown #define	FILE_DEVICE_SOUND		0x0000001d
904bbf6f00cSJordan Brown #define	FILE_DEVICE_STREAMS		0x0000001e
905bbf6f00cSJordan Brown #define	FILE_DEVICE_TAPE		0x0000001f
906bbf6f00cSJordan Brown #define	FILE_DEVICE_TAPE_FILE_SYSTEM	0x00000020
907bbf6f00cSJordan Brown #define	FILE_DEVICE_TRANSPORT		0x00000021
908bbf6f00cSJordan Brown #define	FILE_DEVICE_UNKNOWN		0x00000022
909bbf6f00cSJordan Brown #define	FILE_DEVICE_VIDEO		0x00000023
910bbf6f00cSJordan Brown #define	FILE_DEVICE_VIRTUAL_DISK	0x00000024
911bbf6f00cSJordan Brown #define	FILE_DEVICE_WAVE_IN		0x00000025
912bbf6f00cSJordan Brown #define	FILE_DEVICE_WAVE_OUT		0x00000026
913bbf6f00cSJordan Brown #define	FILE_DEVICE_8042_PORT		0x00000027
914bbf6f00cSJordan Brown #define	FILE_DEVICE_NETWORK_REDIRECTOR	0x00000028
915bbf6f00cSJordan Brown #define	FILE_DEVICE_BATTERY		0x00000029
916bbf6f00cSJordan Brown #define	FILE_DEVICE_BUS_EXTENDER	0x0000002a
917bbf6f00cSJordan Brown #define	FILE_DEVICE_MODEM		0x0000002b
918bbf6f00cSJordan Brown #define	FILE_DEVICE_VDM			0x0000002c
919bbf6f00cSJordan Brown 
920bbf6f00cSJordan Brown /*
921bbf6f00cSJordan Brown  * Some of these device types are not currently accessible over the network
922bbf6f00cSJordan Brown  * and may never be accessible over the network. Some may change to be
923bbf6f00cSJordan Brown  *
924bbf6f00cSJordan Brown  * accessible over the network. The values for device types that may never
925bbf6f00cSJordan Brown  * be accessible over the network may be redefined to be just reserved at
926bbf6f00cSJordan Brown  * some date in the future.
927bbf6f00cSJordan Brown  *
928bbf6f00cSJordan Brown  * Characteristics is the sum of any of the following:
929bbf6f00cSJordan Brown  */
930bbf6f00cSJordan Brown 
931bbf6f00cSJordan Brown #define	FILE_REMOVABLE_MEDIA		0x00000001
932bbf6f00cSJordan Brown #define	FILE_READ_ONLY_DEVICE		0x00000002
933bbf6f00cSJordan Brown #define	FILE_FLOPPY_DISKETTE		0x00000004
934bbf6f00cSJordan Brown #define	FILE_WRITE_ONE_MEDIA		0x00000008
935bbf6f00cSJordan Brown #define	FILE_REMOTE_DEVICE		0x00000010
936bbf6f00cSJordan Brown #define	FILE_DEVICE_IS_MOUNTED		0x00000020
937bbf6f00cSJordan Brown #define	FILE_VIRTUAL_VOLUME		0x00000040
938bbf6f00cSJordan Brown 
939bbf6f00cSJordan Brown /*
940*a90cf9f2SGordon Ross  * File System Control Flags for smb_com_trans2_query|set_fs_information
941*a90cf9f2SGordon Ross  * level SMB_FILE_FS_CONTROL_INFORMATION
942*a90cf9f2SGordon Ross  */
943*a90cf9f2SGordon Ross #define	FILE_VC_QUOTA_TRACK		0x00000001
944*a90cf9f2SGordon Ross #define	FILE_VC_QUOTA_ENFORCE		0x00000002
945*a90cf9f2SGordon Ross #define	FILE_VC_CONTENT_INDEX_DISABLED	0x00000008
946*a90cf9f2SGordon Ross #define	FILE_VC_LOG_QUOTA_THRESHOLD	0x00000010
947*a90cf9f2SGordon Ross #define	FILE_VC_LOG_QUOTA_LIMIT		0x00000020
948*a90cf9f2SGordon Ross #define	FILE_VC_LOG_VOLUME_THRESHOLD	0x00000040
949*a90cf9f2SGordon Ross #define	FILE_VC_LOG_VOLUME_LIMIT	0x00000080
950*a90cf9f2SGordon Ross #define	FILE_VC_QUOTAS_INCOMPLETE	0x00000100
951*a90cf9f2SGordon Ross #define	FILE_VC_QUOTAS_REBUILDING	0x00000200
952*a90cf9f2SGordon Ross 
953*a90cf9f2SGordon Ross /*
954bbf6f00cSJordan Brown  * CREATE_ANDX ShareAccess Flags
955bbf6f00cSJordan Brown  */
956bbf6f00cSJordan Brown 
957bbf6f00cSJordan Brown #define	FILE_SHARE_NONE			0x00000000
958bbf6f00cSJordan Brown #define	FILE_SHARE_READ			0x00000001
959bbf6f00cSJordan Brown #define	FILE_SHARE_WRITE		0x00000002
960bbf6f00cSJordan Brown #define	FILE_SHARE_DELETE		0x00000004
961bbf6f00cSJordan Brown #define	FILE_SHARE_ALL			0x00000007
962bbf6f00cSJordan Brown #define	FILE_SHARE_VALID_FLAGS		0x00000007
963bbf6f00cSJordan Brown 
964bbf6f00cSJordan Brown 
965bbf6f00cSJordan Brown /*
966bbf6f00cSJordan Brown  * CREATE_ANDX CreateDisposition flags
967bbf6f00cSJordan Brown  *
968bbf6f00cSJordan Brown  * FILE_SUPERSEDE     If the file already exists it should be superseded
969bbf6f00cSJordan Brown  *		      by the specified file. If the file does not already
970bbf6f00cSJordan Brown  *		      exist then it should be created.
971bbf6f00cSJordan Brown  *
972bbf6f00cSJordan Brown  * FILE_CREATE	      If the file already exists the operation should fail.
973bbf6f00cSJordan Brown  *		      If the file does not already exist then it should be
974bbf6f00cSJordan Brown  *		      created. (aka CREATE_NEW)
975bbf6f00cSJordan Brown  *
976bbf6f00cSJordan Brown  * FILE_OPEN	      If the file already exists then it should be opened.
977bbf6f00cSJordan Brown  *		      If the file does not already exist then the operation
978bbf6f00cSJordan Brown  *		      should fail. (aka OPEN_EXISTING)
979bbf6f00cSJordan Brown  *
980bbf6f00cSJordan Brown  * FILE_OPEN_IF	      If the file already exists then it should be opened.
981bbf6f00cSJordan Brown  *		      If the file does not already exist then it should be
982bbf6f00cSJordan Brown  *		      created. (aka OPEN_ALWAYS)
983bbf6f00cSJordan Brown  *
984bbf6f00cSJordan Brown  * FILE_OVERWRITE     If the file already exists, it should be opened and
985bbf6f00cSJordan Brown  *		      overwritten. If the file does not already exist then
986bbf6f00cSJordan Brown  *		      the operation should fail. (aka TRUNCATE_EXISTING)
987bbf6f00cSJordan Brown  *
988bbf6f00cSJordan Brown  * FILE_OVERWRITE_IF  If the file already exists, it should be opened and
989bbf6f00cSJordan Brown  *		      overwritten. If the file does not already exist then
990bbf6f00cSJordan Brown  *		      it should be created. (aka CREATE_ALWAYS)
991bbf6f00cSJordan Brown  */
992bbf6f00cSJordan Brown #define	FILE_SUPERSEDE			0x00000000
993bbf6f00cSJordan Brown #define	FILE_OPEN			0x00000001
994bbf6f00cSJordan Brown #define	FILE_CREATE			0x00000002
995bbf6f00cSJordan Brown #define	FILE_OPEN_IF			0x00000003
996bbf6f00cSJordan Brown #define	FILE_OVERWRITE			0x00000004
997bbf6f00cSJordan Brown #define	FILE_OVERWRITE_IF		0x00000005
998bbf6f00cSJordan Brown #define	FILE_MAXIMUM_DISPOSITION	0x00000005
999bbf6f00cSJordan Brown 
1000bbf6f00cSJordan Brown /*
1001bbf6f00cSJordan Brown  * CREATE_ANDX Impersonation levels
1002bbf6f00cSJordan Brown  */
1003bbf6f00cSJordan Brown 
1004bbf6f00cSJordan Brown #define	SECURITY_ANONYMOUS	0x00000001
1005bbf6f00cSJordan Brown #define	SECURITY_IDENTIFICATION	0x00000002
1006bbf6f00cSJordan Brown #define	SECURITY_IMPERSONATION	0x00000003
1007bbf6f00cSJordan Brown #define	SECURITY_DELEGATION	0x00000004
1008bbf6f00cSJordan Brown 
1009bbf6f00cSJordan Brown /*
1010bbf6f00cSJordan Brown  * CREATE_ANDX SecurityFlags
1011bbf6f00cSJordan Brown  */
1012bbf6f00cSJordan Brown 
1013bbf6f00cSJordan Brown #define	SECURITY_CONTEXT_TRACKING	0x00000001
1014bbf6f00cSJordan Brown #define	SECURITY_EFFECTIVE_ONLY		0x00000002
1015bbf6f00cSJordan Brown 
1016bbf6f00cSJordan Brown /*
1017bbf6f00cSJordan Brown  * Server types
1018bbf6f00cSJordan Brown  */
1019bbf6f00cSJordan Brown #define	SV_WORKSTATION		0x00000001	/* All workstations */
1020bbf6f00cSJordan Brown #define	SV_SERVER		0x00000002	/* All servers */
1021bbf6f00cSJordan Brown #define	SV_SQLSERVER		0x00000004	/* running with SQL server */
1022bbf6f00cSJordan Brown #define	SV_DOMAIN_CTRL		0x00000008	/* Primary domain controller */
1023bbf6f00cSJordan Brown #define	SV_DOMAIN_BAKCTRL	0x00000010	/* Backup domain controller */
1024bbf6f00cSJordan Brown #define	SV_TIME_SOURCE		0x00000020	/* running timesource service */
1025bbf6f00cSJordan Brown #define	SV_AFP			0x00000040	/* Apple File Protocol */
1026bbf6f00cSJordan Brown #define	SV_NOVELL		0x00000080	/* Novell servers */
1027bbf6f00cSJordan Brown #define	SV_DOMAIN_MEMBER	0x00000100	/* Domain Member */
1028bbf6f00cSJordan Brown #define	SV_PRINTQ_SERVER	0x00000200	/* Server sharing print queue */
1029bbf6f00cSJordan Brown #define	SV_DIALIN_SERVER	0x00000400	/* Server running dialin */
1030bbf6f00cSJordan Brown #define	SV_XENIX_SERVER		0x00000800	/* Xenix server */
1031bbf6f00cSJordan Brown #define	SV_NT			0x00001000	/* NT server */
1032bbf6f00cSJordan Brown #define	SV_WFW			0x00002000	/* Server running Windows for */
1033bbf6f00cSJordan Brown #define	SV_SERVER_NT		0x00008000	/* Windows NT non DC server */
1034bbf6f00cSJordan Brown #define	SV_POTENTIAL_BROWSER	0x00010000	/* can run browser service */
1035bbf6f00cSJordan Brown #define	SV_BACKUP_BROWSER	0x00020000	/* Backup browser server */
1036bbf6f00cSJordan Brown #define	SV_MASTER_BROWSER	0x00040000	/* Master browser server */
1037bbf6f00cSJordan Brown #define	SV_DOMAIN_MASTER	0x00080000	/* Domain Master Browser */
1038bbf6f00cSJordan Brown #define	SV_OSF			0x00100000	/* OSF operating system */
1039bbf6f00cSJordan Brown #define	SV_VMS			0x00200000	/* VMS operating system */
1040bbf6f00cSJordan Brown #define	SV_WINDOWS_95_PLUS	0x00400000	/* Windows 95 or better */
1041bbf6f00cSJordan Brown 
1042bbf6f00cSJordan Brown #define	SV_LOCAL_LIST_ONLY	0x40000000	/* Enumerate only "local" */
1043bbf6f00cSJordan Brown #define	SV_TYPE_DOMAIN_ENUM	0x80000000	/*  Enumerate Domains */
1044bbf6f00cSJordan Brown 
1045bbf6f00cSJordan Brown #define	MY_SERVER_TYPE	(SV_SERVER | SV_NT | SV_SERVER_NT)
1046bbf6f00cSJordan Brown 
1047bbf6f00cSJordan Brown 
1048bbf6f00cSJordan Brown #define	PRQ_ACTIVE	0	/* Active */
1049bbf6f00cSJordan Brown #define	PRQ_PAUSE	1	/* Paused */
1050bbf6f00cSJordan Brown #define	PRQ_ERROR	2	/* Error Occurred */
1051bbf6f00cSJordan Brown #define	PRQ_PENDING	3	/* Deletion pending */
1052bbf6f00cSJordan Brown 
1053bbf6f00cSJordan Brown #define	PRJ_QS_QUEUED	0	/* Active */
1054bbf6f00cSJordan Brown #define	PRJ_QS_PAUSED	1	/* Paused */
1055bbf6f00cSJordan Brown #define	PRJ_QS_SPOOLING	2	/* Paused */
1056bbf6f00cSJordan Brown #define	PRJ_QS_PRINTING	3	/* Paused */
1057bbf6f00cSJordan Brown 
1058bbf6f00cSJordan Brown 
1059bbf6f00cSJordan Brown #define	SHARE_ACCESS_READ	0x01	/* read & execute from resource	*/
1060bbf6f00cSJordan Brown #define	SHARE_ACCESS_WRITE	0x02	/* write data to resource	*/
1061bbf6f00cSJordan Brown #define	SHARE_ACCESS_CREATE	0x04	/* create an instance of	*/
1062bbf6f00cSJordan Brown #define	SHARE_ACCESS_EXEC	0x08	/* execute from resource	*/
1063bbf6f00cSJordan Brown #define	SHARE_ACCESS_DELETE	0x10	/* Permission to delete the resource */
1064bbf6f00cSJordan Brown #define	SHARE_ACCESS_ATTRIB	0x20	/* Permission to modify the resource */
1065bbf6f00cSJordan Brown #define	SHARE_ACCESS_PERM	0x40	/* Permission to change permissions */
1066bbf6f00cSJordan Brown #define	SHARE_ACCESS_ALL	0x7F	/* All of the above permissions	*/
1067bbf6f00cSJordan Brown 
1068bbf6f00cSJordan Brown 
1069bbf6f00cSJordan Brown /*
1070bbf6f00cSJordan Brown  * SMB_COM_NT_TRANSACTION sub-command codes (CIFS/1.0 section 5.3)
1071bbf6f00cSJordan Brown  *
1072bbf6f00cSJordan Brown  * SubCommand Code		   Value Description
1073bbf6f00cSJordan Brown  * =============================== ===== =================================
1074bbf6f00cSJordan Brown  * NT_TRANSACT_CREATE		   1	 File open/create
1075bbf6f00cSJordan Brown  * NT_TRANSACT_IOCTL		   2	 Device IOCTL
1076bbf6f00cSJordan Brown  * NT_TRANSACT_SET_SECURITY_DESC   3	 Set security descriptor
1077bbf6f00cSJordan Brown  * NT_TRANSACT_NOTIFY_CHANGE	   4	 Start directory watch
1078bbf6f00cSJordan Brown  * NT_TRANSACT_RENAME		   5	 Reserved (handle-based rename)
1079bbf6f00cSJordan Brown  * NT_TRANSACT_QUERY_SECURITY_DESC 6	 Retrieve security descriptor
1080bbf6f00cSJordan Brown  * NT_TRANSACT_QUERY_QUOTA	   7	 Retrieve quota information
1081bbf6f00cSJordan Brown  * NT_TRANSACT_SET_QUOTA	   8	 Set quota information
1082bbf6f00cSJordan Brown  */
1083bbf6f00cSJordan Brown #define	NT_TRANSACT_MIN_FUNCTION	1
1084bbf6f00cSJordan Brown 
1085bbf6f00cSJordan Brown #define	NT_TRANSACT_CREATE		1
1086bbf6f00cSJordan Brown #define	NT_TRANSACT_IOCTL		2
1087bbf6f00cSJordan Brown #define	NT_TRANSACT_SET_SECURITY_DESC	3
1088bbf6f00cSJordan Brown #define	NT_TRANSACT_NOTIFY_CHANGE	4
1089bbf6f00cSJordan Brown #define	NT_TRANSACT_RENAME		5
1090bbf6f00cSJordan Brown #define	NT_TRANSACT_QUERY_SECURITY_DESC 6
1091bbf6f00cSJordan Brown #define	NT_TRANSACT_QUERY_QUOTA		7
1092bbf6f00cSJordan Brown #define	NT_TRANSACT_SET_QUOTA		8
1093bbf6f00cSJordan Brown 
1094bbf6f00cSJordan Brown #define	NT_TRANSACT_MAX_FUNCTION	8
1095bbf6f00cSJordan Brown 
1096bbf6f00cSJordan Brown 
1097bbf6f00cSJordan Brown /*
1098bbf6f00cSJordan Brown  * Pipe states
1099bbf6f00cSJordan Brown  */
1100bbf6f00cSJordan Brown #define	SMB_PIPE_READMODE_BYTE		0x0000
1101bbf6f00cSJordan Brown #define	SMB_PIPE_READMODE_MESSAGE	0x0100
1102bbf6f00cSJordan Brown #define	SMB_PIPE_TYPE_BYTE		0x0000
1103bbf6f00cSJordan Brown #define	SMB_PIPE_TYPE_MESSAGE		0x0400
1104bbf6f00cSJordan Brown #define	SMB_PIPE_END_CLIENT		0x0000
1105bbf6f00cSJordan Brown #define	SMB_PIPE_END_SERVER		0x4000
1106bbf6f00cSJordan Brown #define	SMB_PIPE_WAIT			0x0000
1107bbf6f00cSJordan Brown #define	SMB_PIPE_NOWAIT			0x8000
1108bbf6f00cSJordan Brown #define	SMB_PIPE_UNLIMITED_INSTANCES	0x00FF
1109bbf6f00cSJordan Brown 
1110bbf6f00cSJordan Brown /*
1111bbf6f00cSJordan Brown  * smb_com_seek request
1112bbf6f00cSJordan Brown  */
1113bbf6f00cSJordan Brown #define	SMB_SEEK_SET	0 /* set file offset to specified offset */
1114bbf6f00cSJordan Brown #define	SMB_SEEK_CUR	1 /* set file offset to current plus specified offset */
1115bbf6f00cSJordan Brown #define	SMB_SEEK_END	2 /* set file offset to EOF plus specified offset */
1116bbf6f00cSJordan Brown 
1117bbf6f00cSJordan Brown /*
1118bbf6f00cSJordan Brown  * API Numbers for Transact based RAP (Remote Administration Protocol) calls
1119bbf6f00cSJordan Brown  */
1120bbf6f00cSJordan Brown #define	API_WshareEnum			0
1121bbf6f00cSJordan Brown #define	API_WshareGetInfo		1
1122bbf6f00cSJordan Brown #define	API_WshareSetInfo		2
1123bbf6f00cSJordan Brown #define	API_WshareAdd			3
1124bbf6f00cSJordan Brown #define	API_WshareDel			4
1125bbf6f00cSJordan Brown #define	API_NetShareCheck		5
1126bbf6f00cSJordan Brown #define	API_WsessionEnum		6
1127bbf6f00cSJordan Brown #define	API_WsessionGetInfo		7
1128bbf6f00cSJordan Brown #define	API_WsessionDel			8
1129bbf6f00cSJordan Brown #define	API_WconnectionEnum		9
1130bbf6f00cSJordan Brown #define	API_WfileEnum			10
1131bbf6f00cSJordan Brown #define	API_WfileGetInfo		11
1132bbf6f00cSJordan Brown #define	API_WfileClose			12
1133bbf6f00cSJordan Brown #define	API_WserverGetInfo		13
1134bbf6f00cSJordan Brown #define	API_WserverSetInfo		14
1135bbf6f00cSJordan Brown #define	API_WserverDiskEnum		15
1136bbf6f00cSJordan Brown #define	API_WserverAdminCommand		16
1137bbf6f00cSJordan Brown #define	API_NetAuditOpen		17
1138bbf6f00cSJordan Brown #define	API_WauditClear			18
1139bbf6f00cSJordan Brown #define	API_NetErrorLogOpen		19
1140bbf6f00cSJordan Brown #define	API_WerrorLogClear		20
1141bbf6f00cSJordan Brown #define	API_NetCharDevEnum		21
1142bbf6f00cSJordan Brown #define	API_NetCharDevGetInfo		22
1143bbf6f00cSJordan Brown #define	API_WCharDevControl		23
1144bbf6f00cSJordan Brown #define	API_NetCharDevQEnum		24
1145bbf6f00cSJordan Brown #define	API_NetCharDevQGetInfo		25
1146bbf6f00cSJordan Brown #define	API_WCharDevQSetInfo		26
1147bbf6f00cSJordan Brown #define	API_WCharDevQPurge		27
1148bbf6f00cSJordan Brown #define	API_WCharDevQPurgeSelf		28
1149bbf6f00cSJordan Brown #define	API_WMessageNameEnum		29
1150bbf6f00cSJordan Brown #define	API_WMessageNameGetInfo		30
1151bbf6f00cSJordan Brown #define	API_WMessageNameAdd		31
1152bbf6f00cSJordan Brown #define	API_WMessageNameDel		32
1153bbf6f00cSJordan Brown #define	API_WMessageNameFwd		33
1154bbf6f00cSJordan Brown #define	API_WMessageNameUnFwd		34
1155bbf6f00cSJordan Brown #define	API_WMessageBufferSend		35
1156bbf6f00cSJordan Brown #define	API_WMessageFileSend		36
1157bbf6f00cSJordan Brown #define	API_WMessageLogFileSet		37
1158bbf6f00cSJordan Brown #define	API_WMessageLogFileGet		38
1159bbf6f00cSJordan Brown #define	API_WServiceEnum		39
1160bbf6f00cSJordan Brown #define	API_WServiceInstall		40
1161bbf6f00cSJordan Brown #define	API_WServiceControl		41
1162bbf6f00cSJordan Brown #define	API_WAccessEnum			42
1163bbf6f00cSJordan Brown #define	API_WAccessGetInfo		43
1164bbf6f00cSJordan Brown #define	API_WAccessSetInfo		44
1165bbf6f00cSJordan Brown #define	API_WAccessAdd			45
1166bbf6f00cSJordan Brown #define	API_WAccessDel			46
1167bbf6f00cSJordan Brown #define	API_WGroupEnum			47
1168bbf6f00cSJordan Brown #define	API_WGroupAdd			48
1169bbf6f00cSJordan Brown #define	API_WGroupDel			49
1170bbf6f00cSJordan Brown #define	API_WGroupAddUser		50
1171bbf6f00cSJordan Brown #define	API_WGroupDelUser		51
1172bbf6f00cSJordan Brown #define	API_WGroupGetUsers		52
1173bbf6f00cSJordan Brown #define	API_WUserEnum			53
1174bbf6f00cSJordan Brown #define	API_WUserAdd			54
1175bbf6f00cSJordan Brown #define	API_WUserDel			55
1176bbf6f00cSJordan Brown #define	API_WUserGetInfo		56
1177bbf6f00cSJordan Brown #define	API_WUserSetInfo		57
1178bbf6f00cSJordan Brown #define	API_WUserPasswordSet		58
1179bbf6f00cSJordan Brown #define	API_WUserGetGroups		59
1180bbf6f00cSJordan Brown #define	API_DeadTableEntry		60
1181bbf6f00cSJordan Brown #define	API_WWkstaSetUID		62
1182bbf6f00cSJordan Brown #define	API_WWkstaGetInfo		63
1183bbf6f00cSJordan Brown #define	API_WWkstaSetInfo		64
1184bbf6f00cSJordan Brown #define	API_WUseEnum			65
1185bbf6f00cSJordan Brown #define	API_WUseAdd			66
1186bbf6f00cSJordan Brown #define	API_WUseDel			67
1187bbf6f00cSJordan Brown #define	API_WUseGetInfo			68
1188bbf6f00cSJordan Brown #define	API_WPrintQEnum			69
1189bbf6f00cSJordan Brown #define	API_WPrintQGetInfo		70
1190bbf6f00cSJordan Brown #define	API_WPrintQSetInfo		71
1191bbf6f00cSJordan Brown #define	API_WPrintQAdd			72
1192bbf6f00cSJordan Brown #define	API_WPrintQDel			73
1193bbf6f00cSJordan Brown #define	API_WPrintQPause		74
1194bbf6f00cSJordan Brown #define	API_WPrintQContinue		75
1195bbf6f00cSJordan Brown #define	API_WPrintJobEnum		76
1196bbf6f00cSJordan Brown #define	API_WPrintJobGetInfo		77
1197bbf6f00cSJordan Brown #define	API_WPrintJobSetInfo_OLD	78
1198bbf6f00cSJordan Brown #define	API_WPrintJobDel		81
1199bbf6f00cSJordan Brown #define	API_WPrintJobPause		82
1200bbf6f00cSJordan Brown #define	API_WPrintJobContinue		83
1201bbf6f00cSJordan Brown #define	API_WPrintDestEnum		84
1202bbf6f00cSJordan Brown #define	API_WPrintDestGetInfo		85
1203bbf6f00cSJordan Brown #define	API_WPrintDestControl		86
1204bbf6f00cSJordan Brown #define	API_WProfileSave		87
1205bbf6f00cSJordan Brown #define	API_WProfileLoad		88
1206bbf6f00cSJordan Brown #define	API_WStatisticsGet		89
1207bbf6f00cSJordan Brown #define	API_WStatisticsClear		90
1208bbf6f00cSJordan Brown #define	API_NetRemoteTOD		91
1209bbf6f00cSJordan Brown #define	API_WNetBiosEnum		92
1210bbf6f00cSJordan Brown #define	API_WNetBiosGetInfo		93
1211bbf6f00cSJordan Brown #define	API_NetServerEnum		94
1212bbf6f00cSJordan Brown #define	API_I_NetServerEnum		95
1213bbf6f00cSJordan Brown #define	API_WServiceGetInfo		96
1214bbf6f00cSJordan Brown #define	API_WPrintQPurge		103
1215bbf6f00cSJordan Brown #define	API_NetServerEnum2		104
1216bbf6f00cSJordan Brown #define	API_WAccessGetUserPerms		105
1217bbf6f00cSJordan Brown #define	API_WGroupGetInfo		106
1218bbf6f00cSJordan Brown #define	API_WGroupSetInfo		107
1219bbf6f00cSJordan Brown #define	API_WGroupSetUsers		108
1220bbf6f00cSJordan Brown #define	API_WUserSetGroups		109
1221bbf6f00cSJordan Brown #define	API_WUserModalsGet		110
1222bbf6f00cSJordan Brown #define	API_WUserModalsSet		111
1223bbf6f00cSJordan Brown #define	API_WFileEnum2			112
1224bbf6f00cSJordan Brown #define	API_WUserAdd2			113
1225bbf6f00cSJordan Brown #define	API_WUserSetInfo2		114
1226bbf6f00cSJordan Brown #define	API_WUserPasswordSet2		115
1227bbf6f00cSJordan Brown #define	API_I_NetServerEnum2		116
1228bbf6f00cSJordan Brown #define	API_WConfigGet2			117
1229bbf6f00cSJordan Brown #define	API_WConfigGetAll2		118
1230bbf6f00cSJordan Brown #define	API_WGetDCName			119
1231bbf6f00cSJordan Brown #define	API_NetHandleGetInfo		120
1232bbf6f00cSJordan Brown #define	API_NetHandleSetInfo		121
1233bbf6f00cSJordan Brown #define	API_WStatisticsGet2		122
1234bbf6f00cSJordan Brown #define	API_WBuildGetInfo		123
1235bbf6f00cSJordan Brown #define	API_WFileGetInfo2		124
1236bbf6f00cSJordan Brown #define	API_WFileClose2			125
1237bbf6f00cSJordan Brown #define	API_WNetServerReqChallenge	126
1238bbf6f00cSJordan Brown #define	API_WNetServerAuthenticate	127
1239bbf6f00cSJordan Brown #define	API_WNetServerPasswordSet	128
1240bbf6f00cSJordan Brown #define	API_WNetAccountDeltas		129
1241bbf6f00cSJordan Brown #define	API_WNetAccountSync		130
1242bbf6f00cSJordan Brown #define	API_WUserEnum2			131
1243bbf6f00cSJordan Brown #define	API_WWkstaUserLogon		132
1244bbf6f00cSJordan Brown #define	API_WWkstaUserLogoff		133
1245bbf6f00cSJordan Brown #define	API_WLogonEnum			134
1246bbf6f00cSJordan Brown #define	API_WErrorLogRead		135
1247bbf6f00cSJordan Brown #define	API_WI_NetPathType		136
1248bbf6f00cSJordan Brown #define	API_WI_NetPathCanonicalize	137
1249bbf6f00cSJordan Brown #define	API_WI_NetPathCompare		138
1250bbf6f00cSJordan Brown #define	API_WI_NetNameValidate		139
1251bbf6f00cSJordan Brown #define	API_WI_NetNameCanonicalize	140
1252bbf6f00cSJordan Brown #define	API_WI_NetNameCompare		141
1253bbf6f00cSJordan Brown #define	API_WAuditRead			142
1254bbf6f00cSJordan Brown #define	API_WPrintDestAdd		143
1255bbf6f00cSJordan Brown #define	API_WPrintDestSetInfo		144
1256bbf6f00cSJordan Brown #define	API_WPrintDestDel		145
1257bbf6f00cSJordan Brown #define	API_WUserValidate2		146
1258bbf6f00cSJordan Brown #define	API_WPrintJobSetInfo		147
1259bbf6f00cSJordan Brown #define	API_TI_NetServerDiskEnum	148
1260bbf6f00cSJordan Brown #define	API_TI_NetServerDiskGetInfo	149
1261bbf6f00cSJordan Brown #define	API_TI_FTVerifyMirror		150
1262bbf6f00cSJordan Brown #define	API_TI_FTAbortVerify		151
1263bbf6f00cSJordan Brown #define	API_TI_FTGetInfo		152
1264bbf6f00cSJordan Brown #define	API_TI_FTSetInfo		153
1265bbf6f00cSJordan Brown #define	API_TI_FTLockDisk		154
1266bbf6f00cSJordan Brown #define	API_TI_FTFixError		155
1267bbf6f00cSJordan Brown #define	API_TI_FTAbortFix		156
1268bbf6f00cSJordan Brown #define	API_TI_FTDiagnoseError		157
1269bbf6f00cSJordan Brown #define	API_TI_FTGetDriveStats		158
1270bbf6f00cSJordan Brown #define	API_TI_FTErrorGetInfo		160
1271bbf6f00cSJordan Brown #define	API_NetAccessCheck		163
1272bbf6f00cSJordan Brown #define	API_NetAlertRaise		164
1273bbf6f00cSJordan Brown #define	API_NetAlertStart		165
1274bbf6f00cSJordan Brown #define	API_NetAlertStop		166
1275bbf6f00cSJordan Brown #define	API_NetAuditWrite		167
1276bbf6f00cSJordan Brown #define	API_NetIRemoteAPI		168
1277bbf6f00cSJordan Brown #define	API_NetServiceStatus		169
1278bbf6f00cSJordan Brown #define	API_I_NetServerRegister		170
1279bbf6f00cSJordan Brown #define	API_I_NetServerDeregister	171
1280bbf6f00cSJordan Brown #define	API_I_NetSessionEntryMake	172
1281bbf6f00cSJordan Brown #define	API_I_NetSessionEntryClear	173
1282bbf6f00cSJordan Brown #define	API_I_NetSessionEntryGetInfo	174
1283bbf6f00cSJordan Brown #define	API_I_NetSessionEntrySetInfo	175
1284bbf6f00cSJordan Brown #define	API_I_NetConnectionEntryMake	176
1285bbf6f00cSJordan Brown #define	API_I_NetConnectionEntryClear	177
1286bbf6f00cSJordan Brown #define	API_I_NetConnectionEntrySetInfo	178
1287bbf6f00cSJordan Brown #define	API_I_NetConnectionEntryGetInfo	179
1288bbf6f00cSJordan Brown #define	API_I_NetFileEntryMake		180
1289bbf6f00cSJordan Brown #define	API_I_NetFileEntryClear		181
1290bbf6f00cSJordan Brown #define	API_I_NetFileEntrySetInfo	182
1291bbf6f00cSJordan Brown #define	API_I_NetFileEntryGetInfo	183
1292bbf6f00cSJordan Brown #define	API_AltSrvMessageBufferSend	184
1293bbf6f00cSJordan Brown #define	API_AltSrvMessageFileSend	185
1294bbf6f00cSJordan Brown #define	API_wI_NetRplWkstaEnum		186
1295bbf6f00cSJordan Brown #define	API_wI_NetRplWkstaGetInfo	187
1296bbf6f00cSJordan Brown #define	API_wI_NetRplWkstaSetInfo	188
1297bbf6f00cSJordan Brown #define	API_wI_NetRplWkstaAdd		189
1298bbf6f00cSJordan Brown #define	API_wI_NetRplWkstaDel		190
1299bbf6f00cSJordan Brown #define	API_wI_NetRplProfileEnum	191
1300bbf6f00cSJordan Brown #define	API_wI_NetRplProfileGetInfo	192
1301bbf6f00cSJordan Brown #define	API_wI_NetRplProfileSetInfo	193
1302bbf6f00cSJordan Brown #define	API_wI_NetRplProfileAdd		194
1303bbf6f00cSJordan Brown #define	API_wI_NetRplProfileDel		195
1304bbf6f00cSJordan Brown #define	API_wI_NetRplProfileClone	196
1305bbf6f00cSJordan Brown #define	API_wI_NetRplBaseProfileEnum	197
1306bbf6f00cSJordan Brown #define	API_WIServerSetInfo		201
1307bbf6f00cSJordan Brown #define	API_WPrintDriverEnum		205
1308bbf6f00cSJordan Brown #define	API_WPrintQProcessorEnum	206
1309bbf6f00cSJordan Brown #define	API_WPrintPortEnum		207
1310bbf6f00cSJordan Brown #define	API_WNetWriteUpdateLog		208
1311bbf6f00cSJordan Brown #define	API_WNetAccountUpdate		209
1312bbf6f00cSJordan Brown #define	API_WNetAccountConfirmUpdate	210
1313bbf6f00cSJordan Brown #define	API_WConfigSet			211
1314bbf6f00cSJordan Brown #define	API_WAccountsReplicate		212
1315bbf6f00cSJordan Brown #define	API_SamOEMChgPasswordUser2_P	214
1316bbf6f00cSJordan Brown #define	API_NetServerEnum3		215
1317bbf6f00cSJordan Brown #define	API_WprintDriverGetInfo		250
1318bbf6f00cSJordan Brown #define	API_WprintDriverSetInfo		251
1319bbf6f00cSJordan Brown #define	API_WaliasAdd			252
1320bbf6f00cSJordan Brown #define	API_WaliasDel			253
1321bbf6f00cSJordan Brown #define	API_WaliasGetInfo		254
1322bbf6f00cSJordan Brown #define	API_WaliasSetInfo		255
1323bbf6f00cSJordan Brown #define	API_WaliasEnum			256
1324bbf6f00cSJordan Brown #define	API_WuserGetLogonAsn		257
1325bbf6f00cSJordan Brown #define	API_WuserSetLogonAsn		258
1326bbf6f00cSJordan Brown #define	API_WuserGetAppSel		259
1327bbf6f00cSJordan Brown #define	API_WuserSetAppSel		260
1328bbf6f00cSJordan Brown #define	API_WappAdd			261
1329bbf6f00cSJordan Brown #define	API_WappDel			262
1330bbf6f00cSJordan Brown #define	API_WappGetInfo			263
1331bbf6f00cSJordan Brown #define	API_WappSetInfo			264
1332bbf6f00cSJordan Brown #define	API_WappEnum			265
1333bbf6f00cSJordan Brown #define	API_WUserDCDBInit		266
1334bbf6f00cSJordan Brown #define	API_WDASDAdd			267
1335bbf6f00cSJordan Brown #define	API_WDASDDel			268
1336bbf6f00cSJordan Brown #define	API_WDASDGetInfo		269
1337bbf6f00cSJordan Brown #define	API_WDASDSetInfo		270
1338bbf6f00cSJordan Brown #define	API_WDASDEnum			271
1339bbf6f00cSJordan Brown #define	API_WDASDCheck			272
1340bbf6f00cSJordan Brown #define	API_WDASDCtl			273
1341bbf6f00cSJordan Brown #define	API_WuserRemoteLogonCheck	274
1342bbf6f00cSJordan Brown #define	API_WUserPasswordSet3		275
1343bbf6f00cSJordan Brown #define	API_WCreateRIPLMachine		276
1344bbf6f00cSJordan Brown #define	API_WDeleteRIPLMachine		277
1345bbf6f00cSJordan Brown #define	API_WGetRIPLMachineInfo		278
1346bbf6f00cSJordan Brown #define	API_WSetRIPLMachineInfo		279
1347bbf6f00cSJordan Brown #define	API_WEnumRIPLMachine		280
1348bbf6f00cSJordan Brown #define	API_WI_ShareAdd			281
1349bbf6f00cSJordan Brown #define	API_WI_AliasEnum		282
1350bbf6f00cSJordan Brown #define	API_WaccessApply		283
1351bbf6f00cSJordan Brown #define	API_WPrt16Query			284
1352bbf6f00cSJordan Brown #define	API_WPrt16Set			285
1353bbf6f00cSJordan Brown #define	API_WUserDel100			286
1354bbf6f00cSJordan Brown #define	API_WUserRemoteLogonCheck2	287
1355bbf6f00cSJordan Brown #define	API_WRemoteTODSet		294
1356bbf6f00cSJordan Brown #define	API_WprintJobMoveAll		295
1357bbf6f00cSJordan Brown #define	API_W16AppParmAdd		296
1358bbf6f00cSJordan Brown #define	API_W16AppParmDel		297
1359bbf6f00cSJordan Brown #define	API_W16AppParmGet		298
1360bbf6f00cSJordan Brown #define	API_W16AppParmSet		299
1361bbf6f00cSJordan Brown #define	API_W16RIPLMachineCreate	300
1362bbf6f00cSJordan Brown #define	API_W16RIPLMachineGetInfo	301
1363bbf6f00cSJordan Brown #define	API_W16RIPLMachineSetInfo	302
1364bbf6f00cSJordan Brown #define	API_W16RIPLMachineEnum		303
1365bbf6f00cSJordan Brown #define	API_W16RIPLMachineListParmEnum	304
1366bbf6f00cSJordan Brown #define	API_W16RIPLMachClassGetInfo	305
1367bbf6f00cSJordan Brown #define	API_W16RIPLMachClassEnum	306
1368bbf6f00cSJordan Brown #define	API_W16RIPLMachClassCreate	307
1369bbf6f00cSJordan Brown #define	API_W16RIPLMachClassSetInfo	308
1370bbf6f00cSJordan Brown #define	API_W16RIPLMachClassDelete	309
1371bbf6f00cSJordan Brown #define	API_W16RIPLMachClassLPEnum	310
1372bbf6f00cSJordan Brown #define	API_W16RIPLMachineDelete	311
1373bbf6f00cSJordan Brown #define	API_W16WSLevelGetInfo		312
1374bbf6f00cSJordan Brown #define	API_WserverNameAdd		313
1375bbf6f00cSJordan Brown #define	API_WserverNameDel		314
1376bbf6f00cSJordan Brown #define	API_WserverNameEnum		315
1377bbf6f00cSJordan Brown #define	API_I_WDASDEnum			316
1378bbf6f00cSJordan Brown #define	API_I_WDASDEnumTerminate	317
1379bbf6f00cSJordan Brown #define	API_I_WDASDSetInfo2		318
1380bbf6f00cSJordan Brown #define	MAX_RAP_API			318
1381da6c28aaSamw 
1382da6c28aaSamw #ifdef __cplusplus
1383da6c28aaSamw }
1384da6c28aaSamw #endif
1385da6c28aaSamw 
1386da6c28aaSamw #endif /* _SMBSRV_SMB_H */
1387