📄 cifspdu.h
字号:
__u32 Reserved; __le16 WriteMode; __le16 Remaining; __le16 DataLengthHigh; __le16 DataLengthLow; __le16 DataOffset; __le32 OffsetHigh; __le16 ByteCount; __u8 Pad; /* BB check for whether padded to DWORD boundary and optimum performance here */ char Data[0];} __attribute__((packed)) WRITE_REQ;typedef struct smb_com_write_rsp { struct smb_hdr hdr; /* wct = 6 */ __u8 AndXCommand; __u8 AndXReserved; __le16 AndXOffset; __le16 Count; __le16 Remaining; __le16 CountHigh; __u16 Reserved; __u16 ByteCount;} __attribute__((packed)) WRITE_RSP;/* legacy read request for older servers */typedef struct smb_com_readx_req { struct smb_hdr hdr; /* wct = 10 */ __u8 AndXCommand; __u8 AndXReserved; __le16 AndXOffset; __u16 Fid; __le32 OffsetLow; __le16 MaxCount; __le16 MinCount; /* obsolete */ __le32 Reserved; __le16 Remaining; __le16 ByteCount;} __attribute__((packed)) READX_REQ;typedef struct smb_com_read_req { struct smb_hdr hdr; /* wct = 12 */ __u8 AndXCommand; __u8 AndXReserved; __le16 AndXOffset; __u16 Fid; __le32 OffsetLow; __le16 MaxCount; __le16 MinCount; /* obsolete */ __le32 MaxCountHigh; __le16 Remaining; __le32 OffsetHigh; __le16 ByteCount;} __attribute__((packed)) READ_REQ;typedef struct smb_com_read_rsp { struct smb_hdr hdr; /* wct = 12 */ __u8 AndXCommand; __u8 AndXReserved; __le16 AndXOffset; __le16 Remaining; __le16 DataCompactionMode; __le16 Reserved; __le16 DataLength; __le16 DataOffset; __le16 DataLengthHigh; __u64 Reserved2; __u16 ByteCount; __u8 Pad; /* BB check for whether padded to DWORD boundary and optimum performance here */ char Data[1];} __attribute__((packed)) READ_RSP;typedef struct locking_andx_range { __le16 Pid; __le16 Pad; __le32 OffsetHigh; __le32 OffsetLow; __le32 LengthHigh; __le32 LengthLow;} __attribute__((packed)) LOCKING_ANDX_RANGE;#define LOCKING_ANDX_SHARED_LOCK 0x01#define LOCKING_ANDX_OPLOCK_RELEASE 0x02#define LOCKING_ANDX_CHANGE_LOCKTYPE 0x04#define LOCKING_ANDX_CANCEL_LOCK 0x08#define LOCKING_ANDX_LARGE_FILES 0x10 /* always on for us */typedef struct smb_com_lock_req { struct smb_hdr hdr; /* wct = 8 */ __u8 AndXCommand; __u8 AndXReserved; __le16 AndXOffset; __u16 Fid; __u8 LockType; __u8 OplockLevel; __le32 Timeout; __le16 NumberOfUnlocks; __le16 NumberOfLocks; __le16 ByteCount; LOCKING_ANDX_RANGE Locks[1];} __attribute__((packed)) LOCK_REQ;/* lock type */#define CIFS_RDLCK 0#define CIFS_WRLCK 1#define CIFS_UNLCK 2typedef struct cifs_posix_lock { __le16 lock_type; /* 0 = Read, 1 = Write, 2 = Unlock */ __le16 lock_flags; /* 1 = Wait (only valid for setlock) */ __le32 pid; __le64 start; __le64 length; /* BB what about additional owner info to identify network client */} __attribute__((packed)) CIFS_POSIX_LOCK;typedef struct smb_com_lock_rsp { struct smb_hdr hdr; /* wct = 2 */ __u8 AndXCommand; __u8 AndXReserved; __le16 AndXOffset; __u16 ByteCount;} __attribute__((packed)) LOCK_RSP;typedef struct smb_com_rename_req { struct smb_hdr hdr; /* wct = 1 */ __le16 SearchAttributes; /* target file attributes */ __le16 ByteCount; __u8 BufferFormat; /* 4 = ASCII or Unicode */ unsigned char OldFileName[1]; /* followed by __u8 BufferFormat2 */ /* followed by NewFileName */} __attribute__((packed)) RENAME_REQ; /* copy request flags */#define COPY_MUST_BE_FILE 0x0001#define COPY_MUST_BE_DIR 0x0002#define COPY_TARGET_MODE_ASCII 0x0004 /* if not set, binary */#define COPY_SOURCE_MODE_ASCII 0x0008 /* if not set, binary */#define COPY_VERIFY_WRITES 0x0010#define COPY_TREE 0x0020typedef struct smb_com_copy_req { struct smb_hdr hdr; /* wct = 3 */ __u16 Tid2; __le16 OpenFunction; __le16 Flags; __le16 ByteCount; __u8 BufferFormat; /* 4 = ASCII or Unicode */ unsigned char OldFileName[1]; /* followed by __u8 BufferFormat2 */ /* followed by NewFileName string */} __attribute__((packed)) COPY_REQ;typedef struct smb_com_copy_rsp { struct smb_hdr hdr; /* wct = 1 */ __le16 CopyCount; /* number of files copied */ __u16 ByteCount; /* may be zero */ __u8 BufferFormat; /* 0x04 - only present if errored file follows */ unsigned char ErrorFileName[1]; /* only present if error in copy */} __attribute__((packed)) COPY_RSP;#define CREATE_HARD_LINK 0x103#define MOVEFILE_COPY_ALLOWED 0x0002#define MOVEFILE_REPLACE_EXISTING 0x0001typedef struct smb_com_nt_rename_req { /* A5 - also used for create hardlink */ struct smb_hdr hdr; /* wct = 4 */ __le16 SearchAttributes; /* target file attributes */ __le16 Flags; /* spec says Information Level */ __le32 ClusterCount; __le16 ByteCount; __u8 BufferFormat; /* 4 = ASCII or Unicode */ unsigned char OldFileName[1]; /* followed by __u8 BufferFormat2 */ /* followed by NewFileName */} __attribute__((packed)) NT_RENAME_REQ;typedef struct smb_com_rename_rsp { struct smb_hdr hdr; /* wct = 0 */ __u16 ByteCount; /* bct = 0 */} __attribute__((packed)) RENAME_RSP;typedef struct smb_com_delete_file_req { struct smb_hdr hdr; /* wct = 1 */ __le16 SearchAttributes; __le16 ByteCount; __u8 BufferFormat; /* 4 = ASCII */ unsigned char fileName[1];} __attribute__((packed)) DELETE_FILE_REQ;typedef struct smb_com_delete_file_rsp { struct smb_hdr hdr; /* wct = 0 */ __u16 ByteCount; /* bct = 0 */} __attribute__((packed)) DELETE_FILE_RSP;typedef struct smb_com_delete_directory_req { struct smb_hdr hdr; /* wct = 0 */ __le16 ByteCount; __u8 BufferFormat; /* 4 = ASCII */ unsigned char DirName[1];} __attribute__((packed)) DELETE_DIRECTORY_REQ;typedef struct smb_com_delete_directory_rsp { struct smb_hdr hdr; /* wct = 0 */ __u16 ByteCount; /* bct = 0 */} __attribute__((packed)) DELETE_DIRECTORY_RSP;typedef struct smb_com_create_directory_req { struct smb_hdr hdr; /* wct = 0 */ __le16 ByteCount; __u8 BufferFormat; /* 4 = ASCII */ unsigned char DirName[1];} __attribute__((packed)) CREATE_DIRECTORY_REQ;typedef struct smb_com_create_directory_rsp { struct smb_hdr hdr; /* wct = 0 */ __u16 ByteCount; /* bct = 0 */} __attribute__((packed)) CREATE_DIRECTORY_RSP;typedef struct smb_com_query_information_req { struct smb_hdr hdr; /* wct = 0 */ __le16 ByteCount; /* 1 + namelen + 1 */ __u8 BufferFormat; /* 4 = ASCII */ unsigned char FileName[1];} __attribute__((packed)) QUERY_INFORMATION_REQ;typedef struct smb_com_query_information_rsp { struct smb_hdr hdr; /* wct = 10 */ __le16 attr; __le32 last_write_time; __le32 size; __u16 reserved[5]; __le16 ByteCount; /* bcc = 0 */} __attribute__((packed)) QUERY_INFORMATION_RSP;typedef struct smb_com_setattr_req { struct smb_hdr hdr; /* wct = 8 */ __le16 attr; __le16 time_low; __le16 time_high; __le16 reserved[5]; /* must be zero */ __u16 ByteCount; __u8 BufferFormat; /* 4 = ASCII */ unsigned char fileName[1];} __attribute__((packed)) SETATTR_REQ;typedef struct smb_com_setattr_rsp { struct smb_hdr hdr; /* wct = 0 */ __u16 ByteCount; /* bct = 0 */} __attribute__((packed)) SETATTR_RSP;/* empty wct response to setattr *//*******************************************************//* NT Transact structure defintions follow *//* Currently only ioctl, acl (get security descriptor) *//* and notify are implemented *//*******************************************************/typedef struct smb_com_ntransact_req { struct smb_hdr hdr; /* wct >= 19 */ __u8 MaxSetupCount; __u16 Reserved; __le32 TotalParameterCount; __le32 TotalDataCount; __le32 MaxParameterCount; __le32 MaxDataCount; __le32 ParameterCount; __le32 ParameterOffset; __le32 DataCount; __le32 DataOffset; __u8 SetupCount; /* four setup words follow subcommand */ /* SNIA spec incorrectly included spurious pad here */ __le16 SubCommand; /* 2 = IOCTL/FSCTL */ /* SetupCount words follow then */ __le16 ByteCount; __u8 Pad[3]; __u8 Parms[0];} __attribute__((packed)) NTRANSACT_REQ;typedef struct smb_com_ntransact_rsp { struct smb_hdr hdr; /* wct = 18 */ __u8 Reserved[3]; __le32 TotalParameterCount; __le32 TotalDataCount; __le32 ParameterCount; __le32 ParameterOffset; __le32 ParameterDisplacement; __le32 DataCount; __le32 DataOffset; __le32 DataDisplacement; __u8 SetupCount; /* 0 */ __u16 ByteCount; /* __u8 Pad[3]; */ /* parms and data follow */} __attribute__((packed)) NTRANSACT_RSP;typedef struct smb_com_transaction_ioctl_req { struct smb_hdr hdr; /* wct = 23 */ __u8 MaxSetupCount; __u16 Reserved; __le32 TotalParameterCount; __le32 TotalDataCount; __le32 MaxParameterCount; __le32 MaxDataCount; __le32 ParameterCount; __le32 ParameterOffset; __le32 DataCount; __le32 DataOffset; __u8 SetupCount; /* four setup words follow subcommand */ /* SNIA spec incorrectly included spurious pad here */ __le16 SubCommand; /* 2 = IOCTL/FSCTL */ __le32 FunctionCode; __u16 Fid; __u8 IsFsctl; /* 1 = File System Control 0 = device control (IOCTL) */ __u8 IsRootFlag; /* 1 = apply command to root of share (must be DFS) */ __le16 ByteCount; __u8 Pad[3]; __u8 Data[1];} __attribute__((packed)) TRANSACT_IOCTL_REQ;typedef struct smb_com_transaction_ioctl_rsp { struct smb_hdr hdr; /* wct = 19 */ __u8 Reserved[3]; __le32 TotalParameterCount; __le32 TotalDataCount; __le32 ParameterCount; __le32 ParameterOffset; __le32 ParameterDisplacement; __le32 DataCount; __le32 DataOffset; __le32 DataDisplacement; __u8 SetupCount; /* 1 */ __le16 ReturnedDataLen; __u16 ByteCount;} __attribute__((packed)) TRANSACT_IOCTL_RSP;#define CIFS_ACL_OWNER 1#define CIFS_ACL_GROUP 2#define CIFS_ACL_DACL 4#define CIFS_ACL_SACL 8typedef struct smb_com_transaction_qsec_req { struct smb_hdr hdr; /* wct = 19 */ __u8 MaxSetupCount; __u16 Reserved; __le32 TotalParameterCount; __le32 TotalDataCount; __le32 MaxParameterCount; __le32 MaxDataCount; __le32 ParameterCount; __le32 ParameterOffset; __le32 DataCount; __le32 DataOffset; __u8 SetupCount; /* no setup words follow subcommand */ /* SNIA spec incorrectly included spurious pad here */ __le16 SubCommand; /* 6 = QUERY_SECURITY_DESC */ __le16 ByteCount; /* bcc = 3 + 8 */ __u8 Pad[3]; __u16 Fid; __u16 Reserved2; __le32 AclFlags;} __attribute__((packed)) QUERY_SEC_DESC_REQ;typedef struct smb_com_transaction_change_notify_req { struct smb_hdr hdr; /* wct = 23 */ __u8 MaxSetupCount; __u16 Reserved; __le32 TotalParameterCount; __le32 TotalDataCount; __le32 MaxParameterCount; __le32 MaxDataCount; __le32 ParameterCount; __le32 ParameterOffset; __le32 DataCount; __le32 DataOffset; __u8 SetupCount; /* four setup words follow subcommand */ /* SNIA spec incorrectly included spurious pad here */ __le16 SubCommand;/* 4 = Change Notify */ __le32 CompletionFilter; /* operation to monitor */ __u16 Fid; __u8 WatchTree; /* 1 = Monitor subdirectories */ __u8 Reserved2; __le16 ByteCount;/* __u8 Pad[3];*//* __u8 Data[1];*/} __attribute__((packed)) TRANSACT_CHANGE_NOTIFY_REQ;/* BB eventually change to use generic ntransact rsp struct and validation routine */typedef struct smb_com_transaction_change_notify_rsp { struct smb_hdr hdr; /* wct = 18 */ __u8 Reserved[3]; __le32 TotalParameterCount; __le32 TotalDataCount; __le32 ParameterCount; __le32 ParameterOffset; __le32 ParameterDisplacement; __le32 DataCount; __le32 DataOffset; __le32 DataDisplacement; __u8 SetupCount; /* 0 */ __u16 ByteCount; /* __u8 Pad[3]; */} __attribute__((packed)) TRANSACT_CHANGE_NOTIFY_RSP;/* Completion Filter flags for Notify */#define FILE_NOTIFY_CHANGE_FILE_NAME 0x00000001#define FILE_NOTIFY_CHANGE_DIR_NAME 0x00000002#define FILE_NOTIFY_CHANGE_NAME 0x00000003#define FILE_NOTIFY_CHANGE_ATTRIBUTES 0x00000004#define FILE_NOTIFY_CHANGE_SIZE 0x00000008#define FILE_NOTIFY_CHANGE_LAST_WRITE 0x00000010#define FILE_NOTIFY_CHANGE_LAST_ACCESS 0x00000020#define FILE_NOTIFY_CHANGE_CREATION 0x00000040#define FILE_NOTIFY_CHANGE_EA 0x00000080#define FILE_NOTIFY_CHANGE_SECURITY 0x00000100#define FILE_NOTIFY_CHANGE_STREAM_NAME 0x00000200#define FILE_NOTIFY_CHANGE_STREAM_SIZE 0x00000400#define FILE_NOTIFY_CHANGE_STREAM_WRITE 0x00000800#define FILE_ACTION_ADDED 0x00000001#define FILE_ACTION_REMOVED 0x00000002
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -