diff options
author | Simon Horman <horms@verge.net.au> | 2014-02-20 13:08:51 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2014-02-26 23:53:22 +0900 |
commit | ef8633753f73a01b692a5fe062badd3bad4e15bb (patch) | |
tree | ac51452e2170f8f9fe444d796055b629f32da1e8 | |
parent | 7c96df602398e847c18679cc43c36cdbf37dbcc0 (diff) |
of14: Add OFPQueueDesc
This may be used by queue desc request and reply messages
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r-- | ryu/ofproto/ofproto_v1_4_parser.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/ryu/ofproto/ofproto_v1_4_parser.py b/ryu/ofproto/ofproto_v1_4_parser.py index 6cbcbfeb..0c5d731e 100644 --- a/ryu/ofproto/ofproto_v1_4_parser.py +++ b/ryu/ofproto/ofproto_v1_4_parser.py @@ -1796,6 +1796,28 @@ class OFPTableDesc(StringifyMixin): return ofptabledesc +class OFPQueueDesc(StringifyMixin): + def __init__(self, port_no=None, queue_id=None, len_=None, + properties=None): + super(OFPQueueDesc, self).__init__() + self.port_no = port_no + self.queue_id = queue_id + self.len = len_ + self.properties = properties + + @classmethod + def parser(cls, buf, offset): + (port_no, queue_id, len_) = struct.unpack_from( + ofproto.OFP_QUEUE_DESC_PACK_STR, buf, offset) + props = [] + rest = buf[offset + ofproto.OFP_QUEUE_DESC_SIZE:offset + len_] + while rest: + p, rest = OFPQueueDescProp.parse(rest) + props.append(p) + ofpqueuedesc = cls(port_no, queue_id, len_, props) + return ofpqueuedesc + + def _set_stats_type(stats_type, stats_body_cls): def _set_cls_stats_type(cls): cls.cls_stats_type = stats_type |