diff options
author | Hanoh Haim <hhaim@cisco.com> | 2016-02-15 14:19:55 +0200 |
---|---|---|
committer | Hanoh Haim <hhaim@cisco.com> | 2016-02-15 14:19:55 +0200 |
commit | 831557167f13715b0c9b5b456e0756bb9c8af3ab (patch) | |
tree | f264d07a5feec83d38afdf9813558e23271db2bb | |
parent | 6389df5830584f4ab4f5d83f0c9575f5c154b379 (diff) | |
parent | f6901ca1f2cca419eeba2e1a35a38fe06a6650be (diff) |
Add support for mac replacement
140 files changed, 247 insertions, 34 deletions
@@ -58,6 +58,11 @@ scripts/exp/stl_vm_rand_size_64_128.pcap scripts/exp/stl_vm_random_size_64_128.pcap scripts/automation/regression/reports/unit_test.xml scripts/automation/regression/unit_tests/functional_tests/test.pcap +scripts/exp/stl_single_stream_mac0-0.erf +scripts/exp/stl_single_stream_mac01-0.erf +scripts/exp/stl_single_stream_mac10-0.erf +scripts/exp/stl_single_stream_mac11-0.erf + #files generated by global src/GPATH diff --git a/scripts/automation/regression/unit_tests/functional_tests/stl_basic_tests.py b/scripts/automation/regression/unit_tests/functional_tests/stl_basic_tests.py index fd372aea..ec1b6e92 100644 --- a/scripts/automation/regression/unit_tests/functional_tests/stl_basic_tests.py +++ b/scripts/automation/regression/unit_tests/functional_tests/stl_basic_tests.py @@ -126,6 +126,10 @@ class CStlBasic_Test(functional_general_test.CGeneralFunctional_Test): try: rc = self.run_sim(input_file, output_cap, options, silent) assert_equal(rc, True) + #s='cp '+output_cap+' '+golden_file; + #print s + #os.system(s) + if compare: self.compare_caps(output_cap, golden_file) finally: @@ -133,19 +137,6 @@ class CStlBasic_Test(functional_general_test.CGeneralFunctional_Test): os.unlink(output_cap) - - # test for IMIX - def test_imix (self): - self.golden_run("basic_imix", "imix_3pkt", "-m 50kpps --limit 500 --cores 8", silent = False) - - - def test_vm (self): - self.golden_run("basic_imix_vm", "imix_3pkt_vm", "-m 50kpps --limit 500 --cores 8", silent = False) - - - def test_tuple_gen (self): - self.golden_run("basic_tuple_gen", "imix_tuple_gen", "-m 50kpps --limit 500 --cores 8", silent = False) - def test_stl_profiles (self): p = [ @@ -178,11 +169,22 @@ class CStlBasic_Test(functional_general_test.CGeneralFunctional_Test): ["udp_1pkt_tuple_gen_split.py","-m 1 -c 2 -l 100",True], ["udp_1pkt_range_clients_split.py","-m 1 -c 2 -l 100",True], ["udp_1pkt_vxlan.py","-m 1 -c 1 -l 17",True], - ["udp_1pkt_ipv6_in_ipv4.py","-m 1 -c 1 -l 17",True] + ["udp_1pkt_ipv6_in_ipv4.py","-m 1 -c 1 -l 17",True], + ["yaml/imix_3pkt.yaml","-m 50kpps --limit 20 --cores 2",True], + ["yaml/imix_3pkt_vm.yaml","-m 50kpps --limit 20 --cores 2",True], + #["yaml/imix_1pkt_tuple_gen.yaml","-m 50kpps --limit 20 --cores 2",True] + + #imix_1pkt_tuple_gen.yaml ]; - p1 = [ ["udp_1pkt_ipv6_in_ipv4.py","-m 1 -c 1 -l 17",True] ] + #self.profiles['imix_3pkt'] = os.path.join(self.profiles_path, "imix_3pkt.yaml") + #self.profiles['imix_3pkt_vm'] = os.path.join(self.profiles_path, "imix_3pkt_vm.yaml") + #self.profiles['random_size_9k'] = os.path.join(self.profiles_path, "../udp_rand_len_9k.py") + #self.profiles['imix_tuple_gen'] = os.path.join(self.profiles_path, "imix_1pkt_tuple_gen.yaml") + + + p1 = [ ["yaml/imix_1pkt_tuple_gen.yaml","-m 50kpps --limit 20 --cores 2",True] ] for obj in p: diff --git a/scripts/exp/burst_1000_pkt.pcap b/scripts/exp/burst_1000_pkt.pcap Binary files differindex bbf15472..b9eb15e5 100644 --- a/scripts/exp/burst_1000_pkt.pcap +++ b/scripts/exp/burst_1000_pkt.pcap diff --git a/scripts/exp/burst_1pkt_1burst.pcap b/scripts/exp/burst_1pkt_1burst.pcap Binary files differindex bbf15472..b9eb15e5 100644 --- a/scripts/exp/burst_1pkt_1burst.pcap +++ b/scripts/exp/burst_1pkt_1burst.pcap diff --git a/scripts/exp/burst_1pkt_vm.pcap b/scripts/exp/burst_1pkt_vm.pcap Binary files differindex 06010c49..b2d89ad2 100644 --- a/scripts/exp/burst_1pkt_vm.pcap +++ b/scripts/exp/burst_1pkt_vm.pcap diff --git a/scripts/exp/dns-0-ex.erf b/scripts/exp/dns-0-ex.erf Binary files differindex fdb19009..08a02075 100755 --- a/scripts/exp/dns-0-ex.erf +++ b/scripts/exp/dns-0-ex.erf diff --git a/scripts/exp/dns-0.erf b/scripts/exp/dns-0.erf Binary files differindex fdb19009..08a02075 100644 --- a/scripts/exp/dns-0.erf +++ b/scripts/exp/dns-0.erf diff --git a/scripts/exp/dns_e-0-ex.erf b/scripts/exp/dns_e-0-ex.erf Binary files differindex e0de09fc..6ac25dfb 100755 --- a/scripts/exp/dns_e-0-ex.erf +++ b/scripts/exp/dns_e-0-ex.erf diff --git a/scripts/exp/dns_e-0.erf b/scripts/exp/dns_e-0.erf Binary files differindex e0de09fc..6ac25dfb 100644 --- a/scripts/exp/dns_e-0.erf +++ b/scripts/exp/dns_e-0.erf diff --git a/scripts/exp/dns_flip-0-ex.erf b/scripts/exp/dns_flip-0-ex.erf Binary files differindex 774f0fdf..b9b61e5d 100755 --- a/scripts/exp/dns_flip-0-ex.erf +++ b/scripts/exp/dns_flip-0-ex.erf diff --git a/scripts/exp/dns_flip-0.erf b/scripts/exp/dns_flip-0.erf Binary files differindex 774f0fdf..b9b61e5d 100644 --- a/scripts/exp/dns_flip-0.erf +++ b/scripts/exp/dns_flip-0.erf diff --git a/scripts/exp/dns_ipv6-0-ex.erf b/scripts/exp/dns_ipv6-0-ex.erf Binary files differindex e0d33efc..4284cc98 100755 --- a/scripts/exp/dns_ipv6-0-ex.erf +++ b/scripts/exp/dns_ipv6-0-ex.erf diff --git a/scripts/exp/dns_ipv6-0.erf b/scripts/exp/dns_ipv6-0.erf Binary files differindex e0d33efc..4284cc98 100644 --- a/scripts/exp/dns_ipv6-0.erf +++ b/scripts/exp/dns_ipv6-0.erf diff --git a/scripts/exp/dns_one_server-0-ex.erf b/scripts/exp/dns_one_server-0-ex.erf Binary files differindex 15323016..f1b4d7fe 100755 --- a/scripts/exp/dns_one_server-0-ex.erf +++ b/scripts/exp/dns_one_server-0-ex.erf diff --git a/scripts/exp/dns_one_server-0.erf b/scripts/exp/dns_one_server-0.erf Binary files differindex 15323016..f1b4d7fe 100644 --- a/scripts/exp/dns_one_server-0.erf +++ b/scripts/exp/dns_one_server-0.erf diff --git a/scripts/exp/dns_p-0-ex.erf b/scripts/exp/dns_p-0-ex.erf Binary files differindex 7d93c1d3..3849dbc3 100755 --- a/scripts/exp/dns_p-0-ex.erf +++ b/scripts/exp/dns_p-0-ex.erf diff --git a/scripts/exp/dns_p-0.erf b/scripts/exp/dns_p-0.erf Binary files differindex 7d93c1d3..3849dbc3 100644 --- a/scripts/exp/dns_p-0.erf +++ b/scripts/exp/dns_p-0.erf diff --git a/scripts/exp/dyn_pyld1-0-ex.erf b/scripts/exp/dyn_pyld1-0-ex.erf Binary files differindex 6a0028dc..ef054447 100755 --- a/scripts/exp/dyn_pyld1-0-ex.erf +++ b/scripts/exp/dyn_pyld1-0-ex.erf diff --git a/scripts/exp/dyn_pyld1-0.erf b/scripts/exp/dyn_pyld1-0.erf Binary files differindex 6a0028dc..ef054447 100644 --- a/scripts/exp/dyn_pyld1-0.erf +++ b/scripts/exp/dyn_pyld1-0.erf diff --git a/scripts/exp/hlt_udp_inc_dec_len_9k.pcap b/scripts/exp/hlt_udp_inc_dec_len_9k.pcap Binary files differindex 698c5fb3..5ece7381 100644 --- a/scripts/exp/hlt_udp_inc_dec_len_9k.pcap +++ b/scripts/exp/hlt_udp_inc_dec_len_9k.pcap diff --git a/scripts/exp/http_plugin-0-ex.erf b/scripts/exp/http_plugin-0-ex.erf Binary files differindex f195e6ae..6c0accd7 100755 --- a/scripts/exp/http_plugin-0-ex.erf +++ b/scripts/exp/http_plugin-0-ex.erf diff --git a/scripts/exp/http_plugin-0.erf b/scripts/exp/http_plugin-0.erf Binary files differindex e2320eeb..6c0accd7 100644 --- a/scripts/exp/http_plugin-0.erf +++ b/scripts/exp/http_plugin-0.erf diff --git a/scripts/exp/http_plugin_v6-0-ex.erf b/scripts/exp/http_plugin_v6-0-ex.erf Binary files differindex a0b43754..2b5e7163 100755 --- a/scripts/exp/http_plugin_v6-0-ex.erf +++ b/scripts/exp/http_plugin_v6-0-ex.erf diff --git a/scripts/exp/http_plugin_v6-0.erf b/scripts/exp/http_plugin_v6-0.erf Binary files differindex 96e79eae..2b5e7163 100644 --- a/scripts/exp/http_plugin_v6-0.erf +++ b/scripts/exp/http_plugin_v6-0.erf diff --git a/scripts/exp/ignore-0-ex.erf b/scripts/exp/ignore-0-ex.erf Binary files differindex 92883717..f51431cb 100644 --- a/scripts/exp/ignore-0-ex.erf +++ b/scripts/exp/ignore-0-ex.erf diff --git a/scripts/exp/ignore-0.erf b/scripts/exp/ignore-0.erf Binary files differindex 92883717..f51431cb 100644 --- a/scripts/exp/ignore-0.erf +++ b/scripts/exp/ignore-0.erf diff --git a/scripts/exp/imix-0-ex.erf b/scripts/exp/imix-0-ex.erf Binary files differindex 07fb2ace..4e9a685c 100755 --- a/scripts/exp/imix-0-ex.erf +++ b/scripts/exp/imix-0-ex.erf diff --git a/scripts/exp/imix-0.erf b/scripts/exp/imix-0.erf Binary files differindex 07fb2ace..4e9a685c 100644 --- a/scripts/exp/imix-0.erf +++ b/scripts/exp/imix-0.erf diff --git a/scripts/exp/imix.pcap b/scripts/exp/imix.pcap Binary files differindex 13ac06e2..aec8dac8 100644 --- a/scripts/exp/imix.pcap +++ b/scripts/exp/imix.pcap diff --git a/scripts/exp/imix_1pkt.pcap b/scripts/exp/imix_1pkt.pcap Binary files differindex bbf15472..b9eb15e5 100644 --- a/scripts/exp/imix_1pkt.pcap +++ b/scripts/exp/imix_1pkt.pcap diff --git a/scripts/exp/imix_1pkt_2.pcap b/scripts/exp/imix_1pkt_2.pcap Binary files differindex 38aa3ce3..cebf6ff5 100644 --- a/scripts/exp/imix_1pkt_2.pcap +++ b/scripts/exp/imix_1pkt_2.pcap diff --git a/scripts/exp/imix_1pkt_tuple_gen.pcap b/scripts/exp/imix_1pkt_tuple_gen.pcap Binary files differindex 77096de2..3ad50671 100644 --- a/scripts/exp/imix_1pkt_tuple_gen.pcap +++ b/scripts/exp/imix_1pkt_tuple_gen.pcap diff --git a/scripts/exp/imix_1pkt_vm.pcap b/scripts/exp/imix_1pkt_vm.pcap Binary files differindex ec57dfb9..73fdd22a 100644 --- a/scripts/exp/imix_1pkt_vm.pcap +++ b/scripts/exp/imix_1pkt_vm.pcap diff --git a/scripts/exp/imix_3pkt.pcap b/scripts/exp/imix_3pkt.pcap Binary files differnew file mode 100644 index 00000000..29e84d63 --- /dev/null +++ b/scripts/exp/imix_3pkt.pcap diff --git a/scripts/exp/imix_3pkt_vm.pcap b/scripts/exp/imix_3pkt_vm.pcap Binary files differnew file mode 100644 index 00000000..5af466d9 --- /dev/null +++ b/scripts/exp/imix_3pkt_vm.pcap diff --git a/scripts/exp/imix_v6-0-ex.erf b/scripts/exp/imix_v6-0-ex.erf Binary files differindex c5f247d1..1b6b6bb7 100755 --- a/scripts/exp/imix_v6-0-ex.erf +++ b/scripts/exp/imix_v6-0-ex.erf diff --git a/scripts/exp/imix_v6-0.erf b/scripts/exp/imix_v6-0.erf Binary files differindex c5f247d1..1b6b6bb7 100644 --- a/scripts/exp/imix_v6-0.erf +++ b/scripts/exp/imix_v6-0.erf diff --git a/scripts/exp/ipv4_vlan-0-ex.erf b/scripts/exp/ipv4_vlan-0-ex.erf Binary files differindex abbdb652..1ec8a1fa 100755 --- a/scripts/exp/ipv4_vlan-0-ex.erf +++ b/scripts/exp/ipv4_vlan-0-ex.erf diff --git a/scripts/exp/ipv4_vlan-0.erf b/scripts/exp/ipv4_vlan-0.erf Binary files differindex 3a9ec6d1..1ec8a1fa 100644 --- a/scripts/exp/ipv4_vlan-0.erf +++ b/scripts/exp/ipv4_vlan-0.erf diff --git a/scripts/exp/ipv6-0-ex.erf b/scripts/exp/ipv6-0-ex.erf Binary files differindex 85d30377..21e0eabb 100755 --- a/scripts/exp/ipv6-0-ex.erf +++ b/scripts/exp/ipv6-0-ex.erf diff --git a/scripts/exp/ipv6-0.erf b/scripts/exp/ipv6-0.erf Binary files differindex 50f89ece..21e0eabb 100644 --- a/scripts/exp/ipv6-0.erf +++ b/scripts/exp/ipv6-0.erf diff --git a/scripts/exp/ipv6_vlan-0-ex.erf b/scripts/exp/ipv6_vlan-0-ex.erf Binary files differindex ac7cc39b..b97d760b 100755 --- a/scripts/exp/ipv6_vlan-0-ex.erf +++ b/scripts/exp/ipv6_vlan-0-ex.erf diff --git a/scripts/exp/ipv6_vlan-0.erf b/scripts/exp/ipv6_vlan-0.erf Binary files differindex 771f5c03..b97d760b 100644 --- a/scripts/exp/ipv6_vlan-0.erf +++ b/scripts/exp/ipv6_vlan-0.erf diff --git a/scripts/exp/limit_multi_pkt-0-ex.erf b/scripts/exp/limit_multi_pkt-0-ex.erf Binary files differindex 23d536fc..5bf3a5b3 100755 --- a/scripts/exp/limit_multi_pkt-0-ex.erf +++ b/scripts/exp/limit_multi_pkt-0-ex.erf diff --git a/scripts/exp/limit_multi_pkt-0.erf b/scripts/exp/limit_multi_pkt-0.erf Binary files differindex a2ff8815..5bf3a5b3 100644 --- a/scripts/exp/limit_multi_pkt-0.erf +++ b/scripts/exp/limit_multi_pkt-0.erf diff --git a/scripts/exp/limit_single_pkt-0-ex.erf b/scripts/exp/limit_single_pkt-0-ex.erf Binary files differindex adc6fd46..5438feee 100755 --- a/scripts/exp/limit_single_pkt-0-ex.erf +++ b/scripts/exp/limit_single_pkt-0-ex.erf diff --git a/scripts/exp/limit_single_pkt-0.erf b/scripts/exp/limit_single_pkt-0.erf Binary files differindex adc6fd46..5438feee 100644 --- a/scripts/exp/limit_single_pkt-0.erf +++ b/scripts/exp/limit_single_pkt-0.erf diff --git a/scripts/exp/multi_burst_2st_1000pkt.pcap b/scripts/exp/multi_burst_2st_1000pkt.pcap Binary files differindex 2da71e0f..ba4546b6 100644 --- a/scripts/exp/multi_burst_2st_1000pkt.pcap +++ b/scripts/exp/multi_burst_2st_1000pkt.pcap diff --git a/scripts/exp/pcap_mode1-0-ex.erf b/scripts/exp/pcap_mode1-0-ex.erf Binary files differindex 245b5ffb..e8d0f202 100755 --- a/scripts/exp/pcap_mode1-0-ex.erf +++ b/scripts/exp/pcap_mode1-0-ex.erf diff --git a/scripts/exp/pcap_mode1-0.erf b/scripts/exp/pcap_mode1-0.erf Binary files differindex ad5469f8..e8d0f202 100644 --- a/scripts/exp/pcap_mode1-0.erf +++ b/scripts/exp/pcap_mode1-0.erf diff --git a/scripts/exp/pcap_mode2-0-ex.erf b/scripts/exp/pcap_mode2-0-ex.erf Binary files differindex e19274f7..d8432f86 100755 --- a/scripts/exp/pcap_mode2-0-ex.erf +++ b/scripts/exp/pcap_mode2-0-ex.erf diff --git a/scripts/exp/pcap_mode2-0.erf b/scripts/exp/pcap_mode2-0.erf Binary files differindex 348d1a4c..d8432f86 100644 --- a/scripts/exp/pcap_mode2-0.erf +++ b/scripts/exp/pcap_mode2-0.erf diff --git a/scripts/exp/rtsp_short1-0-ex.erf b/scripts/exp/rtsp_short1-0-ex.erf Binary files differindex 7a7522b2..2f65a39d 100755 --- a/scripts/exp/rtsp_short1-0-ex.erf +++ b/scripts/exp/rtsp_short1-0-ex.erf diff --git a/scripts/exp/rtsp_short1-0.erf b/scripts/exp/rtsp_short1-0.erf Binary files differindex 09e180c6..2f65a39d 100644 --- a/scripts/exp/rtsp_short1-0.erf +++ b/scripts/exp/rtsp_short1-0.erf diff --git a/scripts/exp/rtsp_short1_v6-0-ex.erf b/scripts/exp/rtsp_short1_v6-0-ex.erf Binary files differindex 1b6d6391..cc2e1fc6 100755 --- a/scripts/exp/rtsp_short1_v6-0-ex.erf +++ b/scripts/exp/rtsp_short1_v6-0-ex.erf diff --git a/scripts/exp/rtsp_short1_v6-0.erf b/scripts/exp/rtsp_short1_v6-0.erf Binary files differindex 57373ba5..cc2e1fc6 100644 --- a/scripts/exp/rtsp_short1_v6-0.erf +++ b/scripts/exp/rtsp_short1_v6-0.erf diff --git a/scripts/exp/rtsp_short2-0-ex.erf b/scripts/exp/rtsp_short2-0-ex.erf Binary files differindex 7a7522b2..2f65a39d 100755 --- a/scripts/exp/rtsp_short2-0-ex.erf +++ b/scripts/exp/rtsp_short2-0-ex.erf diff --git a/scripts/exp/rtsp_short2-0.erf b/scripts/exp/rtsp_short2-0.erf Binary files differindex 09e180c6..2f65a39d 100644 --- a/scripts/exp/rtsp_short2-0.erf +++ b/scripts/exp/rtsp_short2-0.erf diff --git a/scripts/exp/rtsp_short2_v6-0-ex.erf b/scripts/exp/rtsp_short2_v6-0-ex.erf Binary files differindex 1b6d6391..cc2e1fc6 100755 --- a/scripts/exp/rtsp_short2_v6-0-ex.erf +++ b/scripts/exp/rtsp_short2_v6-0-ex.erf diff --git a/scripts/exp/rtsp_short2_v6-0.erf b/scripts/exp/rtsp_short2_v6-0.erf Binary files differindex 57373ba5..cc2e1fc6 100644 --- a/scripts/exp/rtsp_short2_v6-0.erf +++ b/scripts/exp/rtsp_short2_v6-0.erf diff --git a/scripts/exp/rtsp_short3-0-ex.erf b/scripts/exp/rtsp_short3-0-ex.erf Binary files differindex bae34983..be1027d5 100755 --- a/scripts/exp/rtsp_short3-0-ex.erf +++ b/scripts/exp/rtsp_short3-0-ex.erf diff --git a/scripts/exp/rtsp_short3-0.erf b/scripts/exp/rtsp_short3-0.erf Binary files differindex 93ad0fa4..be1027d5 100644 --- a/scripts/exp/rtsp_short3-0.erf +++ b/scripts/exp/rtsp_short3-0.erf diff --git a/scripts/exp/rtsp_short3_v6-0-ex.erf b/scripts/exp/rtsp_short3_v6-0-ex.erf Binary files differindex e68dc787..08ae1be7 100755 --- a/scripts/exp/rtsp_short3_v6-0-ex.erf +++ b/scripts/exp/rtsp_short3_v6-0-ex.erf diff --git a/scripts/exp/rtsp_short3_v6-0.erf b/scripts/exp/rtsp_short3_v6-0.erf Binary files differindex 281bd36f..08ae1be7 100644 --- a/scripts/exp/rtsp_short3_v6-0.erf +++ b/scripts/exp/rtsp_short3_v6-0.erf diff --git a/scripts/exp/sfr2-0-ex.erf b/scripts/exp/sfr2-0-ex.erf Binary files differindex e5dfc4c3..b0b93a26 100755 --- a/scripts/exp/sfr2-0-ex.erf +++ b/scripts/exp/sfr2-0-ex.erf diff --git a/scripts/exp/sfr2-0.erf b/scripts/exp/sfr2-0.erf Binary files differindex e5dfc4c3..b0b93a26 100644 --- a/scripts/exp/sfr2-0.erf +++ b/scripts/exp/sfr2-0.erf diff --git a/scripts/exp/sfr3-0-ex.erf b/scripts/exp/sfr3-0-ex.erf Binary files differindex fa9b1008..ec8e3f90 100755 --- a/scripts/exp/sfr3-0-ex.erf +++ b/scripts/exp/sfr3-0-ex.erf diff --git a/scripts/exp/sfr3-0.erf b/scripts/exp/sfr3-0.erf Binary files differindex bd14de4f..ec8e3f90 100644 --- a/scripts/exp/sfr3-0.erf +++ b/scripts/exp/sfr3-0.erf diff --git a/scripts/exp/sfr_4-0-ex.erf b/scripts/exp/sfr_4-0-ex.erf Binary files differindex a0cddc92..89ca013b 100755 --- a/scripts/exp/sfr_4-0-ex.erf +++ b/scripts/exp/sfr_4-0-ex.erf diff --git a/scripts/exp/sfr_4-0.erf b/scripts/exp/sfr_4-0.erf Binary files differindex 8cbf4275..89ca013b 100644 --- a/scripts/exp/sfr_4-0.erf +++ b/scripts/exp/sfr_4-0.erf diff --git a/scripts/exp/sip_short1-0-ex.erf b/scripts/exp/sip_short1-0-ex.erf Binary files differindex 762fc157..e642442c 100755 --- a/scripts/exp/sip_short1-0-ex.erf +++ b/scripts/exp/sip_short1-0-ex.erf diff --git a/scripts/exp/sip_short1-0.erf b/scripts/exp/sip_short1-0.erf Binary files differindex c78c215e..e642442c 100644 --- a/scripts/exp/sip_short1-0.erf +++ b/scripts/exp/sip_short1-0.erf diff --git a/scripts/exp/sip_short1_v6-0-ex.erf b/scripts/exp/sip_short1_v6-0-ex.erf Binary files differindex cb027045..000d3934 100755 --- a/scripts/exp/sip_short1_v6-0-ex.erf +++ b/scripts/exp/sip_short1_v6-0-ex.erf diff --git a/scripts/exp/sip_short1_v6-0.erf b/scripts/exp/sip_short1_v6-0.erf Binary files differindex a77b5c60..000d3934 100644 --- a/scripts/exp/sip_short1_v6-0.erf +++ b/scripts/exp/sip_short1_v6-0.erf diff --git a/scripts/exp/sip_short2-0-ex.erf b/scripts/exp/sip_short2-0-ex.erf Binary files differindex 762fc157..e642442c 100755 --- a/scripts/exp/sip_short2-0-ex.erf +++ b/scripts/exp/sip_short2-0-ex.erf diff --git a/scripts/exp/sip_short2-0.erf b/scripts/exp/sip_short2-0.erf Binary files differindex c78c215e..e642442c 100644 --- a/scripts/exp/sip_short2-0.erf +++ b/scripts/exp/sip_short2-0.erf diff --git a/scripts/exp/sip_short2_v6-0-ex.erf b/scripts/exp/sip_short2_v6-0-ex.erf Binary files differindex cb027045..000d3934 100755 --- a/scripts/exp/sip_short2_v6-0-ex.erf +++ b/scripts/exp/sip_short2_v6-0-ex.erf diff --git a/scripts/exp/sip_short2_v6-0.erf b/scripts/exp/sip_short2_v6-0.erf Binary files differindex a77b5c60..000d3934 100644 --- a/scripts/exp/sip_short2_v6-0.erf +++ b/scripts/exp/sip_short2_v6-0.erf diff --git a/scripts/exp/sip_short3-0-ex.erf b/scripts/exp/sip_short3-0-ex.erf Binary files differindex f6b0d5bb..1eb3881b 100755 --- a/scripts/exp/sip_short3-0-ex.erf +++ b/scripts/exp/sip_short3-0-ex.erf diff --git a/scripts/exp/sip_short3-0.erf b/scripts/exp/sip_short3-0.erf Binary files differindex 26f38414..1eb3881b 100644 --- a/scripts/exp/sip_short3-0.erf +++ b/scripts/exp/sip_short3-0.erf diff --git a/scripts/exp/sip_short3_v6-0-ex.erf b/scripts/exp/sip_short3_v6-0-ex.erf Binary files differindex 431fab0b..aa9d6562 100755 --- a/scripts/exp/sip_short3_v6-0-ex.erf +++ b/scripts/exp/sip_short3_v6-0-ex.erf diff --git a/scripts/exp/sip_short3_v6-0.erf b/scripts/exp/sip_short3_v6-0.erf Binary files differindex 1f347a29..aa9d6562 100644 --- a/scripts/exp/sip_short3_v6-0.erf +++ b/scripts/exp/sip_short3_v6-0.erf diff --git a/scripts/exp/stl_basic_pause_resume0-0-ex.erf b/scripts/exp/stl_basic_pause_resume0-0-ex.erf Binary files differindex 7f833920..0c92f266 100644 --- a/scripts/exp/stl_basic_pause_resume0-0-ex.erf +++ b/scripts/exp/stl_basic_pause_resume0-0-ex.erf diff --git a/scripts/exp/stl_bb_start_stop2-0-ex.erf b/scripts/exp/stl_bb_start_stop2-0-ex.erf Binary files differindex 0eff9601..a83c0ae6 100644 --- a/scripts/exp/stl_bb_start_stop2-0-ex.erf +++ b/scripts/exp/stl_bb_start_stop2-0-ex.erf diff --git a/scripts/exp/stl_bb_start_stop_delay1-0-ex.erf b/scripts/exp/stl_bb_start_stop_delay1-0-ex.erf Binary files differindex 08afdf4b..558c1afa 100644 --- a/scripts/exp/stl_bb_start_stop_delay1-0-ex.erf +++ b/scripts/exp/stl_bb_start_stop_delay1-0-ex.erf diff --git a/scripts/exp/stl_bb_start_stop_delay2-0-ex.erf b/scripts/exp/stl_bb_start_stop_delay2-0-ex.erf Binary files differindex 01a77466..e435dff8 100644 --- a/scripts/exp/stl_bb_start_stop_delay2-0-ex.erf +++ b/scripts/exp/stl_bb_start_stop_delay2-0-ex.erf diff --git a/scripts/exp/stl_multi_burst1-0-ex.erf b/scripts/exp/stl_multi_burst1-0-ex.erf Binary files differindex c5cc7484..34161171 100644 --- a/scripts/exp/stl_multi_burst1-0-ex.erf +++ b/scripts/exp/stl_multi_burst1-0-ex.erf diff --git a/scripts/exp/stl_multi_pkt1-0-ex.erf b/scripts/exp/stl_multi_pkt1-0-ex.erf Binary files differindex de109191..8d6532ab 100644 --- a/scripts/exp/stl_multi_pkt1-0-ex.erf +++ b/scripts/exp/stl_multi_pkt1-0-ex.erf diff --git a/scripts/exp/stl_multi_pkt2-0-ex.erf b/scripts/exp/stl_multi_pkt2-0-ex.erf Binary files differindex eec33117..a1625ee6 100644 --- a/scripts/exp/stl_multi_pkt2-0-ex.erf +++ b/scripts/exp/stl_multi_pkt2-0-ex.erf diff --git a/scripts/exp/stl_simple_prog1-0-ex.erf b/scripts/exp/stl_simple_prog1-0-ex.erf Binary files differindex 374256c2..5d374235 100644 --- a/scripts/exp/stl_simple_prog1-0-ex.erf +++ b/scripts/exp/stl_simple_prog1-0-ex.erf diff --git a/scripts/exp/stl_simple_prog2-0-ex.erf b/scripts/exp/stl_simple_prog2-0-ex.erf Binary files differindex 3ec46e2f..3c3fe910 100644 --- a/scripts/exp/stl_simple_prog2-0-ex.erf +++ b/scripts/exp/stl_simple_prog2-0-ex.erf diff --git a/scripts/exp/stl_simple_prog3-0-ex.erf b/scripts/exp/stl_simple_prog3-0-ex.erf Binary files differindex 4da3438c..239f0b30 100644 --- a/scripts/exp/stl_simple_prog3-0-ex.erf +++ b/scripts/exp/stl_simple_prog3-0-ex.erf diff --git a/scripts/exp/stl_simple_prog4-0-ex.erf b/scripts/exp/stl_simple_prog4-0-ex.erf Binary files differindex 62da4682..b5b19f88 100644 --- a/scripts/exp/stl_simple_prog4-0-ex.erf +++ b/scripts/exp/stl_simple_prog4-0-ex.erf diff --git a/scripts/exp/stl_single_pkt_burst1-0-ex.erf b/scripts/exp/stl_single_pkt_burst1-0-ex.erf Binary files differindex 08afdf4b..558c1afa 100644 --- a/scripts/exp/stl_single_pkt_burst1-0-ex.erf +++ b/scripts/exp/stl_single_pkt_burst1-0-ex.erf diff --git a/scripts/exp/stl_single_stream-0-ex.erf b/scripts/exp/stl_single_stream-0-ex.erf Binary files differindex 92883717..f51431cb 100644 --- a/scripts/exp/stl_single_stream-0-ex.erf +++ b/scripts/exp/stl_single_stream-0-ex.erf diff --git a/scripts/exp/stl_single_stream_mac0-0-ex.erf b/scripts/exp/stl_single_stream_mac0-0-ex.erf Binary files differnew file mode 100644 index 00000000..f51431cb --- /dev/null +++ b/scripts/exp/stl_single_stream_mac0-0-ex.erf diff --git a/scripts/exp/stl_single_stream_mac01-0-ex.erf b/scripts/exp/stl_single_stream_mac01-0-ex.erf Binary files differnew file mode 100644 index 00000000..eb15f454 --- /dev/null +++ b/scripts/exp/stl_single_stream_mac01-0-ex.erf diff --git a/scripts/exp/stl_single_stream_mac10-0-ex.erf b/scripts/exp/stl_single_stream_mac10-0-ex.erf Binary files differnew file mode 100644 index 00000000..5d6046be --- /dev/null +++ b/scripts/exp/stl_single_stream_mac10-0-ex.erf diff --git a/scripts/exp/stl_single_stream_mac11-0-ex.erf b/scripts/exp/stl_single_stream_mac11-0-ex.erf Binary files differnew file mode 100644 index 00000000..89f1f282 --- /dev/null +++ b/scripts/exp/stl_single_stream_mac11-0-ex.erf diff --git a/scripts/exp/stl_vm_enable0-0-ex.erf b/scripts/exp/stl_vm_enable0-0-ex.erf Binary files differindex c6285be1..1a0ba1f6 100644 --- a/scripts/exp/stl_vm_enable0-0-ex.erf +++ b/scripts/exp/stl_vm_enable0-0-ex.erf diff --git a/scripts/exp/stl_vm_enable1-0-ex.erf b/scripts/exp/stl_vm_enable1-0-ex.erf Binary files differindex 3ccf49ac..7610d3e8 100644 --- a/scripts/exp/stl_vm_enable1-0-ex.erf +++ b/scripts/exp/stl_vm_enable1-0-ex.erf diff --git a/scripts/exp/stl_vm_enable2-0-ex.erf b/scripts/exp/stl_vm_enable2-0-ex.erf Binary files differindex d099c14c..f4f55e91 100644 --- a/scripts/exp/stl_vm_enable2-0-ex.erf +++ b/scripts/exp/stl_vm_enable2-0-ex.erf diff --git a/scripts/exp/stl_vm_split_client_var.erf-0-ex.erf b/scripts/exp/stl_vm_split_client_var.erf-0-ex.erf Binary files differindex 12e68c09..25b2a2bd 100644 --- a/scripts/exp/stl_vm_split_client_var.erf-0-ex.erf +++ b/scripts/exp/stl_vm_split_client_var.erf-0-ex.erf diff --git a/scripts/exp/stl_vm_split_client_var.erf-0.erf b/scripts/exp/stl_vm_split_client_var.erf-0.erf Binary files differindex a9f330fe..25b2a2bd 100644 --- a/scripts/exp/stl_vm_split_client_var.erf-0.erf +++ b/scripts/exp/stl_vm_split_client_var.erf-0.erf diff --git a/scripts/exp/stl_vm_split_flow_var_big_range.erf-0-ex.erf b/scripts/exp/stl_vm_split_flow_var_big_range.erf-0-ex.erf Binary files differindex 8f4fe297..d5ad29d8 100644 --- a/scripts/exp/stl_vm_split_flow_var_big_range.erf-0-ex.erf +++ b/scripts/exp/stl_vm_split_flow_var_big_range.erf-0-ex.erf diff --git a/scripts/exp/stl_vm_split_flow_var_big_range.erf-0.erf b/scripts/exp/stl_vm_split_flow_var_big_range.erf-0.erf Binary files differindex 8e62aca6..d5ad29d8 100644 --- a/scripts/exp/stl_vm_split_flow_var_big_range.erf-0.erf +++ b/scripts/exp/stl_vm_split_flow_var_big_range.erf-0.erf diff --git a/scripts/exp/stl_vm_split_flow_var_inc.erf-0-ex.erf b/scripts/exp/stl_vm_split_flow_var_inc.erf-0-ex.erf Binary files differindex 82025972..a938b37c 100644 --- a/scripts/exp/stl_vm_split_flow_var_inc.erf-0-ex.erf +++ b/scripts/exp/stl_vm_split_flow_var_inc.erf-0-ex.erf diff --git a/scripts/exp/stl_vm_split_flow_var_inc.erf-0.erf b/scripts/exp/stl_vm_split_flow_var_inc.erf-0.erf Binary files differindex acd31a64..a938b37c 100644 --- a/scripts/exp/stl_vm_split_flow_var_inc.erf-0.erf +++ b/scripts/exp/stl_vm_split_flow_var_inc.erf-0.erf diff --git a/scripts/exp/stl_vm_split_flow_var_small_range.erf-0-ex.erf b/scripts/exp/stl_vm_split_flow_var_small_range.erf-0-ex.erf Binary files differindex 5dac9893..94e493fe 100644 --- a/scripts/exp/stl_vm_split_flow_var_small_range.erf-0-ex.erf +++ b/scripts/exp/stl_vm_split_flow_var_small_range.erf-0-ex.erf diff --git a/scripts/exp/stl_vm_split_flow_var_small_range.erf-0.erf b/scripts/exp/stl_vm_split_flow_var_small_range.erf-0.erf Binary files differindex 4cf58e67..94e493fe 100644 --- a/scripts/exp/stl_vm_split_flow_var_small_range.erf-0.erf +++ b/scripts/exp/stl_vm_split_flow_var_small_range.erf-0.erf diff --git a/scripts/exp/syn_attack.pcap b/scripts/exp/syn_attack.pcap Binary files differnew file mode 100644 index 00000000..d1aa5f6f --- /dev/null +++ b/scripts/exp/syn_attack.pcap diff --git a/scripts/exp/udp_1pkt.pcap b/scripts/exp/udp_1pkt.pcap Binary files differindex e75bdd87..6479009d 100644 --- a/scripts/exp/udp_1pkt.pcap +++ b/scripts/exp/udp_1pkt.pcap diff --git a/scripts/exp/udp_1pkt_1mac.pcap b/scripts/exp/udp_1pkt_1mac.pcap Binary files differindex 4141830e..7cee57eb 100644 --- a/scripts/exp/udp_1pkt_1mac.pcap +++ b/scripts/exp/udp_1pkt_1mac.pcap diff --git a/scripts/exp/udp_1pkt_1mac_override.pcap b/scripts/exp/udp_1pkt_1mac_override.pcap Binary files differindex 350f3e2a..4ee63b0c 100644 --- a/scripts/exp/udp_1pkt_1mac_override.pcap +++ b/scripts/exp/udp_1pkt_1mac_override.pcap diff --git a/scripts/exp/udp_1pkt_ipv6_in_ipv4.pcap b/scripts/exp/udp_1pkt_ipv6_in_ipv4.pcap Binary files differindex a46888e9..2433d1ca 100644 --- a/scripts/exp/udp_1pkt_ipv6_in_ipv4.pcap +++ b/scripts/exp/udp_1pkt_ipv6_in_ipv4.pcap diff --git a/scripts/exp/udp_1pkt_mac.pcap b/scripts/exp/udp_1pkt_mac.pcap Binary files differindex 840cee52..2f4695db 100644 --- a/scripts/exp/udp_1pkt_mac.pcap +++ b/scripts/exp/udp_1pkt_mac.pcap diff --git a/scripts/exp/udp_1pkt_mpls.pcap b/scripts/exp/udp_1pkt_mpls.pcap Binary files differindex 4b6e0682..bcf93ec5 100644 --- a/scripts/exp/udp_1pkt_mpls.pcap +++ b/scripts/exp/udp_1pkt_mpls.pcap diff --git a/scripts/exp/udp_1pkt_mpls_vm.pcap b/scripts/exp/udp_1pkt_mpls_vm.pcap Binary files differindex cfa69421..f205b334 100644 --- a/scripts/exp/udp_1pkt_mpls_vm.pcap +++ b/scripts/exp/udp_1pkt_mpls_vm.pcap diff --git a/scripts/exp/udp_1pkt_pcap.pcap b/scripts/exp/udp_1pkt_pcap.pcap Binary files differindex f150434b..28900217 100644 --- a/scripts/exp/udp_1pkt_pcap.pcap +++ b/scripts/exp/udp_1pkt_pcap.pcap diff --git a/scripts/exp/udp_1pkt_pcap_relative_path.pcap b/scripts/exp/udp_1pkt_pcap_relative_path.pcap Binary files differindex 56ae1bac..2d8b777c 100644 --- a/scripts/exp/udp_1pkt_pcap_relative_path.pcap +++ b/scripts/exp/udp_1pkt_pcap_relative_path.pcap diff --git a/scripts/exp/udp_1pkt_range_clients.pcap b/scripts/exp/udp_1pkt_range_clients.pcap Binary files differindex d0e6d923..203de6eb 100644 --- a/scripts/exp/udp_1pkt_range_clients.pcap +++ b/scripts/exp/udp_1pkt_range_clients.pcap diff --git a/scripts/exp/udp_1pkt_range_clients_split.pcap b/scripts/exp/udp_1pkt_range_clients_split.pcap Binary files differindex b4b7b7c0..fc5572a8 100644 --- a/scripts/exp/udp_1pkt_range_clients_split.pcap +++ b/scripts/exp/udp_1pkt_range_clients_split.pcap diff --git a/scripts/exp/udp_1pkt_tuple_gen.pcap b/scripts/exp/udp_1pkt_tuple_gen.pcap Binary files differindex e993ddcf..b279cfad 100644 --- a/scripts/exp/udp_1pkt_tuple_gen.pcap +++ b/scripts/exp/udp_1pkt_tuple_gen.pcap diff --git a/scripts/exp/udp_1pkt_tuple_gen_split.pcap b/scripts/exp/udp_1pkt_tuple_gen_split.pcap Binary files differindex bbaa456a..08377c6d 100644 --- a/scripts/exp/udp_1pkt_tuple_gen_split.pcap +++ b/scripts/exp/udp_1pkt_tuple_gen_split.pcap diff --git a/scripts/exp/udp_1pkt_vxlan.pcap b/scripts/exp/udp_1pkt_vxlan.pcap Binary files differindex 601185a0..6fe39e11 100644 --- a/scripts/exp/udp_1pkt_vxlan.pcap +++ b/scripts/exp/udp_1pkt_vxlan.pcap diff --git a/scripts/exp/udp_3pkt_pcap.pcap b/scripts/exp/udp_3pkt_pcap.pcap Binary files differindex f9ee2dc4..9e332a23 100644 --- a/scripts/exp/udp_3pkt_pcap.pcap +++ b/scripts/exp/udp_3pkt_pcap.pcap diff --git a/scripts/exp/udp_inc_len_9k.pcap b/scripts/exp/udp_inc_len_9k.pcap Binary files differindex bf367953..ca64cb1f 100644 --- a/scripts/exp/udp_inc_len_9k.pcap +++ b/scripts/exp/udp_inc_len_9k.pcap diff --git a/scripts/exp/udp_rand_len_9k.pcap b/scripts/exp/udp_rand_len_9k.pcap Binary files differindex ecddbe3a..5e3a06d2 100644 --- a/scripts/exp/udp_rand_len_9k.pcap +++ b/scripts/exp/udp_rand_len_9k.pcap diff --git a/src/bp_gtest.cpp b/src/bp_gtest.cpp index 8d6a7b83..e312abc7 100755 --- a/src/bp_gtest.cpp +++ b/src/bp_gtest.cpp @@ -200,6 +200,7 @@ public: lpt->m_node_gen.DumpHist(stdout); cmp.d_sec = m_time_diff; + //compare if ( cmp.compare(std::string(buf),std::string(buf_ex)) != true ) { res=false; } @@ -686,14 +687,14 @@ bool verify_latency_pkt(uint8_t *p, uint8_t proto, uint16_t icmp_seq, uint8_t icmp_type) { EthernetHeader *eth = (EthernetHeader *)p; IPHeader *ip = (IPHeader *)(p + 14); - uint8_t srcmac[]={0,0,0,1,0,0}; - uint8_t dstmac[]={0,0,0,1,0,0}; + uint8_t srcmac[]={0x10,0x10,0x10,0x10,0x10,0x10}; + //uint8_t dstmac[]={0x0,0x0,0x0,0x0,0x0,0x0}; latency_header * h; // eth EXPECT_EQ_UINT32(eth->getNextProtocol(), 0x0800)<< "Failed ethernet next protocol check"; EXPECT_EQ_UINT32(memcmp(p, srcmac, 6), 0)<< "Failed ethernet source MAC check"; - EXPECT_EQ_UINT32(memcmp(p, dstmac, 6), 0)<< "Failed ethernet dest MAC check"; + //EXPECT_EQ_UINT32(memcmp(p, dstmac, 6), 0)<< "Failed ethernet dest MAC check"; // IP EXPECT_EQ_UINT32(ip->getSourceIp(), l_pkt_test_s_ip)<< "Failed IP src check"; EXPECT_EQ_UINT32(ip->getDestIp(), l_pkt_test_d_ip)<< "Failed IP dst check"; diff --git a/src/bp_sim.cpp b/src/bp_sim.cpp index 72ad1097..a1851b55 100755 --- a/src/bp_sim.cpp +++ b/src/bp_sim.cpp @@ -4726,6 +4726,17 @@ void CErfIF::fill_raw_packet(rte_mbuf_t * m,CGenNode * node,pkt_dir_t dir){ } +pkt_dir_t CErfIFStl::port_id_to_dir(uint8_t port_id) { + return ((pkt_dir_t)(port_id&1)); +} + + +int CErfIFStl::update_mac_addr_from_global_cfg(pkt_dir_t dir, uint8_t * p){ + memcpy(p,CGlobalInfo::m_options.get_dst_src_mac_addr(dir),12); + return (0); +} + + int CErfIFStl::send_node(CGenNode * _no_to_use){ if ( m_preview_mode->getFileWrite() ){ @@ -4757,6 +4768,7 @@ int CErfIFStl::send_node(CGenNode * _no_to_use){ } + int CErfIF::send_node(CGenNode * node){ if ( m_preview_mode->getFileWrite() ){ diff --git a/src/bp_sim.h b/src/bp_sim.h index 9f08cdc9..a51a520d 100755 --- a/src/bp_sim.h +++ b/src/bp_sim.h @@ -1846,6 +1846,12 @@ class CErfIFStl : public CErfIF { public: virtual int send_node(CGenNode * node); + + virtual int update_mac_addr_from_global_cfg(pkt_dir_t dir, uint8_t * p); + + virtual pkt_dir_t port_id_to_dir(uint8_t port_id); + + }; /** @@ -1872,9 +1878,6 @@ public: } - virtual int update_mac_addr_from_global_cfg(pkt_dir_t dir, uint8_t * p){ - return (0); - } virtual int flush_tx_queue(void){ diff --git a/src/common/captureFile.cpp b/src/common/captureFile.cpp index 00625181..e73c37ad 100755 --- a/src/common/captureFile.cpp +++ b/src/common/captureFile.cpp @@ -157,6 +157,33 @@ bool CCapPktRaw::Compare(CCapPktRaw * obj,int dump,double dsec){ } } +#define CPY_BUFSIZE 1024 + +bool CErfCmp::cpy(std::string src,std::string dst){ + + char mybuf[CPY_BUFSIZE] ; + FILE *ifd = NULL; + FILE *ofd = NULL; + ifd = fopen( src.c_str(), "rb" ); + ofd = fopen( dst.c_str(), "w+"); + assert(ifd!=NULL); + assert(ofd!=NULL); + + int n; + while ( true){ + n = fread(mybuf, sizeof(char), CPY_BUFSIZE ,ifd); + if (n>0) { + fwrite(mybuf, sizeof(char),n,ofd); + }else{ + break; + } + } + + fclose(ifd); + fclose(ofd); + return true; +} + bool CErfCmp::compare(std::string f1, std::string f2 ){ diff --git a/src/common/captureFile.h b/src/common/captureFile.h index 16a6120b..3be83432 100755 --- a/src/common/captureFile.h +++ b/src/common/captureFile.h @@ -279,6 +279,8 @@ public: d_sec=0.001; } bool compare(std::string f1, std::string f2 ); + + bool cpy(std::string src,std::string dst); public: bool dump; double d_sec; diff --git a/src/gtest/trex_stateless_gtest.cpp b/src/gtest/trex_stateless_gtest.cpp index fc6c8152..68f9a4b7 100644 --- a/src/gtest/trex_stateless_gtest.cpp +++ b/src/gtest/trex_stateless_gtest.cpp @@ -1437,6 +1437,7 @@ public: //lpt->m_node_gen.DumpHist(stdout); cmp.d_sec = m_time_diff; + if ( cmp.compare(std::string(buf),std::string(buf_ex)) != true ) { res=false; } @@ -2221,6 +2222,7 @@ TEST_F(basic_stl, single_pkt_burst1) { + TEST_F(basic_stl, single_pkt) { CBasicStl t1; @@ -2267,6 +2269,84 @@ TEST_F(basic_stl, single_pkt) { EXPECT_EQ_UINT32(1, res?1:0)<< "pass"; } +void test_mac_replace(bool replace_src_by_pkt, + int replace_dst_mode, + std::string file){ + CBasicStl t1; + CParserOption * po =&CGlobalInfo::m_options; + po->preview.setVMode(7); + po->preview.setFileWrite(true); + po->out_file = file; + + TrexStreamsCompiler compile; + + uint8_t port_id=0; + + std::vector<TrexStream *> streams; + + TrexStream * stream1 = new TrexStream(TrexStream::stCONTINUOUS,0,0); + stream1->set_override_src_mac_by_pkt_data(replace_src_by_pkt); + stream1->set_override_dst_mac_mode((TrexStream::stream_dst_mac_t)replace_dst_mode); + + stream1->set_pps(1.0); + + + stream1->m_enabled = true; + stream1->m_self_start = true; + stream1->m_port_id= port_id; + + + CPcapLoader pcap; + pcap.load_pcap_file("cap2/udp_64B.pcap",0); + pcap.update_ip_src(0x10000001); + pcap.clone_packet_into_stream(stream1); + + streams.push_back(stream1); + + // stream - clean + + std::vector<TrexStreamsCompiledObj *>objs; + assert(compile.compile(port_id, streams, objs)); + TrexStatelessDpStart *lpstart = new TrexStatelessDpStart(port_id, 0, objs[0], 10.0 /*sec */ ); + + + t1.m_msg = lpstart; + + bool res=t1.init(); + + delete stream1 ; + + EXPECT_EQ_UINT32(1, res?1:0)<< "pass"; +} + +TEST_F(basic_stl, single_pkt_mac0) { + + test_mac_replace(false, + TrexStream::stCFG_FILE, + "exp/stl_single_stream_mac0"); +} + +TEST_F(basic_stl, single_pkt_mac11) { + + test_mac_replace(true, + TrexStream::stPKT, + "exp/stl_single_stream_mac11"); +} + +TEST_F(basic_stl, single_pkt_mac10) { + + test_mac_replace(false, + TrexStream::stPKT, + "exp/stl_single_stream_mac01"); +} + +TEST_F(basic_stl, single_pkt_mac01) { + + test_mac_replace(true, + TrexStream::stCFG_FILE, + "exp/stl_single_stream_mac10"); +} + TEST_F(basic_stl, multi_pkt1) { diff --git a/src/main.cpp b/src/main.cpp index a2d06067..6ee3a03d 100755 --- a/src/main.cpp +++ b/src/main.cpp @@ -238,6 +238,15 @@ static int parse_options(int argc, return 0; } +void set_default_mac_addr(){ + + int i; + for (i=0; i<4; i++) { + memset(CGlobalInfo::m_options.get_dst_src_mac_addr(i),((i+1)<<4),6); + memset(CGlobalInfo::m_options.get_src_mac_addr(i),((i+1)<<4)+8,6); + } +} + int main(int argc , char * argv[]){ @@ -246,6 +255,7 @@ int main(int argc , char * argv[]){ if ( parse_options(argc, argv, &CGlobalInfo::m_options , params) != 0) { exit(-1); } + set_default_mac_addr(); opt_type_e type = (opt_type_e) params["type"]; diff --git a/src/stateless/cp/trex_stream.cpp b/src/stateless/cp/trex_stream.cpp index 256f7de8..af35dbe9 100644 --- a/src/stateless/cp/trex_stream.cpp +++ b/src/stateless/cp/trex_stream.cpp @@ -130,6 +130,8 @@ TrexStream::TrexStream(uint8_t type, m_num_bursts=1; m_ibg_usec=0.0; m_vm_dp = NULL; + m_flags=0; + m_stream_count=0; } TrexStream::~TrexStream() { diff --git a/src/stateless/cp/trex_stream.h b/src/stateless/cp/trex_stream.h index 72e7bb8b..0f2a16c3 100644 --- a/src/stateless/cp/trex_stream.h +++ b/src/stateless/cp/trex_stream.h @@ -33,6 +33,8 @@ limitations under the License. #include <stdio.h> #include <string.h> #include <common/captureFile.h> +#include <common/bitMan.h> + class TrexRpcCmdAddStream; @@ -118,6 +120,15 @@ public: typedef uint8_t stream_type_t ; + enum DST_MAC_TYPE { + stCFG_FILE = 0, + stPKT = 1, + stARP = 2 + }; + + typedef uint8_t stream_dst_mac_t ; + + static std::string get_stream_type_str(stream_type_t stream_type); public: @@ -163,8 +174,6 @@ public: return (true); } } - - /* can this stream be split ? */ bool is_splitable(uint8_t dp_core_count) const { @@ -218,6 +227,8 @@ public: dp->m_burst_total_pkts = m_burst_total_pkts; dp->m_num_bursts = m_num_bursts; dp->m_ibg_usec = m_ibg_usec; + dp->m_flags = m_flags; + dp->m_stream_count = m_stream_count; return(dp); } @@ -256,10 +267,30 @@ public: void vm_compile(); public: + + void set_override_src_mac_by_pkt_data(bool enable){ + btSetMaskBit16(m_flags,0,0,enable?1:0); + } + + bool get_override_src_mac_by_pkt_data(){ + return (btGetMaskBit16(m_flags,0,0) ?true:false); + } + + void set_override_dst_mac_mode(stream_dst_mac_t val){ + btSetMaskBit16(m_flags,2,1,val&0x3); + } + + stream_dst_mac_t get_override_dst_mac_mode(){ + return ((stream_dst_mac_t)btGetMaskBit16(m_flags,2,1)); + } + +public: /* basic */ uint8_t m_type; uint8_t m_port_id; + uint16_t m_flags; uint32_t m_stream_id; /* id from RPC can be anything */ + uint16_t m_stream_count; /* config fields */ diff --git a/src/stateless/dp/trex_stateless_dp_core.cpp b/src/stateless/dp/trex_stateless_dp_core.cpp index a80efc08..a84269ab 100644 --- a/src/stateless/dp/trex_stateless_dp_core.cpp +++ b/src/stateless/dp/trex_stateless_dp_core.cpp @@ -506,6 +506,43 @@ TrexStatelessDpCore::add_port_duration(double duration, } +void TrexStatelessDpCore::update_mac_addr(TrexStream * stream, + CGenNodeStateless *node, + pkt_dir_t dir, + char *raw_pkt){ + bool ov_src = stream->get_override_src_mac_by_pkt_data(); + TrexStream::stream_dst_mac_t ov_dst = stream->get_override_dst_mac_mode(); + + + if ( (ov_src == true) && (ov_dst == TrexStream::stPKT) ) { + /* nothing to do, take from the packet both */ + return; + } + + /* take from cfg_file */ + if ( (ov_src == false) && + (ov_dst == TrexStream::stCFG_FILE) ){ + + m_core->m_node_gen.m_v_if->update_mac_addr_from_global_cfg(dir,(uint8_t*)raw_pkt); + return; + } + + /* save the pkt*/ + char tmp_pkt[12]; + memcpy(tmp_pkt,raw_pkt,12); + + m_core->m_node_gen.m_v_if->update_mac_addr_from_global_cfg(dir,(uint8_t*)raw_pkt); + + if ((ov_src == true) && (ov_dst == TrexStream::stCFG_FILE)) { + memcpy(raw_pkt+6,tmp_pkt+6,6); + } + + if ((ov_src == false) && (ov_dst == TrexStream::stPKT)) { + memcpy(raw_pkt,tmp_pkt,6); + } +} + + void TrexStatelessDpCore::add_stream(TrexStatelessDpPerPort * lp_port, TrexStream * stream, @@ -561,7 +598,6 @@ TrexStatelessDpCore::add_stream(TrexStatelessDpPerPort * lp_port, node->m_single_burst=0; node->m_single_burst_refill=0; node->m_multi_bursts=0; - node->m_ibg_sec = 0.0; break; case TrexStream::stSINGLE_BURST : @@ -569,14 +605,12 @@ TrexStatelessDpCore::add_stream(TrexStatelessDpPerPort * lp_port, node->m_single_burst = stream->m_burst_total_pkts; node->m_single_burst_refill = stream->m_burst_total_pkts; node->m_multi_bursts = 1; /* single burst in multi burst of 1 */ - node->m_ibg_sec = 0.0; break; case TrexStream::stMULTI_BURST : node->m_single_burst = stream->m_burst_total_pkts; node->m_single_burst_refill = stream->m_burst_total_pkts; node->m_multi_bursts = stream->m_num_bursts; - node->m_ibg_sec = usec_to_sec( stream->m_ibg_usec ); break; default: @@ -605,8 +639,7 @@ TrexStatelessDpCore::add_stream(TrexStatelessDpPerPort * lp_port, /* copy the packet */ memcpy(p,stream_pkt,pkt_size); - /* TBD repace the mac if req we should add flag */ - m_core->m_node_gen.m_v_if->update_mac_addr_from_global_cfg(dir,(uint8_t*) p); + update_mac_addr(stream,node,dir,p); /* set the packet as a readonly */ node->set_cache_mbuf(m); @@ -659,8 +692,8 @@ TrexStatelessDpCore::add_stream(TrexStatelessDpPerPort * lp_port, assert(p); memcpy(p,stream_pkt , header_size); - /* TBD repace the mac if req we should add flag */ - m_core->m_node_gen.m_v_if->update_mac_addr_from_global_cfg(dir, p); + + update_mac_addr(stream,node,dir,(char *)p); } diff --git a/src/stateless/dp/trex_stateless_dp_core.h b/src/stateless/dp/trex_stateless_dp_core.h index c8a5eff5..3d214655 100644 --- a/src/stateless/dp/trex_stateless_dp_core.h +++ b/src/stateless/dp/trex_stateless_dp_core.h @@ -271,6 +271,11 @@ private: void add_global_duration(double duration); + void update_mac_addr(TrexStream * stream, + CGenNodeStateless *node, + uint8_t dir, + char *raw_pkt); + void add_stream(TrexStatelessDpPerPort * lp_port, TrexStream * stream, TrexStreamsCompiledObj *comp); diff --git a/src/stateless/dp/trex_stream_node.h b/src/stateless/dp/trex_stream_node.h index dfa4cc13..db7f19e8 100644 --- a/src/stateless/dp/trex_stream_node.h +++ b/src/stateless/dp/trex_stream_node.h @@ -81,8 +81,8 @@ private: void * m_cache_mbuf; double m_next_time_offset; /* in sec */ - double m_ibg_sec; /* inter burst time in sec */ - + uint32_t m_pad11; + uint32_t m_pad12; stream_state_t m_state; uint8_t m_port_id; @@ -167,7 +167,7 @@ public: } inline double get_multi_ibg_sec(){ - return (m_ibg_sec); + return (usec_to_sec(m_ref_stream_info->m_ibg_usec)); } inline uint32_t get_multi_burst_cnt(){ @@ -222,7 +222,7 @@ public: } }else{ - m_time += m_ibg_sec; + m_time += get_multi_ibg_sec(); m_single_burst = m_single_burst_refill; thread->m_node_gen.m_p_queue.push( (CGenNode *)this); } |