aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/cifs/README9
-rw-r--r--fs/cifs/cifspdu.h110
2 files changed, 105 insertions, 14 deletions
diff --git a/fs/cifs/README b/fs/cifs/README
index 50306229b0f9..621aa1a85971 100644
--- a/fs/cifs/README
+++ b/fs/cifs/README
@@ -3,7 +3,14 @@ features such as hierarchical dfs like namespace, hardlinks, locking and more.
3It was designed to comply with the SNIA CIFS Technical Reference (which 3It was designed to comply with the SNIA CIFS Technical Reference (which
4supersedes the 1992 X/Open SMB Standard) as well as to perform best practice 4supersedes the 1992 X/Open SMB Standard) as well as to perform best practice
5practical interoperability with Windows 2000, Windows XP, Samba and equivalent 5practical interoperability with Windows 2000, Windows XP, Samba and equivalent
6servers. 6servers. This code was developed in participation with the Protocol Freedom
7Information Foundation.
8
9Please see
10 http://protocolfreedom.org/ and
11 http://samba.org/samba/PFIF/
12for more details.
13
7 14
8For questions or bug reports please contact: 15For questions or bug reports please contact:
9 sfrench@samba.org (sfrench@us.ibm.com) 16 sfrench@samba.org (sfrench@us.ibm.com)
diff --git a/fs/cifs/cifspdu.h b/fs/cifs/cifspdu.h
index 47f79504f57b..64bd3ed6803a 100644
--- a/fs/cifs/cifspdu.h
+++ b/fs/cifs/cifspdu.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * fs/cifs/cifspdu.h 2 * fs/cifs/cifspdu.h
3 * 3 *
4 * Copyright (c) International Business Machines Corp., 2002,2007 4 * Copyright (c) International Business Machines Corp., 2002,2008
5 * Author(s): Steve French (sfrench@us.ibm.com) 5 * Author(s): Steve French (sfrench@us.ibm.com)
6 * 6 *
7 * This library is free software; you can redistribute it and/or modify 7 * This library is free software; you can redistribute it and/or modify
@@ -163,7 +163,10 @@
163 path names in response */ 163 path names in response */
164#define SMBFLG2_KNOWS_EAS cpu_to_le16(2) 164#define SMBFLG2_KNOWS_EAS cpu_to_le16(2)
165#define SMBFLG2_SECURITY_SIGNATURE cpu_to_le16(4) 165#define SMBFLG2_SECURITY_SIGNATURE cpu_to_le16(4)
166#define SMBFLG2_COMPRESSED (8)
167#define SMBFLG2_SECURITY_SIGNATURE_REQUIRED (0x10)
166#define SMBFLG2_IS_LONG_NAME cpu_to_le16(0x40) 168#define SMBFLG2_IS_LONG_NAME cpu_to_le16(0x40)
169#define SMBFLG2_REPARSE_PATH (0x400)
167#define SMBFLG2_EXT_SEC cpu_to_le16(0x800) 170#define SMBFLG2_EXT_SEC cpu_to_le16(0x800)
168#define SMBFLG2_DFS cpu_to_le16(0x1000) 171#define SMBFLG2_DFS cpu_to_le16(0x1000)
169#define SMBFLG2_PAGING_IO cpu_to_le16(0x2000) 172#define SMBFLG2_PAGING_IO cpu_to_le16(0x2000)
@@ -305,7 +308,7 @@
305#define FILE_SHARE_DELETE 0x00000004 308#define FILE_SHARE_DELETE 0x00000004
306#define FILE_SHARE_ALL 0x00000007 309#define FILE_SHARE_ALL 0x00000007
307 310
308/* CreateDisposition flags */ 311/* CreateDisposition flags, similar to CreateAction as well */
309#define FILE_SUPERSEDE 0x00000000 312#define FILE_SUPERSEDE 0x00000000
310#define FILE_OPEN 0x00000001 313#define FILE_OPEN 0x00000001
311#define FILE_CREATE 0x00000002 314#define FILE_CREATE 0x00000002
@@ -317,15 +320,25 @@
317#define CREATE_NOT_FILE 0x00000001 /* if set must not be file */ 320#define CREATE_NOT_FILE 0x00000001 /* if set must not be file */
318#define CREATE_WRITE_THROUGH 0x00000002 321#define CREATE_WRITE_THROUGH 0x00000002
319#define CREATE_SEQUENTIAL 0x00000004 322#define CREATE_SEQUENTIAL 0x00000004
320#define CREATE_SYNC_ALERT 0x00000010 323#define CREATE_NO_BUFFER 0x00000008 /* should not buffer on srv */
321#define CREATE_ASYNC_ALERT 0x00000020 324#define CREATE_SYNC_ALERT 0x00000010 /* MBZ */
325#define CREATE_ASYNC_ALERT 0x00000020 /* MBZ */
322#define CREATE_NOT_DIR 0x00000040 /* if set must not be directory */ 326#define CREATE_NOT_DIR 0x00000040 /* if set must not be directory */
327#define CREATE_TREE_CONNECTION 0x00000080 /* should be zero */
328#define CREATE_COMPLETE_IF_OPLK 0x00000100 /* should be zero */
323#define CREATE_NO_EA_KNOWLEDGE 0x00000200 329#define CREATE_NO_EA_KNOWLEDGE 0x00000200
324#define CREATE_EIGHT_DOT_THREE 0x00000400 330#define CREATE_EIGHT_DOT_THREE 0x00000400 /* doc says this is obsolete
331 open for recovery flag - should
332 be zero */
325#define CREATE_RANDOM_ACCESS 0x00000800 333#define CREATE_RANDOM_ACCESS 0x00000800
326#define CREATE_DELETE_ON_CLOSE 0x00001000 334#define CREATE_DELETE_ON_CLOSE 0x00001000
327#define CREATE_OPEN_BY_ID 0x00002000 335#define CREATE_OPEN_BY_ID 0x00002000
336#define CREATE_OPEN_BACKUP_INTN 0x00004000
337#define CREATE_NO_COMPRESSION 0x00008000
338#define CREATE_RESERVE_OPFILTER 0x00100000 /* should be zero */
328#define OPEN_REPARSE_POINT 0x00200000 339#define OPEN_REPARSE_POINT 0x00200000
340#define OPEN_NO_RECALL 0x00400000
341#define OPEN_FREE_SPACE_QUERY 0x00800000 /* should be zero */
329#define CREATE_OPTIONS_MASK 0x007FFFFF 342#define CREATE_OPTIONS_MASK 0x007FFFFF
330#define CREATE_OPTION_SPECIAL 0x20000000 /* system. NB not sent over wire */ 343#define CREATE_OPTION_SPECIAL 0x20000000 /* system. NB not sent over wire */
331 344
@@ -470,7 +483,7 @@ typedef struct lanman_neg_rsp {
470 483
471typedef struct negotiate_rsp { 484typedef struct negotiate_rsp {
472 struct smb_hdr hdr; /* wct = 17 */ 485 struct smb_hdr hdr; /* wct = 17 */
473 __le16 DialectIndex; 486 __le16 DialectIndex; /* 0xFFFF = no dialect acceptable */
474 __u8 SecurityMode; 487 __u8 SecurityMode;
475 __le16 MaxMpxCount; 488 __le16 MaxMpxCount;
476 __le16 MaxNumberVcs; 489 __le16 MaxNumberVcs;
@@ -516,10 +529,11 @@ typedef struct negotiate_rsp {
516#define CAP_INFOLEVEL_PASSTHRU 0x00002000 529#define CAP_INFOLEVEL_PASSTHRU 0x00002000
517#define CAP_LARGE_READ_X 0x00004000 530#define CAP_LARGE_READ_X 0x00004000
518#define CAP_LARGE_WRITE_X 0x00008000 531#define CAP_LARGE_WRITE_X 0x00008000
532#define CAP_LWIO 0x00010000 /* support fctl_srv_req_resume_key */
519#define CAP_UNIX 0x00800000 533#define CAP_UNIX 0x00800000
520#define CAP_RESERVED 0x02000000 534#define CAP_COMPRESSED_DATA 0x02000000
521#define CAP_BULK_TRANSFER 0x20000000 535#define CAP_DYNAMIC_REAUTH 0x20000000
522#define CAP_COMPRESSED_DATA 0x40000000 536#define CAP_PERSISTENT_HANDLES 0x40000000
523#define CAP_EXTENDED_SECURITY 0x80000000 537#define CAP_EXTENDED_SECURITY 0x80000000
524 538
525typedef union smb_com_session_setup_andx { 539typedef union smb_com_session_setup_andx {
@@ -668,9 +682,7 @@ typedef struct smb_com_tconx_req {
668} __attribute__((packed)) TCONX_REQ; 682} __attribute__((packed)) TCONX_REQ;
669 683
670typedef struct smb_com_tconx_rsp { 684typedef struct smb_com_tconx_rsp {
671 struct smb_hdr hdr; /* wct = 3 note that Win2000 has sent wct = 7 685 struct smb_hdr hdr; /* wct = 3 , not extended response */
672 in some cases on responses. Four unspecified
673 words followed OptionalSupport */
674 __u8 AndXCommand; 686 __u8 AndXCommand;
675 __u8 AndXReserved; 687 __u8 AndXReserved;
676 __le16 AndXOffset; 688 __le16 AndXOffset;
@@ -680,13 +692,48 @@ typedef struct smb_com_tconx_rsp {
680 /* STRING NativeFileSystem */ 692 /* STRING NativeFileSystem */
681} __attribute__((packed)) TCONX_RSP; 693} __attribute__((packed)) TCONX_RSP;
682 694
695typedef struct smb_com_tconx_rsp_ext {
696 struct smb_hdr hdr; /* wct = 7, extended response */
697 __u8 AndXCommand;
698 __u8 AndXReserved;
699 __le16 AndXOffset;
700 __le16 OptionalSupport; /* see below */
701 __le32 MaximalShareAccessRights;
702 __le32 GuestMaximalShareAccessRights;
703 __u16 ByteCount;
704 unsigned char Service[1]; /* always ASCII, not Unicode */
705 /* STRING NativeFileSystem */
706} __attribute__((packed)) TCONX_RSP_EXT;
707
708
683/* tree connect Flags */ 709/* tree connect Flags */
684#define DISCONNECT_TID 0x0001 710#define DISCONNECT_TID 0x0001
711#define TCON_EXTENDED_SIGNATURES 0x0004
685#define TCON_EXTENDED_SECINFO 0x0008 712#define TCON_EXTENDED_SECINFO 0x0008
713
686/* OptionalSupport bits */ 714/* OptionalSupport bits */
687#define SMB_SUPPORT_SEARCH_BITS 0x0001 /* "must have" directory search bits 715#define SMB_SUPPORT_SEARCH_BITS 0x0001 /* "must have" directory search bits
688 (exclusive searches supported) */ 716 (exclusive searches supported) */
689#define SMB_SHARE_IS_IN_DFS 0x0002 717#define SMB_SHARE_IS_IN_DFS 0x0002
718#define SMB_CSC_MASK 0x000C
719/* CSC flags defined as follows */
720#define SMB_CSC_CACHE_MANUAL_REINT 0x0000
721#define SMB_CSC_CACHE_AUTO_REINT 0x0004
722#define SMB_CSC_CACHE_VDO 0x0008
723#define SMB_CSC_NO_CACHING 0x000C
724
725#define SMB_UNIQUE_FILE_NAME 0x0010
726#define SMB_EXTENDED_SIGNATURES 0x0020
727
728/* services
729 *
730 * A: ie disk
731 * LPT1: ie printer
732 * IPC ie named pipe
733 * COMM
734 * ????? ie any type
735 *
736 */
690 737
691typedef struct smb_com_logoff_andx_req { 738typedef struct smb_com_logoff_andx_req {
692 struct smb_hdr hdr; /* wct = 2 */ 739 struct smb_hdr hdr; /* wct = 2 */
@@ -750,6 +797,17 @@ typedef struct smb_com_findclose_req {
750#define COMM_DEV_TYPE 0x0004 797#define COMM_DEV_TYPE 0x0004
751#define UNKNOWN_TYPE 0xFFFF 798#define UNKNOWN_TYPE 0xFFFF
752 799
800/* Device Type or File Status Flags */
801#define NO_EAS 0x0001
802#define NO_SUBSTREAMS 0x0002
803#define NO_REPARSETAG 0x0004
804/* following flags can apply if pipe */
805#define ICOUNT_MASK 0x00FF
806#define PIPE_READ_MODE 0x0100
807#define NAMED_PIPE_TYPE 0x0400
808#define PIPE_END_POINT 0x0800
809#define BLOCKING_NAMED_PIPE 0x8000
810
753typedef struct smb_com_open_req { /* also handles create */ 811typedef struct smb_com_open_req { /* also handles create */
754 struct smb_hdr hdr; /* wct = 24 */ 812 struct smb_hdr hdr; /* wct = 24 */
755 __u8 AndXCommand; 813 __u8 AndXCommand;
@@ -758,7 +816,7 @@ typedef struct smb_com_open_req { /* also handles create */
758 __u8 Reserved; /* Must Be Zero */ 816 __u8 Reserved; /* Must Be Zero */
759 __le16 NameLength; 817 __le16 NameLength;
760 __le32 OpenFlags; 818 __le32 OpenFlags;
761 __le32 RootDirectoryFid; 819 __u32 RootDirectoryFid;
762 __le32 DesiredAccess; 820 __le32 DesiredAccess;
763 __le64 AllocationSize; 821 __le64 AllocationSize;
764 __le32 FileAttributes; 822 __le32 FileAttributes;
@@ -801,6 +859,32 @@ typedef struct smb_com_open_rsp {
801 __u16 ByteCount; /* bct = 0 */ 859 __u16 ByteCount; /* bct = 0 */
802} __attribute__((packed)) OPEN_RSP; 860} __attribute__((packed)) OPEN_RSP;
803 861
862typedef struct smb_com_open_rsp_ext {
863 struct smb_hdr hdr; /* wct = 42 but meaningless due to MS bug? */
864 __u8 AndXCommand;
865 __u8 AndXReserved;
866 __le16 AndXOffset;
867 __u8 OplockLevel;
868 __u16 Fid;
869 __le32 CreateAction;
870 __le64 CreationTime;
871 __le64 LastAccessTime;
872 __le64 LastWriteTime;
873 __le64 ChangeTime;
874 __le32 FileAttributes;
875 __le64 AllocationSize;
876 __le64 EndOfFile;
877 __le16 FileType;
878 __le16 DeviceState;
879 __u8 DirectoryFlag;
880 __u8 VolumeGUID[16];
881 __u64 FileId; /* note no endian conversion - is opaque UniqueID */
882 __le32 MaximalAccessRights;
883 __le32 GuestMaximalAccessRights;
884 __u16 ByteCount; /* bct = 0 */
885} __attribute__((packed)) OPEN_RSP_EXT;
886
887
804/* format of legacy open request */ 888/* format of legacy open request */
805typedef struct smb_com_openx_req { 889typedef struct smb_com_openx_req {
806 struct smb_hdr hdr; /* wct = 15 */ 890 struct smb_hdr hdr; /* wct = 15 */