summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--trex_rpc_server_spec.asciidoc79
1 files changed, 50 insertions, 29 deletions
diff --git a/trex_rpc_server_spec.asciidoc b/trex_rpc_server_spec.asciidoc
index 728781bc..c08447dd 100644
--- a/trex_rpc_server_spec.asciidoc
+++ b/trex_rpc_server_spec.asciidoc
@@ -193,32 +193,32 @@ The following diagram illustres the RPC server component's place:
image::images/rpc_server_big_picture.png[title="RPC Server Position",align="left",width=800, link="images/rpc_server_big_picture.png"]
-== RPC Server State Machine
-The RPC server can be in numbered of states, each state provides other subset of the commands
+== RPC Server Port State Machine
+Any port on the server can be in numbered of states, each state provides other subset of the commands
that are allowed to be executed.
We define the following possible states:
-* *unowned* - The server is either unowned or another user is owning the device
-* *owned* - The server has been acquired by the client
-* *active* - The server is in the middle of injecting traffic - currently active
+* *unowned* - The specific port is either unowned or another user is owning the port
+* *owned* - The specific port has been acquired by the client
+* *active* - The specific port is in the middle of injecting traffic - currently active
-Each command will specify on which states it is possible to execute it.
+Each port command will specify on which states it is possible to execute it.
-For commands valid only on 'owned' or 'active', a field called ''handler'' 'MUST' be passed
+For port related commands valid only on 'owned' or 'active', a field called ''handler'' 'MUST' be passed
along with the rest of the parameters.
This will identify the connection:
-image::images/rpc_states.png[title="RPC Server States",align="left",width=150, link="images/rpc_states.png"]
+image::images/rpc_states.png[title="Port States",align="left",width=150, link="images/rpc_states.png"]
== RPC Commands
The following RPC commands are supported
=== Ping
* *Name* - 'ping'
-* *Valid States* - 'all'
+* *Valid States* - 'not relevant'
* *Description* - Pings the TRex server
* *Paramters* - None
* *Result* ['string'] - "ACK" On Sucess
@@ -248,7 +248,7 @@ Example:
=== Get Server Supported Commands
* *Name* - 'get_supported_cmds'
-* *Valid States* - 'all'
+* *Valid States* - 'not relevant'
* *Description* - Queries the server for all the supported commands
* *Paramters* - None
* *Result* ['array'] - A list of all the supported commands by the server
@@ -289,7 +289,7 @@ Example:
=== Get Version
* *Name* - 'get_version'
-* *Valid States* - 'all'
+* *Valid States* - 'not relevant'
* *Description* - Queries the server for version information
* *Paramters* - None
* *Result* ['object'] - See table below
@@ -416,8 +416,9 @@ Example:
=== Get Owner
* *Name* - 'get_owner'
* *Valid States* - 'all'
-* *Description* - Queries the server for current owner
-* *Paramters* - None
+* *Description* - Queries the server for a specific port current owner
+* *Paramters* -
+** *port_id* ['int'] - port id to query for owner
* *Result* ['string'] - owner name if exists, otherwise 'none'
[source,bash]
@@ -429,7 +430,9 @@ Example:
"id": "hxjkuwj9",
"jsonrpc": "2.0",
"method": "get_owner",
- "params": null
+ "params": {
+ "port_id": 1
+ }
}
'Response':
@@ -447,11 +450,12 @@ Example:
=== Acquire
* *Name* - 'Acquire'
* *Valid States* - 'all'
-* *Description* - Takes ownership on the device.
+* *Description* - Takes ownership over the port
* *Paramters* -
+** *port_id* ['int'] - port id to take ownership
** *user* ['string'] - User name aquiring the system
-** *force* ['boolean'] - force action even if another user is holding the device
-* *Result* ['string'] - 'unique' connection handler for future requests
+** *force* ['boolean'] - force action even if another user is holding the port
+* *Result* ['string'] - 'unique' connection handler for future requests for that port
[source,bash]
----
@@ -463,8 +467,9 @@ Example:
"jsonrpc": "2.0",
"method": "Acquire",
"params": {
+ "user": "itay"
+ "port_id": 1
"force": false,
- "user": "itay"
}
}
@@ -485,6 +490,7 @@ Example:
* *Description* - Release owernship over the device
* *Paramters* -
** *handler* ['string'] - unique connection handler
+** *port_id* ['int'] - port id to release
* *Result* ['string'] - "ACK" on success
[source,bash]
@@ -498,6 +504,7 @@ Example:
"method": "release",
"params": {
"handler": "37JncCHr"
+ "port_id": 1
}
}
@@ -622,6 +629,8 @@ Any element in the array can be one of the following object types:
| is_big_endian | boolean | should write as big endian or little
|=================
+TIP: For more information and examples on VM objects please refer to:
+link:vm_doc.html[VM examples]
===== Object type 'rx_stats' anchor:rx_stats_obj[]
Describes rx stats for the stream
@@ -888,7 +897,7 @@ if both are enabled then 10 bytes will be used.
* *Description* - Starts the traffic on a specific port. if traffic has already started an error will be returned
* *Paramters*
** *handler* ['string'] - unique connection handler
-** *port_id* ['array'] - array of port id on which to start traffic
+** *port_id* ['int'] - port id on which to start traffic
* *Result* ['string'] - "ACK" on success
@@ -903,7 +912,7 @@ if both are enabled then 10 bytes will be used.
"method": "start_traffic",
"params": {
"handler": "37JncCHr",
- "port_id": [3, 4]
+ "port_id": 3
}
'Response':
@@ -923,7 +932,7 @@ if both are enabled then 10 bytes will be used.
* *Description* - Stops the traffic on a specific port. if the port has already started nothing will happen
* *Paramters*
** *handler* ['string'] - unique connection handler
-** *port_id* ['array'] - array of port id on which to stop traffic
+** *port_id* ['int'] - port id on which to stop traffic
* *Result* ['string'] - "ACK" on success
@@ -938,7 +947,7 @@ if both are enabled then 10 bytes will be used.
"method": "stop_traffic",
"params": {
"handler": "37JncCHr",
- "port_id": [3, 4]
+ "port_id": 3
}
}
@@ -975,6 +984,7 @@ if both are enabled then 10 bytes will be used.
| total_rx_pkts | int | total RX packets
| total_rx_bytes | int | total TX bytes
| total_tx_bytes | int | total RX bytes
+| tx-rx-error | int | total Tx/Rx errors
|=================
=== Get Port Stats
@@ -990,11 +1000,15 @@ if both are enabled then 10 bytes will be used.
[options="header",cols="1,1,3"]
|=================
| Field | Type | Description
-| active | boolean | 'true' if the port is in transmitting phase
-| opackets | int | total output packets
-| ipackets | int | total input packets
-| obytes | int | total output bytes
-| ibytes | int | total input bytes
+| status | string | 'down', 'idle' or 'transmitting'
+| tx_bps | double | total TX bits per second
+| rx_bps | double | total RX bits per second
+| tx_pps | double | total TX packets per second
+| rx_pps | double | total RX packets per second
+| total_tx_pkts | int | total TX packets
+| total_rx_pkts | int | total RX packets
+| total_rx_bytes | int | total TX bytes
+| total_tx_bytes | int | total RX bytes
| tx-rx-error | int | total Tx/Rx errors
|=================
@@ -1012,8 +1026,15 @@ if both are enabled then 10 bytes will be used.
[options="header",cols="1,1,3"]
|=================
| Field | Type | Description
-| tx_pkts | int | total TX packets
-| rx_pkts | int | total RX packets [only if 'rx_stats' is enabled], o.w always zero
+| tx_bps | double | total TX bits per second
+| tx_pps | double | total TX packets per second
+| total_tx_pkts | int | total TX packets
+| total_tx_bytes | int | total TX bytes
+| rx_bps | double | total RX bits per second (if 'rx_stats' enabled)
+| rx_pps | double | total RX packets per second (if 'rx_stats' enabled)
+| total_rx_pkts | int | total RX packets (if 'rx_stats' enabled)
+| total_rx_bytes | int | total RX bytes (if 'rx_stats' enabled)
+| latency | array | array of 2 ordered elements average, maximum (if 'rx_stats' enabled)
|=================