summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Matz <olivier.matz@6wind.com>2019-05-21 18:13:09 +0200
committerFerruh Yigit <ferruh.yigit@intel.com>2019-05-24 13:34:46 +0200
commitecaeed4f1d042b4317f756ad49ab4d918d0e4f76 (patch)
treeb58684350d7c58943ddf35bc43bc8377b62be300
parent6d961b06d8c0fdda1632f62a0414959e3f92bfbf (diff)
downloaddpdk-ecaeed4f1d042b4317f756ad49ab4d918d0e4f76.zip
dpdk-ecaeed4f1d042b4317f756ad49ab4d918d0e4f76.tar.gz
dpdk-ecaeed4f1d042b4317f756ad49ab4d918d0e4f76.tar.xz
net: add rte prefix to ICMP defines
Add 'RTE_' prefix to defines: - rename IP_ICMP_ECHO_REPLY as RTE_IP_ICMP_ECHO_REPLY. - rename IP_ICMP_ECHO_REQUEST as RTE_IP_ICMP_ECHO_REQUEST. Signed-off-by: Olivier Matz <olivier.matz@6wind.com> Reviewed-by: Stephen Hemminger <stephen@networkplumber.org> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
-rw-r--r--app/test-pmd/icmpecho.c10
-rw-r--r--lib/librte_net/rte_icmp.h4
2 files changed, 7 insertions, 7 deletions
diff --git a/app/test-pmd/icmpecho.c b/app/test-pmd/icmpecho.c
index bff0b8d..949cc55 100644
--- a/app/test-pmd/icmpecho.c
+++ b/app/test-pmd/icmpecho.c
@@ -433,7 +433,7 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs)
icmp_h = (struct rte_icmp_hdr *) ((char *)ip_h +
sizeof(struct ipv4_hdr));
if (! ((ip_h->next_proto_id == IPPROTO_ICMP) &&
- (icmp_h->icmp_type == IP_ICMP_ECHO_REQUEST) &&
+ (icmp_h->icmp_type == RTE_IP_ICMP_ECHO_REQUEST) &&
(icmp_h->icmp_code == 0))) {
rte_pktmbuf_free(pkt);
continue;
@@ -457,7 +457,7 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs)
* - switch the request IP source and destination
* addresses in the reply IP header,
* - keep the IP header checksum unchanged.
- * - set IP_ICMP_ECHO_REPLY in ICMP header.
+ * - set RTE_IP_ICMP_ECHO_REPLY in ICMP header.
* ICMP checksum is computed by assuming it is valid in the
* echo request and not verified.
*/
@@ -480,10 +480,10 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs)
ip_h->src_addr = ip_h->dst_addr;
ip_h->dst_addr = ip_addr;
}
- icmp_h->icmp_type = IP_ICMP_ECHO_REPLY;
+ icmp_h->icmp_type = RTE_IP_ICMP_ECHO_REPLY;
cksum = ~icmp_h->icmp_cksum & 0xffff;
- cksum += ~htons(IP_ICMP_ECHO_REQUEST << 8) & 0xffff;
- cksum += htons(IP_ICMP_ECHO_REPLY << 8);
+ cksum += ~htons(RTE_IP_ICMP_ECHO_REQUEST << 8) & 0xffff;
+ cksum += htons(RTE_IP_ICMP_ECHO_REPLY << 8);
cksum = (cksum & 0xffff) + (cksum >> 16);
cksum = (cksum & 0xffff) + (cksum >> 16);
icmp_h->icmp_cksum = ~cksum;
diff --git a/lib/librte_net/rte_icmp.h b/lib/librte_net/rte_icmp.h
index d030953..3f8100a 100644
--- a/lib/librte_net/rte_icmp.h
+++ b/lib/librte_net/rte_icmp.h
@@ -32,8 +32,8 @@ struct rte_icmp_hdr {
} __attribute__((__packed__));
/* ICMP packet types */
-#define IP_ICMP_ECHO_REPLY 0
-#define IP_ICMP_ECHO_REQUEST 8
+#define RTE_IP_ICMP_ECHO_REPLY 0
+#define RTE_IP_ICMP_ECHO_REQUEST 8
#ifdef __cplusplus
}