[qca-nss-clients] Reverting some of the fields for IPsec manager

 Reverting the field names to reduce changes in public API users

Change-Id: Ia27b618cf3f8d87af73367141c18e98b2a98ac22
Signed-off-by: Ratheesh Kannoth <rkannoth@codeaurora.org>
diff --git a/exports/nss_ipsecmgr.h b/exports/nss_ipsecmgr.h
index 9c52d18..62b0f23 100644
--- a/exports/nss_ipsecmgr.h
+++ b/exports/nss_ipsecmgr.h
@@ -203,10 +203,10 @@
 	uint32_t src_ip[4];	/**< IPv6 source IP. */
 	uint32_t dest_ip[4];	/**< IPv6 destination IP. */
 	uint32_t spi_index;	/**< SPI index of the encapsulating security payload (ESP). */
-	uint16_t src_port;	/**< Source port. */
-	uint16_t dest_port;	/**< Destination port. */
-	uint8_t protocol;	/**< Protocol (ESP or NAT-T) */
-	uint8_t ip_ver;		/**< IP version 4/6. */
+	uint16_t sport;		/**< Source port. */
+	uint16_t dport;		/**< Destination port. */
+	uint8_t proto_next_hdr;	/**< Protocol (ESP or NAT-T) */
+	uint8_t ip_version;	/**< IP version 4/6. */
 	uint8_t res[2];		/**< Reserved */
 };
 
@@ -218,11 +218,11 @@
 	uint32_t src_ip[4];		/**< Source IP. */
 	uint32_t dest_ip[4];		/**< Destination IP. */
 	uint32_t spi_index;		/**< ESP SPI index for decapsulation flows. */
