⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 iscsi_common.h

📁 iscsi源代码 UNH的progect 有initiator端和target端的源码
💻 H
📖 第 1 页 / 共 2 页
字号:
	__u32 target_xfer_tag;	__u32 rsvd3;	__u32 exp_stat_sn;	__u32 rsvd4;	__u32 data_sn;	__u32 offset;	__u32 rsvd5;	__u32 header_digest;	/* holds header CRC if in use */};struct iscsi_targ_scsi_data_in {	/* Draft 20, Section 10.7 SCSI Data-in */	__u8 opcode;	__u8 flags;	__u8 rsvd1;	__u8 status;	__u32 length;	__u64 lun;	__u32 init_task_tag;	__u32 target_xfer_tag;	__u32 stat_sn;	__u32 exp_cmd_sn;	__u32 max_cmd_sn;	__u32 data_sn;	__u32 offset;	__u32 resid;	__u32 header_digest;	/* holds header CRC if in use */};struct iscsi_targ_r2t {		/* Draft 20, Section 10.8 Ready To Transfer (R2T) */	__u8 opcode;	__u8 flags;	__u16 rsvd2;	__u32 length;		/* reserved */	__u64 lun;	__u32 init_task_tag;	__u32 target_xfer_tag;	__u32 stat_sn;	__u32 exp_cmd_sn;	__u32 max_cmd_sn;	__u32 r2t_sn;	__u32 offset;	__u32 xfer_len;	__u32 header_digest;	/* holds header CRC if in use */};struct iscsi_targ_async_msg {	/* Draft 20, Section 10.9 Asynchronous Message */	__u8 opcode;	__u8 flags;	__u16 rsvd2;	__u32 length;	__u64 lun;	__u32 init_task_tag;	/* reserved 0xffffffff */	__u32 rsvd3;	__u32 stat_sn;	__u32 exp_cmd_sn;	__u32 max_cmd_sn;	__u8 async_event;	__u8 async_vcode;	__u16 parameter1;	__u16 parameter2;	__u16 parameter3;	__u32 rsvd5;	__u32 header_digest;	/* holds header CRC if in use */};struct iscsi_init_text_cmnd {	/* Draft 20, Section 10.10 Text Request */	__u8 opcode;	__u8 flags;	__u16 rsvd2;	__u32 length;	__u64 lun;	__u32 init_task_tag;	__u32 target_xfer_tag;	__u32 cmd_sn;	__u32 exp_stat_sn;	__u64 rsvd4;	__u64 rsvd5;	__u32 header_digest;	/* holds header CRC if in use */};struct iscsi_targ_text_rsp {	/* Draft 20, Section 10.11 Text Response */	__u8 opcode;	__u8 flags;	__u16 rsvd2;	__u32 length;	__u64 lun;	__u32 init_task_tag;	__u32 target_xfer_tag;	__u32 stat_sn;	__u32 exp_cmd_sn;	__u32 max_cmd_sn;	__u32 rsvd4;	__u64 rsvd5;	__u32 header_digest;	/* holds header CRC if in use */};struct iscsi_init_login_cmnd {	/* Draft 20, Section 10.12 Login Request */	__u8 opcode;	__u8 flags;	__u8 version_max;	__u8 version_min;	__u32 length;	__u8 isid[6];	__u16 tsih;	__u32 init_task_tag;	__u16 cid;	__u16 rsvd1;	__u32 cmd_sn;	__u32 exp_stat_sn;	__u64 rsvd2;	__u64 rsvd3;	__u32 header_digest;	/* holds header CRC if in use */};struct iscsi_targ_login_rsp {	/* Draft 20, Section 10.13 Login Response */	__u8 opcode;	__u8 flags;	__u8 version_max;	__u8 version_active;	__u32 length;	__u8 isid[6];	__u16 tsih;	__u32 init_task_tag;	__u32 rsvd1;	__u32 stat_sn;	__u32 exp_cmd_sn;	__u32 max_cmd_sn;	__u8 status_class;	__u8 status_detail;	__u16 rsvd2;	__u64 rsvd3;	__u32 header_digest;	/* holds header CRC if in use */};struct iscsi_init_logout_cmnd {	/* Draft 20, Section 10.14 Logout Request */	__u8 opcode;	__u8 flags;		/* reasoncode */	__u16 rsvd1;	__u32 length;	__u64 lun;		/* reserved */	__u32 init_task_tag;	__u16 cid;	__u16 rsvd2;	__u32 cmd_sn;	__u32 exp_stat_sn;	__u64 rsvd4;	__u64 rsvd5;	__u32 header_digest;	/* holds header CRC if in use */};struct iscsi_targ_logout_rsp {	/* Draft 20, Section 10.15 Logout Response */	__u8 opcode;	__u8 flags;	__u8 response;	__u8 rsvd1;	__u32 length;		/* reserved */	__u64 lun;		/* reserved */	__u32 init_task_tag;	__u32 rsvd3;	__u32 stat_sn;	__u32 exp_cmd_sn;	__u32 max_cmd_sn;	__u32 rsvd4;	__u16 time2wait;	__u16 time2retain;	__u32 rsvd5;	__u32 header_digest;	/* holds header CRC if in use */};/* SNACK pdu structure definition - SAI */struct iscsi_init_snack {	/* Draft 20, Section 10.16 SNACK Request */	__u8 opcode;	__u8 flags;	__u16 rsvd1;	__u32 length;	__u64 lun;	__u32 init_task_tag;	__u32 target_xfer_tag;	__u32 rsvd2;	__u32 exp_stat_sn;	__u64 rsvd3;	__u32 begrun;	__u32 runlen;	__u32 header_digest;	/* holds header CRC if in use */};struct iscsi_targ_rjt {		/* Draft 20, Section 10.17 Reject */	__u8 opcode;	__u8 flags;	__u8 reason;	__u8 rsvd2;	__u32 length;	__u64 lun;		/* reserved */	__u32 init_task_tag;	/* reserved 0xffffffff */	__u32 rsvd4;	__u32 stat_sn;	__u32 exp_cmd_sn;	__u32 max_cmd_sn;	__u32 data_sn;	__u64 rsvd5;	__u32 header_digest;	/* holds header CRC if in use */};struct iscsi_init_nopout {	/* Draft 20, Section 10.18 NOP-Out */	__u8 opcode;	__u8 flags;	__u16 rsvd1;	__u32 length;	__u64 lun;	__u32 init_task_tag;	__u32 target_xfer_tag;	__u32 cmd_sn;	__u32 exp_stat_sn;	__u64 rsvd2;	__u64 rsvd3;	__u32 header_digest;	/* holds header CRC if in use */};struct iscsi_targ_nopin {	/* Draft 20, Section 10.19 NOP-In */	__u8 opcode;	__u8 flags;	__u16 rsvd1;	__u32 length;	__u64 lun;	__u32 init_task_tag;	__u32 target_xfer_tag;	__u32 stat_sn;	__u32 exp_cmd_sn;	__u32 max_cmd_sn;	__u32 rsvd2;	__u64 rsvd3;	__u32 header_digest;	/* holds header CRC if in use */};/* Used in Login negotiations */struct generic_pdu {	__u8 opcode;		/*  0 */	__u8 flags;		/*  1 */	__u8 version_max;	/*  2 */	__u8 version_active;	/*  3 for login response PDU */	__u32 length;		/*  4 */	__u8 isid[6];		/*  8 */	__u16 tsih;		/* 14 */	__u32 init_task_tag;	/* 16 */	__u16 CID;		/* 20 */	__u16 rsvd1;		/* 22 */	__u32 cmd_sn;		/* 24 */	__u32 exp_stat_sn;	/* 28 */	__u32 max_cmd_sn;	/* 32 */	__u8 status_class;	/* 36 */	__u8 status_detail;	/* 37 */	__u16 rsvd2;		/* 38 */	__u32 offset;		/* 40 */	__u32 resid;		/* 44 */	__u32 header_digest;	/* 48 holds header CRC if in use */	__u8 *text;	__u32 text_length;};/* Used in generic processing of responses */struct response_pdu {	__u8 opcode;	__u8 flags;	__u8 reason;		/* for reject PDU */	__u8 version_active;	/* for login response PDU */	__u32 length;	__u64 lun;	__u32 init_task_tag;	__u32 target_xfer_tag;	__u32 stat_sn;	__u32 exp_cmd_sn;	__u32 max_cmd_sn;	__u8 status_class;	__u8 status_detail;	__u16 rsvd2;	__u32 offset;	__u32 xfer_len;	__u32 header_digest;	/* holds header CRC if in use */};/* The format of the data returned by the SCSI REQUEST SENSE command. *	SCSI Primary Commands - 2 (SPC-2) *	ANSI Project T10/1236-D *	Revision 20 18 July 2001 *	page 135 *	7.20.1 REQUEST SENSE command introduction *		"Device servers shall be capable of returning 18 bytes of data *		in response to a REQUEST SENSE command." *	page 136 *	7.20.2 Sense data format *		Table 102 -- Response codes 70h and 71h sense data format * *	This structure is the minimum a device can return. *	The file linux/drivers/scsi/scsi.h defines the maximum acceptable as: *		#define SCSI_SENSE_BUFFERSIZE	64 *		unsigned char sr_sense_buffer[SCSI_SENSE_BUFFERSIZE]; *		unsigned char sense_buffer[SCSI_SENSE_BUFFERSIZE]; */struct scsi_sense_data {	__u8 response;		/* sense_buffer[0] -- value f0h or f1h only */	__u8 obsolete;		/* sense_buffer[1] */	__u8 sense_key;		/* sense_buffer[2] -- plus FILEMARK, EOM, ILI */	__u8 info[4];		/* sense_buffer[3-6] */	__u8 asl;		/* sense_buffer[7] -- value 17-7 = 10 */	__u8 cmnd_spec_info[4];	/* sense_buffer[8-11] */	__u8 asc;		/* sense_buffer[12] */	__u8 ascq;		/* sense_buffer[13] */	__u8 f_r_unit_code;	/* sense_buffer[14] */	__u8 sense_specific[3];	/* sense_buffer[15-17] */};/* values of connection-specific parameters used during FFP */struct connection_operational_parameters {	void *dummy;		/* at present, there are none we use */};/* values of session-wide parameters used during FFP */struct session_operational_parameters {	__u16 MaxConnections;	/* [1..65535] */	__u8 InitialR2T;	/* [0,1] == [No,Yes] */	__u8 ImmediateData;	/* [0,1] == [No,Yes] */	__u32 MaxBurstLength;	/* [512..2**24-1] */	__u32 FirstBurstLength;	/* [512..2**24-1] */	__u16 DefaultTime2Wait;	/* [0..3600] */	__u16 DefaultTime2Retain;	/* [0..3600] */	__u16 MaxOutstandingR2T;	/* [1..65535] */	__u8 DataPDUInOrder;	/* [0,1] == [No,Yes] */	__u8 DataSequenceInOrder;	/* [0,1] == [No,Yes] */	__u8 ErrorRecoveryLevel;	/* [0..2] */	__u8 SessionType;	/* [0,1] == [Normal,Discovery] */	__u8 TargetName;	/* number at the end of the target name */};#ifdef __KERNEL__char *string_llx(__u64 x, char *str); void print_init_scsi_cmnd(struct iscsi_init_scsi_cmnd *cmd);void print_targ_scsi_rsp(struct iscsi_targ_scsi_rsp *cmd);void print_init_text_cmnd(struct iscsi_init_text_cmnd *cmd);void print_targ_text_rsp(struct iscsi_targ_text_rsp *cmd);void print_init_login_cmnd(struct iscsi_init_login_cmnd *cmd);void print_targ_login_rsp(struct iscsi_targ_login_rsp *cmd);void print_init_logout_cmnd(struct iscsi_init_logout_cmnd *cmd);void print_targ_logout_rsp(struct iscsi_targ_logout_rsp *cmd);void print_init_scsi_data_out(struct iscsi_init_scsi_data_out *cmd);void print_targ_scsi_data_in(struct iscsi_targ_scsi_data_in *cmd);void print_targ_rjt(struct iscsi_targ_rjt *cmd);void print_init_nopout(struct iscsi_init_nopout *cmd);void print_targ_nopin(struct iscsi_targ_nopin *cmd);void print_targ_r2t(struct iscsi_targ_r2t *cmd);void print_targ_async_msg(struct iscsi_targ_async_msg *cmd);void print_init_task_mgt_command(struct iscsi_init_task_mgt_command *cmd);void print_targ_task_mgt_response(struct iscsi_targ_task_mgt_response *cmd);void print_init_snack(struct iscsi_init_snack *cmd);void print_iscsi_command(void *cmd);/*	returns pointer to printable name of SCSI op code *//*	(Normally this is byte 1 of a SCSI CDB */char *printable_scsi_op(__u8 opcode, char *op_buf);/*	returns pointer to printable name of iSCSI op code, but if this is *	a SCSI Command, return the printable name of the SCSI op from the cdb */char *printable_iscsi_op(void *cmd, char *op_buf);/* * Returns 1 if any luns for this target are in use. * Returns 0 otherwise. */extern int target_in_use(__u32 target_id);#endif#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -