Changeset 988 for vendor/current/source3/include/trans2.h
- Timestamp:
- Nov 24, 2016, 1:14:11 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/source3/include/trans2.h
r740 r988 282 282 #define TYPE_MOUNTED 0x20 283 283 #define TYPE_VIRTUAL 0x40 284 285 /* SMB_FS_SECTOR_SIZE_INFORMATION values */ 286 #define SSINFO_FLAGS_ALIGNED_DEVICE 0x00000001 287 #define SSINFO_FLAGS_PARTITION_ALIGNED_ON_DEVICE 0x00000002 288 #define SSINFO_FLAGS_NO_SEEK_PENALTY 0x00000004 289 #define SSINFO_FLAGS_TRIM_ENABLED 0x00000008 290 291 #define SSINFO_OFFSET_UNKNOWN 0xffffffff 284 292 285 293 /* NT passthrough levels... */ … … 334 342 #define SMB_FS_FULL_SIZE_INFORMATION 1007 335 343 #define SMB_FS_OBJECTID_INFORMATION 1008 344 #define SMB_FS_SECTOR_SIZE_INFORMATION 1011 336 345 337 346 /* SMB_FS_DEVICE_INFORMATION device types. */ … … 356 365 #define FLAG_TRANS2_FIND_BACKUP_INTENT 0x10 357 366 358 /* UNIX CIFS Extensions - created by HP */359 /*360 * UNIX CIFS Extensions have the range 0x200 - 0x2FF reserved.361 * Supposedly Microsoft have agreed to this.362 */363 364 #define MIN_UNIX_INFO_LEVEL 0x200365 #define MAX_UNIX_INFO_LEVEL 0x2FF366 367 #define INFO_LEVEL_IS_UNIX(level) (((level) >= MIN_UNIX_INFO_LEVEL) && ((level) <= MAX_UNIX_INFO_LEVEL))368 369 #define SMB_QUERY_FILE_UNIX_BASIC 0x200 /* UNIX File Info*/370 #define SMB_SET_FILE_UNIX_BASIC 0x200371 #define SMB_SET_FILE_UNIX_INFO2 0x20B /* UNIX File Info2 */372 373 #define SMB_MODE_NO_CHANGE 0xFFFFFFFF /* file mode value which */374 /* means "don't change it" */375 #define SMB_UID_NO_CHANGE 0xFFFFFFFF376 #define SMB_GID_NO_CHANGE 0xFFFFFFFF377 378 #define SMB_SIZE_NO_CHANGE_LO 0xFFFFFFFF379 #define SMB_SIZE_NO_CHANGE_HI 0xFFFFFFFF380 381 #define SMB_TIME_NO_CHANGE_LO 0xFFFFFFFF382 #define SMB_TIME_NO_CHANGE_HI 0xFFFFFFFF383 384 /*385 Offset Size Name386 0 LARGE_INTEGER EndOfFile File size387 8 LARGE_INTEGER Blocks Number of bytes used on disk (st_blocks).388 16 LARGE_INTEGER CreationTime Creation time389 24 LARGE_INTEGER LastAccessTime Last access time390 32 LARGE_INTEGER LastModificationTime Last modification time391 40 LARGE_INTEGER Uid Numeric user id for the owner392 48 LARGE_INTEGER Gid Numeric group id of owner393 56 ULONG Type Enumeration specifying the pathname type:394 0 -- File395 1 -- Directory396 2 -- Symbolic link397 3 -- Character device398 4 -- Block device399 5 -- FIFO (named pipe)400 6 -- Unix domain socket401 402 60 LARGE_INTEGER devmajor Major device number if type is device403 68 LARGE_INTEGER devminor Minor device number if type is device404 76 LARGE_INTEGER uniqueid This is a server-assigned unique id for the file. The client405 will typically map this onto an inode number. The scope of406 uniqueness is the share.407 84 LARGE_INTEGER permissions Standard UNIX file permissions - see below.408 92 LARGE_INTEGER nlinks The number of directory entries that map to this entry409 (number of hard links)410 411 100 - end.412 */413 414 #define SMB_FILE_UNIX_BASIC_SIZE 100415 416 /* UNIX filetype mappings. */417 418 #define UNIX_TYPE_FILE 0419 #define UNIX_TYPE_DIR 1420 #define UNIX_TYPE_SYMLINK 2421 #define UNIX_TYPE_CHARDEV 3422 #define UNIX_TYPE_BLKDEV 4423 #define UNIX_TYPE_FIFO 5424 #define UNIX_TYPE_SOCKET 6425 #define UNIX_TYPE_UNKNOWN 0xFFFFFFFF426 427 /*428 * Oh this is fun. "Standard UNIX permissions" has no429 * meaning in POSIX. We need to define the mapping onto430 * and off the wire as this was not done in the original HP431 * spec. JRA.432 */433 434 #define UNIX_X_OTH 0000001435 #define UNIX_W_OTH 0000002436 #define UNIX_R_OTH 0000004437 #define UNIX_X_GRP 0000010438 #define UNIX_W_GRP 0000020439 #define UNIX_R_GRP 0000040440 #define UNIX_X_USR 0000100441 #define UNIX_W_USR 0000200442 #define UNIX_R_USR 0000400443 #define UNIX_STICKY 0001000444 #define UNIX_SET_GID 0002000445 #define UNIX_SET_UID 0004000446 447 /* Masks for the above */448 #define UNIX_OTH_MASK 0000007449 #define UNIX_GRP_MASK 0000070450 #define UNIX_USR_MASK 0000700451 #define UNIX_PERM_MASK 0000777452 #define UNIX_EXTRA_MASK 0007000453 #define UNIX_ALL_MASK 0007777454 455 /* Flags for chflags (CIFS_UNIX_EXTATTR_CAP capability) and456 * SMB_QUERY_FILE_UNIX_INFO2.457 */458 #define EXT_SECURE_DELETE 0x00000001459 #define EXT_ENABLE_UNDELETE 0x00000002460 #define EXT_SYNCHRONOUS 0x00000004461 #define EXT_IMMUTABLE 0x00000008462 #define EXT_OPEN_APPEND_ONLY 0x00000010463 #define EXT_DO_NOT_BACKUP 0x00000020464 #define EXT_NO_UPDATE_ATIME 0x00000040465 #define EXT_HIDDEN 0x00000080466 467 #define SMB_QUERY_FILE_UNIX_LINK 0x201468 #define SMB_SET_FILE_UNIX_LINK 0x201469 #define SMB_SET_FILE_UNIX_HLINK 0x203470 /* SMB_QUERY_POSIX_ACL 0x204 see below */471 #define SMB_QUERY_XATTR 0x205 /* need for non-user XATTRs */472 #define SMB_QUERY_ATTR_FLAGS 0x206 /* chflags, chattr */473 #define SMB_SET_ATTR_FLAGS 0x206474 #define SMB_QUERY_POSIX_PERMISSION 0x207475 /* Only valid for qfileinfo */476 #define SMB_QUERY_POSIX_LOCK 0x208477 /* Only valid for setfileinfo */478 #define SMB_SET_POSIX_LOCK 0x208479 480 /* The set info levels for POSIX path operations. */481 #define SMB_POSIX_PATH_OPEN 0x209482 #define SMB_POSIX_PATH_UNLINK 0x20A483 484 #define SMB_QUERY_FILE_UNIX_INFO2 0x20B /* UNIX File Info2 */485 #define SMB_SET_FILE_UNIX_INFO2 0x20B486 487 /*488 SMB_QUERY_FILE_UNIX_INFO2 is SMB_QUERY_FILE_UNIX_BASIC with create489 time and file flags appended. The corresponding info level for490 findfirst/findnext is SMB_FIND_FILE_UNIX_INFO2.491 Size Offset Value492 ---------------------493 0 LARGE_INTEGER EndOfFile File size494 8 LARGE_INTEGER Blocks Number of blocks used on disk495 16 LARGE_INTEGER ChangeTime Attribute change time496 24 LARGE_INTEGER LastAccessTime Last access time497 32 LARGE_INTEGER LastModificationTime Last modification time498 40 LARGE_INTEGER Uid Numeric user id for the owner499 48 LARGE_INTEGER Gid Numeric group id of owner500 56 ULONG Type Enumeration specifying the file type501 60 LARGE_INTEGER devmajor Major device number if type is device502 68 LARGE_INTEGER devminor Minor device number if type is device503 76 LARGE_INTEGER uniqueid This is a server-assigned unique id504 84 LARGE_INTEGER permissions Standard UNIX permissions505 92 LARGE_INTEGER nlinks Number of hard links506 100 LARGE_INTEGER CreationTime Create/birth time507 108 ULONG FileFlags File flags enumeration508 112 ULONG FileFlagsMask Mask of valid flags509 */510 511 /* Transact 2 Find First levels */512 #define SMB_FIND_FILE_UNIX 0x202513 #define SMB_FIND_FILE_UNIX_INFO2 0x20B /* UNIX File Info2 */514 515 #define SMB_FILE_UNIX_INFO2_SIZE 116516 517 /*518 Info level for TRANS2_QFSINFO - returns version of CIFS UNIX extensions, plus519 64-bits worth of capability fun :-).520 Use the same info level for TRANS2_SETFSINFO521 */522 523 #define SMB_QUERY_CIFS_UNIX_INFO 0x200524 #define SMB_SET_CIFS_UNIX_INFO 0x200525 526 /* Returns or sets the following.527 528 UINT16 major version number529 UINT16 minor version number530 LARGE_INTEGER capability bitfield531 532 */533 534 #define CIFS_UNIX_MAJOR_VERSION 1535 #define CIFS_UNIX_MINOR_VERSION 0536 537 #define CIFS_UNIX_FCNTL_LOCKS_CAP 0x1538 #define CIFS_UNIX_POSIX_ACLS_CAP 0x2539 #define CIFS_UNIX_XATTTR_CAP 0x4 /* for support of other xattr540 namespaces such as system,541 security and trusted */542 #define CIFS_UNIX_EXTATTR_CAP 0x8 /* for support of chattr543 (chflags) and lsattr */544 #define CIFS_UNIX_POSIX_PATHNAMES_CAP 0x10 /* Use POSIX pathnames on the wire. */545 #define CIFS_UNIX_POSIX_PATH_OPERATIONS_CAP 0x20 /* We can cope with POSIX open/mkdir/unlink etc. */546 #define CIFS_UNIX_LARGE_READ_CAP 0x40 /* We can cope with 24 bit reads in readX. */547 #define CIFS_UNIX_LARGE_WRITE_CAP 0x80 /* We can cope with 24 bit writes in writeX. */548 #define CIFS_UNIX_TRANSPORT_ENCRYPTION_CAP 0x100 /* We can do SPNEGO negotiations for encryption. */549 #define CIFS_UNIX_TRANSPORT_ENCRYPTION_MANDATORY_CAP 0x200 /* We *must* SPNEGO negotiations for encryption. */550 551 #define SMB_QUERY_POSIX_FS_INFO 0x201552 553 /* Returns FILE_SYSTEM_POSIX_INFO struct as follows554 (NB For undefined values return -1 in that field)555 le32 OptimalTransferSize; bsize on some os, iosize on other os, This556 is a hint to the client about best size. Server557 can return -1 if no preference, ie if SMB558 negotiated size is adequate for optimal559 read/write performance560 le32 BlockSize; (often 512 bytes) NB: BlockSize * TotalBlocks = disk space561 le64 TotalBlocks; redundant with other infolevels but easy to ret here562 le64 BlocksAvail; although redundant, easy to return563 le64 UserBlocksAvail; bavail564 le64 TotalFileNodes;565 le64 FreeFileNodes;566 le64 FileSysIdentifier; fsid567 (NB statfs field Namelen comes from FILE_SYSTEM_ATTRIBUTE_INFO call)568 (NB statfs field flags can come from FILE_SYSTEM_DEVICE_INFO call)569 */570 571 #define SMB_QUERY_POSIX_WHO_AM_I 0x202 /* QFS Info */572 /* returns:573 __u32 flags; 0 = Authenticated user 1 = GUEST574 __u32 mask; which flags bits server understands ie 0x0001575 __u64 unix_user_id;576 __u64 unix_user_gid;577 __u32 number_of_supplementary_gids; may be zero578 __u32 number_of_sids; may be zero579 __u32 length_of_sid_array; in bytes - may be zero580 __u32 pad; reserved - MBZ581 __u64 gid_array[0]; may be empty582 __u8 * psid_list may be empty583 */584 585 /* ... more as we think of them :-). */586 587 /* SMB POSIX ACL definitions. */588 /* Wire format is (all little endian) :589 590 [2 bytes] - Version number.591 [2 bytes] - Number of ACE entries to follow.592 [2 bytes] - Number of default ACE entries to follow.593 -------------------------------------594 ^595 |596 ACE entries597 |598 v599 -------------------------------------600 ^601 |602 Default ACE entries603 |604 v605 -------------------------------------606 607 Where an ACE entry looks like :608 609 [1 byte] - Entry type.610 611 Entry types are :612 613 ACL_USER_OBJ 0x01614 ACL_USER 0x02615 ACL_GROUP_OBJ 0x04616 ACL_GROUP 0x08617 ACL_MASK 0x10618 ACL_OTHER 0x20619 620 [1 byte] - permissions (perm_t)621 622 perm_t types are :623 624 ACL_READ 0x04625 ACL_WRITE 0x02626 ACL_EXECUTE 0x01627 628 [8 bytes] - uid/gid to apply this permission to.629 630 In the same format as the uid/gid fields in the other631 UNIX extensions definitions. Use 0xFFFFFFFFFFFFFFFF for632 the MASK and OTHER entry types.633 634 If the Number of ACE entries for either file or default ACE's635 is set to 0xFFFF this means ignore this kind of ACE (and the636 number of entries sent will be zero.637 638 */639 640 #define SMB_QUERY_POSIX_WHOAMI 0x202641 642 enum smb_whoami_flags {643 SMB_WHOAMI_GUEST = 0x1 /* Logged in as (or squashed to) guest */644 };645 646 /* Mask of which WHOAMI bits are valid. This should make it easier for clients647 * to cope with servers that have different sets of WHOAMI flags (as more get648 * added).649 */650 #define SMB_WHOAMI_MASK 0x00000001651 652 /*653 SMBWhoami - Query the user mapping performed by the server for the654 connected tree. This is a subcommand of the TRANS2_QFSINFO.655 656 Returns:657 4 bytes unsigned - mapping flags (smb_whoami_flags)658 4 bytes unsigned - flags mask659 660 8 bytes unsigned - primary UID661 8 bytes unsigned - primary GID662 4 bytes unsigned - number of supplementary GIDs663 4 bytes unsigned - number of SIDs664 4 bytes unsigned - SID list byte count665 4 bytes - pad / reserved (must be zero)666 667 8 bytes unsigned[] - list of GIDs (may be empty)668 struct dom_sid[] - list of SIDs (may be empty)669 */670 671 /*672 * The following trans2 is done between client and server673 * as a FSINFO call to set up the encryption state for transport674 * encryption.675 * This is a subcommand of the TRANS2_QFSINFO.676 *677 * The request looks like :678 *679 * [data block] -> SPNEGO framed GSSAPI request.680 *681 * The reply looks like :682 *683 * [data block] -> SPNEGO framed GSSAPI reply - if error684 * is NT_STATUS_OK then we're done, if it's685 * NT_STATUS_MORE_PROCESSING_REQUIRED then the686 * client needs to keep going. If it's an687 * error it can be any NT_STATUS error.688 *689 */690 691 #define SMB_REQUEST_TRANSPORT_ENCRYPTION 0x203 /* QFSINFO */692 693 694 /* The query/set info levels for POSIX ACLs. */695 #define SMB_QUERY_POSIX_ACL 0x204696 #define SMB_SET_POSIX_ACL 0x204697 698 /* Current on the wire ACL version. */699 #define SMB_POSIX_ACL_VERSION 1700 701 /* ACE entry type. */702 #define SMB_POSIX_ACL_USER_OBJ 0x01703 #define SMB_POSIX_ACL_USER 0x02704 #define SMB_POSIX_ACL_GROUP_OBJ 0x04705 #define SMB_POSIX_ACL_GROUP 0x08706 #define SMB_POSIX_ACL_MASK 0x10707 #define SMB_POSIX_ACL_OTHER 0x20708 709 /* perm_t types. */710 #define SMB_POSIX_ACL_READ 0x04711 #define SMB_POSIX_ACL_WRITE 0x02712 #define SMB_POSIX_ACL_EXECUTE 0x01713 714 #define SMB_POSIX_ACL_HEADER_SIZE 6715 #define SMB_POSIX_ACL_ENTRY_SIZE 10716 717 #define SMB_POSIX_IGNORE_ACE_ENTRIES 0xFFFF718 719 /* Definition of data block of SMB_SET_POSIX_LOCK */720 /*721 [2 bytes] lock_type - 0 = Read, 1 = Write, 2 = Unlock722 [2 bytes] lock_flags - 1 = Wait (only valid for setlock)723 [4 bytes] pid = locking context.724 [8 bytes] start = unsigned 64 bits.725 [8 bytes] length = unsigned 64 bits.726 */727 728 #define POSIX_LOCK_TYPE_OFFSET 0729 #define POSIX_LOCK_FLAGS_OFFSET 2730 #define POSIX_LOCK_PID_OFFSET 4731 #define POSIX_LOCK_START_OFFSET 8732 #define POSIX_LOCK_LEN_OFFSET 16733 #define POSIX_LOCK_DATA_SIZE 24734 735 #define POSIX_LOCK_FLAG_NOWAIT 0736 #define POSIX_LOCK_FLAG_WAIT 1737 738 #define POSIX_LOCK_TYPE_READ 0739 #define POSIX_LOCK_TYPE_WRITE 1740 #define POSIX_LOCK_TYPE_UNLOCK 2741 742 /* SMB_POSIX_PATH_OPEN "open_mode" definitions. */743 #define SMB_O_RDONLY 0x1744 #define SMB_O_WRONLY 0x2745 #define SMB_O_RDWR 0x4746 747 #define SMB_ACCMODE 0x7748 749 #define SMB_O_CREAT 0x10750 #define SMB_O_EXCL 0x20751 #define SMB_O_TRUNC 0x40752 #define SMB_O_APPEND 0x80753 #define SMB_O_SYNC 0x100754 #define SMB_O_DIRECTORY 0x200755 #define SMB_O_NOFOLLOW 0x400756 #define SMB_O_DIRECT 0x800757 758 /* Definition of request data block for SMB_POSIX_PATH_OPEN */759 /*760 [4 bytes] flags (as smb_ntcreate_Flags).761 [4 bytes] open_mode - SMB_O_xxx flags above.762 [8 bytes] mode_t (permissions) - same encoding as "Standard UNIX permissions" above in SMB_SET_FILE_UNIX_BASIC.763 [2 bytes] ret_info_level - optimization. Info level to be returned.764 */765 766 /* Definition of reply data block for SMB_POSIX_PATH_OPEN */767 768 #define SMB_NO_INFO_LEVEL_RETURNED 0xFFFF769 770 /*771 [2 bytes] - flags field. Identical to flags reply for oplock response field in SMBNTCreateX)772 [2 bytes] - FID returned.773 [4 bytes] - CreateAction (same as in NTCreateX response).774 [2 bytes] - reply info level - as requested or 0xFFFF if not available.775 [2 bytes] - padding (must be zero)776 [n bytes] - info level reply - if available.777 */778 779 /* Definition of request data block for SMB_POSIX_UNLINK */780 /*781 [2 bytes] flags (defined below).782 */783 784 #define SMB_POSIX_UNLINK_FILE_TARGET 0785 #define SMB_POSIX_UNLINK_DIRECTORY_TARGET 1786 787 367 #endif
Note:
See TracChangeset
for help on using the changeset viewer.