Signed-off-by: FUJITA Tomonori <[email protected]>
---
 ryu/ofproto/ofproto_v1_2_parser.py |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/ryu/ofproto/ofproto_v1_2_parser.py 
b/ryu/ofproto/ofproto_v1_2_parser.py
index 8923ffd..f33bb98 100644
--- a/ryu/ofproto/ofproto_v1_2_parser.py
+++ b/ryu/ofproto/ofproto_v1_2_parser.py
@@ -867,6 +867,7 @@ class Flow(object):
         self.dl_type = 0
         self.vlan_vid = 0
         self.vlan_pcp = 0
+        self.ip_dscp = 0
         self.arp_op = 0
         self.arp_spa = 0
         self.arp_tpa = 0
@@ -938,6 +939,10 @@ class OFPMatch(object):
             self.fields.append(
                 OFPMatchField.make(ofproto_v1_2.OXM_OF_VLAN_PCP))
 
+        if self.wc.ft_test(ofproto_v1_2.OFPXMT_OFB_IP_DSCP):
+            self.fields.append(
+                OFPMatchField.make(ofproto_v1_2.OXM_OF_IP_DSCP))
+
         if self.wc.ft_test(ofproto_v1_2.OFPXMT_OFB_ARP_OP):
             self.fields.append(
                 OFPMatchField.make(ofproto_v1_2.OXM_OF_ARP_OP))
@@ -1036,6 +1041,10 @@ class OFPMatch(object):
         self.wc.ft_set(ofproto_v1_2.OFPXMT_OFB_VLAN_PCP)
         self.flow.vlan_pcp = pcp
 
+    def set_ip_dscp(self, ip_dscp):
+        self.wc.ft_set(ofproto_v1_2.OFPXMT_OFB_IP_DSCP)
+        self.flow.ip_dscp = ip_dscp
+
     def set_arp_opcode(self, arp_op):
         self.wc.ft_set(ofproto_v1_2.OFPXMT_OFB_ARP_OP)
         self.flow.arp_op = arp_op
@@ -1240,6 +1249,19 @@ class MTVlanPcp(OFPMatchField):
         return MTVlanPcp(header)
 
 
[email protected]_field_header([ofproto_v1_2.OXM_OF_IP_DSCP])
+class MTIPDscp(OFPMatchField):
+    def __init__(self, header):
+        super(MTIPDscp, self).__init__(header, '!B')
+
+    def serialize(self, buf, offset, match):
+        self.put(buf, offset, match.flow.ip_dscp)
+
+    @classmethod
+    def parser(cls, header, buf, offset):
+        return MTIPDscp(header)
+
+
 @OFPMatchField.register_field_header([ofproto_v1_2.OXM_OF_ARP_OP])
 class MTArpOp(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

Reply via email to