nicira_ext: Support DEC_NSH_TTL action

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:
IWASE Yusuke 2018-03-08 15:40:24 +09:00 committed by FUJITA Tomonori
parent 684b665290
commit a0f90115cc
3 changed files with 38 additions and 0 deletions

View File

@ -54,6 +54,7 @@ The followings shows the supported NXAction classes in OpenFlow1.0 or later
.. autoclass:: NXActionCT
.. autoclass:: NXActionNAT
.. autoclass:: NXActionOutputTrunc
.. autoclass:: NXActionDecNshTtl
.. autoclass:: NXFlowSpecMatch
.. autoclass:: NXFlowSpecLoad
.. autoclass:: NXFlowSpecOutput

View File

@ -62,6 +62,7 @@ NXAST_NAT = 36
NXAST_CONTROLLER2 = 37
NXAST_SAMPLE2 = 38
NXAST_OUTPUT_TRUNC = 39
NXAST_DEC_NSH_TTL = 48
NX_ACTION_RESUBMIT_PACK_STR = '!HHIHHB3x'
NX_ACTION_RESUBMIT_SIZE = 16

View File

@ -2984,6 +2984,41 @@ def generate(ofp_name, ofpp_name):
self.max_len)
return data
class NXActionDecNshTtl(NXAction):
"""
Decrement NSH TTL action
This action decrements the TTL in the Network Service Header(NSH).
This action was added in OVS v2.9.
And equivalent to the followings action of ovs-ofctl command.
::
dec_nsh_ttl
Example::
actions += [parser.NXActionDecNshTtl()]
"""
_subtype = nicira_ext.NXAST_DEC_NSH_TTL
_fmt_str = '!6x'
def __init__(self,
type_=None, len_=None, vendor=None, subtype=None):
super(NXActionDecNshTtl, self).__init__()
@classmethod
def parser(cls, buf):
return cls()
def serialize_body(self):
data = bytearray()
msg_pack_into(self._fmt_str, data, 0)
return data
def add_attr(k, v):
v.__module__ = ofpp.__name__ # Necessary for stringify stuff
setattr(ofpp, k, v)
@ -3032,6 +3067,7 @@ def generate(ofp_name, ofpp_name):
'NXFlowSpecMatch',
'NXFlowSpecLoad',
'NXFlowSpecOutput',
'NXActionDecNshTtl',
]
vars = locals()
for name in classes: