]> git.droids-corp.org - dpdk.git/blobdiff - lib/librte_net/rte_ip.h
net: define IPv4 IHL and VHL
[dpdk.git] / lib / librte_net / rte_ip.h
index e69b863534fa0378c0989640e56c6b02cd119ecc..26b089ec123630aeeac29e05cc9184c2de2b5cd9 100644 (file)
@@ -16,7 +16,9 @@
  */
 
 #include <stdint.h>
+#include <sys/types.h>
 #include <netinet/in.h>
+#include <netinet/ip.h>
 
 #include <rte_byteorder.h>
 #include <rte_mbuf.h>
@@ -96,6 +98,10 @@ struct rte_ipv4_hdr {
        ((x) >= RTE_IPV4_MIN_MCAST && (x) <= RTE_IPV4_MAX_MCAST)
        /**< check if IPv4 address is multicast */
 
+/* IPv4 default fields values */
+#define RTE_IPV4_MIN_IHL    (0x5)
+#define RTE_IPV4_VHL_DEF    (IPVERSION | RTE_IPV4_MIN_IHL)
+
 /**
  * @internal Calculate a sum of all words in the buffer.
  * Helper routine for the rte_raw_cksum().