summaryrefslogtreecommitdiffstats
path: root/scripts/automation/trex_control_plane/client_utils/packet_builder.py
diff options
context:
space:
mode:
authorDan Klein <danklei@cisco.com>2015-10-20 09:15:52 +0300
committerDan Klein <danklei@cisco.com>2015-10-20 09:15:52 +0300
commit014c1c1757873bbe2b9a9a0d635cb65ea55b67ab (patch)
tree202fe09b0070f962da1e996673d7db21005a94d8 /scripts/automation/trex_control_plane/client_utils/packet_builder.py
parent51ad078182d17b42a36c239c3c21381eeb3eec85 (diff)
parent5abe21ffb26a15c2a63e90b5628d704e8211b599 (diff)
Merge branch 'master-demo'
Diffstat (limited to 'scripts/automation/trex_control_plane/client_utils/packet_builder.py')
-rwxr-xr-xscripts/automation/trex_control_plane/client_utils/packet_builder.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/scripts/automation/trex_control_plane/client_utils/packet_builder.py b/scripts/automation/trex_control_plane/client_utils/packet_builder.py
index c687126b..3aeb6a34 100755
--- a/scripts/automation/trex_control_plane/client_utils/packet_builder.py
+++ b/scripts/automation/trex_control_plane/client_utils/packet_builder.py
@@ -33,6 +33,7 @@ class CTRexPktBuilder(object):
self._max_pkt_size = max_pkt_size
self.payload_gen = CTRexPktBuilder.CTRexPayloadGen(self._packet, self._max_pkt_size)
self.vm = CTRexPktBuilder.CTRexVM()
+ self.metadata = ""
def add_pkt_layer(self, layer_name, pkt_layer):
"""
@@ -441,8 +442,9 @@ class CTRexPktBuilder(object):
if self._packet is None:
raise CTRexPktBuilder.EmptyPacketError()
pkt_in_hex = binascii.hexlify(str(self._packet))
- return [int(pkt_in_hex[i:i+2], 16)
- for i in range(0, len(pkt_in_hex), 2)]
+ return {"binary": [int(pkt_in_hex[i:i+2], 16)
+ for i in range(0, len(pkt_in_hex), 2)],
+ "meta": self.metadata}
# return [pkt_in_hex[i:i+2] for i in range(0, len(pkt_in_hex), 2)]
def dump_pkt_to_pcap(self, file_path, ts=None):
@@ -887,7 +889,7 @@ class CTRexPktBuilder(object):
dictionary holds variable data of VM variable
"""
- return {"ins_name": "flow_var", # VM variable dump always refers to manipulate instruction.
+ return {"type": "flow_var", # VM variable dump always refers to manipulate instruction.
"name": self.name,
"size": self.size,
"op": self.operation,