summaryrefslogtreecommitdiffstats
path: root/src/test_pkt_gen.h
diff options
context:
space:
mode:
authorIdo Barnea <ibarnea@cisco.com>2016-08-10 15:09:45 +0300
committerIdo Barnea <ibarnea@cisco.com>2016-08-10 15:09:45 +0300
commit92880804c194990c0a2e3201c6179b8c2f6cae7c (patch)
tree6650b767894e35b0090b7e80d8f0371d2ba0f97c /src/test_pkt_gen.h
parente61cecf7febc28116507221af6922e252bda89a4 (diff)
Better flow stat parser unit tests, including IPv6
Diffstat (limited to 'src/test_pkt_gen.h')
-rw-r--r--src/test_pkt_gen.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/test_pkt_gen.h b/src/test_pkt_gen.h
new file mode 100644
index 00000000..f4ac3a83
--- /dev/null
+++ b/src/test_pkt_gen.h
@@ -0,0 +1,46 @@
+/*
+ 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 __TEST_PKT_GEN_H__
+#define __TEST_PKT_GEN_H__
+
+enum {
+ D_PKT_TYPE_ICMP = 1,
+ D_PKT_TYPE_UDP = 2,
+ D_PKT_TYPE_TCP = 3,
+ D_PKT_TYPE_9k_UDP = 4,
+ D_PKT_TYPE_IPV6 = 60,
+ D_PKT_TYPE_HW_VERIFY = 100,
+};
+
+enum {
+ DPF_VLAN = 0x1,
+ DPF_QINQ = 0X2,
+ DPF_RXCHECK = 0x4
+};
+
+class CTestPktGen {
+ public:
+ 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);
+};
+
+#endif