This class is parser class for OFPPDPT_PIPELINE_INPUT and
OFPPDPT_PIPELINE_OUTPUT type in Port Description Properties.

Signed-off-by: IWASE Yusuke <[email protected]>
---
 ryu/ofproto/ofproto_v1_5_parser.py | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/ryu/ofproto/ofproto_v1_5_parser.py 
b/ryu/ofproto/ofproto_v1_5_parser.py
index 4289da0..bc83a30 100644
--- a/ryu/ofproto/ofproto_v1_5_parser.py
+++ b/ryu/ofproto/ofproto_v1_5_parser.py
@@ -969,6 +969,29 @@ class OFPPortDescPropOptical(OFPPortDescProp):
         return optical
 
 
[email protected]_type(ofproto.OFPPDPT_PIPELINE_INPUT)
[email protected]_type(ofproto.OFPPDPT_PIPELINE_OUTPUT)
+class OFPPortDescPropOxm(OFPPortDescProp):
+    def __init__(self, type_=None, length=None, oxm_ids=[]):
+        super(OFPPortDescPropOxm, self).__init__(type_, length)
+        self.oxm_ids = oxm_ids
+
+    @classmethod
+    def parser(cls, buf):
+        rest = cls.get_rest(buf)
+        ids = []
+        while rest:
+            i, rest = OFPOxmId.parse(rest)
+            ids.append(i)
+        return cls(oxm_ids=ids)
+
+    def serialize_body(self):
+        bin_ids = bytearray()
+        for i in self.oxm_ids:
+            bin_ids += i.serialize()
+        return bin_ids
+
+
 @OFPPortDescProp.register_type(ofproto.OFPPDPT_EXPERIMENTER)
 class OFPPortDescPropExperimenter(OFPPropCommonExperimenter4ByteData):
     pass
-- 
1.9.1



------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to