summaryrefslogtreecommitdiffstats
path: root/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_hltapi.py
diff options
context:
space:
mode:
authorYaroslav Brustinov <ybrustin@cisco.com>2016-04-14 17:23:04 +0300
committerYaroslav Brustinov <ybrustin@cisco.com>2016-04-14 17:23:04 +0300
commit501fb3b44f14e9c0d40a63bd8b47200b01e50be9 (patch)
treea45a01a5d0e724282f83df5b419916afd6784ca6 /scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_hltapi.py
parente0720b15ec9dc695a8c1799e87cbe41a670cb616 (diff)
regression: python3 support
Diffstat (limited to 'scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_hltapi.py')
-rwxr-xr-xscripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_hltapi.py15
1 files changed, 2 insertions, 13 deletions
diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_hltapi.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_hltapi.py
index 9518852f..45f3dd45 100755
--- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_hltapi.py
+++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_hltapi.py
@@ -172,23 +172,12 @@ import sys
import os
import socket
import copy
-from collections import defaultdict, OrderedDict
+from collections import defaultdict
from .api import *
from .trex_stl_types import *
from .utils.common import get_number
-class LRU_cache(OrderedDict):
- def __init__(self, maxlen = 20, *args, **kwargs):
- OrderedDict.__init__(self, *args, **kwargs)
- self.maxlen = maxlen
-
- def __setitem__(self, *args, **kwargs):
- OrderedDict.__setitem__(self, *args, **kwargs)
- if len(self) > self.maxlen:
- self.popitem(last = False)
-
-
class HLT_ERR(dict):
def __init__(self, log = 'Unknown error', **kwargs):
dict.__init__(self, {'status': 0})
@@ -1078,7 +1067,7 @@ def generate_packet(**user_kwargs):
if ip_tos < 0 or ip_tos > 255:
raise STLError('TOS %s is not in range 0-255' % ip_tos)
l3_layer = IP(tos = ip_tos,
- len = kwargs['l3_length'],
+ #len = kwargs['l3_length'], don't let user create corrupt packets
id = kwargs['ip_id'],
frag = kwargs['ip_fragment_offset'],
ttl = kwargs['ip_ttl'],