aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/cifspdu.h
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2005-08-25 02:06:05 -0400
committerSteve French <sfrench@us.ibm.com>2005-08-25 02:06:05 -0400
commita9d02ad49013c8fc527f06ca66417103cdbb08b6 (patch)
tree9ee3f14e81777296e7057adcfe5c986aea696d47 /fs/cifs/cifspdu.h
parente22cb8bcb8bce94bf5cca90c98933a28816c6a75 (diff)
[CIFS] Support for legacy servers part 3 - Add support for Open and most
of Read support. Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/cifspdu.h')
-rw-r--r--fs/cifs/cifspdu.h73
1 files changed, 73 insertions, 0 deletions
diff --git a/fs/cifs/cifspdu.h b/fs/cifs/cifspdu.h
index 026c88f486a2..cf466595b0d4 100644
--- a/fs/cifs/cifspdu.h
+++ b/fs/cifs/cifspdu.h
@@ -40,6 +40,7 @@
40#define SMB_COM_SETATTR 0x09 /* trivial response */ 40#define SMB_COM_SETATTR 0x09 /* trivial response */
41#define SMB_COM_LOCKING_ANDX 0x24 /* trivial response */ 41#define SMB_COM_LOCKING_ANDX 0x24 /* trivial response */
42#define SMB_COM_COPY 0x29 /* trivial rsp, fail filename ignrd*/ 42#define SMB_COM_COPY 0x29 /* trivial rsp, fail filename ignrd*/
43#define SMB_COM_OPEN_ANDX 0x2D /* Legacy open for old servers */
43#define SMB_COM_READ_ANDX 0x2E 44#define SMB_COM_READ_ANDX 0x2E
44#define SMB_COM_WRITE_ANDX 0x2F 45#define SMB_COM_WRITE_ANDX 0x2F
45#define SMB_COM_TRANSACTION2 0x32 46#define SMB_COM_TRANSACTION2 0x32
@@ -625,6 +626,7 @@ typedef struct smb_com_findclose_req {
625} FINDCLOSE_REQ; 626} FINDCLOSE_REQ;
626 627
627/* OpenFlags */ 628/* OpenFlags */
629#define REQ_MORE_INFO 0x00000001 /* legacy (OPEN_AND_X) only */
628#define REQ_OPLOCK 0x00000002 630#define REQ_OPLOCK 0x00000002
629#define REQ_BATCHOPLOCK 0x00000004 631#define REQ_BATCHOPLOCK 0x00000004
630#define REQ_OPENDIRONLY 0x00000008 632#define REQ_OPENDIRONLY 0x00000008
@@ -680,6 +682,62 @@ typedef struct smb_com_open_rsp {
680 __u16 ByteCount; /* bct = 0 */ 682 __u16 ByteCount; /* bct = 0 */
681} OPEN_RSP; 683} OPEN_RSP;
682 684
685/* format of legacy open request */
686typedef struct smb_com_openx_req {
687 struct smb_hdr hdr; /* wct = 15 */
688 __u8 AndXCommand;
689 __u8 AndXReserved;
690 __le16 AndXOffset;
691 __le16 OpenFlags;
692 __le16 Mode;
693 __le16 Sattr; /* search attributes */
694 __le16 FileAttributes; /* dos attrs */
695 __le32 CreateTime; /* os2 format */
696 __le16 OpenFunction;
697 __le32 EndOfFile;
698 __le32 Timeout;
699 __le32 Reserved;
700 __u16 ByteCount; /* file name follows */
701 char fileName[1];
702} OPENX_REQ;
703
704typedef struct smb_com_openx_rsp {
705 struct smb_hdr hdr; /* wct = 15 */
706 __u8 AndXCommand;
707 __u8 AndXReserved;
708 __le16 AndXOffset;
709 __u16 Fid;
710 __le16 FileAttributes;
711 __le32 LastWriteTime; /* os2 format */
712 __le32 EndOfFile;
713 __le16 Access;
714 __le16 FileType;
715 __le16 IPCState;
716 __le16 Action;
717 __u32 FileId;
718 __u16 Reserved;
719 __u16 ByteCount;
720} OPENX_RSP;
721
722/* Legacy write request for older servers */
723typedef struct smb_com_writex_req {
724 struct smb_hdr hdr; /* wct = 12 */
725 __u8 AndXCommand;
726 __u8 AndXReserved;
727 __le16 AndXOffset;
728 __u16 Fid;
729 __le32 OffsetLow;
730 __u32 Reserved; /* Timeout */
731 __le16 WriteMode; /* 1 = write through */
732 __le16 Remaining;
733 __le16 Reserved2;
734 __le16 DataLengthLow;
735 __le16 DataOffset;
736 __le16 ByteCount;
737 __u8 Pad; /* BB check for whether padded to DWORD boundary and optimum performance here */
738 char Data[0];
739} WRITEX_REQ;
740
683typedef struct smb_com_write_req { 741typedef struct smb_com_write_req {
684 struct smb_hdr hdr; /* wct = 14 */ 742 struct smb_hdr hdr; /* wct = 14 */
685 __u8 AndXCommand; 743 __u8 AndXCommand;
@@ -711,6 +769,21 @@ typedef struct smb_com_write_rsp {
711 __u16 ByteCount; 769 __u16 ByteCount;
712} WRITE_RSP; 770} WRITE_RSP;
713 771
772/* legacy read request for older servers */
773typedef struct smb_com_readx_req {
774 struct smb_hdr hdr; /* wct = 10 */
775 __u8 AndXCommand;
776 __u8 AndXReserved;
777 __le16 AndXOffset;
778 __u16 Fid;
779 __le32 OffsetLow;
780 __le16 MaxCount;
781 __le16 MinCount; /* obsolete */
782 __le32 Reserved;
783 __le16 Remaining;
784 __le16 ByteCount;
785} READX_REQ;
786
714typedef struct smb_com_read_req { 787typedef struct smb_com_read_req {
715 struct smb_hdr hdr; /* wct = 12 */ 788 struct smb_hdr hdr; /* wct = 12 */
716 __u8 AndXCommand; 789 __u8 AndXCommand;