a288e4f
From 66d9f120e26d49329667e4b9f5a84076c4f66a6e Mon Sep 17 00:00:00 2001
a288e4f
From: Harish Zunjarrao <harish.zunjarrao@qlogic.com>
a288e4f
Date: Fri, 18 Oct 2013 09:29:24 -0400
a288e4f
Subject: [PATCH] iscsi tools: Additional parameters for network settings
a288e4f
a288e4f
Signed-off-by: Harish Zunjarrao <harish.zunjarrao@qlogic.com>
a288e4f
Signed-off-by: Adheer Chandravanshi <adheer.chandravanshi@qlogic.com>
a288e4f
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
a288e4f
---
a288e4f
 usr/config.h      |  50 +++-
a288e4f
 usr/idbm.c        |  76 +++++
a288e4f
 usr/idbm_fields.h |  49 ++++
a288e4f
 usr/iface.c       | 847 ++++++++++++++++++++++++++++++++++++++++++++++++------
a288e4f
 usr/iscsi_sysfs.c | 200 +++++++++++++
a288e4f
 5 files changed, 1132 insertions(+), 90 deletions(-)
a288e4f
a288e4f
diff --git a/usr/config.h b/usr/config.h
a288e4f
index d457bdd..fd31a54 100644
a288e4f
--- a/usr/config.h
a288e4f
+++ b/usr/config.h
a288e4f
@@ -232,11 +232,59 @@ typedef struct iface_rec {
a288e4f
 							   * 1 = enable */
a288e4f
 	uint16_t		mtu;
a288e4f
 	uint16_t		port;
a288e4f
+	char			delayed_ack[ISCSI_MAX_STR_LEN];
a288e4f
+	char			nagle[ISCSI_MAX_STR_LEN];
a288e4f
+	char			tcp_wsf_state[ISCSI_MAX_STR_LEN];
a288e4f
+	uint8_t			tcp_wsf;
a288e4f
+	uint8_t			tcp_timer_scale;
a288e4f
+	char			tcp_timestamp[ISCSI_MAX_STR_LEN];
a288e4f
+	char			dhcp_dns[ISCSI_MAX_STR_LEN];
a288e4f
+	char			dhcp_slp_da[ISCSI_MAX_STR_LEN];
a288e4f
+	char			tos_state[ISCSI_MAX_STR_LEN];
a288e4f
+	uint8_t			tos;
a288e4f
+	char			gratuitous_arp[ISCSI_MAX_STR_LEN];
a288e4f
+	char			dhcp_alt_client_id_state[ISCSI_MAX_STR_LEN];
a288e4f
+	char			dhcp_alt_client_id[ISCSI_MAX_STR_LEN];
a288e4f
+	char			dhcp_req_vendor_id_state[ISCSI_MAX_STR_LEN];
a288e4f
+	char			dhcp_vendor_id_state[ISCSI_MAX_STR_LEN];
a288e4f
+	char			dhcp_vendor_id[ISCSI_MAX_STR_LEN];
a288e4f
+	char			dhcp_learn_iqn[ISCSI_MAX_STR_LEN];
a288e4f
+	char			fragmentation[ISCSI_MAX_STR_LEN];
a288e4f
+	char			incoming_forwarding[ISCSI_MAX_STR_LEN];
a288e4f
+	uint8_t			ttl;
a288e4f
+	char			gratuitous_neighbor_adv[ISCSI_MAX_STR_LEN];
a288e4f
+	char			redirect[ISCSI_MAX_STR_LEN];
a288e4f
+	char			mld[ISCSI_MAX_STR_LEN];
a288e4f
+	uint32_t		flow_label;
a288e4f
+	uint32_t		traffic_class;
a288e4f
+	uint8_t			hop_limit;
a288e4f
+	uint32_t		nd_reachable_tmo;
a288e4f
+	uint32_t		nd_rexmit_time;
a288e4f
+	uint32_t		nd_stale_tmo;
a288e4f
+	uint8_t			dup_addr_detect_cnt;
a288e4f
+	uint32_t		router_adv_link_mtu;
a288e4f
+	uint16_t		def_task_mgmt_tmo;
a288e4f
+	char			header_digest[ISCSI_MAX_STR_LEN];
a288e4f
+	char			data_digest[ISCSI_MAX_STR_LEN];
a288e4f
+	char			immediate_data[ISCSI_MAX_STR_LEN];
a288e4f
+	char			initial_r2t[ISCSI_MAX_STR_LEN];
a288e4f
+	char			data_seq_inorder[ISCSI_MAX_STR_LEN];
a288e4f
+	char			data_pdu_inorder[ISCSI_MAX_STR_LEN];
a288e4f
+	uint8_t			erl;
a288e4f
+	uint32_t		max_recv_dlength;
a288e4f
+	uint32_t		first_burst_len;
a288e4f
+	uint16_t		max_out_r2t;
a288e4f
+	uint32_t		max_burst_len;
a288e4f
+	char			chap_auth[ISCSI_MAX_STR_LEN];
a288e4f
+	char			bidi_chap[ISCSI_MAX_STR_LEN];
a288e4f
+	char			strict_login_comp[ISCSI_MAX_STR_LEN];
a288e4f
+	char			discovery_auth[ISCSI_MAX_STR_LEN];
a288e4f
+	char			discovery_logout[ISCSI_MAX_STR_LEN];
a288e4f
 	char			port_state[ISCSI_MAX_STR_LEN];
a288e4f
 	char			port_speed[ISCSI_MAX_STR_LEN];
a288e4f
 	/*
a288e4f
 	 * TODO: we may have to make this bigger and interconnect
a288e4f
-	 * specific for infinniband 
a288e4f
+	 * specific for infiniband
a288e4f
 	 */
a288e4f
 	char			hwaddress[ISCSI_HWADDRESS_BUF_SIZE];
a288e4f
 	char			transport_name[ISCSI_TRANSPORT_NAME_MAXLEN];
a288e4f
diff --git a/usr/idbm.c b/usr/idbm.c
a288e4f
index 6b6f57c..4428ebe 100644
a288e4f
--- a/usr/idbm.c
a288e4f
+++ b/usr/idbm.c
a288e4f
@@ -454,6 +454,82 @@ void idbm_recinfo_iface(iface_rec_t *r, recinfo_t *ri)
a288e4f
 	__recinfo_int(IFACE_NUM, ri, r, iface_num, IDBM_SHOW, num, 1);
a288e4f
 	__recinfo_uint16(IFACE_MTU, ri, r, mtu, IDBM_SHOW, num, 1);
a288e4f
 	__recinfo_uint16(IFACE_PORT, ri, r, port, IDBM_SHOW, num, 1);
a288e4f
+	__recinfo_str(IFACE_DHCP_ALT_CID, ri, r, dhcp_alt_client_id_state,
a288e4f
+		      IDBM_SHOW, num, 1);
a288e4f
+	__recinfo_str(IFACE_DHCP_ALT_CID_STR, ri, r, dhcp_alt_client_id,
a288e4f
+		      IDBM_SHOW, num, 1);
a288e4f
+	__recinfo_str(IFACE_DHCP_DNS, ri, r, dhcp_dns, IDBM_SHOW, num, 1);
a288e4f
+	__recinfo_str(IFACE_DHCP_LEARN_IQN, ri, r, dhcp_learn_iqn, IDBM_SHOW,
a288e4f
+		      num, 1);
a288e4f
+	__recinfo_str(IFACE_DHCP_REQ_VID, ri, r, dhcp_req_vendor_id_state,
a288e4f
+		      IDBM_SHOW, num, 1);
a288e4f
+	__recinfo_str(IFACE_DHCP_VID, ri, r, dhcp_vendor_id_state, IDBM_SHOW,
a288e4f
+		      num, 1);
a288e4f
+	__recinfo_str(IFACE_DHCP_VID_STR, ri, r, dhcp_vendor_id, IDBM_SHOW,
a288e4f
+		      num, 1);
a288e4f
+	__recinfo_str(IFACE_DHCP_SLP_DA, ri, r, dhcp_slp_da, IDBM_SHOW, num, 1);
a288e4f
+	__recinfo_str(IFACE_FRAGMENTATION, ri, r, fragmentation, IDBM_SHOW,
a288e4f
+		      num, 1);
a288e4f
+	__recinfo_str(IFACE_GRAT_ARP, ri, r, gratuitous_arp, IDBM_SHOW, num, 1);
a288e4f
+	__recinfo_str(IFACE_IN_FORWARD, ri, r, incoming_forwarding, IDBM_SHOW,
a288e4f
+		      num, 1);
a288e4f
+	__recinfo_str(IFACE_TOS_STATE, ri, r, tos_state, IDBM_SHOW, num, 1);
a288e4f
+	__recinfo_uint8(IFACE_TOS, ri, r, tos, IDBM_SHOW, num, 1);
a288e4f
+	__recinfo_uint8(IFACE_TTL, ri, r, ttl, IDBM_SHOW, num, 1);
a288e4f
+	__recinfo_uint8(IFACE_DUP_ADDR_DETECT_CNT, ri, r, dup_addr_detect_cnt,
a288e4f
+			IDBM_SHOW, num, 1);
a288e4f
+	__recinfo_uint32(IFACE_FLOW_LABEL, ri, r, flow_label, IDBM_SHOW,
a288e4f
+			 num, 1);
a288e4f
+	__recinfo_str(IFACE_GRAT_NEIGHBOR_ADV, ri, r, gratuitous_neighbor_adv,
a288e4f
+		      IDBM_SHOW, num, 1);
a288e4f
+	__recinfo_uint8(IFACE_HOP_LIMIT, ri, r, hop_limit, IDBM_SHOW, num, 1);
a288e4f
+	__recinfo_str(IFACE_MLD, ri, r, mld, IDBM_SHOW, num, 1);
a288e4f
+	__recinfo_uint32(IFACE_ND_REACHABLE_TMO, ri, r, nd_reachable_tmo,
a288e4f
+			 IDBM_SHOW, num, 1);
a288e4f
+	__recinfo_uint32(IFACE_ND_REXMIT_TIME, ri, r, nd_rexmit_time, IDBM_SHOW,
a288e4f
+			 num, 1);
a288e4f
+	__recinfo_uint32(IFACE_ND_STALE_TMO, ri, r, nd_stale_tmo, IDBM_SHOW,
a288e4f
+			 num, 1);
a288e4f
+	__recinfo_uint32(IFACE_RTR_ADV_LINK_MTU, ri, r, router_adv_link_mtu,
a288e4f
+			 IDBM_SHOW, num, 1);
a288e4f
+	__recinfo_uint8(IFACE_TRAFFIC_CLASS, ri, r, traffic_class, IDBM_SHOW,
a288e4f
+			num, 1);
a288e4f
+	__recinfo_str(IFACE_DELAYED_ACK, ri, r, delayed_ack, IDBM_SHOW, num, 1);
a288e4f
+	__recinfo_str(IFACE_TCP_NAGLE, ri, r, nagle, IDBM_SHOW, num, 1);
a288e4f
+	__recinfo_str(IFACE_TCP_WSF_STATE, ri, r, tcp_wsf_state, IDBM_SHOW,
a288e4f
+		      num, 1);
a288e4f
+	__recinfo_uint8(IFACE_TCP_WSF, ri, r, tcp_wsf, IDBM_SHOW, num, 1);
a288e4f
+	__recinfo_uint8(IFACE_TCP_TIMER_SCALE, ri, r, tcp_timer_scale,
a288e4f
+			IDBM_SHOW, num, 1);
a288e4f
+	__recinfo_str(IFACE_TCP_TIMESTAMP, ri, r, tcp_timestamp, IDBM_SHOW,
a288e4f
+		      num, 1);
a288e4f
+	__recinfo_str(IFACE_REDIRECT, ri, r, redirect, IDBM_SHOW, num, 1);
a288e4f
+	__recinfo_uint16(IFACE_DEF_TMF_TMO, ri, r, def_task_mgmt_tmo, IDBM_SHOW,
a288e4f
+			 num, 1);
a288e4f
+	__recinfo_str(IFACE_HDRDGST, ri, r, header_digest, IDBM_SHOW, num, 1);
a288e4f
+	__recinfo_str(IFACE_DATADGST, ri, r, data_digest, IDBM_SHOW, num, 1);
a288e4f
+	__recinfo_str(IFACE_IMM_DATA, ri, r, immediate_data, IDBM_SHOW, num, 1);
a288e4f
+	__recinfo_str(IFACE_INITIAL_R2T, ri, r, initial_r2t, IDBM_SHOW, num, 1);
a288e4f
+	__recinfo_str(IFACE_DSEQ_INORDER, ri, r, data_seq_inorder, IDBM_SHOW,
a288e4f
+		      num, 1);
a288e4f
+	__recinfo_str(IFACE_DPDU_INORDER, ri, r, data_pdu_inorder, IDBM_SHOW,
a288e4f
+		      num, 1);
a288e4f
+	__recinfo_uint8(IFACE_ERL, ri, r, erl, IDBM_SHOW, num, 1);
a288e4f
+	__recinfo_uint32(IFACE_MAX_RECV_DLEN, ri, r, max_recv_dlength,
a288e4f
+			 IDBM_SHOW, num, 1);
a288e4f
+	__recinfo_uint32(IFACE_FIRST_BURST, ri, r, first_burst_len, IDBM_SHOW,
a288e4f
+			 num, 1);
a288e4f
+	__recinfo_uint16(IFACE_MAX_R2T, ri, r, max_out_r2t, IDBM_SHOW, num, 1);
a288e4f
+	__recinfo_uint32(IFACE_MAX_BURST, ri, r, max_burst_len, IDBM_SHOW,
a288e4f
+			 num, 1);
a288e4f
+	__recinfo_str(IFACE_CHAP_AUTH, ri, r, chap_auth, IDBM_SHOW, num, 1);
a288e4f
+	__recinfo_str(IFACE_BIDI_CHAP, ri, r, bidi_chap, IDBM_SHOW, num, 1);
a288e4f
+	__recinfo_str(IFACE_STRICT_LOGIN_COMP, ri, r, strict_login_comp,
a288e4f
+		      IDBM_SHOW, num, 1);
a288e4f
+	__recinfo_str(IFACE_DISCOVERY_AUTH, ri, r, discovery_auth, IDBM_SHOW,
a288e4f
+		      num, 1);
a288e4f
+	__recinfo_str(IFACE_DISCOVERY_LOGOUT, ri, r, discovery_logout,
a288e4f
+		      IDBM_SHOW, num, 1);
a288e4f
 }
a288e4f
 
a288e4f
 void idbm_recinfo_host_chap(struct iscsi_chap_rec *r, recinfo_t *ri)
a288e4f
diff --git a/usr/idbm_fields.h b/usr/idbm_fields.h
a288e4f
index 179dda8..5790a03 100644
a288e4f
--- a/usr/idbm_fields.h
a288e4f
+++ b/usr/idbm_fields.h
a288e4f
@@ -89,6 +89,55 @@
a288e4f
 #define IFACE_NUM		"iface.iface_num"
a288e4f
 #define IFACE_MTU		"iface.mtu"
a288e4f
 #define IFACE_PORT		"iface.port"
a288e4f
+#define IFACE_DELAYED_ACK	"iface.delayed_ack"
a288e4f
+#define IFACE_TCP_NAGLE		"iface.tcp_nagle"
a288e4f
+#define IFACE_TCP_WSF_STATE	"iface.tcp_wsf_state"
a288e4f
+#define IFACE_TCP_WSF		"iface.tcp_wsf"
a288e4f
+#define IFACE_TCP_TIMER_SCALE	"iface.tcp_timer_scale"
a288e4f
+#define IFACE_TCP_TIMESTAMP	"iface.tcp_timestamp"
a288e4f
+#define IFACE_DHCP_DNS		"iface.dhcp_dns"
a288e4f
+#define IFACE_DHCP_SLP_DA	"iface.dhcp_slp_da"
a288e4f
+#define IFACE_TOS_STATE		"iface.tos_state"
a288e4f
+#define IFACE_TOS		"iface.tos"
a288e4f
+#define IFACE_GRAT_ARP		"iface.gratuitous_arp"
a288e4f
+#define IFACE_DHCP_ALT_CID	"iface.dhcp_alt_client_id_state"
a288e4f
+#define IFACE_DHCP_ALT_CID_STR	"iface.dhcp_alt_client_id"
a288e4f
+#define IFACE_DHCP_REQ_VID	"iface.dhcp_req_vendor_id_state"
a288e4f
+#define IFACE_DHCP_VID		"iface.dhcp_vendor_id_state"
a288e4f
+#define IFACE_DHCP_VID_STR	"iface.dhcp_vendor_id"
a288e4f
+#define IFACE_DHCP_LEARN_IQN	"iface.dhcp_learn_iqn"
a288e4f
+#define IFACE_FRAGMENTATION	"iface.fragmentation"
a288e4f
+#define IFACE_IN_FORWARD	"iface.incoming_forwarding"
a288e4f
+#define IFACE_TTL		"iface.ttl"
a288e4f
+#define IFACE_GRAT_NEIGHBOR_ADV	"iface.gratuitous_neighbor_adv"
a288e4f
+#define IFACE_REDIRECT		"iface.redirect"
a288e4f
+#define IFACE_IGNORE_ICMP_ECHO_REQ	"iface.ignore_icmp_echo_request"
a288e4f
+#define IFACE_MLD		"iface.mld"
a288e4f
+#define IFACE_FLOW_LABEL	"iface.flow_label"
a288e4f
+#define IFACE_TRAFFIC_CLASS	"iface.traffic_class"
a288e4f
+#define IFACE_HOP_LIMIT		"iface.hop_limit"
a288e4f
+#define IFACE_ND_REACHABLE_TMO	"iface.nd_reachable_tmo"
a288e4f
+#define IFACE_ND_REXMIT_TIME	"iface.nd_rexmit_time"
a288e4f
+#define IFACE_ND_STALE_TMO	"iface.nd_stale_tmo"
a288e4f
+#define IFACE_DUP_ADDR_DETECT_CNT	"iface.dup_addr_detect_cnt"
a288e4f
+#define IFACE_RTR_ADV_LINK_MTU	"iface.router_adv_link_mtu"
a288e4f
+#define IFACE_DEF_TMF_TMO	"iface.def_task_mgmt_timeout"
a288e4f
+#define IFACE_HDRDGST		"iface.header_digest"
a288e4f
+#define IFACE_DATADGST		"iface.data_digest"
a288e4f
+#define IFACE_IMM_DATA		"iface.immediate_data"
a288e4f
+#define IFACE_INITIAL_R2T	"iface.initial_r2t"
a288e4f
+#define IFACE_DSEQ_INORDER	"iface.data_seq_inorder"
a288e4f
+#define IFACE_DPDU_INORDER	"iface.data_pdu_inorder"
a288e4f
+#define IFACE_ERL		"iface.erl"
a288e4f
+#define IFACE_MAX_RECV_DLEN	"iface.max_receive_data_len"
a288e4f
+#define IFACE_FIRST_BURST	"iface.first_burst_len"
a288e4f
+#define IFACE_MAX_R2T		"iface.max_outstanding_r2t"
a288e4f
+#define IFACE_MAX_BURST		"iface.max_burst_len"
a288e4f
+#define IFACE_CHAP_AUTH		"iface.chap_auth"
a288e4f
+#define IFACE_BIDI_CHAP		"iface.bidi_chap"
a288e4f
+#define IFACE_STRICT_LOGIN_COMP	"iface.strict_login_compliance"
a288e4f
+#define IFACE_DISCOVERY_AUTH	"iface.discovery_auth"
a288e4f
+#define IFACE_DISCOVERY_LOGOUT	"iface.discovery_logout"
a288e4f
 
a288e4f
 /* discovery fields */
a288e4f
 #define DISC_STARTUP		"discovery.startup"
a288e4f
diff --git a/usr/iface.c b/usr/iface.c
a288e4f
index 55b0dd4..87ac875 100644
a288e4f
--- a/usr/iface.c
a288e4f
+++ b/usr/iface.c
a288e4f
@@ -601,6 +601,105 @@ void iface_copy(struct iface_rec *dst, struct iface_rec *src)
a288e4f
 		dst->mtu = src->mtu;
a288e4f
 	if (src->port)
a288e4f
 		dst->port = src->port;
