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>
This commit is contained in:
parent
3a9559e042
commit
142e180b94
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user