📄 trans2.h
字号:
#define SMB_FILE_INTERNAL_INFORMATION 1006#define SMB_FILE_EA_INFORMATION 1007#define SMB_FILE_ACCESS_INFORMATION 1008#define SMB_FILE_NAME_INFORMATION 1009#define SMB_FILE_RENAME_INFORMATION 1010#define SMB_FILE_LINK_INFORMATION 1011#define SMB_FILE_NAMES_INFORMATION 1012#define SMB_FILE_DISPOSITION_INFORMATION 1013#define SMB_FILE_POSITION_INFORMATION 1014#define SMB_FILE_FULL_EA_INFORMATION 1015#define SMB_FILE_MODE_INFORMATION 1016#define SMB_FILE_ALIGNMENT_INFORMATION 1017#define SMB_FILE_ALL_INFORMATION 1018#define SMB_FILE_ALLOCATION_INFORMATION 1019#define SMB_FILE_END_OF_FILE_INFORMATION 1020#define SMB_FILE_ALTERNATE_NAME_INFORMATION 1021#define SMB_FILE_STREAM_INFORMATION 1022#define SMB_FILE_PIPE_INFORMATION 1023#define SMB_FILE_PIPE_LOCAL_INFORMATION 1024#define SMB_FILE_PIPE_REMOTE_INFORMATION 1025#define SMB_FILE_MAILSLOT_QUERY_INFORMATION 1026#define SMB_FILE_MAILSLOT_SET_INFORMATION 1027#define SMB_FILE_COMPRESSION_INFORMATION 1028#define SMB_FILE_OBJECTID_INFORMATION 1029#define SMB_FILE_COMPLETION_INFORMATION 1030#define SMB_FILE_MOVE_CLUSTER_INFORMATION 1031#define SMB_FILE_QUOTA_INFORMATION 1032#define SMB_FILE_REPARSEPOINT_INFORMATION 1033#define SMB_FILE_NETWORK_OPEN_INFORMATION 1034#define SMB_FILE_ATTRIBUTE_TAG_INFORMATION 1035#define SMB_FILE_TRACKING_INFORMATION 1036#define SMB_FILE_MAXIMUM_INFORMATION 1037/* NT passthough levels for qfsinfo. */#define SMB_FS_VOLUME_INFORMATION 1001#define SMB_FS_LABEL_INFORMATION 1002#define SMB_FS_SIZE_INFORMATION 1003#define SMB_FS_DEVICE_INFORMATION 1004#define SMB_FS_ATTRIBUTE_INFORMATION 1005#define SMB_FS_QUOTA_INFORMATION 1006#define SMB_FS_FULL_SIZE_INFORMATION 1007#define SMB_FS_OBJECTID_INFORMATION 1008/* flags on trans2 findfirst/findnext that control search */#define FLAG_TRANS2_FIND_CLOSE 0x1#define FLAG_TRANS2_FIND_CLOSE_IF_END 0x2#define FLAG_TRANS2_FIND_REQUIRE_RESUME 0x4#define FLAG_TRANS2_FIND_CONTINUE 0x8#define FLAG_TRANS2_FIND_BACKUP_INTENT 0x10/* UNIX CIFS Extensions - created by HP *//* * UNIX CIFS Extensions have the range 0x200 - 0x2FF reserved. * Supposedly Microsoft have agreed to this. */#define MIN_UNIX_INFO_LEVEL 0x200#define MAX_UNIX_INFO_LEVEL 0x2FF#define INFO_LEVEL_IS_UNIX(level) (((level) >= MIN_UNIX_INFO_LEVEL) && ((level) <= MAX_UNIX_INFO_LEVEL))#define SMB_QUERY_FILE_UNIX_BASIC 0x200 /* UNIX File Info*/#define SMB_SET_FILE_UNIX_BASIC 0x200#define SMB_MODE_NO_CHANGE 0xFFFFFFFF /* file mode value which */ /* means "don't change it" */#define SMB_UID_NO_CHANGE 0xFFFFFFFF#define SMB_GID_NO_CHANGE 0xFFFFFFFF#define SMB_SIZE_NO_CHANGE_LO 0xFFFFFFFF#define SMB_SIZE_NO_CHANGE_HI 0xFFFFFFFF #define SMB_TIME_NO_CHANGE_LO 0xFFFFFFFF#define SMB_TIME_NO_CHANGE_HI 0xFFFFFFFF/*Offset Size Name0 LARGE_INTEGER EndOfFile File size8 LARGE_INTEGER Blocks Number of bytes used on disk (st_blocks).16 LARGE_INTEGER CreationTime Creation time24 LARGE_INTEGER LastAccessTime Last access time32 LARGE_INTEGER LastModificationTime Last modification time40 LARGE_INTEGER Uid Numeric user id for the owner48 LARGE_INTEGER Gid Numeric group id of owner56 ULONG Type Enumeration specifying the pathname type: 0 -- File 1 -- Directory 2 -- Symbolic link 3 -- Character device 4 -- Block device 5 -- FIFO (named pipe) 6 -- Unix domain socket60 LARGE_INTEGER devmajor Major device number if type is device68 LARGE_INTEGER devminor Minor device number if type is device76 LARGE_INTEGER uniqueid This is a server-assigned unique id for the file. The client will typically map this onto an inode number. The scope of uniqueness is the share.84 LARGE_INTEGER permissions Standard UNIX file permissions - see below.92 LARGE_INTEGER nlinks The number of directory entries that map to this entry (number of hard links)100 - end.*//* UNIX filetype mappings. */#define UNIX_TYPE_FILE 0#define UNIX_TYPE_DIR 1#define UNIX_TYPE_SYMLINK 2#define UNIX_TYPE_CHARDEV 3#define UNIX_TYPE_BLKDEV 4#define UNIX_TYPE_FIFO 5#define UNIX_TYPE_SOCKET 6#define UNIX_TYPE_UNKNOWN 0xFFFFFFFF/* * Oh this is fun. "Standard UNIX permissions" has no * meaning in POSIX. We need to define the mapping onto * and off the wire as this was not done in the original HP * spec. JRA. */#define UNIX_X_OTH 0000001#define UNIX_W_OTH 0000002#define UNIX_R_OTH 0000004#define UNIX_X_GRP 0000010#define UNIX_W_GRP 0000020#define UNIX_R_GRP 0000040#define UNIX_X_USR 0000100#define UNIX_W_USR 0000200#define UNIX_R_USR 0000400#define UNIX_STICKY 0001000#define UNIX_SET_GID 0002000#define UNIX_SET_UID 0004000/* Masks for the above */#define UNIX_OTH_MASK 0000007#define UNIX_GRP_MASK 0000070#define UNIX_USR_MASK 0000700#define UNIX_PERM_MASK 0000777#define UNIX_EXTRA_MASK 0007000#define UNIX_ALL_MASK 0007777#define SMB_QUERY_FILE_UNIX_LINK 0x201#define SMB_SET_FILE_UNIX_LINK 0x201#define SMB_SET_FILE_UNIX_HLINK 0x203/* SMB_QUERY_POSIX_ACL 0x204 see below */#define SMB_QUERY_XATTR 0x205 /* need for non-user XATTRs */#define SMB_QUERY_ATTR_FLAGS 0x206 /* chflags, chattr */#define SMB_SET_ATTR_FLAGS 0x206 #define SMB_QUERY_POSIX_PERMISSION 0x207#define SMB_QUERY_POSIX_LOCK 0x208#define SMB_SET_POSIX_LOCK 0x208/* Transact 2 Find First levels */#define SMB_FIND_FILE_UNIX 0x202/* Info level for TRANS2_QFSINFO - returns version of CIFS UNIX extensions, plus 64-bits worth of capability fun :-). Use the same info level for TRANS2_SETFSINFO*/#define SMB_QUERY_CIFS_UNIX_INFO 0x200#define SMB_SET_CIFS_UNIX_INFO 0x200/* Returns or sets the following. UINT16 major version number UINT16 minor version number LARGE_INTEGER capability bitfield*/#define CIFS_UNIX_MAJOR_VERSION 1#define CIFS_UNIX_MINOR_VERSION 0#define CIFS_UNIX_FCNTL_LOCKS_CAP 0x1#define CIFS_UNIX_POSIX_ACLS_CAP 0x2#define CIFS_UNIX_XATTTR_CAP 0x4 /* for support of other xattr namespaces such as system, security and trusted */#define CIFS_UNIX_EXTATTR_CAP 0x8 /* for support of chattr (chflags) and lsattr */#define CIFS_UNIX_POSIX_PATHNAMES_CAP 0x10 /* Use POSIX pathnames on the wire. */#define SMB_QUERY_POSIX_FS_INFO 0x201/* Returns FILE_SYSTEM_POSIX_INFO struct as follows (NB For undefined values return -1 in that field) le32 OptimalTransferSize; bsize on some os, iosize on other os, This is a hint to the client about best size. Server can return -1 if no preference, ie if SMB negotiated size is adequate for optimal read/write performance le32 BlockSize; (often 512 bytes) NB: BlockSize * TotalBlocks = disk space le64 TotalBlocks; redundant with other infolevels but easy to ret here le64 BlocksAvail; although redundant, easy to return le64 UserBlocksAvail; bavail le64 TotalFileNodes; le64 FreeFileNodes; le64 FileSysIdentifier; fsid (NB statfs field Namelen comes from FILE_SYSTEM_ATTRIBUTE_INFO call) (NB statfs field flags can come from FILE_SYSTEM_DEVICE_INFO call) *//* ... more as we think of them :-). *//* SMB POSIX ACL definitions. *//* Wire format is (all little endian) :[2 bytes] - Version number.[2 bytes] - Number of ACE entries to follow.[2 bytes] - Number of default ACE entries to follow.-------------------------------------^|ACE entries|v-------------------------------------^|Default ACE entries|v-------------------------------------Where an ACE entry looks like :[1 byte] - Entry type.Entry types are :ACL_USER_OBJ 0x01ACL_USER 0x02ACL_GROUP_OBJ 0x04ACL_GROUP 0x08ACL_MASK 0x10ACL_OTHER 0x20[1 byte] - permissions (perm_t)perm_t types are :ACL_READ 0x04ACL_WRITE 0x02ACL_EXECUTE 0x01[8 bytes] - uid/gid to apply this permission to.In the same format as the uid/gid fields in the otherUNIX extensions definitions. Use 0xFFFFFFFFFFFFFFFF forthe MASK and OTHER entry types.If the Number of ACE entries for either file or default ACE'sis set to 0xFFFF this means ignore this kind of ACE (and thenumber of entries sent will be zero.*//* The query/set info levels for POSIX ACLs. */#define SMB_QUERY_POSIX_ACL 0x204#define SMB_SET_POSIX_ACL 0x204/* Current on the wire ACL version. */#define SMB_POSIX_ACL_VERSION 1/* ACE entry type. */#define SMB_POSIX_ACL_USER_OBJ 0x01#define SMB_POSIX_ACL_USER 0x02#define SMB_POSIX_ACL_GROUP_OBJ 0x04#define SMB_POSIX_ACL_GROUP 0x08#define SMB_POSIX_ACL_MASK 0x10#define SMB_POSIX_ACL_OTHER 0x20/* perm_t types. */#define SMB_POSIX_ACL_READ 0x04#define SMB_POSIX_ACL_WRITE 0x02#define SMB_POSIX_ACL_EXECUTE 0x01#define SMB_POSIX_ACL_HEADER_SIZE 6#define SMB_POSIX_ACL_ENTRY_SIZE 10#define SMB_POSIX_IGNORE_ACE_ENTRIES 0xFFFF#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -