📄 cifspdu.h
字号:
__u32 SessionKey; __le16 CaseInsensitivePasswordLength; /* ASCII password length */ __le16 CaseSensitivePasswordLength; /* Unicode password length */ __u32 Reserved; /* see below */ __le32 Capabilities; __le16 ByteCount; unsigned char CaseInsensitivePassword[1]; /* followed by: */ /* unsigned char * CaseSensitivePassword; */ /* STRING AccountName */ /* STRING PrimaryDomain */ /* STRING NativeOS */ /* STRING NativeLanMan */ } req_no_secext; /* NTLM request format (without extended security */ struct { /* default (NTLM) response format */ struct smb_hdr hdr; /* wct = 4 */ __u8 AndXCommand; __u8 AndXReserved; __le16 AndXOffset; __le16 Action; /* see below */ __le16 SecurityBlobLength; __u16 ByteCount; unsigned char SecurityBlob[1]; /* followed by *//* unsigned char * NativeOS; *//* unsigned char * NativeLanMan; *//* unsigned char * PrimaryDomain; */ } resp; /* NTLM response format (with or without extended security */ struct { /* request format */ struct smb_hdr hdr; /* wct = 10 */ __u8 AndXCommand; __u8 AndXReserved; __le16 AndXOffset; __le16 MaxBufferSize; __le16 MaxMpxCount; __le16 VcNumber; __u32 SessionKey; __le16 PassswordLength; __u32 Reserved; __le16 ByteCount; unsigned char AccountPassword[1]; /* followed by */ /* STRING AccountName */ /* STRING PrimaryDomain */ /* STRING NativeOS */ /* STRING NativeLanMan */ } old_req; /* pre-NTLM (LANMAN2.1) request format */ struct { /* default (NTLM) response format */ struct smb_hdr hdr; /* wct = 3 */ __u8 AndXCommand; __u8 AndXReserved; __le16 AndXOffset; __le16 Action; /* see below */ __u16 ByteCount; unsigned char NativeOS[1]; /* followed by *//* unsigned char * NativeLanMan; *//* unsigned char * PrimaryDomain; */ } old_resp; /* pre-NTLM (LANMAN2.1) response format */} SESSION_SETUP_ANDX;#define CIFS_NETWORK_OPSYS "CIFS VFS Client for Linux"/* Capabilities bits (for NTLM SessSetup request) */#define CAP_UNICODE 0x00000004#define CAP_LARGE_FILES 0x00000008#define CAP_NT_SMBS 0x00000010#define CAP_STATUS32 0x00000040#define CAP_LEVEL_II_OPLOCKS 0x00000080#define CAP_NT_FIND 0x00000200 /* reserved should be zero (presumably because NT_SMBs implies the same thing) */#define CAP_BULK_TRANSFER 0x20000000#define CAP_EXTENDED_SECURITY 0x80000000/* Action bits */#define GUEST_LOGIN 1typedef struct smb_com_tconx_req { struct smb_hdr hdr; /* wct = 4 */ __u8 AndXCommand; __u8 AndXReserved; __le16 AndXOffset; __le16 Flags; /* see below */ __le16 PasswordLength; __le16 ByteCount; unsigned char Password[1]; /* followed by *//* STRING Path *//* \\server\share name */ /* STRING Service */} TCONX_REQ;typedef struct smb_com_tconx_rsp { struct smb_hdr hdr; /* wct = 3 *//* note that Win2000 has sent wct=7 in some cases on responses. Four unspecified words followed OptionalSupport */ __u8 AndXCommand; __u8 AndXReserved; __le16 AndXOffset; __le16 OptionalSupport; /* see below */ __u16 ByteCount; unsigned char Service[1]; /* always ASCII, not Unicode */ /* STRING NativeFileSystem */} TCONX_RSP;/* tree connect Flags */#define DISCONNECT_TID 0x0001#define TCON_EXTENDED_SECINFO 0x0008/* OptionalSupport bits */#define SMB_SUPPORT_SEARCH_BITS 0x0001 /* must have bits (exclusive searches suppt. */#define SMB_SHARE_IS_IN_DFS 0x0002typedef struct smb_com_logoff_andx_req { struct smb_hdr hdr; /* wct = 2 */ __u8 AndXCommand; __u8 AndXReserved; __u16 AndXOffset; __u16 ByteCount;} LOGOFF_ANDX_REQ;typedef struct smb_com_logoff_andx_rsp { struct smb_hdr hdr; /* wct = 2 */ __u8 AndXCommand; __u8 AndXReserved; __u16 AndXOffset; __u16 ByteCount;} LOGOFF_ANDX_RSP;typedef union smb_com_tree_disconnect { /* as an altetnative can use flag on tree_connect PDU to effect disconnect *//* probably the simplest SMB PDU */ struct { struct smb_hdr hdr; /* wct = 0 */ __u16 ByteCount; /* bcc = 0 */ } req; struct { struct smb_hdr hdr; /* wct = 0 */ __u16 ByteCount; /* bcc = 0 */ } resp;} TREE_DISCONNECT;typedef struct smb_com_close_req { struct smb_hdr hdr; /* wct = 3 */ __u16 FileID; __u32 LastWriteTime; /* should be zero */ __u16 ByteCount; /* 0 */} CLOSE_REQ;typedef struct smb_com_close_rsp { struct smb_hdr hdr; /* wct = 0 */ __u16 ByteCount; /* bct = 0 */} CLOSE_RSP;typedef struct smb_com_findclose_req { struct smb_hdr hdr; /* wct = 1 */ __u16 FileID; __u16 ByteCount; /* 0 */} FINDCLOSE_REQ;/* OpenFlags */#define REQ_OPLOCK 0x00000002#define REQ_BATCHOPLOCK 0x00000004#define REQ_OPENDIRONLY 0x00000008typedef struct smb_com_open_req { /* also handles create */ struct smb_hdr hdr; /* wct = 24 */ __u8 AndXCommand; __u8 AndXReserved; __le16 AndXOffset; __u8 Reserved; /* Must Be Zero */ __le16 NameLength; __le32 OpenFlags; __le32 RootDirectoryFid; __le32 DesiredAccess; __le64 AllocationSize; __le32 FileAttributes; __le32 ShareAccess; __le32 CreateDisposition; __le32 CreateOptions; __le32 ImpersonationLevel; __u8 SecurityFlags; __le16 ByteCount; char fileName[1];} OPEN_REQ;/* open response: oplock levels */#define OPLOCK_NONE 0#define OPLOCK_EXCLUSIVE 1#define OPLOCK_BATCH 2#define OPLOCK_READ 3 /* level 2 oplock *//* open response for CreateAction shifted left */#define CIFS_CREATE_ACTION 0x20000 /* file created */typedef struct smb_com_open_rsp { struct smb_hdr hdr; /* wct = 34 BB */ __u8 AndXCommand; __u8 AndXReserved; __le16 AndXOffset; __u8 OplockLevel; __u16 Fid; __le32 CreateAction; __le64 CreationTime; __le64 LastAccessTime; __le64 LastWriteTime; __le64 ChangeTime; __le32 FileAttributes; __le64 AllocationSize; __le64 EndOfFile; __le16 FileType; __le16 DeviceState; __u8 DirectoryFlag; __u16 ByteCount; /* bct = 0 */} OPEN_RSP;typedef struct smb_com_write_req { struct smb_hdr hdr; /* wct = 14 */ __u8 AndXCommand; __u8 AndXReserved; __le16 AndXOffset; __u16 Fid; __le32 OffsetLow; __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[1];} WRITE_REQ;typedef struct smb_com_write_rsp { struct smb_hdr hdr; /* wct = 6 */ __u8 AndXCommand; __u8 AndXReserved; __le16 AndXOffset; __le16 Count; __le16 Remaining; __le32 Reserved; __u16 ByteCount;} WRITE_RSP;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;} 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];} READ_RSP;typedef struct locking_andx_range { __le16 Pid; __le16 Pad; __le32 OffsetHigh; __le32 OffsetLow; __le32 LengthHigh; __le32 LengthLow;} 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];} LOCK_REQ;typedef struct smb_com_lock_rsp { struct smb_hdr hdr; /* wct = 2 */ __u8 AndXCommand; __u8 AndXReserved; __le16 AndXOffset; __u16 ByteCount;} 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 */} 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 0x0020 typedef 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 */} 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 */} 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 */} NT_RENAME_REQ;typedef struct smb_com_rename_rsp { struct smb_hdr hdr; /* wct = 0 */ __u16 ByteCount; /* bct = 0 */} 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];} DELETE_FILE_REQ;typedef struct smb_com_delete_file_rsp { struct smb_hdr hdr; /* wct = 0 */ __u16 ByteCount; /* bct = 0 */} 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];} DELETE_DIRECTORY_REQ;typedef struct smb_com_delete_directory_rsp { struct smb_hdr hdr; /* wct = 0 */ __u16 ByteCount; /* bct = 0 */} 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];} CREATE_DIRECTORY_REQ;typedef struct smb_com_create_directory_rsp { struct smb_hdr hdr; /* wct = 0 */ __u16 ByteCount; /* bct = 0 */} CREATE_DIRECTORY_RSP;/***************************************************//* NT Transact structure defintions follow *//* Currently only ioctl and notify are implemented *//***************************************************/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 share)*/ __le16 ByteCount; __u8 Pad[3]; __u8 Data[1];} 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; __u8 Pad[3];} TRANSACT_IOCTL_RSP;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;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -