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

diff --git a/ryu/ofproto/ofproto_v1_2_parser.py 
b/ryu/ofproto/ofproto_v1_2_parser.py
index 2a6b748..cd21eab 100644
--- a/ryu/ofproto/ofproto_v1_2_parser.py
+++ b/ryu/ofproto/ofproto_v1_2_parser.py
@@ -876,6 +876,8 @@ class Flow(object):
         self.tcp_dst = 0
         self.udp_src = 0
         self.udp_dst = 0
+        self.sctp_src = 0
+        self.sctp_dst = 0
         self.arp_op = 0
         self.arp_spa = 0
         self.arp_tpa = 0
@@ -993,6 +995,14 @@ class OFPMatch(object):
             self.fields.append(
                 OFPMatchField.make(ofproto_v1_2.OXM_OF_UDP_DST))
 
+        if self.wc.ft_test(ofproto_v1_2.OFPXMT_OFB_SCTP_SRC):
+            self.fields.append(
+                OFPMatchField.make(ofproto_v1_2.OXM_OF_SCTP_SRC))
+
+        if self.wc.ft_test(ofproto_v1_2.OFPXMT_OFB_SCTP_DST):
+            self.fields.append(
+                OFPMatchField.make(ofproto_v1_2.OXM_OF_SCTP_DST))
+
         if self.wc.ft_test(ofproto_v1_2.OFPXMT_OFB_ARP_OP):
             self.fields.append(
                 OFPMatchField.make(ofproto_v1_2.OXM_OF_ARP_OP))
@@ -1135,6 +1145,14 @@ class OFPMatch(object):
         self.wc.ft_set(ofproto_v1_2.OFPXMT_OFB_UDP_DST)
         self.flow.udp_dst = udp_dst
 
+    def set_sctp_src(self, sctp_src):
+        self.wc.ft_set(ofproto_v1_2.OFPXMT_OFB_SCTP_SRC)
+        self.flow.sctp_src = sctp_src
+
+    def set_sctp_dst(self, sctp_dst):
+        self.wc.ft_set(ofproto_v1_2.OFPXMT_OFB_SCTP_DST)
+        self.flow.sctp_dst = sctp_dst
+
     def set_arp_opcode(self, arp_op):
         self.wc.ft_set(ofproto_v1_2.OFPXMT_OFB_ARP_OP)
         self.flow.arp_op = arp_op
@@ -1466,6 +1484,32 @@ class MTUDPDst(OFPMatchField):
         return MTUDPDst(header)
 
 
[email protected]_field_header([ofproto_v1_2.OXM_OF_SCTP_SRC])
+class MTSCTPSrc(OFPMatchField):
+    def __init__(self, header):
+        super(MTSCTPSrc, self).__init__(header, '!H')
+
+    def serialize(self, buf, offset, match):
+        self.put(buf, offset, match.flow.sctp_src)
+
+    @classmethod
+    def parser(cls, header, buf, offset):
+        return MTSCTPSrc(header)
+
+
[email protected]_field_header([ofproto_v1_2.OXM_OF_SCTP_DST])
+class MTSCTPDst(OFPMatchField):
+    def __init__(self, header):
+        super(MTSCTPDst, self).__init__(header, '!H')
+
+    def serialize(self, buf, offset, match):
+        self.put(buf, offset, match.flow.sctp_dst)
+
+    @classmethod
+    def parser(cls, header, buf, offset):
+        return MTSCTPDst(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