Signed-off-by: IWASE Yusuke <[email protected]>
---
ryu/lib/packet/ether_types.py | 1 +
ryu/ofproto/nicira_ext.py | 38 ++++++++++++++++++++++++++++++++++++++
ryu/ofproto/ofproto_common.py | 1 +
ryu/ofproto/oxm_fields.py | 4 ++++
4 files changed, 44 insertions(+)
diff --git a/ryu/lib/packet/ether_types.py b/ryu/lib/packet/ether_types.py
index e8287d3..ff2ba67 100644
--- a/ryu/lib/packet/ether_types.py
+++ b/ryu/lib/packet/ether_types.py
@@ -26,3 +26,4 @@ ETH_TYPE_LLDP = 0x88cc
ETH_TYPE_8021AH = 0x88e7
ETH_TYPE_IEEE802_3 = 0x05dc
ETH_TYPE_CFM = 0x8902
+ETH_TYPE_NSH = 0x894f # RFC8300
diff --git a/ryu/ofproto/nicira_ext.py b/ryu/ofproto/nicira_ext.py
index 9e0f887..94f38fc 100644
--- a/ryu/ofproto/nicira_ext.py
+++ b/ryu/ofproto/nicira_ext.py
@@ -590,6 +590,29 @@ tun_ipv6_dst IPv6 address Tunnel IPv6 destination
address.
eth_type_nxm = 0x86dd (IPv6)
_recirc_id Integer 32bit ID for recirculation.
_dp_hash Integer 32bit Flow hash computed in Datapath.
+nsh_flags Integer 8bit Flags field in NSH Base Header.
+ Requires eth_type_nxm = 0x894f (NSH).
+ Since OpenFlow 1.3 and OVS v2.8.
+nsh_mdtype Integer 8bit Metadata Type in NSH Base Header.
+ Requires eth_type_nxm = 0x894f (NSH).
+ Since OpenFlow 1.3 and OVS v2.8.
+nsh_np Integer 8bit Next Protocol type in NSH Base Header.
+ Requires eth_type_nxm = 0x894f (NSH).
+ Since OpenFlow 1.3 and OVS v2.8.
+nsh_spi Integer 32bit Service Path Identifier in NSH Service Path
+ Header.
+ Requires eth_type_nxm = 0x894f (NSH).
+ Since OpenFlow 1.3 and OVS v2.8.
+nsh_si Integer 8bit Service Index in NSH Service Path Header.
+ Requires eth_type_nxm = 0x894f (NSH).
+ Since OpenFlow 1.3 and OVS v2.8.
+nsh_c<N> Integer 32bit Context fields in NSH Context Header.
+ <N> is a number of 1-4.
+ Requires eth_type_nxm = 0x894f (NSH).
+ Since OpenFlow 1.3 and OVS v2.8.
+nsh_ttl Integer 8bit TTL field in NSH Base Header.
+ Requires eth_type_nxm = 0x894f (NSH).
+ Since OpenFlow 1.3 and OVS v2.9.
reg<idx> Integer 32bit Packet register.
<idx> is register number 0-15.
xxreg<idx> Integer 128bit Packet extended-extended register.
@@ -684,6 +707,21 @@ oxm_types = [
# in wild.
oxm_fields.NiciraExperimenter('_dp_hash', 0, type_desc.Int4),
+ # Nicira Experimenter for Network Service Header
+ oxm_fields.NiciraNshExperimenter('nsh_flags', 1, type_desc.Int1),
+ oxm_fields.NiciraNshExperimenter('nsh_mdtype', 2, type_desc.Int1),
+ oxm_fields.NiciraNshExperimenter('nsh_np', 3, type_desc.Int1),
+ # aka "nsp"
+ oxm_fields.NiciraNshExperimenter('nsh_spi', 4, type_desc.Int4),
+ # aka "nsi"
+ oxm_fields.NiciraNshExperimenter('nsh_si', 5, type_desc.Int1),
+ # aka "nshc<N>"
+ oxm_fields.NiciraNshExperimenter('nsh_c1', 6, type_desc.Int4),
+ oxm_fields.NiciraNshExperimenter('nsh_c2', 7, type_desc.Int4),
+ oxm_fields.NiciraNshExperimenter('nsh_c3', 8, type_desc.Int4),
+ oxm_fields.NiciraNshExperimenter('nsh_c4', 9, type_desc.Int4),
+ oxm_fields.NiciraNshExperimenter('nsh_ttl', 10, type_desc.Int1),
+
# Support for matching/setting NX registers 0-15
oxm_fields.NiciraExtended1('reg0', 0, type_desc.Int4),
oxm_fields.NiciraExtended1('reg1', 1, type_desc.Int4),
diff --git a/ryu/ofproto/ofproto_common.py b/ryu/ofproto/ofproto_common.py
index 4f0d995..ffdf1a4 100644
--- a/ryu/ofproto/ofproto_common.py
+++ b/ryu/ofproto/ofproto_common.py
@@ -32,5 +32,6 @@ OFP_SSL_PORT_OLD = 6633
# Vendor/Experimenter IDs
# https://rs.opennetworking.org/wiki/display/PUBLIC/ONF+Registry
NX_EXPERIMENTER_ID = 0x00002320 # Nicira
+NX_NSH_EXPERIMENTER_ID = 0x005ad650 # Nicira Ext for Network Service Header
BSN_EXPERIMENTER_ID = 0x005c16c7 # Big Switch Networks
ONF_EXPERIMENTER_ID = 0x4f4e4600 # OpenFlow Extensions for 1.3.X Pack 1
diff --git a/ryu/ofproto/oxm_fields.py b/ryu/ofproto/oxm_fields.py
index d2bea49..f978f5b 100644
--- a/ryu/ofproto/oxm_fields.py
+++ b/ryu/ofproto/oxm_fields.py
@@ -132,6 +132,10 @@ class NiciraExperimenter(_Experimenter):
experimenter_id = ofproto_common.NX_EXPERIMENTER_ID
+class NiciraNshExperimenter(_Experimenter):
+ experimenter_id = ofproto_common.NX_NSH_EXPERIMENTER_ID
+
+
class NiciraExtended0(_OxmClass):
"""Nicira Extended Match (NXM_0)
--
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel