scapy: Load default SCAPY protocols 93/55793/1
authorMartin Klozik <martinx.klozik@intel.com>
Mon, 16 Apr 2018 06:58:20 +0000 (07:58 +0100)
committerMartin Klozik <martinx.klozik@intel.com>
Mon, 16 Apr 2018 06:58:20 +0000 (07:58 +0100)
After the fix of SCAPY library import, it was not possible to use
some of the network protocols by T-Rex. T-Rex 2.38 uses by default
SCAPY 2.3.1 for python3, but it overrides the default set of network
protocols loaded by layers/all.py. VSPERF makefile was modified to
restore original version of all.py from SCAPY 2.3.1 git repository.
Also examples of scapy usage were updated to generate correct traffic
with modified scapy version.

JIRA: VSPERF-566

Change-Id: Ib9ae3c572e693e86d30eb0467ab9c812fe8f335b
Signed-off-by: Martin Klozik <martinx.klozik@intel.com>
Reviewed-by: Al Morton <acmorton@att.com>
Reviewed-by: Christian Trautman <ctrautma@redhat.com>
Reviewed-by: Sridhar Rao <sridhar.rao@spirent.com>
docs/testing/user/configguide/trafficgen.rst
src/trex/Makefile

index f9e2db1..42141c5 100644 (file)
@@ -974,8 +974,8 @@ definition and supported network layers at: http://www.secdev.org/projects/scapy
 
         'scapy': {
             'enabled': True,
-            '0' : 'Ether(src={Ether_src}, dst={Ether_dst})/IP(proto={IP_proto}, src={IP_src}, dst={IP_dst})/ICMP()',
-            '1' : 'Ether(src={Ether_dst}, dst={Ether_src})/IP(proto={IP_proto}, src={IP_dst}, dst={IP_src})/ICMP()',
+            '0' : 'Ether(src={Ether_src}, dst={Ether_dst})/IP(proto="icmp", src={IP_src}, dst={IP_dst})/ICMP()',
+            '1' : 'Ether(src={Ether_dst}, dst={Ether_src})/IP(proto="icmp", src={IP_dst}, dst={IP_src})/ICMP()',
         }
 
 #. Generate IPv6 ICMP Echo Request
@@ -992,17 +992,13 @@ definition and supported network layers at: http://www.secdev.org/projects/scapy
             '1' : 'Ether(src={Ether_dst}, dst={Ether_src})/IPv6(src={IP_dst}, dst={IP_src})/ICMPv6EchoRequest()',
         }
 
-#. Generate SCTP frames:
+#. Generate TCP frames:
 
-   Example uses default SCAPY frame definition, which can reflect ``TRAFFIC['l3']['proto']`` settings. The same
-   approach can be used to generate other protocols, e.g. TCP.
+   Example uses default SCAPY frame definition, which can reflect ``TRAFFIC['l3']['proto']`` settings.
 
    .. code-block:: console
 
         'l3' : {
-            'proto' : 'sctp',
+            'proto' : 'tcp',
         },
-        'scapy': {
-            'enabled': True,
-        }
 
index 41eb52a..9a0704a 100644 (file)
@@ -29,6 +29,8 @@ all: force_pull
 force_pull: $(TAG_DONE_FLAG)
        $(AT)cd $(WORK_DIR) && git pull $(TREX_URL) $(TREX_TAG)
        @echo "git pull done"
+       $(AT)wget https://raw.githubusercontent.com/phaethon/scapy/v0.18/scapy/layers/all.py -O $(WORK_DIR)/scripts/external_libs/scapy-2.3.1/python3/scapy/layers/all.py
+       @echo "orignal SCAPY 2.3.1 layers/all.py was restored"
 
 $(WORK_DIR):
        $(AT)git clone $(TREX_URL) $(WORK_DIR)