Skip to content

Commit

Permalink
oxm_fields: Add Nicira Extended Match (NXM) support
Browse files Browse the repository at this point in the history
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]>
Signed-off-by: FUJITA Tomonori <[email protected]>
  • Loading branch information
yamt authored and fujita committed Oct 14, 2014
1 parent 73e336e commit be892f8
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions ryu/ofproto/oxm_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand All @@ -119,6 +120,24 @@ def __init__(self, name, num, type_):
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
Expand Down

0 comments on commit be892f8

Please sign in to comment.