ofproto_v1_5_parser: oxm_ids with name str in OFPActionCopyField
Currently, oxm_ids argument of OFPActionCopyField should be a list of OFPOxmId instances, but this patch enables to specify with the OXM field name as the str type value which is corresponding to the keywords of OFPMatch. 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
4602651b2c
commit
870dcab678
|
@ -5948,7 +5948,16 @@ class OFPActionCopyField(OFPAction):
|
||||||
self.n_bits = n_bits
|
self.n_bits = n_bits
|
||||||
self.src_offset = src_offset
|
self.src_offset = src_offset
|
||||||
self.dst_offset = dst_offset
|
self.dst_offset = dst_offset
|
||||||
self.oxm_ids = oxm_ids
|
assert len(oxm_ids) == 2
|
||||||
|
self.oxm_ids = []
|
||||||
|
for i in oxm_ids:
|
||||||
|
if isinstance(i, OFPOxmId):
|
||||||
|
i.hasmask = False # fixup
|
||||||
|
self.oxm_ids.append(i)
|
||||||
|
elif isinstance(i, six.text_type):
|
||||||
|
self.oxm_ids.append(OFPOxmId(i, hasmask=False))
|
||||||
|
else:
|
||||||
|
raise ValueError('invalid value for oxm_ids: %s' % oxm_ids)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def parser(cls, buf, offset):
|
def parser(cls, buf, offset):
|
||||||
|
|
Loading…
Reference in New Issue