summaryrefslogtreecommitdiffstats
path: root/src/debug.cpp
diff options
context:
space:
mode:
authorIdo Barnea <ibarnea@cisco.com>2016-03-15 13:19:20 +0200
committerIdo Barnea <ibarnea@cisco.com>2016-03-15 13:19:20 +0200
commitdaf8476c5602d026364df9816ade07a3d4831a0a (patch)
treefb476944eedcd6c331526058b823b14c588ad8ee /src/debug.cpp
parentd354934b8d6aeef4f0329a4460d57328e8a4ed6a (diff)
Support for Q in Q for debug packets
Diffstat (limited to 'src/debug.cpp')
-rw-r--r--src/debug.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/debug.cpp b/src/debug.cpp
index 3f8ad2fa..902766a1 100644
--- a/src/debug.cpp
+++ b/src/debug.cpp
@@ -109,6 +109,9 @@ rte_mbuf_t *CTrexDebug::create_test_pkt(int pkt_type, uint8_t ttl, uint16_t ip_i
#ifdef VLAN
uint16_t l2_proto = 0x0081;
uint8_t vlan_header[4] = {0x0a, 0xbc, 0x08, 0x00};
+#ifdef QINQ
+ uint8_t vlan_header2[4] = {0x0a, 0xbc, 0x88, 0xa8};
+#endif
#else
uint16_t l2_proto = 0x0008;
#endif
@@ -187,6 +190,9 @@ rte_mbuf_t *CTrexDebug::create_test_pkt(int pkt_type, uint8_t ttl, uint16_t ip_i
memcpy(p, src_mac, sizeof(src_mac)); p += sizeof(src_mac);
memcpy(p, &l2_proto, sizeof(l2_proto)); p += sizeof(l2_proto);
#ifdef VLAN
+#ifdef QINQ
+ memcpy(p, &vlan_header2, sizeof(vlan_header2)); p += sizeof(vlan_header2);
+#endif
memcpy(p, &vlan_header, sizeof(vlan_header)); p += sizeof(vlan_header);
#endif
struct IPHeader *ip = (IPHeader *)p;