summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--doc/source/nicira_ext_ref.rst1
-rw-r--r--ryu/ofproto/nicira_ext.py1
-rw-r--r--ryu/ofproto/nx_actions.py36
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: