fs/smb/server/smb2pdu.h
Source file repositories/reference/linux-study-clean/fs/smb/server/smb2pdu.h
File Facts
- System
- Linux kernel
- Corpus path
fs/smb/server/smb2pdu.h- Extension
.h- Size
- 11150 bytes
- Lines
- 388
- Domain
- Core OS
- Bucket
- VFS And Filesystem Core
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
ntlmssp.hsmbacl.h
Detected Declarations
struct preauth_integrity_infostruct create_alloc_size_reqstruct create_durable_rspstruct create_posix_rspstruct sockaddr_storage_rspstruct file_object_buf_type1_ioctl_rspstruct file_sparsestruct fs_type_infostruct smb2_file_access_infostruct smb2_file_alignment_infostruct smb2_file_alt_name_infostruct smb2_file_stream_infostruct smb2_file_standard_infostruct smb2_file_ea_infostruct smb2_file_alloc_infostruct smb2_file_disposition_infostruct smb2_file_pos_infostruct smb2_file_mode_infostruct smb2_file_comp_infostruct smb2_file_attr_tag_infostruct smb2_ea_info_reqstruct smb2_ea_infostruct create_ea_buf_reqstruct create_sd_buf_reqstruct smb2_posix_info
Annotated Snippet
struct preauth_integrity_info {
/* PreAuth integrity Hash ID */
__le16 Preauth_HashId;
/* PreAuth integrity Hash Value */
__u8 Preauth_HashValue[SMB2_PREAUTH_HASH_SIZE];
};
/* offset is sizeof smb2_negotiate_rsp but rounded up to 8 bytes. */
#ifdef CONFIG_SMB_SERVER_KERBEROS5
/* sizeof(struct smb2_negotiate_rsp) =
* header(64) + response(64) + GSS_LENGTH(96) + GSS_PADDING(0)
*/
#define OFFSET_OF_NEG_CONTEXT 0xe0
#else
/* sizeof(struct smb2_negotiate_rsp) =
* header(64) + response(64) + GSS_LENGTH(74) + GSS_PADDING(6)
*/
#define OFFSET_OF_NEG_CONTEXT 0xd0
#endif
#define SMB2_SESSION_EXPIRED (0)
#define SMB2_SESSION_IN_PROGRESS BIT(0)
#define SMB2_SESSION_VALID BIT(1)
#define SMB2_SESSION_TIMEOUT (10 * HZ)
/* Apple Defined Contexts */
#define SMB2_CREATE_AAPL "AAPL"
#define DURABLE_HANDLE_MAX_TIMEOUT 300000
struct create_alloc_size_req {
struct create_context_hdr ccontext;
__u8 Name[8];
__le64 AllocationSize;
} __packed;
struct create_durable_rsp {
struct create_context_hdr ccontext;
__u8 Name[8];
union {
__u8 Reserved[8];
__u64 data;
} Data;
} __packed;
/*
* See POSIX-SMB2 2.2.14.2.16
* Link: https://gitlab.com/samba-team/smb3-posix-spec/-/blob/master/smb3_posix_extensions.md
*/
struct create_posix_rsp {
struct create_context_hdr ccontext;
__u8 Name[16];
__le32 nlink;
__le32 reparse_tag;
__le32 mode;
/* SidBuffer contain two sids(Domain sid(28), UNIX group sid(16)) */
u8 SidBuffer[44];
} __packed;
#define SMB2_0_IOCTL_IS_FSCTL 0x00000001
struct sockaddr_storage_rsp {
__le16 Family;
union {
struct smb_sockaddr_in addr4;
struct smb_sockaddr_in6 addr6;
};
} __packed;
struct file_object_buf_type1_ioctl_rsp {
__u8 ObjectId[16];
__u8 BirthVolumeId[16];
__u8 BirthObjectId[16];
__u8 DomainId[16];
} __packed;
struct file_sparse {
__u8 SetSparse;
} __packed;
/* FILE Info response size */
#define FILE_DIRECTORY_INFORMATION_SIZE 1
#define FILE_FULL_DIRECTORY_INFORMATION_SIZE 2
#define FILE_BOTH_DIRECTORY_INFORMATION_SIZE 3
#define FILE_BASIC_INFORMATION_SIZE 40
#define FILE_STANDARD_INFORMATION_SIZE 24
#define FILE_INTERNAL_INFORMATION_SIZE 8
#define FILE_EA_INFORMATION_SIZE 4
#define FILE_ACCESS_INFORMATION_SIZE 4
Annotation
- Immediate include surface: `ntlmssp.h`, `smbacl.h`.
- Detected declarations: `struct preauth_integrity_info`, `struct create_alloc_size_req`, `struct create_durable_rsp`, `struct create_posix_rsp`, `struct sockaddr_storage_rsp`, `struct file_object_buf_type1_ioctl_rsp`, `struct file_sparse`, `struct fs_type_info`, `struct smb2_file_access_info`, `struct smb2_file_alignment_info`.
- Atlas domain: Core OS / VFS And Filesystem Core.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.