summaryrefslogtreecommitdiffstats
path: root/scripts/automation/trex_control_plane/stl
diff options
context:
space:
mode:
authorHanoh Haim <hhaim@cisco.com>2016-03-17 17:01:04 +0200
committerHanoh Haim <hhaim@cisco.com>2016-03-17 17:01:04 +0200
commit8c321b54deecde71b80ce0d210ef31d78c8cabf6 (patch)
tree689a67c5e7319fb24fc7fc8f60f60b52a510b4c0 /scripts/automation/trex_control_plane/stl
parent11425470921de652bc6849666562d4bc4045229b (diff)
add pyATS help
Diffstat (limited to 'scripts/automation/trex_control_plane/stl')
-rw-r--r--scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_packet_builder_scapy.py37
1 files changed, 37 insertions, 0 deletions
diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_packet_builder_scapy.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_packet_builder_scapy.py
index 46218bd3..661bf52a 100644
--- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_packet_builder_scapy.py
+++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_packet_builder_scapy.py
@@ -177,6 +177,43 @@ class STLScVmRaw(CTRexScriptsBase):
raw instructions
"""
def __init__(self,list_of_commands=None,split_by_field=None):
+ """
+ include a list of a basic instructions objects
+
+ :parameters:
+ list_of_commands : list
+ list of instructions
+
+ split_by_field : string
+ by which field to split to threads
+
+
+ The following example will split the generated traffic by "ip_src" variable
+
+ .. code-block:: python
+ :caption: Split by
+
+
+ # TCP SYN
+ base_pkt = Ether()/IP(dst="48.0.0.1")/TCP(dport=80,flags="S")
+
+
+ # vm
+ vm = STLScVmRaw( [ STLVmFlowVar(name="ip_src",
+ min_value="16.0.0.0",
+ max_value="16.0.0.254",
+ size=4, op="inc"),
+
+
+ STLVmWrFlowVar(fv_name="ip_src", pkt_offset= "IP.src" ),
+
+ STLVmFixIpv4(offset = "IP"), # fix checksum
+ ]
+ ,split_by_field = "ip_src"
+ )
+
+ """
+
super(STLScVmRaw, self).__init__()
self.split_by_field = split_by_field
if list_of_commands==None: