xref: /illumos-gate/usr/src/uts/common/netsmb/smb.h (revision 635216b673cf196ac523ff2a7ab715717e553292)
1 /*
2  * Copyright (c) 2000-2001 Boris Popov
3  * All rights reserved.
4  *
5  * Now many of these defines are from samba4 code, by Andrew Tridgell.
6  * (Permission given to Conrad Minshall at CIFS plugfest Aug 13 2003.)
7  * (Note the main decision was whether to use defines found in MS includes
8  * and web pages, versus Samba, and the deciding factor is which developers
9  * are more likely to be looking at this code base.)
10  *
11  * Redistribution and use in source and binary forms, with or without
12  * modification, are permitted provided that the following conditions
13  * are met:
14  * 1. Redistributions of source code must retain the above copyright
15  *    notice, this list of conditions and the following disclaimer.
16  * 2. Redistributions in binary form must reproduce the above copyright
17  *    notice, this list of conditions and the following disclaimer in the
18  *    documentation and/or other materials provided with the distribution.
19  * 3. All advertising materials mentioning features or use of this software
20  *    must display the following acknowledgement:
21  *    This product includes software developed by Boris Popov.
22  * 4. Neither the name of the author nor the names of any co-contributors
23  *    may be used to endorse or promote products derived from this software
24  *    without specific prior written permission.
25  *
26  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
27  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
30  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36  * SUCH DAMAGE.
37  *
38  * $Id: smb.h,v 1.36.90.1 2005/05/27 02:35:29 lindak Exp $
39  */
40 
41 /*
42  * Common definintions and structures for SMB/CIFS protocol
43  */
44 
45 #ifndef _NETSMB_SMB_H_
46 #define	_NETSMB_SMB_H_
47 
48 /*
49  * This file should be purely SMB protocol definition stuff.
50  * (Please don't make it a catch-all:)
51  */
52 
53 /*
54  * SMB dialects that we have to deal with.
55  */
56 enum smb_dialects {
57 	SMB_DIALECT_NONE,
58 	SMB_DIALECT_CORE,		/* PC NETWORK PROGRAM 1.0, PCLAN1.0 */
59 	SMB_DIALECT_COREPLUS,		/* MICROSOFT NETWORKS 1.03 */
60 	SMB_DIALECT_LANMAN1_0,		/* MICROSOFT NETWORKS 3.0, LANMAN1.0 */
61 	SMB_DIALECT_LANMAN2_0,		/* LM1.2X002, DOS LM1.2X002, Samba */
62 	SMB_DIALECT_LANMAN2_1,		/* DOS LANMAN2.1, LANMAN2.1 */
63 	SMB_DIALECT_NTLM0_12		/* NT LM 0.12, Windows for Workgroups */
64 					/* 3.1a, * NT LANMAN 1.0 */
65 };
66 
67 /*
68  * Formats of data/string buffers
69  */
70 #define	SMB_DT_DATA		1
71 #define	SMB_DT_DIALECT		2
72 #define	SMB_DT_PATHNAME		3
73 #define	SMB_DT_ASCII		4
74 #define	SMB_DT_VARIABLE		5
75 
76 /*
77  * SMB header
78  */
79 #define	SMB_SIGNATURE		"\xFFSMB"
80 #define	SMB_SIGLEN		4
81 #define	SMB_HDRCMD(p)		(*((uchar_t *)(p) + SMB_SIGLEN))
82 #define	SMB_HDRMID(p)		(*(ushort_t *)((uchar_t *)(p) + 30))
83 #define	SMB_HDRLEN		32
84 /*
85  * bits in the smb_flags field
86  */
87 #define	SMB_FLAGS_SUPPORT_LOCKREAD	0x01
88 #define	SMB_FLAGS_CLIENT_BUF_AVAIL	0x02
89 #define	SMB_FLAGS_CASELESS		0x08
90 #define	SMB_FLAGS_CANONICAL_PATHNAMES	0x10
91 #define	SMB_FLAGS_REQUEST_OPLOCK	0x20
92 #define	SMB_FLAGS_REQUEST_BATCH_OPLOCK	0x40
93 #define	SMB_FLAGS_SERVER_RESP		0x80
94 
95 /*
96  * bits in the smb_flags2 field
97  */
98 #define	SMB_FLAGS2_KNOWS_LONG_NAMES	0x0001
99 #define	SMB_FLAGS2_KNOWS_EAS		0x0002	/* client know about EAs */
100 #define	SMB_FLAGS2_SECURITY_SIGNATURE	0x0004	/* check SMB integrity */
101 #define	SMB_FLAGS2_IS_LONG_NAME		0x0040	/* any path name is long name */
102 #define	SMB_FLAGS2_EXT_SEC		0x0800	/* client aware of Extended */
103 						/* Security negotiation */
104 #define	SMB_FLAGS2_DFS			0x1000	/* resolve paths in DFS */
105 #define	SMB_FLAGS2_PAGING_IO		0x2000	/* for exec */
106 #define	SMB_FLAGS2_ERR_STATUS		0x4000	/* 1 - status.status */
107 #define	SMB_FLAGS2_UNICODE		0x8000	/* use Unicode for strings */
108 
109 #define	SMB_UID_UNKNOWN		0xffff
110 #define	SMB_TID_UNKNOWN		0xffff
111 #define	SMB_FID_UNUSED		0xffff
112 
113 /*
114  * Security mode bits
115  */
116 #define	SMB_SM_USER		0x01	/* server in the user security mode */
117 #define	SMB_SM_ENCRYPT		0x02	/* use challenge/responce */
118 #define	SMB_SM_SIGS		0x04
119 #define	SMB_SM_SIGS_REQUIRE	0x08
120 
121 /*
122  * Action bits in session setup reply
123  */
124 #define	SMB_ACT_GUEST		0x01
125 
126 /*
127  * NTLM capabilities
128  */
129 #define	SMB_CAP_RAW_MODE		0x0001
130 #define	SMB_CAP_MPX_MODE		0x0002
131 #define	SMB_CAP_UNICODE			0x0004
132 #define	SMB_CAP_LARGE_FILES		0x0008	/* 64 bit offsets supported */
133 #define	SMB_CAP_NT_SMBS			0x0010
134 #define	SMB_CAP_RPC_REMOTE_APIS		0x0020
135 #define	SMB_CAP_STATUS32		0x0040
136 #define	SMB_CAP_LEVEL_II_OPLOCKS	0x0080
137 #define	SMB_CAP_LOCK_AND_READ		0x0100
138 #define	SMB_CAP_NT_FIND			0x0200
139 #define	SMB_CAP_DFS			0x1000
140 #define	SMB_CAP_INFOLEVEL_PASSTHRU	0x2000
141 #define	SMB_CAP_LARGE_READX		0x4000
142 #define	SMB_CAP_LARGE_WRITEX		0x8000
143 #define	SMB_CAP_UNIX			0x00800000
144 #define	SMB_CAP_BULK_TRANSFER		0x20000000
145 #define	SMB_CAP_COMPRESSED_DATA		0x40000000
146 #define	SMB_CAP_EXT_SECURITY		0x80000000
147 
148 /*
149  * File attributes
150  */
151 #define	SMB_FA_RDONLY		0x01
152 #define	SMB_FA_HIDDEN		0x02
153 #define	SMB_FA_SYSTEM		0x04
154 #define	SMB_FA_VOLUME		0x08
155 #define	SMB_FA_DIR		0x10
156 #define	SMB_FA_ARCHIVE		0x20
157 
158 /*
159  * Extended file attributes
160  */
161 #define	SMB_EFA_RDONLY			0x00000001
162 #define	SMB_EFA_HIDDEN			0x00000002
163 #define	SMB_EFA_SYSTEM			0x00000004
164 #define	SMB_EFA_VOLUME			0x00000008
165 #define	SMB_EFA_DIRECTORY		0x00000010
166 #define	SMB_EFA_ARCHIVE			0x00000020
167 #define	SMB_EFA_DEVICE			0x00000040
168 #define	SMB_EFA_NORMAL			0x00000080
169 #define	SMB_EFA_TEMPORARY		0x00000100
170 #define	SMB_EFA_SPARSE			0x00000200
171 #define	SMB_EFA_REPARSE_POINT		0x00000400
172 #define	SMB_EFA_COMPRESSED		0x00000800
173 #define	SMB_EFA_OFFLINE			0x00001000
174 #define	SMB_EFA_NONINDEXED		0x00002000
175 #define	SMB_EFA_ENCRYPTED		0x00004000
176 #define	SMB_EFA_POSIX_SEMANTICS		0x01000000
177 #define	SMB_EFA_BACKUP_SEMANTICS	0x02000000
178 #define	SMB_EFA_DELETE_ON_CLOSE		0x04000000
179 #define	SMB_EFA_SEQUENTIAL_SCAN		0x08000000
180 #define	SMB_EFA_RANDOM_ACCESS		0x10000000
181 #define	SMB_EFA_NO_BUFFERING		0x20000000
182 #define	SMB_EFA_WRITE_THROUGH		0x80000000
183 
184 /*
185  * Access Mode Encoding
186  */
187 #define	SMB_AM_OPENREAD		0x0000
188 #define	SMB_AM_OPENWRITE	0x0001
189 #define	SMB_AM_OPENRW		0x0002
190 #define	SMB_AM_OPENEXEC		0x0003
191 #define	SMB_AM_OPENMODE		0x0003	/* mask for access mode bits */
192 #define	SMB_SM_COMPAT		0x0000
193 #define	SMB_SM_EXCLUSIVE	0x0010
194 #define	SMB_SM_DENYWRITE	0x0020
195 #define	SMB_SM_DENYREADEXEC	0x0030
196 #define	SMB_SM_DENYNONE		0x0040
197 
198 /* NT_CREATE_ANDX flags */
199 #define	NTCREATEX_FLAGS_REQUEST_OPLOCK		0x02
200 #define	NTCREATEX_FLAGS_REQUEST_BATCH_OPLOCK	0x04
201 #define	NTCREATEX_FLAGS_OPEN_DIRECTORY		0x08
202 #define	NTCREATEX_FLAGS_EXTENDED		0x10
203 
204 /* NT_CREATE_ANDX share_access (share mode) */
205 #define	NTCREATEX_SHARE_ACCESS_NONE		0
206 #define	NTCREATEX_SHARE_ACCESS_READ		1
207 #define	NTCREATEX_SHARE_ACCESS_WRITE		2
208 #define	NTCREATEX_SHARE_ACCESS_DELETE		4
209 #define	NTCREATEX_SHARE_ACCESS_ALL		7
210 
211 /* NT_CREATE_ANDX open_disposition */
212 #define	NTCREATEX_DISP_SUPERSEDE	0 /* if file exists supersede it */
213 #define	NTCREATEX_DISP_OPEN		1 /* exists ? open it : fail */
214 #define	NTCREATEX_DISP_CREATE		2 /* exists ? fail : create it */
215 #define	NTCREATEX_DISP_OPEN_IF		3 /* exists ? open it : create it */
216 #define	NTCREATEX_DISP_OVERWRITE	4 /* exists ? overwrite : fail */
217 #define	NTCREATEX_DISP_OVERWRITE_IF	5 /* exists ? overwrite : create */
218 
219 /* NT_CREATE_ANDX create_options */
220 #define	NTCREATEX_OPTIONS_DIRECTORY		0x0001
221 #define	NTCREATEX_OPTIONS_WRITE_THROUGH		0x0002
222 #define	NTCREATEX_OPTIONS_SEQUENTIAL_ONLY	0x0004
223 #define	NTCREATEX_OPTIONS_SYNC_ALERT		0x0010
224 #define	NTCREATEX_OPTIONS_ASYNC_ALERT		0x0020
225 #define	NTCREATEX_OPTIONS_NON_DIRECTORY_FILE	0x0040
226 #define	NTCREATEX_OPTIONS_NO_EA_KNOWLEDGE	0x0200
227 #define	NTCREATEX_OPTIONS_EIGHT_DOT_THREE_ONLY	0x0400
228 #define	NTCREATEX_OPTIONS_RANDOM_ACCESS		0x0800
229 #define	NTCREATEX_OPTIONS_DELETE_ON_CLOSE	0x1000
230 #define	NTCREATEX_OPTIONS_OPEN_BY_FILE_ID	0x2000
231 
232 /* NT_CREATE_ANDX "impersonation" */
233 #define	NTCREATEX_IMPERSONATION_ANONYMOUS		0
234 #define	NTCREATEX_IMPERSONATION_IDENTIFICATION		1
235 #define	NTCREATEX_IMPERSONATION_IMPERSONATION		2
236 #define	NTCREATEX_IMPERSONATION_DELEGATION		3
237 
238 /* NT_CREATE_ANDX security flags */
239 #define	NTCREATEX_SECURITY_DYNAMIC	1
240 #define	NTCREATEX_SECURITY_ALL		2
241 
242 /* NT_CREATE_ANDX create_action in reply */
243 #define	NTCREATEX_ACTION_EXISTED	1
244 #define	NTCREATEX_ACTION_CREATED	2
245 #define	NTCREATEX_ACTION_TRUNCATED	3
246 
247 /* SMB_TRANS2_FIND_FIRST2/SMB_TRANS2_FIND_NEXT2 flags */
248 #define	FIND2_CLOSE_AFTER_REQUEST	0x0001
249 #define	FIND2_CLOSE_ON_EOS		0x0002
250 #define	FIND2_RETURN_RESUME_KEYS	0x0004
251 #define	FIND2_CONTINUE_SEARCH		0x0008
252 #define	FIND2_BACKUP_INTENT		0x0010
253 
254 /*
255  * SMB commands
256  */
257 #define	SMB_COM_CREATE_DIRECTORY	0x00
258 #define	SMB_COM_DELETE_DIRECTORY	0x01
259 #define	SMB_COM_OPEN			0x02
260 #define	SMB_COM_CREATE			0x03
261 #define	SMB_COM_CLOSE			0x04
262 #define	SMB_COM_FLUSH			0x05
263 #define	SMB_COM_DELETE			0x06
264 #define	SMB_COM_RENAME			0x07
265 #define	SMB_COM_QUERY_INFORMATION	0x08
266 #define	SMB_COM_SET_INFORMATION		0x09
267 #define	SMB_COM_READ			0x0A
268 #define	SMB_COM_WRITE			0x0B
269 #define	SMB_COM_LOCK_BYTE_RANGE		0x0C
270 #define	SMB_COM_UNLOCK_BYTE_RANGE	0x0D
271 #define	SMB_COM_CREATE_TEMPORARY	0x0E
272 #define	SMB_COM_CREATE_NEW		0x0F
273 #define	SMB_COM_CHECK_DIRECTORY		0x10
274 #define	SMB_COM_PROCESS_EXIT		0x11
275 #define	SMB_COM_SEEK			0x12
276 #define	SMB_COM_LOCK_AND_READ		0x13
277 #define	SMB_COM_WRITE_AND_UNLOCK	0x14
278 #define	SMB_COM_READ_RAW		0x1A
279 #define	SMB_COM_READ_MPX		0x1B
280 #define	SMB_COM_READ_MPX_SECONDARY	0x1C
281 #define	SMB_COM_WRITE_RAW		0x1D
282 #define	SMB_COM_WRITE_MPX		0x1E
283 #define	SMB_COM_WRITE_COMPLETE		0x20
284 #define	SMB_COM_SET_INFORMATION2	0x22
285 #define	SMB_COM_QUERY_INFORMATION2	0x23
286 #define	SMB_COM_LOCKING_ANDX		0x24
287 #define	SMB_COM_TRANSACTION		0x25
288 #define	SMB_COM_TRANSACTION_SECONDARY	0x26
289 #define	SMB_COM_IOCTL			0x27
290 #define	SMB_COM_IOCTL_SECONDARY		0x28
291 #define	SMB_COM_COPY			0x29
292 #define	SMB_COM_MOVE			0x2A
293 #define	SMB_COM_ECHO			0x2B
294 #define	SMB_COM_WRITE_AND_CLOSE		0x2C
295 #define	SMB_COM_OPEN_ANDX		0x2D
296 #define	SMB_COM_READ_ANDX		0x2E
297 #define	SMB_COM_WRITE_ANDX		0x2F
298 #define	SMB_COM_CLOSE_AND_TREE_DISC	0x31
299 #define	SMB_COM_TRANSACTION2		0x32
300 #define	SMB_COM_TRANSACTION2_SECONDARY	0x33
301 #define	SMB_COM_FIND_CLOSE2		0x34
302 #define	SMB_COM_FIND_NOTIFY_CLOSE	0x35
303 #define	SMB_COM_TREE_CONNECT		0x70
304 #define	SMB_COM_TREE_DISCONNECT		0x71
305 #define	SMB_COM_NEGOTIATE		0x72
306 #define	SMB_COM_SESSION_SETUP_ANDX	0x73
307 #define	SMB_COM_LOGOFF_ANDX		0x74
308 #define	SMB_COM_TREE_CONNECT_ANDX	0x75
309 #define	SMB_COM_QUERY_INFORMATION_DISK	0x80
310 #define	SMB_COM_SEARCH			0x81
311 #define	SMB_COM_FIND			0x82
312 #define	SMB_COM_FIND_UNIQUE		0x83
313 #define	SMB_COM_NT_TRANSACT		0xA0
314 #define	SMB_COM_NT_TRANSACT_SECONDARY	0xA1
315 #define	SMB_COM_NT_CREATE_ANDX		0xA2
316 #define	SMB_COM_NT_CANCEL		0xA4
317 #define	SMB_COM_OPEN_PRINT_FILE		0xC0
318 #define	SMB_COM_WRITE_PRINT_FILE	0xC1
319 #define	SMB_COM_CLOSE_PRINT_FILE	0xC2
320 #define	SMB_COM_GET_PRINT_QUEUE		0xC3
321 #define	SMB_COM_READ_BULK		0xD8
322 #define	SMB_COM_WRITE_BULK		0xD9
323 #define	SMB_COM_WRITE_BULK_DATA		0xDA
324 
325 /*
326  * SMB_COM_TRANSACTION2 subcommands
327  */
328 #define	SMB_TRANS2_OPEN2			0x00
329 #define	SMB_TRANS2_FIND_FIRST2			0x01
330 #define	SMB_TRANS2_FIND_NEXT2			0x02
331 #define	SMB_TRANS2_QUERY_FS_INFORMATION		0x03
332 #define	SMB_TRANS2_SETFSINFO			0x04
333 #define	SMB_TRANS2_QUERY_PATH_INFORMATION	0x05
334 #define	SMB_TRANS2_SET_PATH_INFORMATION		0x06
335 #define	SMB_TRANS2_QUERY_FILE_INFORMATION	0x07
336 #define	SMB_TRANS2_SET_FILE_INFORMATION		0x08
337 #define	SMB_TRANS2_FSCTL			0x09
338 #define	SMB_TRANS2_IOCTL2			0x0A
339 #define	SMB_TRANS2_FIND_NOTIFY_FIRST		0x0B
340 #define	SMB_TRANS2_FIND_NOTIFY_NEXT		0x0C
341 #define	SMB_TRANS2_CREATE_DIRECTORY		0x0D
342 #define	SMB_TRANS2_SESSION_SETUP		0x0E
343 #define	SMB_TRANS2_GET_DFS_REFERRAL		0x10
344 #define	SMB_TRANS2_REPORT_DFS_INCONSISTENCY	0x11
345 
346 /*
347  * SMB_COM_NT_TRANSACT subcommands
348  */
349 #define	NT_TRANSACT_CREATE		0x01
350 #define	NT_TRANSACT_IOCTL		0x02
351 #define	NT_TRANSACT_SET_SECURITY_DESC	0x03
352 #define	NT_TRANSACT_NOTIFY_CHANGE	0x04
353 #define	NT_TRANSACT_RENAME		0x05
354 #define	NT_TRANSACT_QUERY_SECURITY_DESC	0x06
355 #define	NT_TRANSACT_GET_USER_QUOTA	0x07
356 #define	NT_TRANSACT_SET_USER_QUOTA	0x08
357 
358 /*
359  * SMB_TRANS2_QUERY_FS_INFORMATION levels
360  */
361 #define	SMB_QFS_ALLOCATION			1
362 #define	SMB_QFS_VOLUME				2
363 #define	SMB_QFS_LABEL_INFO			0x101
364 #define	SMB_QFS_VOLUME_INFO			0x102
365 #define	SMB_QFS_SIZE_INFO			0x103
366 #define	SMB_QFS_DEVICE_INFO			0x104
367 #define	SMB_QFS_ATTRIBUTE_INFO			0x105
368 #define	SMB_QFS_UNIX_INFO			0x200
369 #define	SMB_QFS_MAC_FS_INFO			0x301
370 #define	SMB_QFS_VOLUME_INFORMATION		1001
371 #define	SMB_QFS_SIZE_INFORMATION		1003
372 #define	SMB_QFS_DEVICE_INFORMATION		1004
373 #define	SMB_QFS_ATTRIBUTE_INFORMATION		1005
374 #define	SMB_QFS_QUOTA_INFORMATION		1006
375 #define	SMB_QFS_FULL_SIZE_INFORMATION		1007
376 #define	SMB_QFS_OBJECTID_INFORMATION		1008
377 
378 
379 /*
380  * SMB_QFS_ATTRIBUTE_INFO bits.
381  * The following info found in msdn
382  * (http://msdn.microsoft.com/library/default.asp?
383  * url=/library/en-us/wmisdk/wmi/win32_cdromdrive.asp)
384  * Naming is mostly as in samba, to help Those Who Google.
385  */
386 #define	FILE_CASE_SENSITIVE_SEARCH	0x00000001
387 #define	FILE_CASE_PRESERVED_NAMES	0x00000002
388 #define	FILE_UNICODE_ON_DISK		0x00000004
389 #define	FILE_PERSISTENT_ACLS		0x00000008
390 #define	FILE_FILE_COMPRESSION		0x00000010
391 #define	FILE_VOLUME_QUOTAS		0x00000020
392 #define	FILE_SUPPORTS_SPARSE_FILES	0x00000040
393 #define	FILE_SUPPORTS_REPARSE_POINTS	0x00000080
394 #define	FILE_SUPPORTS_REMOTE_STORAGE	0x00000100
395 #define	FILE_SUPPORTS_LONG_NAMES	0x00004000
396 #define	FILE_VOLUME_IS_COMPRESSED	0x00008000
397 #define	FILE_SUPPORTS_OBJECT_IDS	0x00010000
398 #define	FILE_SUPPORTS_ENCRYPTION	0x00020000
399 #define	FILE_NAMED_STREAMS		0x00040000
400 
401 /*
402  * SMB_TRANS2_QUERY_PATH levels
403  */
404 #define	SMB_QFILEINFO_STANDARD			1
405 #define	SMB_QFILEINFO_EA_SIZE			2
406 #define	SMB_QFILEINFO_EAS_FROM_LIST		3
407 #define	SMB_QFILEINFO_ALL_EAS			4
408 #define	SMB_QFILEINFO_IS_NAME_VALID		6	/* QPATHINFO only? */
409 #define	SMB_QFILEINFO_BASIC_INFO		0x101
410 #define	SMB_QFILEINFO_STANDARD_INFO		0x102
411 #define	SMB_QFILEINFO_EA_INFO			0x103
412 #define	SMB_QFILEINFO_NAME_INFO			0x104
413 #define	SMB_QFILEINFO_ALLOCATION_INFO		0x105
414 #define	SMB_QFILEINFO_END_OF_FILE_INFO		0x106
415 #define	SMB_QFILEINFO_ALL_INFO			0x107
416 #define	SMB_QFILEINFO_ALT_NAME_INFO		0x108
417 #define	SMB_QFILEINFO_STREAM_INFO		0x109
418 #define	SMB_QFILEINFO_COMPRESSION_INFO		0x10b
419 #define	SMB_QFILEINFO_UNIX_BASIC		0x200
420 #define	SMB_QFILEINFO_UNIX_LINK			0x201
421 #define	SMB_QFILEINFO_MAC_DT_GET_APPL		0x306
422 #define	SMB_QFILEINFO_MAC_DT_GET_ICON		0x307
423 #define	SMB_QFILEINFO_MAC_DT_GET_ICON_INFO	0x308
424 #define	SMB_QFILEINFO_BASIC_INFORMATION		1004
425 #define	SMB_QFILEINFO_STANDARD_INFORMATION	1005
426 #define	SMB_QFILEINFO_INTERNAL_INFORMATION	1006
427 #define	SMB_QFILEINFO_EA_INFORMATION		1007
428 #define	SMB_QFILEINFO_ACCESS_INFORMATION	1008
429 #define	SMB_QFILEINFO_NAME_INFORMATION		1009
430 #define	SMB_QFILEINFO_POSITION_INFORMATION	1014
431 #define	SMB_QFILEINFO_MODE_INFORMATION		1016
432 #define	SMB_QFILEINFO_ALIGNMENT_INFORMATION	1017
433 #define	SMB_QFILEINFO_ALL_INFORMATION		1018
434 #define	SMB_QFILEINFO_ALT_NAME_INFORMATION	1021
435 #define	SMB_QFILEINFO_STREAM_INFORMATION	1022
436 #define	SMB_QFILEINFO_COMPRESSION_INFORMATION	1028
437 #define	SMB_QFILEINFO_NETWORK_OPEN_INFORMATION	1034
438 #define	SMB_QFILEINFO_ATTRIBUTE_TAG_INFORMATION 1035
439 
440 /*
441  * SMB_TRANS2_FIND_FIRST2 information levels
442  */
443 #define	SMB_FIND_STANDARD		1
444 #define	SMB_FIND_EA_SIZE		2
445 #define	SMB_FIND_EAS_FROM_LIST		3
446 #define	SMB_FIND_DIRECTORY_INFO		0x101
447 #define	SMB_FIND_FULL_DIRECTORY_INFO	0x102
448 #define	SMB_FIND_NAME_INFO		0x103
449 #define	SMB_FIND_BOTH_DIRECTORY_INFO	0x104
450 #define	SMB_FIND_UNIX_INFO		0x200
451 
452 /*
453  * Selectors for NT_TRANSACT_QUERY_SECURITY_DESC and
454  * NT_TRANSACT_SET_SECURITY_DESC.  Details found in the MSDN
455  * library by searching on security_information.
456  * Note the protected/unprotected bits did not exist in NT.
457  */
458 
459 #define	OWNER_SECURITY_INFORMATION		0x00000001
460 #define	GROUP_SECURITY_INFORMATION		0x00000002
461 #define	DACL_SECURITY_INFORMATION		0x00000004
462 #define	SACL_SECURITY_INFORMATION		0x00000008
463 #define	UNPROTECTED_SACL_SECURITY_INFORMATION	0x10000000
464 #define	UNPROTECTED_DACL_SECURITY_INFORMATION	0x20000000
465 #define	PROTECTED_SACL_SECURITY_INFORMATION	0x40000000
466 #define	PROTECTED_DACL_SECURITY_INFORMATION	0x80000000
467 
468 /*
469  * security descriptor header
470  * it is followed by the optional SIDs and ACLs
471  * note this is "raw", ie little-endian
472  */
473 struct ntsecdesc {
474 	uint8_t		sd_revision;	/* 0x01 observed between W2K */
475 	uint8_t		sd_pad1;
476 	uint16_t	sd_flags;
477 	uint32_t	sd_owneroff;	/* offset to owner SID */
478 	uint32_t	sd_groupoff;	/* offset to group SID */
479 	uint32_t	sd_sacloff;	/* offset to system/audit ACL */
480 	uint32_t	sd_dacloff;	/* offset to discretionary ACL */
481 }; /* XXX: __attribute__((__packed__)); */
482 typedef struct ntsecdesc ntsecdesc_t;
483 
484 #define	wset_sdrevision(s) ((s)->sd_revision = 0x01)
485 #define	sdflags(s) (letohs((s)->sd_flags))
486 #define	wset_sdflags(s, f) ((s)->sd_flags = letohs(f))
487 #define	sdowner(s) \
488 	((struct ntsid *)((s)->sd_owneroff ? \
489 	(char *)(s) + letohl((s)->sd_owneroff) : \
490 	NULL))
491 #define	wset_sdowneroff(s, o) ((s)->sd_owneroff = htolel(o))
492 #define	sdgroup(s) \
493 	((struct ntsid *)((s)->sd_groupoff ? \
494 	(char *)(s) + letohl((s)->sd_groupoff) : \
495 	NULL))
496 #define	wset_sdgroupoff(s, o) ((s)->sd_groupoff = htolel(o))
497 #define	sdsacl(s) \
498 	((struct ntacl *)((s)->sd_sacloff ? \
499 	(char *)(s) + letohl((s)->sd_sacloff) : \
500 	NULL))
501 #define	wset_sdsacloff(s, o) ((s)->sd_sacloff = htolel(o))
502 #define	sddacl(s) \
503 	((struct ntacl *)((s)->sd_dacloff ? \
504 	(char *)(s) + letohl((s)->sd_dacloff) : \
505 	NULL))
506 #define	wset_sddacloff(s, o) ((s)->sd_dacloff = htolel(o))
507 
508 /*
509  * sd_flags bits
510  */
511 #define	SD_OWNER_DEFAULTED		0x0001
512 #define	SD_GROUP_DEFAULTED		0x0002
513 #define	SD_DACL_PRESENT			0x0004
514 #define	SD_DACL_DEFAULTED		0x0008
515 #define	SD_SACL_PRESENT			0x0010
516 #define	SD_SACL_DEFAULTED		0x0020
517 #define	SD_DACL_TRUSTED			0x0040
518 #define	SD_SERVER_SECURITY		0x0080
519 #define	SD_DACL_AUTO_INHERIT_REQ	0x0100
520 #define	SD_SACL_AUTO_INHERIT_REQ	0x0200
521 #define	SD_DACL_AUTO_INHERITED		0x0400
522 #define	SD_SACL_AUTO_INHERITED		0x0800
523 #define	SD_DACL_PROTECTED		0x1000
524 #define	SD_SACL_PROTECTED		0x2000
525 #define	SD_RM_CONTROL_VALID		0x4000
526 #define	SD_SELF_RELATIVE		0x8000
527 
528 /*
529  * access control list header
530  * it is followed by the ACEs
531  * note this is "raw", ie little-endian
532  */
533 struct ntacl {
534 	uint8_t	acl_revision;	/* 0x02 observed with W2K */
535 	uint8_t	acl_pad1;
536 	uint16_t	acl_len; /* bytes; includes this header */
537 	uint16_t	acl_acecount;
538 	uint16_t	acl_pad2;
539 }; /* XXX: __attribute__((__packed__)); */
540 typedef struct ntacl ntacl_t;
541 
542 #define	wset_aclrevision(a) ((a)->acl_revision = 0x02)
543 #define	acllen(a) (letohs((a)->acl_len))
544 #define	wset_acllen(a, l) ((a)->acl_len = htoles(l))
545 #define	aclacecount(a) (letohs((a)->acl_acecount))
546 #define	wset_aclacecount(a, c) ((a)->acl_acecount = htoles(c))
547 #define	aclace(a) ((struct ntace *)((char *)(a) + sizeof (struct ntacl)))
548 
549 /*
550  * access control entry header
551  * it is followed by type-specific ace data,
552  * which for the simple types is just a SID
553  * note this is "raw", ie little-endian
554  */
555 struct ntace {
556 	uint8_t	ace_type;
557 	uint8_t	ace_flags;
558 	uint16_t	ace_len; /* bytes; includes this header */
559 	uint32_t	ace_rights; /* generic, standard, specific, etc */
560 }; /* XXX: __attribute__((__packed__)); */
561 
562 #define	acetype(a) ((a)->ace_type)
563 #define	wset_acetype(a, t) ((a)->ace_type = (t))
564 #define	aceflags(a) ((a)->ace_flags)
565 #define	wset_aceflags(a, f) ((a)->ace_flags = (f))
566 #define	acelen(a) (letohs((a)->ace_len))
567 #define	wset_acelen(a, l) ((a)->ace_len = htoles(l))
568 #define	acerights(a) (letohl((a)->ace_rights))
569 #define	wset_acerights(a, r) ((a)->ace_rights = htolel(r))
570 #define	aceace(a) ((struct ntace *)((char *)(a) + acelen(a)))
571 #define	acesid(a) ((struct ntsid *)((char *)(a) + sizeof (struct ntace)))
572 
573 /*
574  * ace_rights
575  * (Samba bit names are used here, with permission, as the shorter Windows
576  * names are more likely to cause namespace collisions)
577  */
578 #define	SA_RIGHT_FILE_READ_DATA		0x00000001
579 #define	SA_RIGHT_FILE_WRITE_DATA	0x00000002
580 #define	SA_RIGHT_FILE_APPEND_DATA	0x00000004
581 #define	SA_RIGHT_FILE_READ_EA		0x00000008
582 #define	SA_RIGHT_FILE_WRITE_EA		0x00000010
583 #define	SA_RIGHT_FILE_EXECUTE		0x00000020
584 #define	SA_RIGHT_FILE_DELETE_CHILD	0x00000040
585 #define	SA_RIGHT_FILE_READ_ATTRIBUTES	0x00000080
586 #define	SA_RIGHT_FILE_WRITE_ATTRIBUTES	0x00000100
587 #define	SA_RIGHT_FILE_ALL_ACCESS	0x000001FF
588 
589 #define	STD_RIGHT_DELETE_ACCESS		0x00010000
590 #define	STD_RIGHT_READ_CONTROL_ACCESS	0x00020000
591 #define	STD_RIGHT_WRITE_DAC_ACCESS	0x00040000
592 #define	STD_RIGHT_WRITE_OWNER_ACCESS	0x00080000
593 #define	STD_RIGHT_SYNCHRONIZE_ACCESS	0x00100000
594 #define	STD_RIGHT_ALL_ACCESS		0x001F0000
595 
596 #define	SEC_RIGHT_SYSTEM_SECURITY	0x01000000
597 /*
598  * Don't use MAXIMUM_ALLOWED as Samba (2.2.3 at least) will
599  * return NT_STATUS_INVALID_LOCK_SEQUENCE
600  */
601 #define	SEC_RIGHT_MAXIMUM_ALLOWED	0x02000000
602 
603 #define	GENERIC_RIGHT_ALL_ACCESS	0x10000000
604 #define	GENERIC_RIGHT_EXECUTE_ACCESS	0x20000000
605 #define	GENERIC_RIGHT_WRITE_ACCESS	0x40000000
606 #define	GENERIC_RIGHT_READ_ACCESS	0x80000000
607 
608 /*
609  * these mappings are from Windows sample code but are likely incomplete
610  *
611  * GENERIC_RIGHT_READ_ACCESS :
612  *	STD_RIGHT_SYNCHRONIZE_ACCESS |
613  *	STD_RIGHT_READ_CONTROL_ACCESS |
614  *	SA_RIGHT_FILE_READ_ATTRIBUTES |
615  *	SA_RIGHT_FILE_READ_EA |
616  *	SA_RIGHT_FILE_READ_DATA
617  * GENERIC_RIGHT_WRITE_ACCESS :
618  *	STD_RIGHT_SYNCHRONIZE_ACCESS |
619  *	STD_RIGHT_READ_CONTROL_ACCESS |
620  *	SA_RIGHT_FILE_WRITE_ATTRIBUTES |
621  *	SA_RIGHT_FILE_WRITE_EA |
622  *	SA_RIGHT_FILE_APPEND_DATA |
623  *	SA_RIGHT_FILE_WRITE_DATA
624  * GENERIC_RIGHT_EXECUTE_ACCESS :
625  *	STD_RIGHT_SYNCHRONIZE_ACCESS |
626  *	STD_RIGHT_READ_CONTROL_ACCESS |
627  *	SA_RIGHT_FILE_READ_ATTRIBUTES |
628  *	SA_RIGHT_FILE_EXECUTE
629  * GENERIC_RIGHT_ALL_ACCESS :
630  *	STD_RIGHT_SYNCHRONIZE_ACCESS |
631  *	STD_RIGHT_WRITE_OWNER_ACCESS |
632  *	STD_RIGHT_WRITE_DAC_ACCESS |
633  *	STD_RIGHT_READ_CONTROL_ACCESS |
634  *	STD_RIGHT_DELETE_ACCESS |
635  *	SA_RIGHT_FILE_ALL_ACCESS
636  */
637 
638 /*
639  * security identifier header
640  * it is followed by sid_numauth sub-authorities,
641  * which are 32 bits each.
642  * note the subauths are little-endian on the wire, but
643  * need to be big-endian for memberd/DS
644  */
645 #define	SIDAUTHSIZE 6
646 struct ntsid {
647 	uint8_t	sid_revision;
648 	uint8_t	sid_subauthcount;
649 	uint8_t	sid_authority[SIDAUTHSIZE]; /* ie not little endian */
650 }; /* XXX: __attribute__((__packed__)); */
651 typedef struct ntsid ntsid_t;
652 
653 #define	sidsubauthcount(s) (s->sid_subauthcount)
654 #define	sidlen(s) (sizeof (struct ntsid) + 4 * (s)->sid_subauthcount)
655 #define	MAXSIDLEN (sizeof (struct ntsid) + 4 * KAUTH_NTSID_MAX_AUTHORITIES)
656 #define	sidsub(s) ((uint32_t *)((char *)(s) + sizeof (struct ntsid)))
657 
658 /*
659  * MS' defined values for ace_type
660  */
661 #define	ACCESS_ALLOWED_ACE_TYPE			0x0
662 #define	ACCESS_DENIED_ACE_TYPE			0x1
663 #define	SYSTEM_AUDIT_ACE_TYPE			0x2
664 #define	SYSTEM_ALARM_ACE_TYPE			0x3
665 #define	ACCESS_ALLOWED_COMPOUND_ACE_TYPE	0x4
666 #define	ACCESS_ALLOWED_OBJECT_ACE_TYPE		0x5
667 #define	ACCESS_DENIED_OBJECT_ACE_TYPE		0x6
668 #define	SYSTEM_AUDIT_OBJECT_ACE_TYPE		0x7
669 #define	SYSTEM_ALARM_OBJECT_ACE_TYPE		0x8
670 #define	ACCESS_ALLOWED_CALLBACK_ACE_TYPE	0x9
671 #define	ACCESS_DENIED_CALLBACK_ACE_TYPE		0xA
672 #define	ACCESS_ALLOWED_CALLBACK_OBJECT_ACE_TYPE	0xB
673 #define	ACCESS_DENIED_CALLBACK_OBJECT_ACE_TYPE	0xC
674 #define	SYSTEM_AUDIT_CALLBACK_ACE_TYPE		0xD
675 #define	SYSTEM_ALARM_CALLBACK_ACE_TYPE		0xE
676 #define	SYSTEM_AUDIT_CALLBACK_OBJECT_ACE_TYPE	0xF
677 #define	SYSTEM_ALARM_CALLBACK_OBJECT_ACE_TYPE	0x10
678 
679 /*
680  * MS' defined values for ace_flags
681  */
682 #define	OBJECT_INHERIT_ACE_FLAG			0x01
683 #define	CONTAINER_INHERIT_ACE_FLAG		0x02
684 #define	NO_PROPAGATE_INHERIT_ACE_FLAG		0x04
685 #define	INHERIT_ONLY_ACE_FLAG			0x08
686 #define	INHERITED_ACE_FLAG			0x10
687 #define	UNDEF_ACE_FLAG				0x20 /* MS doesn't define it */
688 #define	VALID_INHERIT_ACE_FLAGS			0x1F
689 #define	SUCCESSFUL_ACCESS_ACE_FLAG		0x40
690 #define	FAILED_ACCESS_ACE_FLAG			0x80
691 
692 /*
693  * Set PATH/FILE information levels
694  */
695 #define	SMB_SFILEINFO_STANDARD			1
696 #define	SMB_SFILEINFO_EA_SET			2
697 #define	SMB_SFILEINFO_BASIC_INFO		0x101
698 #define	SMB_SFILEINFO_DISPOSITION_INFO		0x102
699 #define	SMB_SFILEINFO_ALLOCATION_INFO		0x103
700 #define	SMB_SFILEINFO_END_OF_FILE_INFO		0x104
701 #define	SMB_SFILEINFO_UNIX_BASIC		0x200
702 #define	SMB_SFILEINFO_UNIX_LINK			0x201
703 #define	SMB_SFILEINFO_UNIX_HLINK		0x203
704 #define	SMB_SFILEINFO_DIRECTORY_INFORMATION	1001
705 #define	SMB_SFILEINFO_FULL_DIRECTORY_INFORMATION	1002
706 #define	SMB_SFILEINFO_BOTH_DIRECTORY_INFORMATION	1003
707 #define	SMB_SFILEINFO_BASIC_INFORMATION		1004
708 #define	SMB_SFILEINFO_STANDARD_INFORMATION	1005
709 #define	SMB_SFILEINFO_INTERNAL_INFORMATION	1006
710 #define	SMB_SFILEINFO_EA_INFORMATION		1007
711 #define	SMB_SFILEINFO_ACCESS_INFORMATION	1008
712 #define	SMB_SFILEINFO_NAME_INFORMATION		1009
713 #define	SMB_SFILEINFO_RENAME_INFORMATION	1010
714 #define	SMB_SFILEINFO_LINK_INFORMATION		1011
715 #define	SMB_SFILEINFO_NAMES_INFORMATION		1012
716 #define	SMB_SFILEINFO_DISPOSITION_INFORMATION	1013
717 #define	SMB_SFILEINFO_POSITION_INFORMATION	1014
718 #define	SMB_SFILEINFO_1015			1015 /* ? */
719 #define	SMB_SFILEINFO_MODE_INFORMATION		1016
720 #define	SMB_SFILEINFO_ALIGNMENT_INFORMATION	1017
721 #define	SMB_SFILEINFO_ALL_INFORMATION		1018
722 #define	SMB_SFILEINFO_ALLOCATION_INFORMATION	1019
723 #define	SMB_SFILEINFO_END_OF_FILE_INFORMATION	1020
724 #define	SMB_SFILEINFO_ALT_NAME_INFORMATION	1021
725 #define	SMB_SFILEINFO_STREAM_INFORMATION	1022
726 #define	SMB_SFILEINFO_PIPE_INFORMATION		1023
727 #define	SMB_SFILEINFO_PIPE_LOCAL_INFORMATION	1024
728 #define	SMB_SFILEINFO_PIPE_REMOTE_INFORMATION	1025
729 #define	SMB_SFILEINFO_MAILSLOT_QUERY_INFORMATION	1026
730 #define	SMB_SFILEINFO_MAILSLOT_SET_INFORMATION		1027
731 #define	SMB_SFILEINFO_COMPRESSION_INFORMATION		1028
732 #define	SMB_SFILEINFO_OBJECT_ID_INFORMATION		1029
733 #define	SMB_SFILEINFO_COMPLETION_INFORMATION		1030
734 #define	SMB_SFILEINFO_MOVE_CLUSTER_INFORMATION		1031
735 #define	SMB_SFILEINFO_QUOTA_INFORMATION		1032
736 #define	SMB_SFILEINFO_REPARSE_POINT_INFORMATION	1033
737 #define	SMB_SFILEINFO_NETWORK_OPEN_INFORMATION	1034
738 #define	SMB_SFILEINFO_ATTRIBUTE_TAG_INFORMATION 1035
739 #define	SMB_SFILEINFO_TRACKING_INFORMATION	1036
740 #define	SMB_SFILEINFO_MAXIMUM_INFORMATION	1037
741 
742 /*
743  * LOCKING_ANDX LockType flags
744  */
745 #define	SMB_LOCKING_ANDX_SHARED_LOCK	0x01
746 #define	SMB_LOCKING_ANDX_OPLOCK_RELEASE	0x02
747 #define	SMB_LOCKING_ANDX_CHANGE_LOCKTYPE 0x04
748 #define	SMB_LOCKING_ANDX_CANCEL_LOCK	0x08
749 #define	SMB_LOCKING_ANDX_LARGE_FILES	0x10
750 
751 /*
752  * Error classes
753  */
754 #define	SMBSUCCESS	0x00
755 #define	ERRDOS		0x01
756 #define	ERRSRV		0x02
757 #define	ERRHRD		0x03	/* Error is an hardware error. */
758 #define	ERRCMD		0xFF	/* Command was not in the "SMB" format. */
759 
760 /*
761  * Error codes for the ERRDOS class
762  */
763 #define	ERRbadfunc	1	/* Invalid function */
764 #define	ERRbadfile	2	/* File not found (last component) */
765 #define	ERRbadpath	3	/* Directory invalid */
766 #define	ERRnofids	4	/* Too many open files */
767 #define	ERRnoaccess	5	/* Access denied */
768 #define	ERRbadfid	6	/* Invalid file handle */
769 #define	ERRbadmcb	7	/* Memory control blocks destroyed (huh ?) */
770 #define	ERRnomem	8	/* Insufficient memory */
771 #define	ERRbadmem	9	/* Invalid memory block address */
772 #define	ERRbadenv	10	/* Invalid environment */
773 #define	ERRbadformat	11	/* Invalid format */
774 #define	ERRbadaccess	12	/* Invalid open mode */
775 #define	ERRbaddata	13	/* Invalid data */
776 #define	ERRoutofmem	14	/* out of memory */
777 #define	ERRbaddrive	15	/* Invalid drive specified */
778 #define	ERRremcd	16	/* An attempt to delete current directory */
779 #define	ERRdiffdevice	17	/* cross fs rename/move */
780 #define	ERRnofiles	18	/* no more files found in file search */
781 #define	ERRwriteprotect	19
782 #define	ERRnotready	21
783 #define	ERRbadcmd	22
784 #define	ERRcrc		23
785 #define	ERRbadlength	24
786 #define	ERRsectornotfound	27
787 #define	ERRbadshare	32	/* Share mode can't be granted */
788 #define	ERRlock		33	/* Lock conflicts with existing lock */
789 #define	ERRwrongdisk	34
790 #define	ERRhandleeof	38
791 #define	ERRunsup	50	/* unsupported - Win 95 */
792 #define	ERRnetnamedel	64
793 #define	ERRnoipc	66	/* ipc unsupported */
794 #define	ERRnosuchshare	67	/* invalid share name */
795 #define	ERRtoomanynames	68
796 #define	ERRfilexists	80	/* requested file name already exists */
797 #define	ERRinvalidparam 87
798 #define	ERRcannotopen	110	/* cannot open the file */
799 #define	ERRinsufficientbuffer 122
800 #define	ERRinvalidname	123
801 #define	ERRunknownlevel 124
802 #define	ERRdirnotempty	145
803 #define	ERRnotlocked	158	/* region was not locked by this context */
804 #define	ERRrename	183
805 #define	ERRbadpipe	230	/* named pipe invalid */
806 #define	ERRpipebusy	231	/* all pipe instances are busy */
807 #define	ERRpipeclosing	232	/* close in progress */
808 #define	ERRnotconnected	233	/* nobody on other end of pipe */
809 #define	ERRmoredata	234	/* more data to be returned */
810 #define	ERRnomoreitems 259
811 #define	ERRbaddirectory	267	/* invalid directory name */
812 #define	ERReasunsupported	282	/* extended attributes not supported */
813 #define	ERRlogonfailure 1326
814 #define	ERRbuftoosmall	2123
815 #define	ERRunknownipc	2142
816 #define	ERRnosuchprintjob	2151
817 #define	ERRinvgroup 2455
818 
819 /*
820  * Error codes for the ERRSRV class
821  */
822 #define	ERRerror	1	/* Non-specific error code */
823 #define	ERRbadpw	2	/* Bad password */
824 #define	ERRbadtype	3	/* reserved */
825 #define	ERRaccess	4	/* client doesn't have enough access rights */
826 #define	ERRinvnid	5	/* The Tid specified in a command is invalid */
827 #define	ERRinvnetname	6	/* Invalid server name in the tree connect */
828 #define	ERRinvdevice	7	/* Printer and not printer devices are mixed */
829 #define	ERRqfull	49	/* Print queue full */
830 #define	ERRqtoobig	50	/* Print queue full - no space */
831 #define	ERRinvpfid	52	/* Invalid print file FID */
832 #define	ERRsmbcmd	64	/* The server did not recognise the command */
833 #define	ERRsrverror	65	/* The server encountered and internal error */
834 #define	ERRfilespecs	67	/* The Fid and path name contains an */
835 				/* invalid combination */
836 #define	ERRbadpermits	69	/* Access mode invalid */
837 #define	ERRsetattrmode	71	/* Attribute mode invalid */
838 #define	ERRpaused	81	/* Server is paused */
839 #define	ERRmsgoff	82	/* Not receiving messages */
840 #define	ERRnoroom	83	/* No room to buffer message */
841 #define	ERRrmuns	87	/* Too many remote user names */
842 #define	ERRtimeout	88	/* Operation timed out */
843 #define	ERRnoresource	89	/* No resources currently available for req */
844 #define	ERRtoomanyuids	90	/* Too many UIDs active on this session */
845 #define	ERRbaduid	91	/* The UID is not known in this session */
846 #define	ERRusempx	250	/* Temporarily unable to support Raw, */
847 				/* use MPX mode */
848 #define	ERRusestd	251	/* Temporarily unable to support Raw, */
849 				/* use stdandard r/w */
850 #define	ERRcontmpx	252	/* Continue in MPX mode */
851 #define	ERRacctexpired	2239
852 #define	ERRnosupport	65535	/* Invalid function */
853 
854 /*
855  * Error codes for the ERRHRD class
856  */
857 #define	ERRnowrite	19	/* write protected media */
858 #define	ERRbadunit	20	/* Unknown unit */
859 #define	ERRnotready	21	/* Drive not ready */
860 #define	ERRbadcmd	22	/* Unknown command */
861 #define	ERRdata		23	/* Data error (CRC) */
862 #define	ERRbadreq	24	/* Bad request structure length */
863 #define	ERRseek		25	/* Seek error */
864 #define	ERRbadmedia	26	/* Unknown media type */
865 #define	ERRbadsector	27	/* Sector not found */
866 #define	ERRnopaper	28	/* Printer out of paper */
867 #define	ERRwrite	29	/* Write fault */
868 #define	ERRread		30	/* Read fault */
869 #define	ERRgeneral	31	/* General failure */
870 #define	ERRbadshare	32	/* A open conflicts with an existing open */
871 #define	ERRlock		33	/* lock/unlock conflict */
872 #define	ERRwrongdisk	34	/* The wrong disk was found in a drive */
873 #define	ERRFCBunavail	35	/* No FCBs available */
874 #define	ERRsharebufexc	36	/* A sharing buffer has been exceeded */
875 #define	ERRdiskfull	39
876 
877 /*
878  * RAP error codes (it seems that they returned not only by RAP)
879  */
880 #define	SMB_ERROR_ACCESS_DENIED		5
881 #define	SMB_ERROR_NETWORK_ACCESS_DENIED	65
882 #define	SMB_ERROR_MORE_DATA		ERRmoredata
883 
884 /*
885  * An INCOMPLETE list of 32 bit error codes
886  * For more detail see MSDN and ntstatus.h in the MS DDK
887  *
888  * XXX - these should have the severity and "customer defined" fields
889  * added back in, and smb_maperr32() shouldn't mask those fields out;
890  * 0x80000005 is STATUS_BUFFER_OVERFLOW, with 0xC0000000 is
891  * STATUS_ACCESS_VIOLATION, and we need to distinguish between them.
892  * We use STATUS_BUFFER_OVERFLOW, and need to know its exact value,
893  * so we #define	it correctly here; don't strip off the leading
894  * 0x80000000 from it!
895  */
896 #define	NT_STATUS_BUFFER_OVERFLOW	0x80000005
897 #define	NT_STATUS_UNSUCCESSFUL		0x0001
898 #define	NT_STATUS_NOT_IMPLEMENTED	0x0002
899 #define	NT_STATUS_INVALID_INFO_CLASS	0x0003
900 #define	NT_STATUS_INFO_LENGTH_MISMATCH	0x0004
901 #define	NT_STATUS_ACCESS_VIOLATION	0x0005
902 #define	NT_STATUS_IN_PAGE_ERROR		0x0006
903 #define	NT_STATUS_PAGEFILE_QUOTA	0x0007
904 #define	NT_STATUS_INVALID_HANDLE	0x0008
905 #define	NT_STATUS_BAD_INITIAL_STACK	0x0009
906 #define	NT_STATUS_BAD_INITIAL_PC	0x000a
907 #define	NT_STATUS_INVALID_CID		0x000b
908 #define	NT_STATUS_TIMER_NOT_CANCELED	0x000c
909 #define	NT_STATUS_INVALID_PARAMETER	0x000d
910 #define	NT_STATUS_NO_SUCH_DEVICE	0x000e
911 #define	NT_STATUS_NO_SUCH_FILE		0x000f
912 #define	NT_STATUS_INVALID_DEVICE_REQUEST	0x0010
913 #define	NT_STATUS_END_OF_FILE		0x0011
914 #define	NT_STATUS_WRONG_VOLUME		0x0012
915 #define	NT_STATUS_NO_MEDIA_IN_DEVICE	0x0013
916 #define	NT_STATUS_UNRECOGNIZED_MEDIA	0x0014
917 #define	NT_STATUS_NONEXISTENT_SECTOR	0x0015
918 #define	NT_STATUS_MORE_PROCESSING_REQUIRED	0x0016
919 #define	NT_STATUS_NO_MEMORY		0x0017
920 #define	NT_STATUS_CONFLICTING_ADDRESSES	0x0018
921 #define	NT_STATUS_NOT_MAPPED_VIEW	0x0019
922 #define	NT_STATUS_UNABLE_TO_FREE_VM	0x001a
923 #define	NT_STATUS_UNABLE_TO_DELETE_SECTION	0x001b
924 #define	NT_STATUS_INVALID_SYSTEM_SERVICE	0x001c
925 #define	NT_STATUS_ILLEGAL_INSTRUCTION	0x001d
926 #define	NT_STATUS_INVALID_LOCK_SEQUENCE	0x001e
927 #define	NT_STATUS_INVALID_VIEW_SIZE	0x001f
928 #define	NT_STATUS_INVALID_FILE_FOR_SECTION	0x0020
929 #define	NT_STATUS_ALREADY_COMMITTED	0x0021
930 #define	NT_STATUS_ACCESS_DENIED		0x0022
931 #define	NT_STATUS_BUFFER_TOO_SMALL	0x0023
932 #define	NT_STATUS_OBJECT_TYPE_MISMATCH	0x0024
933 #define	NT_STATUS_NONCONTINUABLE_EXCEPTION	0x0025
934 #define	NT_STATUS_INVALID_DISPOSITION	0x0026
935 #define	NT_STATUS_UNWIND		0x0027
936 #define	NT_STATUS_BAD_STACK		0x0028
937 #define	NT_STATUS_INVALID_UNWIND_TARGET	0x0029
938 #define	NT_STATUS_NOT_LOCKED		0x002a
939 #define	NT_STATUS_PARITY_ERROR		0x002b
940 #define	NT_STATUS_UNABLE_TO_DECOMMIT_VM	0x002c
941 #define	NT_STATUS_NOT_COMMITTED		0x002d
942 #define	NT_STATUS_INVALID_PORT_ATTRIBUTES	0x002e
943 #define	NT_STATUS_PORT_MESSAGE_TOO_LONG	0x002f
944 #define	NT_STATUS_INVALID_PARAMETER_MIX	0x0030
945 #define	NT_STATUS_INVALID_QUOTA_LOWER	0x0031
946 #define	NT_STATUS_DISK_CORRUPT_ERROR	0x0032
947 #define	NT_STATUS_OBJECT_NAME_INVALID	0x0033
948 #define	NT_STATUS_OBJECT_NAME_NOT_FOUND	0x0034
949 #define	NT_STATUS_OBJECT_NAME_COLLISION	0x0035
950 #define	NT_STATUS_HANDLE_NOT_WAITABLE	0x0036
951 #define	NT_STATUS_PORT_DISCONNECTED	0x0037
952 #define	NT_STATUS_DEVICE_ALREADY_ATTACHED	0x0038
953 #define	NT_STATUS_OBJECT_PATH_INVALID	0x0039
954 #define	NT_STATUS_OBJECT_PATH_NOT_FOUND	0x003a
955 #define	NT_STATUS_OBJECT_PATH_SYNTAX_BAD	0x003b
956 #define	NT_STATUS_DATA_OVERRUN		0x003c
957 #define	NT_STATUS_DATA_LATE_ERROR	0x003d
958 #define	NT_STATUS_DATA_ERROR		0x003e
959 #define	NT_STATUS_CRC_ERROR		0x003f
960 #define	NT_STATUS_SECTION_TOO_BIG	0x0040
961 #define	NT_STATUS_PORT_CONNECTION_REFUSED	0x0041
962 #define	NT_STATUS_INVALID_PORT_HANDLE	0x0042
963 #define	NT_STATUS_SHARING_VIOLATION	0x0043
964 #define	NT_STATUS_QUOTA_EXCEEDED	0x0044
965 #define	NT_STATUS_INVALID_PAGE_PROTECTION	0x0045
966 #define	NT_STATUS_MUTANT_NOT_OWNED	0x0046
967 #define	NT_STATUS_SEMAPHORE_LIMIT_EXCEEDED	0x0047
968 #define	NT_STATUS_PORT_ALREADY_SET	0x0048
969 #define	NT_STATUS_SECTION_NOT_IMAGE	0x0049
970 #define	NT_STATUS_SUSPEND_COUNT_EXCEEDED	0x004a
971 #define	NT_STATUS_THREAD_IS_TERMINATING	0x004b
972 #define	NT_STATUS_BAD_WORKING_SET_LIMIT	0x004c
973 #define	NT_STATUS_INCOMPATIBLE_FILE_MAP	0x004d
974 #define	NT_STATUS_SECTION_PROTECTION	0x004e
975 #define	NT_STATUS_EAS_NOT_SUPPORTED	0x004f
976 #define	NT_STATUS_EA_TOO_LARGE		0x0050
977 #define	NT_STATUS_NONEXISTENT_EA_ENTRY	0x0051
978 #define	NT_STATUS_NO_EAS_ON_FILE	0x0052
979 #define	NT_STATUS_EA_CORRUPT_ERROR	0x0053
980 #define	NT_STATUS_FILE_LOCK_CONFLICT	0x0054
981 #define	NT_STATUS_LOCK_NOT_GRANTED	0x0055
982 #define	NT_STATUS_DELETE_PENDING	0x0056
983 #define	NT_STATUS_CTL_FILE_NOT_SUPPORTED	0x0057
984 #define	NT_STATUS_UNKNOWN_REVISION	0x0058
985 #define	NT_STATUS_REVISION_MISMATCH	0x0059
986 #define	NT_STATUS_INVALID_OWNER		0x005a
987 #define	NT_STATUS_INVALID_PRIMARY_GROUP	0x005b
988 #define	NT_STATUS_NO_IMPERSONATION_TOKEN	0x005c
989 #define	NT_STATUS_CANT_DISABLE_MANDATORY	0x005d
990 #define	NT_STATUS_NO_LOGON_SERVERS	0x005e
991 #define	NT_STATUS_NO_SUCH_LOGON_SESSION	0x005f
992 #define	NT_STATUS_NO_SUCH_PRIVILEGE	0x0060
993 #define	NT_STATUS_PRIVILEGE_NOT_HELD	0x0061
994 #define	NT_STATUS_INVALID_ACCOUNT_NAME	0x0062
995 #define	NT_STATUS_USER_EXISTS		0x0063
996 #define	NT_STATUS_NO_SUCH_USER		0x0064
997 #define	NT_STATUS_GROUP_EXISTS		0x0065
998 #define	NT_STATUS_NO_SUCH_GROUP		0x0066
999 #define	NT_STATUS_MEMBER_IN_GROUP	0x0067
1000 #define	NT_STATUS_MEMBER_NOT_IN_GROUP	0x0068
1001 #define	NT_STATUS_LAST_ADMIN		0x0069
1002 #define	NT_STATUS_WRONG_PASSWORD	0x006a
1003 #define	NT_STATUS_ILL_FORMED_PASSWORD	0x006b
1004 #define	NT_STATUS_PASSWORD_RESTRICTION	0x006c
1005 #define	NT_STATUS_LOGON_FAILURE		0x006d
1006 #define	NT_STATUS_ACCOUNT_RESTRICTION	0x006e
1007 #define	NT_STATUS_INVALID_LOGON_HOURS	0x006f
1008 #define	NT_STATUS_INVALID_WORKSTATION	0x0070
1009 #define	NT_STATUS_PASSWORD_EXPIRED	0x0071
1010 #define	NT_STATUS_ACCOUNT_DISABLED	0x0072
1011 #define	NT_STATUS_NONE_MAPPED		0x0073
1012 #define	NT_STATUS_TOO_MANY_LUIDS_REQUESTED	0x0074
1013 #define	NT_STATUS_LUIDS_EXHAUSTED	0x0075
1014 #define	NT_STATUS_INVALID_SUB_AUTHORITY	0x0076
1015 #define	NT_STATUS_INVALID_ACL		0x0077
1016 #define	NT_STATUS_INVALID_SID		0x0078
1017 #define	NT_STATUS_INVALID_SECURITY_DESCR	0x0079
1018 #define	NT_STATUS_PROCEDURE_NOT_FOUND	0x007a
1019 #define	NT_STATUS_INVALID_IMAGE_FORMAT	0x007b
1020 #define	NT_STATUS_NO_TOKEN		0x007c
1021 #define	NT_STATUS_BAD_INHERITANCE_ACL	0x007d
1022 #define	NT_STATUS_RANGE_NOT_LOCKED	0x007e
1023 #define	NT_STATUS_DISK_FULL		0x007f
1024 #define	NT_STATUS_SERVER_DISABLED	0x0080
1025 #define	NT_STATUS_SERVER_NOT_DISABLED	0x0081
1026 #define	NT_STATUS_TOO_MANY_GUIDS_REQUESTED	0x0082
1027 #define	NT_STATUS_GUIDS_EXHAUSTED	0x0083
1028 #define	NT_STATUS_INVALID_ID_AUTHORITY	0x0084
1029 #define	NT_STATUS_AGENTS_EXHAUSTED	0x0085
1030 #define	NT_STATUS_INVALID_VOLUME_LABEL	0x0086
1031 #define	NT_STATUS_SECTION_NOT_EXTENDED	0x0087
1032 #define	NT_STATUS_NOT_MAPPED_DATA	0x0088
1033 #define	NT_STATUS_RESOURCE_DATA_NOT_FOUND	0x0089
1034 #define	NT_STATUS_RESOURCE_TYPE_NOT_FOUND	0x008a
1035 #define	NT_STATUS_RESOURCE_NAME_NOT_FOUND	0x008b
1036 #define	NT_STATUS_ARRAY_BOUNDS_EXCEEDED	0x008c
1037 #define	NT_STATUS_FLOAT_DENORMAL_OPERAND	0x008d
1038 #define	NT_STATUS_FLOAT_DIVIDE_BY_ZERO	0x008e
1039 #define	NT_STATUS_FLOAT_INEXACT_RESULT	0x008f
1040 #define	NT_STATUS_FLOAT_INVALID_OPERATION	0x0090
1041 #define	NT_STATUS_FLOAT_OVERFLOW	0x0091
1042 #define	NT_STATUS_FLOAT_STACK_CHECK	0x0092
1043 #define	NT_STATUS_FLOAT_UNDERFLOW	0x0093
1044 #define	NT_STATUS_INTEGER_DIVIDE_BY_ZERO	0x0094
1045 #define	NT_STATUS_INTEGER_OVERFLOW	0x0095
1046 #define	NT_STATUS_PRIVILEGED_INSTRUCTION	0x0096
1047 #define	NT_STATUS_TOO_MANY_PAGING_FILES	0x0097
1048 #define	NT_STATUS_FILE_INVALID	0x0098
1049 #define	NT_STATUS_ALLOTTED_SPACE_EXCEEDED	0x0099
1050 #define	NT_STATUS_INSUFFICIENT_RESOURCES	0x009a
1051 #define	NT_STATUS_DFS_EXIT_PATH_FOUND	0x009b
1052 #define	NT_STATUS_DEVICE_DATA_ERROR	0x009c
1053 #define	NT_STATUS_DEVICE_NOT_CONNECTED	0x009d
1054 #define	NT_STATUS_DEVICE_POWER_FAILURE	0x009e
1055 #define	NT_STATUS_FREE_VM_NOT_AT_BASE	0x009f
1056 #define	NT_STATUS_MEMORY_NOT_ALLOCATED	0x00a0
1057 #define	NT_STATUS_WORKING_SET_QUOTA	0x00a1
1058 #define	NT_STATUS_MEDIA_WRITE_PROTECTED	0x00a2
1059 #define	NT_STATUS_DEVICE_NOT_READY	0x00a3
1060 #define	NT_STATUS_INVALID_GROUP_ATTRIBUTES	0x00a4
1061 #define	NT_STATUS_BAD_IMPERSONATION_LEVEL	0x00a5
1062 #define	NT_STATUS_CANT_OPEN_ANONYMOUS	0x00a6
1063 #define	NT_STATUS_BAD_VALIDATION_CLASS	0x00a7
1064 #define	NT_STATUS_BAD_TOKEN_TYPE	0x00a8
1065 #define	NT_STATUS_BAD_MASTER_BOOT_RECORD	0x00a9
1066 #define	NT_STATUS_INSTRUCTION_MISALIGNMENT	0x00aa
1067 #define	NT_STATUS_INSTANCE_NOT_AVAILABLE	0x00ab
1068 #define	NT_STATUS_PIPE_NOT_AVAILABLE	0x00ac
1069 #define	NT_STATUS_INVALID_PIPE_STATE	0x00ad
1070 #define	NT_STATUS_PIPE_BUSY		0x00ae
1071 #define	NT_STATUS_ILLEGAL_FUNCTION	0x00af
1072 #define	NT_STATUS_PIPE_DISCONNECTED	0x00b0
1073 #define	NT_STATUS_PIPE_CLOSING		0x00b1
1074 #define	NT_STATUS_PIPE_CONNECTED	0x00b2
1075 #define	NT_STATUS_PIPE_LISTENING	0x00b3
1076 #define	NT_STATUS_INVALID_READ_MODE	0x00b4
1077 #define	NT_STATUS_IO_TIMEOUT		0x00b5
1078 #define	NT_STATUS_FILE_FORCED_CLOSED	0x00b6
1079 #define	NT_STATUS_PROFILING_NOT_STARTED	0x00b7
1080 #define	NT_STATUS_PROFILING_NOT_STOPPED	0x00b8
1081 #define	NT_STATUS_COULD_NOT_INTERPRET	0x00b9
1082 #define	NT_STATUS_FILE_IS_A_DIRECTORY	0x00ba
1083 #define	NT_STATUS_NOT_SUPPORTED		0x00bb
1084 #define	NT_STATUS_REMOTE_NOT_LISTENING	0x00bc
1085 #define	NT_STATUS_DUPLICATE_NAME	0x00bd
1086 #define	NT_STATUS_BAD_NETWORK_PATH	0x00be
1087 #define	NT_STATUS_NETWORK_BUSY		0x00bf
1088 #define	NT_STATUS_DEVICE_DOES_NOT_EXIST	0x00c0
1089 #define	NT_STATUS_TOO_MANY_COMMANDS	0x00c1
1090 #define	NT_STATUS_ADAPTER_HARDWARE_ERROR	0x00c2
1091 #define	NT_STATUS_INVALID_NETWORK_RESPONSE	0x00c3
1092 #define	NT_STATUS_UNEXPECTED_NETWORK_ERROR	0x00c4
1093 #define	NT_STATUS_BAD_REMOTE_ADAPTER	0x00c5
1094 #define	NT_STATUS_PRINT_QUEUE_FULL	0x00c6
1095 #define	NT_STATUS_NO_SPOOL_SPACE	0x00c7
1096 #define	NT_STATUS_PRINT_CANCELLED	0x00c8
1097 #define	NT_STATUS_NETWORK_NAME_DELETED	0x00c9
1098 #define	NT_STATUS_NETWORK_ACCESS_DENIED	0x00ca
1099 #define	NT_STATUS_BAD_DEVICE_TYPE	0x00cb
1100 #define	NT_STATUS_BAD_NETWORK_NAME	0x00cc
1101 #define	NT_STATUS_TOO_MANY_NAMES	0x00cd
1102 #define	NT_STATUS_TOO_MANY_SESSIONS	0x00ce
1103 #define	NT_STATUS_SHARING_PAUSED	0x00cf
1104 #define	NT_STATUS_REQUEST_NOT_ACCEPTED	0x00d0
1105 #define	NT_STATUS_REDIRECTOR_PAUSED	0x00d1
1106 #define	NT_STATUS_NET_WRITE_FAULT	0x00d2
1107 #define	NT_STATUS_PROFILING_AT_LIMIT	0x00d3
1108 #define	NT_STATUS_NOT_SAME_DEVICE	0x00d4
1109 #define	NT_STATUS_FILE_RENAMED		0x00d5
1110 #define	NT_STATUS_VIRTUAL_CIRCUIT_CLOSED	0x00d6
1111 #define	NT_STATUS_NO_SECURITY_ON_OBJECT	0x00d7
1112 #define	NT_STATUS_CANT_WAIT		0x00d8
1113 #define	NT_STATUS_PIPE_EMPTY		0x00d9
1114 #define	NT_STATUS_CANT_ACCESS_DOMAIN_INFO	0x00da
1115 #define	NT_STATUS_CANT_TERMINATE_SELF	0x00db
1116 #define	NT_STATUS_INVALID_SERVER_STATE	0x00dc
1117 #define	NT_STATUS_INVALID_DOMAIN_STATE	0x00dd
1118 #define	NT_STATUS_INVALID_DOMAIN_ROLE	0x00de
1119 #define	NT_STATUS_NO_SUCH_DOMAIN	0x00df
1120 #define	NT_STATUS_DOMAIN_EXISTS		0x00e0
1121 #define	NT_STATUS_DOMAIN_LIMIT_EXCEEDED	0x00e1
1122 #define	NT_STATUS_OPLOCK_NOT_GRANTED	0x00e2
1123 #define	NT_STATUS_INVALID_OPLOCK_PROTOCOL	0x00e3
1124 #define	NT_STATUS_INTERNAL_DB_CORRUPTION	0x00e4
1125 #define	NT_STATUS_INTERNAL_ERROR	0x00e5
1126 #define	NT_STATUS_GENERIC_NOT_MAPPED	0x00e6
1127 #define	NT_STATUS_BAD_DESCRIPTOR_FORMAT	0x00e7
1128 #define	NT_STATUS_INVALID_USER_BUFFER	0x00e8
1129 #define	NT_STATUS_UNEXPECTED_IO_ERROR	0x00e9
1130 #define	NT_STATUS_UNEXPECTED_MM_CREATE_ERR	0x00ea
1131 #define	NT_STATUS_UNEXPECTED_MM_MAP_ERROR	0x00eb
1132 #define	NT_STATUS_UNEXPECTED_MM_EXTEND_ERR	0x00ec
1133 #define	NT_STATUS_NOT_LOGON_PROCESS	0x00ed
1134 #define	NT_STATUS_LOGON_SESSION_EXISTS	0x00ee
1135 #define	NT_STATUS_INVALID_PARAMETER_1	0x00ef
1136 #define	NT_STATUS_INVALID_PARAMETER_2	0x00f0
1137 #define	NT_STATUS_INVALID_PARAMETER_3	0x00f1
1138 #define	NT_STATUS_INVALID_PARAMETER_4	0x00f2
1139 #define	NT_STATUS_INVALID_PARAMETER_5	0x00f3
1140 #define	NT_STATUS_INVALID_PARAMETER_6	0x00f4
1141 #define	NT_STATUS_INVALID_PARAMETER_7	0x00f5
1142 #define	NT_STATUS_INVALID_PARAMETER_8	0x00f6
1143 #define	NT_STATUS_INVALID_PARAMETER_9	0x00f7
1144 #define	NT_STATUS_INVALID_PARAMETER_10	0x00f8
1145 #define	NT_STATUS_INVALID_PARAMETER_11	0x00f9
1146 #define	NT_STATUS_INVALID_PARAMETER_12	0x00fa
1147 #define	NT_STATUS_REDIRECTOR_NOT_STARTED	0x00fb
1148 #define	NT_STATUS_REDIRECTOR_STARTED	0x00fc
1149 #define	NT_STATUS_STACK_OVERFLOW	0x00fd
1150 #define	NT_STATUS_NO_SUCH_PACKAGE	0x00fe
1151 #define	NT_STATUS_BAD_FUNCTION_TABLE	0x00ff
1152 #define	NT_STATUS_VARIABLE_NOT_FOUND	0x0100
1153 #define	NT_STATUS_DIRECTORY_NOT_EMPTY	0x0101
1154 #define	NT_STATUS_FILE_CORRUPT_ERROR	0x0102
1155 #define	NT_STATUS_NOT_A_DIRECTORY	0x0103
1156 #define	NT_STATUS_BAD_LOGON_SESSION_STATE	0x0104
1157 #define	NT_STATUS_LOGON_SESSION_COLLISION	0x0105
1158 #define	NT_STATUS_NAME_TOO_LONG		0x0106
1159 #define	NT_STATUS_FILES_OPEN		0x0107
1160 #define	NT_STATUS_CONNECTION_IN_USE	0x0108
1161 #define	NT_STATUS_MESSAGE_NOT_FOUND	0x0109
1162 #define	NT_STATUS_PROCESS_IS_TERMINATING	0x010a
1163 #define	NT_STATUS_INVALID_LOGON_TYPE	0x010b
1164 #define	NT_STATUS_NO_GUID_TRANSLATION	0x010c
1165 #define	NT_STATUS_CANNOT_IMPERSONATE	0x010d
1166 #define	NT_STATUS_IMAGE_ALREADY_LOADED	0x010e
1167 #define	NT_STATUS_ABIOS_NOT_PRESENT	0x010f
1168 #define	NT_STATUS_ABIOS_LID_NOT_EXIST	0x0110
1169 #define	NT_STATUS_ABIOS_LID_ALREADY_OWNED	0x0111
1170 #define	NT_STATUS_ABIOS_NOT_LID_OWNER	0x0112
1171 #define	NT_STATUS_ABIOS_INVALID_COMMAND	0x0113
1172 #define	NT_STATUS_ABIOS_INVALID_LID	0x0114
1173 #define	NT_STATUS_ABIOS_SELECTOR_NOT_AVAILABLE	0x0115
1174 #define	NT_STATUS_ABIOS_INVALID_SELECTOR	0x0116
1175 #define	NT_STATUS_NO_LDT		0x0117
1176 #define	NT_STATUS_INVALID_LDT_SIZE	0x0118
1177 #define	NT_STATUS_INVALID_LDT_OFFSET	0x0119
1178 #define	NT_STATUS_INVALID_LDT_DESCRIPTOR	0x011a
1179 #define	NT_STATUS_INVALID_IMAGE_NE_FORMAT	0x011b
1180 #define	NT_STATUS_RXACT_INVALID_STATE	0x011c
1181 #define	NT_STATUS_RXACT_COMMIT_FAILURE	0x011d
1182 #define	NT_STATUS_MAPPED_FILE_SIZE_ZERO	0x011e
1183 #define	NT_STATUS_TOO_MANY_OPENED_FILES	0x011f
1184 #define	NT_STATUS_CANCELLED		0x0120
1185 #define	NT_STATUS_CANNOT_DELETE		0x0121
1186 #define	NT_STATUS_INVALID_COMPUTER_NAME	0x0122
1187 #define	NT_STATUS_FILE_DELETED		0x0123
1188 #define	NT_STATUS_SPECIAL_ACCOUNT	0x0124
1189 #define	NT_STATUS_SPECIAL_GROUP		0x0125
1190 #define	NT_STATUS_SPECIAL_USER		0x0126
1191 #define	NT_STATUS_MEMBERS_PRIMARY_GROUP	0x0127
1192 #define	NT_STATUS_FILE_CLOSED		0x0128
1193 #define	NT_STATUS_TOO_MANY_THREADS	0x0129
1194 #define	NT_STATUS_THREAD_NOT_IN_PROCESS	0x012a
1195 #define	NT_STATUS_TOKEN_ALREADY_IN_USE	0x012b
1196 #define	NT_STATUS_PAGEFILE_QUOTA_EXCEEDED	0x012c
1197 #define	NT_STATUS_COMMITMENT_LIMIT	0x012d
1198 #define	NT_STATUS_INVALID_IMAGE_LE_FORMAT	0x012e
1199 #define	NT_STATUS_INVALID_IMAGE_NOT_MZ	0x012f
1200 #define	NT_STATUS_INVALID_IMAGE_PROTECT	0x0130
1201 #define	NT_STATUS_INVALID_IMAGE_WIN_16	0x0131
1202 #define	NT_STATUS_LOGON_SERVER_CONFLICT	0x0132
1203 #define	NT_STATUS_TIME_DIFFERENCE_AT_DC	0x0133
1204 #define	NT_STATUS_SYNCHRONIZATION_REQUIRED	0x0134
1205 #define	NT_STATUS_DLL_NOT_FOUND		0x0135
1206 #define	NT_STATUS_OPEN_FAILED		0x0136
1207 #define	NT_STATUS_IO_PRIVILEGE_FAILED	0x0137
1208 #define	NT_STATUS_ORDINAL_NOT_FOUND	0x0138
1209 #define	NT_STATUS_ENTRYPOINT_NOT_FOUND	0x0139
1210 #define	NT_STATUS_CONTROL_C_EXIT	0x013a
1211 #define	NT_STATUS_LOCAL_DISCONNECT	0x013b
1212 #define	NT_STATUS_REMOTE_DISCONNECT	0x013c
1213 #define	NT_STATUS_REMOTE_RESOURCES	0x013d
1214 #define	NT_STATUS_LINK_FAILED		0x013e
1215 #define	NT_STATUS_LINK_TIMEOUT		0x013f
1216 #define	NT_STATUS_INVALID_CONNECTION	0x0140
1217 #define	NT_STATUS_INVALID_ADDRESS	0x0141
1218 #define	NT_STATUS_DLL_INIT_FAILED	0x0142
1219 #define	NT_STATUS_MISSING_SYSTEMFILE	0x0143
1220 #define	NT_STATUS_UNHANDLED_EXCEPTION	0x0144
1221 #define	NT_STATUS_APP_INIT_FAILURE	0x0145
1222 #define	NT_STATUS_PAGEFILE_CREATE_FAILED	0x0146
1223 #define	NT_STATUS_NO_PAGEFILE		0x0147
1224 #define	NT_STATUS_INVALID_LEVEL		0x0148
1225 #define	NT_STATUS_WRONG_PASSWORD_CORE	0x0149
1226 #define	NT_STATUS_ILLEGAL_FLOAT_CONTEXT	0x014a
1227 #define	NT_STATUS_PIPE_BROKEN		0x014b
1228 #define	NT_STATUS_REGISTRY_CORRUPT	0x014c
1229 #define	NT_STATUS_REGISTRY_IO_FAILED	0x014d
1230 #define	NT_STATUS_NO_EVENT_PAIR		0x014e
1231 #define	NT_STATUS_UNRECOGNIZED_VOLUME	0x014f
1232 #define	NT_STATUS_SERIAL_NO_DEVICE_INITED	0x0150
1233 #define	NT_STATUS_NO_SUCH_ALIAS		0x0151
1234 #define	NT_STATUS_MEMBER_NOT_IN_ALIAS	0x0152
1235 #define	NT_STATUS_MEMBER_IN_ALIAS	0x0153
1236 #define	NT_STATUS_ALIAS_EXISTS		0x0154
1237 #define	NT_STATUS_LOGON_NOT_GRANTED	0x0155
1238 #define	NT_STATUS_TOO_MANY_SECRETS	0x0156
1239 #define	NT_STATUS_SECRET_TOO_LONG	0x0157
1240 #define	NT_STATUS_INTERNAL_DB_ERROR	0x0158
1241 #define	NT_STATUS_FULLSCREEN_MODE	0x0159
1242 #define	NT_STATUS_TOO_MANY_CONTEXT_IDS	0x015a
1243 #define	NT_STATUS_LOGON_TYPE_NOT_GRANTED	0x015b
1244 #define	NT_STATUS_NOT_REGISTRY_FILE	0x015c
1245 #define	NT_STATUS_NT_CROSS_ENCRYPTION_REQUIRED	0x015d
1246 #define	NT_STATUS_DOMAIN_CTRLR_CONFIG_ERROR	0x015e
1247 #define	NT_STATUS_FT_MISSING_MEMBER	0x015f
1248 #define	NT_STATUS_ILL_FORMED_SERVICE_ENTRY	0x0160
1249 #define	NT_STATUS_ILLEGAL_CHARACTER	0x0161
1250 #define	NT_STATUS_UNMAPPABLE_CHARACTER	0x0162
1251 #define	NT_STATUS_UNDEFINED_CHARACTER	0x0163
1252 #define	NT_STATUS_FLOPPY_VOLUME		0x0164
1253 #define	NT_STATUS_FLOPPY_ID_MARK_NOT_FOUND	0x0165
1254 #define	NT_STATUS_FLOPPY_WRONG_CYLINDER	0x0166
1255 #define	NT_STATUS_FLOPPY_UNKNOWN_ERROR	0x0167
1256 #define	NT_STATUS_FLOPPY_BAD_REGISTERS	0x0168
1257 #define	NT_STATUS_DISK_RECALIBRATE_FAILED	0x0169
1258 #define	NT_STATUS_DISK_OPERATION_FAILED	0x016a
1259 #define	NT_STATUS_DISK_RESET_FAILED	0x016b
1260 #define	NT_STATUS_SHARED_IRQ_BUSY	0x016c
1261 #define	NT_STATUS_FT_ORPHANING		0x016d
1262 #define	NT_STATUS_BIOS_FAILED_TO_CONNECT_INTERRUPT	0x016e
1263 #define	NT_STATUS_16F		0x016f
1264 #define	NT_STATUS_170		0x0170
1265 #define	NT_STATUS_171		0x0171
1266 #define	NT_STATUS_PARTITION_FAILURE	0x0172
1267 #define	NT_STATUS_INVALID_BLOCK_LENGTH	0x0173
1268 #define	NT_STATUS_DEVICE_NOT_PARTITIONED	0x0174
1269 #define	NT_STATUS_UNABLE_TO_LOCK_MEDIA	0x0175
1270 #define	NT_STATUS_UNABLE_TO_UNLOAD_MEDIA	0x0176
1271 #define	NT_STATUS_EOM_OVERFLOW		0x0177
1272 #define	NT_STATUS_NO_MEDIA		0x0178
1273 #define	NT_STATUS_179		0x0179
1274 #define	NT_STATUS_NO_SUCH_MEMBER	0x017a
1275 #define	NT_STATUS_INVALID_MEMBER	0x017b
1276 #define	NT_STATUS_KEY_DELETED		0x017c
1277 #define	NT_STATUS_NO_LOG_SPACE		0x017d
1278 #define	NT_STATUS_TOO_MANY_SIDS		0x017e
1279 #define	NT_STATUS_LM_CROSS_ENCRYPTION_REQUIRED	0x017f
1280 #define	NT_STATUS_KEY_HAS_CHILDREN	0x0180
1281 #define	NT_STATUS_CHILD_MUST_BE_VOLATILE	0x0181
1282 #define	NT_STATUS_DEVICE_CONFIGURATION_ERROR	0x0182
1283 #define	NT_STATUS_DRIVER_INTERNAL_ERROR	0x0183
1284 #define	NT_STATUS_INVALID_DEVICE_STATE	0x0184
1285 #define	NT_STATUS_IO_DEVICE_ERROR	0x0185
1286 #define	NT_STATUS_DEVICE_PROTOCOL_ERROR	0x0186
1287 #define	NT_STATUS_BACKUP_CONTROLLER	0x0187
1288 #define	NT_STATUS_LOG_FILE_FULL		0x0188
1289 #define	NT_STATUS_TOO_LATE		0x0189
1290 #define	NT_STATUS_NO_TRUST_LSA_SECRET	0x018a
1291 #define	NT_STATUS_NO_TRUST_SAM_ACCOUNT	0x018b
1292 #define	NT_STATUS_TRUSTED_DOMAIN_FAILURE	0x018c
1293 #define	NT_STATUS_TRUSTED_RELATIONSHIP_FAILURE	0x018d
1294 #define	NT_STATUS_EVENTLOG_FILE_CORRUPT	0x018e
1295 #define	NT_STATUS_EVENTLOG_CANT_START	0x018f
1296 #define	NT_STATUS_TRUST_FAILURE		0x0190
1297 #define	NT_STATUS_MUTANT_LIMIT_EXCEEDED	0x0191
1298 #define	NT_STATUS_NETLOGON_NOT_STARTED	0x0192
1299 #define	NT_STATUS_ACCOUNT_EXPIRED	0x0193
1300 #define	NT_STATUS_POSSIBLE_DEADLOCK	0x0194
1301 #define	NT_STATUS_NETWORK_CREDENTIAL_CONFLICT	0x0195
1302 #define	NT_STATUS_REMOTE_SESSION_LIMIT	0x0196
1303 #define	NT_STATUS_EVENTLOG_FILE_CHANGED	0x0197
1304 #define	NT_STATUS_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT	0x0198
1305 #define	NT_STATUS_NOLOGON_WORKSTATION_TRUST_ACCOUNT	0x0199
1306 #define	NT_STATUS_NOLOGON_SERVER_TRUST_ACCOUNT	0x019a
1307 #define	NT_STATUS_DOMAIN_TRUST_INCONSISTENT	0x019b
1308 #define	NT_STATUS_FS_DRIVER_REQUIRED	0x019c
1309 #define	NT_STATUS_NO_USER_SESSION_KEY	0x0202
1310 #define	NT_STATUS_USER_SESSION_DELETED	0x0203
1311 #define	NT_STATUS_RESOURCE_LANG_NOT_FOUND	0x0204
1312 #define	NT_STATUS_INSUFF_SERVER_RESOURCES	0x0205
1313 #define	NT_STATUS_INVALID_BUFFER_SIZE	0x0206
1314 #define	NT_STATUS_INVALID_ADDRESS_COMPONENT	0x0207
1315 #define	NT_STATUS_INVALID_ADDRESS_WILDCARD	0x0208
1316 #define	NT_STATUS_TOO_MANY_ADDRESSES	0x0209
1317 #define	NT_STATUS_ADDRESS_ALREADY_EXISTS	0x020a
1318 #define	NT_STATUS_ADDRESS_CLOSED	0x020b
1319 #define	NT_STATUS_CONNECTION_DISCONNECTED	0x020c
1320 #define	NT_STATUS_CONNECTION_RESET	0x020d
1321 #define	NT_STATUS_TOO_MANY_NODES	0x020e
1322 #define	NT_STATUS_TRANSACTION_ABORTED	0x020f
1323 #define	NT_STATUS_TRANSACTION_TIMED_OUT	0x0210
1324 #define	NT_STATUS_TRANSACTION_NO_RELEASE	0x0211
1325 #define	NT_STATUS_TRANSACTION_NO_MATCH	0x0212
1326 #define	NT_STATUS_TRANSACTION_RESPONDED	0x0213
1327 #define	NT_STATUS_TRANSACTION_INVALID_ID	0x0214
1328 #define	NT_STATUS_TRANSACTION_INVALID_TYPE	0x0215
1329 #define	NT_STATUS_NOT_SERVER_SESSION	0x0216
1330 #define	NT_STATUS_NOT_CLIENT_SESSION	0x0217
1331 #define	NT_STATUS_CANNOT_LOAD_REGISTRY_FILE	0x0218
1332 #define	NT_STATUS_DEBUG_ATTACH_FAILED	0x0219
1333 #define	NT_STATUS_SYSTEM_PROCESS_TERMINATED	0x021a
1334 #define	NT_STATUS_DATA_NOT_ACCEPTED	0x021b
1335 #define	NT_STATUS_NO_BROWSER_SERVERS_FOUND	0x021c
1336 #define	NT_STATUS_VDM_HARD_ERROR	0x021d
1337 #define	NT_STATUS_DRIVER_CANCEL_TIMEOUT	0x021e
1338 #define	NT_STATUS_REPLY_MESSAGE_MISMATCH	0x021f
1339 #define	NT_STATUS_MAPPED_ALIGNMENT	0x0220
1340 #define	NT_STATUS_IMAGE_CHECKSUM_MISMATCH	0x0221
1341 #define	NT_STATUS_LOST_WRITEBEHIND_DATA	0x0222
1342 #define	NT_STATUS_CLIENT_SERVER_PARAMETERS_INVALID	0x0223
1343 #define	NT_STATUS_PASSWORD_MUST_CHANGE	0x0224
1344 #define	NT_STATUS_NOT_FOUND		0x0225
1345 #define	NT_STATUS_NOT_TINY_STREAM	0x0226
1346 #define	NT_STATUS_RECOVERY_FAILURE	0x0227
1347 #define	NT_STATUS_STACK_OVERFLOW_READ	0x0228
1348 #define	NT_STATUS_FAIL_CHECK		0x0229
1349 #define	NT_STATUS_DUPLICATE_OBJECTID	0x022a
1350 #define	NT_STATUS_OBJECTID_EXISTS	0x022b
1351 #define	NT_STATUS_CONVERT_TO_LARGE	0x022c
1352 #define	NT_STATUS_RETRY			0x022d
1353 #define	NT_STATUS_FOUND_OUT_OF_SCOPE	0x022e
1354 #define	NT_STATUS_ALLOCATE_BUCKET	0x022f
1355 #define	NT_STATUS_PROPSET_NOT_FOUND	0x0230
1356 #define	NT_STATUS_MARSHALL_OVERFLOW	0x0231
1357 #define	NT_STATUS_INVALID_VARIANT	0x0232
1358 #define	NT_STATUS_DOMAIN_CONTROLLER_NOT_FOUND	0x0233
1359 #define	NT_STATUS_ACCOUNT_LOCKED_OUT	0x0234
1360 #define	NT_STATUS_HANDLE_NOT_CLOSABLE	0x0235
1361 #define	NT_STATUS_CONNECTION_REFUSED	0x0236
1362 #define	NT_STATUS_GRACEFUL_DISCONNECT	0x0237
1363 #define	NT_STATUS_ADDRESS_ALREADY_ASSOCIATED	0x0238
1364 #define	NT_STATUS_ADDRESS_NOT_ASSOCIATED	0x0239
1365 #define	NT_STATUS_CONNECTION_INVALID	0x023a
1366 #define	NT_STATUS_CONNECTION_ACTIVE	0x023b
1367 #define	NT_STATUS_NETWORK_UNREACHABLE	0x023c
1368 #define	NT_STATUS_HOST_UNREACHABLE	0x023d
1369 #define	NT_STATUS_PROTOCOL_UNREACHABLE	0x023e
1370 #define	NT_STATUS_PORT_UNREACHABLE	0x023f
1371 #define	NT_STATUS_REQUEST_ABORTED	0x0240
1372 #define	NT_STATUS_CONNECTION_ABORTED	0x0241
1373 #define	NT_STATUS_BAD_COMPRESSION_BUFFER	0x0242
1374 #define	NT_STATUS_USER_MAPPED_FILE	0x0243
1375 #define	NT_STATUS_AUDIT_FAILED		0x0244
1376 #define	NT_STATUS_TIMER_RESOLUTION_NOT_SET	0x0245
1377 #define	NT_STATUS_CONNECTION_COUNT_LIMIT	0x0246
1378 #define	NT_STATUS_LOGIN_TIME_RESTRICTION	0x0247
1379 #define	NT_STATUS_LOGIN_WKSTA_RESTRICTION	0x0248
1380 #define	NT_STATUS_IMAGE_MP_UP_MISMATCH	0x0249
1381 #define	NT_STATUS_INSUFFICIENT_LOGON_INFO	0x0250
1382 #define	NT_STATUS_BAD_DLL_ENTRYPOINT	0x0251
1383 #define	NT_STATUS_BAD_SERVICE_ENTRYPOINT	0x0252
1384 #define	NT_STATUS_LPC_REPLY_LOST	0x0253
1385 #define	NT_STATUS_IP_ADDRESS_CONFLICT1	0x0254
1386 #define	NT_STATUS_IP_ADDRESS_CONFLICT2	0x0255
1387 #define	NT_STATUS_REGISTRY_QUOTA_LIMIT	0x0256
1388 #define	NT_STATUS_PATH_NOT_COVERED	0x0257
1389 #define	NT_STATUS_NO_CALLBACK_ACTIVE	0x0258
1390 #define	NT_STATUS_LICENSE_QUOTA_EXCEEDED	0x0259
1391 #define	NT_STATUS_PWD_TOO_SHORT		0x025a
1392 #define	NT_STATUS_PWD_TOO_RECENT	0x025b
1393 #define	NT_STATUS_PWD_HISTORY_CONFLICT	0x025c
1394 #define	NT_STATUS_PLUGPLAY_NO_DEVICE	0x025e
1395 #define	NT_STATUS_UNSUPPORTED_COMPRESSION	0x025f
1396 #define	NT_STATUS_INVALID_HW_PROFILE	0x0260
1397 #define	NT_STATUS_INVALID_PLUGPLAY_DEVICE_PATH	0x0261
1398 #define	NT_STATUS_DRIVER_ORDINAL_NOT_FOUND	0x0262
1399 #define	NT_STATUS_DRIVER_ENTRYPOINT_NOT_FOUND	0x0263
1400 #define	NT_STATUS_RESOURCE_NOT_OWNED	0x0264
1401 #define	NT_STATUS_TOO_MANY_LINKS	0x0265
1402 #define	NT_STATUS_QUOTA_LIST_INCONSISTENT	0x0266
1403 #define	NT_STATUS_FILE_IS_OFFLINE	0x0267
1404 
1405 #define	NT_STATUS_LICENSE_VIOLATION	0x026a
1406 
1407 #define	NT_STATUS_DFS_UNAVAILABLE	0x026d
1408 #define	NT_STATUS_VOLUME_DISMOUNTED	0x026e
1409 
1410 #define	NT_STATUS_NOT_A_REPARSE_POINT	0x0275
1411 
1412 #define	NT_STATUS_REPARSE_POINT_NOT_RESOLVED	0x0280
1413 #define	NT_STATUS_DIRECTORY_IS_A_REPARSE_POINT	0x0281
1414 
1415 #define	NT_STATUS_ENCRYPTION_FAILED	0x028a
1416 #define	NT_STATUS_DECRYPTION_FAILED	0x028b
1417 #define	NT_STATUS_RANGE_NOT_FOUND	0x028c
1418 #define	NT_STATUS_NO_RECOVERY_POLICY	0x028d
1419 #define	NT_STATUS_NO_EFS		0x028e
1420 #define	NT_STATUS_WRONG_EFS		0x028f
1421 #define	NT_STATUS_NO_USER_KEYS		0x0290
1422 #define	NT_STATUS_FILE_NOT_ENCRYPTED	0x0291
1423 
1424 #define	NT_STATUS_FILE_ENCRYPTED	0x0293
1425 
1426 #define	NT_STATUS_VOLUME_NOT_UPGRADED	0x029c
1427 
1428 #define	NT_STATUS_KDC_CERT_EXPIRED	0x040e
1429 /*
1430  * 0x00010000-0x0001ffff are "DBG" errors
1431  * 0x00020000-0x0003ffff are "RPC" errors
1432  * 0x00040000-0x0004ffff are "PNP" errors
1433  * 0x000A0000-0x000Affff are "CTX" errors
1434  * 0x00130000-0x0013ffff are "CLUSTER" errors
1435  * 0x00140000-0x0014ffff are "ACPI" errors
1436  * 0x00150000-0x0015ffff are "SXS" errors
1437  */
1438 
1439 /*
1440  * size of the GUID returned in an extended security negotiate response
1441  */
1442 #define	SMB_GUIDLEN	16
1443 
1444 typedef uint16_t	smbfh;
1445 
1446 /*
1447  * NTLMv2 blob header structure.
1448  */
1449 struct ntlmv2_blobhdr {
1450 	uint32_t	header;
1451 	uint32_t	reserved;
1452 	uint64_t	timestamp;
1453 	uint64_t	client_nonce;
1454 	uint32_t	unknown1;
1455 };
1456 typedef struct ntlmv2_blobhdr ntlmv2_blobhdr_t;
1457 
1458 /*
1459  * NTLMv2 name header structure, for names in a blob.
1460  */
1461 struct ntlmv2_namehdr {
1462 	uint16_t	type;
1463 	uint16_t	len;
1464 };
1465 typedef struct ntlmv2_namehdr ntlmv2_namehdr_t;
1466 
1467 #define	NAMETYPE_EOL		0x0000	/* end of list of names */
1468 #define	NAMETYPE_MACHINE_NB	0x0001	/* NetBIOS machine name */
1469 #define	NAMETYPE_DOMAIN_NB	0x0002	/* NetBIOS domain name */
1470 #define	NAMETYPE_MACHINE_DNS	0x0003	/* DNS machine name */
1471 #define	NAMETYPE_DOMAIN_DNS	0x0004	/* DNS Active Directory domain name */
1472 
1473 /*
1474  * Named pipe commands.
1475  */
1476 #define	TRANS_CALL_NAMED_PIPE		0x54	/* open/write/read/close pipe */
1477 #define	TRANS_WAIT_NAMED_PIPE		0x53	/* wait for pipe to be !busy */
1478 #define	TRANS_PEEK_NAMED_PIPE		0x23	/* read but don't remove data */
1479 #define	TRANS_Q_NAMED_PIPE_HAND_STATE	0x21	/* query pipe handle modes */
1480 #define	TRANS_SET_NAMED_PIPE_HAND_STATE	0x01	/* set pipe handle modes */
1481 #define	TRANS_Q_NAMED_PIPE_INFO		0x22	/* query pipe attributes */
1482 #define	TRANS_TRANSACT_NAMED_PIPE	0x26	/* r/w operation on pipe */
1483 #define	TRANS_READ_NAMED_PIPE		0x11	/* read pipe in "raw" mode */
1484 						/* (non message mode) */
1485 #define	TRANS_WRITE_NAMED_PIPE		0x31	/* write pipe "raw" mode */
1486 						/* (non message mode) */
1487 
1488 /*
1489  * Share types, visible via NetShareEnum
1490  */
1491 #define	STYPE_DISKTREE			0x00000000
1492 #define	STYPE_PRINTQ			0x00000001
1493 #define	STYPE_DEVICE			0x00000002
1494 #define	STYPE_IPC			0x00000003
1495 #define	STYPE_UNKNOWN			0x00000004
1496 #define	STYPE_MASK			0x0000000F
1497 #define	STYPE_TEMPORARY			0x40000000
1498 #define	STYPE_HIDDEN			0x80000000
1499 
1500 #endif /* _NETSMB_SMB_H_ */
1501