linux/fs/smb/server/smb2misc.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 *   Copyright (C) 2016 Namjae Jeon <[email protected]>
 *   Copyright (C) 2018 Samsung Electronics Co., Ltd.
 */

#include "glob.h"
#include "nterr.h"
#include "smb_common.h"
#include "../common/smb2status.h"
#include "mgmt/user_session.h"
#include "connection.h"

static int check_smb2_hdr(struct smb2_hdr *hdr)
{}

/*
 *  The following table defines the expected "StructureSize" of SMB2 requests
 *  in order by SMB2 command.  This is similar to "wct" in SMB/CIFS requests.
 *
 *  Note that commands are defined in smb2pdu.h in le16 but the array below is
 *  indexed by command in host byte order
 */
static const __le16 smb2_req_struct_sizes[NUMBER_OF_SMB2_COMMANDS] =;

/*
 * The size of the variable area depends on the offset and length fields
 * located in different fields for various SMB2 requests. SMB2 requests
 * with no variable length info, show an offset of zero for the offset field.
 */
static const bool has_smb2_data_area[NUMBER_OF_SMB2_COMMANDS] =;

/*
 * Set length of the data area and the offset to arguments.
 * if they are invalid, return error.
 */
static int smb2_get_data_area_len(unsigned int *off, unsigned int *len,
				  struct smb2_hdr *hdr)
{}

/*
 * Calculate the size of the SMB message based on the fixed header
 * portion, the number of word parameters and the data portion of the message.
 */
static int smb2_calc_size(void *buf, unsigned int *len)
{}

static inline int smb2_query_info_req_len(struct smb2_query_info_req *h)
{}

static inline int smb2_set_info_req_len(struct smb2_set_info_req *h)
{}

static inline int smb2_read_req_len(struct smb2_read_req *h)
{}

static inline int smb2_write_req_len(struct smb2_write_req *h)
{}

static inline int smb2_query_dir_req_len(struct smb2_query_directory_req *h)
{}

static inline int smb2_ioctl_req_len(struct smb2_ioctl_req *h)
{}

static inline int smb2_ioctl_resp_len(struct smb2_ioctl_req *h)
{}

static int smb2_validate_credit_charge(struct ksmbd_conn *conn,
				       struct smb2_hdr *hdr)
{}

int ksmbd_smb2_check_message(struct ksmbd_work *work)
{}

int smb2_negotiate_request(struct ksmbd_work *work)
{}