X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=sidebyside;f=app%2Ftest-pmd%2Ficmpecho.c;h=2d359c9436173fe4cfb1c339461df56bd404fd78;hb=95e4e4ec7469e24e507381b40b48e92a345ec02f;hp=bff0b8d9c21d007d58cdb3b5a2003e7706294e3f;hpb=6d961b06d8c0fdda1632f62a0414959e3f92bfbf;p=dpdk.git diff --git a/app/test-pmd/icmpecho.c b/app/test-pmd/icmpecho.c index bff0b8d9c2..2d359c9436 100644 --- a/app/test-pmd/icmpecho.c +++ b/app/test-pmd/icmpecho.c @@ -243,7 +243,7 @@ ipv4_addr_dump(const char *what, uint32_t be_ipv4_addr) } static uint16_t -ipv4_hdr_cksum(struct ipv4_hdr *ip_h) +ipv4_hdr_cksum(struct rte_ipv4_hdr *ip_h) { uint16_t *v16_h; uint32_t ip_cksum; @@ -278,7 +278,7 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs) struct rte_ether_hdr *eth_h; struct rte_vlan_hdr *vlan_h; struct rte_arp_hdr *arp_h; - struct ipv4_hdr *ip_h; + struct rte_ipv4_hdr *ip_h; struct rte_icmp_hdr *icmp_h; struct rte_ether_addr eth_addr; uint32_t retry; @@ -360,7 +360,7 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs) } if ((RTE_BE_TO_CPU_16(arp_h->arp_hardware) != RTE_ARP_HRD_ETHER) || - (arp_pro != RTE_ETHER_TYPE_IPv4) || + (arp_pro != RTE_ETHER_TYPE_IPV4) || (arp_h->arp_hlen != 6) || (arp_h->arp_plen != 4) ) { @@ -414,11 +414,11 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs) continue; } - if (eth_type != RTE_ETHER_TYPE_IPv4) { + if (eth_type != RTE_ETHER_TYPE_IPV4) { rte_pktmbuf_free(pkt); continue; } - ip_h = (struct ipv4_hdr *) ((char *)eth_h + l2_len); + ip_h = (struct rte_ipv4_hdr *) ((char *)eth_h + l2_len); if (verbose_level > 0) { ipv4_addr_dump(" IPV4: src=", ip_h->src_addr); ipv4_addr_dump(" dst=", ip_h->dst_addr); @@ -431,9 +431,9 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs) * Check if packet is a ICMP echo request. */ icmp_h = (struct rte_icmp_hdr *) ((char *)ip_h + - sizeof(struct ipv4_hdr)); + sizeof(struct rte_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;