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