|
12 | 12 | #ifndef _COMMON_SMB_FSCC_H |
13 | 13 | #define _COMMON_SMB_FSCC_H |
14 | 14 |
|
| 15 | +/* See MS-FSCC 2.4.8 */ |
| 16 | +typedef struct { |
| 17 | + __le32 NextEntryOffset; |
| 18 | + __u32 FileIndex; |
| 19 | + __le64 CreationTime; |
| 20 | + __le64 LastAccessTime; |
| 21 | + __le64 LastWriteTime; |
| 22 | + __le64 ChangeTime; |
| 23 | + __le64 EndOfFile; |
| 24 | + __le64 AllocationSize; |
| 25 | + __le32 ExtFileAttributes; |
| 26 | + __le32 FileNameLength; |
| 27 | + __le32 EaSize; /* length of the xattrs */ |
| 28 | + __u8 ShortNameLength; |
| 29 | + __u8 Reserved; |
| 30 | + __u8 ShortName[24]; |
| 31 | + char FileName[]; |
| 32 | +} __packed FILE_BOTH_DIRECTORY_INFO; /* level 0x104 FFrsp data */ |
| 33 | + |
| 34 | +/* See MS-FSCC 2.4.10 */ |
| 35 | +typedef struct { |
| 36 | + __le32 NextEntryOffset; |
| 37 | + __u32 FileIndex; |
| 38 | + __le64 CreationTime; |
| 39 | + __le64 LastAccessTime; |
| 40 | + __le64 LastWriteTime; |
| 41 | + __le64 ChangeTime; |
| 42 | + __le64 EndOfFile; |
| 43 | + __le64 AllocationSize; |
| 44 | + __le32 ExtFileAttributes; |
| 45 | + __le32 FileNameLength; |
| 46 | + char FileName[]; |
| 47 | +} __packed FILE_DIRECTORY_INFO; /* level 0x101 FF resp data */ |
| 48 | + |
| 49 | +/* See MS-FSCC 2.4.14 */ |
| 50 | +typedef struct { |
| 51 | + __le32 NextEntryOffset; |
| 52 | + __u32 FileIndex; |
| 53 | + __le64 CreationTime; |
| 54 | + __le64 LastAccessTime; |
| 55 | + __le64 LastWriteTime; |
| 56 | + __le64 ChangeTime; |
| 57 | + __le64 EndOfFile; |
| 58 | + __le64 AllocationSize; |
| 59 | + __le32 ExtFileAttributes; |
| 60 | + __le32 FileNameLength; |
| 61 | + __le32 EaSize; /* length of the xattrs */ |
| 62 | + char FileName[]; |
| 63 | +} __packed FILE_FULL_DIRECTORY_INFO; /* level 0x102 rsp data */ |
| 64 | + |
| 65 | +/* See MS-FSCC 2.4.24 */ |
| 66 | +typedef struct { |
| 67 | + __le32 NextEntryOffset; |
| 68 | + __u32 FileIndex; |
| 69 | + __le64 CreationTime; |
| 70 | + __le64 LastAccessTime; |
| 71 | + __le64 LastWriteTime; |
| 72 | + __le64 ChangeTime; |
| 73 | + __le64 EndOfFile; |
| 74 | + __le64 AllocationSize; |
| 75 | + __le32 ExtFileAttributes; |
| 76 | + __le32 FileNameLength; |
| 77 | + __le32 EaSize; /* EA size */ |
| 78 | + __le32 Reserved; |
| 79 | + __le64 UniqueId; /* inode num - le since Samba puts ino in low 32 bit*/ |
| 80 | + char FileName[]; |
| 81 | +} __packed FILE_ID_FULL_DIR_INFO; /* level 0x105 FF rsp data */ |
| 82 | + |
| 83 | +/* See MS-FSCC 2.4.34 */ |
| 84 | +struct smb2_file_network_open_info { |
| 85 | + struct_group_attr(network_open_info, __packed, |
| 86 | + __le64 CreationTime; |
| 87 | + __le64 LastAccessTime; |
| 88 | + __le64 LastWriteTime; |
| 89 | + __le64 ChangeTime; |
| 90 | + __le64 AllocationSize; |
| 91 | + __le64 EndOfFile; |
| 92 | + __le32 Attributes; |
| 93 | + ); |
| 94 | + __le32 Reserved; |
| 95 | +} __packed; /* level 34 Query also similar returned in close rsp and open rsp */ |
| 96 | + |
15 | 97 | /* List of FileSystemAttributes - see MS-FSCC 2.5.1 */ |
16 | 98 | #define FILE_SUPPORTS_SPARSE_VDL 0x10000000 /* faster nonsparse extend */ |
17 | 99 | #define FILE_SUPPORTS_BLOCK_REFCOUNTING 0x08000000 /* allow ioctl dup extents */ |
|
39 | 121 | #define FILE_CASE_PRESERVED_NAMES 0x00000002 |
40 | 122 | #define FILE_CASE_SENSITIVE_SEARCH 0x00000001 |
41 | 123 |
|
| 124 | +/* See MS-FSCC 2.5.10 */ |
| 125 | +typedef struct { |
| 126 | + __le32 DeviceType; |
| 127 | + __le32 DeviceCharacteristics; |
| 128 | +} __packed FILE_SYSTEM_DEVICE_INFO; /* device info level 0x104 */ |
| 129 | + |
| 130 | +/* |
| 131 | + * See POSIX Extensions to MS-FSCC 2.3.2.1 |
| 132 | + * Link: https://gitlab.com/samba-team/smb3-posix-spec/-/blob/master/fscc_posix_extensions.md |
| 133 | + */ |
| 134 | +typedef struct { |
| 135 | + /* For undefined recommended transfer size return -1 in that field */ |
| 136 | + __le32 OptimalTransferSize; /* bsize on some os, iosize on other os */ |
| 137 | + __le32 BlockSize; |
| 138 | + /* The next three fields are in terms of the block size. |
| 139 | + * (above). If block size is unknown, 4096 would be a |
| 140 | + * reasonable block size for a server to report. |
| 141 | + * Note that returning the blocks/blocksavail removes need |
| 142 | + * to make a second call (to QFSInfo level 0x103 to get this info. |
| 143 | + * UserBlockAvail is typically less than or equal to BlocksAvail, |
| 144 | + * if no distinction is made return the same value in each |
| 145 | + */ |
| 146 | + __le64 TotalBlocks; |
| 147 | + __le64 BlocksAvail; /* bfree */ |
| 148 | + __le64 UserBlocksAvail; /* bavail */ |
| 149 | + /* For undefined Node fields or FSID return -1 */ |
| 150 | + __le64 TotalFileNodes; |
| 151 | + __le64 FreeFileNodes; |
| 152 | + __le64 FileSysIdentifier; /* fsid */ |
| 153 | + /* NB Namelen comes from FILE_SYSTEM_ATTRIBUTE_INFO call */ |
| 154 | + /* NB flags can come from FILE_SYSTEM_DEVICE_INFO call */ |
| 155 | +} __packed FILE_SYSTEM_POSIX_INFO; |
| 156 | + |
42 | 157 | #endif /* _COMMON_SMB_FSCC_H */ |
0 commit comments