linux/drivers/target/iscsi/iscsi_target_parameters.h

/* SPDX-License-Identifier: GPL-2.0 */
#ifndef ISCSI_PARAMETERS_H
#define ISCSI_PARAMETERS_H

#include <linux/types.h>
#include <scsi/iscsi_proto.h>

struct iscsi_extra_response {} ____cacheline_aligned;

struct iscsi_param {} ____cacheline_aligned;

struct iscsit_conn;
struct iscsi_conn_ops;
struct iscsi_param_list;
struct iscsi_sess_ops;

extern int iscsi_login_rx_data(struct iscsit_conn *, char *, int);
extern int iscsi_login_tx_data(struct iscsit_conn *, char *, char *, int);
extern void iscsi_dump_conn_ops(struct iscsi_conn_ops *);
extern void iscsi_dump_sess_ops(struct iscsi_sess_ops *);
extern void iscsi_print_params(struct iscsi_param_list *);
extern int iscsi_create_default_params(struct iscsi_param_list **);
extern int iscsi_set_keys_to_negotiate(struct iscsi_param_list *, bool);
extern int iscsi_set_keys_irrelevant_for_discovery(struct iscsi_param_list *);
extern int iscsi_copy_param_list(struct iscsi_param_list **,
			struct iscsi_param_list *, int);
extern int iscsi_change_param_value(char *, struct iscsi_param_list *, int);
extern void iscsi_release_param_list(struct iscsi_param_list *);
extern struct iscsi_param *iscsi_find_param_from_key(char *, struct iscsi_param_list *);
extern int iscsi_extract_key_value(char *, char **, char **);
extern int iscsi_update_param_value(struct iscsi_param *, char *);
extern int iscsi_decode_text_input(u8, u8, char *, u32, struct iscsit_conn *);
extern int iscsi_encode_text_output(u8, u8, char *, u32 *,
			struct iscsi_param_list *, bool);
extern int iscsi_check_negotiated_keys(struct iscsi_param_list *);
extern void iscsi_set_connection_parameters(struct iscsi_conn_ops *,
			struct iscsi_param_list *);
extern void iscsi_set_session_parameters(struct iscsi_sess_ops *,
			struct iscsi_param_list *, int);

#define YES
#define NO
#define ALL
#define IRRELEVANT
#define NONE
#define NOTUNDERSTOOD
#define REJECT

/*
 * The Parameter Names.
 */
#define AUTHMETHOD
#define HEADERDIGEST
#define DATADIGEST
#define MAXCONNECTIONS
#define SENDTARGETS
#define TARGETNAME
#define INITIATORNAME
#define TARGETALIAS
#define INITIATORALIAS
#define TARGETADDRESS
#define TARGETPORTALGROUPTAG
#define INITIALR2T
#define IMMEDIATEDATA
#define MAXRECVDATASEGMENTLENGTH
#define MAXXMITDATASEGMENTLENGTH
#define MAXBURSTLENGTH
#define FIRSTBURSTLENGTH
#define DEFAULTTIME2WAIT
#define DEFAULTTIME2RETAIN
#define MAXOUTSTANDINGR2T
#define DATAPDUINORDER
#define DATASEQUENCEINORDER
#define ERRORRECOVERYLEVEL
#define SESSIONTYPE
#define IFMARKER
#define OFMARKER
#define IFMARKINT
#define OFMARKINT

/*
 * Parameter names of iSCSI Extentions for RDMA (iSER).  See RFC-5046
 */
#define RDMAEXTENSIONS
#define INITIATORRECVDATASEGMENTLENGTH
#define TARGETRECVDATASEGMENTLENGTH

/*
 * For AuthMethod.
 */
#define KRB5
#define SPKM1
#define SPKM2
#define SRP
#define CHAP

/*
 * Initial values for Parameter Negotiation.
 */
#define INITIAL_AUTHMETHOD
#define INITIAL_HEADERDIGEST
#define INITIAL_DATADIGEST
#define INITIAL_MAXCONNECTIONS
#define INITIAL_SENDTARGETS
#define INITIAL_TARGETNAME
#define INITIAL_INITIATORNAME
#define INITIAL_TARGETALIAS
#define INITIAL_INITIATORALIAS
#define INITIAL_TARGETADDRESS
#define INITIAL_TARGETPORTALGROUPTAG
#define INITIAL_INITIALR2T
#define INITIAL_IMMEDIATEDATA
#define INITIAL_MAXRECVDATASEGMENTLENGTH
/*
 * Match outgoing MXDSL default to incoming Open-iSCSI default
 */
#define INITIAL_MAXXMITDATASEGMENTLENGTH
#define INITIAL_MAXBURSTLENGTH
#define INITIAL_FIRSTBURSTLENGTH
#define INITIAL_DEFAULTTIME2WAIT
#define INITIAL_DEFAULTTIME2RETAIN
#define INITIAL_MAXOUTSTANDINGR2T
#define INITIAL_DATAPDUINORDER
#define INITIAL_DATASEQUENCEINORDER
#define INITIAL_ERRORRECOVERYLEVEL
#define INITIAL_SESSIONTYPE
#define INITIAL_IFMARKER
#define INITIAL_OFMARKER
#define INITIAL_IFMARKINT
#define INITIAL_OFMARKINT

