Signed-off-by: IWASE Yusuke <iwase.yusu...@gmail.com>
---
 doc/source/nicira_ext_ref.rst |  1 +
 ryu/ofproto/nicira_ext.py     |  1 +
 ryu/ofproto/nx_actions.py     | 36 ++++++++++++++++++++++++++++++++++++
 3 files changed, 38 insertions(+)

diff --git a/doc/source/nicira_ext_ref.rst b/doc/source/nicira_ext_ref.rst
index 739349c..7ca1b0c 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 94f38fc..4a06b64 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 8921007..18dc921 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:
-- 
2.7.4


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Ryu-devel mailing list
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to