⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cifspdu.h

📁 Linux内核自带的cifs模块
💻 H
📖 第 1 页 / 共 5 页
字号:
	__u16 ByteCount;	__u8 Pad;	/* may be three bytes? *//* followed by data area */} __attribute__((packed)) TRANSACTION2_QFSI_RSP;typedef struct whoami_rsp_data { /* Query level 0x202 */	__u32 flags; /* 0 = Authenticated user 1 = GUEST */	__u32 mask; /* which flags bits server understands ie 0x0001 */	__u64 unix_user_id;	__u64 unix_user_gid;	__u32 number_of_supplementary_gids; /* may be zero */	__u32 number_of_sids; /* may be zero */	__u32 length_of_sid_array; /* in bytes - may be zero */	__u32 pad; /* reserved - MBZ */	/* __u64 gid_array[0]; */  /* may be empty */	/* __u8 * psid_list */  /* may be empty */} __attribute__((packed)) WHOAMI_RSP_DATA;/* SETFSInfo Levels */#define SMB_SET_CIFS_UNIX_INFO    0x200typedef struct smb_com_transaction2_setfsi_req {	struct smb_hdr hdr;	/* wct = 15 */	__le16 TotalParameterCount;	__le16 TotalDataCount;	__le16 MaxParameterCount;	__le16 MaxDataCount;	__u8 MaxSetupCount;	__u8 Reserved;	__le16 Flags;	__le32 Timeout;	__u16 Reserved2;	__le16 ParameterCount;	/* 4 */	__le16 ParameterOffset;	__le16 DataCount;	/* 12 */	__le16 DataOffset;	__u8 SetupCount;	/* one */	__u8 Reserved3;	__le16 SubCommand;	/* TRANS2_SET_FS_INFORMATION */	__le16 ByteCount;	__u8 Pad;	__u16 FileNum;		/* Parameters start. */	__le16 InformationLevel;/* Parameters end. */	__le16 ClientUnixMajor; /* Data start. */	__le16 ClientUnixMinor;	__le64 ClientUnixCap;   /* Data end */} __attribute__((packed)) TRANSACTION2_SETFSI_REQ;typedef struct smb_com_transaction2_setfsi_rsp {	struct smb_hdr hdr;	/* wct = 10 */	struct trans2_resp t2;	__u16 ByteCount;} __attribute__((packed)) TRANSACTION2_SETFSI_RSP;typedef struct smb_com_transaction2_get_dfs_refer_req {	struct smb_hdr hdr;	/* wct = 15 */	__le16 TotalParameterCount;	__le16 TotalDataCount;	__le16 MaxParameterCount;	__le16 MaxDataCount;	__u8 MaxSetupCount;	__u8 Reserved;	__le16 Flags;	__le32 Timeout;	__u16 Reserved2;	__le16 ParameterCount;	__le16 ParameterOffset;	__le16 DataCount;	__le16 DataOffset;	__u8 SetupCount;	__u8 Reserved3;	__le16 SubCommand;	/* one setup word */	__le16 ByteCount;	__u8 Pad[3];		/* Win2K has sent 0x0F01 (max response length				   perhaps?) followed by one byte pad - doesn't				   seem to matter though */	__le16 MaxReferralLevel;	char RequestFileName[1];} __attribute__((packed)) TRANSACTION2_GET_DFS_REFER_REQ;typedef struct dfs_referral_level_3 {	__le16 VersionNumber;	__le16 ReferralSize;	__le16 ServerType;	/* 0x0001 = CIFS server */	__le16 ReferralFlags;	/* or proximity - not clear which since it is				   always set to zero - SNIA spec says 0x01				   means strip off PathConsumed chars before				   submitting RequestFileName to remote node */	__le16 TimeToLive;	__le16 Proximity;	__le16 DfsPathOffset;	__le16 DfsAlternatePathOffset;	__le16 NetworkAddressOffset;} __attribute__((packed)) REFERRAL3;typedef struct smb_com_transaction_get_dfs_refer_rsp {	struct smb_hdr hdr;	/* wct = 10 */	struct trans2_resp t2;	__u16 ByteCount;	__u8 Pad;	__le16 PathConsumed;	__le16 NumberOfReferrals;	__le16 DFSFlags;	__u16 Pad2;	REFERRAL3 referrals[1];	/* array of level 3 dfs_referral structures */	/* followed by the strings pointed to by the referral structures */} __attribute__((packed)) TRANSACTION2_GET_DFS_REFER_RSP;/* DFS Flags */#define DFSREF_REFERRAL_SERVER  0x0001#define DFSREF_STORAGE_SERVER   0x0002/* IOCTL information *//* * List of ioctl function codes that look to be of interest to remote clients * like this one.  Need to do some experimentation to make sure they all work * remotely.  Some of the following, such as the encryption/compression ones * would be invoked from tools via a specialized hook into the VFS rather * than via the standard vfs entry points */#define FSCTL_REQUEST_OPLOCK_LEVEL_1 0x00090000#define FSCTL_REQUEST_OPLOCK_LEVEL_2 0x00090004#define FSCTL_REQUEST_BATCH_OPLOCK   0x00090008#define FSCTL_LOCK_VOLUME            0x00090018#define FSCTL_UNLOCK_VOLUME          0x0009001C#define FSCTL_GET_COMPRESSION        0x0009003C#define FSCTL_SET_COMPRESSION        0x0009C040#define FSCTL_REQUEST_FILTER_OPLOCK  0x0009008C#define FSCTL_FILESYS_GET_STATISTICS 0x00090090#define FSCTL_SET_REPARSE_POINT      0x000900A4#define FSCTL_GET_REPARSE_POINT      0x000900A8#define FSCTL_DELETE_REPARSE_POINT   0x000900AC#define FSCTL_SET_SPARSE             0x000900C4#define FSCTL_SET_ZERO_DATA          0x000900C8#define FSCTL_SET_ENCRYPTION         0x000900D7#define FSCTL_ENCRYPTION_FSCTL_IO    0x000900DB#define FSCTL_WRITE_RAW_ENCRYPTED    0x000900DF#define FSCTL_READ_RAW_ENCRYPTED     0x000900E3#define FSCTL_SIS_COPYFILE           0x00090100#define FSCTL_SIS_LINK_FILES         0x0009C104#define IO_REPARSE_TAG_MOUNT_POINT   0xA0000003#define IO_REPARSE_TAG_HSM           0xC0000004#define IO_REPARSE_TAG_SIS           0x80000007/* ************************************************************************ * All structs for everything above the SMB PDUs themselves * (such as the T2 level specific data) go here ************************************************************************ *//* * Information on a server */struct serverInfo {	char name[16];	unsigned char versionMajor;	unsigned char versionMinor;	unsigned long type;	unsigned int commentOffset;} __attribute__((packed));/* * The following structure is the format of the data returned on a NetShareEnum * with level "90" (x5A) */struct shareInfo {	char shareName[13];	char pad;	unsigned short type;	unsigned int commentOffset;} __attribute__((packed));struct aliasInfo {	char aliasName[9];	char pad;	unsigned int commentOffset;	unsigned char type[2];} __attribute__((packed));struct aliasInfo92 {	int aliasNameOffset;	int serverNameOffset;	int shareNameOffset;} __attribute__((packed));typedef struct {	__le64 TotalAllocationUnits;	__le64 FreeAllocationUnits;	__le32 SectorsPerAllocationUnit;	__le32 BytesPerSector;} __attribute__((packed)) FILE_SYSTEM_INFO;	/* size info, level 0x103 */typedef struct {	__le32 fsid;	__le32 SectorsPerAllocationUnit;	__le32 TotalAllocationUnits;	__le32 FreeAllocationUnits;	__le16  BytesPerSector;} __attribute__((packed)) FILE_SYSTEM_ALLOC_INFO;typedef struct {	__le16 MajorVersionNumber;	__le16 MinorVersionNumber;	__le64 Capability;} __attribute__((packed)) FILE_SYSTEM_UNIX_INFO; /* Unix extension level 0x200*//* Version numbers for CIFS UNIX major and minor. */#define CIFS_UNIX_MAJOR_VERSION 1#define CIFS_UNIX_MINOR_VERSION 0/* Linux/Unix extensions capability flags */#define CIFS_UNIX_FCNTL_CAP             0x00000001 /* support for fcntl locks */#define CIFS_UNIX_POSIX_ACL_CAP         0x00000002 /* support getfacl/setfacl */#define CIFS_UNIX_XATTR_CAP             0x00000004 /* support new namespace   */#define CIFS_UNIX_EXTATTR_CAP           0x00000008 /* support chattr/chflag   */#define CIFS_UNIX_POSIX_PATHNAMES_CAP   0x00000010 /* Allow POSIX path chars  */#define CIFS_UNIX_POSIX_PATH_OPS_CAP    0x00000020 /* Allow new POSIX path based						      calls including posix open						      and posix unlink */#define CIFS_UNIX_LARGE_READ_CAP        0x00000040 /* support reads >128K (up						      to 0xFFFF00 */#define CIFS_UNIX_LARGE_WRITE_CAP       0x00000080#ifdef CONFIG_CIFS_POSIX/* Can not set pathnames cap yet until we send new posix create SMB since   otherwise server can treat such handles opened with older ntcreatex   (by a new client which knows how to send posix path ops)   as non-posix handles (can affect write behavior with byte range locks.   We can add back in POSIX_PATH_OPS cap when Posix Create/Mkdir finished *//* #define CIFS_UNIX_CAP_MASK              0x000000fb */#define CIFS_UNIX_CAP_MASK              0x000000db#else#define CIFS_UNIX_CAP_MASK              0x00000013#endif /* CONFIG_CIFS_POSIX */#define CIFS_POSIX_EXTENSIONS           0x00000010 /* support for new QFSInfo */typedef struct {	/* For undefined recommended transfer size return -1 in that field */	__le32 OptimalTransferSize;  /* bsize on some os, iosize on other os */	__le32 BlockSize;    /* The next three fields are in terms of the block size.	(above). If block size is unknown, 4096 would be a	reasonable block size for a server to report.	Note that returning the blocks/blocksavail removes need	to make a second call (to QFSInfo level 0x103 to get this info.	UserBlockAvail is typically less than or equal to BlocksAvail,	if no distinction is made return the same value in each */	__le64 TotalBlocks;	__le64 BlocksAvail;       /* bfree */	__le64 UserBlocksAvail;   /* bavail */    /* For undefined Node fields or FSID return -1 */	__le64 TotalFileNodes;	__le64 FreeFileNodes;	__le64 FileSysIdentifier;   /* fsid */	/* NB Namelen comes from FILE_SYSTEM_ATTRIBUTE_INFO call */	/* NB flags can come from FILE_SYSTEM_DEVICE_INFO call   */} __attribute__((packed)) FILE_SYSTEM_POSIX_INFO;/* DeviceType Flags */#define FILE_DEVICE_CD_ROM              0x00000002#define FILE_DEVICE_CD_ROM_FILE_SYSTEM  0x00000003#define FILE_DEVICE_DFS                 0x00000006#define FILE_DEVICE_DISK                0x00000007#define FILE_DEVICE_DISK_FILE_SYSTEM    0x00000008#define FILE_DEVICE_FILE_SYSTEM         0x00000009#define FILE_DEVICE_NAMED_PIPE          0x00000011#define FILE_DEVICE_NETWORK             0x00000012#define FILE_DEVICE_NETWORK_FILE_SYSTEM 0x00000014#define FILE_DEVICE_NULL                0x00000015#define FILE_DEVICE_PARALLEL_PORT       0x00000016#define FILE_DEVICE_PRINTER             0x00000018#define FILE_DEVICE_SERIAL_PORT         0x0000001b#define FILE_DEVICE_STREAMS             0x0000001e#define FILE_DEVICE_TAPE                0x0000001f#define FILE_DEVICE_TAPE_FILE_SYSTEM    0x00000020#define FILE_DEVICE_VIRTUAL_DISK        0x00000024#define FILE_DEVICE_NETWORK_REDIRECTOR  0x00000028typedef struct {	__le32 DeviceType;	__le32 DeviceCharacteristics;} __attribute__((packed)) FILE_SYSTEM_DEVICE_INFO; /* device info level 0x104 */typedef struct {	__le32 Attributes;	__le32 MaxPathNameComponentLength;	__le32 FileSystemNameLen;	char FileSystemName[52]; /* do not have to save this - get subset? */} __attribute__((packed)) FILE_SYSTEM_ATTRIBUTE_INFO;/******************************************************************************//* QueryFileInfo/QueryPathinfo (also for SetPath/SetFile) data buffer formats *//******************************************************************************/typedef struct { /* data block encoding of response to level 263 QPathInfo */	__le64 CreationTime;	__le64 LastAccessTime;	__le64 LastWriteTime;	__le64 ChangeTime;	__le32 Attributes;	__u32 Pad1;	__le64 AllocationSize;	__le64 EndOfFile;	/* size ie offset to first free byte in file */	__le32 NumberOfLinks;	/* hard links */	__u8 DeletePending;	__u8 Directory;	__u16 Pad2;	__u64 IndexNumber;	__le32 EASize;	__le32 AccessFlags;	__u64 IndexNumber1;	__le64 CurrentByteOffset;	__le32 Mode;	__le32 AlignmentRequirement;	__le32 FileNameLength;	char FileName[1];} __attribute__((packed)) FILE_ALL_INFO;	/* level 0x107 QPathInfo *//* defines for enumerating possible values of the Unix type field below */#define UNIX_FILE      0#define UNIX_DIR       1#define UNIX_SYMLINK   2#define UNIX_CHARDEV   3#define UNIX_BLOCKDEV  4#define UNIX_FIFO      5#define UNIX_SOCKET    6typedef struct {	__le64 EndOfFile;	__le64 NumOfBytes;	__le64 LastStatusChange; /*SNIA specs DCE time for the 3 time fields */	__le64 LastAccessTime;	__le64 LastModificationTime;	__le64 Uid;	__le64 Gid;	__le32 Type;	__le64 DevMajor;	__le64 DevMinor;	__u64 UniqueId;	__le64 Permissions;	__le64 Nlinks;} __attribute__((packed)) FILE_UNIX_BASIC_INFO;	/* level 0x200 QPathInfo */typedef struct {	char LinkDest[1];} __attribute__((packed)) FILE_UNIX_LINK_INFO;	/* level 0x201 QPathInfo *//* The following three structures are needed only for	setting time to NT4 and some older servers via	the primitive DOS time format */typedef struct {	__u16 Day:5;	__u16 Month:4;	__u16 Year:7;} __attribute__((packed)) SMB_DATE;typedef struct {	__u16 TwoSeconds:5;	__u16 Minutes:6;	__u16 Hours:5;} __attribute__((packed)) SMB_TIME;typedef struct {	__le16 CreationDate; /* SMB Date see above */	__le16 CreationTime; /* SMB Time */	__le16 LastAccessDate;	__le16 LastAccessTime;	__le16 LastWriteDate;	__le16 LastWriteTime;	__le32 DataSize; /* File Size (EOF) */	__le32 AllocationSize;	__le16 Attributes; /* verify not u32 */	__le32 EASize;} __attribute__((packed)) FILE_INFO_STANDARD;  /* level 1 SetPath/FileInfo */typedef struct {	__le64 CreationTime;	__le64 LastAccessTime;	__le64 LastWriteTime;	__le64 ChangeTime;	__le32 Attributes;	__u32 Pad;} __attribute__((packed)) FILE_BASIC_INFO;	/* size info, level 0x101 */struct file_allocation_info {	__le64 AllocationSize; /* Note old Samba srvr rounds this up too much */} __attribute__((packed));	/* size used on disk, for level 0x103 for set,				   0x105 for query */struct file_end_of_file_info {	__le64 FileSize;		/* offset to end of file */} __attribute__((packed)); /* size info, level 0x104 for set, 0x106 for query */struct file_alt_name_info {	__u8   alt_name[1];} __attribute__((packed));      /* level 0x0108 */struct file_stream_info {	__le32 number_of_streams;  /* BB check sizes and verify location */	/* followed by info on streams themselves		u64 size;		u64 allocation_size		stream info */};      /* level 0x109 */struct file_compression_info {	__le64 compressed_size;	__le16 format;	__u8   unit_shift;	__u8   ch_shift;	__u8   cl_shift;	__u8   pad[3];} __attribute__((packed));      /* level 0x10b *//* POSIX ACL set/query path info structures */#define CIFS_ACL_VERSION 1struct cifs

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -