From 9ff1f808edcc9289d297b3a6cf34b1e5590ecf85 Mon Sep 17 00:00:00 2001 From: Hanoh Haim Date: Mon, 26 Sep 2016 17:51:38 +0300 Subject: update stl doc --- .../doc_stl/api/field_engine.rst | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'scripts/automation/trex_control_plane/doc_stl') 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 + ); + + -- cgit 1.2.3-korg