-	uint16_t src_port;			/**< Source Port (unused). */
-	uint16_t dest_port;			/**< Destination Port (unused). */
-	uint8_t protocol;		/**< Transport layer protocol. */
-	uint8_t ip_ver;			/**< IP version 4/6. */
-	uint8_t user_pattern;		/**< User defined flow identifier. */
+	uint16_t sport;			/**< Source Port (unused). */
+	uint16_t dport;			/**< Destination Port (unused). */
+	uint8_t proto_next_hdr;		/**< Transport layer proto_next_hdr. */
+	uint8_t ip_version;		/**< IP version 4/6. */
+	uint8_t use_pattern;		/**< User defined flow identifier. */
 };
 
 /**
diff --git a/ipsecmgr/v2.0/nss_ipsecmgr_flow.h b/ipsecmgr/v2.0/nss_ipsecmgr_flow.h
index d0a90bd..d29dcd5 100644
--- a/ipsecmgr/v2.0/nss_ipsecmgr_flow.h
+++ b/ipsecmgr/v2.0/nss_ipsecmgr_flow.h
@@ -131,11 +131,11 @@
 	memcpy(t->dest_ip, f->dest_ip, sizeof(t->dest_ip));
 	memcpy(t->src_ip, f->src_ip, sizeof(t->src_ip));
 	t->spi_index = f->spi_index;
-	t->protocol = f->protocol;
-	t->ip_ver = f->ip_ver;
-	t->src_port = f->src_port;
-	t->dst_port = f->dest_port;
-	t->user_pattern = f->user_pattern;
+	t->protocol = f->proto_next_hdr;
+	t->ip_ver = f->ip_version;
+	t->src_port = f->sport;
+	t->dst_port = f->dport;
+	t->user_pattern = f->use_pattern;
 }
 
 /*
diff --git a/ipsecmgr/v2.0/nss_ipsecmgr_sa.c b/ipsecmgr/v2.0/nss_ipsecmgr_sa.c
index 31ae25f..3e7590a 100644
--- a/ipsecmgr/v2.0/nss_ipsecmgr_sa.c
+++ b/ipsecmgr/v2.0/nss_ipsecmgr_sa.c
@@ -625,7 +625,7 @@
 	sa_data->flags |= data->encap.copy_dscp ? NSS_IPSEC_CMN_FLAG_COPY_DSCP : 0;
 	sa_data->flags |= data->encap.copy_df ? NSS_IPSEC_CMN_FLAG_COPY_DF : 0;
 
-	if (tuple->ip_ver == 6) {
+	if (tuple->ip_version == 6) {
 		sa_data->flags &= ~NSS_IPSEC_CMN_FLAG_HDR_MASK;
 		sa_data->flags |= NSS_IPSEC_CMN_FLAG_IPV6;
 	}
diff --git a/ipsecmgr/v2.0/nss_ipsecmgr_sa.h b/ipsecmgr/v2.0/nss_ipsecmgr_sa.h
index d569fcf..128add6 100644
--- a/ipsecmgr/v2.0/nss_ipsecmgr_sa.h
+++ b/ipsecmgr/v2.0/nss_ipsecmgr_sa.h
@@ -172,10 +172,10 @@
 	memcpy(sa->dest_ip, tuple->dest_ip, sizeof(sa->dest_ip));
 	memcpy(sa->src_ip, tuple->src_ip, sizeof(sa->src_ip));
 	sa->spi_index = tuple->spi_index;
-	sa->protocol = tuple->protocol;
-	sa->ip_ver = tuple->ip_ver;
-	sa->src_port = tuple->src_port;
-	sa->dest_port = tuple->dest_port;
+	sa->proto_next_hdr = tuple->protocol;
+	sa->ip_version = tuple->ip_ver;
+	sa->sport = tuple->src_port;
+	sa->dport = tuple->dest_port;
 }
 
 /*
@@ -187,10 +187,10 @@
 	memcpy(tuple->dest_ip, sa->dest_ip, sizeof(tuple->dest_ip));
 	memcpy(tuple->src_ip, sa->src_ip, sizeof(tuple->src_ip));
 	tuple->spi_index = sa->spi_index;
-	tuple->protocol = sa->protocol;
-	tuple->ip_ver = sa->ip_ver;
-	tuple->src_port = sa->src_port;
-	tuple->dest_port = sa->dest_port;
+	tuple->protocol = sa->proto_next_hdr;
+	tuple->ip_ver = sa->ip_version;
+	tuple->src_port = sa->sport;
+	tuple->dest_port = sa->dport;
 }
 
 /*
diff --git a/ipsecmgr/v2.0/plugins/klips/nss_ipsec_klips.c b/ipsecmgr/v2.0/plugins/klips/nss_ipsec_klips.c
index 8a64851..39a3640 100644
--- a/ipsecmgr/v2.0/plugins/klips/nss_ipsec_klips.c
+++ b/ipsecmgr/v2.0/plugins/klips/nss_ipsec_klips.c
@@ -352,8 +352,8 @@
 
 		tuple->src_ip[0] = ntohl(ip4h->saddr);
 		tuple->dest_ip[0] = ntohl(ip4h->daddr);
-		tuple->protocol = ip4h->protocol;
-		tuple->ip_ver = IPVERSION;
+		tuple->proto_next_hdr = ip4h->protocol;
+		tuple->ip_version = IPVERSION;
 		*ttl = ip4h->ttl;
 
 		/*
@@ -361,9 +361,9 @@
 		 * support for loading programmed ports by user
 		 */
 		if (natt) {
-			tuple->src_port = NSS_IPSECMGR_NATT_PORT_DATA;
-			tuple->dest_port = NSS_IPSECMGR_NATT_PORT_DATA;
-			tuple->protocol = IPPROTO_UDP;
+			tuple->sport = NSS_IPSECMGR_NATT_PORT_DATA;
+			tuple->dport = NSS_IPSECMGR_NATT_PORT_DATA;
+			tuple->proto_next_hdr = IPPROTO_UDP;
 
 			/*
 			 * TODO: Find out why we need decap flag
@@ -386,9 +386,9 @@
 	nss_ipsec_klips_v6addr_ntoh(tuple->dest_ip, ip6h->daddr.s6_addr32);
 
 	tuple->spi_index = ntohl(esph->spi);
-	tuple->protocol = IPPROTO_ESP;
+	tuple->proto_next_hdr = IPPROTO_ESP;
 	*ttl = ip6h->hop_limit;
-	tuple->ip_ver = 6;
+	tuple->ip_version = 6;
 
 	return outer + sizeof(*esph);
 }
@@ -410,13 +410,13 @@
 
 		tuple->src_ip[0] = ntohl(ip4h->saddr);
 		tuple->dest_ip[0] = ntohl(ip4h->daddr);
-		tuple->protocol = ip4h->protocol;
-		tuple->ip_ver = IPVERSION;
+		tuple->proto_next_hdr = ip4h->protocol;
+		tuple->ip_version = IPVERSION;
 
 		if (natt) {
-			tuple->src_port = NSS_IPSECMGR_NATT_PORT_DATA;
-			tuple->dest_port = NSS_IPSECMGR_NATT_PORT_DATA;
-			tuple->protocol = IPPROTO_UDP;
+			tuple->sport = NSS_IPSECMGR_NATT_PORT_DATA;
+			tuple->dport = NSS_IPSECMGR_NATT_PORT_DATA;
+			tuple->proto_next_hdr = IPPROTO_UDP;
 			outer += sizeof(struct udphdr);
 		}
 
@@ -436,8 +436,8 @@
 	nss_ipsec_klips_v6addr_ntoh(tuple->dest_ip, ip6h->daddr.s6_addr32);
 
 	tuple->spi_index = ntohl(esph->spi);
-	tuple->protocol = IPPROTO_ESP;
-	tuple->ip_ver = 6;
+	tuple->proto_next_hdr = IPPROTO_ESP;
+	tuple->ip_version = 6;
 	return true;
 }
 
@@ -457,15 +457,15 @@
 	 * them and then allow adding or deleting of 3-tuple correctly
 	 */
 
-	tuple->src_port = 0;
-	tuple->dest_port = 0;
-	tuple->user_pattern = 0;
+	tuple->sport = 0;
+	tuple->dport = 0;
+	tuple->use_pattern = 0;
 
 	if (iph->version == IPVERSION) {
 		tuple->src_ip[0] = ntohl(iph->saddr);
 		tuple->dest_ip[0] = ntohl(iph->daddr);
-		tuple->protocol = iph->protocol;
-		tuple->ip_ver = IPVERSION;
+		tuple->proto_next_hdr = iph->protocol;
+		tuple->ip_version = IPVERSION;
 		return;
 	}
 
@@ -473,12 +473,12 @@
 
 	nss_ipsec_klips_v6addr_ntoh(tuple->src_ip, ip6h->saddr.s6_addr32);
 	nss_ipsec_klips_v6addr_ntoh(tuple->dest_ip, ip6h->daddr.s6_addr32);
-	tuple->protocol = ip6h->nexthdr;
-	tuple->ip_ver = 6;
+	tuple->proto_next_hdr = ip6h->nexthdr;
+	tuple->ip_version = 6;
 
 	if (ip6h->nexthdr == NEXTHDR_FRAGMENT) {
 		struct frag_hdr *fragh = (struct frag_hdr *)(inner + sizeof(*ip6h));
-		tuple->protocol = fragh->nexthdr;
+		tuple->proto_next_hdr = fragh->nexthdr;
 	}
 }