summaryrefslogtreecommitdiffstats
path: root/scripts/automation/trex_control_plane/doc_stl
diff options
context:
space:
mode:
authorHanoh Haim <hhaim@cisco.com>2016-09-26 17:51:38 +0300
committerHanoh Haim <hhaim@cisco.com>2016-09-26 17:52:04 +0300
commit9ff1f808edcc9289d297b3a6cf34b1e5590ecf85 (patch)
tree913cab781ba05be44502729909c49f3b1ee31bc7 /scripts/automation/trex_control_plane/doc_stl
parente3c6ee9f99d5df4f1eae50f694efc609ea3c91ac (diff)
update stl doc
Diffstat (limited to 'scripts/automation/trex_control_plane/doc_stl')
-rwxr-xr-xscripts/automation/trex_control_plane/doc_stl/api/field_engine.rst36
1 files changed, 36 insertions, 0 deletions
diff --git a/scripts/automation/trex_control_plane/doc_stl/api/field_engine.rst b/scripts/automation/trex_control_plane/doc_stl/api/field_engine.rst
index 39afa38b..a6e624c1 100755
--- a/scripts/automation/trex_control_plane/doc_stl/api/field_engine.rst
+++ b/scripts/automation/trex_control_plane/doc_stl/api/field_engine.rst
@@ -147,6 +147,13 @@ STLVmTupleGen
:members:
:member-order: bysource
+STLVmFlowVarRepetableRandom
+----------------------------
+
+.. autoclass:: trex_stl_lib.trex_stl_packet_builder_scapy.STLVmFlowVarRepetableRandom
+ :members:
+ :member-order: bysource
+
Field Engine snippet
@@ -199,3 +206,32 @@ Field Engine snippet
)
+.. code-block:: python
+
+ # FE Example3
+
+
+ #IP dest would have 10 random values betwean 48.0.0.1 48.0.0.255
+
+ base_pkt = Ether()/IP(src=src_ip,dst=dst_ip)/UDP(dport=12,sport=1025)
+
+ pad = max(0, size - len(base_pkt)) * 'x'
+
+ vm = STLScVmRaw( [ STLVmFlowVar ( "ip_src", min_value="10.0.0.1",
+ max_value="10.0.0.255", size=4, step=1,op="inc"),
+ STLVmFlowVarRepetableRandom ( "ip_dst",
+ min_value="48.0.0.1",
+ max_value="48.0.0.255",
+ size=4,
+ limit=10, seed=0x1235),
+
+ STLVmWrFlowVar (fv_name="ip_src", pkt_offset= "IP.src" ), # write ip to packet IP.src
+ STLVmWrFlowVar (fv_name="ip_dst", pkt_offset= "IP.dst" ), # write ip to packet IP.dst
+
+ STLVmFixIpv4(offset = "IP") # fix checksum
+ ]
+ ,split_by_field = "ip_src" # split to cores base on the tuple generator
+ ,cache_size = cache_size # the cache size
+ );
+
+