loxi-prep: rename uses of match fields
diff --git a/src/python/of10/parse.py b/src/python/of10/parse.py
index e56b69a..5c3ce65 100644
--- a/src/python/of10/parse.py
+++ b/src/python/of10/parse.py
@@ -172,13 +172,13 @@
return hdr
map_wc_field_to_match_member = {
- 'OFPFW_DL_VLAN' : 'dl_vlan',
- 'OFPFW_DL_SRC' : 'dl_src',
- 'OFPFW_DL_DST' : 'dl_dst',
- 'OFPFW_DL_TYPE' : 'dl_type',
- 'OFPFW_NW_PROTO' : 'nw_proto',
- 'OFPFW_TP_SRC' : 'tp_src',
- 'OFPFW_TP_DST' : 'tp_dst',
+ 'OFPFW_DL_VLAN' : 'vlan_vid',
+ 'OFPFW_DL_SRC' : 'eth_src',
+ 'OFPFW_DL_DST' : 'eth_dst',
+ 'OFPFW_DL_TYPE' : 'eth_type',
+ 'OFPFW_NW_PROTO' : 'ip_proto',
+ 'OFPFW_TP_SRC' : 'tcp_src',
+ 'OFPFW_TP_DST' : 'tcp_dst',
'OFPFW_NW_SRC_SHIFT' : 'nw_src_shift',
'OFPFW_NW_SRC_BITS' : 'nw_src_bits',
'OFPFW_NW_SRC_MASK' : 'nw_src_mask',
@@ -187,8 +187,8 @@
'OFPFW_NW_DST_BITS' : 'nw_dst_bits',
'OFPFW_NW_DST_MASK' : 'nw_dst_mask',
'OFPFW_NW_DST_ALL' : 'nw_dst_all',
- 'OFPFW_DL_VLAN_PCP' : 'dl_vlan_pcp',
- 'OFPFW_NW_TOS' : 'nw_tos'
+ 'OFPFW_DL_VLAN_PCP' : 'vlan_pcp',
+ 'OFPFW_NW_TOS' : 'ip_dscp'
}
@@ -287,57 +287,57 @@
match = cstruct.ofp_match()
match.wildcards = cstruct.OFPFW_ALL
#@todo Check if packet is other than L2 format
- match.dl_dst = parse_mac(ether.dst)
+ match.eth_dst = parse_mac(ether.dst)
match.wildcards &= ~cstruct.OFPFW_DL_DST
- match.dl_src = parse_mac(ether.src)
+ match.eth_src = parse_mac(ether.src)
match.wildcards &= ~cstruct.OFPFW_DL_SRC
- match.dl_type = ether.type
+ match.eth_type = ether.type
match.wildcards &= ~cstruct.OFPFW_DL_TYPE
if dot1q:
- match.dl_vlan = dot1q.vlan
- match.dl_vlan_pcp = dot1q.prio
- match.dl_type = dot1q.type
+ match.vlan_vid = dot1q.vlan
+ match.vlan_pcp = dot1q.prio
+ match.eth_type = dot1q.type
else:
- match.dl_vlan = cstruct.OFP_VLAN_NONE
- match.dl_vlan_pcp = 0
+ match.vlan_vid = cstruct.OFP_VLAN_NONE
+ match.vlan_pcp = 0
match.wildcards &= ~cstruct.OFPFW_DL_VLAN
match.wildcards &= ~cstruct.OFPFW_DL_VLAN_PCP
if ip:
- match.nw_src = parse_ip(ip.src)
+ match.ipv4_src = parse_ip(ip.src)
match.wildcards &= ~cstruct.OFPFW_NW_SRC_MASK
- match.nw_dst = parse_ip(ip.dst)
+ match.ipv4_dst = parse_ip(ip.dst)
match.wildcards &= ~cstruct.OFPFW_NW_DST_MASK
- match.nw_tos = ip.tos
+ match.ip_dscp = ip.tos
match.wildcards &= ~cstruct.OFPFW_NW_TOS
if tcp:
- match.nw_proto = 6
+ match.ip_proto = 6
match.wildcards &= ~cstruct.OFPFW_NW_PROTO
elif not tcp and udp:
tcp = udp
- match.nw_proto = 17
+ match.ip_proto = 17
match.wildcards &= ~cstruct.OFPFW_NW_PROTO
if tcp:
- match.tp_src = tcp.sport
+ match.tcp_src = tcp.sport
match.wildcards &= ~cstruct.OFPFW_TP_SRC
- match.tp_dst = tcp.dport
+ match.tcp_dst = tcp.dport
match.wildcards &= ~cstruct.OFPFW_TP_DST
if icmp:
- match.nw_proto = 1
- match.tp_src = icmp.type
- match.tp_dst = icmp.code
+ match.ip_proto = 1
+ match.tcp_src = icmp.type
+ match.tcp_dst = icmp.code
match.wildcards &= ~cstruct.OFPFW_NW_PROTO
if arp:
- match.nw_proto = arp.op
+ match.ip_proto = arp.op
match.wildcards &= ~cstruct.OFPFW_NW_PROTO
- match.nw_src = parse_ip(arp.psrc)
+ match.ipv4_src = parse_ip(arp.psrc)
match.wildcards &= ~cstruct.OFPFW_NW_SRC_MASK
- match.nw_dst = parse_ip(arp.pdst)
+ match.ipv4_dst = parse_ip(arp.pdst)
match.wildcards &= ~cstruct.OFPFW_NW_DST_MASK
return match
diff --git a/src/python/oftest/testutils.py b/src/python/oftest/testutils.py
index 90d17ef..1aacf63 100644
--- a/src/python/oftest/testutils.py
+++ b/src/python/oftest/testutils.py
@@ -57,11 +57,11 @@
return 0
def simple_tcp_packet(pktlen=100,
- dl_dst='00:01:02:03:04:05',
- dl_src='00:06:07:08:09:0a',
+ eth_dst='00:01:02:03:04:05',
+ eth_src='00:06:07:08:09:0a',
dl_vlan_enable=False,
- dl_vlan=0,
- dl_vlan_pcp=0,
+ vlan_vid=0,
+ vlan_pcp=0,
dl_vlan_cfi=0,
ip_src='192.168.0.1',
ip_dst='192.168.0.2',
@@ -77,11 +77,11 @@
Supports a few parameters:
@param len Length of packet in bytes w/o CRC
- @param dl_dst Destinatino MAC
- @param dl_src Source MAC
+ @param eth_dst Destinatino MAC
+ @param eth_src Source MAC
@param dl_vlan_enable True if the packet is with vlan, False otherwise
- @param dl_vlan VLAN ID
- @param dl_vlan_pcp VLAN priority
+ @param vlan_vid VLAN ID
+ @param vlan_pcp VLAN priority
@param ip_src IP source
@param ip_dst IP destination
@param ip_tos IP ToS
@@ -99,17 +99,17 @@
# Note Dot1Q.id is really CFI
if (dl_vlan_enable):
- pkt = scapy.Ether(dst=dl_dst, src=dl_src)/ \
- scapy.Dot1Q(prio=dl_vlan_pcp, id=dl_vlan_cfi, vlan=dl_vlan)/ \
+ pkt = scapy.Ether(dst=eth_dst, src=eth_src)/ \
+ scapy.Dot1Q(prio=vlan_pcp, id=dl_vlan_cfi, vlan=vlan_vid)/ \
scapy.IP(src=ip_src, dst=ip_dst, tos=ip_tos, ttl=ip_ttl, ihl=ip_ihl)/ \
scapy.TCP(sport=tcp_sport, dport=tcp_dport)
else:
if not ip_options:
- pkt = scapy.Ether(dst=dl_dst, src=dl_src)/ \
+ pkt = scapy.Ether(dst=eth_dst, src=eth_src)/ \
scapy.IP(src=ip_src, dst=ip_dst, tos=ip_tos, ttl=ip_ttl, ihl=ip_ihl)/ \
scapy.TCP(sport=tcp_sport, dport=tcp_dport)
else:
- pkt = scapy.Ether(dst=dl_dst, src=dl_src)/ \
+ pkt = scapy.Ether(dst=eth_dst, src=eth_src)/ \
scapy.IP(src=ip_src, dst=ip_dst, tos=ip_tos, ttl=ip_ttl, ihl=ip_ihl, options=ip_options)/ \
scapy.TCP(sport=tcp_sport, dport=tcp_dport)
@@ -118,11 +118,11 @@
return pkt
def simple_udp_packet(pktlen=100,
- dl_dst='00:01:02:03:04:05',
- dl_src='00:06:07:08:09:0a',
+ eth_dst='00:01:02:03:04:05',
+ eth_src='00:06:07:08:09:0a',
dl_vlan_enable=False,
- dl_vlan=0,
- dl_vlan_pcp=0,
+ vlan_vid=0,
+ vlan_pcp=0,
dl_vlan_cfi=0,
ip_src='192.168.0.1',
ip_dst='192.168.0.2',
@@ -138,11 +138,11 @@
Supports a few parameters:
@param len Length of packet in bytes w/o CRC
- @param dl_dst Destination MAC
- @param dl_src Source MAC
+ @param eth_dst Destination MAC
+ @param eth_src Source MAC
@param dl_vlan_enable True if the packet is with vlan, False otherwise
- @param dl_vlan VLAN ID
- @param dl_vlan_pcp VLAN priority
+ @param vlan_vid VLAN ID
+ @param vlan_pcp VLAN priority
@param ip_src IP source
@param ip_dst IP destination
@param ip_tos IP ToS
@@ -159,17 +159,17 @@
# Note Dot1Q.id is really CFI
if (dl_vlan_enable):
- pkt = scapy.Ether(dst=dl_dst, src=dl_src)/ \
- scapy.Dot1Q(prio=dl_vlan_pcp, id=dl_vlan_cfi, vlan=dl_vlan)/ \
+ pkt = scapy.Ether(dst=eth_dst, src=eth_src)/ \
+ scapy.Dot1Q(prio=vlan_pcp, id=dl_vlan_cfi, vlan=vlan_vid)/ \
scapy.IP(src=ip_src, dst=ip_dst, tos=ip_tos, ttl=ip_ttl, ihl=ip_ihl)/ \
scapy.UDP(sport=udp_sport, dport=udp_dport)
else:
if not ip_options:
- pkt = scapy.Ether(dst=dl_dst, src=dl_src)/ \
+ pkt = scapy.Ether(dst=eth_dst, src=eth_src)/ \
scapy.IP(src=ip_src, dst=ip_dst, tos=ip_tos, ttl=ip_ttl, ihl=ip_ihl)/ \
scapy.UDP(sport=udp_sport, dport=udp_dport)
else:
- pkt = scapy.Ether(dst=dl_dst, src=dl_src)/ \
+ pkt = scapy.Ether(dst=eth_dst, src=eth_src)/ \
scapy.IP(src=ip_src, dst=ip_dst, tos=ip_tos, ttl=ip_ttl, ihl=ip_ihl, options=ip_options)/ \
scapy.UDP(sport=udp_sport, dport=udp_dport)
@@ -178,11 +178,11 @@
return pkt
def simple_icmp_packet(pktlen=60,
- dl_dst='00:01:02:03:04:05',
- dl_src='00:06:07:08:09:0a',
+ eth_dst='00:01:02:03:04:05',
+ eth_src='00:06:07:08:09:0a',
dl_vlan_enable=False,
- dl_vlan=0,
- dl_vlan_pcp=0,
+ vlan_vid=0,
+ vlan_pcp=0,
ip_src='192.168.0.1',
ip_dst='192.168.0.2',
ip_tos=0,
@@ -195,11 +195,11 @@
Supports a few parameters:
@param len Length of packet in bytes w/o CRC
- @param dl_dst Destinatino MAC
- @param dl_src Source MAC
+ @param eth_dst Destinatino MAC
+ @param eth_src Source MAC
@param dl_vlan_enable True if the packet is with vlan, False otherwise
- @param dl_vlan VLAN ID
- @param dl_vlan_pcp VLAN priority
+ @param vlan_vid VLAN ID
+ @param vlan_pcp VLAN priority
@param ip_src IP source
@param ip_dst IP destination
@param ip_tos IP ToS
@@ -216,12 +216,12 @@
pktlen = MINSIZE
if (dl_vlan_enable):
- pkt = scapy.Ether(dst=dl_dst, src=dl_src)/ \
- scapy.Dot1Q(prio=dl_vlan_pcp, id=0, vlan=dl_vlan)/ \
+ pkt = scapy.Ether(dst=eth_dst, src=eth_src)/ \
+ scapy.Dot1Q(prio=vlan_pcp, id=0, vlan=vlan_vid)/ \
scapy.IP(src=ip_src, dst=ip_dst, ttl=ip_ttl, tos=ip_tos)/ \
scapy.ICMP(type=icmp_type, code=icmp_code)
else:
- pkt = scapy.Ether(dst=dl_dst, src=dl_src)/ \
+ pkt = scapy.Ether(dst=eth_dst, src=eth_src)/ \
scapy.IP(src=ip_src, dst=ip_dst, ttl=ip_ttl, tos=ip_tos)/ \
scapy.ICMP(type=icmp_type, code=icmp_code)
@@ -230,8 +230,8 @@
return pkt
def simple_arp_packet(pktlen=60,
- dl_dst='ff:ff:ff:ff:ff:ff',
- dl_src='00:06:07:08:09:0a',
+ eth_dst='ff:ff:ff:ff:ff:ff',
+ eth_src='00:06:07:08:09:0a',
arp_op=1,
ip_snd='192.168.0.1',
ip_tgt='192.168.0.2',
@@ -243,8 +243,8 @@
Supports a few parameters:
@param len Length of packet in bytes w/o CRC
- @param dl_dst Destinatino MAC
- @param dl_src Source MAC
+ @param eth_dst Destinatino MAC
+ @param eth_src Source MAC
@param arp_op Operation (1=request, 2=reply)
@param ip_snd Sender IP
@param ip_tgt Target IP
@@ -259,7 +259,7 @@
if MINSIZE > pktlen:
pktlen = MINSIZE
- pkt = scapy.Ether(dst=dl_dst, src=dl_src)/ \
+ pkt = scapy.Ether(dst=eth_dst, src=eth_src)/ \
scapy.ARP(hwsrc=hw_snd, hwdst=hw_tgt, pdst=ip_tgt, psrc=ip_snd, op=arp_op)
pkt = pkt/("0" * (pktlen - len(pkt)))
@@ -267,27 +267,27 @@
return pkt
def simple_eth_packet(pktlen=60,
- dl_dst='00:01:02:03:04:05',
- dl_src='01:80:c2:00:00:00',
- dl_type=0x88cc):
+ eth_dst='00:01:02:03:04:05',
+ eth_src='01:80:c2:00:00:00',
+ eth_type=0x88cc):
if MINSIZE > pktlen:
pktlen = MINSIZE
- pkt = scapy.Ether(dst=dl_dst, src=dl_src, type=dl_type)
+ pkt = scapy.Ether(dst=eth_dst, src=eth_src, type=eth_type)
pkt = pkt/("0" * (pktlen - len(pkt)))
return pkt
def qinq_tcp_packet(pktlen=100,
- dl_dst='00:01:02:03:04:05',
- dl_src='00:06:07:08:09:0a',
+ eth_dst='00:01:02:03:04:05',
+ eth_src='00:06:07:08:09:0a',
dl_vlan_outer=20,
dl_vlan_pcp_outer=0,
dl_vlan_cfi_outer=0,
- dl_vlan=10,
- dl_vlan_pcp=0,
+ vlan_vid=10,
+ vlan_pcp=0,
dl_vlan_cfi=0,
ip_src='192.168.0.1',
ip_dst='192.168.0.2',
@@ -303,13 +303,13 @@
Supports a few parameters:
@param len Length of packet in bytes w/o CRC
- @param dl_dst Destinatino MAC
- @param dl_src Source MAC
+ @param eth_dst Destinatino MAC
+ @param eth_src Source MAC
@param dl_vlan_outer Outer VLAN ID
@param dl_vlan_pcp_outer Outer VLAN priority
@param dl_vlan_cfi_outer Outer VLAN cfi bit
- @param dl_vlan Inner VLAN ID
- @param dl_vlan_pcp VLAN priority
+ @param vlan_vid Inner VLAN ID
+ @param vlan_pcp VLAN priority
@param dl_vlan_cfi VLAN cfi bit
@param ip_src IP source
@param ip_dst IP destination
@@ -326,9 +326,9 @@
pktlen = MINSIZE
# Note Dot1Q.id is really CFI
- pkt = scapy.Ether(dst=dl_dst, src=dl_src)/ \
+ pkt = scapy.Ether(dst=eth_dst, src=eth_src)/ \
scapy.Dot1Q(prio=dl_vlan_pcp_outer, id=dl_vlan_cfi_outer, vlan=dl_vlan_outer)/ \
- scapy.Dot1Q(prio=dl_vlan_pcp, id=dl_vlan_cfi, vlan=dl_vlan)/ \
+ scapy.Dot1Q(prio=vlan_pcp, id=dl_vlan_cfi, vlan=vlan_vid)/ \
scapy.IP(src=ip_src, dst=ip_dst, tos=ip_tos, ttl=ip_ttl, ihl=ip_ihl)/ \
scapy.TCP(sport=tcp_sport, dport=tcp_dport)
@@ -500,49 +500,49 @@
parent.assertEqual(req_match.in_port, res_match.in_port,
'Match failed: in_port: ' + str(req_match.in_port) +
" != " + str(res_match.in_port))
- parent.assertEqual(str(req_match.dl_src), str(res_match.dl_src),
- 'Match failed: dl_src: ' + str(req_match.dl_src) +
- " != " + str(res_match.dl_src))
- parent.assertEqual(str(req_match.dl_dst), str(res_match.dl_dst),
- 'Match failed: dl_dst: ' + str(req_match.dl_dst) +
- " != " + str(res_match.dl_dst))
- parent.assertEqual(req_match.dl_vlan, res_match.dl_vlan,
- 'Match failed: dl_vlan: ' + str(req_match.dl_vlan) +
- " != " + str(res_match.dl_vlan))
- parent.assertEqual(req_match.dl_vlan_pcp, res_match.dl_vlan_pcp,
- 'Match failed: dl_vlan_pcp: ' +
- str(req_match.dl_vlan_pcp) + " != " +
- str(res_match.dl_vlan_pcp))
- parent.assertEqual(req_match.dl_type, res_match.dl_type,
- 'Match failed: dl_type: ' + str(req_match.dl_type) +
- " != " + str(res_match.dl_type))
+ parent.assertEqual(str(req_match.eth_src), str(res_match.eth_src),
+ 'Match failed: eth_src: ' + str(req_match.eth_src) +
+ " != " + str(res_match.eth_src))
+ parent.assertEqual(str(req_match.eth_dst), str(res_match.eth_dst),
+ 'Match failed: eth_dst: ' + str(req_match.eth_dst) +
+ " != " + str(res_match.eth_dst))
+ parent.assertEqual(req_match.vlan_vid, res_match.vlan_vid,
+ 'Match failed: vlan_vid: ' + str(req_match.vlan_vid) +
+ " != " + str(res_match.vlan_vid))
+ parent.assertEqual(req_match.vlan_pcp, res_match.vlan_pcp,
+ 'Match failed: vlan_pcp: ' +
+ str(req_match.vlan_pcp) + " != " +
+ str(res_match.vlan_pcp))
+ parent.assertEqual(req_match.eth_type, res_match.eth_type,
+ 'Match failed: eth_type: ' + str(req_match.eth_type) +
+ " != " + str(res_match.eth_type))
if (not(req_match.wildcards & of10.OFPFW_DL_TYPE)
- and (req_match.dl_type == IP_ETHERTYPE)):
- parent.assertEqual(req_match.nw_tos, res_match.nw_tos,
- 'Match failed: nw_tos: ' + str(req_match.nw_tos) +
- " != " + str(res_match.nw_tos))
- parent.assertEqual(req_match.nw_proto, res_match.nw_proto,
- 'Match failed: nw_proto: ' + str(req_match.nw_proto) +
- " != " + str(res_match.nw_proto))
- parent.assertEqual(req_match.nw_src, res_match.nw_src,
- 'Match failed: nw_src: ' + str(req_match.nw_src) +
- " != " + str(res_match.nw_src))
- parent.assertEqual(req_match.nw_dst, res_match.nw_dst,
- 'Match failed: nw_dst: ' + str(req_match.nw_dst) +
- " != " + str(res_match.nw_dst))
+ and (req_match.eth_type == IP_ETHERTYPE)):
+ parent.assertEqual(req_match.ip_dscp, res_match.ip_dscp,
+ 'Match failed: ip_dscp: ' + str(req_match.ip_dscp) +
+ " != " + str(res_match.ip_dscp))
+ parent.assertEqual(req_match.ip_proto, res_match.ip_proto,
+ 'Match failed: ip_proto: ' + str(req_match.ip_proto) +
+ " != " + str(res_match.ip_proto))
+ parent.assertEqual(req_match.ipv4_src, res_match.ipv4_src,
+ 'Match failed: ipv4_src: ' + str(req_match.ipv4_src) +
+ " != " + str(res_match.ipv4_src))
+ parent.assertEqual(req_match.ipv4_dst, res_match.ipv4_dst,
+ 'Match failed: ipv4_dst: ' + str(req_match.ipv4_dst) +
+ " != " + str(res_match.ipv4_dst))
if (not(req_match.wildcards & of10.OFPFW_NW_PROTO)
- and ((req_match.nw_proto == TCP_PROTOCOL)
- or (req_match.nw_proto == UDP_PROTOCOL))):
- parent.assertEqual(req_match.tp_src, res_match.tp_src,
- 'Match failed: tp_src: ' +
- str(req_match.tp_src) +
- " != " + str(res_match.tp_src))
- parent.assertEqual(req_match.tp_dst, res_match.tp_dst,
- 'Match failed: tp_dst: ' +
- str(req_match.tp_dst) +
- " != " + str(res_match.tp_dst))
+ and ((req_match.ip_proto == TCP_PROTOCOL)
+ or (req_match.ip_proto == UDP_PROTOCOL))):
+ parent.assertEqual(req_match.tcp_src, res_match.tcp_src,
+ 'Match failed: tcp_src: ' +
+ str(req_match.tcp_src) +
+ " != " + str(res_match.tcp_src))
+ parent.assertEqual(req_match.tcp_dst, res_match.tcp_dst,
+ 'Match failed: tcp_dst: ' +
+ str(req_match.tcp_dst) +
+ " != " + str(res_match.tcp_dst))
def packet_to_flow_match(parent, packet):
match = of10.parse.packet_to_flow_match(packet)
@@ -627,7 +627,7 @@
do_barrier(parent.controller)
def flow_match_test_port_pair(parent, ing_port, egr_ports, wildcards=None,
- dl_vlan=-1, pkt=None, exp_pkt=None,
+ vlan_vid=-1, pkt=None, exp_pkt=None,
action_list=None):
"""
Flow match test on single TCP packet
@@ -641,9 +641,9 @@
wildcards = required_wildcards(parent)
logging.info("Pkt match test: " + str(ing_port) + " to " +
str(egr_ports))
- logging.debug(" WC: " + hex(wildcards) + " vlan: " + str(dl_vlan))
+ logging.debug(" WC: " + hex(wildcards) + " vlan: " + str(vlan_vid))
if pkt is None:
- pkt = simple_tcp_packet(dl_vlan_enable=(dl_vlan >= 0), dl_vlan=dl_vlan)
+ pkt = simple_tcp_packet(dl_vlan_enable=(vlan_vid >= 0), vlan_vid=vlan_vid)
request = flow_msg_create(parent, pkt, ing_port=ing_port,
wildcards=wildcards, egr_ports=egr_ports,
@@ -660,7 +660,7 @@
receive_pkt_verify(parent, egr_ports, exp_pkt, ing_port)
def flow_match_test_pktout(parent, ing_port, egr_ports,
- dl_vlan=-1, pkt=None, exp_pkt=None,
+ vlan_vid=-1, pkt=None, exp_pkt=None,
action_list=None):
"""
Packet-out test on single TCP packet
@@ -672,7 +672,7 @@
"""
if pkt is None:
- pkt = simple_tcp_packet(dl_vlan_enable=(dl_vlan >= 0), dl_vlan=dl_vlan)
+ pkt = simple_tcp_packet(dl_vlan_enable=(vlan_vid >= 0), vlan_vid=vlan_vid)
msg = of10.message.packet_out()
msg.in_port = ing_port
@@ -719,7 +719,7 @@
logging.debug("Could not generate enough egress ports for test")
return []
-def flow_match_test(parent, port_map, wildcards=None, dl_vlan=-1, pkt=None,
+def flow_match_test(parent, port_map, wildcards=None, vlan_vid=-1, pkt=None,
exp_pkt=None, action_list=None,
max_test=0, egr_count=1, ing_port=False):
"""
@@ -730,7 +730,7 @@
and logging
@param pkt If not None, use this packet for ingress
@param wildcards For flow match entry
- @param dl_vlan If not -1, and pkt is None, create a pkt w/ VLAN tag
+ @param vlan_vid If not -1, and pkt is None, create a pkt w/ VLAN tag
@param exp_pkt If not None, use this as the expected output pkt; els use pkt
@param action_list Additional actions to add to flow mod
@param egr_count Number of egress ports; -1 means get from config w/ dflt 2
@@ -755,7 +755,7 @@
parent.assertTrue(0, "Failed to generate egress port list")
flow_match_test_port_pair(parent, ingress_port, egr_ports,
- wildcards=wildcards, dl_vlan=dl_vlan,
+ wildcards=wildcards, vlan_vid=vlan_vid,
pkt=pkt, exp_pkt=exp_pkt,
action_list=action_list)
test_count += 1
@@ -772,7 +772,7 @@
if ing_port:
egr_ports.append(of10.OFPP_IN_PORT)
flow_match_test_pktout(parent, ingress_port, egr_ports,
- dl_vlan=dl_vlan,
+ vlan_vid=vlan_vid,
pkt=pkt, exp_pkt=exp_pkt,
action_list=action_list)
@@ -816,23 +816,23 @@
if field_to_mod in ['pktlen']:
return None
- if field_to_mod == 'dl_dst':
+ if field_to_mod == 'eth_dst':
act = of10.action.action_set_dl_dst()
- act.dl_addr = of10.parse.parse_mac(mod_field_vals['dl_dst'])
- elif field_to_mod == 'dl_src':
+ act.dl_addr = of10.parse.parse_mac(mod_field_vals['eth_dst'])
+ elif field_to_mod == 'eth_src':
act = of10.action.action_set_dl_src()
- act.dl_addr = of10.parse.parse_mac(mod_field_vals['dl_src'])
+ act.dl_addr = of10.parse.parse_mac(mod_field_vals['eth_src'])
elif field_to_mod == 'dl_vlan_enable':
if not mod_field_vals['dl_vlan_enable']: # Strip VLAN tag
act = of10.action.action_strip_vlan()
- # Add VLAN tag is handled by dl_vlan field
+ # Add VLAN tag is handled by vlan_vid field
# Will return None in this case
- elif field_to_mod == 'dl_vlan':
+ elif field_to_mod == 'vlan_vid':
act = of10.action.action_set_vlan_vid()
- act.vlan_vid = mod_field_vals['dl_vlan']
- elif field_to_mod == 'dl_vlan_pcp':
+ act.vlan_vid = mod_field_vals['vlan_vid']
+ elif field_to_mod == 'vlan_pcp':
act = of10.action.action_set_vlan_pcp()
- act.vlan_pcp = mod_field_vals['dl_vlan_pcp']
+ act.vlan_pcp = mod_field_vals['vlan_pcp']
elif field_to_mod == 'ip_src':
act = of10.action.action_set_nw_src()
act.nw_addr = of10.parse.parse_ip(mod_field_vals['ip_src'])
@@ -878,11 +878,11 @@
base_pkt_params = {}
base_pkt_params['pktlen'] = 100
- base_pkt_params['dl_dst'] = '00:DE:F0:12:34:56'
- base_pkt_params['dl_src'] = '00:23:45:67:89:AB'
+ base_pkt_params['eth_dst'] = '00:DE:F0:12:34:56'
+ base_pkt_params['eth_src'] = '00:23:45:67:89:AB'
base_pkt_params['dl_vlan_enable'] = False
- base_pkt_params['dl_vlan'] = 2
- base_pkt_params['dl_vlan_pcp'] = 0
+ base_pkt_params['vlan_vid'] = 2
+ base_pkt_params['vlan_pcp'] = 0
base_pkt_params['ip_src'] = '192.168.0.1'
base_pkt_params['ip_dst'] = '192.168.0.2'
base_pkt_params['ip_tos'] = 0
@@ -897,11 +897,11 @@
mod_pkt_params = {}
mod_pkt_params['pktlen'] = 100
- mod_pkt_params['dl_dst'] = '00:21:0F:ED:CB:A9'
- mod_pkt_params['dl_src'] = '00:ED:CB:A9:87:65'
+ mod_pkt_params['eth_dst'] = '00:21:0F:ED:CB:A9'
+ mod_pkt_params['eth_src'] = '00:ED:CB:A9:87:65'
mod_pkt_params['dl_vlan_enable'] = False
- mod_pkt_params['dl_vlan'] = 3
- mod_pkt_params['dl_vlan_pcp'] = 7
+ mod_pkt_params['vlan_vid'] = 3
+ mod_pkt_params['vlan_pcp'] = 7
mod_pkt_params['ip_src'] = '10.20.30.40'
mod_pkt_params['ip_dst'] = '50.60.70.80'
mod_pkt_params['ip_tos'] = 0xf0
@@ -926,9 +926,9 @@
if vid:
base_pkt_params['dl_vlan_enable'] = True
- base_pkt_params['dl_vlan'] = vid
- if 'dl_vlan' in mod_fields:
- mod_pkt_params['dl_vlan'] = vid + 1
+ base_pkt_params['vlan_vid'] = vid
+ if 'vlan_vid' in mod_fields:
+ mod_pkt_params['vlan_vid'] = vid + 1
if add_vlan:
base_pkt_params['dl_vlan_enable'] = False
@@ -936,8 +936,8 @@
mod_pkt_params['pktlen'] = base_pkt_params['pktlen'] + 4
mod_fields.append('pktlen')
mod_fields.append('dl_vlan_enable')
- if 'dl_vlan' not in mod_fields:
- mod_fields.append('dl_vlan')
+ if 'vlan_vid' not in mod_fields:
+ mod_fields.append('vlan_vid')
elif strip_vlan:
base_pkt_params['dl_vlan_enable'] = True
mod_pkt_params['dl_vlan_enable'] = False