linux/fs/smb/client/smb2pdu.h

/* SPDX-License-Identifier: LGPL-2.1 */
/*
 *
 *   Copyright (c) International Business Machines  Corp., 2009, 2013
 *                 Etersoft, 2012
 *   Author(s): Steve French ([email protected])
 *              Pavel Shilovsky ([email protected]) 2012
 *
 */

#ifndef _SMB2PDU_H
#define _SMB2PDU_H

#include <net/sock.h>
#include "cifsacl.h"

/* 52 transform hdr + 64 hdr + 88 create rsp */
#define SMB2_TRANSFORM_HEADER_SIZE
#define MAX_SMB2_HDR_SIZE

/* The total header size for SMB2 read and write */
#define SMB2_READWRITE_PDU_HEADER_SIZE

/* See MS-SMB2 2.2.43 */
struct smb2_rdma_transform {} __packed;

/* TransformType */
#define SMB2_RDMA_TRANSFORM_TYPE_ENCRYPTION
#define SMB2_RDMA_TRANSFORM_TYPE_SIGNING

struct smb2_rdma_crypto_transform {} __packed;

/*
 *	Definitions for SMB2 Protocol Data Units (network frames)
 *
 *  See MS-SMB2.PDF specification for protocol details.
 *  The Naming convention is the lower case version of the SMB2
 *  command code name for the struct. Note that structures must be packed.
 *
 */

#define COMPOUND_FID

#define SMB2_SYMLINK_STRUCT_SIZE

#define SYMLINK_ERROR_TAG

struct smb2_symlink_err_rsp {} __packed;

/* SMB 3.1.1 and later dialects. See MS-SMB2 section 2.2.2.1 */
struct smb2_error_context_rsp {} __packed;

/* ErrorId values */
#define SMB2_ERROR_ID_DEFAULT
#define SMB2_ERROR_ID_SHARE_REDIRECT

/* Defines for Type field below (see MS-SMB2 2.2.2.2.2.1) */
#define MOVE_DST_IPADDR_V4
#define MOVE_DST_IPADDR_V6

struct move_dst_ipaddr {} __packed;

struct share_redirect_error_context_rsp {} __packed;

/*
 * Maximum number of iovs we need for an open/create request.
 * [0] : struct smb2_create_req
 * [1] : path
 * [2] : lease context
 * [3] : durable context
 * [4] : posix context
 * [5] : time warp context
 * [6] : query id context
 * [7] : create ea context
 * [8] : compound padding
 */
#define SMB2_CREATE_IOV_SIZE

/*
 * Maximum size of a SMB2_CREATE response is 64 (smb2 header) +
 * 88 (fixed part of create response) + 520 (path) + 208 (contexts) +
 * 2 bytes of padding.
 */
#define MAX_SMB2_CREATE_RESPONSE_SIZE

#define SMB2_LEASE_READ_CACHING_HE
#define SMB2_LEASE_HANDLE_CACHING_HE
#define SMB2_LEASE_WRITE_CACHING_HE


/* See MS-SMB2 2.2.13.2.11 */
/* Flags */
#define SMB2_DHANDLE_FLAG_PERSISTENT
struct durable_context_v2 {} __packed;

struct create_durable_v2 {} __packed;

/* See MS-SMB2 2.2.13.2.12 */
struct durable_reconnect_context_v2 {} __packed;

/* See MS-SMB2 2.2.14.2.12 */
struct durable_reconnect_context_v2_rsp {} __packed;

struct create_durable_handle_reconnect_v2 {} __packed;

/* See MS-SMB2 2.2.13.2.5 */
struct crt_twarp_ctxt {} __packed;

/* See MS-SMB2 2.2.13.2.9 */
struct crt_query_id_ctxt {} __packed;

struct crt_sd_ctxt {} __packed;


#define COPY_CHUNK_RES_KEY_SIZE
struct resume_key_req {} __packed;

/* this goes in the ioctl buffer when doing a copychunk request */
struct copychunk_ioctl {} __packed;

struct copychunk_ioctl_rsp {} __packed;

/* See MS-FSCC 2.3.29 and 2.3.30 */
struct get_retrieval_pointer_count_req {} __packed;

struct get_retrieval_pointer_count_rsp {} __packed;

/*
 * See MS-FSCC 2.3.33 and 2.3.34
 * request is the same as get_retrieval_point_count_req struct above
 */
struct smb3_extents {} __packed;

struct get_retrieval_pointers_refcount_rsp {} __packed;

/* See MS-DFSC 2.2.2 */
struct fsctl_get_dfs_referral_req {} __packed;

/* DFS response is struct get_dfs_refer_rsp */

/* See MS-SMB2 2.2.31.3 */
struct network_resiliency_req {} __packed;
/* There is no buffer for the response ie no struct network_resiliency_rsp */

#define RSS_CAPABLE
#define RDMA_CAPABLE

#define INTERNETWORK
#define INTERNETWORKV6

struct network_interface_info_ioctl_rsp {} __packed;

struct iface_info_ipv4 {} __packed;

struct iface_info_ipv6 {} __packed;

#define NO_FILE_ID

struct compress_ioctl {} __packed;

/*
 * Maximum number of iovs we need for an ioctl request.
 * [0] : struct smb2_ioctl_req
 * [1] : in_data
 */
#define SMB2_IOCTL_IOV_SIZE

/*
 *	PDU query infolevel structure definitions
 *	BB consider moving to a different header
 */

struct smb2_file_full_ea_info {} __packed; /* level 15 Set */

struct smb2_file_reparse_point_info {} __packed;

struct smb2_file_network_open_info {} __packed; /* level 34 Query also similar returned in close rsp and open rsp */

/* See MS-FSCC 2.4.21 */
struct smb2_file_id_information {} __packed; /* level 59 */

/* See MS-FSCC 2.4.18 */
struct smb2_file_id_extd_directory_info {} __packed; /* level 60 */

extern char smb2_padding[7];

/* equivalent of the contents of SMB3.1.1 POSIX open context response */
struct create_posix_rsp {} __packed;

#define SMB2_QUERY_DIRECTORY_IOV_SIZE

/*
 * SMB2-only POSIX info level for query dir
 *
 * See posix_info_sid_size(), posix_info_extra_size() and
 * posix_info_parse() to help with the handling of this struct.
 */
struct smb2_posix_info {} __packed;

/*
 * Parsed version of the above struct. Allows direct access to the
 * variable length fields
 */
struct smb2_posix_info_parsed {};

struct smb2_create_ea_ctx {} __packed;

#define SMB2_WSL_XATTR_UID
#define SMB2_WSL_XATTR_GID
#define SMB2_WSL_XATTR_MODE
#define SMB2_WSL_XATTR_DEV
#define SMB2_WSL_XATTR_NAME_LEN
#define SMB2_WSL_NUM_XATTRS

#define SMB2_WSL_XATTR_UID_SIZE
#define SMB2_WSL_XATTR_GID_SIZE
#define SMB2_WSL_XATTR_MODE_SIZE
#define SMB2_WSL_XATTR_DEV_SIZE

#define SMB2_WSL_MIN_QUERY_EA_RESP_SIZE

#define SMB2_WSL_MAX_QUERY_EA_RESP_SIZE

#endif				/* _SMB2PDU_H */