#include "testpmd.h"
#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)
#define GRE_CHECKSUM_PRESENT 0x8000
#define GRE_KEY_PRESENT 0x2000
{{ 0x00, 0x01, 0x02, 0x03, 0x04, 0x01 }};
#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 inline uint16_t
ip_sum(const unaligned_uint16_t *hdr, int hdr_len)
/* Initialize IP header. */
ip_hdr = (struct rte_ipv4_hdr *)(eth_hdr + 1);
memset(ip_hdr, 0, sizeof(*ip_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;
uint32_t tx_ip_dst_addr = (192U << 24) | (18 << 16) | (0 << 8) | 2;
#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 struct rte_ipv4_hdr pkt_ip_hdr; /**< IP header of transmitted packets. */
RTE_DEFINE_PER_LCORE(uint8_t, _ip_var); /**< IP address variation */
* Initialize IP header.
*/
pkt_len = (uint16_t) (pkt_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;
#include <rte_byteorder.h>
#include <rte_mbuf.h>
+#include <rte_ip.h>
#include "packet_burst_generator.h"
#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,
*/
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;
*/
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;
#include "vnic_nic.h"
#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)
#define IP6_VTC_FLOW 0x60000000
/* Highest Item type supported by Flowman */
sizeof(struct rte_vxlan_hdr);
append_template(&template, &off, item->spec,
sizeof(struct rte_ipv4_hdr));
- ip4->version_ihl = IP_VHL_DEF;
+ ip4->version_ihl = RTE_IPV4_VHL_DEF;
if (ip4->time_to_live == 0)
ip4->time_to_live = IP_DEFTTL;
ip4->next_proto_id = IPPROTO_UDP;
#define UDP_HEADER_LEN 8
#define VXLAN_HEADER_LEN 8
-#define IP_VERSION 0x40
-#define IP_HDRLEN 0x05 /* default IP header length == five 32-bits words. */
#define IP_DEFTTL 64 /* from RFC 1340. */
-#define IP_VHL_DEF (IP_VERSION | IP_HDRLEN)
#define IP_DN_FRAGMENT_FLAG 0x0040
app_l2_hdr[portid].ether_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV4);
ip = &app_ip_hdr[portid];
- ip->version_ihl = IP_VHL_DEF;
+ ip->version_ihl = RTE_IPV4_VHL_DEF;
ip->type_of_service = 0;
ip->total_length = 0;
ip->packet_id = 0;