summaryrefslogtreecommitdiffstats
path: root/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_packet_builder_scapy.py
diff options
context:
space:
mode:
authorHanoh Haim <hhaim@cisco.com>2016-02-15 18:01:09 +0200
committerHanoh Haim <hhaim@cisco.com>2016-02-15 18:01:09 +0200
commit1e98c58d91673ae56d4eb0943d619ddb77a21a33 (patch)
treefdc78e2ea1121ecbd5c5626414e0ae5016ebb2f0 /scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_packet_builder_scapy.py
parent0c28aadfe1490c0ec44c94690f4c6d64f2e76e41 (diff)
add scapy layer for default mac
Diffstat (limited to 'scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_packet_builder_scapy.py')
-rw-r--r--scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_packet_builder_scapy.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_packet_builder_scapy.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_packet_builder_scapy.py
index f1462ede..1e2286c5 100644
--- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_packet_builder_scapy.py
+++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_packet_builder_scapy.py
@@ -751,7 +751,21 @@ class CScapyTRexPktBuilder(CTrexPktBuilderInterface):
else:
raise CTRexPacketBuildException(-14, "bad packet" )
-
+ def is_def_src_mac (self):
+ p = self.pkt
+ if isinstance(p, Packet):
+ if isinstance(p,Ether):
+ if 'src' in p.fields :
+ return False
+ return True
+
+ def is_def_dst_mac (self):
+ p = self.pkt
+ if isinstance(p, Packet):
+ if isinstance(p,Ether):
+ if 'dst' in p.fields :
+ return False
+ return True
def compile (self):
self.vm_low_level=CTRexVmEngine()