Signed-off-by: FUJITA Tomonori <[email protected]>
---
ryu/ofproto/ofproto_v1_2_parser.py | 37 ++++++++++++++++++++++++++++++++++++
1 files changed, 37 insertions(+), 0 deletions(-)
diff --git a/ryu/ofproto/ofproto_v1_2_parser.py
b/ryu/ofproto/ofproto_v1_2_parser.py
index 076979f..8281f50 100644
--- a/ryu/ofproto/ofproto_v1_2_parser.py
+++ b/ryu/ofproto/ofproto_v1_2_parser.py
@@ -939,6 +939,7 @@ class Flow(object):
self.arp_tha = 0
self.ipv6_src = []
self.ipv6_dst = []
+ self.ipv6_flabel = 0
self.mpls_lable = 0
self.mpls_tc = 0
@@ -956,6 +957,7 @@ class FlowWildcards(object):
self.arp_tha_mask = 0
self.ipv6_src_mask = []
self.ipv6_dst_mask = []
+ self.ipv6_flabel_mask = 0
self.wildcards = (1 << 64) - 1
def ft_set(self, shift):
@@ -1105,6 +1107,14 @@ class OFPMatch(object):
self.fields.append(
OFPMatchField.make(ofproto_v1_2.OXM_OF_IPV6_DST))
+ if self.wc.ft_test(ofproto_v1_2.OFPXMT_OFB_IPV6_FLABEL):
+ if self.wc.ipv6_flabel_mask:
+ self.fields.append(
+ OFPMatchField.make(ofproto_v1_2.OXM_OF_IPV6_FLABEL_W))
+ else:
+ self.fields.append(
+ OFPMatchField.make(ofproto_v1_2.OXM_OF_IPV6_FLABEL))
+
if self.wc.ft_test(ofproto_v1_2.OFPXMT_OFB_MPLS_LABEL):
self.fields.append(
OFPMatchField.make(ofproto_v1_2.OXM_OF_MPLS_LABEL))
@@ -1301,6 +1311,15 @@ class OFPMatch(object):
self.wc.ipv6_dst_mask = mask
self.flow.ipv6_dst = [x & y for (x, y) in itertools.izip(dst, mask)]
+ def set_ipv6_flabel(self, flabel):
+ self.wc.ft_set(ofproto_v1_2.OFPXMT_OFB_IPV6_FLABEL)
+ self.flow.ipv6_flabel = flabel
+
+ def set_ipv6_flabel_masked(self, flabel, mask):
+ self.wc.ft_set(ofproto_v1_2.OFPXMT_OFB_IPV6_FLABEL)
+ self.wc.ipv6_flabel_mask = mask
+ self.flow.ipv6_flabel = flabel
+
def set_mpls_label(self, mpls_label):
self.wc.ft_set(ofproto_v1_2.OFPXMT_OFB_MPLS_LABEL)
self.flow.mpls_label = mpls_label
@@ -1772,6 +1791,24 @@ class MTIPv6Dst(OFPMatchField):
return MTIPv6Dst(header)
[email protected]_field_header([ofproto_v1_2.OXM_OF_IPV6_FLABEL,
+ ofproto_v1_2.OXM_OF_IPV6_FLABEL_W])
+class MTIPv6Flabel(OFPMatchField):
+ def __init__(self, header):
+ super(MTIPv6Flabel, self).__init__(header, '!I')
+
+ def serialize(self, buf, offset, match):
+ if self.header == ofproto_v1_2.OXM_OF_IPV6_FLABEL_W:
+ self.put_w(buf, offset, match.flow.ipv6_flabel,
+ match.wc.ipv6_flabel_mask)
+ else:
+ self.put(buf, offset, match.flow.ipv6_flabel)
+
+ @classmethod
+ def parser(cls, header, buf, offset):
+ return MTIPv6Flabel(header)
+
+
@OFPMatchField.register_field_header([ofproto_v1_2.OXM_OF_MPLS_LABEL])
class MTMplsLabel(OFPMatchField):
def __init__(self, header):
--
1.7.4.4
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel