4 * Copyright (c) International Business Machines Corp., 2002
5 * Author(s): Steve French (sfrench@us.ibm.com)
7 * This library is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License as published
9 * by the Free Software Foundation; either version 2.1 of the License, or
10 * (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
15 * the GNU Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with this library; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 #define BAD_PROT CIFS_PROT+1
30 /* SMB command codes */
31 #define SMB_COM_CREATE_DIRECTORY 0x00
32 #define SMB_COM_DELETE_DIRECTORY 0x01
33 #define SMB_COM_CLOSE 0x04
34 #define SMB_COM_DELETE 0x06
35 #define SMB_COM_RENAME 0x07
36 #define SMB_COM_LOCKING_ANDX 0x24
37 #define SMB_COM_READ_ANDX 0x2E
38 #define SMB_COM_WRITE_ANDX 0x2F
39 #define SMB_COM_TRANSACTION2 0x32
40 #define SMB_COM_TRANSACTION2_SECONDARY 0x33
41 #define SMB_COM_FIND_CLOSE2 0x34
42 #define SMB_COM_TREE_DISCONNECT 0x71
43 #define SMB_COM_NEGOTIATE 0x72
44 #define SMB_COM_SESSION_SETUP_ANDX 0x73
45 #define SMB_COM_LOGOFF_ANDX 0x74
46 #define SMB_COM_TREE_CONNECT_ANDX 0x75
47 #define SMB_COM_NT_TRANSACT 0xA0
48 #define SMB_COM_NT_TRANSACT_SECONDARY 0xA1
49 #define SMB_COM_NT_CREATE_ANDX 0xA2
50 #define SMB_COM_NT_RENAME 0xA5
52 /* Transact2 subcommand codes */
53 #define TRANS2_OPEN 0x00
54 #define TRANS2_FIND_FIRST 0x01
55 #define TRANS2_FIND_NEXT 0x02
56 #define TRANS2_QUERY_FS_INFORMATION 0x03
57 #define TRANS2_QUERY_PATH_INFORMATION 0x05
58 #define TRANS2_SET_PATH_INFORMATION 0x06
59 #define TRANS2_QUERY_FILE_INFORMATION 0x07
60 #define TRANS2_SET_FILE_INFORMATION 0x08
61 #define TRANS2_GET_DFS_REFERRAL 0x10
62 #define TRANS2_REPORT_DFS_INCOSISTENCY 0x11
64 /* NT Transact subcommand codes */
65 #define NT_TRANSACT_CREATE 0x01
66 #define NT_TRANSACT_IOCTL 0x02
67 #define NT_TRANSACT_SET_SECURITY_DESC 0x03
68 #define NT_TRANSACT_NOTIFY_CHANGE 0x04
69 #define NT_TRANSACT_RENAME 0x05
70 #define NT_TRANSACT_QUERY_SECURITY_DESC 0x06
71 #define NT_TRANSACT_GET_USER_QUOTA 0x07
72 #define NT_TRANSACT_SET_USER_QUOTA 0x08
74 #define MAX_CIFS_HDR_SIZE 256 /* chained NTCreateXReadX will probably be biggest */
76 /* internal cifs vfs structures */
77 /*****************************************************************
78 * All constants go here
79 *****************************************************************
83 * Starting value for maximum SMB size negotiation
85 #define CIFS_MAX_MSGSIZE (4*4096)
88 * Size of encrypted user password in bytes
90 #define CIFS_ENCPWD_SIZE (16)
93 * Size of the crypto key returned on the negotiate SMB in bytes
95 #define CIFS_CRYPTO_KEY_SIZE (8)
98 * Size of the session key (crypto key encrypted with the password
100 #define CIFS_SESSION_KEY_SIZE (24)
103 * Maximum user name length
105 #define CIFS_UNLEN (20)
110 #define SMBOPEN_WRITE_THROUGH 0x4000
111 #define SMBOPEN_DENY_ALL 0x0010
112 #define SMBOPEN_DENY_WRITE 0x0020
113 #define SMBOPEN_DENY_READ 0x0030
114 #define SMBOPEN_DENY_NONE 0x0040
115 #define SMBOPEN_READ 0x0000
116 #define SMBOPEN_WRITE 0x0001
117 #define SMBOPEN_READWRITE 0x0002
118 #define SMBOPEN_EXECUTE 0x0003
120 #define SMBOPEN_OCREATE 0x0010
121 #define SMBOPEN_OTRUNC 0x0002
122 #define SMBOPEN_OAPPEND 0x0001
125 * SMB flag definitions
127 #define SMBFLG_EXTD_LOCK 0x01 /* server supports lock-read write-unlock primitives */
128 #define SMBFLG_RCV_POSTED 0x02 /* obsolete */
129 #define SMBFLG_RSVD 0x04
130 #define SMBFLG_CASELESS 0x08 /* all pathnames treated as caseless (off implies case sensitive file handling requested) */
131 #define SMBFLG_CANONICAL_PATH_FORMAT 0x10 /* obsolete */
132 #define SMBFLG_OLD_OPLOCK 0x20 /* obsolete */
133 #define SMBFLG_OLD_OPLOCK_NOTIFY 0x40 /* obsolete */
134 #define SMBFLG_RESPONSE 0x80 /* this PDU is a response from server */
137 * SMB flag2 definitions
139 #define SMBFLG2_KNOWS_LONG_NAMES 0x0001 /* can send long (non-8.3) path names in response */
140 #define SMBFLG2_KNOWS_EAS 0x0002
141 #define SMBFLG2_SECURITY_SIGNATURE 0x0004
142 #define SMBFLG2_IS_LONG_NAME 0x0040
143 #define SMBFLG2_EXT_SEC 0x0800
144 #define SMBFLG2_DFS 0x1000
145 #define SMBFLG2_PAGING_IO 0x2000
146 #define SMBFLG2_ERR_STATUS 0x4000
147 #define SMBFLG2_UNICODE 0x8000
150 * These are the file access permission bits defined in CIFS for the
151 * NTCreateAndX as well as the level 0x107
152 * TRANS2_QUERY_PATH_INFORMATION API. The level 0x107, SMB_QUERY_FILE_ALL_INFO
153 * responds with the AccessFlags.
154 * The AccessFlags specifies the access permissions a caller has to the
155 * file and can have any suitable combination of the following values:
158 #define FILE_READ_DATA 0x00000001 /* Data can be read from the file */
159 #define FILE_WRITE_DATA 0x00000002 /* Data can be written to the file */
160 #define FILE_APPEND_DATA 0x00000004 /* Data can be appended to the file */
161 #define FILE_READ_EA 0x00000008 /* Extended attributes associated */
162 /* with the file can be read */
163 #define FILE_WRITE_EA 0x00000010 /* Extended attributes associated */
164 /* with the file can be written */
165 #define FILE_EXECUTE 0x00000020 /*Data can be read into memory from */
166 /* the file using system paging I/O */
167 #define FILE_DELETE_CHILD 0x00000040
168 #define FILE_READ_ATTRIBUTES 0x00000080 /* Attributes associated with the */
169 /* file can be read */
170 #define FILE_WRITE_ATTRIBUTES 0x00000100 /* Attributes associated with the */
171 /* file can be written */
172 #define DELETE 0x00010000 /* The file can be deleted */
173 #define READ_CONTROL 0x00020000 /* The access control list and */
174 /* ownership associated with the */
175 /* file can be read */
176 #define WRITE_DAC 0x00040000 /* The access control list and */
177 /* ownership associated with the */
178 /* file can be written. */
179 #define WRITE_OWNER 0x00080000 /* Ownership information associated */
180 /* with the file can be written */
181 #define SYNCHRONIZE 0x00100000 /* The file handle can waited on to */
182 /* synchronize with the completion */
183 /* of an input/output request */
184 #define GENERIC_ALL 0x10000000
185 #define GENERIC_EXECUTE 0x20000000
186 #define GENERIC_WRITE 0x40000000
187 #define GENERIC_READ 0x80000000
188 /* In summary - Relevant file */
189 /* access flags from CIFS are */
190 /* file_read_data, file_write_data */
191 /* file_execute, file_read_attributes */
192 /* write_dac, and delete. */
195 * Invalid readdir handle
197 #define CIFS_NO_HANDLE 0xFFFF
200 #define CIFS_IPC_RESOURCE "\x49\x50\x43\x24"
202 /* IPC$ in Unicode */
203 #define CIFS_IPC_UNICODE_RESOURCE "\x00\x49\x00\x50\x00\x43\x00\x24\x00\x00"
205 /* Unicode Null terminate 2 bytes of 0 */
206 #define UNICODE_NULL "\x00\x00"
207 #define ASCII_NULL 0x00
210 * Server type values (returned on EnumServer API
212 #define CIFS_SV_TYPE_DC 0x00000008
213 #define CIFS_SV_TYPE_BACKDC 0x00000010
216 * Alias type flags (From EnumAlias API call
218 #define CIFS_ALIAS_TYPE_FILE 0x0001
219 #define CIFS_SHARE_TYPE_FILE 0x0000
222 * File Attribute flags
224 #define ATTR_READONLY 0x0001
225 #define ATTR_HIDDEN 0x0002
226 #define ATTR_SYSTEM 0x0004
227 #define ATTR_VOLUME 0x0008
228 #define ATTR_DIRECTORY 0x0010
229 #define ATTR_ARCHIVE 0x0020
230 #define ATTR_DEVICE 0x0040
231 #define ATTR_NORMAL 0x0080
232 #define ATTR_TEMPORARY 0x0100
233 #define ATTR_SPARSE 0x0200
234 #define ATTR_REPARSE 0x0400
235 #define ATTR_COMPRESSED 0x0800
236 #define ATTR_OFFLINE 0x1000 /* ie file not immediately available - offline storage */
237 #define ATTR_NOT_CONTENT_INDEXED 0x2000
238 #define ATTR_ENCRYPTED 0x4000
239 #define ATTR_POSIX_SEMANTICS 0x01000000
240 #define ATTR_BACKUP_SEMANTICS 0x02000000
241 #define ATTR_DELETE_ON_CLOSE 0x04000000
242 #define ATTR_SEQUENTIAL_SCAN 0x08000000
243 #define ATTR_RANDOM_ACCESS 0x10000000
244 #define ATTR_NO_BUFFERING 0x20000000
245 #define ATTR_WRITE_THROUGH 0x80000000
247 /* ShareAccess flags */
248 #define FILE_NO_SHARE 0x00000000
249 #define FILE_SHARE_READ 0x00000001
250 #define FILE_SHARE_WRITE 0x00000002
251 #define FILE_SHARE_DELETE 0x00000004
252 #define FILE_SHARE_ALL 0x00000007
254 /* CreateDisposition flags */
255 #define FILE_SUPERSEDE 0x00000000
256 #define FILE_OPEN 0x00000001
257 #define FILE_CREATE 0x00000002
258 #define FILE_OPEN_IF 0x00000003
259 #define FILE_OVERWRITE 0x00000004
260 #define FILE_OVERWRITE_IF 0x00000005
263 #define CREATE_NOT_FILE 0x00000001 /* if set must not be file */
264 #define CREATE_WRITE_THROUGH 0x00000002
265 #define CREATE_NOT_DIR 0x00000040 /* if set must not be directory */
266 #define CREATE_RANDOM_ACCESS 0x00000800
267 #define CREATE_DELETE_ON_CLOSE 0x00001000
268 #define OPEN_REPARSE_POINT 0x00200000
270 /* ImpersonationLevel flags */
271 #define SECURITY_ANONYMOUS 0
272 #define SECURITY_IDENTIFICATION 1
273 #define SECURITY_IMPERSONATION 2
274 #define SECURITY_DELEGATION 3
277 #define SECURITY_CONTEXT_TRACKING 0x01
278 #define SECURITY_EFFECTIVE_ONLY 0x02
281 * Default PID value, used in all SMBs where the PID is not important
283 #define CIFS_DFT_PID 0x1234
286 * We use the same routine for Copy and Move SMBs. This flag is used to
289 #define CIFS_COPY_OP 1
290 #define CIFS_RENAME_OP 2
292 #define GETU16(var) (*((__u16 *)var)) /* BB check for endian issues */
293 #define GETU32(var) (*((__u32 *)var)) /* BB check for endian issues */
298 __u32 smb_buf_length; /* big endian on wire *//* BB length is only two or three bytes - with one or two byte type preceding it but that is always zero - we could mask the type byte off just in case BB */
305 __u16 Error; /* note: treated as little endian (le) on wire */
307 __u32 CifsError; /* note: le */
310 __u16 Flags2; /* note: le */
311 __u16 PidHigh; /* note: le */
314 __u32 SequenceNumber; /* le */
315 __u32 Reserved; /* zero */
317 __u8 SecuritySignature[8]; /* le */
321 __u16 Pid; /* note: le */
326 /* given a pointer to an smb_hdr retrieve the value of byte count */
327 #define BCC(smb_var) ( *(__u16 *)((char *)smb_var + sizeof(struct smb_hdr) + (2* smb_var->WordCount) ) )
329 /* given a pointer to an smb_hdr retrieve the pointer to the byte area */
330 #define pByteArea(smb_var) ((char *)smb_var + sizeof(struct smb_hdr) + (2* smb_var->WordCount) + 2 )
333 * Computer Name Length
338 * Share Name Length @S8A
339 * Note: This length is limited by the SMB used to get @S8A
340 * the Share info. NetShareEnum only returns 13 @S8A
341 * chars, including the null termination. @S8A
343 #define SNLEN 12 /*@S8A */
348 #define MAXCOMMENTLEN 40
351 * The OS/2 maximum path name
353 #define MAX_PATHCONF 256
356 * SMB frame definitions (following must be packed structs)
357 * See the SNIA CIFS Specification for details.
359 * The Naming convention is the lower case version of the
360 * smb command code name for the struct and this is typedef to the
361 * uppercase version of the same name with the prefix SMB_ removed
362 * for brevity. Although typedefs are not commonly used for
363 * structure definitions in the Linux kernel, their use in the
364 * CIFS standards document, which this code is based on, may
365 * make this one of the cases where typedefs for structures make
366 * sense to improve readability for readers of the standards doc.
367 * Typedefs can always be removed later if they are too distracting
368 * and they are only used for the CIFSs PDUs themselves, not
369 * internal cifs vfs structures
373 typedef struct negotiate_req {
374 struct smb_hdr hdr; /* wct = 0 */
376 unsigned char DialectsArray[1];
379 typedef struct negotiate_rsp {
380 struct smb_hdr hdr; /* wct = 17 */
388 __u32 Capabilities; /* see below */
390 __u32 SystemTimeHigh;
391 __u16 ServerTimeZone;
392 __u8 EncryptionKeyLength;
395 unsigned char EncryptionKey[1]; /* if cap extended security is off */
396 /* followed by Domain name - if extended security is off */
397 /* followed by 16 bytes of server GUID */
398 /* followed by security blob if cap_extended_security negotiated */
400 unsigned char GUID[16];
401 unsigned char SecurityBlob[1];
406 /* SecurityMode bits */
407 #define SECMODE_USER 0x01 /* off indicates share level security */
408 #define SECMODE_PW_ENCRYPT 0x02
409 #define SECMODE_SIGN_ENABLED 0x04 /* SMB security signatures enabled */
410 #define SECMODE_SIGN_REQUIRED 0x08 /* SMB security signatures required */
412 /* Negotiate response Capabilities */
413 #define CAP_RAW_MODE 0x00000001
414 #define CAP_MPX_MODE 0x00000002
415 #define CAP_UNICODE 0x00000004
416 #define CAP_LARGE_FILES 0x00000008
417 #define CAP_NT_SMBS 0x00000010 /* implies CAP_NT_FIND */
418 #define CAP_RPC_REMOTE_APIS 0x00000020
419 #define CAP_STATUS32 0x00000040
420 #define CAP_LEVEL_II_OPLOCKS 0x00000080
421 #define CAP_LOCK_AND_READ 0x00000100
422 #define CAP_NT_FIND 0x00000200
423 #define CAP_DFS 0x00001000
424 #define CAP_INFOLEVEL_PASSTHRU 0x00002000
425 #define CAP_LARGE_READ_X 0x00004000
426 #define CAP_LARGE_WRITE_X 0x00008000
427 #define CAP_UNIX 0x00800000
428 #define CAP_RESERVED 0x02000000
429 #define CAP_BULK_TRANSFER 0x20000000
430 #define CAP_COMPRESSED_DATA 0x40000000
431 #define CAP_EXTENDED_SECURITY 0x80000000
433 typedef union smb_com_session_setup_andx {
434 struct { /* request format */
435 struct smb_hdr hdr; /* wct = 12 */
443 __u16 SecurityBlobLength;
445 __u32 Capabilities; /* see below */
447 unsigned char SecurityBlob[1]; /* followed by */
448 /* STRING NativeOS */
449 /* STRING NativeLanMan */
450 } req; /* NTLM request format (with extended security */
452 struct { /* request format */
453 struct smb_hdr hdr; /* wct = 13 */
461 __u16 CaseInsensitivePasswordLength; /* ASCII password length */
462 __u16 CaseSensitivePasswordLength; /* Unicode password length */
463 __u32 Reserved; /* see below */
466 unsigned char CaseInsensitivePassword[1]; /* followed by: */
467 /* unsigned char * CaseSensitivePassword; */
468 /* STRING AccountName */
469 /* STRING PrimaryDomain */
470 /* STRING NativeOS */
471 /* STRING NativeLanMan */
472 } req_no_secext; /* NTLM request format (without extended security */
474 struct { /* default (NTLM) response format */
475 struct smb_hdr hdr; /* wct = 4 */
479 __u16 Action; /* see below */
480 __u16 SecurityBlobLength;
482 unsigned char SecurityBlob[1]; /* followed by */
483 /* unsigned char * NativeOS; */
484 /* unsigned char * NativeLanMan; */
485 /* unsigned char * PrimaryDomain; */
486 } resp; /* NTLM response format (with or without extended security */
488 struct { /* request format */
489 struct smb_hdr hdr; /* wct = 10 */
497 __u16 PassswordLength;
500 unsigned char AccountPassword[1]; /* followed by */
501 /* STRING AccountName */
502 /* STRING PrimaryDomain */
503 /* STRING NativeOS */
504 /* STRING NativeLanMan */
505 } old_req; /* pre-NTLM (LANMAN2.1) request format */
507 struct { /* default (NTLM) response format */
508 struct smb_hdr hdr; /* wct = 3 */
512 __u16 Action; /* see below */
514 unsigned char NativeOS[1]; /* followed by */
515 /* unsigned char * NativeLanMan; */
516 /* unsigned char * PrimaryDomain; */
517 } old_resp; /* pre-NTLM (LANMAN2.1) response format */
518 } SESSION_SETUP_ANDX;
520 #define CIFS_NETWORK_OPSYS "CIFS VFS Client for Linux"
522 /* Capabilities bits (for NTLM SessSetup request) */
523 #define CAP_UNICODE 0x00000004
524 #define CAP_LARGE_FILES 0x00000008
525 #define CAP_NT_SMBS 0x00000010
526 #define CAP_STATUS32 0x00000040
527 #define CAP_LEVEL_II_OPLOCKS 0x00000080
528 #define CAP_NT_FIND 0x00000200 /* reserved should be zero (presumably because NT_SMBs implies the same thing) */
529 #define CAP_BULK_TRANSFER 0x20000000
530 #define CAP_EXTENDED_SECURITY 0x80000000
533 #define GUEST_LOGIN 1
535 typedef struct smb_com_tconx_req {
536 struct smb_hdr hdr; /* wct = 4 */
540 __u16 Flags; /* see below */
541 __u16 PasswordLength;
543 unsigned char Password[1]; /* followed by */
544 /* STRING Path *//* \\server\share name */
548 typedef struct smb_com_tconx_rsp {
549 struct smb_hdr hdr; /* wct = 3 *//* note that Win2000 has sent wct=7 in some cases on responses. Four unspecified words followed OptionalSupport */
553 __u16 OptionalSupport; /* see below */
555 unsigned char Service[1]; /* always ASCII, not Unicode */
556 /* STRING NativeFileSystem */
559 /* tree connect Flags */
560 #define DISCONNECT_TID 0x0001
561 #define TCON_EXTENDED_SECINFO 0x0008
562 /* OptionalSupport bits */
563 #define SMB_SUPPORT_SEARCH_BITS 0x0001 /* must have bits (exclusive searches suppt. */
564 #define SMB_SHARE_IS_IN_DFS 0x0002
566 typedef struct smb_com_logoff_andx_req {
568 struct smb_hdr hdr; /* wct = 2 */
575 typedef struct smb_com_logoff_andx_rsp {
576 struct smb_hdr hdr; /* wct = 2 */
583 typedef union smb_com_tree_disconnect { /* as an altetnative can use flag on tree_connect PDU to effect disconnect *//* probably the simplest SMB PDU */
585 struct smb_hdr hdr; /* wct = 0 */
586 __u16 ByteCount; /* bcc = 0 */
589 struct smb_hdr hdr; /* wct = 0 */
590 __u16 ByteCount; /* bcc = 0 */
594 typedef struct smb_com_close_req {
595 struct smb_hdr hdr; /* wct = 3 */
597 __u32 LastWriteTime; /* should be zero */
598 __u16 ByteCount; /* 0 */
601 typedef struct smb_com_close_rsp {
602 struct smb_hdr hdr; /* wct = 0 */
603 __u16 ByteCount; /* bct = 0 */
606 typedef struct smb_com_findclose_req {
607 struct smb_hdr hdr; /* wct = 1 */
609 __u16 ByteCount; /* 0 */
613 #define REQ_OPLOCK 0x00000002
614 #define REQ_BATCHOPLOCK 0x00000004
615 #define REQ_OPENDIRONLY 0x00000008
617 typedef struct smb_com_open_req { /* also handles create */
618 struct smb_hdr hdr; /* wct = 24 */
622 __u8 Reserved; /* Must Be Zero */
625 __u32 RootDirectoryFid;
627 __u64 AllocationSize;
628 __u32 FileAttributes;
630 __u32 CreateDisposition;
632 __u32 ImpersonationLevel;
638 /* open response: oplock levels */
639 #define OPLOCK_NONE 0
640 #define OPLOCK_EXCLUSIVE 1
641 #define OPLOCK_BATCH 2
642 #define OPLOCK_READ 3 /* level 2 oplock */
644 /* open response for CreateAction shifted left */
645 #define CIFS_CREATE_ACTION 0x20000 /* file created */
647 typedef struct smb_com_open_rsp {
648 struct smb_hdr hdr; /* wct = 34 BB */
656 __u64 LastAccessTime;
659 __u32 FileAttributes;
660 __u64 AllocationSize;
665 __u16 ByteCount; /* bct = 0 */
668 typedef struct smb_com_write_req {
669 struct smb_hdr hdr; /* wct = 14 */
678 __u16 DataLengthHigh;
683 __u8 Pad; /* BB check for whether padded to DWORD boundary and optimum performance here */
687 typedef struct smb_com_write_rsp {
688 struct smb_hdr hdr; /* wct = 6 */
698 typedef struct smb_com_read_req {
699 struct smb_hdr hdr; /* wct = 12 */
706 __u16 MinCount; /* obsolete */
713 typedef struct smb_com_read_rsp {
714 struct smb_hdr hdr; /* wct = 12 */
719 __u16 DataCompactionMode;
723 __u16 DataLengthHigh;
726 __u8 Pad; /* BB check for whether padded to DWORD boundary and optimum performance here */
730 typedef struct locking_andx_range {
737 } LOCKING_ANDX_RANGE;
739 #define LOCKING_ANDX_SHARED_LOCK 0x01
740 #define LOCKING_ANDX_OPLOCK_RELEASE 0x02
741 #define LOCKING_ANDX_CHANGE_LOCKTYPE 0x04
742 #define LOCKING_ANDX_CANCEL_LOCK 0x08
743 #define LOCKING_ANDX_LARGE_FILES 0x10 /* always on for us */
745 typedef struct smb_com_lock_req {
746 struct smb_hdr hdr; /* wct = 8 */
754 __u16 NumberOfUnlocks;
757 LOCKING_ANDX_RANGE Locks[1];
760 typedef struct smb_com_lock_rsp {
761 struct smb_hdr hdr; /* wct = 2 */
768 typedef struct smb_com_rename_req {
769 struct smb_hdr hdr; /* wct = 1 */
770 __u16 SearchAttributes; /* target file attributes */
772 __u8 BufferFormat; /* 4 = ASCII or Unicode */
773 unsigned char OldFileName[1];
774 /* followed by __u8 BufferFormat2 */
775 /* followed by NewFileName */
778 #define CREATE_HARD_LINK 0x103
779 #define MOVEFILE_COPY_ALLOWED 0x0002
780 #define MOVEFILE_REPLACE_EXISTING 0x0001
782 typedef struct smb_com_nt_rename_req { /* A5 - also used for create hardlink */
783 struct smb_hdr hdr; /* wct = 4 */
784 __u16 SearchAttributes; /* target file attributes */
785 __u16 Flags; /* spec says Information Level */
788 __u8 BufferFormat; /* 4 = ASCII or Unicode */
789 unsigned char OldFileName[1];
790 /* followed by __u8 BufferFormat2 */
791 /* followed by NewFileName */
794 typedef struct smb_com_rename_rsp {
795 struct smb_hdr hdr; /* wct = 0 */
796 __u16 ByteCount; /* bct = 0 */
799 typedef struct smb_com_delete_file_req {
800 struct smb_hdr hdr; /* wct = 1 */
801 __u16 SearchAttributes;
803 __u8 BufferFormat; /* 4 = ASCII */
804 unsigned char fileName[1];
807 typedef struct smb_com_delete_file_rsp {
808 struct smb_hdr hdr; /* wct = 0 */
809 __u16 ByteCount; /* bct = 0 */
812 typedef struct smb_com_delete_directory_req {
813 struct smb_hdr hdr; /* wct = 0 */
815 __u8 BufferFormat; /* 4 = ASCII */
816 unsigned char DirName[1];
817 } DELETE_DIRECTORY_REQ;
819 typedef struct smb_com_delete_directory_rsp {
820 struct smb_hdr hdr; /* wct = 0 */
821 __u16 ByteCount; /* bct = 0 */
822 } DELETE_DIRECTORY_RSP;
824 typedef struct smb_com_create_directory_req {
825 struct smb_hdr hdr; /* wct = 0 */
827 __u8 BufferFormat; /* 4 = ASCII */
828 unsigned char DirName[1];
829 } CREATE_DIRECTORY_REQ;
831 typedef struct smb_com_create_directory_rsp {
832 struct smb_hdr hdr; /* wct = 0 */
833 __u16 ByteCount; /* bct = 0 */
834 } CREATE_DIRECTORY_RSP;
836 typedef struct smb_com_transaction_ioctl_req {
837 struct smb_hdr hdr; /* wct = 23 */
840 __u32 TotalParameterCount;
841 __u32 TotalDataCount;
842 __u32 MaxParameterCount;
844 __u32 ParameterCount;
845 __u32 ParameterOffset;
848 __u8 SetupCount; /* four setup words follow subcommand */
849 /* SNIA spec incorrectly included spurious pad here */
850 __u16 SubCommand;/* 2 = IOCTL/FSCTL */
853 __u8 IsFsctl; /* 1 = File System Control, 0 = device control (IOCTL)*/
854 __u8 IsRootFlag; /* 1 = apply command to root of share (must be DFS share)*/
858 } TRANSACT_IOCTL_REQ;
860 typedef struct smb_com_transaction_ioctl_rsp {
861 struct smb_hdr hdr; /* wct = 19 */
863 __u32 TotalParameterCount;
864 __u32 TotalDataCount;
865 __u32 ParameterCount;
866 __u32 ParameterOffset;
867 __u32 ParameterDisplacement;
870 __u32 DataDisplacement;
871 __u8 SetupCount; /* 1 */
872 __u16 ReturnedDataLen;
875 } TRANSACT_IOCTL_RSP;
877 typedef struct smb_com_transaction_change_notify_req {
878 struct smb_hdr hdr; /* wct = 23 */
881 __u32 TotalParameterCount;
882 __u32 TotalDataCount;
883 __u32 MaxParameterCount;
885 __u32 ParameterCount;
886 __u32 ParameterOffset;
889 __u8 SetupCount; /* four setup words follow subcommand */
890 /* SNIA spec incorrectly included spurious pad here */
891 __u16 SubCommand;/* 4 = Change Notify */
892 __u32 CompletionFilter; /* operation to monitor */
894 __u8 WatchTree; /* 1 = Monitor subdirectories */
898 } TRANSACT_CHANGE_NOTIFY_REQ;
900 /* Completion Filter flags */
901 #define FILE_NOTIFY_CHANGE_FILE_NAME 0x00000001
902 #define FILE_NOTIFY_CHANGE_DIR_NAME 0x00000002
903 #define FILE_NOTIFY_CHANGE_NAME 0x00000003
904 #define FILE_NOTIFY_CHANGE_ATTRIBUTES 0x00000004
905 #define FILE_NOTIFY_CHANGE_SIZE 0x00000008
906 #define FILE_NOTIFY_CHANGE_LAST_WRITE 0x00000010
907 #define FILE_NOTIFY_CHANGE_LAST_ACCESS 0x00000020
908 #define FILE_NOTIFY_CHANGE_CREATION 0x00000040
909 #define FILE_NOTIFY_CHANGE_EA 0x00000080
910 #define FILE_NOTIFY_CHANGE_SECURITY 0x00000100
911 #define FILE_NOTIFY_CHANGE_STREAM_NAME 0x00000200
912 #define FILE_NOTIFY_CHANGE_STREAM_SIZE 0x00000400
913 #define FILE_NOTIFY_CHANGE_STREAM_WRITE 0x00000800
915 /* response contains array of the following structures */
916 struct file_notify_information {
917 __u32 NextEntryOffset;
919 __u32 FileNameLength;
923 struct reparse_data {
925 __u16 ReparseDataLength;
929 __u16 TargetNameOffset;
931 char LinkNamesBuf[1];
934 struct cifs_quota_data {
935 __u32 rsrvd1; /* 0 */
937 __u64 rsrvd2; /* 0 */
941 char sid[1]; /* variable size? */
944 /* quota sub commands */
945 #define QUOTA_LIST_CONTINUE 0
946 #define QUOTA_LIST_START 0x100
947 #define QUOTA_FOR_SID 0x101
949 typedef union smb_com_transaction2 {
951 struct smb_hdr hdr; /* wct = 14+ */
952 __u16 TotalParameterCount;
953 __u16 TotalDataCount;
954 __u16 MaxParameterCount;
961 __u16 ParameterCount;
962 __u16 ParameterOffset;
967 __u16 SubCommand; /* 1st setup word - can be followed by SetupCount words */
968 __u16 ByteCount; /* careful - setupcount is not always one */
971 struct smb_hdr hdr; /* wct = 0 */
972 __u16 TotalParameterCount;
973 __u16 TotalDataCount;
975 __u16 ParameterCount;
976 __u16 ParamterOffset;
977 __u16 ParameterDisplacement;
980 __u16 DataDisplacement;
982 __u8 Reserved1; /* should be zero setup words following */
984 __u16 Reserved2; /* parameter word reserved - present for infolevels > 100 */
985 /* data area follows */
989 /* PathInfo/FileInfo infolevels */
990 #define SMB_INFO_STANDARD 1
991 #define SMB_INFO_IS_NAME_VALID 6
992 #define SMB_QUERY_FILE_BASIC_INFO 0x101
993 #define SMB_QUERY_FILE_STANDARD_INFO 0x102
994 #define SMB_QUERY_FILE_NAME_INFO 0x104
995 #define SMB_QUERY_FILE_ALLOCATION_INFO 0x105
996 #define SMB_QUERY_FILE_END_OF_FILEINFO 0x106
997 #define SMB_QUERY_FILE_ALL_INFO 0x107
998 #define SMB_QUERY_ALT_NAME_INFO 0x108
999 #define SMB_QUERY_FILE_STREAM_INFO 0x109
1000 #define SMB_QUERY_FILE_COMPRESSION_INFO 0x10B
1001 #define SMB_QUERY_FILE_UNIX_BASIC 0x200
1002 #define SMB_QUERY_FILE_UNIX_LINK 0x201
1004 #define SMB_SET_FILE_BASIC_INFO 0x101
1005 #define SMB_SET_FILE_DISPOSITION_INFO 0x102
1006 #define SMB_SET_FILE_ALLOCATION_INFO 0x103
1007 #define SMB_SET_FILE_END_OF_FILE_INFO 0x104
1008 #define SMB_SET_FILE_UNIX_BASIC 0x200
1009 #define SMB_SET_FILE_UNIX_LINK 0x201
1010 #define SMB_SET_FILE_UNIX_HLINK 0x203
1011 #define SMB_SET_FILE_BASIC_INFO2 0x3ec
1012 #define SMB_SET_FILE_RENAME_INFORMATION 0x3f2
1013 #define SMB_SET_FILE_ALLOCATION_INFO2 0x3fb
1014 #define SMB_SET_FILE_END_OF_FILE_INFO2 0x3fc
1016 /* Find File infolevels */
1017 #define SMB_FIND_FILE_DIRECTORY_INFO 0x101
1018 #define SMB_FIND_FILE_FULL_DIRECTORY_INFO 0x102
1019 #define SMB_FIND_FILE_NAMES_INFO 0x103
1020 #define SMB_FIND_FILE_BOTH_DIRECTORY_INFO 0x104
1021 #define SMB_FIND_FILE_UNIX 0x202
1023 typedef struct smb_com_transaction2_qpi_req {
1024 struct smb_hdr hdr; /* wct = 14+ */
1025 __u16 TotalParameterCount;
1026 __u16 TotalDataCount;
1027 __u16 MaxParameterCount;
1034 __u16 ParameterCount;
1035 __u16 ParameterOffset;
1040 __u16 SubCommand; /* one setup word */
1043 __u16 InformationLevel;
1046 } TRANSACTION2_QPI_REQ;
1048 typedef struct smb_com_transaction2_qpi_rsp {
1049 struct smb_hdr hdr; /* wct = 10 + SetupCount */
1050 __u16 TotalParameterCount;
1051 __u16 TotalDataCount;
1053 __u16 ParameterCount;
1054 __u16 ParameterOffset;
1055 __u16 ParameterDisplacement;
1058 __u16 DataDisplacement;
1060 __u8 Reserved1; /* should be zero setup words following */
1062 __u16 Reserved2; /* parameter word reserved - present for infolevels > 100 */
1063 } TRANSACTION2_QPI_RSP;
1065 typedef struct smb_com_transaction2_spi_req {
1066 struct smb_hdr hdr; /* wct = 15 */
1067 __u16 TotalParameterCount;
1068 __u16 TotalDataCount;
1069 __u16 MaxParameterCount;
1076 __u16 ParameterCount;
1077 __u16 ParameterOffset;
1082 __u16 SubCommand; /* one setup word */
1086 __u16 InformationLevel;
1089 } TRANSACTION2_SPI_REQ;
1091 typedef struct smb_com_transaction2_spi_rsp {
1092 struct smb_hdr hdr; /* wct = 10 + SetupCount */
1093 __u16 TotalParameterCount;
1094 __u16 TotalDataCount;
1096 __u16 ParameterCount;
1097 __u16 ParameterOffset;
1098 __u16 ParameterDisplacement;
1101 __u16 DataDisplacement;
1103 __u8 Reserved1; /* should be zero setup words following */
1105 __u16 Reserved2; /* parameter word reserved - present for infolevels > 100 */
1106 } TRANSACTION2_SPI_RSP;
1108 struct set_file_rename {
1109 __u32 overwrite; /* 1 = overwrite dest */
1110 __u32 root_fid; /* zero */
1111 __u32 target_name_len;
1112 char target_name[0]; /* Must be unicode */
1115 struct smb_com_transaction2_sfi_req {
1116 struct smb_hdr hdr; /* wct = 15 */
1117 __u16 TotalParameterCount;
1118 __u16 TotalDataCount;
1119 __u16 MaxParameterCount;
1126 __u16 ParameterCount;
1127 __u16 ParameterOffset;
1132 __u16 SubCommand; /* one setup word */
1137 __u16 InformationLevel;
1141 struct smb_com_transaction2_sfi_rsp {
1142 struct smb_hdr hdr; /* wct = 10 + SetupCount */
1143 __u16 TotalParameterCount;
1144 __u16 TotalDataCount;
1146 __u16 ParameterCount;
1147 __u16 ParameterOffset;
1148 __u16 ParameterDisplacement;
1151 __u16 DataDisplacement;
1153 __u8 Reserved1; /* should be zero setup words following */
1155 __u16 Reserved2; /* parameter word reserved - present for infolevels > 100 */
1160 * Flags on T2 FINDFIRST and FINDNEXT
1162 #define CIFS_SEARCH_CLOSE_ALWAYS 0x0001
1163 #define CIFS_SEARCH_CLOSE_AT_END 0x0002
1164 #define CIFS_SEARCH_RETURN_RESUME 0x0004
1165 #define CIFS_SEARCH_CONTINUE_FROM_LAST 0x0008
1166 #define CIFS_SEARCH_BACKUP_SEARCH 0x0010
1169 * Size of the resume key on FINDFIRST and FINDNEXT calls
1171 #define CIFS_SMB_RESUME_KEY_SIZE 4
1173 typedef struct smb_com_transaction2_ffirst_req {
1174 struct smb_hdr hdr; /* wct = 15 */
1175 __u16 TotalParameterCount;
1176 __u16 TotalDataCount;
1177 __u16 MaxParameterCount;
1184 __u16 ParameterCount;
1185 __u16 ParameterOffset;
1188 __u8 SetupCount; /* one */
1190 __u16 SubCommand; /* TRANS2_FIND_FIRST */
1193 __u16 SearchAttributes;
1196 __u16 InformationLevel;
1197 __u32 SearchStorageType;
1199 } TRANSACTION2_FFIRST_REQ;
1201 typedef struct smb_com_transaction2_ffirst_rsp {
1202 struct smb_hdr hdr; /* wct = 10 */
1203 __u16 TotalParameterCount;
1204 __u16 TotalDataCount;
1206 __u16 ParameterCount;
1207 __u16 ParameterOffset;
1208 __u16 ParameterDisplacement;
1211 __u16 DataDisplacement;
1213 __u8 Reserved1; /* should be zero setup words following */
1215 } TRANSACTION2_FFIRST_RSP;
1217 typedef struct smb_com_transaction2_ffirst_rsp_parms {
1221 __u16 EAErrorOffset;
1222 __u16 LastNameOffset;
1223 } T2_FFIRST_RSP_PARMS;
1225 typedef struct smb_com_transaction2_fnext_req {
1226 struct smb_hdr hdr; /* wct = 15 */
1227 __u16 TotalParameterCount;
1228 __u16 TotalDataCount;
1229 __u16 MaxParameterCount;
1236 __u16 ParameterCount;
1237 __u16 ParameterOffset;
1240 __u8 SetupCount; /* one */
1242 __u16 SubCommand; /* TRANS2_FIND_NEXT */
1247 __u16 InformationLevel;
1250 char ResumeFileName[1];
1251 } TRANSACTION2_FNEXT_REQ;
1253 typedef struct smb_com_transaction2_fnext_rsp {
1254 struct smb_hdr hdr; /* wct = 10 */
1255 __u16 TotalParameterCount;
1256 __u16 TotalDataCount;
1258 __u16 ParameterCount;
1259 __u16 ParameterOffset;
1260 __u16 ParameterDisplacement;
1263 __u16 DataDisplacement;
1265 __u8 Reserved1; /* should be zero setup words following */
1267 } TRANSACTION2_FNEXT_RSP;
1269 typedef struct smb_com_transaction2_fnext_rsp_parms {
1272 __u16 EAErrorOffset;
1273 __u16 LastNameOffset;
1274 } T2_FNEXT_RSP_PARMS;
1276 #define SMB_INFO_ALLOCATION 1
1277 #define SMB_INFO_VOLUME 2
1278 #define SMB_QUERY_FS_VOLUME_INFO 0x102
1279 #define SMB_QUERY_FS_SIZE_INFO 0x103
1280 #define SMB_QUERY_FS_DEVICE_INFO 0x104
1281 #define SMB_QUERY_FS_ATTRIBUTE_INFO 0x105
1282 #define SMB_QUERY_CIFS_UNIX_INFO 0x200
1284 typedef struct smb_com_transaction2_qfsi_req {
1285 struct smb_hdr hdr; /* wct = 14+ */
1286 __u16 TotalParameterCount;
1287 __u16 TotalDataCount;
1288 __u16 MaxParameterCount;
1295 __u16 ParameterCount;
1296 __u16 ParameterOffset;
1301 __u16 SubCommand; /* one setup word */
1304 __u16 InformationLevel;
1305 } TRANSACTION2_QFSI_REQ;
1307 typedef struct smb_com_transaction_qfsi_rsp {
1308 struct smb_hdr hdr; /* wct = 10 + SetupCount */
1309 __u16 TotalParameterCount;
1310 __u16 TotalDataCount;
1312 __u16 ParameterCount;
1313 __u16 ParameterOffset;
1314 __u16 ParameterDisplacement;
1317 __u16 DataDisplacement;
1319 __u8 Reserved1; /* should be zero setup words following */
1321 __u8 Pad; /* may be three bytes *//* followed by data area */
1322 } TRANSACTION2_QFSI_RSP;
1324 typedef struct smb_com_transaction2_get_dfs_refer_req {
1325 struct smb_hdr hdr; /* wct = 15 */
1326 __u16 TotalParameterCount;
1327 __u16 TotalDataCount;
1328 __u16 MaxParameterCount;
1335 __u16 ParameterCount;
1336 __u16 ParameterOffset;
1341 __u16 SubCommand; /* one setup word */
1343 __u8 Pad[3]; /* Win2K has sent 0x0F01 (max resp length perhaps?) followed by one byte pad - doesn't seem to matter though */
1344 __u16 MaxReferralLevel;
1345 char RequestFileName[1];
1346 } TRANSACTION2_GET_DFS_REFER_REQ;
1348 typedef struct dfs_referral_level_3 {
1349 __u16 VersionNumber;
1351 __u16 ServerType; /* 0x0001 = CIFS server */
1352 __u16 ReferralFlags; /* or proximity - not clear which since always set to zero - SNIA spec says 0x01 means strip off PathConsumed chars before submitting RequestFileName to remote node */
1355 __u16 DfsPathOffset;
1356 __u16 DfsAlternatePathOffset;
1357 __u16 NetworkAddressOffset;
1360 typedef struct smb_com_transaction_get_dfs_refer_rsp {
1361 struct smb_hdr hdr; /* wct = 10 */
1362 __u16 TotalParameterCount;
1363 __u16 TotalDataCount;
1365 __u16 ParameterCount;
1366 __u16 ParameterOffset;
1367 __u16 ParameterDisplacement;
1370 __u16 DataDisplacement;
1372 __u8 Reserved1; /* zero setup words following */
1376 __u16 NumberOfReferrals;
1379 REFERRAL3 referrals[1]; /* array of level 3 dfs_referral structures */
1380 /* followed by the strings pointed to by the referral structures */
1381 } TRANSACTION2_GET_DFS_REFER_RSP;
1384 #define DFSREF_REFERRAL_SERVER 0x0001
1385 #define DFSREF_STORAGE_SERVER 0x0002
1387 /* IOCTL information */
1388 /* List of ioctl function codes that look to be of interest to remote clients like this. */
1389 /* Need to do some experimentation to make sure they all work remotely. */
1390 /* Some of the following such as the encryption/compression ones would be */
1391 /* invoked from tools via a specialized hook into the VFS rather than via the */
1392 /* standard vfs entry points */
1393 #define FSCTL_REQUEST_OPLOCK_LEVEL_1 0x00090000
1394 #define FSCTL_REQUEST_OPLOCK_LEVEL_2 0x00090004
1395 #define FSCTL_REQUEST_BATCH_OPLOCK 0x00090008
1396 #define FSCTL_LOCK_VOLUME 0x00090018
1397 #define FSCTL_UNLOCK_VOLUME 0x0009001C
1398 #define FSCTL_GET_COMPRESSION 0x0009003C
1399 #define FSCTL_SET_COMPRESSION 0x0009C040
1400 #define FSCTL_REQUEST_FILTER_OPLOCK 0x0009008C
1401 #define FSCTL_FILESYS_GET_STATISTICS 0x00090090
1402 #define FSCTL_SET_REPARSE_POINT 0x000900A4
1403 #define FSCTL_GET_REPARSE_POINT 0x000900A8
1404 #define FSCTL_DELETE_REPARSE_POINT 0x000900AC
1405 #define FSCTL_SET_SPARSE 0x000900C4
1406 #define FSCTL_SET_ZERO_DATA 0x000900C8
1407 #define FSCTL_SET_ENCRYPTION 0x000900D7
1408 #define FSCTL_ENCRYPTION_FSCTL_IO 0x000900DB
1409 #define FSCTL_WRITE_RAW_ENCRYPTED 0x000900DF
1410 #define FSCTL_READ_RAW_ENCRYPTED 0x000900E3
1411 #define FSCTL_SIS_COPYFILE 0x00090100
1412 #define FSCTL_SIS_LINK_FILES 0x0009C104
1414 #define IO_REPARSE_TAG_MOUNT_POINT 0xA0000003
1415 #define IO_REPARSE_TAG_HSM 0xC0000004
1416 #define IO_REPARSE_TAG_SIS 0x80000007
1419 ************************************************************************
1420 * All structs for everything above the SMB PDUs themselves
1421 * (such as the T2 level specific data) go here
1422 ************************************************************************
1426 * Information on a server
1431 unsigned char versionMajor;
1432 unsigned char versionMinor;
1434 unsigned int commentOffset;
1438 * The following structure is the format of the data returned on a NetShareEnum
1439 * with level "90" (x5A)
1445 unsigned short type;
1446 unsigned int commentOffset;
1452 unsigned int commentOffset;
1453 unsigned char type[2];
1456 struct aliasInfo92 {
1457 int aliasNameOffset;
1458 int serverNameOffset;
1459 int shareNameOffset;
1463 __u64 TotalAllocationUnits;
1464 __u64 FreeAllocationUnits;
1465 __u32 SectorsPerAllocationUnit;
1466 __u32 BytesPerSector;
1467 } FILE_SYSTEM_INFO; /* size info, level 0x103 */
1470 __u16 MajorVersionNumber;
1471 __u16 MinorVersionNumber;
1473 } FILE_SYSTEM_UNIX_INFO; /* Unix extensions info, level 0x200 */
1474 /* Linux/Unix extensions capability flags */
1475 #define CIFS_UNIX_FCNTL_CAP 0x00000001 /* support for fcntl locks */
1476 #define CIFS_UNIX_POSIX_ACL_CAP 0x00000002
1478 /* DeviceType Flags */
1479 #define FILE_DEVICE_CD_ROM 0x00000002
1480 #define FILE_DEVICE_CD_ROM_FILE_SYSTEM 0x00000003
1481 #define FILE_DEVICE_DFS 0x00000006
1482 #define FILE_DEVICE_DISK 0x00000007
1483 #define FILE_DEVICE_DISK_FILE_SYSTEM 0x00000008
1484 #define FILE_DEVICE_FILE_SYSTEM 0x00000009
1485 #define FILE_DEVICE_NAMED_PIPE 0x00000011
1486 #define FILE_DEVICE_NETWORK 0x00000012
1487 #define FILE_DEVICE_NETWORK_FILE_SYSTEM 0x00000014
1488 #define FILE_DEVICE_NULL 0x00000015
1489 #define FILE_DEVICE_PARALLEL_PORT 0x00000016
1490 #define FILE_DEVICE_PRINTER 0x00000018
1491 #define FILE_DEVICE_SERIAL_PORT 0x0000001b
1492 #define FILE_DEVICE_STREAMS 0x0000001e
1493 #define FILE_DEVICE_TAPE 0x0000001f
1494 #define FILE_DEVICE_TAPE_FILE_SYSTEM 0x00000020
1495 #define FILE_DEVICE_VIRTUAL_DISK 0x00000024
1496 #define FILE_DEVICE_NETWORK_REDIRECTOR 0x00000028
1500 __u32 DeviceCharacteristics;
1501 } FILE_SYSTEM_DEVICE_INFO; /* device info, level 0x104 */
1505 __u32 MaxPathNameComponentLength;
1506 __u32 FileSystemNameLen;
1507 char FileSystemName[52]; /* do not really need to save this - so potentially get only subset of name */
1508 } FILE_SYSTEM_ATTRIBUTE_INFO;
1510 typedef struct { /* data block encoding of response to level 263 QPathInfo */
1512 __u64 LastAccessTime;
1513 __u64 LastWriteTime;
1517 __u64 AllocationSize;
1518 __u64 EndOfFile; /* size ie offset to first free byte in file */
1519 __u32 NumberOfLinks; /* hard links */
1527 __u64 CurrentByteOffset;
1529 __u32 AlignmentRequirement;
1530 __u32 FileNameLength;
1532 } FILE_ALL_INFO; /* level 263 QPathInfo */
1537 __u64 LastStatusChange; /*SNIA spec says DCE time for the three time fields */
1538 __u64 LastAccessTime;
1539 __u64 LastModificationTime;
1548 } FILE_UNIX_BASIC_INFO; /* level 512 QPathInfo */
1552 } FILE_UNIX_LINK_INFO; /* level 513 QPathInfo */
1554 /* defines for enumerating possible values of the Unix type field below */
1557 #define UNIX_SYMLINK 2
1558 #define UNIX_CHARDEV 3
1559 #define UNIX_BLOCKDEV 4
1561 #define UNIX_SOCKET 6
1564 __u32 NextEntryOffset;
1568 __u64 LastStatusChange; /*SNIA spec says DCE time for the three time fields */
1569 __u64 LastAccessTime;
1570 __u64 LastModificationTime;
1584 __u64 LastAccessTime;
1585 __u64 LastWriteTime;
1589 } FILE_BASIC_INFO; /* size info, level 0x101 */
1591 struct file_allocation_info {
1592 __u64 AllocationSize;
1593 }; /* size info, level 0x103 */
1595 struct file_end_of_file_info {
1596 __u64 FileSize; /* offset to end of file */
1597 }; /* size info, level 0x104 */
1600 __u32 NextEntryOffset;
1603 __u64 LastAccessTime;
1604 __u64 LastWriteTime;
1607 __u64 AllocationSize;
1608 __u32 ExtFileAttributes;
1609 __u32 FileNameLength;
1611 } FILE_DIRECTORY_INFO; /* level 257 FF response data area */
1614 unsigned char cbName;
1619 unsigned long cbList;
1625 unsigned char cbName;
1626 unsigned short cbValue;
1629 /* flags for _FEA.fEA */
1630 #define FEA_NEEDEA 0x80 /* need EA bit */
1633 unsigned long cbList;
1637 /* used to hold an arbitrary blob of data */
1641 void (*free) (struct data_blob * data_blob);
1644 #pragma pack() /* resume default structure packing */
1646 #endif /* _CIFSPDU_H */