linux-cifs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [SMB3] New compression flags
@ 2020-03-15 22:50 Steve French
  2020-03-15 23:07 ` Steve French
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Steve French @ 2020-03-15 22:50 UTC (permalink / raw)
  To: CIFS, samba-technical

[-- Attachment #1: Type: text/plain, Size: 96 bytes --]

Some compression related flags I noticed were added in the latest MS-SMB2



-- 
Thanks,

Steve

[-- Attachment #2: 0001-SMB3-Add-new-compression-flags.patch --]
[-- Type: text/x-patch, Size: 1370 bytes --]

From 12837ae091d533b58c80a0da43b92980b7ff5b6b Mon Sep 17 00:00:00 2001
From: Steve French <stfrench@microsoft.com>
Date: Sun, 15 Mar 2020 17:42:41 -0500
Subject: [PATCH] SMB3: Add new compression flags

Additional compression capabilities can now be negotiated and a
new compression algorithm.  Add the flags for these.

See newly updated MS-SMB2 sections 3.1.4.4.1 and 2.2.3.1.3

Signed-off-by: Steve French <stfrench@microsoft.com>
---
 fs/cifs/smb2pdu.h | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/fs/cifs/smb2pdu.h b/fs/cifs/smb2pdu.h
index 817bc0531536..4a7d154fffae 100644
--- a/fs/cifs/smb2pdu.h
+++ b/fs/cifs/smb2pdu.h
@@ -307,11 +307,17 @@ struct smb2_encryption_neg_context {
 #define SMB3_COMPRESS_LZNT1	cpu_to_le16(0x0001)
 #define SMB3_COMPRESS_LZ77	cpu_to_le16(0x0002)
 #define SMB3_COMPRESS_LZ77_HUFF	cpu_to_le16(0x0003)
+/* Pattern scanning algorithm See MS-SMB2 3.1.4.4.1 */
+#define SMB3_COMPRESS_PATTERN	cpu_to_le16(0x0004)
+
+/* Compression Flags */
+#define SMB2_COMPRESSION_CAPABILITIES_FLAG_NONE		cpu_to_le32(0x00000000)
+#define SMB2_COMPRESSION_CAPABILITIES_FLAG_CHAINED	cpu_to_le32(0x00000001)
 
 struct smb2_compression_capabilities_context {
 	__le16	ContextType; /* 3 */
 	__le16  DataLength;
-	__u32	Reserved;
+	__u32	Flags;
 	__le16	CompressionAlgorithmCount;
 	__u16	Padding;
 	__u32	Reserved1;
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-03-16 19:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-15 22:50 [SMB3] New compression flags Steve French
2020-03-15 23:07 ` Steve French
2020-03-15 23:09   ` ronnie sahlberg
2020-03-16  1:19     ` Steve French
2020-03-16 10:50 ` Aurélien Aptel
2020-03-16 19:01 ` [EXTERNAL] " Tom Talpey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).