summaryrefslogtreecommitdiffstats
path: root/src/pkt_gen.cpp
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2017-01-22 16:20:45 +0200
committerimarom <imarom@cisco.com>2017-01-22 16:20:45 +0200
commit904eacd9be1230efb7ae0ab7997ec131b588ec8a (patch)
tree8e4bcd1b1a5f683efdb8f3eeb962acefc3201961 /src/pkt_gen.cpp
parentd2f1c8451e2e8ffc47b208f68f9b16697d706d60 (diff)
parentb81cdb6c2d6d118c1c346e7c8dae6a5e747d867d (diff)
Merge branch 'master' into capture
Signed-off-by: imarom <imarom@cisco.com> Conflicts: scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_jsonrpc_client.py scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py src/main_dpdk.cpp
Diffstat (limited to 'src/pkt_gen.cpp')
-rw-r--r--src/pkt_gen.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/pkt_gen.cpp b/src/pkt_gen.cpp
index 656b1b06..9f6a3d34 100644
--- a/src/pkt_gen.cpp
+++ b/src/pkt_gen.cpp
@@ -123,6 +123,9 @@ char *CTestPktGen::create_test_pkt(uint16_t l3_type, uint16_t l4_proto, uint8_t
pkt_size += sizeof(struct CRx_check_header);
}
break;
+ case EthernetHeader::Protocol::ARP:
+ pkt_size += sizeof(ArpHdr);
+ break;
}
switch (l4_proto) {
@@ -192,9 +195,13 @@ char *CTestPktGen::create_test_pkt(uint16_t l3_type, uint16_t l4_proto, uint8_t
ipv6->setPayloadLen(pkt_size - 14 - sizeof(ipv6_header));
ipv6->setFlowLabel(ip_id);
break;
+ case EthernetHeader::Protocol::ARP:
+ uint16_t vlan = (flags & DPF_VLAN) ? 200 : 0;
+ create_arp_req((uint8_t *)p_start, 0x01020304, 0x05060708, src_mac, vlan, 0);
+ return p_start;
+ break;
}
-
struct TCPHeader *tcp = (TCPHeader *)p;
struct ICMPHeader *icmp= (ICMPHeader *)p;
switch (l4_proto) {