a288e4f
+	if (strlen(src->delayed_ack))
a288e4f
+		strcpy(dst->delayed_ack, src->delayed_ack);
a288e4f
+	if (strlen(src->nagle))
a288e4f
+		strcpy(dst->nagle, src->nagle);
a288e4f
+	if (strlen(src->tcp_wsf_state))
a288e4f
+		strcpy(dst->tcp_wsf_state, src->tcp_wsf_state);
a288e4f
+	if (src->tcp_wsf)
a288e4f
+		dst->tcp_wsf = src->tcp_wsf;
a288e4f
+	if (src->tcp_timer_scale)
a288e4f
+		dst->tcp_timer_scale = src->tcp_timer_scale;
a288e4f
+	if (strlen(src->tcp_timestamp))
a288e4f
+		strcpy(dst->tcp_timestamp, src->tcp_timestamp);
a288e4f
+	if (strlen(src->dhcp_dns))
a288e4f
+		strcpy(dst->dhcp_dns, src->dhcp_dns);
a288e4f
+	if (strlen(src->dhcp_slp_da))
a288e4f
+		strcpy(dst->dhcp_slp_da, src->dhcp_slp_da);
a288e4f
+	if (strlen(src->tos_state))
a288e4f
+		strcpy(dst->tos_state, src->tos_state);
a288e4f
+	if (src->tos)
a288e4f
+		dst->tos = src->tos;
a288e4f
+	if (strlen(src->gratuitous_arp))
a288e4f
+		strcpy(dst->gratuitous_arp, src->gratuitous_arp);
a288e4f
+	if (strlen(src->dhcp_alt_client_id_state))
a288e4f
+		strcpy(dst->dhcp_alt_client_id_state,
a288e4f
+		       src->dhcp_alt_client_id_state);
a288e4f
+	if (strlen(src->dhcp_alt_client_id))
a288e4f
+		strcpy(dst->dhcp_alt_client_id, src->dhcp_alt_client_id);
a288e4f
+	if (strlen(src->dhcp_req_vendor_id_state))
a288e4f
+		strcpy(dst->dhcp_req_vendor_id_state,
a288e4f
+		       src->dhcp_req_vendor_id_state);
a288e4f
+	if (strlen(src->dhcp_vendor_id_state))
a288e4f
+		strcpy(dst->dhcp_vendor_id_state, src->dhcp_vendor_id_state);
a288e4f
+	if (strlen(src->dhcp_vendor_id))
a288e4f
+		strcpy(dst->dhcp_vendor_id, src->dhcp_vendor_id);
a288e4f
+	if (strlen(src->dhcp_learn_iqn))
a288e4f
+		strcpy(dst->dhcp_learn_iqn, src->dhcp_learn_iqn);
a288e4f
+	if (strlen(src->fragmentation))
a288e4f
+		strcpy(dst->fragmentation, src->fragmentation);
a288e4f
+	if (strlen(src->incoming_forwarding))
a288e4f
+		strcpy(dst->incoming_forwarding, src->incoming_forwarding);
a288e4f
+	if (src->ttl)
a288e4f
+		dst->ttl = src->ttl;
a288e4f
+	if (strlen(src->gratuitous_neighbor_adv))
a288e4f
+		strcpy(dst->gratuitous_neighbor_adv,
a288e4f
+		       src->gratuitous_neighbor_adv);
a288e4f
+	if (strlen(src->redirect))
a288e4f
+		strcpy(dst->redirect, src->redirect);
a288e4f
+	if (strlen(src->mld))
a288e4f
+		strcpy(dst->mld, src->mld);
a288e4f
+	if (src->flow_label)
a288e4f
+		dst->flow_label = src->flow_label;
a288e4f
+	if (src->traffic_class)
a288e4f
+		dst->traffic_class = src->traffic_class;
a288e4f
+	if (src->hop_limit)
a288e4f
+		dst->hop_limit = src->hop_limit;
a288e4f
+	if (src->nd_reachable_tmo)
a288e4f
+		dst->nd_reachable_tmo = src->nd_reachable_tmo;
a288e4f
+	if (src->nd_rexmit_time)
a288e4f
+		dst->nd_rexmit_time = src->nd_rexmit_time;
a288e4f
+	if (src->nd_stale_tmo)
a288e4f
+		dst->nd_stale_tmo = src->nd_stale_tmo;
a288e4f
+	if (src->dup_addr_detect_cnt)
a288e4f
+		dst->dup_addr_detect_cnt = src->dup_addr_detect_cnt;
a288e4f
+	if (src->router_adv_link_mtu)
a288e4f
+		dst->router_adv_link_mtu = src->router_adv_link_mtu;
a288e4f
+	if (src->def_task_mgmt_tmo)
a288e4f
+		dst->def_task_mgmt_tmo = src->def_task_mgmt_tmo;
a288e4f
+	if (strlen(src->header_digest))
a288e4f
+		strcpy(dst->header_digest, src->header_digest);
a288e4f
+	if (strlen(src->data_digest))
a288e4f
+		strcpy(dst->data_digest, src->data_digest);
a288e4f
+	if (strlen(src->immediate_data))
a288e4f
+		strcpy(dst->immediate_data, src->immediate_data);
a288e4f
+	if (strlen(src->initial_r2t))
a288e4f
+		strcpy(dst->initial_r2t, src->initial_r2t);
a288e4f
+	if (strlen(src->data_seq_inorder))
a288e4f
+		strcpy(dst->data_seq_inorder, src->data_seq_inorder);
a288e4f
+	if (strlen(src->data_pdu_inorder))
a288e4f
+		strcpy(dst->data_pdu_inorder, src->data_pdu_inorder);
a288e4f
+	if (src->erl)
a288e4f
+		dst->erl = src->erl;
a288e4f
+	if (src->max_recv_dlength)
a288e4f
+		dst->max_recv_dlength = src->max_recv_dlength;
a288e4f
+	if (src->first_burst_len)
a288e4f
+		dst->first_burst_len = src->first_burst_len;
a288e4f
+	if (src->max_out_r2t)
a288e4f
+		dst->max_out_r2t = src->max_out_r2t;
a288e4f
+	if (src->max_burst_len)
a288e4f
+		dst->max_burst_len = src->max_burst_len;
a288e4f
+	if (strlen(src->chap_auth))
a288e4f
+		strcpy(dst->chap_auth, src->chap_auth);
a288e4f
+	if (strlen(src->bidi_chap))
a288e4f
+		strcpy(dst->bidi_chap, src->bidi_chap);
a288e4f
+	if (strlen(src->strict_login_comp))
a288e4f
+		strcpy(dst->strict_login_comp, src->strict_login_comp);
a288e4f
+	if (strlen(src->discovery_auth))
a288e4f
+		strcpy(dst->discovery_auth, src->discovery_auth);
a288e4f
+	if (strlen(src->discovery_logout))
a288e4f
+		strcpy(dst->discovery_logout, src->discovery_logout);
a288e4f
 	if (strlen(src->hwaddress))
a288e4f
 		strcpy(dst->hwaddress, src->hwaddress);
a288e4f
 	if (strlen(src->transport_name))
a288e4f
@@ -1026,6 +1125,79 @@ struct iface_param_count {
a288e4f
 	int count;
a288e4f
 };
a288e4f
 
a288e4f
+#define IFACE_NET_PARAM_EN_CNT(param_val, cnt) {	\
a288e4f
+	if (!strcmp(param_val, "disable") ||		\
a288e4f
+	    !strcmp(param_val, "enable"))		\
a288e4f
+		(*cnt)++;				\
a288e4f
+}
a288e4f
+
a288e4f
+/**
a288e4f
+ * iface_get_common_param_count - Gets common parameters count for given iface
a288e4f
+ * @iface: iface to setup
a288e4f
+ * @count: number of parameters to set
a288e4f
+ */
a288e4f
+static void iface_get_common_param_count(struct iface_rec *iface, int *count)
a288e4f
+{
a288e4f
+	if (strcmp(iface->vlan_state, "disable")) {
a288e4f
+		/* vlan_state enabled */
a288e4f
+		(*count)++;
a288e4f
+
a288e4f
+		if (iface->vlan_id)
a288e4f
+			/* For vlan value */
a288e4f
+			(*count)++;
a288e4f
+	} else {
a288e4f
+		/* vlan_state disabled */
a288e4f
+		(*count)++;
a288e4f
+	}
a288e4f
+
a288e4f
+	if (iface->mtu)
a288e4f
+		(*count)++;
a288e4f
+
a288e4f
+	if (iface->port)
a288e4f
+		(*count)++;
a288e4f
+
a288e4f
+	IFACE_NET_PARAM_EN_CNT(iface->delayed_ack, count);
a288e4f
+	IFACE_NET_PARAM_EN_CNT(iface->nagle, count);
a288e4f
+	IFACE_NET_PARAM_EN_CNT(iface->tcp_wsf_state, count);
a288e4f
+	IFACE_NET_PARAM_EN_CNT(iface->tcp_timestamp, count);
a288e4f
+	IFACE_NET_PARAM_EN_CNT(iface->redirect, count);
a288e4f
+	IFACE_NET_PARAM_EN_CNT(iface->header_digest, count);
a288e4f
+	IFACE_NET_PARAM_EN_CNT(iface->data_digest, count);
a288e4f
+	IFACE_NET_PARAM_EN_CNT(iface->immediate_data, count);
a288e4f
+	IFACE_NET_PARAM_EN_CNT(iface->initial_r2t, count);
a288e4f
+	IFACE_NET_PARAM_EN_CNT(iface->data_seq_inorder, count);
a288e4f
+	IFACE_NET_PARAM_EN_CNT(iface->data_pdu_inorder, count);
a288e4f
+	IFACE_NET_PARAM_EN_CNT(iface->chap_auth, count);
a288e4f
+	IFACE_NET_PARAM_EN_CNT(iface->bidi_chap, count);
a288e4f
+	IFACE_NET_PARAM_EN_CNT(iface->strict_login_comp, count);
a288e4f
+	IFACE_NET_PARAM_EN_CNT(iface->discovery_auth, count);
a288e4f
+	IFACE_NET_PARAM_EN_CNT(iface->discovery_logout, count);
a288e4f
+
a288e4f
+	if (iface->tcp_wsf)
a288e4f
+		(*count)++;
a288e4f
+
a288e4f
+	if (iface->tcp_timer_scale)
a288e4f
+		(*count)++;
a288e4f
+
a288e4f
+	if (iface->def_task_mgmt_tmo)
a288e4f
+		(*count)++;
a288e4f
+
a288e4f
+	if (iface->erl)
a288e4f
+		(*count)++;
a288e4f
+
a288e4f
+	if (iface->max_recv_dlength)
a288e4f
+		(*count)++;
a288e4f
+
a288e4f
+	if (iface->first_burst_len)
a288e4f
+		(*count)++;
a288e4f
+
a288e4f
+	if (iface->max_burst_len)
a288e4f
+		(*count)++;
a288e4f
+
a288e4f
+	if (iface->max_out_r2t)
a288e4f
+		(*count)++;
a288e4f
+}
a288e4f
+
a288e4f
 /**
a288e4f
  * __iface_get_param_count - Gets netconfig parameter count for given iface
a288e4f
  * @data: iface_param_count structure
a288e4f
@@ -1044,10 +1216,10 @@ static int __iface_get_param_count(void *data, struct iface_rec *iface)
a288e4f
 	if (iptype == ISCSI_IFACE_TYPE_IPV4) {
a288e4f
 
a288e4f
 		if (strcmp(iface->state, "disable")) {
a288e4f
-			if (strstr(iface->bootproto, "dhcp"))
a288e4f
+			if (strstr(iface->bootproto, "dhcp")) {
a288e4f
 				/* DHCP enabled */
