This may be used by queue desc request and reply messages

Signed-off-by: Simon Horman <[email protected]>
---
 ryu/ofproto/ofproto_v1_4_parser.py | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/ryu/ofproto/ofproto_v1_4_parser.py 
b/ryu/ofproto/ofproto_v1_4_parser.py
index 6cbcbfe..0c5d731 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
-- 
1.8.5.2


------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to