diff options
author | Yusuke Iwase <iwase.yusuke0@gmail.com> | 2015-07-22 14:13:43 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-07-22 19:01:01 +0900 |
commit | 142e180b941b0804a0366e8e6331a44f18c3f291 (patch) | |
tree | 2bc4da6485a06ddd2177114d5f4a624cf13e4c4b | |
parent | 3a9559e042f87f387d9027fa8fe02050ad8d1a97 (diff) |
ofproto_v1_5_parser: Add OFPPortDescPropOxm class
This class is parser class for OFPPDPT_PIPELINE_INPUT and
OFPPDPT_PIPELINE_OUTPUT type in Port Description Properties.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r-- | ryu/ofproto/ofproto_v1_5_parser.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/ryu/ofproto/ofproto_v1_5_parser.py b/ryu/ofproto/ofproto_v1_5_parser.py index 525bc618..966c5766 100644 --- a/ryu/ofproto/ofproto_v1_5_parser.py +++ b/ryu/ofproto/ofproto_v1_5_parser.py @@ -1111,6 +1111,29 @@ class OFPPortDescPropOptical(OFPPortDescProp): return optical +@OFPPortDescProp.register_type(ofproto.OFPPDPT_PIPELINE_INPUT) +@OFPPortDescProp.register_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 |