From 062718a9579a10ea7c87e46162f80e3f57e80b67 Mon Sep 17 00:00:00 2001 From: Adheer Chandravanshi Date: Tue, 17 Sep 2013 08:07:32 -0400 Subject: iscsiadm: Add support to set CHAP entry using host chap mode Provide support to add and update CHAP entry using chap submode of iscsiadm host mode. Both, new and update, iscsiadm operations perform the same function. Currently only one entry can be added or updated at a time. Signed-off-by: Adheer Chandravanshi Signed-off-by: Vikas Chaudhary --- include/iscsi_if.h | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/iscsi_if.h b/include/iscsi_if.h index 01d38e7..0284662 100644 --- a/include/iscsi_if.h +++ b/include/iscsi_if.h @@ -74,8 +74,9 @@ enum iscsi_uevent_e { ISCSI_UEVENT_LOGIN_FLASHNODE = UEVENT_BASE + 28, ISCSI_UEVENT_LOGOUT_FLASHNODE = UEVENT_BASE + 29, ISCSI_UEVENT_LOGOUT_FLASHNODE_SID = UEVENT_BASE + 30, + ISCSI_UEVENT_SET_CHAP = UEVENT_BASE + 31, - ISCSI_UEVENT_MAX = ISCSI_UEVENT_LOGOUT_FLASHNODE_SID, + ISCSI_UEVENT_MAX = ISCSI_UEVENT_SET_CHAP, /* up events */ ISCSI_KEVENT_RECV_PDU = KEVENT_BASE + 1, @@ -318,8 +319,16 @@ enum iscsi_param_type { ISCSI_HOST_PARAM, /* iscsi_host_param */ ISCSI_NET_PARAM, /* iscsi_net_param */ ISCSI_FLASHNODE_PARAM, /* iscsi_flashnode_param */ + ISCSI_CHAP_PARAM, /* iscsi_chap_param */ }; +/* structure for minimalist usecase */ +struct iscsi_param_info { + uint32_t len; /* Actual length of the param value */ + uint16_t param; /* iscsi param */ + uint8_t value[0]; /* length sized value follows */ +} __attribute__((__packed__)); + struct iscsi_iface_param_info { uint32_t iface_num; /* iface number, 0 - n */ uint32_t len; /* Actual length of the param */ @@ -748,6 +757,14 @@ enum chap_type_e { CHAP_TYPE_IN, }; +enum iscsi_chap_param { + ISCSI_CHAP_PARAM_INDEX, + ISCSI_CHAP_PARAM_CHAP_TYPE, + ISCSI_CHAP_PARAM_USERNAME, + ISCSI_CHAP_PARAM_PASSWORD, + ISCSI_CHAP_PARAM_PASSWORD_LEN +}; + #define ISCSI_CHAP_AUTH_NAME_MAX_LEN 256 #define ISCSI_CHAP_AUTH_SECRET_MAX_LEN 256 struct iscsi_chap_rec { -- cgit v1.2.1