/*
 * Initial values for iSER parameters following RFC-5046 Section 6
 */
#define INITIAL_RDMAEXTENSIONS
#define INITIAL_INITIATORRECVDATASEGMENTLENGTH
#define INITIAL_TARGETRECVDATASEGMENTLENGTH

/*
 * For [Header,Data]Digests.
 */
#define CRC32C

/*
 * For SessionType.
 */
#define DISCOVERY
#define NORMAL

/*
 * struct iscsi_param->use
 */
#define USE_LEADING_ONLY
#define USE_INITIAL_ONLY
#define USE_ALL

#define IS_USE_LEADING_ONLY(p)
#define IS_USE_INITIAL_ONLY(p)
#define IS_USE_ALL(p)

#define SET_USE_INITIAL_ONLY(p)

/*
 * struct iscsi_param->sender
 */
#define SENDER_INITIATOR
#define SENDER_TARGET
#define SENDER_BOTH
/* Used in iscsi_check_key() */
#define SENDER_RECEIVER

#define IS_SENDER_INITIATOR(p)
#define IS_SENDER_TARGET(p)
#define IS_SENDER_BOTH(p)

/*
 * struct iscsi_param->scope
 */
#define SCOPE_CONNECTION_ONLY
#define SCOPE_SESSION_WIDE

#define IS_SCOPE_CONNECTION_ONLY(p)
#define IS_SCOPE_SESSION_WIDE(p)

/*
 * struct iscsi_param->phase
 */
#define PHASE_SECURITY
#define PHASE_OPERATIONAL
#define PHASE_DECLARATIVE
#define PHASE_FFP0

#define IS_PHASE_SECURITY(p)
#define IS_PHASE_OPERATIONAL(p)
#define IS_PHASE_DECLARATIVE(p)
#define IS_PHASE_FFP0(p)

/*
 * struct iscsi_param->type
 */
#define TYPE_BOOL_AND
#define TYPE_BOOL_OR
#define TYPE_NUMBER
#define TYPE_NUMBER_RANGE
#define TYPE_STRING
#define TYPE_VALUE_LIST

#define IS_TYPE_BOOL_AND(p)
#define IS_TYPE_BOOL_OR(p)
#define IS_TYPE_NUMBER(p)
#define IS_TYPE_NUMBER_RANGE(p)
#define IS_TYPE_STRING(p)
#define IS_TYPE_VALUE_LIST(p)

/*
 * struct iscsi_param->type_range
 */
#define TYPERANGE_BOOL_AND
#define TYPERANGE_BOOL_OR
#define TYPERANGE_0_TO_2
#define TYPERANGE_0_TO_3600
#define TYPERANGE_0_TO_32767
#define TYPERANGE_0_TO_65535
#define TYPERANGE_1_TO_65535
#define TYPERANGE_2_TO_3600
#define TYPERANGE_512_TO_16777215
#define TYPERANGE_AUTH
#define TYPERANGE_DIGEST
#define TYPERANGE_ISCSINAME
#define TYPERANGE_SESSIONTYPE
#define TYPERANGE_TARGETADDRESS
#define TYPERANGE_UTF8

#define IS_TYPERANGE_0_TO_2(p)
#define IS_TYPERANGE_0_TO_3600(p)
#define IS_TYPERANGE_0_TO_32767(p)
#define IS_TYPERANGE_0_TO_65535(p)
#define IS_TYPERANGE_1_TO_65535(p)
#define IS_TYPERANGE_2_TO_3600(p)
#define IS_TYPERANGE_512_TO_16777215(p)
#define IS_TYPERANGE_AUTH_PARAM(p)
#define IS_TYPERANGE_DIGEST_PARAM(p)
#define IS_TYPERANGE_SESSIONTYPE(p)

/*
 * struct iscsi_param->state
 */
#define PSTATE_ACCEPTOR
#define PSTATE_NEGOTIATE
#define PSTATE_PROPOSER
#define PSTATE_IRRELEVANT
#define PSTATE_REJECT
#define PSTATE_REPLY_OPTIONAL
#define PSTATE_RESPONSE_GOT
#define PSTATE_RESPONSE_SENT

#define IS_PSTATE_ACCEPTOR(p)
#define IS_PSTATE_NEGOTIATE(p)
#define IS_PSTATE_PROPOSER(p)
#define IS_PSTATE_IRRELEVANT(p)
#define IS_PSTATE_REJECT(p)
#define IS_PSTATE_REPLY_OPTIONAL(p)
#define IS_PSTATE_RESPONSE_GOT(p)
#define IS_PSTATE_RESPONSE_SENT(p)

#define SET_PSTATE_ACCEPTOR(p)
#define SET_PSTATE_NEGOTIATE(p)
#define SET_PSTATE_PROPOSER(p)
#define SET_PSTATE_IRRELEVANT(p)
#define SET_PSTATE_REJECT(p)
#define SET_PSTATE_REPLY_OPTIONAL(p)
#define SET_PSTATE_RESPONSE_GOT(p)
#define SET_PSTATE_RESPONSE_SENT(p)

#endif /* ISCSI_PARAMETERS_H */