From 2ec326cbe088f3ee5634336e326ae8c3561c7461 Mon Sep 17 00:00:00 2001 From: Hanoh Haim Date: Wed, 30 Mar 2016 13:57:58 +0300 Subject: add ga to api --- .../trex_control_plane/doc/_templates/layout.html | 17 +++++++++++++++ .../doc_stl/_templates/layout.html | 17 +++++++++++++++ scripts/stl/udp_1pkt_simple_burst.py | 24 ++++++++++++++++++++++ 3 files changed, 58 insertions(+) create mode 100644 scripts/automation/trex_control_plane/doc/_templates/layout.html create mode 100644 scripts/automation/trex_control_plane/doc_stl/_templates/layout.html create mode 100644 scripts/stl/udp_1pkt_simple_burst.py diff --git a/scripts/automation/trex_control_plane/doc/_templates/layout.html b/scripts/automation/trex_control_plane/doc/_templates/layout.html new file mode 100644 index 00000000..8c1c709c --- /dev/null +++ b/scripts/automation/trex_control_plane/doc/_templates/layout.html @@ -0,0 +1,17 @@ +{% extends "!layout.html" %} + +{% block footer %} +{{ super() }} + +{% endblock %} + + 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() }} + +{% endblock %} + + diff --git a/scripts/stl/udp_1pkt_simple_burst.py b/scripts/stl/udp_1pkt_simple_burst.py new file mode 100644 index 00000000..bf485ab0 --- /dev/null +++ b/scripts/stl/udp_1pkt_simple_burst.py @@ -0,0 +1,24 @@ +from trex_stl_lib.api import * + +class STLS1(object): + + def create_stream (self): + return STLStream( + packet = + STLPktBuilder( + pkt = Ether()/IP(src="16.0.0.1",dst="48.0.0.1")/ + UDP(dport=12,sport=1025)/(10*'x') + ), + mode = STLTXSingleBurst(total_pkts = 1)) + + def get_streams (self, direction = 0, **kwargs): + # create 1 stream + return [ self.create_stream() ] + + +# dynamic load - used for trex console or simulator +def register(): + return STLS1() + + + -- cgit 1.2.3-korg