diff options
author | 2016-11-09 18:19:09 +0200 | |
---|---|---|
committer | 2016-11-09 18:19:09 +0200 | |
commit | ab28fccc187c6134eeb0400ce0b113a77e498bb2 (patch) | |
tree | 8ac54ad7a53992fb25e48d14eee274a2fdab3f37 /scripts/automation/trex_control_plane/stl/trex_stl_lib/utils | |
parent | d09b123992f990a6c219dd47707cc703fe9055b5 (diff) |
RX features - added port attributes for IPv4 and DG
Signed-off-by: imarom <imarom@cisco.com>
Diffstat (limited to 'scripts/automation/trex_control_plane/stl/trex_stl_lib/utils')
-rw-r--r-- | scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/common.py | 7 | ||||
-rwxr-xr-x | scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/parsing_opts.py | 8 |
2 files changed, 15 insertions, 0 deletions
diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/common.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/common.py index 72ee8972..f0da9a08 100644 --- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/common.py +++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/common.py @@ -3,6 +3,7 @@ import sys import string import random import time +import socket try: import pwd @@ -86,3 +87,9 @@ class PassiveTimer(object): return (time.time() > self.expr_sec) +def is_valid_ipv4 (addr): + try: + socket.inet_pton(socket.AF_INET, addr) + return True + except socket.error: + return False diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/parsing_opts.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/parsing_opts.py index 715a741e..b93a797d 100755 --- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/parsing_opts.py +++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/parsing_opts.py @@ -45,9 +45,11 @@ FLOW_CTRL = 28 SUPPORTED = 29 RX_FILTER_MODE = 30 + OUTPUT_FILENAME = 31 ALL_FILES = 32 LIMIT = 33 +PORT_RESTART = 34 GLOBAL_STATS = 50 PORT_STATS = 51 @@ -322,6 +324,12 @@ OPTIONS_DB = {MULTIPLIER: ArgumentPack(['-m', '--multiplier'], 'type': str}), + PORT_RESTART: ArgumentPack(['-r', '--restart'], + {'help': 'hard restart port(s)', + 'dest': 'restart', + 'default': False, + 'action': 'store_true'}), + ALL_FILES: ArgumentPack(['--all'], {'help': 'change RX port filter to fetch all packets', |