a288e4f
 				count++;
a288e4f
-			else {
a288e4f
+			} else {
a288e4f
 				/* DHCP disabled */
a288e4f
 				count++;
a288e4f
 
a288e4f
@@ -1062,12 +1234,13 @@ static int __iface_get_param_count(void *data, struct iface_rec *iface)
a288e4f
 					if (strstr(iface->gateway, "."))
a288e4f
 						/* User configured Gateway */
a288e4f
 						count++;
a288e4f
-				} else
a288e4f
+				} else {
a288e4f
 					/*
a288e4f
 					 * IPv4 Address not valid, decrement
a288e4f
 					 * count of DHCP
a288e4f
 					 */
a288e4f
 					count--;
a288e4f
+				}
a288e4f
 			}
a288e4f
 
a288e4f
 			/*
a288e4f
@@ -1078,37 +1251,68 @@ static int __iface_get_param_count(void *data, struct iface_rec *iface)
a288e4f
 				/* iface state */
a288e4f
 				count++;
a288e4f
 
a288e4f
-				if (strcmp(iface->vlan_state, "disable")) {
a288e4f
-					/* vlan_state enabled */
a288e4f
+				IFACE_NET_PARAM_EN_CNT(iface->dhcp_dns,
a288e4f
+						       &count);
a288e4f
+
a288e4f
+				IFACE_NET_PARAM_EN_CNT(iface->dhcp_slp_da,
a288e4f
+						       &count);
a288e4f
+
a288e4f
+				IFACE_NET_PARAM_EN_CNT(iface->tos_state,
a288e4f
+						       &count);
a288e4f
+
a288e4f
+				IFACE_NET_PARAM_EN_CNT(iface->gratuitous_arp,
a288e4f
+						       &count);
a288e4f
+
a288e4f
+				IFACE_NET_PARAM_EN_CNT(
a288e4f
+						iface->dhcp_alt_client_id_state,
a288e4f
+						&count);
a288e4f
+
a288e4f
+				if (iface->dhcp_alt_client_id[0])
a288e4f
 					count++;
a288e4f
 
a288e4f
-					if (iface->vlan_id)
a288e4f
-						/* For vlan value */
a288e4f
-						count++;
a288e4f
-				} else
a288e4f
-					/* vlan_state disabled */
a288e4f
+				IFACE_NET_PARAM_EN_CNT(
a288e4f
+						iface->dhcp_req_vendor_id_state,
a288e4f
+						&count);
a288e4f
+
a288e4f
+				IFACE_NET_PARAM_EN_CNT(
a288e4f
+						iface->dhcp_vendor_id_state,
a288e4f
+						&count);
a288e4f
+
a288e4f
+				if (iface->dhcp_vendor_id[0])
a288e4f
 					count++;
a288e4f
 
a288e4f
-				if (iface->mtu)
a288e4f
+				IFACE_NET_PARAM_EN_CNT(iface->dhcp_learn_iqn,
a288e4f
+						       &count);
a288e4f
+
a288e4f
+				IFACE_NET_PARAM_EN_CNT(iface->fragmentation,
a288e4f
+						       &count);
a288e4f
+
a288e4f
+				IFACE_NET_PARAM_EN_CNT(
a288e4f
+						     iface->incoming_forwarding,
a288e4f
+						     &count);
a288e4f
+
a288e4f
+				if (iface->tos)
a288e4f
 					count++;
a288e4f
 
a288e4f
-				if (iface->port)
a288e4f
+				if (iface->ttl)
a288e4f
 					count++;
a288e4f
+
a288e4f
+				iface_get_common_param_count(iface, &count);
a288e4f
 			}
a288e4f
-		} else
a288e4f
+		} else {
a288e4f
 			/* IPv4 is disabled, iface state */
a288e4f
 			count++;
a288e4f
-
a288e4f
+		}
a288e4f
 	} else if (iptype == ISCSI_IFACE_TYPE_IPV6) {
a288e4f
 
a288e4f
 		if (strcmp(iface->state, "disable")) {
a288e4f
 
a288e4f
 			/* IPv6 Address */
a288e4f
 			if (strstr(iface->ipv6_autocfg, "nd") ||
a288e4f
-			    strstr(iface->ipv6_autocfg, "dhcpv6"))
a288e4f
+			    strstr(iface->ipv6_autocfg, "dhcpv6")) {
a288e4f
 				/* Autocfg enabled */
a288e4f
 				count++;
a288e4f
-			else {
a288e4f
+			} else {
a288e4f
 				/* Autocfg disabled */
a288e4f
 				count++;
a288e4f
 
a288e4f
@@ -1169,26 +1373,42 @@ static int __iface_get_param_count(void *data, struct iface_rec *iface)
a288e4f
 				/* iface state */
a288e4f
 				count++;
a288e4f
 
a288e4f
-				if (strcmp(iface->vlan_state, "disable")) {
a288e4f
-					/* vlan_state enabled */
a288e4f
+				IFACE_NET_PARAM_EN_CNT(
a288e4f
+						 iface->gratuitous_neighbor_adv,
a288e4f
+						 &count);
a288e4f
+
a288e4f
+				IFACE_NET_PARAM_EN_CNT(iface->mld, &count);
a288e4f
+
a288e4f
+				if (iface->flow_label)
a288e4f
+					count++;
a288e4f
+
a288e4f
+				if (iface->traffic_class)
a288e4f
+					count++;
a288e4f
+
a288e4f
+				if (iface->hop_limit)
a288e4f
 					count++;
a288e4f
 
a288e4f
-					if (iface->vlan_id)
a288e4f
-						/* For vlan value */
a288e4f
-						count++;
a288e4f
-				} else
a288e4f
-					/* vlan_state disabled */
a288e4f
+				if (iface->nd_reachable_tmo)
a288e4f
 					count++;
a288e4f
 
a288e4f
-				if (iface->mtu)
a288e4f
+				if (iface->nd_rexmit_time)
a288e4f
 					count++;
a288e4f
 
a288e4f
-				if (iface->port)
a288e4f
+				if (iface->nd_stale_tmo)
a288e4f
 					count++;
a288e4f
+
a288e4f
+				if (iface->dup_addr_detect_cnt)
a288e4f
+					count++;
a288e4f
+
a288e4f
+				if (iface->router_adv_link_mtu)
a288e4f
+					count++;
a288e4f
+
a288e4f
+				iface_get_common_param_count(iface, &count);
a288e4f
 			}
a288e4f
-		} else
a288e4f
+		} else {
a288e4f
 			/* IPv6 is disabled, iface state */
a288e4f
 			count++;
a288e4f
+		}
a288e4f
 	}
a288e4f
 
a288e4f
 	iface_params->count += count;
a288e4f
@@ -1578,6 +1798,44 @@ free:
a288e4f
 	}								\
a288e4f
 }
a288e4f
 
