aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/smb2pdu.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/cifs/smb2pdu.h')
-rw-r--r--fs/cifs/smb2pdu.h61
1 files changed, 57 insertions, 4 deletions
diff --git a/fs/cifs/smb2pdu.h b/fs/cifs/smb2pdu.h
index b83d0118a757..f88320bbb477 100644
--- a/fs/cifs/smb2pdu.h
+++ b/fs/cifs/smb2pdu.h
@@ -122,6 +122,23 @@ struct smb2_pdu {
122 __le16 StructureSize2; /* size of wct area (varies, request specific) */ 122 __le16 StructureSize2; /* size of wct area (varies, request specific) */
123} __packed; 123} __packed;
124 124
125struct smb2_transform_hdr {
126 __be32 smb2_buf_length; /* big endian on wire */
127 /* length is only two or three bytes - with
128 one or two byte type preceding it that MBZ */
129 __u8 ProtocolId[4]; /* 0xFD 'S' 'M' 'B' */
130 __u8 Signature[16];
131 __u8 Nonce[11];
132 __u8 Reserved[5];
133 __le32 OriginalMessageSize;
134 __u16 Reserved1;
135 __le16 EncryptionAlgorithm;
136 __u64 SessionId;
137} __packed;
138
139/* Encryption Algorithms */
140#define SMB2_ENCRYPTION_AES128_CCM __constant_cpu_to_le16(0x0001)
141
125/* 142/*
126 * SMB2 flag definitions 143 * SMB2 flag definitions
127 */ 144 */
@@ -237,6 +254,7 @@ struct smb2_sess_setup_req {
237/* Currently defined SessionFlags */ 254/* Currently defined SessionFlags */
238#define SMB2_SESSION_FLAG_IS_GUEST 0x0001 255#define SMB2_SESSION_FLAG_IS_GUEST 0x0001
239#define SMB2_SESSION_FLAG_IS_NULL 0x0002 256#define SMB2_SESSION_FLAG_IS_NULL 0x0002
257#define SMB2_SESSION_FLAG_ENCRYPT_DATA 0x0004
240struct smb2_sess_setup_rsp { 258struct smb2_sess_setup_rsp {
241 struct smb2_hdr hdr; 259 struct smb2_hdr hdr;
242 __le16 StructureSize; /* Must be 9 */ 260 __le16 StructureSize; /* Must be 9 */
@@ -534,9 +552,16 @@ struct create_durable {
534 } Data; 552 } Data;
535} __packed; 553} __packed;
536 554
555#define COPY_CHUNK_RES_KEY_SIZE 24
556struct resume_key_req {
557 char ResumeKey[COPY_CHUNK_RES_KEY_SIZE];
558 __le32 ContextLength; /* MBZ */
559 char Context[0]; /* ignored, Windows sets to 4 bytes of zero */
560} __packed;
561
537/* this goes in the ioctl buffer when doing a copychunk request */ 562/* this goes in the ioctl buffer when doing a copychunk request */
538struct copychunk_ioctl { 563struct copychunk_ioctl {
539 char SourceKey[24]; 564 char SourceKey[COPY_CHUNK_RES_KEY_SIZE];
540 __le32 ChunkCount; /* we are only sending 1 */ 565 __le32 ChunkCount; /* we are only sending 1 */
541 __le32 Reserved; 566 __le32 Reserved;
542 /* array will only be one chunk long for us */ 567 /* array will only be one chunk long for us */
@@ -546,6 +571,12 @@ struct copychunk_ioctl {
546 __u32 Reserved2; 571 __u32 Reserved2;
547} __packed; 572} __packed;
548 573
574struct copychunk_ioctl_rsp {
575 __le32 ChunksWritten;
576 __le32 ChunkBytesWritten;
577 __le32 TotalBytesWritten;
578} __packed;
579
549/* Response and Request are the same format */ 580/* Response and Request are the same format */
550struct validate_negotiate_info { 581struct validate_negotiate_info {
551 __le32 Capabilities; 582 __le32 Capabilities;
@@ -569,6 +600,10 @@ struct network_interface_info_ioctl_rsp {
569 600
570#define NO_FILE_ID 0xFFFFFFFFFFFFFFFFULL /* general ioctls to srv not to file */ 601#define NO_FILE_ID 0xFFFFFFFFFFFFFFFFULL /* general ioctls to srv not to file */
571 602
603struct compress_ioctl {
604 __le16 CompressionState; /* See cifspdu.h for possible flag values */
605} __packed;
606
572struct smb2_ioctl_req { 607struct smb2_ioctl_req {
573 struct smb2_hdr hdr; 608 struct smb2_hdr hdr;
574 __le16 StructureSize; /* Must be 57 */ 609 __le16 StructureSize; /* Must be 57 */
@@ -584,7 +619,7 @@ struct smb2_ioctl_req {
584 __le32 MaxOutputResponse; 619 __le32 MaxOutputResponse;
585 __le32 Flags; 620 __le32 Flags;
586 __u32 Reserved2; 621 __u32 Reserved2;
587 char Buffer[0]; 622 __u8 Buffer[0];
588} __packed; 623} __packed;
589 624
590struct smb2_ioctl_rsp { 625struct smb2_ioctl_rsp {
@@ -870,14 +905,16 @@ struct smb2_lease_ack {
870 905
871/* File System Information Classes */ 906/* File System Information Classes */
872#define FS_VOLUME_INFORMATION 1 /* Query */ 907#define FS_VOLUME_INFORMATION 1 /* Query */
873#define FS_LABEL_INFORMATION 2 /* Set */ 908#define FS_LABEL_INFORMATION 2 /* Local only */
874#define FS_SIZE_INFORMATION 3 /* Query */ 909#define FS_SIZE_INFORMATION 3 /* Query */
875#define FS_DEVICE_INFORMATION 4 /* Query */ 910#define FS_DEVICE_INFORMATION 4 /* Query */
876#define FS_ATTRIBUTE_INFORMATION 5 /* Query */ 911#define FS_ATTRIBUTE_INFORMATION 5 /* Query */
877#define FS_CONTROL_INFORMATION 6 /* Query, Set */ 912#define FS_CONTROL_INFORMATION 6 /* Query, Set */
878#define FS_FULL_SIZE_INFORMATION 7 /* Query */ 913#define FS_FULL_SIZE_INFORMATION 7 /* Query */
879#define FS_OBJECT_ID_INFORMATION 8 /* Query, Set */ 914#define FS_OBJECT_ID_INFORMATION 8 /* Query, Set */
880#define FS_DRIVER_PATH_INFORMATION 9 /* Query */ 915#define FS_DRIVER_PATH_INFORMATION 9 /* Local only */
916#define FS_VOLUME_FLAGS_INFORMATION 10 /* Local only */
917#define FS_SECTOR_SIZE_INFORMATION 11 /* SMB3 or later. Query */
881 918
882struct smb2_fs_full_size_info { 919struct smb2_fs_full_size_info {
883 __le64 TotalAllocationUnits; 920 __le64 TotalAllocationUnits;
@@ -887,6 +924,22 @@ struct smb2_fs_full_size_info {
887 __le32 BytesPerSector; 924 __le32 BytesPerSector;
888} __packed; 925} __packed;
889 926
927#define SSINFO_FLAGS_ALIGNED_DEVICE 0x00000001
928#define SSINFO_FLAGS_PARTITION_ALIGNED_ON_DEVICE 0x00000002
929#define SSINFO_FLAGS_NO_SEEK_PENALTY 0x00000004
930#define SSINFO_FLAGS_TRIM_ENABLED 0x00000008
931
932/* sector size info struct */
933struct smb3_fs_ss_info {
934 __le32 LogicalBytesPerSector;
935 __le32 PhysicalBytesPerSectorForAtomicity;
936 __le32 PhysicalBytesPerSectorForPerf;
937 __le32 FileSystemEffectivePhysicalBytesPerSectorForAtomicity;
938 __le32 Flags;
939 __le32 ByteOffsetForSectorAlignment;
940 __le32 ByteOffsetForPartitionAlignment;
941} __packed;
942
890/* partial list of QUERY INFO levels */ 943/* partial list of QUERY INFO levels */
891#define FILE_DIRECTORY_INFORMATION 1 944#define FILE_DIRECTORY_INFORMATION 1
892#define FILE_FULL_DIRECTORY_INFORMATION 2 945#define FILE_FULL_DIRECTORY_INFORMATION 2