aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/smb2pdu.h
diff options
context:
space:
mode:
authorPavel Shilovsky <piastry@etersoft.ru>2011-12-29 08:06:33 -0500
committerPavel Shilovsky <pshilovsky@samba.org>2012-07-24 13:55:08 -0400
commitbe4cb9e3d4ef7af1aaf66cebab1391ff91b48beb (patch)
treed6cd1bc8f7ff8053c5917043b24e69c07f46594b /fs/cifs/smb2pdu.h
parent1208ef1f76540b621f80e6130c4fb7bed8ece360 (diff)
CIFS: Query SMB2 inode info
Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru> Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs/smb2pdu.h')
-rw-r--r--fs/cifs/smb2pdu.h111
1 files changed, 111 insertions, 0 deletions
diff --git a/fs/cifs/smb2pdu.h b/fs/cifs/smb2pdu.h
index 5cd358ef312e..9151e9040b02 100644
--- a/fs/cifs/smb2pdu.h
+++ b/fs/cifs/smb2pdu.h
@@ -448,4 +448,115 @@ struct smb2_close_rsp {
448 __le32 Attributes; 448 __le32 Attributes;
449} __packed; 449} __packed;
450 450
451/* Possible InfoType values */
452#define SMB2_O_INFO_FILE 0x01
453#define SMB2_O_INFO_FILESYSTEM 0x02
454#define SMB2_O_INFO_SECURITY 0x03
455#define SMB2_O_INFO_QUOTA 0x04
456
457struct smb2_query_info_req {
458 struct smb2_hdr hdr;
459 __le16 StructureSize; /* Must be 41 */
460 __u8 InfoType;
461 __u8 FileInfoClass;
462 __le32 OutputBufferLength;
463 __le16 InputBufferOffset;
464 __u16 Reserved;
465 __le32 InputBufferLength;
466 __le32 AdditionalInformation;
467 __le32 Flags;
468 __u64 PersistentFileId; /* opaque endianness */
469 __u64 VolatileFileId; /* opaque endianness */
470 __u8 Buffer[1];
471} __packed;
472
473struct smb2_query_info_rsp {
474 struct smb2_hdr hdr;
475 __le16 StructureSize; /* Must be 9 */
476 __le16 OutputBufferOffset;
477 __le32 OutputBufferLength;
478 __u8 Buffer[1];
479} __packed;
480
481/*
482 * PDU infolevel structure definitions
483 * BB consider moving to a different header
484 */
485
486/* partial list of QUERY INFO levels */
487#define FILE_DIRECTORY_INFORMATION 1
488#define FILE_FULL_DIRECTORY_INFORMATION 2
489#define FILE_BOTH_DIRECTORY_INFORMATION 3
490#define FILE_BASIC_INFORMATION 4
491#define FILE_STANDARD_INFORMATION 5
492#define FILE_INTERNAL_INFORMATION 6
493#define FILE_EA_INFORMATION 7
494#define FILE_ACCESS_INFORMATION 8
495#define FILE_NAME_INFORMATION 9
496#define FILE_RENAME_INFORMATION 10
497#define FILE_LINK_INFORMATION 11
498#define FILE_NAMES_INFORMATION 12
499#define FILE_DISPOSITION_INFORMATION 13
500#define FILE_POSITION_INFORMATION 14
501#define FILE_FULL_EA_INFORMATION 15
502#define FILE_MODE_INFORMATION 16
503#define FILE_ALIGNMENT_INFORMATION 17
504#define FILE_ALL_INFORMATION 18
505#define FILE_ALLOCATION_INFORMATION 19
506#define FILE_END_OF_FILE_INFORMATION 20
507#define FILE_ALTERNATE_NAME_INFORMATION 21
508#define FILE_STREAM_INFORMATION 22
509#define FILE_PIPE_INFORMATION 23
510#define FILE_PIPE_LOCAL_INFORMATION 24
511#define FILE_PIPE_REMOTE_INFORMATION 25
512#define FILE_MAILSLOT_QUERY_INFORMATION 26
513#define FILE_MAILSLOT_SET_INFORMATION 27
514#define FILE_COMPRESSION_INFORMATION 28
515#define FILE_OBJECT_ID_INFORMATION 29
516/* Number 30 not defined in documents */
517#define FILE_MOVE_CLUSTER_INFORMATION 31
518#define FILE_QUOTA_INFORMATION 32
519#define FILE_REPARSE_POINT_INFORMATION 33
520#define FILE_NETWORK_OPEN_INFORMATION 34
521#define FILE_ATTRIBUTE_TAG_INFORMATION 35
522#define FILE_TRACKING_INFORMATION 36
523#define FILEID_BOTH_DIRECTORY_INFORMATION 37
524#define FILEID_FULL_DIRECTORY_INFORMATION 38
525#define FILE_VALID_DATA_LENGTH_INFORMATION 39
526#define FILE_SHORT_NAME_INFORMATION 40
527#define FILE_SFIO_RESERVE_INFORMATION 44
528#define FILE_SFIO_VOLUME_INFORMATION 45
529#define FILE_HARD_LINK_INFORMATION 46
530#define FILE_NORMALIZED_NAME_INFORMATION 48
531#define FILEID_GLOBAL_TX_DIRECTORY_INFORMATION 50
532#define FILE_STANDARD_LINK_INFORMATION 54
533
534/*
535 * This level 18, although with struct with same name is different from cifs
536 * level 0x107. Level 0x107 has an extra u64 between AccessFlags and
537 * CurrentByteOffset.
538 */
539struct smb2_file_all_info { /* data block encoding of response to level 18 */
540 __le64 CreationTime; /* Beginning of FILE_BASIC_INFO equivalent */
541 __le64 LastAccessTime;
542 __le64 LastWriteTime;
543 __le64 ChangeTime;
544 __le32 Attributes;
545 __u32 Pad1; /* End of FILE_BASIC_INFO_INFO equivalent */
546 __le64 AllocationSize; /* Beginning of FILE_STANDARD_INFO equivalent */
547 __le64 EndOfFile; /* size ie offset to first free byte in file */
548 __le32 NumberOfLinks; /* hard links */
549 __u8 DeletePending;
550 __u8 Directory;
551 __u16 Pad2; /* End of FILE_STANDARD_INFO equivalent */
552 __le64 IndexNumber;
553 __le32 EASize;
554 __le32 AccessFlags;
555 __le64 CurrentByteOffset;
556 __le32 Mode;
557 __le32 AlignmentRequirement;
558 __le32 FileNameLength;
559 char FileName[1];
560} __packed; /* level 18 Query */
561
451#endif /* _SMB2PDU_H */ 562#endif /* _SMB2PDU_H */