a288e4f
+/* write string parameter value */
a288e4f
+static int iface_fill_str_param_val(struct iovec *iov, uint32_t iface_num,
a288e4f
+				    uint8_t iface_type, uint16_t param,
a288e4f
+				    uint32_t param_len, char *param_val)
a288e4f
+{
a288e4f
+	int len;
a288e4f
+	struct iscsi_iface_param_info *net_param;
a288e4f
+	struct nlattr *attr;
a288e4f
+
a288e4f
+	if (!param_val[0])
a288e4f
+		return 1;
a288e4f
+
a288e4f
+	len = sizeof(struct iscsi_iface_param_info) + param_len;
a288e4f
+	iov->iov_base = iscsi_nla_alloc(param, len);
a288e4f
+	if (!(iov->iov_base))
a288e4f
+		return 1;
a288e4f
+
a288e4f
+	attr = iov->iov_base;
a288e4f
+	iov->iov_len = NLA_ALIGN(attr->nla_len);
a288e4f
+	net_param = (struct iscsi_iface_param_info *)ISCSI_NLA_DATA(attr);
a288e4f
+	net_param->iface_num = iface_num;
a288e4f
+	net_param->len = param_len;
a288e4f
+	net_param->param = param;
a288e4f
+	net_param->iface_type = iface_type;
a288e4f
+	net_param->param_type = ISCSI_NET_PARAM;
a288e4f
+	memcpy(net_param->value, param_val, param_len);
a288e4f
+	return 0;
a288e4f
+}
a288e4f
+
a288e4f
+#define IFACE_SET_NET_PARAM_STRVAL(iov, inum, itype, param, plen,	\
a288e4f
+				   ival, gcnt, lcnt) {			\
a288e4f
+	if (!iface_fill_str_param_val(iov, inum, itype, param, plen,	\
a288e4f
+				      ival)) {				\
a288e4f
+		(*gcnt)++;						\
a288e4f
+		(*lcnt)++;						\
a288e4f
+	}								\
a288e4f
+}
a288e4f
+
a288e4f
 struct iface_net_config {
a288e4f
 	struct iface_rec *primary;
a288e4f
 	struct iovec *iovs;
a288e4f
@@ -1597,8 +1855,12 @@ static int __iface_build_net_config(void *data, struct iface_rec *iface)
a288e4f
 	/* start at 2, because 0 is for nlmsghdr and 1 for event */
a288e4f
 	iov = net_config->iovs + 2;
a288e4f
 
a288e4f
+	if (!iface->port)
a288e4f
+		iface->port = 3260;
a288e4f
+
a288e4f
 	iptype = iface_get_iptype(iface);
a288e4f
-	if (iptype == ISCSI_IFACE_TYPE_IPV4) {
a288e4f
+	switch (iptype) {
a288e4f
+	case ISCSI_IFACE_TYPE_IPV4:
a288e4f
 		if (!strcmp(iface->state, "disable")) {
a288e4f
 			IFACE_SET_PARAM_STATE(&iov[net_config->count],
a288e4f
 					      iface->iface_num,
a288e4f
@@ -1652,53 +1914,136 @@ static int __iface_build_net_config(void *data, struct iface_rec *iface)
a288e4f
 		 */
a288e4f
 		if (count) {
a288e4f
 			IFACE_SET_PARAM_STATE(&iov[net_config->count],
a288e4f
+					  iface->iface_num,
a288e4f
+					  ISCSI_IFACE_TYPE_IPV4,
a288e4f
+					  ISCSI_NET_PARAM_IPV4_DHCP_DNS_ADDR_EN,
a288e4f
+					  ISCSI_NET_PARAM,
a288e4f
+					  iface->dhcp_dns,
a288e4f
+					  &net_config->count,
a288e4f
+					  &count);
a288e4f
+
a288e4f
+			IFACE_SET_PARAM_STATE(&iov[net_config->count],
a288e4f
+					    iface->iface_num,
a288e4f
+					    ISCSI_IFACE_TYPE_IPV4,
a288e4f
+					    ISCSI_NET_PARAM_IPV4_DHCP_SLP_DA_EN,
a288e4f
+					    ISCSI_NET_PARAM,
a288e4f
+					    iface->dhcp_slp_da,
a288e4f
+					    &net_config->count,
a288e4f
+					    &count);
a288e4f
+
a288e4f
+			IFACE_SET_PARAM_STATE(&iov[net_config->count],
a288e4f
+					      iface->iface_num,
a288e4f
+					      ISCSI_IFACE_TYPE_IPV4,
a288e4f
+					      ISCSI_NET_PARAM_IPV4_TOS_EN,
a288e4f
+					      ISCSI_NET_PARAM,
a288e4f
+					      iface->tos_state,
a288e4f
+					      &net_config->count,
a288e4f
+					      &count);
a288e4f
+
a288e4f
+			IFACE_SET_PARAM_INTVAL(&iov[net_config->count],
a288e4f
 					      iface->iface_num,
a288e4f
 					      ISCSI_IFACE_TYPE_IPV4,
a288e4f
-					      ISCSI_NET_PARAM_IFACE_ENABLE,
a288e4f
+					      ISCSI_NET_PARAM_IPV4_TOS,
a288e4f
 					      ISCSI_NET_PARAM,
a288e4f
-					      iface->state,
a288e4f
+					      1,
a288e4f
+					      iface->tos,
a288e4f
 					      &net_config->count,
a288e4f
 					      &count);
a288e4f
 
a288e4f
 			IFACE_SET_PARAM_STATE(&iov[net_config->count],
a288e4f
 					      iface->iface_num,
a288e4f
 					      ISCSI_IFACE_TYPE_IPV4,
a288e4f
-					      ISCSI_NET_PARAM_VLAN_ENABLED,
a288e4f
+					      ISCSI_NET_PARAM_IPV4_GRAT_ARP_EN,
a288e4f
 					      ISCSI_NET_PARAM,
a288e4f
-					      iface->vlan_state,
a288e4f
+					      iface->gratuitous_arp,
a288e4f
 					      &net_config->count,
a288e4f
 					      &count);
a288e4f
 
a288e4f
-			if (strcmp(iface->vlan_state, "disable") &&
a288e4f
-			    iface->vlan_id) {
a288e4f
-				if (!iface_fill_vlan_id(&iov[net_config->count],
a288e4f
-						iface, ISCSI_IFACE_TYPE_IPV4)) {
a288e4f
-					net_config->count++;
a288e4f
-					count++;
a288e4f
-				}
a288e4f
-			}
a288e4f
+			IFACE_SET_PARAM_STATE(&iov[net_config->count],
a288e4f
+				     iface->iface_num,
a288e4f
+				     ISCSI_IFACE_TYPE_IPV4,
a288e4f
+				     ISCSI_NET_PARAM_IPV4_DHCP_ALT_CLIENT_ID_EN,
a288e4f
+				     ISCSI_NET_PARAM,
a288e4f
+				     iface->dhcp_alt_client_id_state,
a288e4f
+				     &net_config->count,
a288e4f
+				     &count);
a288e4f
 
a288e4f
-			IFACE_SET_PARAM_INTVAL(&iov[net_config->count],
a288e4f
-					       iface->iface_num,
a288e4f
-					       ISCSI_IFACE_TYPE_IPV4,
a288e4f
-					       ISCSI_NET_PARAM_MTU,
a288e4f
-					       ISCSI_NET_PARAM,
a288e4f
-					       2,
a288e4f
-					       iface->mtu,
a288e4f
-					       &net_config->count,
a288e4f
-					       &count);
a288e4f
+			IFACE_SET_NET_PARAM_STRVAL(&iov[net_config->count],
a288e4f
+					iface->iface_num,
a288e4f
+					ISCSI_IFACE_TYPE_IPV4,
a288e4f
+					ISCSI_NET_PARAM_IPV4_DHCP_ALT_CLIENT_ID,
a288e4f
+					 strlen(iface->dhcp_alt_client_id),
a288e4f
+					iface->dhcp_alt_client_id,
a288e4f
+					&net_config->count,
a288e4f
+					&count);
a288e4f
+
a288e4f
+			IFACE_SET_PARAM_STATE(&iov[net_config->count],
a288e4f
+				     iface->iface_num,
a288e4f
+				     ISCSI_IFACE_TYPE_IPV4,
a288e4f
+				     ISCSI_NET_PARAM_IPV4_DHCP_REQ_VENDOR_ID_EN,
a288e4f
+				     ISCSI_NET_PARAM,
a288e4f
+				     iface->dhcp_req_vendor_id_state,
a288e4f
+				     &net_config->count,
a288e4f
+				     &count);
a288e4f
+
a288e4f
+			IFACE_SET_PARAM_STATE(&iov[net_config->count],
a288e4f
+				     iface->iface_num,
a288e4f
+				     ISCSI_IFACE_TYPE_IPV4,
a288e4f
+				     ISCSI_NET_PARAM_IPV4_DHCP_USE_VENDOR_ID_EN,
a288e4f
+				     ISCSI_NET_PARAM,
a288e4f
+				     iface->dhcp_vendor_id_state,
a288e4f
+				     &net_config->count,
a288e4f
+				     &count);
a288e4f
+
a288e4f
+			IFACE_SET_NET_PARAM_STRVAL(&iov[net_config->count],
a288e4f
+					iface->iface_num,
a288e4f
+					ISCSI_IFACE_TYPE_IPV4,
a288e4f
+					ISCSI_NET_PARAM_IPV4_DHCP_VENDOR_ID,
a288e4f
+					strlen(iface->dhcp_vendor_id),
a288e4f
+					iface->dhcp_vendor_id,
a288e4f
+					&net_config->count,
a288e4f
+					&count);
a288e4f
+
a288e4f
+			IFACE_SET_PARAM_STATE(&iov[net_config->count],
a288e4f
+					 iface->iface_num,
a288e4f
+					 ISCSI_IFACE_TYPE_IPV4,
a288e4f
+					 ISCSI_NET_PARAM_IPV4_DHCP_LEARN_IQN_EN,
a288e4f
+					 ISCSI_NET_PARAM,
a288e4f
+					 iface->dhcp_learn_iqn,
a288e4f
+					 &net_config->count,
a288e4f
+					 &count);
a288e4f
+
a288e4f
+			IFACE_SET_PARAM_STATE(&iov[net_config->count],
a288e4f
+					  iface->iface_num,
a288e4f
+					  ISCSI_IFACE_TYPE_IPV4,
a288e4f
+					  ISCSI_NET_PARAM_IPV4_FRAGMENT_DISABLE,
a288e4f
+					  ISCSI_NET_PARAM,
a288e4f
+					  iface->fragmentation,
a288e4f
+					  &net_config->count,
a288e4f
+					  &count);
a288e4f
+
a288e4f
+			IFACE_SET_PARAM_STATE(&iov[net_config->count],
a288e4f
+					     iface->iface_num,
a288e4f
+					     ISCSI_IFACE_TYPE_IPV4,
a288e4f
+					     ISCSI_NET_PARAM_IPV4_IN_FORWARD_EN,
a288e4f
+					     ISCSI_NET_PARAM,
a288e4f
+					     iface->incoming_forwarding,
a288e4f
+					     &net_config->count,
a288e4f
+					     &count);
a288e4f
 
a288e4f
 			IFACE_SET_PARAM_INTVAL(&iov[net_config->count],
a288e4f
 					       iface->iface_num,
a288e4f
 					       ISCSI_IFACE_TYPE_IPV4,
a288e4f
-					       ISCSI_NET_PARAM_PORT,
a288e4f
+					       ISCSI_NET_PARAM_IPV4_TTL,
a288e4f
 					       ISCSI_NET_PARAM,
a288e4f
-					       2,
a288e4f
-					       iface->port,
a288e4f
+					       1,
a288e4f
+					       iface->ttl,
a288e4f
 					       &net_config->count,
a288e4f
 					       &count);
a288e4f
 		}
a288e4f
-	} else if (iptype == ISCSI_IFACE_TYPE_IPV6) {
a288e4f
+		break;
a288e4f
+
a288e4f
+	case ISCSI_IFACE_TYPE_IPV6:
a288e4f
 		if (!strcmp(iface->state, "disable")) {
a288e4f
 			IFACE_SET_PARAM_STATE(&iov[net_config->count],
a288e4f
 					      iface->iface_num,
a288e4f
@@ -1786,53 +2131,377 @@ static int __iface_build_net_config(void *data, struct iface_rec *iface)
a288e4f
 		 */
a288e4f
 		if (count) {
a288e4f
 			IFACE_SET_PARAM_STATE(&iov[net_config->count],
a288e4f
-					      iface->iface_num,
a288e4f
-					      ISCSI_IFACE_TYPE_IPV6,
a288e4f
-					      ISCSI_NET_PARAM_IFACE_ENABLE,
a288e4f
-					      ISCSI_NET_PARAM,
a288e4f
-					      iface->state,
a288e4f
-					      &net_config->count,
a288e4f
-					      &count);
a288e4f
+				      iface->iface_num,
a288e4f
+				      ISCSI_IFACE_TYPE_IPV6,
a288e4f
+				      ISCSI_NET_PARAM_IPV6_GRAT_NEIGHBOR_ADV_EN,
a288e4f
+				      ISCSI_NET_PARAM,
a288e4f
+				      iface->gratuitous_neighbor_adv,
a288e4f
+				      &net_config->count,
a288e4f
+				      &count);
a288e4f
 
a288e4f
 			IFACE_SET_PARAM_STATE(&iov[net_config->count],
a288e4f
 					      iface->iface_num,
a288e4f
 					      ISCSI_IFACE_TYPE_IPV6,
a288e4f
-					      ISCSI_NET_PARAM_VLAN_ENABLED,
a288e4f
+					      ISCSI_NET_PARAM_IPV6_MLD_EN,
a288e4f
 					      ISCSI_NET_PARAM,
a288e4f
-					      iface->vlan_state,
a288e4f
+					      iface->mld,
a288e4f
 					      &net_config->count,
a288e4f
 					      &count);
a288e4f
 
a288e4f
-			if (strcmp(iface->vlan_state, "disable") &&
a288e4f
-			    iface->vlan_id) {
a288e4f
-				if (!iface_fill_vlan_id(&iov[net_config->count],
a288e4f
-						iface,
a288e4f
-						ISCSI_IFACE_TYPE_IPV6)) {
a288e4f
-					net_config->count++;
a288e4f
-					count++;
a288e4f
-				}
a288e4f
+			IFACE_SET_PARAM_INTVAL(&iov[net_config->count],
a288e4f
+					       iface->iface_num,
a288e4f
+					       ISCSI_IFACE_TYPE_IPV6,
a288e4f
+					       ISCSI_NET_PARAM_IPV6_FLOW_LABEL,
a288e4f
+					       ISCSI_NET_PARAM,
a288e4f
+					       4,
a288e4f
+					       iface->flow_label,
a288e4f
+					       &net_config->count,
a288e4f
+					       &count);
a288e4f
+
a288e4f
+			IFACE_SET_PARAM_INTVAL(&iov[net_config->count],
a288e4f
+					     iface->iface_num,
a288e4f
+					     ISCSI_IFACE_TYPE_IPV6,
a288e4f
+					     ISCSI_NET_PARAM_IPV6_TRAFFIC_CLASS,
a288e4f
+					     ISCSI_NET_PARAM,
a288e4f
+					     1,
a288e4f
+					     iface->traffic_class,
a288e4f
+					     &net_config->count,
a288e4f
+					     &count);
a288e4f
+
a288e4f
+			IFACE_SET_PARAM_INTVAL(&iov[net_config->count],
a288e4f
+					       iface->iface_num,
a288e4f
+					       ISCSI_IFACE_TYPE_IPV6,
a288e4f
+					       ISCSI_NET_PARAM_IPV6_HOP_LIMIT,
a288e4f
+					       ISCSI_NET_PARAM,
a288e4f
+					       1,
a288e4f
+					       iface->hop_limit,
a288e4f
+					       &net_config->count,
a288e4f
+					       &count);
a288e4f
+
a288e4f
+			IFACE_SET_PARAM_INTVAL(&iov[net_config->count],
a288e4f
+					  iface->iface_num,
a288e4f
+					  ISCSI_IFACE_TYPE_IPV6,
a288e4f
+					  ISCSI_NET_PARAM_IPV6_ND_REACHABLE_TMO,
a288e4f
+					  ISCSI_NET_PARAM,
a288e4f
+					  4,
a288e4f
+					  iface->nd_reachable_tmo,
a288e4f
+					  &net_config->count,
a288e4f
+					  &count);
a288e4f
+
a288e4f
+			IFACE_SET_PARAM_INTVAL(&iov[net_config->count],
a288e4f
+					    iface->iface_num,
a288e4f
+					    ISCSI_IFACE_TYPE_IPV6,
a288e4f
+					    ISCSI_NET_PARAM_IPV6_ND_REXMIT_TIME,
a288e4f
+					    ISCSI_NET_PARAM,
a288e4f
+					    4,
a288e4f
+					    iface->nd_rexmit_time,
a288e4f
+					    &net_config->count,
a288e4f
+					    &count);
a288e4f
+
a288e4f
+			IFACE_SET_PARAM_INTVAL(&iov[net_config->count],
a288e4f
+					      iface->iface_num,
a288e4f
+					      ISCSI_IFACE_TYPE_IPV6,
a288e4f
+					      ISCSI_NET_PARAM_IPV6_ND_STALE_TMO,
a288e4f
+					      ISCSI_NET_PARAM,
a288e4f
+					      4,
a288e4f
+					      iface->nd_stale_tmo,
a288e4f
+					      &net_config->count,
a288e4f
+					      &count);
a288e4f
+
a288e4f
+			IFACE_SET_PARAM_INTVAL(&iov[net_config->count],
a288e4f
+				       iface->iface_num,
a288e4f
+				       ISCSI_IFACE_TYPE_IPV6,
a288e4f
+				       ISCSI_NET_PARAM_IPV6_DUP_ADDR_DETECT_CNT,
a288e4f
+				       ISCSI_NET_PARAM,
a288e4f
+				       1,
a288e4f
+				       iface->dup_addr_detect_cnt,
a288e4f
+				       &net_config->count,
a288e4f
+				       &count);
a288e4f
+
a288e4f
+			IFACE_SET_PARAM_INTVAL(&iov[net_config->count],
a288e4f
+					  iface->iface_num,
a288e4f
+					  ISCSI_IFACE_TYPE_IPV6,
a288e4f
+					  ISCSI_NET_PARAM_IPV6_RTR_ADV_LINK_MTU,
a288e4f
+					  ISCSI_NET_PARAM,
a288e4f
+					  4,
a288e4f
+					  iface->router_adv_link_mtu,
a288e4f
+					  &net_config->count,
a288e4f
+					  &count);
a288e4f
+		}
a288e4f
+		break;
a288e4f
+	}
a288e4f
+
a288e4f
+	/* Fill parameters common to IPv4 and IPv6 ifaces */
a288e4f
+	if (count) {
a288e4f
+		IFACE_SET_PARAM_STATE(&iov[net_config->count],
a288e4f
+				      iface->iface_num,
a288e4f
+				      iptype,
a288e4f
+				      ISCSI_NET_PARAM_IFACE_ENABLE,
a288e4f
+				      ISCSI_NET_PARAM,
a288e4f
+				      iface->state,
a288e4f
+				      &net_config->count,
a288e4f
+				      &count);
a288e4f
+
a288e4f
+		IFACE_SET_PARAM_STATE(&iov[net_config->count],
a288e4f
+				      iface->iface_num,
a288e4f
+				      iptype,
a288e4f
+				      ISCSI_NET_PARAM_VLAN_ENABLED,
a288e4f
+				      ISCSI_NET_PARAM,
a288e4f
+				      iface->vlan_state,
a288e4f
+				      &net_config->count,
a288e4f
+				      &count);
a288e4f
+
a288e4f
+		if (strcmp(iface->vlan_state, "disable") && iface->vlan_id) {
a288e4f
+			if (!iface_fill_vlan_id(&iov[net_config->count], iface,
a288e4f
+						iptype)) {
a288e4f
+				net_config->count++;
a288e4f
+				count++;
a288e4f
 			}
a288e4f
-
a288e4f
-			IFACE_SET_PARAM_INTVAL(&iov[net_config->count],
a288e4f
-					       iface->iface_num,
a288e4f
-					       ISCSI_IFACE_TYPE_IPV6,
a288e4f
-					       ISCSI_NET_PARAM_MTU,
a288e4f
-					       ISCSI_NET_PARAM,
a288e4f
-					       2,
a288e4f
-					       iface->mtu,
a288e4f
-					       &net_config->count,
a288e4f
-					       &count);
a288e4f
-
a288e4f
-			IFACE_SET_PARAM_INTVAL(&iov[net_config->count],
a288e4f
-					       iface->iface_num,
a288e4f
-					       ISCSI_IFACE_TYPE_IPV6,
a288e4f
-					       ISCSI_NET_PARAM_PORT,
a288e4f
-					       ISCSI_NET_PARAM,
a288e4f
-					       2,
a288e4f
-					       iface->port,
a288e4f
-					       &net_config->count,
a288e4f
-					       &count);
a288e4f
 		}
a288e4f
+
a288e4f
+		IFACE_SET_PARAM_INTVAL(&iov[net_config->count],
a288e4f
+				       iface->iface_num,
a288e4f
+				       iptype,
a288e4f
+				       ISCSI_NET_PARAM_MTU,
a288e4f
+				       ISCSI_NET_PARAM,
a288e4f
+				       2,
a288e4f
+				       iface->mtu,
a288e4f
+				       &net_config->count,
a288e4f
+				       &count);
a288e4f
+
a288e4f
+		IFACE_SET_PARAM_INTVAL(&iov[net_config->count],
a288e4f
+				       iface->iface_num,
a288e4f
+				       iptype,
a288e4f
+				       ISCSI_NET_PARAM_PORT,
a288e4f
+				       ISCSI_NET_PARAM,
a288e4f
+				       2,
a288e4f
+				       iface->port,
a288e4f
+				       &net_config->count,
a288e4f
+				       &count);
a288e4f
+
a288e4f
+		IFACE_SET_PARAM_STATE(&iov[net_config->count],
a288e4f
+				      iface->iface_num,
a288e4f
+				      iptype,
a288e4f
+				      ISCSI_NET_PARAM_DELAYED_ACK_EN,
a288e4f
+				      ISCSI_NET_PARAM,
a288e4f
+				      iface->delayed_ack,
a288e4f
+				      &net_config->count,
a288e4f
+				      &count);
a288e4f
+
a288e4f
+		IFACE_SET_PARAM_STATE(&iov[net_config->count],
a288e4f
+				      iface->iface_num,
a288e4f
+				      iptype,
a288e4f
+				      ISCSI_NET_PARAM_TCP_NAGLE_DISABLE,
a288e4f
+				      ISCSI_NET_PARAM,
a288e4f
+				      iface->nagle,
a288e4f
+				      &net_config->count,
a288e4f
+				      &count);
a288e4f
+
a288e4f
+		IFACE_SET_PARAM_STATE(&iov[net_config->count],
a288e4f
+				      iface->iface_num,
a288e4f
+				      iptype,
a288e4f
+				      ISCSI_NET_PARAM_TCP_WSF_DISABLE,
a288e4f
+				      ISCSI_NET_PARAM,
a288e4f
+				      iface->tcp_wsf_state,
a288e4f
+				      &net_config->count,
a288e4f
+				      &count);
a288e4f
+
a288e4f
+		IFACE_SET_PARAM_INTVAL(&iov[net_config->count],
a288e4f
+				       iface->iface_num,
a288e4f
+				       iptype,
a288e4f
+				       ISCSI_NET_PARAM_TCP_WSF,
a288e4f
+				       ISCSI_NET_PARAM,
a288e4f
+				       1,
a288e4f
+				       iface->tcp_wsf,
a288e4f
+				       &net_config->count,
a288e4f
+				       &count);
a288e4f
+
a288e4f
+		IFACE_SET_PARAM_INTVAL(&iov[net_config->count],
a288e4f
+				       iface->iface_num,
a288e4f
+				       iptype,
a288e4f
+				       ISCSI_NET_PARAM_TCP_TIMER_SCALE,
a288e4f
+				       ISCSI_NET_PARAM,
a288e4f
+				       1,
a288e4f
+				       iface->tcp_timer_scale,
a288e4f
+				       &net_config->count,
a288e4f
+				       &count);
a288e4f
+
a288e4f
+		IFACE_SET_PARAM_STATE(&iov[net_config->count],
a288e4f
+				      iface->iface_num,
a288e4f
+				      iptype,
a288e4f
+				      ISCSI_NET_PARAM_TCP_TIMESTAMP_EN,
a288e4f
+				      ISCSI_NET_PARAM,
a288e4f
+				      iface->tcp_timestamp,
a288e4f
+				      &net_config->count,
a288e4f
+				      &count);
a288e4f
+
a288e4f
+		IFACE_SET_PARAM_STATE(&iov[net_config->count],
a288e4f
+				      iface->iface_num,
a288e4f
+				      iptype,
a288e4f
+				      ISCSI_NET_PARAM_REDIRECT_EN,
a288e4f
+				      ISCSI_NET_PARAM,
a288e4f
+				      iface->redirect,
a288e4f
+				      &net_config->count,
a288e4f
+				      &count);
a288e4f
+
a288e4f
+		IFACE_SET_PARAM_INTVAL(&iov[net_config->count],
a288e4f
+				     iface->iface_num,
a288e4f
+				     iptype,
a288e4f
+				     ISCSI_IFACE_PARAM_DEF_TASKMGMT_TMO,
a288e4f
+				     ISCSI_IFACE_PARAM,
a288e4f
+				     2,
a288e4f
+				     iface->def_task_mgmt_tmo,
a288e4f
+				     &net_config->count,
a288e4f
+				     &count);
a288e4f
+
a288e4f
+		IFACE_SET_PARAM_STATE(&iov[net_config->count],
a288e4f
+				      iface->iface_num,
a288e4f
+				      iptype,
a288e4f
+				      ISCSI_IFACE_PARAM_HDRDGST_EN,
a288e4f
+				      ISCSI_IFACE_PARAM,
a288e4f
+				      iface->header_digest,
a288e4f
+				      &net_config->count,
a288e4f
+				      &count);
a288e4f
+
a288e4f
+		IFACE_SET_PARAM_STATE(&iov[net_config->count],
a288e4f
+				      iface->iface_num,
a288e4f
+				      iptype,
a288e4f
+				      ISCSI_IFACE_PARAM_DATADGST_EN,
a288e4f
+				      ISCSI_IFACE_PARAM,
a288e4f
+				      iface->data_digest,
a288e4f
+				      &net_config->count,
a288e4f
+				      &count);
a288e4f
+
a288e4f
+		IFACE_SET_PARAM_STATE(&iov[net_config->count],
a288e4f
+				      iface->iface_num,
a288e4f
+				      iptype,
a288e4f
+				      ISCSI_IFACE_PARAM_IMM_DATA_EN,
a288e4f
+				      ISCSI_IFACE_PARAM,
a288e4f
+				      iface->immediate_data,
a288e4f
+				      &net_config->count,
a288e4f
+				      &count);
a288e4f
+
a288e4f
+		IFACE_SET_PARAM_STATE(&iov[net_config->count],
a288e4f
+				      iface->iface_num,
a288e4f
+				      iptype,
a288e4f
+				      ISCSI_IFACE_PARAM_INITIAL_R2T_EN,
a288e4f
+				      ISCSI_IFACE_PARAM,
a288e4f
+				      iface->initial_r2t,
a288e4f
+				      &net_config->count,
a288e4f
+				      &count);
a288e4f
+
a288e4f
+		IFACE_SET_PARAM_STATE(&iov[net_config->count],
a288e4f
+				      iface->iface_num,
a288e4f
+				      iptype,
a288e4f
+				      ISCSI_IFACE_PARAM_DATASEQ_INORDER_EN,
a288e4f
+				      ISCSI_IFACE_PARAM,
a288e4f
+				      iface->data_seq_inorder,
a288e4f
+				      &net_config->count,
a288e4f
+				      &count);
a288e4f
+
a288e4f
+		IFACE_SET_PARAM_STATE(&iov[net_config->count],
a288e4f
+				      iface->iface_num,
a288e4f
+				      iptype,
a288e4f
+				      ISCSI_IFACE_PARAM_PDU_INORDER_EN,
a288e4f
+				      ISCSI_IFACE_PARAM,
a288e4f
+				      iface->data_pdu_inorder,
a288e4f
+				      &net_config->count,
a288e4f
+				      &count);
a288e4f
+
a288e4f
+		IFACE_SET_PARAM_INTVAL(&iov[net_config->count],
a288e4f
+				       iface->iface_num,
a288e4f
+				       iptype,
a288e4f
+				       ISCSI_IFACE_PARAM_ERL,
a288e4f
+				       ISCSI_IFACE_PARAM,
a288e4f
+				       1,
a288e4f
+				       iface->erl,
a288e4f
+				       &net_config->count,
a288e4f
+				       &count);
a288e4f
+
a288e4f
+		IFACE_SET_PARAM_INTVAL(&iov[net_config->count],
a288e4f
+				       iface->iface_num,
a288e4f
+				       iptype,
a288e4f
+				       ISCSI_IFACE_PARAM_MAX_RECV_DLENGTH,
a288e4f
+				       ISCSI_IFACE_PARAM,
a288e4f
+				       4,
a288e4f
+				       iface->max_recv_dlength,
a288e4f
+				       &net_config->count,
a288e4f
+				       &count);
a288e4f
+
a288e4f
+		IFACE_SET_PARAM_INTVAL(&iov[net_config->count],
a288e4f
+				       iface->iface_num,
a288e4f
+				       iptype,
a288e4f
+				       ISCSI_IFACE_PARAM_FIRST_BURST,
a288e4f
+				       ISCSI_IFACE_PARAM,
a288e4f
+				       4,
a288e4f
+				       iface->first_burst_len,
a288e4f
+				       &net_config->count,
a288e4f
+				       &count);
a288e4f
+
a288e4f
+		IFACE_SET_PARAM_INTVAL(&iov[net_config->count],
a288e4f
+				       iface->iface_num,
a288e4f
+				       iptype,
a288e4f
+				       ISCSI_IFACE_PARAM_MAX_R2T,
a288e4f
+				       ISCSI_IFACE_PARAM,
a288e4f
+				       2,
a288e4f
+				       iface->max_out_r2t,
a288e4f
+				       &net_config->count,
a288e4f
+				       &count);
a288e4f
+
a288e4f
+		IFACE_SET_PARAM_INTVAL(&iov[net_config->count],
a288e4f
+				       iface->iface_num,
a288e4f
+				       iptype,
a288e4f
+				       ISCSI_IFACE_PARAM_MAX_BURST,
a288e4f
+				       ISCSI_IFACE_PARAM,
a288e4f
+				       4,
a288e4f
+				       iface->max_burst_len,
a288e4f
+				       &net_config->count,
a288e4f
+				       &count);
a288e4f
+
a288e4f
+		IFACE_SET_PARAM_STATE(&iov[net_config->count],
a288e4f
+				      iface->iface_num,
a288e4f
+				      iptype,
a288e4f
+				      ISCSI_IFACE_PARAM_CHAP_AUTH_EN,
a288e4f
+				      ISCSI_IFACE_PARAM,
a288e4f
+				      iface->chap_auth,
a288e4f
+				      &net_config->count,
a288e4f
+				      &count);
a288e4f
+
a288e4f
+		IFACE_SET_PARAM_STATE(&iov[net_config->count],
a288e4f
+				      iface->iface_num,
a288e4f
+				      iptype,
a288e4f
+				      ISCSI_IFACE_PARAM_BIDI_CHAP_EN,
a288e4f
+				      ISCSI_IFACE_PARAM,
a288e4f
+				      iface->bidi_chap,
a288e4f
+				      &net_config->count,
a288e4f
+				      &count);
a288e4f
+
a288e4f
+		IFACE_SET_PARAM_STATE(&iov[net_config->count],
a288e4f
+				      iface->iface_num,
a288e4f
+				      iptype,
a288e4f
+				      ISCSI_IFACE_PARAM_STRICT_LOGIN_COMP_EN,
a288e4f
+				      ISCSI_IFACE_PARAM,
a288e4f
+				      iface->strict_login_comp,
a288e4f
+				      &net_config->count,
a288e4f
+				      &count);
a288e4f
+
a288e4f
+		IFACE_SET_PARAM_STATE(&iov[net_config->count],
a288e4f
+				      iface->iface_num,
a288e4f
+				      iptype,
a288e4f
+				      ISCSI_IFACE_PARAM_DISCOVERY_AUTH_OPTIONAL,
a288e4f
+				      ISCSI_IFACE_PARAM,
a288e4f
+				      iface->discovery_auth,
a288e4f
+				      &net_config->count,
a288e4f
+				      &count);
a288e4f
+
a288e4f
+		IFACE_SET_PARAM_STATE(&iov[net_config->count],
a288e4f
+				      iface->iface_num,
a288e4f
+				      iptype,
a288e4f
+				      ISCSI_IFACE_PARAM_DISCOVERY_LOGOUT_EN,
a288e4f
+				      ISCSI_IFACE_PARAM,
a288e4f
+				      iface->discovery_logout,
a288e4f
+				      &net_config->count,
a288e4f
+				      &count);
a288e4f
 	}
a288e4f
 	return 0;
a288e4f
 }
a288e4f
diff --git a/usr/iscsi_sysfs.c b/usr/iscsi_sysfs.c
a288e4f
index 04c3673..c916ed8 100644
a288e4f
--- a/usr/iscsi_sysfs.c
a288e4f
+++ b/usr/iscsi_sysfs.c
a288e4f
@@ -856,6 +856,71 @@ static int iscsi_sysfs_read_iface(struct iface_rec *iface, int host_no,
a288e4f
 
a288e4f
 		sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS, "subnet",
a288e4f
 			      iface->subnet_mask, sizeof(iface->subnet_mask));
a288e4f
+
a288e4f
+		sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS,
a288e4f
+			      "dhcp_alt_client_id_en",
a288e4f
+			      iface->dhcp_alt_client_id_state,
a288e4f
+			      sizeof(iface->dhcp_alt_client_id_state));
a288e4f
+
a288e4f
+		sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS,
a288e4f
+			      "dhcp_alt_client_id",
a288e4f
+			      iface->dhcp_alt_client_id,
a288e4f
+			      sizeof(iface->dhcp_alt_client_id));
a288e4f
+
a288e4f
+		sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS,
a288e4f
+			      "dhcp_dns_address_en",
a288e4f
+			      iface->dhcp_dns, sizeof(iface->dhcp_dns));
a288e4f
+
a288e4f
+		sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS,
a288e4f
+			      "dhcp_learn_iqn_en",
a288e4f
+			      iface->dhcp_learn_iqn,
a288e4f
+			      sizeof(iface->dhcp_learn_iqn));
a288e4f
+
a288e4f
+		sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS,
a288e4f
+			      "dhcp_req_vendor_id_en",
a288e4f
+			      iface->dhcp_req_vendor_id_state,
a288e4f
+			      sizeof(iface->dhcp_req_vendor_id_state));
a288e4f
+
a288e4f
+		sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS,
a288e4f
+			      "dhcp_use_vendor_id_en",
a288e4f
+			      iface->dhcp_vendor_id_state,
a288e4f
+			      sizeof(iface->dhcp_vendor_id_state));
a288e4f
+
a288e4f
+		sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS,
a288e4f
+			      "dhcp_vendor_id",
a288e4f
+			      iface->dhcp_vendor_id,
a288e4f
+			      sizeof(iface->dhcp_vendor_id));
a288e4f
+
a288e4f
+		sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS,
a288e4f
+			      "dhcp_slp_da_info_en",
a288e4f
+			      iface->dhcp_slp_da, sizeof(iface->dhcp_slp_da));
a288e4f
+
a288e4f
+		sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS,
a288e4f
+			      "fragment_disable",
a288e4f
+			      iface->fragmentation,
a288e4f
+			      sizeof(iface->fragmentation));
a288e4f
+
a288e4f
+		sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS,
a288e4f
+			      "grat_arp_en",
a288e4f
+			      iface->gratuitous_arp,
a288e4f
+			      sizeof(iface->gratuitous_arp));
a288e4f
+
a288e4f
+		sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS,
a288e4f
+			      "incoming_forwarding_en",
a288e4f
+			      iface->incoming_forwarding,
a288e4f
+			      sizeof(iface->incoming_forwarding));
a288e4f
+
a288e4f
+		sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS,
a288e4f
+			      "tos_en",
a288e4f
+			      iface->tos_state, sizeof(iface->tos_state));
a288e4f
+
a288e4f
+		if (sysfs_get_uint8(iface_kern_id, ISCSI_IFACE_SUBSYS,
a288e4f
+				    "tos", &iface->tos))
a288e4f
+			iface->tos = 0;
a288e4f
+
a288e4f
+		if (sysfs_get_uint8(iface_kern_id, ISCSI_IFACE_SUBSYS,
a288e4f
+				    "ttl", &iface->ttl))
a288e4f
+			iface->ttl = 0;
a288e4f
 	} else {
a288e4f
 		sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS,
a288e4f
 			      "ipaddr_autocfg",
a288e4f
@@ -872,6 +937,53 @@ static int iscsi_sysfs_read_iface(struct iface_rec *iface, int host_no,
a288e4f
 		sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS, "router_addr",
a288e4f
 			      iface->ipv6_router,
a288e4f
 			      sizeof(iface->ipv6_router));
a288e4f
+
a288e4f
+		sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS, "router_state",
a288e4f
+			      iface->router_autocfg,
a288e4f
+			      sizeof(iface->router_autocfg));
a288e4f
+
a288e4f
+		if (sysfs_get_uint8(iface_kern_id, ISCSI_IFACE_SUBSYS,
a288e4f
+				    "dup_addr_detect_cnt",
a288e4f
+				    &iface->dup_addr_detect_cnt))
a288e4f
+			iface->dup_addr_detect_cnt = 0;
a288e4f
+
a288e4f
+		if (sysfs_get_uint(iface_kern_id, ISCSI_IFACE_SUBSYS,
a288e4f
+				   "flow_label", &iface->flow_label))
a288e4f
+			iface->flow_label = 0;
a288e4f
+
a288e4f
+		sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS,
a288e4f
+			      "grat_neighbor_adv_en",
a288e4f
+			      iface->gratuitous_neighbor_adv,
a288e4f
+			      sizeof(iface->gratuitous_neighbor_adv));
a288e4f
+
a288e4f
+		if (sysfs_get_uint8(iface_kern_id, ISCSI_IFACE_SUBSYS,
a288e4f
+				    "hop_limit", &iface->hop_limit))
a288e4f
+			iface->hop_limit = 0;
a288e4f
+
a288e4f
+		sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS, "mld_en",
a288e4f
+			      iface->mld, sizeof(iface->mld));
a288e4f
+
a288e4f
+		if (sysfs_get_uint(iface_kern_id, ISCSI_IFACE_SUBSYS,
a288e4f
+				   "nd_reachable_tmo",
a288e4f
+				   &iface->nd_reachable_tmo))
a288e4f
+			iface->nd_reachable_tmo = 0;
a288e4f
+
a288e4f
+		if (sysfs_get_uint(iface_kern_id, ISCSI_IFACE_SUBSYS,
a288e4f
+				   "nd_rexmit_time", &iface->nd_rexmit_time))
a288e4f
+			iface->nd_rexmit_time = 0;
a288e4f
+
a288e4f
+		if (sysfs_get_uint(iface_kern_id, ISCSI_IFACE_SUBSYS,
a288e4f
+				   "nd_stale_tmo", &iface->nd_stale_tmo))
a288e4f
+			iface->nd_stale_tmo = 0;
a288e4f
+
a288e4f
+		if (sysfs_get_uint(iface_kern_id, ISCSI_IFACE_SUBSYS,
a288e4f
+				   "router_adv_link_mtu",
a288e4f
+				   &iface->router_adv_link_mtu))
a288e4f
+			iface->router_adv_link_mtu = 0;
a288e4f
+
a288e4f
+		if (sysfs_get_uint(iface_kern_id, ISCSI_IFACE_SUBSYS,
a288e4f
+				   "traffic_class", &iface->traffic_class))
a288e4f
+			iface->traffic_class = 0;
a288e4f
 	}
