From d94720a7f3f5c53d702a727ab8845ac9df6fd22b Mon Sep 17 00:00:00 2001 From: Mike Christie Date: Tue, 6 Mar 2012 03:31:29 -0600 Subject: iscsi tools: Add support to display a host's CHAP list and delete Drivers like qla4xxx store the CHAP info in a table that is managed at the host level. This patch allows you to see and delete the CHAP entries on the host. Patch from: Nilesh Javali [lots of bug fixes by Mike Christie] Signed-off-by: Nilesh Javali Signed-off-by: Vikas Chaudhary --- include/iscsi_err.h | 2 ++ include/iscsi_if.h | 32 +++++++++++++++++++++++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/iscsi_err.h b/include/iscsi_err.h index e038f1c..aabea4e 100644 --- a/include/iscsi_err.h +++ b/include/iscsi_err.h @@ -60,6 +60,8 @@ enum { ISCSI_ERR_ISNS_REG_FAILED = 26, /* operation not supported */ ISCSI_ERR_OP_NOT_SUPP = 27, + /* device or resource in use */ + ISCSI_ERR_BUSY = 28, /* Always last. Indicates end of error code space */ ISCSI_MAX_ERR_VAL, diff --git a/include/iscsi_if.h b/include/iscsi_if.h index 26182aa..ce9ba15 100644 --- a/include/iscsi_if.h +++ b/include/iscsi_if.h @@ -66,8 +66,10 @@ enum iscsi_uevent_e { ISCSI_UEVENT_PATH_UPDATE = UEVENT_BASE + 20, ISCSI_UEVENT_SET_IFACE_PARAMS = UEVENT_BASE + 21, ISCSI_UEVENT_PING = UEVENT_BASE + 22, + ISCSI_UEVENT_GET_CHAP = UEVENT_BASE + 23, + ISCSI_UEVENT_DELETE_CHAP = UEVENT_BASE + 24, - ISCSI_UEVENT_MAX = ISCSI_UEVENT_PING, + ISCSI_UEVENT_MAX = ISCSI_UEVENT_DELETE_CHAP, /* up events */ ISCSI_KEVENT_RECV_PDU = KEVENT_BASE + 1, @@ -205,6 +207,18 @@ struct iscsi_uevent { uint32_t pid; /* unique ping id associated with each ping request */ } iscsi_ping; + struct msg_get_chap { + uint32_t host_no; + uint32_t num_entries; /* number of CHAP entries + * on request, number of + * valid CHAP entries on + * response */ + uint16_t chap_tbl_idx; + } get_chap; + struct msg_delete_chap { + uint32_t host_no; + uint16_t chap_tbl_idx; + } delete_chap; } u; union { /* messages k -> u */ @@ -583,4 +597,20 @@ struct iscsi_stats { __attribute__ ((aligned (sizeof(uint64_t)))); }; +enum chap_type_e { + CHAP_TYPE_OUT, + CHAP_TYPE_IN, +}; + +#define ISCSI_CHAP_AUTH_NAME_MAX_LEN 256 +#define ISCSI_CHAP_AUTH_SECRET_MAX_LEN 256 + +struct iscsi_chap_rec { + uint16_t chap_tbl_idx; + enum chap_type_e chap_type; + char username[ISCSI_CHAP_AUTH_NAME_MAX_LEN]; + uint8_t password[ISCSI_CHAP_AUTH_SECRET_MAX_LEN]; + uint8_t password_length; +}; + #endif -- cgit v1.2.1