26 #include <asm/unaligned.h>
29 #ifdef CONFIG_CIFS_WEAK_PW_HASH
31 #define LANMAN2_PROT 1
36 #define POSIX_PROT (CIFS_PROT+1)
37 #define BAD_PROT 0xFFFF
44 #define SMB_COM_CREATE_DIRECTORY 0x00
45 #define SMB_COM_DELETE_DIRECTORY 0x01
46 #define SMB_COM_CLOSE 0x04
47 #define SMB_COM_FLUSH 0x05
48 #define SMB_COM_DELETE 0x06
49 #define SMB_COM_RENAME 0x07
50 #define SMB_COM_QUERY_INFORMATION 0x08
51 #define SMB_COM_SETATTR 0x09
52 #define SMB_COM_LOCKING_ANDX 0x24
53 #define SMB_COM_COPY 0x29
54 #define SMB_COM_ECHO 0x2B
55 #define SMB_COM_OPEN_ANDX 0x2D
56 #define SMB_COM_READ_ANDX 0x2E
57 #define SMB_COM_WRITE_ANDX 0x2F
58 #define SMB_COM_TRANSACTION2 0x32
59 #define SMB_COM_TRANSACTION2_SECONDARY 0x33
60 #define SMB_COM_FIND_CLOSE2 0x34
61 #define SMB_COM_TREE_DISCONNECT 0x71
62 #define SMB_COM_NEGOTIATE 0x72
63 #define SMB_COM_SESSION_SETUP_ANDX 0x73
64 #define SMB_COM_LOGOFF_ANDX 0x74
65 #define SMB_COM_TREE_CONNECT_ANDX 0x75
66 #define SMB_COM_NT_TRANSACT 0xA0
67 #define SMB_COM_NT_TRANSACT_SECONDARY 0xA1
68 #define SMB_COM_NT_CREATE_ANDX 0xA2
69 #define SMB_COM_NT_CANCEL 0xA4
70 #define SMB_COM_NT_RENAME 0xA5
73 #define TRANS2_OPEN 0x00
74 #define TRANS2_FIND_FIRST 0x01
75 #define TRANS2_FIND_NEXT 0x02
76 #define TRANS2_QUERY_FS_INFORMATION 0x03
77 #define TRANS2_SET_FS_INFORMATION 0x04
78 #define TRANS2_QUERY_PATH_INFORMATION 0x05
79 #define TRANS2_SET_PATH_INFORMATION 0x06
80 #define TRANS2_QUERY_FILE_INFORMATION 0x07
81 #define TRANS2_SET_FILE_INFORMATION 0x08
82 #define TRANS2_GET_DFS_REFERRAL 0x10
83 #define TRANS2_REPORT_DFS_INCOSISTENCY 0x11
86 #define TRANS_SET_NMPIPE_STATE 0x0001
87 #define TRANS_RAW_READ_NMPIPE 0x0011
88 #define TRANS_QUERY_NMPIPE_STATE 0x0021
89 #define TRANS_QUERY_NMPIPE_INFO 0x0022
90 #define TRANS_PEEK_NMPIPE 0x0023
91 #define TRANS_TRANSACT_NMPIPE 0x0026
92 #define TRANS_RAW_WRITE_NMPIPE 0x0031
93 #define TRANS_READ_NMPIPE 0x0036
94 #define TRANS_WRITE_NMPIPE 0x0037
95 #define TRANS_WAIT_NMPIPE 0x0053
96 #define TRANS_CALL_NMPIPE 0x0054
99 #define NT_TRANSACT_CREATE 0x01
100 #define NT_TRANSACT_IOCTL 0x02
101 #define NT_TRANSACT_SET_SECURITY_DESC 0x03
102 #define NT_TRANSACT_NOTIFY_CHANGE 0x04
103 #define NT_TRANSACT_RENAME 0x05
104 #define NT_TRANSACT_QUERY_SECURITY_DESC 0x06
105 #define NT_TRANSACT_GET_USER_QUOTA 0x07
106 #define NT_TRANSACT_SET_USER_QUOTA 0x08
108 #define MAX_CIFS_SMALL_BUFFER_SIZE 448
111 #define MAX_CIFS_HDR_SIZE 0x58
112 #define CIFS_SMALL_PATH 120
123 #define CIFS_MAX_MSGSIZE (4*4096)
128 #define CIFS_ENCPWD_SIZE (16)
133 #define CIFS_CRYPTO_KEY_SIZE (8)
138 #define CIFS_AUTH_RESP_SIZE (24)
143 #define CIFS_SESS_KEY_SIZE (16)
145 #define CIFS_CLIENT_CHALLENGE_SIZE (8)
146 #define CIFS_SERVER_CHALLENGE_SIZE (8)
147 #define CIFS_HMAC_MD5_HASH_SIZE (16)
148 #define CIFS_CPHTXT_SIZE (16)
149 #define CIFS_NTHASH_SIZE (16)
154 #define CIFS_UNLEN (20)
159 #define SMBOPEN_WRITE_THROUGH 0x4000
160 #define SMBOPEN_DENY_ALL 0x0010
161 #define SMBOPEN_DENY_WRITE 0x0020
162 #define SMBOPEN_DENY_READ 0x0030
163 #define SMBOPEN_DENY_NONE 0x0040
164 #define SMBOPEN_READ 0x0000
165 #define SMBOPEN_WRITE 0x0001
166 #define SMBOPEN_READWRITE 0x0002
167 #define SMBOPEN_EXECUTE 0x0003
169 #define SMBOPEN_OCREATE 0x0010
170 #define SMBOPEN_OTRUNC 0x0002
171 #define SMBOPEN_OAPPEND 0x0001
176 #define SMBFLG_EXTD_LOCK 0x01
177 #define SMBFLG_RCV_POSTED 0x02
178 #define SMBFLG_RSVD 0x04
179 #define SMBFLG_CASELESS 0x08
181 #define SMBFLG_CANONICAL_PATH_FORMAT 0x10
182 #define SMBFLG_OLD_OPLOCK 0x20
183 #define SMBFLG_OLD_OPLOCK_NOTIFY 0x40
184 #define SMBFLG_RESPONSE 0x80
189 #define SMBFLG2_KNOWS_LONG_NAMES cpu_to_le16(1)
191 #define SMBFLG2_KNOWS_EAS cpu_to_le16(2)
192 #define SMBFLG2_SECURITY_SIGNATURE cpu_to_le16(4)
193 #define SMBFLG2_COMPRESSED (8)
194 #define SMBFLG2_SECURITY_SIGNATURE_REQUIRED (0x10)
195 #define SMBFLG2_IS_LONG_NAME cpu_to_le16(0x40)
196 #define SMBFLG2_REPARSE_PATH (0x400)
197 #define SMBFLG2_EXT_SEC cpu_to_le16(0x800)
198 #define SMBFLG2_DFS cpu_to_le16(0x1000)
199 #define SMBFLG2_PAGING_IO cpu_to_le16(0x2000)
200 #define SMBFLG2_ERR_STATUS cpu_to_le16(0x4000)
201 #define SMBFLG2_UNICODE cpu_to_le16(0x8000)
212 #define FILE_READ_DATA 0x00000001
213 #define FILE_WRITE_DATA 0x00000002
214 #define FILE_APPEND_DATA 0x00000004
215 #define FILE_READ_EA 0x00000008
217 #define FILE_WRITE_EA 0x00000010
219 #define FILE_EXECUTE 0x00000020
221 #define FILE_DELETE_CHILD 0x00000040
222 #define FILE_READ_ATTRIBUTES 0x00000080
224 #define FILE_WRITE_ATTRIBUTES 0x00000100
226 #define DELETE 0x00010000
227 #define READ_CONTROL 0x00020000
230 #define WRITE_DAC 0x00040000
233 #define WRITE_OWNER 0x00080000
235 #define SYNCHRONIZE 0x00100000
238 #define GENERIC_ALL 0x10000000
239 #define GENERIC_EXECUTE 0x20000000
240 #define GENERIC_WRITE 0x40000000
241 #define GENERIC_READ 0x80000000
248 #define FILE_READ_RIGHTS (FILE_READ_DATA | FILE_READ_EA | FILE_READ_ATTRIBUTES)
249 #define FILE_WRITE_RIGHTS (FILE_WRITE_DATA | FILE_APPEND_DATA \
250 | FILE_WRITE_EA | FILE_WRITE_ATTRIBUTES)
251 #define FILE_EXEC_RIGHTS (FILE_EXECUTE)
253 #define SET_FILE_READ_RIGHTS (FILE_READ_DATA | FILE_READ_EA | FILE_WRITE_EA \
254 | FILE_READ_ATTRIBUTES \
255 | FILE_WRITE_ATTRIBUTES \
256 | DELETE | READ_CONTROL | WRITE_DAC \
257 | WRITE_OWNER | SYNCHRONIZE)
258 #define SET_FILE_WRITE_RIGHTS (FILE_WRITE_DATA | FILE_APPEND_DATA \
259 | FILE_READ_EA | FILE_WRITE_EA \
260 | FILE_DELETE_CHILD | FILE_READ_ATTRIBUTES \
261 | FILE_WRITE_ATTRIBUTES \
262 | DELETE | READ_CONTROL | WRITE_DAC \
263 | WRITE_OWNER | SYNCHRONIZE)
264 #define SET_FILE_EXEC_RIGHTS (FILE_READ_EA | FILE_WRITE_EA | FILE_EXECUTE \
265 | FILE_READ_ATTRIBUTES \
266 | FILE_WRITE_ATTRIBUTES \
267 | DELETE | READ_CONTROL | WRITE_DAC \
268 | WRITE_OWNER | SYNCHRONIZE)
270 #define SET_MINIMUM_RIGHTS (FILE_READ_EA | FILE_READ_ATTRIBUTES \
271 | READ_CONTROL | SYNCHRONIZE)
277 #define CIFS_NO_HANDLE 0xFFFF
279 #define NO_CHANGE_64 0xFFFFFFFFFFFFFFFFULL
280 #define NO_CHANGE_32 0xFFFFFFFFUL
283 #define CIFS_IPC_RESOURCE "\x49\x50\x43\x24"
286 #define CIFS_IPC_UNICODE_RESOURCE "\x00\x49\x00\x50\x00\x43\x00\x24\x00\x00"
289 #define UNICODE_NULL "\x00\x00"
290 #define ASCII_NULL 0x00
295 #define CIFS_SV_TYPE_DC 0x00000008
296 #define CIFS_SV_TYPE_BACKDC 0x00000010
301 #define CIFS_ALIAS_TYPE_FILE 0x0001
302 #define CIFS_SHARE_TYPE_FILE 0x0000
307 #define ATTR_READONLY 0x0001
308 #define ATTR_HIDDEN 0x0002
309 #define ATTR_SYSTEM 0x0004
310 #define ATTR_VOLUME 0x0008
311 #define ATTR_DIRECTORY 0x0010
312 #define ATTR_ARCHIVE 0x0020
313 #define ATTR_DEVICE 0x0040
314 #define ATTR_NORMAL 0x0080
315 #define ATTR_TEMPORARY 0x0100
316 #define ATTR_SPARSE 0x0200
317 #define ATTR_REPARSE 0x0400
318 #define ATTR_COMPRESSED 0x0800
319 #define ATTR_OFFLINE 0x1000
321 #define ATTR_NOT_CONTENT_INDEXED 0x2000
322 #define ATTR_ENCRYPTED 0x4000
323 #define ATTR_POSIX_SEMANTICS 0x01000000
324 #define ATTR_BACKUP_SEMANTICS 0x02000000
325 #define ATTR_DELETE_ON_CLOSE 0x04000000
326 #define ATTR_SEQUENTIAL_SCAN 0x08000000
327 #define ATTR_RANDOM_ACCESS 0x10000000
328 #define ATTR_NO_BUFFERING 0x20000000
329 #define ATTR_WRITE_THROUGH 0x80000000
332 #define FILE_NO_SHARE 0x00000000
333 #define FILE_SHARE_READ 0x00000001
334 #define FILE_SHARE_WRITE 0x00000002
335 #define FILE_SHARE_DELETE 0x00000004
336 #define FILE_SHARE_ALL 0x00000007
339 #define FILE_SUPERSEDE 0x00000000
340 #define FILE_OPEN 0x00000001
341 #define FILE_CREATE 0x00000002
342 #define FILE_OPEN_IF 0x00000003
343 #define FILE_OVERWRITE 0x00000004
344 #define FILE_OVERWRITE_IF 0x00000005
347 #define CREATE_NOT_FILE 0x00000001
348 #define CREATE_WRITE_THROUGH 0x00000002
349 #define CREATE_SEQUENTIAL 0x00000004
350 #define CREATE_NO_BUFFER 0x00000008
351 #define CREATE_SYNC_ALERT 0x00000010
352 #define CREATE_ASYNC_ALERT 0x00000020
353 #define CREATE_NOT_DIR 0x00000040
354 #define CREATE_TREE_CONNECTION 0x00000080
355 #define CREATE_COMPLETE_IF_OPLK 0x00000100
356 #define CREATE_NO_EA_KNOWLEDGE 0x00000200
357 #define CREATE_EIGHT_DOT_THREE 0x00000400
360 #define CREATE_OPEN_FOR_RECOVERY 0x00000400
361 #define CREATE_RANDOM_ACCESS 0x00000800
362 #define CREATE_DELETE_ON_CLOSE 0x00001000
363 #define CREATE_OPEN_BY_ID 0x00002000
364 #define CREATE_OPEN_BACKUP_INTENT 0x00004000
365 #define CREATE_NO_COMPRESSION 0x00008000
366 #define CREATE_RESERVE_OPFILTER 0x00100000
367 #define OPEN_REPARSE_POINT 0x00200000
368 #define OPEN_NO_RECALL 0x00400000
369 #define OPEN_FREE_SPACE_QUERY 0x00800000
370 #define CREATE_OPTIONS_MASK 0x007FFFFF
371 #define CREATE_OPTION_READONLY 0x10000000
372 #define CREATE_OPTION_SPECIAL 0x20000000
375 #define SECURITY_ANONYMOUS 0
376 #define SECURITY_IDENTIFICATION 1
377 #define SECURITY_IMPERSONATION 2
378 #define SECURITY_DELEGATION 3
381 #define SECURITY_CONTEXT_TRACKING 0x01
382 #define SECURITY_EFFECTIVE_ONLY 0x02
387 #define CIFS_DFT_PID 0x1234
393 #define CIFS_COPY_OP 1
394 #define CIFS_RENAME_OP 2
396 #define GETU16(var) (*((__u16 *)var))
397 #define GETU32(var) (*((__u32 *)var))
435 return (
void *)smb +
sizeof(*smb) + 2 * smb->WordCount;
439 #define pByteArea(smb_var) (BCC(smb_var) + 2)
447 return get_unaligned_le16(bc_ptr);
456 put_unaligned_le16(count, bc_ptr);
477 #define MAXCOMMENTLEN 40
482 #define MAX_PATHCONF 256
510 #define MIN_TZ_ADJ (15 * 60)
532 #define READ_RAW_ENABLE 1
533 #define WRITE_RAW_ENABLE 2
534 #define RAW_ENABLE (READ_RAW_ENABLE | WRITE_RAW_ENABLE)
552 unsigned char EncryptionKey[1];
557 unsigned char GUID[16];
564 #define SECMODE_USER 0x01
565 #define SECMODE_PW_ENCRYPT 0x02
566 #define SECMODE_SIGN_ENABLED 0x04
567 #define SECMODE_SIGN_REQUIRED 0x08
570 #define CAP_RAW_MODE 0x00000001
571 #define CAP_MPX_MODE 0x00000002
572 #define CAP_UNICODE 0x00000004
573 #define CAP_LARGE_FILES 0x00000008
574 #define CAP_NT_SMBS 0x00000010
575 #define CAP_RPC_REMOTE_APIS 0x00000020
576 #define CAP_STATUS32 0x00000040
577 #define CAP_LEVEL_II_OPLOCKS 0x00000080
578 #define CAP_LOCK_AND_READ 0x00000100
579 #define CAP_NT_FIND 0x00000200
580 #define CAP_DFS 0x00001000
581 #define CAP_INFOLEVEL_PASSTHRU 0x00002000
582 #define CAP_LARGE_READ_X 0x00004000
583 #define CAP_LARGE_WRITE_X 0x00008000
584 #define CAP_LWIO 0x00010000
585 #define CAP_UNIX 0x00800000
586 #define CAP_COMPRESSED_DATA 0x02000000
587 #define CAP_DYNAMIC_REAUTH 0x20000000
588 #define CAP_PERSISTENT_HANDLES 0x40000000
589 #define CAP_EXTENDED_SECURITY 0x80000000
683 #define NTLMSSP_SERVER_TYPE 1
684 #define NTLMSSP_DOMAIN_TYPE 2
685 #define NTLMSSP_FQ_DOMAIN_TYPE 3
686 #define NTLMSSP_DNS_DOMAIN_TYPE 4
687 #define NTLMSSP_DNS_PARENT_TYPE 5
706 #define CIFS_NETWORK_OPSYS "CIFS VFS Client for Linux"
709 #define CAP_UNICODE 0x00000004
710 #define CAP_LARGE_FILES 0x00000008
711 #define CAP_NT_SMBS 0x00000010
712 #define CAP_STATUS32 0x00000040
713 #define CAP_LEVEL_II_OPLOCKS 0x00000080
714 #define CAP_NT_FIND 0x00000200
716 #define CAP_BULK_TRANSFER 0x20000000
717 #define CAP_EXTENDED_SECURITY 0x80000000
720 #define GUEST_LOGIN 1
761 #define DISCONNECT_TID 0x0001
762 #define TCON_EXTENDED_SIGNATURES 0x0004
763 #define TCON_EXTENDED_SECINFO 0x0008
766 #define SMB_SUPPORT_SEARCH_BITS 0x0001
768 #define SMB_SHARE_IS_IN_DFS 0x0002
769 #define SMB_CSC_MASK 0x000C
771 #define SMB_CSC_CACHE_MANUAL_REINT 0x0000
772 #define SMB_CSC_CACHE_AUTO_REINT 0x0004
773 #define SMB_CSC_CACHE_VDO 0x0008
774 #define SMB_CSC_NO_CACHING 0x000C
775 #define SMB_UNIQUE_FILE_NAME 0x0010
776 #define SMB_EXTENDED_SIGNATURES 0x0020
856 #define REQ_MORE_INFO 0x00000001
857 #define REQ_OPLOCK 0x00000002
858 #define REQ_BATCHOPLOCK 0x00000004
859 #define REQ_OPENDIRONLY 0x00000008
860 #define REQ_EXTENDED_INFO 0x00000010
863 #define DISK_TYPE 0x0000
864 #define BYTE_PIPE_TYPE 0x0001
865 #define MESSAGE_PIPE_TYPE 0x0002
866 #define PRINTER_TYPE 0x0003
867 #define COMM_DEV_TYPE 0x0004
868 #define UNKNOWN_TYPE 0xFFFF
871 #define NO_EAS 0x0001
872 #define NO_SUBSTREAMS 0x0002
873 #define NO_REPARSETAG 0x0004
875 #define ICOUNT_MASK 0x00FF
876 #define PIPE_READ_MODE 0x0100
877 #define NAMED_PIPE_TYPE 0x0400
878 #define PIPE_END_POINT 0x4000
879 #define BLOCKING_NAMED_PIPE 0x8000
903 #define OPLOCK_NONE 0
904 #define OPLOCK_EXCLUSIVE 1
905 #define OPLOCK_BATCH 2
906 #define OPLOCK_READ 3
909 #define CIFS_CREATE_ACTION 0x20000
1104 #define LOCKING_ANDX_SHARED_LOCK 0x01
1105 #define LOCKING_ANDX_OPLOCK_RELEASE 0x02
1106 #define LOCKING_ANDX_CHANGE_LOCKTYPE 0x04
1107 #define LOCKING_ANDX_CANCEL_LOCK 0x08
1108 #define LOCKING_ANDX_LARGE_FILES 0x10
1126 #define CIFS_RDLCK 0
1127 #define CIFS_WRLCK 1
1128 #define CIFS_UNLCK 2
1157 #define COPY_MUST_BE_FILE 0x0001
1158 #define COPY_MUST_BE_DIR 0x0002
1159 #define COPY_TARGET_MODE_ASCII 0x0004
1160 #define COPY_SOURCE_MODE_ASCII 0x0008
1161 #define COPY_VERIFY_WRITES 0x0010
1162 #define COPY_TREE 0x0020
1184 #define CREATE_HARD_LINK 0x103
1185 #define MOVEFILE_COPY_ALLOWED 0x0002
1186 #define MOVEFILE_REPLACE_EXISTING 0x0001
1359 #define CIFS_ACL_OWNER 1
1360 #define CIFS_ACL_GROUP 2
1361 #define CIFS_ACL_DACL 4
1362 #define CIFS_ACL_SACL 8
1451 #define FILE_NOTIFY_CHANGE_FILE_NAME 0x00000001
1452 #define FILE_NOTIFY_CHANGE_DIR_NAME 0x00000002
1453 #define FILE_NOTIFY_CHANGE_NAME 0x00000003
1454 #define FILE_NOTIFY_CHANGE_ATTRIBUTES 0x00000004
1455 #define FILE_NOTIFY_CHANGE_SIZE 0x00000008
1456 #define FILE_NOTIFY_CHANGE_LAST_WRITE 0x00000010
1457 #define FILE_NOTIFY_CHANGE_LAST_ACCESS 0x00000020
1458 #define FILE_NOTIFY_CHANGE_CREATION 0x00000040
1459 #define FILE_NOTIFY_CHANGE_EA 0x00000080
1460 #define FILE_NOTIFY_CHANGE_SECURITY 0x00000100
1461 #define FILE_NOTIFY_CHANGE_STREAM_NAME 0x00000200
1462 #define FILE_NOTIFY_CHANGE_STREAM_SIZE 0x00000400
1463 #define FILE_NOTIFY_CHANGE_STREAM_WRITE 0x00000800
1465 #define FILE_ACTION_ADDED 0x00000001
1466 #define FILE_ACTION_REMOVED 0x00000002
1467 #define FILE_ACTION_MODIFIED 0x00000003
1468 #define FILE_ACTION_RENAMED_OLD_NAME 0x00000004
1469 #define FILE_ACTION_RENAMED_NEW_NAME 0x00000005
1470 #define FILE_ACTION_ADDED_STREAM 0x00000006
1471 #define FILE_ACTION_REMOVED_STREAM 0x00000007
1472 #define FILE_ACTION_MODIFIED_STREAM 0x00000008
1504 #define QUOTA_LIST_CONTINUE 0
1505 #define QUOTA_LIST_START 0x100
1506 #define QUOTA_FOR_SID 0x101
1559 #define SMB_INFO_STANDARD 1
1560 #define SMB_SET_FILE_EA 2
1561 #define SMB_QUERY_FILE_EA_SIZE 2
1562 #define SMB_INFO_QUERY_EAS_FROM_LIST 3
1563 #define SMB_INFO_QUERY_ALL_EAS 4
1564 #define SMB_INFO_IS_NAME_VALID 6
1565 #define SMB_QUERY_FILE_BASIC_INFO 0x101
1566 #define SMB_QUERY_FILE_STANDARD_INFO 0x102
1567 #define SMB_QUERY_FILE_EA_INFO 0x103
1568 #define SMB_QUERY_FILE_NAME_INFO 0x104
1569 #define SMB_QUERY_FILE_ALLOCATION_INFO 0x105
1570 #define SMB_QUERY_FILE_END_OF_FILEINFO 0x106
1571 #define SMB_QUERY_FILE_ALL_INFO 0x107
1572 #define SMB_QUERY_ALT_NAME_INFO 0x108
1573 #define SMB_QUERY_FILE_STREAM_INFO 0x109
1574 #define SMB_QUERY_FILE_COMPRESSION_INFO 0x10B
1575 #define SMB_QUERY_FILE_UNIX_BASIC 0x200
1576 #define SMB_QUERY_FILE_UNIX_LINK 0x201
1577 #define SMB_QUERY_POSIX_ACL 0x204
1578 #define SMB_QUERY_XATTR 0x205
1579 #define SMB_QUERY_ATTR_FLAGS 0x206
1580 #define SMB_QUERY_POSIX_PERMISSION 0x207
1581 #define SMB_QUERY_POSIX_LOCK 0x208
1584 #define SMB_QUERY_FILE__UNIX_INFO2 0x20b
1585 #define SMB_QUERY_FILE_INTERNAL_INFO 0x3ee
1586 #define SMB_QUERY_FILE_ACCESS_INFO 0x3f0
1587 #define SMB_QUERY_FILE_NAME_INFO2 0x3f1
1588 #define SMB_QUERY_FILE_POSITION_INFO 0x3f6
1589 #define SMB_QUERY_FILE_MODE_INFO 0x3f8
1590 #define SMB_QUERY_FILE_ALGN_INFO 0x3f9
1593 #define SMB_SET_FILE_BASIC_INFO 0x101
1594 #define SMB_SET_FILE_DISPOSITION_INFO 0x102
1595 #define SMB_SET_FILE_ALLOCATION_INFO 0x103
1596 #define SMB_SET_FILE_END_OF_FILE_INFO 0x104
1597 #define SMB_SET_FILE_UNIX_BASIC 0x200
1598 #define SMB_SET_FILE_UNIX_LINK 0x201
1599 #define SMB_SET_FILE_UNIX_HLINK 0x203
1600 #define SMB_SET_POSIX_ACL 0x204
1601 #define SMB_SET_XATTR 0x205
1602 #define SMB_SET_ATTR_FLAGS 0x206
1603 #define SMB_SET_POSIX_LOCK 0x208
1604 #define SMB_POSIX_OPEN 0x209
1605 #define SMB_POSIX_UNLINK 0x20a
1606 #define SMB_SET_FILE_UNIX_INFO2 0x20b
1607 #define SMB_SET_FILE_BASIC_INFO2 0x3ec
1608 #define SMB_SET_FILE_RENAME_INFORMATION 0x3f2
1609 #define SMB_FILE_ALL_INFO2 0x3fa
1610 #define SMB_SET_FILE_ALLOCATION_INFO2 0x3fb
1611 #define SMB_SET_FILE_END_OF_FILE_INFO2 0x3fc
1612 #define SMB_FILE_MOVE_CLUSTER_INFO 0x407
1613 #define SMB_FILE_QUOTA_INFO 0x408
1614 #define SMB_FILE_REPARSEPOINT_INFO 0x409
1615 #define SMB_FILE_MAXIMUM_INFO 0x40d
1618 #define SMB_FIND_FILE_INFO_STANDARD 0x001
1619 #define SMB_FIND_FILE_QUERY_EA_SIZE 0x002
1620 #define SMB_FIND_FILE_QUERY_EAS_FROM_LIST 0x003
1621 #define SMB_FIND_FILE_DIRECTORY_INFO 0x101
1622 #define SMB_FIND_FILE_FULL_DIRECTORY_INFO 0x102
1623 #define SMB_FIND_FILE_NAMES_INFO 0x103
1624 #define SMB_FIND_FILE_BOTH_DIRECTORY_INFO 0x104
1625 #define SMB_FIND_FILE_ID_FULL_DIR_INFO 0x105
1626 #define SMB_FIND_FILE_ID_BOTH_DIR_INFO 0x106
1627 #define SMB_FIND_FILE_UNIX 0x202
1754 #define CIFS_SEARCH_CLOSE_ALWAYS 0x0001
1755 #define CIFS_SEARCH_CLOSE_AT_END 0x0002
1756 #define CIFS_SEARCH_RETURN_RESUME 0x0004
1757 #define CIFS_SEARCH_CONTINUE_FROM_LAST 0x0008
1758 #define CIFS_SEARCH_BACKUP_SEARCH 0x0010
1763 #define CIFS_SMB_RESUME_KEY_SIZE 4
1849 #define SMB_INFO_ALLOCATION 1
1850 #define SMB_INFO_VOLUME 2
1851 #define SMB_QUERY_FS_VOLUME_INFO 0x102
1852 #define SMB_QUERY_FS_SIZE_INFO 0x103
1853 #define SMB_QUERY_FS_DEVICE_INFO 0x104
1854 #define SMB_QUERY_FS_ATTRIBUTE_INFO 0x105
1855 #define SMB_QUERY_CIFS_UNIX_INFO 0x200
1856 #define SMB_QUERY_POSIX_FS_INFO 0x201
1857 #define SMB_QUERY_POSIX_WHO_AM_I 0x202
1858 #define SMB_REQUEST_TRANSPORT_ENCRYPTION 0x203
1859 #define SMB_QUERY_FS_PROXY 0x204
1864 #define SMB_QUERY_LABEL_INFO 0x3ea
1865 #define SMB_QUERY_FS_QUOTA_INFO 0x3ee
1866 #define SMB_QUERY_FS_FULL_SIZE_INFO 0x3ef
1867 #define SMB_QUERY_OBJECTID_INFO 0x3f0
1913 #define SMB_SET_CIFS_UNIX_INFO 0x200
2004 #define DFS_VERSION cpu_to_le16(0x0003)
2007 #define DFS_TYPE_LINK 0x0000
2008 #define DFS_TYPE_ROOT 0x0001
2011 #define DFS_NAME_LIST_REF 0x0200
2012 #define DFS_TARGET_SET_BOUNDARY 0x0400
2039 #define DFSREF_REFERRAL_SERVER 0x00000001
2040 #define DFSREF_STORAGE_SERVER 0x00000002
2041 #define DFSREF_TARGET_FAILBACK 0x00000004
2089 __le64 FreeAllocationUnits;
2090 __le32 SectorsPerAllocationUnit;
2096 __le32 SectorsPerAllocationUnit;
2097 __le32 TotalAllocationUnits;
2109 #define CIFS_UNIX_MAJOR_VERSION 1
2110 #define CIFS_UNIX_MINOR_VERSION 0
2113 #define CIFS_UNIX_FCNTL_CAP 0x00000001
2114 #define CIFS_UNIX_POSIX_ACL_CAP 0x00000002
2115 #define CIFS_UNIX_XATTR_CAP 0x00000004
2116 #define CIFS_UNIX_EXTATTR_CAP 0x00000008
2117 #define CIFS_UNIX_POSIX_PATHNAMES_CAP 0x00000010
2118 #define CIFS_UNIX_POSIX_PATH_OPS_CAP 0x00000020
2121 #define CIFS_UNIX_LARGE_READ_CAP 0x00000040
2123 #define CIFS_UNIX_LARGE_WRITE_CAP 0x00000080
2124 #define CIFS_UNIX_TRANSPORT_ENCRYPTION_CAP 0x00000100
2125 #define CIFS_UNIX_TRANSPORT_ENCRYPTION_MANDATORY_CAP 0x00000200
2126 #define CIFS_UNIX_PROXY_CAP 0x00000400
2128 #ifdef CONFIG_CIFS_POSIX
2135 #define CIFS_UNIX_CAP_MASK 0x000003db
2137 #define CIFS_UNIX_CAP_MASK 0x00000013
2141 #define CIFS_POSIX_EXTENSIONS 0x00000010
2166 #define FILE_DEVICE_CD_ROM 0x00000002
2167 #define FILE_DEVICE_CD_ROM_FILE_SYSTEM 0x00000003
2168 #define FILE_DEVICE_DFS 0x00000006
2169 #define FILE_DEVICE_DISK 0x00000007
2170 #define FILE_DEVICE_DISK_FILE_SYSTEM 0x00000008
2171 #define FILE_DEVICE_FILE_SYSTEM 0x00000009
2172 #define FILE_DEVICE_NAMED_PIPE 0x00000011
2173 #define FILE_DEVICE_NETWORK 0x00000012
2174 #define FILE_DEVICE_NETWORK_FILE_SYSTEM 0x00000014
2175 #define FILE_DEVICE_NULL 0x00000015
2176 #define FILE_DEVICE_PARALLEL_PORT 0x00000016
2177 #define FILE_DEVICE_PRINTER 0x00000018
2178 #define FILE_DEVICE_SERIAL_PORT 0x0000001b
2179 #define FILE_DEVICE_STREAMS 0x0000001e
2180 #define FILE_DEVICE_TAPE 0x0000001f
2181 #define FILE_DEVICE_TAPE_FILE_SYSTEM 0x00000020
2182 #define FILE_DEVICE_VIRTUAL_DISK 0x00000024
2183 #define FILE_DEVICE_NETWORK_REDIRECTOR 0x00000028
2194 char FileSystemName[52];
2217 __le64 CurrentByteOffset;
2227 #define UNIX_SYMLINK 2
2228 #define UNIX_CHARDEV 3
2229 #define UNIX_BLOCKDEV 4
2231 #define UNIX_SOCKET 6
2237 __le64 LastModificationTime;
2320 #define CIFS_ACL_VERSION 1
2352 #define SMB_O_RDONLY 0x1
2353 #define SMB_O_WRONLY 0x2
2354 #define SMB_O_RDWR 0x4
2355 #define SMB_O_CREAT 0x10
2356 #define SMB_O_EXCL 0x20
2357 #define SMB_O_TRUNC 0x40
2358 #define SMB_O_APPEND 0x80
2359 #define SMB_O_SYNC 0x100
2360 #define SMB_O_DIRECTORY 0x200
2361 #define SMB_O_NOFOLLOW 0x400
2362 #define SMB_O_DIRECT 0x800
2380 #define SMB_POSIX_UNLINK_FILE_TARGET 0
2381 #define SMB_POSIX_UNLINK_DIRECTORY_TARGET 1
2408 FILE_UNIX_BASIC_INFO basic;
2421 __le32 ExtFileAttributes;
2435 __le32 ExtFileAttributes;
2450 __le32 ExtFileAttributes;
2467 __le32 ExtFileAttributes;
2470 __u8 ShortNameLength;
2516 #define FEA_NEEDEA 0x80
2531 #ifdef CONFIG_CIFS_POSIX
2633 typedef struct file_xattr_info {
2635 __u32 xattr_name_len;
2636 __u32 xattr_value_len;
2644 #define EXT_SECURE_DELETE 0x00000001
2645 #define EXT_ENABLE_UNDELETE 0x00000002
2647 #define EXT_SYNCHRONOUS 0x00000008
2648 #define EXT_IMMUTABLE_FL 0x00000010
2649 #define EXT_OPEN_APPEND_ONLY 0x00000020
2650 #define EXT_DO_NOT_BACKUP 0x00000040
2651 #define EXT_NO_UPDATE_ATIME 0x00000080
2653 #define EXT_HASH_TREE_INDEXED_DIR 0x00001000
2655 #define EXT_JOURNAL_THIS_FILE 0x00004000
2657 #define EXT_SYNCHRONOUS_DIR 0x00010000
2658 #define EXT_TOPDIR 0x00020000
2660 #define EXT_SET_MASK 0x000300FF
2661 #define EXT_GET_MASK 0x0003DFFF
2663 typedef struct file_chattr_info {