diff options
author | IWASE Yusuke <iwase.yusuke0@gmail.com> | 2018-03-08 15:40:24 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2018-03-20 22:32:51 +0900 |
commit | a0f90115cc8306435d219923441ea5fda38c9a92 (patch) | |
tree | be0027c33a02dea411727e0a94899b1710c17f2b | |
parent | 684b665290c91d9ac1b1f6f9865506c6a655b1aa (diff) |
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>
-rw-r--r-- | doc/source/nicira_ext_ref.rst | 1 | ||||
-rw-r--r-- | ryu/ofproto/nicira_ext.py | 1 | ||||
-rw-r--r-- | ryu/ofproto/nx_actions.py | 36 |
3 files changed, 38 insertions, 0 deletions
diff --git a/doc/source/nicira_ext_ref.rst b/doc/source/nicira_ext_ref.rst index 739349c4..7ca1b0c7 100644 --- a/doc/source/nicira_ext_ref.rst +++ b/doc/source/nicira_ext_ref.rst @@ -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 diff --git a/ryu/ofproto/nicira_ext.py b/ryu/ofproto/nicira_ext.py index 94f38fc1..4a06b647 100644 --- a/ryu/ofproto/nicira_ext.py +++ b/ryu/ofproto/nicira_ext.py @@ -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 diff --git a/ryu/ofproto/nx_actions.py b/ryu/ofproto/nx_actions.py index 89210070..18dc9210 100644 --- a/ryu/ofproto/nx_actions.py +++ b/ryu/ofproto/nx_actions.py @@ -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: |