net: replace IPv4/v6 constants with uppercase name
[dpdk.git] / examples / l3fwd-power / main.c
index 2631fdd..66ad105 100644 (file)
@@ -258,10 +258,10 @@ struct ipv6_l3fwd_route {
 };
 
 static struct ipv4_l3fwd_route ipv4_l3fwd_route_array[] = {
-       {{RTE_IPv4(100,10,0,1), RTE_IPv4(200,10,0,1), 101, 11, IPPROTO_TCP}, 0},
-       {{RTE_IPv4(100,20,0,2), RTE_IPv4(200,20,0,2), 102, 12, IPPROTO_TCP}, 1},
-       {{RTE_IPv4(100,30,0,3), RTE_IPv4(200,30,0,3), 103, 13, IPPROTO_TCP}, 2},
-       {{RTE_IPv4(100,40,0,4), RTE_IPv4(200,40,0,4), 104, 14, IPPROTO_TCP}, 3},
+       {{RTE_IPV4(100,10,0,1), RTE_IPV4(200,10,0,1), 101, 11, IPPROTO_TCP}, 0},
+       {{RTE_IPV4(100,20,0,2), RTE_IPV4(200,20,0,2), 102, 12, IPPROTO_TCP}, 1},
+       {{RTE_IPV4(100,30,0,3), RTE_IPV4(200,30,0,3), 103, 13, IPPROTO_TCP}, 2},
+       {{RTE_IPV4(100,40,0,4), RTE_IPV4(200,40,0,4), 104, 14, IPPROTO_TCP}, 3},
 };
 
 static struct ipv6_l3fwd_route ipv6_l3fwd_route_array[] = {
@@ -300,14 +300,14 @@ struct ipv4_l3fwd_route {
 };
 
 static struct ipv4_l3fwd_route ipv4_l3fwd_route_array[] = {
-       {RTE_IPv4(1,1,1,0), 24, 0},
-       {RTE_IPv4(2,1,1,0), 24, 1},
-       {RTE_IPv4(3,1,1,0), 24, 2},
-       {RTE_IPv4(4,1,1,0), 24, 3},
-       {RTE_IPv4(5,1,1,0), 24, 4},
-       {RTE_IPv4(6,1,1,0), 24, 5},
-       {RTE_IPv4(7,1,1,0), 24, 6},
-       {RTE_IPv4(8,1,1,0), 24, 7},
+       {RTE_IPV4(1,1,1,0), 24, 0},
+       {RTE_IPV4(2,1,1,0), 24, 1},
+       {RTE_IPV4(3,1,1,0), 24, 2},
+       {RTE_IPV4(4,1,1,0), 24, 3},
+       {RTE_IPV4(5,1,1,0), 24, 4},
+       {RTE_IPV4(6,1,1,0), 24, 5},
+       {RTE_IPV4(7,1,1,0), 24, 6},
+       {RTE_IPV4(8,1,1,0), 24, 7},
 };
 
 #define IPV4_L3FWD_NUM_ROUTES \
@@ -528,7 +528,7 @@ get_ipv4_dst_port(struct rte_ipv4_hdr *ipv4_hdr, uint16_t portid,
 {
        struct ipv4_5tuple key;
        struct rte_tcp_hdr *tcp;
-       struct udp_hdr *udp;
+       struct rte_udp_hdr *udp;
        int ret = 0;
 
        key.ip_dst = rte_be_to_cpu_32(ipv4_hdr->dst_addr);
@@ -544,7 +544,7 @@ get_ipv4_dst_port(struct rte_ipv4_hdr *ipv4_hdr, uint16_t portid,
                break;
 
        case IPPROTO_UDP:
-               udp = (struct udp_hdr *)((unsigned char *)ipv4_hdr +
+               udp = (struct rte_udp_hdr *)((unsigned char *)ipv4_hdr +
                                        sizeof(struct rte_ipv4_hdr));
                key.port_dst = rte_be_to_cpu_16(udp->dst_port);
                key.port_src = rte_be_to_cpu_16(udp->src_port);
@@ -567,7 +567,7 @@ get_ipv6_dst_port(struct rte_ipv6_hdr *ipv6_hdr, uint16_t portid,
 {
        struct ipv6_5tuple key;
        struct rte_tcp_hdr *tcp;
-       struct udp_hdr *udp;
+       struct rte_udp_hdr *udp;
        int ret = 0;
 
        memcpy(key.ip_dst, ipv6_hdr->dst_addr, IPV6_ADDR_LEN);
@@ -584,7 +584,7 @@ get_ipv6_dst_port(struct rte_ipv6_hdr *ipv6_hdr, uint16_t portid,
                break;
 
        case IPPROTO_UDP:
-               udp = (struct udp_hdr *)((unsigned char *) ipv6_hdr +
+               udp = (struct rte_udp_hdr *)((unsigned char *) ipv6_hdr +
                                        sizeof(struct rte_ipv6_hdr));
                key.port_dst = rte_be_to_cpu_16(udp->dst_port);
                key.port_src = rte_be_to_cpu_16(udp->src_port);
@@ -624,9 +624,9 @@ parse_ptype_one(struct rte_mbuf *m)
 
        eth_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
        ether_type = eth_hdr->ether_type;
-       if (ether_type == rte_cpu_to_be_16(RTE_ETHER_TYPE_IPv4))
+       if (ether_type == rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV4))
                packet_type |= RTE_PTYPE_L3_IPV4_EXT_UNKNOWN;
-       else if (ether_type == rte_cpu_to_be_16(RTE_ETHER_TYPE_IPv6))
+       else if (ether_type == rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV6))
                packet_type |= RTE_PTYPE_L3_IPV6_EXT_UNKNOWN;
 
        m->packet_type = packet_type;