net/softnic: use POSIX network address conversion
[dpdk.git] / lib / librte_net / rte_net.c
index 6515909..bfe5003 100644 (file)
@@ -171,15 +171,8 @@ ptype_tunnel(uint16_t *proto, const struct rte_mbuf *m,
        }
 }
 
-/* get the ipv4 header length */
-static uint8_t
-ip4_hlen(const struct rte_ipv4_hdr *hdr)
-{
-       return (hdr->version_ihl & 0xf) * 4;
-}
-
 /* parse ipv6 extended headers, update offset and return next proto */
-int __rte_experimental
+int
 rte_net_skip_ip6_ext(uint16_t proto, const struct rte_mbuf *m, uint32_t *off,
        int *frag)
 {
@@ -278,8 +271,8 @@ uint32_t rte_net_get_ptype(const struct rte_mbuf *m,
        } else if ((proto == rte_cpu_to_be_16(RTE_ETHER_TYPE_MPLS)) ||
                (proto == rte_cpu_to_be_16(RTE_ETHER_TYPE_MPLSM))) {
                unsigned int i;
-               const struct mpls_hdr *mh;
-               struct mpls_hdr mh_copy;
+               const struct rte_mpls_hdr *mh;
+               struct rte_mpls_hdr mh_copy;
 
 #define MAX_MPLS_HDR 5
                for (i = 0; i < MAX_MPLS_HDR; i++) {
@@ -308,7 +301,7 @@ l3:
                        return pkt_type;
 
                pkt_type |= ptype_l3_ip(ip4h->version_ihl);
-               hdr_lens->l3_len = ip4_hlen(ip4h);
+               hdr_lens->l3_len = rte_ipv4_hdr_len(ip4h);
                off += hdr_lens->l3_len;
 
                if ((layers & RTE_PTYPE_L4_MASK) == 0)
@@ -440,7 +433,7 @@ l3:
                        return pkt_type;
 
                pkt_type |= ptype_inner_l3_ip(ip4h->version_ihl);
-               hdr_lens->inner_l3_len = ip4_hlen(ip4h);
+               hdr_lens->inner_l3_len = rte_ipv4_hdr_len(ip4h);
                off += hdr_lens->inner_l3_len;
 
                if ((layers & RTE_PTYPE_INNER_L4_MASK) == 0)