X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=app%2Ftest%2Fpacket_burst_generator.c;h=f203f9d09efc7eecc75a36348973e5550cab99d8;hb=c17af95a19e30c8d89eb96ceca99f60474ca2ac4;hp=445c1df9df89f4319449422336374ee3fe7b1851;hpb=e73e3547ce54d7ae48dff82d87efac0b7a30692a;p=dpdk.git diff --git a/app/test/packet_burst_generator.c b/app/test/packet_burst_generator.c index 445c1df9df..f203f9d09e 100644 --- a/app/test/packet_burst_generator.c +++ b/app/test/packet_burst_generator.c @@ -4,6 +4,7 @@ #include #include +#include #include "packet_burst_generator.h" @@ -12,9 +13,6 @@ #define IP_DEFTTL 64 /* from RFC 1340. */ -#define IP_VERSION 0x40 -#define IP_HDRLEN 0x05 /* default IP header length == five 32-bits words. */ -#define IP_VHL_DEF (IP_VERSION | IP_HDRLEN) static void copy_buf_to_pkt_segs(void *buf, unsigned len, struct rte_mbuf *pkt, @@ -82,7 +80,7 @@ initialize_arp_header(struct rte_arp_hdr *arp_hdr, uint32_t opcode) { arp_hdr->arp_hardware = rte_cpu_to_be_16(RTE_ARP_HRD_ETHER); - arp_hdr->arp_protocol = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPv4); + arp_hdr->arp_protocol = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV4); arp_hdr->arp_hlen = RTE_ETHER_ADDR_LEN; arp_hdr->arp_plen = sizeof(uint32_t); arp_hdr->arp_opcode = rte_cpu_to_be_16(opcode); @@ -167,7 +165,7 @@ initialize_ipv4_header(struct rte_ipv4_hdr *ip_hdr, uint32_t src_addr, */ pkt_len = (uint16_t) (pkt_data_len + sizeof(struct rte_ipv4_hdr)); - ip_hdr->version_ihl = IP_VHL_DEF; + ip_hdr->version_ihl = RTE_IPV4_VHL_DEF; ip_hdr->type_of_service = 0; ip_hdr->fragment_offset = 0; ip_hdr->time_to_live = IP_DEFTTL; @@ -215,7 +213,7 @@ initialize_ipv4_header_proto(struct rte_ipv4_hdr *ip_hdr, uint32_t src_addr, */ pkt_len = (uint16_t) (pkt_data_len + sizeof(struct rte_ipv4_hdr)); - ip_hdr->version_ihl = IP_VHL_DEF; + ip_hdr->version_ihl = RTE_IPV4_VHL_DEF; ip_hdr->type_of_service = 0; ip_hdr->fragment_offset = 0; ip_hdr->time_to_live = IP_DEFTTL; @@ -324,10 +322,10 @@ nomore_mbuf: pkt->l2_len = eth_hdr_size; if (ipv4) { - pkt->vlan_tci = RTE_ETHER_TYPE_IPv4; + pkt->vlan_tci = RTE_ETHER_TYPE_IPV4; pkt->l3_len = sizeof(struct rte_ipv4_hdr); } else { - pkt->vlan_tci = RTE_ETHER_TYPE_IPv6; + pkt->vlan_tci = RTE_ETHER_TYPE_IPV6; pkt->l3_len = sizeof(struct rte_ipv6_hdr); } @@ -445,10 +443,10 @@ nomore_mbuf: pkt->l2_len = eth_hdr_size; if (ipv4) { - pkt->vlan_tci = RTE_ETHER_TYPE_IPv4; + pkt->vlan_tci = RTE_ETHER_TYPE_IPV4; pkt->l3_len = sizeof(struct rte_ipv4_hdr); } else { - pkt->vlan_tci = RTE_ETHER_TYPE_IPv6; + pkt->vlan_tci = RTE_ETHER_TYPE_IPV6; pkt->l3_len = sizeof(struct rte_ipv6_hdr); }