cisco-system-traffic-generator / trex-core

trex-core site
https://trex-tgn.cisco.com/
Other
1.27k stars 457 forks source link

trex_cookbook.asciidoc #957

Open darkpasiu opened 1 year ago

darkpasiu commented 1 year ago

Hi,

Can you please update the trex_cookbook.asciidoc? https://github.com/cisco-system-traffic-generator/trex-core/blob/master/doc/trex_cookbook.asciidoc#acquring--resetting-ports

# get TRex APIs
from trex_stl_lib.api import *

c = STLClient(server = '127.0.0.1')
c.connect()

try:
    c.acquire(ports = [port_0, port_1])

except STLError as e:
    print(e)

finally:

    c.disconnect()

port definition is missing, please add something like this:

port_0 = 0
port_1 = 1

Other examples are also missing this part. Thank you :)

darkpasiu commented 1 year ago

In this example port names are mixed up: https://github.com/cisco-system-traffic-generator/trex-core/blob/master/doc/trex_cookbook.asciidoc#configure-ports-for-l2-mode

    c.set_service_mode(ports = [port_0, port_1])

    c.set_l2_mode(port = tx_port, dst_mac = "6A:A7:B5:3A:4E:00")
    c.set_l2_mode(port = rx_port, dst_mac = "6A:A7:B5:3A:4E:01")

port_0, port_1 -> tx_port, rx_port. Please use correct names and add a variable definition :)

darkpasiu commented 1 year ago

please fix the typo in: https://github.com/cisco-system-traffic-generator/trex-core/blob/master/doc/trex_cookbook.asciidoc#packet-capturing

status = c.get_capture_status()[id['id'] -> status = c.get_capture_status()[id['id']] missing square brackets at the end