summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorHanoh Haim <hhaim@cisco.com>2016-02-14 11:54:01 +0200
committerHanoh Haim <hhaim@cisco.com>2016-02-14 11:54:01 +0200
commit86bfcbf7695fe301671bd01d426ff181e2206653 (patch)
tree91505a6028e5d4fa39d642976fb1ad65c198db6b /scripts
parent1c288332c54dafca2187f09f58c48301326adf71 (diff)
remove mcast mac-addr from example
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/cfg/cfg_example1.yaml16
-rwxr-xr-xscripts/cfg/cfg_example2.yaml26
-rw-r--r--scripts/exp/udp_1pkt_ipv6_in_ipv4.pcapbin0 -> 1894 bytes
-rw-r--r--scripts/stl/udp_1pkt_ipv6_in_ipv4.py35
4 files changed, 56 insertions, 21 deletions
diff --git a/scripts/cfg/cfg_example1.yaml b/scripts/cfg/cfg_example1.yaml
index f46db6ee..a2711d31 100755
--- a/scripts/cfg/cfg_example1.yaml
+++ b/scripts/cfg/cfg_example1.yaml
@@ -13,14 +13,14 @@
threads : [8,9,10,11]
port_info : # set eh mac addr
- - dest_mac : [1,0x0,0x0,0x1,0x0,0x00] # port 0
- src_mac : [0x2,0x0,0x0,0x2,0x0,0x00]
- - dest_mac : [0x3,0x0,0x0,0x3,0x0,0x00] # port 1
- src_mac : [0x4,0x0,0x0,0x4,0x0,0x00]
- - dest_mac : [0x5,0x0,0x0,0x5,0x0,0x00] # port 2
- src_mac : [0x6,0x0,0x0,0x6,0x0,0x00]
- - dest_mac : [0x7,0x0,0x0,0x7,0x0,0x01] # port 3
- src_mac : [0x0,0x0,0x0,0x8,0x0,0x02]
+ - dest_mac : [0x0,0x0,0x0,0x1,0x0,0x00] # port 0
+ src_mac : [0x0,0x0,0x0,0x2,0x0,0x00]
+ - dest_mac : [0x0,0x0,0x0,0x2,0x0,0x00] # port 1
+ src_mac : [0x0,0x0,0x0,0x1,0x0,0x00]
+ - dest_mac : [0x0,0x0,0x0,0x5,0x0,0x00] # port 2
+ src_mac : [0x0,0x0,0x0,0x6,0x0,0x00]
+ - dest_mac : [0x0,0x0,0x0,0x6,0x0,0x01] # port 3
+ src_mac : [0x0,0x0,0x0,0x5,0x0,0x02]
- dest_mac : [0x0,0x0,0x0,0x9,0x0,0x03] # port 4
src_mac : [0x0,0x0,0x0,0xa,0x0,0x04]
- dest_mac : [0x0,0x0,0x0,0xb,0x0,0x05] # port 5
diff --git a/scripts/cfg/cfg_example2.yaml b/scripts/cfg/cfg_example2.yaml
index a381fb2f..d9797bf4 100755
--- a/scripts/cfg/cfg_example2.yaml
+++ b/scripts/cfg/cfg_example2.yaml
@@ -6,21 +6,21 @@
zmq_pub_port : 4500
telnet_port : 4501 # the telnet port in case it is enable ( with intercative mode )
port_info : # set eh mac addr
- - dest_mac : [0x1,0x0,0x0,0x1,0x0,0x00] # port 0
- src_mac : [0x2,0x0,0x0,0x2,0x0,0x00]
- - dest_mac : [0x3,0x0,0x0,0x3,0x0,0x00] # port 1
- src_mac : [0x4,0x0,0x0,0x4,0x0,0x00]
- - dest_mac : [0x5,0x0,0x0,0x5,0x0,0x00] # port 2
- src_mac : [0x6,0x0,0x0,0x6,0x0,0x00]
- - dest_mac : [0x7,0x0,0x0,0x7,0x0,0x01] # port 3
- src_mac : [0x0,0x0,0x0,0x8,0x0,0x02]
+ - dest_mac : [0x0,0x0,0x0,0x1,0x0,0x00] # port 0
+ src_mac : [0x0,0x0,0x0,0x2,0x0,0x00]
+ - dest_mac : [0x0,0x0,0x0,0x2,0x0,0x00] # port 1
+ src_mac : [0x0,0x0,0x0,0x1,0x0,0x00]
+ - dest_mac : [0x0,0x0,0x0,0x5,0x0,0x00] # port 2
+ src_mac : [0x0,0x0,0x0,0x6,0x0,0x00]
+ - dest_mac : [0x0,0x0,0x0,0x6,0x0,0x01] # port 3
+ src_mac : [0x0,0x0,0x0,0x5,0x0,0x02]
- dest_mac : [0x0,0x0,0x0,0x9,0x0,0x03] # port 4
src_mac : [0x0,0x0,0x0,0xa,0x0,0x04]
- - dest_mac : [0x0,0x0,0x0,0xb,0x0,0x05] # port 5
- src_mac : [0x0,0x0,0x0,0xc,0x0,0x06]
+ - dest_mac : [0x0,0x0,0x0,0xa,0x0,0x05] # port 5
+ src_mac : [0x0,0x0,0x0,0x9,0x0,0x06]
- dest_mac : [0x0,0x0,0x0,0xd,0x0,0x07] # port 6
- src_mac : [0x0,0x0,0x0,0xa,0x0,0x08]
- - dest_mac : [0x0,0x0,0x0,0xb,0x0,0x09] # port 7
- src_mac : [0x0,0x0,0x0,0xc,0x0,0x0a]
+ src_mac : [0x0,0x0,0x0,0xe,0x0,0x08]
+ - dest_mac : [0x0,0x0,0x0,0xe,0x0,0x09] # port 7
+ src_mac : [0x0,0x0,0x0,0xd,0x0,0x0a]
diff --git a/scripts/exp/udp_1pkt_ipv6_in_ipv4.pcap b/scripts/exp/udp_1pkt_ipv6_in_ipv4.pcap
new file mode 100644
index 00000000..a46888e9
--- /dev/null
+++ b/scripts/exp/udp_1pkt_ipv6_in_ipv4.pcap
Binary files differ
diff --git a/scripts/stl/udp_1pkt_ipv6_in_ipv4.py b/scripts/stl/udp_1pkt_ipv6_in_ipv4.py
new file mode 100644
index 00000000..6f0eff26
--- /dev/null
+++ b/scripts/stl/udp_1pkt_ipv6_in_ipv4.py
@@ -0,0 +1,35 @@
+from trex_stl_lib.api import *
+
+
+class STLS1(object):
+
+ def create_stream (self):
+ # Teredo Ipv6 over Ipv4
+ pkt = Ether()/IP(src="16.0.0.1",dst="48.0.0.1")/UDP(dport=3797,sport=3544)/IPv6(dst="2001:0:4137:9350:8000:f12a:b9c8:2815",src="2001:4860:0:2001::68")/UDP(dport=12,sport=1025)/ICMPv6Unknown()
+
+ vm = CTRexScRaw( [
+ # tuple gen for inner Ipv6
+ STLVmTupleGen ( ip_min="16.0.0.1", ip_max="16.0.0.2",
+ port_min=1025, port_max=65535,
+ name="tuple"), # define tuple gen
+
+ STLVmWrFlowVar (fv_name="tuple.ip", pkt_offset= "IPv6.src",offset_fixup=12 ), # write ip to packet IPv6.src to LSB
+ STLVmWrFlowVar (fv_name="tuple.port", pkt_offset= "UDP:1.sport" ) #write udp.port (after ipv6)
+ ]
+ )
+
+ # burst of 100 packets
+ return STLStream(packet = STLPktBuilder(pkt = pkt ,vm = vm),
+ mode = STLTXSingleBurst( pps = 1, total_pkts = 17) )
+
+
+ def get_streams (self, direction = 0):
+ # create 1 stream
+ return [ self.create_stream() ]
+
+def register():
+ return STLS1()
+
+
+
+