Note: It wasn't clear to me which NXM stands for "Extensible" or
"Extended".  I chose the latter because it's in the primary
specification.  (nicira-ext.h)

Signed-off-by: YAMAMOTO Takashi <[email protected]>
---
 ryu/ofproto/oxm_fields.py | 27 +++++++++++++++++++++++----
 1 file changed, 23 insertions(+), 4 deletions(-)

diff --git a/ryu/ofproto/oxm_fields.py b/ryu/ofproto/oxm_fields.py
index 4aa390e..15f351c 100644
--- a/ryu/ofproto/oxm_fields.py
+++ b/ryu/ofproto/oxm_fields.py
@@ -87,6 +87,8 @@ class UnknownType(TypeDescr):
     from_user = staticmethod(base64.b64decode)
 
 
+OFPXMC_NXM_0 = 0  # Nicira Extended Match (NXM_OF_)
+OFPXMC_NXM_1 = 1  # Nicira Extended Match (NXM_NX_)
 OFPXMC_OPENFLOW_BASIC = 0x8000
 OFPXMC_EXPERIMENTER = 0xffff
 
@@ -95,16 +97,15 @@ class _OxmClass(object):
     def __init__(self, name, num, type_):
         self.name = name
         self.oxm_type = num | (self._class << 7)
+        # TODO(yamamoto): Clean this up later.
+        # Probably when we drop EXT-256 style experimenter OXMs.
+        self.num = self.oxm_type
         self.type = type_
 
 
 class OpenFlowBasic(_OxmClass):
     _class = OFPXMC_OPENFLOW_BASIC
 
-    def __init__(self, name, num, type_):
-        super(OpenFlowBasic, self).__init__(name, num, type_)
-        self.num = self.oxm_type
-
 
 class _Experimenter(_OxmClass):
     _class = OFPXMC_EXPERIMENTER
@@ -119,6 +120,24 @@ class ONFExperimenter(_Experimenter):
         self.exp_type = num
 
 
+class NiciraExtended0(_OxmClass):
+    """Nicira Extended Match (NXM_0)
+
+    NXM header format is same as 32-bit (non-experimenter) OXMs.
+    """
+
+    _class = OFPXMC_NXM_0
+
+
+class NiciraExtended1(_OxmClass):
+    """Nicira Extended Match (NXM_1)
+
+    NXM header format is same as 32-bit (non-experimenter) OXMs.
+    """
+
+    _class = OFPXMC_NXM_1
+
+
 def generate(modname):
     import sys
     import string
-- 
1.9.4


------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to