From 2a0d6862d2daf6fe79d555a09ce54b474c5d84c5 Mon Sep 17 00:00:00 2001 From: Yusuke Iwase Date: Wed, 19 Aug 2015 10:21:31 +0900 Subject: ofproto_v1_5_parser: Add OFPControllerStatusProp support 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 Signed-off-by: FUJITA Tomonori --- 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 ba593b8e..defbe8eb 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): """ -- cgit v1.2.3