OpenFlow Spec 1.5 introduces controller status property to describe
additional controller status information.

This patch add controller status property support.

Signed-off-by: IWASE Yusuke <iwase.yusu...@gmail.com>
---
 ryu/ofproto/ofproto_v1_5_parser.py | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/ryu/ofproto/ofproto_v1_5_parser.py 
b/ryu/ofproto/ofproto_v1_5_parser.py
index ba593b8..defbe8e 100644
--- a/ryu/ofproto/ofproto_v1_5_parser.py
+++ b/ryu/ofproto/ofproto_v1_5_parser.py
@@ -5228,6 +5228,35 @@ class OFPRequestForward(MsgInMsgBase):
         self.buf += self.request.buf
 
 
+class OFPControllerStatusProp(OFPPropBase):
+    _TYPES = {}
+
+
+@OFPControllerStatusProp.register_type(ofproto.OFPCSPT_URI)
+class OFPControllerStatusPropUri(OFPControllerStatusProp):
+    _TYPE = {
+        'ascii': [
+            'uri',
+        ]
+    }
+
+    def __init__(self, type_=None, length=None, uri=None):
+        super(OFPControllerStatusPropUri, self).__init__(type_, length)
+        self.uri = uri
+
+    @classmethod
+    def parser(cls, buf):
+        rest = cls.get_rest(buf)
+        pack_str = '!%ds' % len(rest)
+        (uri, ) = struct.unpack_from(pack_str, rest, 0)
+        return cls(uri=uri)
+
+
+@OFPControllerStatusProp.register_type(ofproto.OFPCSPT_EXPERIMENTER)
+class OFPControllerStatusPropExperimenter(OFPPropCommonExperimenter4ByteData):
+    pass
+
+
 @_set_msg_type(ofproto.OFPT_PACKET_OUT)
 class OFPPacketOut(MsgBase):
     """
-- 
1.9.1



------------------------------------------------------------------------------
_______________________________________________
Ryu-devel mailing list
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to