Separate files needing GPL license 43/23143/31
authorVratko Polak <vrpolak@cisco.com>
Mon, 4 May 2020 11:05:26 +0000 (13:05 +0200)
committerVratko Polak <vrpolak@cisco.com>
Wed, 6 May 2020 14:03:21 +0000 (14:03 +0000)
+ Keep apache license for now, until this is completed:
  https://wiki.fd.io/view/TSC/Relicensing_Procedure
+ Add utilities for switching license comment blocks.
 - They do not preserve attributes, so executable flag is lost.
+ Move the affected files to GPL/.
 + Update paths so files are executed from the new location.
 + Change the way scripts are started to do not require executable flag.
 + Employ OptionString when constructing longer command lines.
+ Move also PacketVerifier.py and TrafficScriptArg.py
  as they are linked with traffic scripts.
 + That means the two files are outside "resources" package tree now.
 + Added __init__.py files so relative imports work in new package tree.
+ Start traffic scripts as python modules to allow relative imports.
 + Once again needed because they are outside the default PYTHONPATH.

Change-Id: Ieb135629e890adbaf5b79497570f3be25b746f9f
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
156 files changed:
GPL/README.txt [new file with mode: 0644]
GPL/tools/trex/trex_server_info.py [moved from resources/tools/trex/trex_server_info.py with 96% similarity, mode: 0644]
GPL/tools/trex/trex_stateless_profile.py [moved from resources/tools/trex/trex_stateless_profile.py with 100% similarity, mode: 0644]
GPL/tools/trex/trex_stateless_stop.py [moved from resources/tools/trex/trex_stateless_stop.py with 100% similarity, mode: 0644]
GPL/traffic_profiles/trex/profile_trex_stateless_base_class.py [moved from resources/traffic_profiles/trex/profile_trex_stateless_base_class.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-2n-dot1qip4asym-ip4src254.py [moved from resources/traffic_profiles/trex/trex-sl-2n-dot1qip4asym-ip4src254.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-2n-dot1qip6asym-ip6src253.py [moved from resources/traffic_profiles/trex/trex-sl-2n-dot1qip6asym-ip6src253.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-2n-ethip4-ip4dst-rnd10000.py [moved from resources/traffic_profiles/trex/trex-sl-2n-ethip4-ip4dst-rnd10000.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-2n-ethip4-ip4dst-rnd100000.py [moved from resources/traffic_profiles/trex/trex-sl-2n-ethip4-ip4dst-rnd100000.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-2n-ethip4-ip4dst-rnd1000000.py [moved from resources/traffic_profiles/trex/trex-sl-2n-ethip4-ip4dst-rnd1000000.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-2n-ethip4-ip4dst10000.py [moved from resources/traffic_profiles/trex/trex-sl-2n-ethip4-ip4dst10000.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-2n-ethip4-ip4dst100000.py [moved from resources/traffic_profiles/trex/trex-sl-2n-ethip4-ip4dst100000.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-2n-ethip4-ip4dst1000000.py [moved from resources/traffic_profiles/trex/trex-sl-2n-ethip4-ip4dst1000000.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-2n-ethip4-ip4src253.py [moved from resources/traffic_profiles/trex/trex-sl-2n-ethip4-ip4src253.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-2n-ethip4-ip4src254.py [moved from resources/traffic_profiles/trex/trex-sl-2n-ethip4-ip4src254.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-2n-ethip4-macsrc500kdst500k.py [moved from resources/traffic_profiles/trex/trex-sl-2n-ethip4-macsrc500kdst500k.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-2n-ethip4-macsrc50kdst50k.py [moved from resources/traffic_profiles/trex/trex-sl-2n-ethip4-macsrc50kdst50k.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-2n-ethip4-macsrc5kdst5k.py [moved from resources/traffic_profiles/trex/trex-sl-2n-ethip4-macsrc5kdst5k.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-2n-ethip4udp-1000u15p.py [moved from resources/traffic_profiles/trex/trex-sl-2n-ethip4udp-1000u15p.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-2n-ethip4udp-10u1000p-conc.py [moved from resources/traffic_profiles/trex/trex-sl-2n-ethip4udp-10u1000p-conc.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-2n-ethip4udp-1u1p.py [moved from resources/traffic_profiles/trex/trex-sl-2n-ethip4udp-1u1p.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-2n-ethip4udp-lb.py [moved from resources/traffic_profiles/trex/trex-sl-2n-ethip4udp-lb.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-2n-ethip6-ip6dst10000.py [moved from resources/traffic_profiles/trex/trex-sl-2n-ethip6-ip6dst10000.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-2n-ethip6-ip6dst100000.py [moved from resources/traffic_profiles/trex/trex-sl-2n-ethip6-ip6dst100000.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-2n-ethip6-ip6dst1000000.py [moved from resources/traffic_profiles/trex/trex-sl-2n-ethip6-ip6dst1000000.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-2n-ethip6-ip6src253.py [moved from resources/traffic_profiles/trex/trex-sl-2n-ethip6-ip6src253.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-10c1n.py [moved from resources/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-10c1n.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-10c2n.py [moved from resources/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-10c2n.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-1c10n.py [moved from resources/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-1c10n.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-1c1n.py [moved from resources/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-1c1n.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-1c2n.py [moved from resources/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-1c2n.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-1c4n.py [moved from resources/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-1c4n.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-1c6n.py [moved from resources/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-1c6n.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-1c8n.py [moved from resources/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-1c8n.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-2c10n.py [moved from resources/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-2c10n.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-2c1n.py [moved from resources/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-2c1n.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-2c2n.py [moved from resources/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-2c2n.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-2c4n.py [moved from resources/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-2c4n.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-2c6n.py [moved from resources/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-2c6n.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-2c8n.py [moved from resources/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-2c8n.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-4c1n.py [moved from resources/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-4c1n.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-4c2n.py [moved from resources/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-4c2n.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-4c4n.py [moved from resources/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-4c4n.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-4c6n.py [moved from resources/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-4c6n.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-6c1n.py [moved from resources/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-6c1n.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-6c2n.py [moved from resources/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-6c2n.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-6c4n.py [moved from resources/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-6c4n.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-8c1n.py [moved from resources/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-8c1n.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-8c2n.py [moved from resources/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-8c2n.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-dot1qip4-vlan100ip4src254ip4dst254.py [moved from resources/traffic_profiles/trex/trex-sl-3n-dot1qip4-vlan100ip4src254ip4dst254.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-dot1qip4-vlan10ip4src254ip4dst254.py [moved from resources/traffic_profiles/trex/trex-sl-3n-dot1qip4-vlan10ip4src254ip4dst254.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-dot1qip4-vlan1ip4src254ip4dst254.py [moved from resources/traffic_profiles/trex/trex-sl-3n-dot1qip4-vlan1ip4src254ip4dst254.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-dot1qip4-vlan1kip4src254ip4dst254.py [moved from resources/traffic_profiles/trex/trex-sl-3n-dot1qip4-vlan1kip4src254ip4dst254.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst1.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst1.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst100.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst100.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst1000-1cnf.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst1000-1cnf.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst1000-2cnf.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst1000-2cnf.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst1000-4cnf.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst1000-4cnf.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst1000-8cnf.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst1000-8cnf.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst1000.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst1000.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst10000-1cnf.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst10000-1cnf.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst10000-2cnf.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst10000-2cnf.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst10000-4cnf.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst10000-4cnf.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst10000-8cnf.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst10000-8cnf.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst10000.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst10000.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst100000.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst100000.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst1000000.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst1000000.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst20000-1cnf.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst20000-1cnf.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst20000-2cnf.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst20000-2cnf.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst20000-4cnf.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst20000-4cnf.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst20000-8cnf.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst20000-8cnf.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst20000.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst20000.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst253.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst253.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst253_l3fwd.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst253_l3fwd.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst4-1cnf.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst4-1cnf.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst4-2cnf.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst4-2cnf.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst4-4cnf.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst4-4cnf.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst4.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst4.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40-1cnf.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40-1cnf.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40-2cnf.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40-2cnf.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40-4cnf.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40-4cnf.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40-8cnf.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40-8cnf.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst400-1cnf.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst400-1cnf.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst400-2cnf.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst400-2cnf.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst400-4cnf.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst400-4cnf.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst400-8cnf.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst400-8cnf.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst400.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst400.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40000-1cnf.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40000-1cnf.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40000-2cnf.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40000-2cnf.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40000-4cnf.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40000-4cnf.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40000-8cnf.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40000-8cnf.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40000.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40000.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst5000-1cnf.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst5000-1cnf.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst5000-2cnf.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst5000-2cnf.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst5000-4cnf.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst5000-4cnf.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst5000-8cnf.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst5000-8cnf.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst5000.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst5000.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst60000-1cnf.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst60000-1cnf.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst60000-2cnf.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst60000-2cnf.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst60000-4cnf.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst60000-4cnf.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst60000-8cnf.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst60000-8cnf.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst60000.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst60000.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4src253.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4src253.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4src254.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4src254.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4-macsrc100ip4src100.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4-macsrc100ip4src100.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4-macsrc100kip4src100k.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4-macsrc100kip4src100k.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4-macsrc10kip4src10k.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4-macsrc10kip4src10k.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4-macsrc500kdst500k.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4-macsrc500kdst500k.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4-macsrc50kdst50k.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4-macsrc50kdst50k.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4-macsrc5kdst5k.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4-macsrc5kdst5k.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4udp-1000u15p.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4udp-1000u15p.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4udp-100u1000p-conc.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4udp-100u1000p-conc.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4udp-100u15p.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4udp-100u15p.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4udp-10u1000p-conc.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4udp-10u1000p-conc.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4udp-10u10p-conc.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4udp-10u10p-conc.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4udp-10u15p.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4udp-10u15p.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4udp-1u15p.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4udp-1u15p.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4udp-1u1p.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4udp-1u1p.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4udp-2000u15p.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4udp-2000u15p.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip4udp-4000u15p.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip4udp-4000u15p.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip6-ip6dst10000.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip6-ip6dst10000.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip6-ip6dst100000.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip6-ip6dst100000.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip6-ip6dst1000000.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip6-ip6dst1000000.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-3n-ethip6-ip6src253.py [moved from resources/traffic_profiles/trex/trex-sl-3n-ethip6-ip6src253.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-dot1qip4-vlan1ip4src254ip4dst254-bvi.py [moved from resources/traffic_profiles/trex/trex-sl-dot1qip4-vlan1ip4src254ip4dst254-bvi.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-dot1qip4-vlan1ip4src254ip4dst254.py [moved from resources/traffic_profiles/trex/trex-sl-dot1qip4-vlan1ip4src254ip4dst254.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-dot1qip4vxlan-ip4src10udpsrcrnd.py [moved from resources/traffic_profiles/trex/trex-sl-dot1qip4vxlan-ip4src10udpsrcrnd.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-dot1qip4vxlan-ip4src1udpsrcrnd.py [moved from resources/traffic_profiles/trex/trex-sl-dot1qip4vxlan-ip4src1udpsrcrnd.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-dot1qip4vxlan-ip4src2udpsrcrnd.py [moved from resources/traffic_profiles/trex/trex-sl-dot1qip4vxlan-ip4src2udpsrcrnd.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-dot1qip4vxlan-ip4src4udpsrcrnd.py [moved from resources/traffic_profiles/trex/trex-sl-dot1qip4vxlan-ip4src4udpsrcrnd.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-dot1qip4vxlan-ip4src6udpsrcrnd.py [moved from resources/traffic_profiles/trex/trex-sl-dot1qip4vxlan-ip4src6udpsrcrnd.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-dot1qip4vxlan-ip4src8udpsrcrnd.py [moved from resources/traffic_profiles/trex/trex-sl-dot1qip4vxlan-ip4src8udpsrcrnd.py with 100% similarity]
GPL/traffic_profiles/trex/trex-sl-ethip4vxlan-ip4src1udpsrcrnd.py [moved from resources/traffic_profiles/trex/trex-sl-ethip4vxlan-ip4src1udpsrcrnd.py with 100% similarity]
GPL/traffic_scripts/PacketVerifier.py [moved from resources/libraries/python/PacketVerifier.py with 99% similarity]
GPL/traffic_scripts/TrafficScriptArg.py [moved from resources/libraries/python/TrafficScriptArg.py with 97% similarity]
GPL/traffic_scripts/__init__.py [new file with mode: 0644]
GPL/traffic_scripts/ipsec_interface.py [moved from resources/traffic_scripts/ipsec_interface.py with 98% similarity, mode: 0644]
GPL/traffic_scripts/ipsec_policy.py [moved from resources/traffic_scripts/ipsec_policy.py with 98% similarity, mode: 0644]
GPL/traffic_scripts/lisp/__init__.py [new file with mode: 0644]
GPL/traffic_scripts/lisp/lisp_check.py [moved from resources/traffic_scripts/lisp/lisp_check.py with 96% similarity, mode: 0644]
GPL/traffic_scripts/lisp/lispgpe_check.py [moved from resources/traffic_scripts/lisp/lispgpe_check.py with 96% similarity, mode: 0644]
GPL/traffic_scripts/policer.py [moved from resources/traffic_scripts/policer.py with 94% similarity, mode: 0644]
GPL/traffic_scripts/send_icmp_wait_for_reply.py [moved from resources/traffic_scripts/send_icmp_wait_for_reply.py with 95% similarity, mode: 0644]
GPL/traffic_scripts/send_ip_check_headers.py [moved from resources/traffic_scripts/send_ip_check_headers.py with 96% similarity, mode: 0644]
GPL/traffic_scripts/send_vxlan_check_vxlan.py [moved from resources/traffic_scripts/send_vxlan_check_vxlan.py with 94% similarity, mode: 0644]
GPL/traffic_scripts/srv6_encap.py [moved from resources/traffic_scripts/srv6_encap.py with 98% similarity, mode: 0644]
GPL/traffic_scripts/vxlan.py [new file with mode: 0644]
resources/libraries/python/TrafficGenerator.py
resources/libraries/python/TrafficScriptExecutor.py
resources/tools/block_replacer/apache2gpl.sh [new file with mode: 0644]
resources/tools/block_replacer/apache_block.txt [new file with mode: 0644]
resources/tools/block_replacer/gpl2apache.sh [new file with mode: 0644]
resources/tools/block_replacer/gpl_block.txt [new file with mode: 0644]
resources/tools/block_replacer/replace.py [new file with mode: 0644]
resources/traffic_scripts/vxlan.py [deleted file]

diff --git a/GPL/README.txt b/GPL/README.txt
new file mode 100644 (file)
index 0000000..36de320
--- /dev/null
@@ -0,0 +1,11 @@
+This directory (and its subdirectories)
+contain files that have to be distributed under GPL license,
+mostly because of linking with scapy.
+
+When migrating more files here, make sure to migrate
+also everything linking with them.
+
+Currently the license listed is still Apache 2.0,
+we are waiting for sign-offs as described in
+https://wiki.fd.io/view/TSC/Relicensing_Procedure
+before we switch the licenses.
old mode 100755 (executable)
new mode 100644 (file)
similarity index 96%
rename from resources/tools/trex/trex_server_info.py
rename to GPL/tools/trex/trex_server_info.py
index b34709b..8423801
@@ -1,6 +1,6 @@
 #!/usr/bin/python3
 
-# Copyright (c) 2019 Cisco and/or its affiliates.
+# Copyright (c) 2020 Cisco and/or its affiliates.
 # 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:
old mode 100755 (executable)
new mode 100644 (file)
similarity index 100%
rename from resources/tools/trex/trex_stateless_stop.py
rename to GPL/tools/trex/trex_stateless_stop.py
similarity index 99%
rename from resources/libraries/python/PacketVerifier.py
rename to GPL/traffic_scripts/PacketVerifier.py
index fb2337e..20e9af6 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2019 Cisco and/or its affiliates.
+# Copyright (c) 2020 Cisco and/or its affiliates.
 # 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:
similarity index 97%
rename from resources/libraries/python/TrafficScriptArg.py
rename to GPL/traffic_scripts/TrafficScriptArg.py
index 247eccb..b2f7055 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2019 Cisco and/or its affiliates.
+# Copyright (c) 2020 Cisco and/or its affiliates.
 # 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:
diff --git a/GPL/traffic_scripts/__init__.py b/GPL/traffic_scripts/__init__.py
new file mode 100644 (file)
index 0000000..a946304
--- /dev/null
@@ -0,0 +1,16 @@
+# Copyright (c) 2020 Cisco and/or its affiliates.
+# 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.
+
+"""
+__init__ file for directory traffic_scripts
+"""
old mode 100755 (executable)
new mode 100644 (file)
similarity index 98%
rename from resources/traffic_scripts/ipsec_interface.py
rename to GPL/traffic_scripts/ipsec_interface.py
index d1e0747..4b7d758
@@ -24,8 +24,8 @@ from scapy.layers.ipsec import SecurityAssociation, ESP
 from scapy.layers.l2 import Ether
 from scapy.packet import Raw
 
-from resources.libraries.python.PacketVerifier import RxQueue, TxQueue
-from resources.libraries.python.TrafficScriptArg import TrafficScriptArg
+from .PacketVerifier import RxQueue, TxQueue
+from .TrafficScriptArg import TrafficScriptArg
 
 
 def check_ipsec(
old mode 100755 (executable)
new mode 100644 (file)
similarity index 98%
rename from resources/traffic_scripts/ipsec_policy.py
rename to GPL/traffic_scripts/ipsec_policy.py
index 0dbf2af..9e168ee
@@ -24,8 +24,8 @@ from scapy.layers.ipsec import SecurityAssociation, ESP
 from scapy.layers.l2 import Ether
 from scapy.packet import Raw
 
-from resources.libraries.python.PacketVerifier import RxQueue, TxQueue
-from resources.libraries.python.TrafficScriptArg import TrafficScriptArg
+from .PacketVerifier import RxQueue, TxQueue
+from .TrafficScriptArg import TrafficScriptArg
 
 
 def check_ipsec(pkt_recv, ip_layer, dst_tun, src_ip, dst_ip, sa_in):
diff --git a/GPL/traffic_scripts/lisp/__init__.py b/GPL/traffic_scripts/lisp/__init__.py
new file mode 100644 (file)
index 0000000..eef4a31
--- /dev/null
@@ -0,0 +1,16 @@
+# Copyright (c) 2020 Cisco and/or its affiliates.
+# 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.
+
+"""
+__init__ file for directory lisp
+"""
old mode 100755 (executable)
new mode 100644 (file)
similarity index 96%
rename from resources/traffic_scripts/lisp/lisp_check.py
rename to GPL/traffic_scripts/lisp/lisp_check.py
index ebd769f..1bdafb7
@@ -1,6 +1,6 @@
 #!/usr/bin/env python3
 
-# Copyright (c) 2019 Cisco and/or its affiliates.
+# Copyright (c) 2020 Cisco and/or its affiliates.
 # 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:
@@ -28,8 +28,8 @@ from scapy.layers.inet6 import IPv6
 from scapy.layers.l2 import Ether
 from scapy.packet import Raw
 
-from resources.libraries.python.PacketVerifier import RxQueue, TxQueue
-from resources.libraries.python.TrafficScriptArg import TrafficScriptArg
+from ..PacketVerifier import RxQueue, TxQueue
+from ..TrafficScriptArg import TrafficScriptArg
 
 
 class LispHeader(Packet):
old mode 100755 (executable)
new mode 100644 (file)
similarity index 96%
rename from resources/traffic_scripts/lisp/lispgpe_check.py
rename to GPL/traffic_scripts/lisp/lispgpe_check.py
index 50857c4..27a83f5
@@ -1,6 +1,6 @@
 #!/usr/bin/env python3
 
-# Copyright (c) 2019 Cisco and/or its affiliates.
+# Copyright (c) 2020 Cisco and/or its affiliates.
 # 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:
@@ -29,8 +29,8 @@ from scapy.layers.inet6 import IPv6
 from scapy.layers.l2 import Ether
 from scapy.packet import Raw
 
-from resources.libraries.python.PacketVerifier import RxQueue, TxQueue
-from resources.libraries.python.TrafficScriptArg import TrafficScriptArg
+from ..PacketVerifier import RxQueue, TxQueue
+from ..TrafficScriptArg import TrafficScriptArg
 
 
 class LispGPEHeader(Packet):
old mode 100755 (executable)
new mode 100644 (file)
similarity index 94%
rename from resources/traffic_scripts/policer.py
rename to GPL/traffic_scripts/policer.py
index 97cad61..db90bb2
@@ -1,6 +1,6 @@
 #!/usr/bin/env python3
 
-# Copyright (c) 2019 Cisco and/or its affiliates.
+# Copyright (c) 2020 Cisco and/or its affiliates.
 # 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:
@@ -24,8 +24,8 @@ from scapy.layers.inet import IP, TCP
 from scapy.layers.inet6 import IPv6, ICMPv6ND_NS
 from scapy.packet import Raw
 
-from resources.libraries.python.TrafficScriptArg import TrafficScriptArg
-from resources.libraries.python.PacketVerifier import RxQueue, TxQueue
+from .TrafficScriptArg import TrafficScriptArg
+from .PacketVerifier import RxQueue, TxQueue
 
 
 def check_ipv4(pkt_recv, dscp):
old mode 100755 (executable)
new mode 100644 (file)
similarity index 95%
rename from resources/traffic_scripts/send_icmp_wait_for_reply.py
rename to GPL/traffic_scripts/send_icmp_wait_for_reply.py
index 2c79ae7..7855463
@@ -1,6 +1,6 @@
 #!/usr/bin/env python3
 
-# Copyright (c) 2016 Cisco and/or its affiliates.
+# Copyright (c) 2020 Cisco and/or its affiliates.
 # 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:
@@ -24,8 +24,8 @@ from scapy.layers.inet6 import IPv6, ICMPv6EchoRequest, ICMPv6EchoReply,\
 from scapy.layers.l2 import Ether
 from scapy.packet import Raw
 
-from resources.libraries.python.PacketVerifier import RxQueue, TxQueue
-from resources.libraries.python.TrafficScriptArg import TrafficScriptArg
+from .PacketVerifier import RxQueue, TxQueue
+from .TrafficScriptArg import TrafficScriptArg
 
 
 def valid_ipv4(ip):
old mode 100755 (executable)
new mode 100644 (file)
similarity index 96%
rename from resources/traffic_scripts/send_ip_check_headers.py
rename to GPL/traffic_scripts/send_ip_check_headers.py
index f5a5555..ff43563
@@ -1,6 +1,6 @@
 #!/usr/bin/env python3
 
-# Copyright (c) 2019 Cisco and/or its affiliates.
+# Copyright (c) 2020 Cisco and/or its affiliates.
 # 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:
@@ -28,8 +28,8 @@ from scapy.layers.inet6 import IPv6, ICMPv6ND_NS
 from scapy.layers.l2 import Ether, Dot1Q
 from scapy.packet import Raw
 
-from resources.libraries.python.PacketVerifier import RxQueue, TxQueue
-from resources.libraries.python.TrafficScriptArg import TrafficScriptArg
+from .PacketVerifier import RxQueue, TxQueue
+from .TrafficScriptArg import TrafficScriptArg
 
 
 def valid_ipv4(ip):
old mode 100755 (executable)
new mode 100644 (file)
similarity index 94%
rename from resources/traffic_scripts/send_vxlan_check_vxlan.py
rename to GPL/traffic_scripts/send_vxlan_check_vxlan.py
index 162703d..0b1da81
@@ -1,6 +1,6 @@
 #!/usr/bin/env python3
 
-# Copyright (c) 2019 Cisco and/or its affiliates.
+# Copyright (c) 2020 Cisco and/or its affiliates.
 # 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:
@@ -23,9 +23,9 @@ from scapy.layers.inet import IP, UDP
 from scapy.layers.l2 import Ether
 from scapy.packet import Raw
 
-from resources.libraries.python.PacketVerifier import RxQueue, TxQueue
-from resources.libraries.python.TrafficScriptArg import TrafficScriptArg
-from resources.traffic_scripts import vxlan
+from .PacketVerifier import RxQueue, TxQueue
+from .TrafficScriptArg import TrafficScriptArg
+from . import vxlan
 
 
 def main():
old mode 100755 (executable)
new mode 100644 (file)
similarity index 98%
rename from resources/traffic_scripts/srv6_encap.py
rename to GPL/traffic_scripts/srv6_encap.py
index 506a245..9db9538
@@ -22,8 +22,8 @@ from scapy.layers.inet6 import IPv6, ICMPv6ND_NS, IPv6ExtHdrSegmentRouting,\
 from scapy.layers.l2 import Ether
 from scapy.packet import Raw
 
-from resources.libraries.python.PacketVerifier import RxQueue, TxQueue
-from resources.libraries.python.TrafficScriptArg import TrafficScriptArg
+from .PacketVerifier import RxQueue, TxQueue
+from .TrafficScriptArg import TrafficScriptArg
 
 
 def check_srv6(
diff --git a/GPL/traffic_scripts/vxlan.py b/GPL/traffic_scripts/vxlan.py
new file mode 100644 (file)
index 0000000..b39b419
--- /dev/null
@@ -0,0 +1,32 @@
+# Copyright (c) 2020 Cisco and/or its affiliates.
+# 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.
+
+from scapy.fields import BitField, XByteField, X3BytesField
+from scapy.layers.inet import UDP
+from scapy.layers.l2 import Ether
+from scapy.packet import Packet, bind_layers
+
+
+class VXLAN(Packet):
+    name = u"VXLAN"
+    fields_desc = [
+        BitField(u"flags", 0x08000000, 32),
+        X3BytesField(u"vni", 0),
+        XByteField(u"reserved", 0x00)
+    ]
+
+    def mysummary(self):
+        return self.sprintf(f"VXLAN (vni={VXLAN.vni})")
+
+bind_layers(UDP, VXLAN, dport=4789)
+bind_layers(VXLAN, Ether)
index 539ced5..c63dc2d 100644 (file)
@@ -75,7 +75,7 @@ class TGDropRateSearchImpl(DropRateSearch):
         :param loss_acceptance: Permitted drop ratio or frames count.
         :param loss_acceptance_type: Type of permitted loss.
         :param traffic_profile: Module name as a traffic profile identifier.
-            See resources/traffic_profiles/trex for implemented modules.
+            See GPL/traffic_profiles/trex for implemented modules.
         :param skip_warmup: Start TRex without warmup traffic if true.
         :type rate: float
         :type frame_size: str
@@ -406,12 +406,13 @@ class TrafficGenerator(AbstractMeasurer):
                     )
                     raise RuntimeError(u"Start TRex failed!")
 
-                # Test if TRex starts successfully.
-                cmd = f"sh -c \"{Constants.REMOTE_FW_DIR}/resources/tools/" \
-                    f"trex/trex_server_info.py\""
+                # Test if TRex starts successfuly.
+                command_line = OptionString().add(u"python3")
+                dirname = f"{Constants.REMOTE_FW_DIR}/GPL/tools/trex"
+                command_line.add(f"'{dirname}/trex_server_info.py'")
                 try:
                     exec_cmd_no_error(
-                        tg_node, cmd, sudo=True,
+                        tg_node, command_line, sudo=True,
                         message=u"Test TRex failed!", retries=20
                     )
                 except RuntimeError:
@@ -488,16 +489,16 @@ class TrafficGenerator(AbstractMeasurer):
         :raises RuntimeError: If stop traffic script fails.
         """
         # No need to check subtype, we know it is TREX.
-        x_args = u""
+        command_line = OptionString().add(u"python3")
+        dirname = f"{Constants.REMOTE_FW_DIR}/GPL/tools/trex"
+        command_line.add(f"'{dirname}/trex_stateless_stop.py'")
+        command_line.change_prefix(u"--")
         for index, value in enumerate(self._xstats):
             if value is not None:
-                # Nested quoting is fun.
                 value = value.replace(u"'", u"\"")
-                x_args += f" --xstat{index}='\"'\"'{value}'\"'\"'"
+                command_line.add_equals(f"xstat{index}", f"'{value}'")
         stdout, _ = exec_cmd_no_error(
-            node, f"sh -c '{Constants.REMOTE_FW_DIR}/resources/tools/trex/"
-            f"trex_stateless_stop.py{x_args}'",
-            message=u"TRex stateless runtime error"
+            node, command_line, message=u"TRex stateless runtime error"
         )
         self._parse_traffic_results(stdout)
 
@@ -514,7 +515,7 @@ class TrafficGenerator(AbstractMeasurer):
         :param rate: Traffic rate expressed with units (pps, %)
         :param frame_size: L2 frame size to send (without padding and IPG).
         :param traffic_profile: Module name as a traffic profile identifier.
-            See resources/traffic_profiles/trex for implemented modules.
+            See GPL/traffic_profiles/trex for implemented modules.
         :param async_call: If enabled then don't wait for all incomming trafic.
         :param latency: With latency measurement.
         :param warmup_time: Warmup time period.
@@ -539,30 +540,31 @@ class TrafficGenerator(AbstractMeasurer):
         # No need to check subtype, we know it is TREX.
         reorder = self._ifaces_reordered  # Just to make the next line fit.
         p_0, p_1 = (rx_port, tx_port) if reorder else (tx_port, rx_port)
-
         if not isinstance(duration, (float, int)):
             duration = float(duration)
         if not isinstance(warmup_time, (float, int)):
             warmup_time = float(warmup_time)
-        command = f"sh -c \"" \
-            f"{Constants.REMOTE_FW_DIR}/resources/tools/trex/" \
-            f"trex_stateless_profile.py " \
-            f"--profile {Constants.REMOTE_FW_DIR}/resources/" \
-            f"traffic_profiles/trex/{traffic_profile}.py " \
-            f"--duration {duration!r} --frame_size {frame_size} " \
-            f"--rate {rate!r} --warmup_time {warmup_time!r} " \
-            f"--port_0 {p_0} --port_1 {p_1} " \
-            f"--traffic_directions {traffic_directions}"
-        if async_call:
-            command += u" --async_start"
-        if latency:
-            command += u" --latency"
-        if Constants.TREX_SEND_FORCE:
-            command += u" --force"
-        command += u"\""
+
+        command_line = OptionString().add(u"python3")
+        dirname = f"{Constants.REMOTE_FW_DIR}/GPL/tools/trex"
+        command_line.add(f"'{dirname}/trex_stateless_profile.py'")
+        command_line.change_prefix(u"--")
+        dirname = f"{Constants.REMOTE_FW_DIR}/GPL/traffic_profiles/trex"
+        quoted_path = f"'{dirname}/{traffic_profile}.py'"
+        command_line.add_with_value(u"profile", quoted_path)
+        command_line.add_with_value(u"duration", f"{duration!r}")
+        command_line.add_with_value(u"frame_size", frame_size)
+        command_line.add_with_value(u"rate", f"{rate!r}")
+        command_line.add_with_value(u"warmup_time", f"{warmup_time!r}")
+        command_line.add_with_value(u"port_0", p_0)
+        command_line.add_with_value(u"port_1", p_1)
+        command_line.add_with_value(u"traffic_directions", traffic_directions)
+        command_line.add_if(u"async_start", async_call)
+        command_line.add_if(u"latency", latency)
+        command_line.add_if(u"force", Constants.TREX_SEND_FORCE)
 
         stdout, _ = exec_cmd_no_error(
-            self._node, command, timeout=float(duration) + 60,
+            self._node, command_line, timeout=float(duration) + 60,
             message=u"TRex stateless runtime error"
         )
 
@@ -630,7 +632,7 @@ class TrafficGenerator(AbstractMeasurer):
         :param rate: Offered load per interface (e.g. 1%, 3gbps, 4mpps, ...).
         :param frame_size: Frame size (L2) in Bytes.
         :param traffic_profile: Module name as a traffic profile identifier.
-            See resources/traffic_profiles/trex for implemented modules.
+            See GPL/traffic_profiles/trex for implemented modules.
         :param warmup_time: Warmup phase in seconds.
         :param async_call: Async mode.
         :param latency: With latency measurement.
@@ -720,7 +722,7 @@ class TrafficGenerator(AbstractMeasurer):
 
         :param frame_size: Frame size identifier or value [B].
         :param traffic_profile: Module name as a traffic profile identifier.
-            See resources/traffic_profiles/trex for implemented modules.
+            See GPL/traffic_profiles/trex for implemented modules.
         :param warmup_time: Traffic duration before measurement starts [s].
         :param traffic_directions: Traffic is bi- (2) or uni- (1) directional.
             Default: 2
@@ -811,7 +813,7 @@ class OptimizedSearch:
 
         :param frame_size: Frame size identifier or value [B].
         :param traffic_profile: Module name as a traffic profile identifier.
-            See resources/traffic_profiles/trex for implemented modules.
+            See GPL/traffic_profiles/trex for implemented modules.
         :param minimum_transmit_rate: Minimal uni-directional
             target transmit rate [pps].
         :param maximum_transmit_rate: Maximal uni-directional
@@ -879,7 +881,7 @@ class OptimizedSearch:
 
         :param frame_size: Frame size identifier or value [B].
         :param traffic_profile: Module name as a traffic profile identifier.
-            See resources/traffic_profiles/trex for implemented modules.
+            See GPL/traffic_profiles/trex for implemented modules.
         :param minimum_transmit_rate: Minimal uni-directional
             target transmit rate [pps].
         :param maximum_transmit_rate: Maximal uni-directional
index a9a733b..8faa084 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2019 Cisco and/or its affiliates.
+# Copyright (c) 2020 Cisco and/or its affiliates.
 # 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:
@@ -55,11 +55,11 @@ class TrafficScriptExecutor:
         """
         ssh = SSH()
         ssh.connect(node)
+        module_name = script_file_name[:-3].replace('/', '.')
         cmd = f"cd {Constants.REMOTE_FW_DIR}; virtualenv -p $(which python3) " \
             f"--system-site-packages --never-download env && " \
             f"export PYTHONPATH=${{PWD}}; . ${{PWD}}/env/bin/activate; " \
-            f"resources/traffic_scripts/{script_file_name} {script_args}"
-
+            f"cd GPL; python -m traffic_scripts.{module_name} {script_args}"
         ret_code, stdout, stderr = ssh.exec_command_sudo(
             f'sh -c "{TrafficScriptExecutor._escape(cmd)}"', timeout=timeout
         )
diff --git a/resources/tools/block_replacer/apache2gpl.sh b/resources/tools/block_replacer/apache2gpl.sh
new file mode 100644 (file)
index 0000000..f248393
--- /dev/null
@@ -0,0 +1,27 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2020 Cisco and/or its affiliates.
+# 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.
+
+set -exuo pipefail
+
+if [[ "${#}" != "1" ]]; then
+    echo 'An utility to switch license comment blocks.'
+    echo 'Requires files "gpl_block.txt" and "apache_block.txt" in the working'
+    echo 'directory, and a single argument pointing to root directory.'
+    echo 'Affects only .sh and .py files.'
+    exit 1
+fi
+
+find "${1}" \( -name "*.py" -o -name "*.sh" \) -print0 | xargs -0 \
+python3 replace.py "apache_block.txt" "gpl_block.txt"
diff --git a/resources/tools/block_replacer/apache_block.txt b/resources/tools/block_replacer/apache_block.txt
new file mode 100644 (file)
index 0000000..790a3c4
--- /dev/null
@@ -0,0 +1,11 @@
+# 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.
diff --git a/resources/tools/block_replacer/gpl2apache.sh b/resources/tools/block_replacer/gpl2apache.sh
new file mode 100644 (file)
index 0000000..a1ef8df
--- /dev/null
@@ -0,0 +1,27 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2020 Cisco and/or its affiliates.
+# 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.
+
+set -exuo pipefail
+
+if [[ "${#}" != "1" ]]; then
+    echo 'An utility to switch license comment blocks.'
+    echo 'Requires files "gpl_block.txt" and "apache_block.txt" in the working'
+    echo 'directory, and a single argument pointing to root directory.'
+    echo 'Affects only .sh and .py files.'
+    exit 1
+fi
+
+find "${1}" \( -name "*.py" -o -name "*.sh" \) -print0 | xargs -0 \
+python3 replace.py "gpl_block.txt" "apache_block.txt"
diff --git a/resources/tools/block_replacer/gpl_block.txt b/resources/tools/block_replacer/gpl_block.txt
new file mode 100644 (file)
index 0000000..2dbbb2a
--- /dev/null
@@ -0,0 +1,13 @@
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this file.  If not, see <https://www.gnu.org/licenses/>.
diff --git a/resources/tools/block_replacer/replace.py b/resources/tools/block_replacer/replace.py
new file mode 100644 (file)
index 0000000..02d1889
--- /dev/null
@@ -0,0 +1,126 @@
+#!/usr/bin/env python3
+
+# Copyright (c) 2020 Cisco and/or its affiliates.
+# 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.
+
+"""A script simplifying replacement of blocks of lines.
+
+A bash solution created by combining these two:
+    https://unix.stackexchange.com/a/181215
+    https://stackoverflow.com/a/23849180
+does not seem to work if the blocks contain complicated characters.
+"""
+
+import argparse
+import os
+import tempfile
+
+def main():
+    """Main function for the block replacing script."""
+
+    description = '''Replace a block of lines with another block.
+
+    Both block-to-replace and replacing-block are read from a file.
+    The replacement is performed on a file, in-place.
+    Only first block occurence is replaced.
+    If the block-to-replace is preceded by a partial match,
+    it may not be recognized.
+
+    The current implementation uses temporary files,
+    created in the working directory.
+    if something fails, thise temporary files need to be deleted manually.
+
+    TODO: Preserve target attributes. Maybe https://pypi.org/project/in-place/
+'''
+    parser = argparse.ArgumentParser(description)
+    parser.add_argument(
+        u"before", type=str,
+        help=u"Path to file containing the old content to replace."
+    )
+    parser.add_argument(
+        u"after", type=str,
+        help=u"Path to file containing the new content to replace with."
+    )
+    parser.add_argument(
+        u"targets", metavar=u"target", nargs=u"+", type=str,
+        help=u"Paths to file where the replacement should be made."
+    )
+    args = parser.parse_args()
+
+    do_it(args)
+
+
+def do_it(args):
+    """Read contents, create edited target, replace the original target with it.
+
+    :param args: Parsed command line arguments.
+    :type args: Object (typically argparse.Namespace) which contains
+        "before", "after" and "target" fields.
+    """
+    with open(args.before, u"r") as file_in:
+        content_before = file_in.readlines()
+    before_len = len(content_before)
+    with open(args.after, u"r") as file_in:
+        content_after = file_in.readlines()
+
+    for target in args.targets:
+        with tempfile.NamedTemporaryFile(
+            dir=u".", mode=u"w", delete=False
+        ) as file_out:
+            with open(target, u"r") as file_in:
+                # Phase one, searching for content, copying what does not match.
+                buffer_lines = list()
+                line_index_to_check = 0
+                content_found = False
+                while 1:
+                    line_in = file_in.readline()
+                    if not line_in:
+                        print(f"{target}: Content not found.")
+                        for line_out in buffer_lines:
+                            file_out.write(line_out)
+                        buffer_lines = list()
+                        break
+                    if line_in != content_before[line_index_to_check]:
+                        line_index_to_check = 0
+                        if buffer_lines:
+                            for line_out in buffer_lines:
+                                file_out.write(line_out)
+                            buffer_lines = list()
+                        file_out.write(line_in)
+                        continue
+                    buffer_lines.append(line_in)
+                    line_index_to_check += 1
+                    if line_index_to_check < before_len:
+                        continue
+                    # Buffer has the match! Do not write it.
+                    content_found = True
+                    break
+                if not content_found:
+                    file_out.close()
+                    os.remove(file_out.name)
+                    continue
+                # Phase two, write the replacement instead.
+                for line_out in content_after:
+                    file_out.write(line_out)
+                # Phase three, copy the rest of the file.
+                while 1:
+                    line_in = file_in.readline()
+                    if not line_in:
+                        print(f"{target}: Replacement done.")
+                        break
+                    file_out.write(line_in)
+        os.replace(file_out.name, target)
+
+
+if __name__ == u"__main__":
+    main()
diff --git a/resources/traffic_scripts/vxlan.py b/resources/traffic_scripts/vxlan.py
deleted file mode 100644 (file)
index eebfb90..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-from scapy.fields import BitField, XByteField, X3BytesField
-from scapy.layers.inet import UDP
-from scapy.layers.l2 import Ether
-from scapy.packet import Packet, bind_layers
-
-
-class VXLAN(Packet):
-    name = u"VXLAN"
-    fields_desc = [
-        BitField(u"flags", 0x08000000, 32),
-        X3BytesField(u"vni", 0),
-        XByteField(u"reserved", 0x00)
-    ]
-
-    def mysummary(self):
-        return self.sprintf(f"VXLAN (vni={VXLAN.vni})")
-
-bind_layers(UDP, VXLAN, dport=4789)
-bind_layers(VXLAN, Ether)