From 5817a4501ec08f56c3684260c8373f20e4c6c0f0 Mon Sep 17 00:00:00 2001 From: Hanoh Haim Date: Mon, 14 Mar 2016 16:55:42 +0200 Subject: add profile doc --- .../automation/trex_control_plane/doc_stl/api/client_code.rst | 2 +- .../automation/trex_control_plane/doc_stl/api/field_engine.rst | 10 ++++++---- .../automation/trex_control_plane/doc_stl/api/profile_code.rst | 8 ++++++-- 3 files changed, 13 insertions(+), 7 deletions(-) (limited to 'scripts/automation/trex_control_plane/doc_stl/api') diff --git a/scripts/automation/trex_control_plane/doc_stl/api/client_code.rst b/scripts/automation/trex_control_plane/doc_stl/api/client_code.rst index bc9d521a..16a00122 100644 --- a/scripts/automation/trex_control_plane/doc_stl/api/client_code.rst +++ b/scripts/automation/trex_control_plane/doc_stl/api/client_code.rst @@ -13,7 +13,7 @@ The API has two type of API Example1:: - c = STLClient() + c = STLClient(username = "itay",server = "10.0.0.10", verbose_level = LoggerApi.VERBOSE_HIGH) try: # connect to server 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 8b192491..95a23ac1 100644 --- a/scripts/automation/trex_control_plane/doc_stl/api/field_engine.rst +++ b/scripts/automation/trex_control_plane/doc_stl/api/field_engine.rst @@ -14,7 +14,7 @@ The FE can allocate stream variables in a Stream context, write a stream variabl * Update IPv4 checksum -for example this snippet will create SYN Attack:: +Snippet will create SYN Attack:: # create attack from random src_ip from 16.0.0.0-18.0.0.254 and random src_port 1025-65000 # attack 48.0.0.1 server @@ -108,7 +108,8 @@ STLVmTupleGen Field Engine snippet -------------------- -Example1:: +.. code-block:: python + :caption: Example1 base_pkt = Ether()/IP(src="16.0.0.1",dst="48.0.0.1")/UDP(dport=12,sport=1025) @@ -130,9 +131,10 @@ Example1:: pkt = STLPktBuilder(pkt = base_pkt/pad, vm = vm) - -Example2:: +.. code-block:: python + :caption: Example2 + #range of source mac-addr diff --git a/scripts/automation/trex_control_plane/doc_stl/api/profile_code.rst b/scripts/automation/trex_control_plane/doc_stl/api/profile_code.rst index 9484f565..b2b23e48 100644 --- a/scripts/automation/trex_control_plane/doc_stl/api/profile_code.rst +++ b/scripts/automation/trex_control_plane/doc_stl/api/profile_code.rst @@ -81,7 +81,9 @@ STLProfile snippet ------------------ -Example1:: +.. code-block:: python + :caption: Example1 + size = self.fsize - 4; # no FCS base_pkt = Ether()/IP(src="16.0.0.1",dst="48.0.0.1")/UDP(dport=12,sport=1025) @@ -110,7 +112,9 @@ Example1:: ]).get_streams() -Example2:: +.. code-block:: python + :caption: Example2 + class STLS1(object): -- cgit 1.2.3-korg