summaryrefslogtreecommitdiffstats
path: root/scripts/automation/trex_control_plane/doc_stl
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/automation/trex_control_plane/doc_stl')
-rw-r--r--scripts/automation/trex_control_plane/doc_stl/_templates/layout.html17
-rwxr-xr-x[-rw-r--r--]scripts/automation/trex_control_plane/doc_stl/api/client_code.rst36
-rwxr-xr-x[-rw-r--r--]scripts/automation/trex_control_plane/doc_stl/api/field_engine.rst14
-rwxr-xr-x[-rw-r--r--]scripts/automation/trex_control_plane/doc_stl/api/index.rst0
-rwxr-xr-x[-rw-r--r--]scripts/automation/trex_control_plane/doc_stl/api/profile_code.rst8
-rwxr-xr-x[-rw-r--r--]scripts/automation/trex_control_plane/doc_stl/api/scapy_builder.rst10
-rw-r--r--scripts/automation/trex_control_plane/doc_stl/conf.py2
-rw-r--r--scripts/automation/trex_control_plane/doc_stl/index.rst12
8 files changed, 68 insertions, 31 deletions
diff --git a/scripts/automation/trex_control_plane/doc_stl/_templates/layout.html b/scripts/automation/trex_control_plane/doc_stl/_templates/layout.html
new file mode 100644
index 00000000..8c1c709c
--- /dev/null
+++ b/scripts/automation/trex_control_plane/doc_stl/_templates/layout.html
@@ -0,0 +1,17 @@
+{% extends "!layout.html" %}
+
+{% block footer %}
+{{ super() }}
+<script>
+ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
+ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+ })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
+
+ ga('create', 'UA-75220362-1', 'auto');
+ ga('send', 'pageview');
+
+</script>
+{% endblock %}
+
+
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 8736e98d..4ae2b9fd 100644..100755
--- a/scripts/automation/trex_control_plane/doc_stl/api/client_code.rst
+++ b/scripts/automation/trex_control_plane/doc_stl/api/client_code.rst
@@ -2,16 +2,26 @@
Client Module
==================
-TRex Client is an object to access TRex server. It is per user. Each user can own number of interfaces.
-Multi user can interact with one TRex server each user should own a different set of interfaces.
+The TRex Client provides access to the TRex server.
+
+**Client and interfaces**
+
+Multiple users can interact with one TRex server. Each user "owns" a different set of interfaces.
The protocol is JSON-RPC2 over ZMQ transport.
-The API has two type of API
+In addition to the Python API, a console-based API interface is also available.
+
+Python-like example::
+
+ c.start(ports = [0, 1], mult = "5mpps", duration = 10)
+
+Console-like example::
+
+ c.start_line (" -f stl/udp_1pkt_simple.py -m 10mpps --port 0 1 ")
-1. Normal API
-2. xx_line: this api get a line like the Console and parse it and call the low level api
-Example1::
+
+Example 1 - Typical Python API::
c = STLClient(username = "itay",server = "10.0.0.10", verbose_level = LoggerApi.VERBOSE_HIGH)
@@ -49,7 +59,8 @@ STLClient snippet
-----------------
-Example1::
+.. code-block:: python
+ :caption: Example 1: Minimal example of client interacting with the TRex server
c = STLClient()
@@ -75,8 +86,9 @@ Example1::
c.disconnect()
+.. code-block:: python
+ :caption: Example 2: Client can execute other functions while the TRex server is generating traffic
-Example2: wait while doing somthing::
c = STLClient()
try:
@@ -99,7 +111,10 @@ Example2: wait while doing somthing::
c.disconnect()
-Example3: Console like::
+
+.. code-block:: python
+ :caption: Example 3: Console-like API interface
+
def simple ():
@@ -148,7 +163,8 @@ Example3: Console like::
finally:
c.disconnect()
-Example4: Load profile from a file::
+
+Example 4: Load profile from a file::
def simple ():
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 d134b0b9..541e195f 100644..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
@@ -2,19 +2,19 @@
Field Engine modules
=======================
-The Field Engine (FE) has limited number of instructions/operation for supporting most use cases.
+The Field Engine (FE) has limited number of instructions/operations to support most use cases.
There is a plan to add LuaJIT to be more flexible at the cost of performance.
-The FE can allocate stream variables in a Stream context, write a stream variable to a packet offset, change packet size, etc.
+The FE can allocate stream variables in a stream context, write a stream variable to a packet offset, change packet size, and so on.
-*Some examples for what can be done:*
+*Examples of Field Engine uses:*
* Change ipv4.tos 1-10
-* Change packet size to be random in the range 64-9K
-* Create range of flows (change src_ip, dest_ip, src_port, dest_port)
+* Change packet size to a random value in the range 64 to 9K
+* Create a range of flows (change src_ip, dest_ip, src_port, dest_port)
* Update IPv4 checksum
-Snippet will create SYN Attack::
+The following snippet creates a 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
@@ -60,7 +60,7 @@ Snippet will create SYN Attack::
STLScVmRaw class
----------------
-Aggregate a raw instructions objects
+Aggregate raw instructions objects
.. autoclass:: trex_stl_lib.trex_stl_packet_builder_scapy.STLScVmRaw
:members:
diff --git a/scripts/automation/trex_control_plane/doc_stl/api/index.rst b/scripts/automation/trex_control_plane/doc_stl/api/index.rst
index a3c8ad5a..a3c8ad5a 100644..100755
--- a/scripts/automation/trex_control_plane/doc_stl/api/index.rst
+++ b/scripts/automation/trex_control_plane/doc_stl/api/index.rst
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 b61f05e4..9afa9df2 100644..100755
--- a/scripts/automation/trex_control_plane/doc_stl/api/profile_code.rst
+++ b/scripts/automation/trex_control_plane/doc_stl/api/profile_code.rst
@@ -2,13 +2,13 @@
Traffic profile modules
=======================
-TRex STLProfile profile include a list of STLStream. The profile is a ``program`` of streams with a relation betwean the streams.
-Each stream can trigger another stream. Stream can be given a name for a full examples see here Manual_.
+The TRex STLProfile traffic profile includes a number of streams. The profile is a ``program`` of related streams.
+Each stream can trigger another stream. Each stream can be named. For a full set of examples, see Manual_.
-.. _Manual: ../draft_trex_stateless1.html
+.. _Manual: ../trex_stateless.html
-for example::
+Example::
def create_stream (self):
diff --git a/scripts/automation/trex_control_plane/doc_stl/api/scapy_builder.rst b/scripts/automation/trex_control_plane/doc_stl/api/scapy_builder.rst
index 5544df63..2c5790bf 100644..100755
--- a/scripts/automation/trex_control_plane/doc_stl/api/scapy_builder.rst
+++ b/scripts/automation/trex_control_plane/doc_stl/api/scapy_builder.rst
@@ -2,15 +2,15 @@
Packet builder modules
=======================
-The packet builder module objective is to build a template packet for a stream and to create a Field engine program to change fields in the packet.
+The packet builder module is used for building a template packet for a stream, and creating a Field Engine program to change fields in the packet.
-**Some examples for what can be done:**
+**Examples:**
-* Build a IP/UDP/DNS packet and create a range of src_ip = 10.0.0.1-10.0.0.255
-* Build a IP/UDP packets in IMIX sizes
+* Build a IP/UDP/DNS packet with a src_ip range of 10.0.0.1 to 10.0.0.255
+* Build IP/UDP packets in IMIX sizes
-for example this snippet will create SYN Attack::
+For example, this snippet creates a 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
diff --git a/scripts/automation/trex_control_plane/doc_stl/conf.py b/scripts/automation/trex_control_plane/doc_stl/conf.py
index fe6b27bc..45738b6e 100644
--- a/scripts/automation/trex_control_plane/doc_stl/conf.py
+++ b/scripts/automation/trex_control_plane/doc_stl/conf.py
@@ -69,7 +69,7 @@ author = u'TRex team, Cisco Systems Inc.'
# The short X.Y version.
version = '1.94'
# The full version, including alpha/beta/rc tags.
-release = '1.7.1'
+release = '2.0'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
diff --git a/scripts/automation/trex_control_plane/doc_stl/index.rst b/scripts/automation/trex_control_plane/doc_stl/index.rst
index 97a1037a..aa2abd75 100644
--- a/scripts/automation/trex_control_plane/doc_stl/index.rst
+++ b/scripts/automation/trex_control_plane/doc_stl/index.rst
@@ -20,19 +20,23 @@ How to Install
| Put it at any place you like, preferably same place as your scripts.
| (If it's not at same place as your scripts, you will need to ensure trex_client directory is in sys.path)
-Un-pack it using command: tar -xzf trex_client.tar.gz
+Un-pack it using command::
-How to pyATS/v2.0
+ tar -xzf trex_client.tar.gz
+
+
+How to pyATS
==================
.. sectionauthor:: David Shen
pyATS Compatibility
-Trex only supports python2 for now, so it only works for **Python2** pyats.
+TRex supports both Python2 and Python3 pyATS.
-* Install python2 pyats
+* Install python2/python3 pyats
/auto/pyats/bin/pyats-install --python2
+ /auto/pyats/bin/pyats-install --python3
* setenv TREX_PATH to the trex stateless lib path
setenv TREX_PATH <your path>/automation/trex_control_plane/stl