summaryrefslogtreecommitdiffstats
path: root/src/pkt_gen.h
diff options
context:
space:
mode:
authorIdo Barnea <ibarnea@cisco.com>2016-09-27 14:24:32 +0300
committerIdo Barnea <ibarnea@cisco.com>2016-10-05 10:45:29 +0300
commitefb8873783d59ae2e5a870a99f05e40ebf661c16 (patch)
treed1ad7c06f55a532ae1b1349a24bb0aa067def4a8 /src/pkt_gen.h
parent2223955b8eb3b378c1ab79e3735ed340852b04b9 (diff)
pre test: Code review fixes
Diffstat (limited to 'src/pkt_gen.h')
-rw-r--r--src/pkt_gen.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/pkt_gen.h b/src/pkt_gen.h
new file mode 100644
index 00000000..309e02b9
--- /dev/null
+++ b/src/pkt_gen.h
@@ -0,0 +1,51 @@
+/*
+ Ido Barnea
+ Cisco Systems, Inc.
+*/
+
+/*
+ Copyright (c) 2016-2016 Cisco Systems, Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+#ifndef __PKT_GEN_H__
+#define __PKT_GEN_H__
+
+enum {
+ D_PKT_TYPE_ICMP = 1,
+ D_PKT_TYPE_UDP = 2,
+ D_PKT_TYPE_TCP = 3,
+ D_PKT_TYPE_ARP = 4,
+ D_PKT_TYPE_9k_UDP = 5,
+ D_PKT_TYPE_IPV6 = 60,
+ D_PKT_TYPE_HW_VERIFY = 100,
+ D_PKT_TYPE_HW_VERIFY_RCV_ALL = 101,
+ D_PKT_TYPE_HW_TOGGLE_TEST = 102,
+};
+
+enum {
+ DPF_VLAN = 0x1,
+ DPF_QINQ = 0X2,
+ DPF_RXCHECK = 0x4
+};
+
+class CTestPktGen {
+ public:
+ static char *create_test_pkt(uint16_t l3_type, uint16_t l4_proto, uint8_t ttl, uint32_t ip_id, uint16_t flags
+ , uint16_t max_payload, int &pkt_size);
+ static void create_arp_req(uint8_t *pkt, uint32_t sip, uint32_t tip, uint8_t *src_mac, uint16_t vlan
+ , uint16_t port);
+};
+
+#endif