a288e4f
 
a288e4f
 	if (sysfs_get_uint16(iface_kern_id, ISCSI_IFACE_SUBSYS, "port",
a288e4f
@@ -888,6 +1000,94 @@ static int iscsi_sysfs_read_iface(struct iface_rec *iface, int host_no,
a288e4f
 			    &iface->vlan_priority))
a288e4f
 		iface->vlan_priority = UINT8_MAX;
a288e4f
 
a288e4f
+	sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS, "vlan_enabled",
a288e4f
+		      iface->vlan_state, sizeof(iface->vlan_state));
a288e4f
+
a288e4f
+	sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS, "enabled",
a288e4f
+		      iface->state, sizeof(iface->state));
a288e4f
+
a288e4f
+	sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS, "delayed_ack_en",
a288e4f
+		      iface->delayed_ack, sizeof(iface->delayed_ack));
a288e4f
+
a288e4f
+	sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS, "tcp_nagle_disable",
a288e4f
+		      iface->nagle, sizeof(iface->nagle));
a288e4f
+
a288e4f
+	sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS, "tcp_wsf_disable",
a288e4f
+		      iface->tcp_wsf_state, sizeof(iface->tcp_wsf_state));
a288e4f
+
a288e4f
+	if (sysfs_get_uint8(iface_kern_id, ISCSI_IFACE_SUBSYS, "tcp_wsf",
a288e4f
+			    &iface->tcp_wsf))
a288e4f
+		iface->tcp_wsf = 0;
a288e4f
+
a288e4f
+	if (sysfs_get_uint8(iface_kern_id, ISCSI_IFACE_SUBSYS,
a288e4f
+			    "tcp_timer_scale", &iface->tcp_timer_scale))
a288e4f
+		iface->tcp_timer_scale = 0;
a288e4f
+
a288e4f
+	sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS, "tcp_timestamp_en",
a288e4f
+		      iface->tcp_timestamp, sizeof(iface->tcp_timestamp));
a288e4f
+
a288e4f
+	sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS, "redirect_en",
a288e4f
+		      iface->redirect, sizeof(iface->redirect));
a288e4f
+
a288e4f
+	if (sysfs_get_uint16(iface_kern_id, ISCSI_IFACE_SUBSYS,
a288e4f
+			     "def_taskmgmt_tmo", &iface->def_task_mgmt_tmo))
a288e4f
+		iface->def_task_mgmt_tmo = 0;
a288e4f
+
a288e4f
+	sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS, "header_digest",
a288e4f
+		      iface->header_digest, sizeof(iface->header_digest));
a288e4f
+
a288e4f
+	sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS, "data_digest",
a288e4f
+		      iface->data_digest, sizeof(iface->data_digest));
a288e4f
+
a288e4f
+	sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS, "immediate_data",
a288e4f
+		      iface->immediate_data, sizeof(iface->immediate_data));
a288e4f
+
a288e4f
+	sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS, "initial_r2t",
a288e4f
+		      iface->initial_r2t, sizeof(iface->initial_r2t));
a288e4f
+
a288e4f
+	sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS, "data_seq_in_order",
a288e4f
+		      iface->data_seq_inorder, sizeof(iface->data_seq_inorder));
a288e4f
+
a288e4f
+	sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS, "data_pdu_in_order",
a288e4f
+		      iface->data_pdu_inorder, sizeof(iface->data_pdu_inorder));
a288e4f
+
a288e4f
+	if (sysfs_get_uint8(iface_kern_id, ISCSI_IFACE_SUBSYS, "erl",
a288e4f
+			    &iface->erl))
a288e4f
+		iface->erl = 0;
a288e4f
+
a288e4f
+	if (sysfs_get_uint(iface_kern_id, ISCSI_IFACE_SUBSYS,
a288e4f
+			   "max_recv_dlength", &iface->max_recv_dlength))
a288e4f
+		iface->max_recv_dlength = 0;
a288e4f
+
a288e4f
+	if (sysfs_get_uint(iface_kern_id, ISCSI_IFACE_SUBSYS,
a288e4f
+			   "first_burst_len", &iface->first_burst_len))
a288e4f
+		iface->first_burst_len = 0;
a288e4f
+
a288e4f
+	if (sysfs_get_uint16(iface_kern_id, ISCSI_IFACE_SUBSYS,
a288e4f
+			     "max_outstanding_r2t", &iface->max_out_r2t))
a288e4f
+		iface->max_out_r2t = 0;
a288e4f
+
a288e4f
+	if (sysfs_get_uint(iface_kern_id, ISCSI_IFACE_SUBSYS,
a288e4f
+			   "max_burst_len", &iface->max_burst_len))
a288e4f
+		iface->max_burst_len = 0;
a288e4f
+
a288e4f
+	sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS, "chap_auth",
a288e4f
+		      iface->chap_auth, sizeof(iface->chap_auth));
a288e4f
+
a288e4f
+	sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS, "bidi_chap",
a288e4f
+		      iface->bidi_chap, sizeof(iface->bidi_chap));
a288e4f
+
a288e4f
+	sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS, "strict_login_comp_en",
a288e4f
+		      iface->strict_login_comp,
a288e4f
+		      sizeof(iface->strict_login_comp));
a288e4f
+
a288e4f
+	sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS,
a288e4f
+		      "discovery_auth_optional",
a288e4f
+		      iface->discovery_auth, sizeof(iface->discovery_auth));
a288e4f
+
a288e4f
+	sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS, "discovery_logout",
a288e4f
+		      iface->discovery_logout, sizeof(iface->discovery_logout));
a288e4f
+
a288e4f
 	if (sscanf(iface_kern_id, "ipv%d-iface-%u-%u", &iface_type,
a288e4f
 		   &tmp_host_no, &iface_num) == 3)
a288e4f
 		iface->iface_num = iface_num;
a288e4f
-- 
a288e4f
1.8.3.1
a288e4f