fs/smb/client/smb1pdu.h

Source file repositories/reference/linux-study-clean/fs/smb/client/smb1pdu.h

File Facts

System
Linux kernel
Corpus path
fs/smb/client/smb1pdu.h
Extension
.h
Size
69650 bytes
Lines
2341
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.

Dependency Surface

Detected Declarations

Annotated Snippet

struct ntlmssp2_name {
	__le16 type;
	__le16 length;
	__u8 data[];
} __packed;

struct ntlmv2_resp {
	union {
	    char ntlmv2_hash[CIFS_ENCPWD_SIZE];
	    struct {
		__u8 reserved[8];
		__u8 key[CIFS_SERVER_CHALLENGE_SIZE];
	    } __packed challenge;
	} __packed;
	__le32 blob_signature;
	__u32  reserved;
	__le64  time;
	__u64  client_chal; /* random */
	__u32  reserved2;
	/* array of name entries could follow ending in minimum 4 byte struct */
} __packed;


#define CIFS_NETWORK_OPSYS "CIFS VFS Client for Linux"


/*
 * Capabilities bits (for NTLM SessSetup request)
 * See MS-CIFS 2.2.4.52.2
 *     MS-SMB 2.2.4.5.2.1
 */
#define CAP_UNICODE            0x00000004
#define CAP_LARGE_FILES        0x00000008
#define CAP_NT_SMBS            0x00000010
#define CAP_STATUS32           0x00000040
#define CAP_LEVEL_II_OPLOCKS   0x00000080
#define CAP_NT_FIND            0x00000200	/* reserved should be zero
				(because NT_SMBs implies the same thing?) */
#define CAP_BULK_TRANSFER      0x00000400
#define CAP_EXTENDED_SECURITY  0x80000000

/* Action bits */
#define GUEST_LOGIN 1

typedef struct smb_com_tconx_req {
	struct smb_hdr hdr;	/* wct = 4 */
	__u8 AndXCommand;
	__u8 AndXReserved;
	__le16 AndXOffset;
	__le16 Flags;		/* see below */
	__le16 PasswordLength;
	__le16 ByteCount;
	unsigned char Password[];	/* followed by */
/* STRING Path    *//* \\server\share name */
	/* STRING Service */
} __packed TCONX_REQ;

typedef struct smb_com_tconx_rsp {
	struct smb_hdr hdr;	/* wct = 3 , not extended response */
	__u8 AndXCommand;
	__u8 AndXReserved;
	__le16 AndXOffset;
	__le16 OptionalSupport;	/* see below */
	__u16 ByteCount;
	unsigned char Service[];	/* always ASCII, not Unicode */
	/* STRING NativeFileSystem */
} __packed TCONX_RSP;

typedef struct smb_com_tconx_rsp_ext {
	struct smb_hdr hdr;	/* wct = 7, extended response */
	__u8 AndXCommand;
	__u8 AndXReserved;
	__le16 AndXOffset;
	__le16 OptionalSupport;	/* see below */
	__le32 MaximalShareAccessRights;
	__le32 GuestMaximalShareAccessRights;
	__u16 ByteCount;
	unsigned char Service[];	/* always ASCII, not Unicode */
	/* STRING NativeFileSystem */
} __packed TCONX_RSP_EXT;


/* tree connect Flags */
#define DISCONNECT_TID          0x0001
#define TCON_EXTENDED_SIGNATURES 0x0004
#define TCON_EXTENDED_SECINFO   0x0008

/* OptionalSupport bits */
#define SMB_SUPPORT_SEARCH_BITS 0x0001	/* "must have" directory search bits
					 (exclusive searches supported) */

Annotation

Implementation Notes