diff options
author | Pavel Shilovsky <piastryyy@gmail.com> | 2011-06-08 07:51:07 -0400 |
---|---|---|
committer | Pavel Shilovsky <pshilovsky@samba.org> | 2012-07-24 13:54:52 -0400 |
commit | 093b2bdad3221e3fae3c26d89387e7297a157664 (patch) | |
tree | 13f5d345c587b96e7890da13d0a8d1a4c6ab87c5 /fs/cifs/smb2pdu.h | |
parent | 4b1241006c337f57745b0fc2f17b24f8009ca82d (diff) |
CIFS: Make demultiplex_thread work with SMB2 code
Now we can process SMB2 messages: check message, get message id
and wakeup awaiting routines.
Signed-off-by: Pavel Shilovsky <piastryyy@gmail.com>
Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs/smb2pdu.h')
-rw-r--r-- | fs/cifs/smb2pdu.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/fs/cifs/smb2pdu.h b/fs/cifs/smb2pdu.h index c7f52e363d37..b08a277df896 100644 --- a/fs/cifs/smb2pdu.h +++ b/fs/cifs/smb2pdu.h | |||
@@ -85,6 +85,12 @@ | |||
85 | /* BB FIXME - analyze following length BB */ | 85 | /* BB FIXME - analyze following length BB */ |
86 | #define MAX_SMB2_HDR_SIZE 0x78 /* 4 len + 64 hdr + (2*24 wct) + 2 bct + 2 pad */ | 86 | #define MAX_SMB2_HDR_SIZE 0x78 /* 4 len + 64 hdr + (2*24 wct) + 2 bct + 2 pad */ |
87 | 87 | ||
88 | #define SMB2_PROTO_NUMBER __constant_cpu_to_le32(0x424d53fe) | ||
89 | |||
90 | #define SMB2_HEADER_SIZE __constant_le16_to_cpu(64) | ||
91 | |||
92 | #define SMB2_ERROR_STRUCTURE_SIZE2 __constant_le16_to_cpu(9) | ||
93 | |||
88 | /* | 94 | /* |
89 | * SMB2 Header Definition | 95 | * SMB2 Header Definition |
90 | * | 96 | * |
@@ -112,4 +118,34 @@ struct smb2_hdr { | |||
112 | __u8 Signature[16]; | 118 | __u8 Signature[16]; |
113 | } __packed; | 119 | } __packed; |
114 | 120 | ||
121 | struct smb2_pdu { | ||
122 | struct smb2_hdr hdr; | ||
123 | __le16 StructureSize2; /* size of wct area (varies, request specific) */ | ||
124 | } __packed; | ||
125 | |||
126 | /* | ||
127 | * SMB2 flag definitions | ||
128 | */ | ||
129 | #define SMB2_FLAGS_SERVER_TO_REDIR __constant_cpu_to_le32(0x00000001) | ||
130 | #define SMB2_FLAGS_ASYNC_COMMAND __constant_cpu_to_le32(0x00000002) | ||
131 | #define SMB2_FLAGS_RELATED_OPERATIONS __constant_cpu_to_le32(0x00000004) | ||
132 | #define SMB2_FLAGS_SIGNED __constant_cpu_to_le32(0x00000008) | ||
133 | #define SMB2_FLAGS_DFS_OPERATIONS __constant_cpu_to_le32(0x10000000) | ||
134 | |||
135 | /* | ||
136 | * Definitions for SMB2 Protocol Data Units (network frames) | ||
137 | * | ||
138 | * See MS-SMB2.PDF specification for protocol details. | ||
139 | * The Naming convention is the lower case version of the SMB2 | ||
140 | * command code name for the struct. Note that structures must be packed. | ||
141 | * | ||
142 | */ | ||
143 | struct smb2_err_rsp { | ||
144 | struct smb2_hdr hdr; | ||
145 | __le16 StructureSize; | ||
146 | __le16 Reserved; /* MBZ */ | ||
147 | __le32 ByteCount; /* even if zero, at least one byte follows */ | ||
148 | __u8 ErrorData[1]; /* variable length */ | ||
149 | } __packed; | ||
150 | |||
115 | #endif /* _SMB2PDU_H */ | 151 | #endif /* _SMB2PDU_H */ |