aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/smb2pdu.h
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2011-03-14 22:08:48 -0400
committerSteve French <smfrench@gmail.com>2012-07-24 11:25:15 -0400
commitddfbefbd393fb1a935bdf27cba5ad2eb24a76e75 (patch)
tree11f84bfc5c091ae63991c3627874de3ab5bc9ea7 /fs/cifs/smb2pdu.h
parentb8030603d94a231c7fdee4c1ac369537f1fb8fb0 (diff)
CIFS: Map SMB2 status codes to POSIX errors
Add mapping table for 32 bit SMB2 status codes to linux errors. Note that SMB2 does not use DOS/OS2 errors (ever) so mapping to DOS/OS2 errors as a common network subset (as we do for cifs) doesn't help. And note that the set of status codes is much more complete here. Signed-off-by: Steve French <sfrench@us.ibm.com> Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru> Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs/smb2pdu.h')
-rw-r--r--fs/cifs/smb2pdu.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/fs/cifs/smb2pdu.h b/fs/cifs/smb2pdu.h
new file mode 100644
index 000000000000..d35ac689f24b
--- /dev/null
+++ b/fs/cifs/smb2pdu.h
@@ -0,0 +1,56 @@
1/*
2 * fs/cifs/smb2pdu.h
3 *
4 * Copyright (c) International Business Machines Corp., 2009, 2010
5 * Etersoft, 2012
6 * Author(s): Steve French (sfrench@us.ibm.com)
7 * Pavel Shilovsky (pshilovsky@samba.org) 2012
8 *
9 * This library is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU Lesser General Public License as published
11 * by the Free Software Foundation; either version 2.1 of the License, or
12 * (at your option) any later version.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
17 * the GNU Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public License
20 * along with this library; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 */
23
24#ifndef _SMB2PDU_H
25#define _SMB2PDU_H
26
27#include <net/sock.h>
28
29/*
30 * SMB2 Header Definition
31 *
32 * "MBZ" : Must be Zero
33 * "BB" : BugBug, Something to check/review/analyze later
34 * "PDU" : "Protocol Data Unit" (ie a network "frame")
35 *
36 */
37struct smb2_hdr {
38 __be32 smb2_buf_length; /* big endian on wire */
39 /* length is only two or three bytes - with
40 one or two byte type preceding it that MBZ */
41 __u8 ProtocolId[4]; /* 0xFE 'S' 'M' 'B' */
42 __le16 StructureSize; /* 64 */
43 __le16 CreditCharge; /* MBZ */
44 __le32 Status; /* Error from server */
45 __le16 Command;
46 __le16 CreditRequest; /* CreditResponse */
47 __le32 Flags;
48 __le32 NextCommand;
49 __u64 MessageId; /* opaque - so can stay little endian */
50 __le32 ProcessId;
51 __u32 TreeId; /* opaque - so do not make little endian */
52 __u64 SessionId; /* opaque - so do not make little endian */
53 __u8 Signature[16];
54} __packed;
55
56#endif /* _SMB2PDU_H */