Merge "BUG-2613: Migrating Openflow Specific NSF from controller project to openflowp...
authormichal rehak <mirehak@cisco.com>
Tue, 20 Jan 2015 21:46:02 +0000 (21:46 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Tue, 20 Jan 2015 21:46:02 +0000 (21:46 +0000)
38 files changed:
distribution/karaf/pom.xml
drop-test/pom.xml
drop-test/src/main/java/org/opendaylight/openflowplugin/outputtest/OutputTestCommandProvider.java
extension/features/pom.xml [new file with mode: 0644]
extension/features/src/main/resources/features.xml [new file with mode: 0644]
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/NiciraExtensionsRegistrator.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/NiciraMatchCodecs.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/action/MultipathCodec.java [new file with mode: 0644]
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/action/NiciraActionCodecs.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/action/ResubmitCodec.java [new file with mode: 0644]
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/action/SetNsiCodec.java [new file with mode: 0644]
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/action/SetNspCodec.java [new file with mode: 0644]
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/match/NsiCodec.java [new file with mode: 0644]
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/match/NspCodec.java [new file with mode: 0644]
extension/openflowjava-extension-nicira/src/main/resources/initial/44-openflowjava-nx-config.xml [deleted file]
extension/openflowjava-extension-nicira/src/main/yang/nicira-action.yang
extension/openflowjava-extension-nicira/src/main/yang/nicira-match.yang
extension/openflowplugin-extension-nicira-config/pom.xml [new file with mode: 0644]
extension/openflowplugin-extension-nicira-config/src/main/resources/initial/43-openflowjava-nx-config.xml [moved from extension/openflowjava-extension-nicira-api/src/main/resources/initial/43-openflowjava-nx-api-config.xml with 55% similarity]
extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/NiciraExtensionProvider.java
extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/action/MultipathConvertor.java [new file with mode: 0644]
extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/action/ResubmitConvertor.java [new file with mode: 0644]
extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/action/SetNsiConvertor.java [new file with mode: 0644]
extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/action/SetNspConvertor.java [new file with mode: 0644]
extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/MatchUtil.java
extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/NsiConvertor.java [new file with mode: 0644]
extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/NspConvertor.java [new file with mode: 0644]
extension/openflowplugin-extension-nicira/src/main/resources/initial/44-nicira-extension.xml [deleted file]
extension/openflowplugin-extension-nicira/src/main/yang/openflowplugin-extension-nicira-action.yang
extension/openflowplugin-extension-nicira/src/main/yang/openflowplugin-extension-nicira-match.yang
extension/pom.xml
features/src/main/resources/features.xml
openflowplugin-api/src/main/java/org/opendaylight/openflowplugin/api/openflow/md/util/PollableQueuesPriorityZipper.java [new file with mode: 0644]
openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/FlowConvertor.java
openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/queue/QueueKeeperFairImpl.java
openflowplugin/src/test/java/org/opendaylight/openflowplugin/openflow/md/util/PollableQueuesPriorityZipperTest.java [new file with mode: 0644]
samples/learning-switch/pom.xml
samples/learning-switch/src/main/java/org/opendaylight/openflowplugin/learningswitch/FlowUtils.java

index a267387bbc76eba5e71333a3a477b25bb210b523..6fe230492552946734e09621d5f084bcbf313fa1 100644 (file)
       <type>xml</type>
       <scope>runtime</scope>
     </dependency>
+    <!-- openflowplugin extension feature -->
+    <dependency>
+      <groupId>org.opendaylight.openflowplugin</groupId>
+      <artifactId>features-openflowplugin-extension</artifactId>
+      <version>${project.version}</version>
+      <classifier>features</classifier>
+      <type>xml</type>
+      <scope>runtime</scope>
+    </dependency>
   </dependencies>
 
   <build>
index 5da0a710182d73e286b070fded9652fd145ab94f..a0d210518623cdd8f191e8d72151554e356616c1 100644 (file)
             <groupId>org.opendaylight.controller.model</groupId>
             <artifactId>model-inventory</artifactId>
         </dependency>
-         <dependency>
+        <dependency>
                <groupId>equinoxSDK381</groupId>
                <artifactId>org.eclipse.osgi</artifactId>
-             </dependency>
-             <dependency>
+           </dependency>
+           <dependency>
             <groupId>commons-lang</groupId>
             <artifactId>commons-lang</artifactId>
-          </dependency>
-             
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.openflowplugin</groupId>
+            <artifactId>openflowplugin-api</artifactId>
+        </dependency>
     </dependencies>
 
     <build>
index 84d0f17977a020209924004075fbb73069d4e92e..cd7d638c16af83095a07d36e1127c441b769ba05 100644 (file)
@@ -14,6 +14,7 @@ import org.apache.commons.lang.ArrayUtils;
 import org.eclipse.osgi.framework.console.CommandInterpreter;
 import org.eclipse.osgi.framework.console.CommandProvider;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
+import org.opendaylight.openflowplugin.api.OFConstants;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Uri;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.OutputActionCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.output.action._case.OutputActionBuilder;
@@ -138,7 +139,7 @@ public class OutputTestCommandProvider implements CommandProvider {
             packet_out.setNode(ref);
             packet_out.setIngress(nIngressConRef);
             packet_out.setEgress(nEngressConRef);
-            packet_out.setBufferId(Long.valueOf(0xffffffffL));
+            packet_out.setBufferId(OFConstants.OFP_NO_BUFFER);
 
             packetProcessingService.transmitPacket(packet_out.build());
         } else {
diff --git a/extension/features/pom.xml b/extension/features/pom.xml
new file mode 100644 (file)
index 0000000..87cf8ef
--- /dev/null
@@ -0,0 +1,137 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.opendaylight.openflowplugin</groupId>
+    <artifactId>openflowplugin-extension-parent</artifactId>
+    <version>0.1.0-SNAPSHOT</version>
+    <relativePath>../</relativePath>
+  </parent>
+  <artifactId>features-openflowplugin-extension</artifactId>
+
+  <packaging>jar</packaging>
+
+  <properties>
+    <features.file>features.xml</features.file>
+    <karaf.empty.distro.version>1.5.0-SNAPSHOT</karaf.empty.distro.version>
+    <yangtools.version>0.7.0-SNAPSHOT</yangtools.version>
+  </properties>
+
+  <dependencies>
+    <!-- feature dependencies -->
+    <dependency>
+      <groupId>org.opendaylight.openflowplugin</groupId>
+      <artifactId>features-openflowplugin</artifactId>
+      <version>${project.version}</version>
+      <classifier>features</classifier>
+      <type>xml</type>
+    </dependency>
+
+    <!-- bundle dependencies -->
+    <dependency>
+      <groupId>org.opendaylight.openflowplugin</groupId>
+      <artifactId>openflowplugin-extension-api</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+
+    <!-- Nicira extensions -->
+    <dependency>
+      <groupId>org.opendaylight.openflowplugin</groupId>
+      <artifactId>openflowplugin-extension-nicira-config</artifactId>
+      <version>${project.version}</version>
+      <type>xml</type>
+      <classifier>config</classifier>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.openflowplugin</groupId>
+      <artifactId>openflowplugin-extension-nicira</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.openflowplugin</groupId>
+      <artifactId>openflowjava-extension-nicira-api</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.openflowplugin</groupId>
+      <artifactId>openflowjava-extension-nicira</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+
+    <!-- test the features.xml -->
+    <dependency>
+      <groupId>org.opendaylight.yangtools</groupId>
+      <artifactId>features-test</artifactId>
+      <version>${yangtools.version}</version>
+    </dependency>
+    <!-- dependency for opendaylight-karaf-empty for use by testing -->
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>opendaylight-karaf-empty</artifactId>
+      <version>${karaf.distro.empty.version}</version>
+      <type>zip</type>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <resources>
+      <resource>
+        <filtering>true</filtering>
+        <directory>src/main/resources</directory>
+      </resource>
+    </resources>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-resources-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>filter</id>
+            <goals>
+              <goal>resources</goal>
+            </goals>
+            <phase>generate-resources</phase>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>build-helper-maven-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>attach-artifacts</id>
+            <goals>
+              <goal>attach-artifact</goal>
+            </goals>
+            <phase>package</phase>
+            <configuration>
+              <artifacts>
+                <artifact>
+                  <file>${project.build.directory}/classes/${features.file}</file>
+                  <type>xml</type>
+                  <classifier>features</classifier>
+                </artifact>
+              </artifacts>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <version>2.16</version>
+        <configuration>
+          <systemPropertyVariables>
+            <karaf.distro.groupId>org.opendaylight.controller</karaf.distro.groupId>
+            <karaf.distro.artifactId>opendaylight-karaf-empty</karaf.distro.artifactId>
+            <karaf.distro.version>${karaf.empty.distro.version}</karaf.distro.version>
+          </systemPropertyVariables>
+          <dependenciesToScan>
+           <dependency>org.opendaylight.yangtools:features-test</dependency>
+          </dependenciesToScan>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+
+</project>
diff --git a/extension/features/src/main/resources/features.xml b/extension/features/src/main/resources/features.xml
new file mode 100644 (file)
index 0000000..523b235
--- /dev/null
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<features name="openflowplugin-extension-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.2.0"
+   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xsi:schemaLocation="http://karaf.apache.org/xmlns/features/v1.2.0 http://karaf.apache.org/xmlns/features/v1.2.0">
+    <repository>mvn:org.opendaylight.openflowplugin/features-openflowplugin/${project.version}/xml/features</repository>
+
+    <feature name="odl-openflowplugin-nxm-extensions" description="OpenDaylight :: Openflow Plugin :: Nicira Extensions" version='${project.version}'>
+        <feature version="${project.version}">odl-openflowplugin-southbound</feature>
+        <configfile finalname="etc/opendaylight/karaf/43-openflowjava-nx-config.xml">mvn:org.opendaylight.openflowplugin/openflowplugin-extension-nicira-config/${project.version}/xml/config</configfile>
+<!--         <configfile finalname="etc/opendaylight/karaf/44-openflowjava-nx-config.xml">mvn:org.opendaylight.openflowplugin/openflowplugin-extension-nicira-config/${project.version}/xml/openflowjava-nx-config/</configfile> -->
+<!--         <configfile finalname="etc/opendaylight/karaf/44-nicira-extension.xml">mvn:org.opendaylight.openflowplugin/openflowplugin-extension-nicira-config/${project.version}/xml/nicira-extension-config</configfile> -->
+        <bundle>mvn:org.opendaylight.openflowplugin/openflowjava-extension-nicira-api/${project.version}</bundle>
+        <bundle>mvn:org.opendaylight.openflowplugin/openflowjava-extension-nicira/${project.version}</bundle>
+        <bundle>mvn:org.opendaylight.openflowplugin/openflowplugin-extension-nicira/${project.version}</bundle>
+    </feature>
+
+</features>
index efe68885430b9fb701206fc1160afa6fccc6703f..3feb068f8cc0acafbae0e768fdc2741a69a74604 100644 (file)
@@ -5,6 +5,10 @@ import org.opendaylight.openflowjava.nx.codec.action.NiciraActionCodecs;
 import org.opendaylight.openflowjava.nx.codec.action.OutputRegCodec;
 import org.opendaylight.openflowjava.nx.codec.action.RegLoadCodec;
 import org.opendaylight.openflowjava.nx.codec.action.RegMoveCodec;
+import org.opendaylight.openflowjava.nx.codec.action.ResubmitCodec;
+import org.opendaylight.openflowjava.nx.codec.action.MultipathCodec;
+import org.opendaylight.openflowjava.nx.codec.action.SetNspCodec;
+import org.opendaylight.openflowjava.nx.codec.action.SetNsiCodec;
 import org.opendaylight.openflowjava.nx.codec.match.ArpOpCodec;
 import org.opendaylight.openflowjava.nx.codec.match.ArpShaCodec;
 import org.opendaylight.openflowjava.nx.codec.match.ArpSpaCodec;
@@ -24,6 +28,8 @@ import org.opendaylight.openflowjava.nx.codec.match.Reg7Codec;
 import org.opendaylight.openflowjava.nx.codec.match.TunIdCodec;
 import org.opendaylight.openflowjava.nx.codec.match.TunIpv4DstCodec;
 import org.opendaylight.openflowjava.nx.codec.match.TunIpv4SrcCodec;
+import org.opendaylight.openflowjava.nx.codec.match.NspCodec;
+import org.opendaylight.openflowjava.nx.codec.match.NsiCodec;
 
 import com.google.common.base.Preconditions;
 
@@ -46,6 +52,16 @@ public class NiciraExtensionsRegistrator implements AutoCloseable {
         registrator.registerActionSerializer(RegMoveCodec.SERIALIZER_KEY, NiciraActionCodecs.REG_MOVE_CODEC);
         registrator.registerActionDeserializer(OutputRegCodec.DESERIALIZER_KEY, NiciraActionCodecs.OUTPUT_REG_CODEC);
         registrator.registerActionSerializer(OutputRegCodec.SERIALIZER_KEY, NiciraActionCodecs.OUTPUT_REG_CODEC);
+        registrator.registerActionSerializer(ResubmitCodec.SERIALIZER_KEY, NiciraActionCodecs.RESUBMIT_CODEC);
+        registrator.registerActionDeserializer(ResubmitCodec.DESERIALIZER_KEY, NiciraActionCodecs.RESUBMIT_CODEC);
+        registrator.registerActionDeserializer(ResubmitCodec.TABLE_DESERIALIZER_KEY, NiciraActionCodecs.RESUBMIT_CODEC);
+        registrator.registerActionSerializer(MultipathCodec.SERIALIZER_KEY, NiciraActionCodecs.MULTIPATH_CODEC);
+        registrator.registerActionDeserializer(MultipathCodec.DESERIALIZER_KEY, NiciraActionCodecs.MULTIPATH_CODEC);
+        registrator.registerActionDeserializer(SetNspCodec.DESERIALIZER_KEY, NiciraActionCodecs.SET_NSP_CODEC);
+        registrator.registerActionSerializer(SetNspCodec.SERIALIZER_KEY, NiciraActionCodecs.SET_NSP_CODEC);
+        registrator.registerActionDeserializer(SetNsiCodec.DESERIALIZER_KEY, NiciraActionCodecs.SET_NSI_CODEC);
+        registrator.registerActionSerializer(SetNsiCodec.SERIALIZER_KEY, NiciraActionCodecs.SET_NSI_CODEC);
+
         registrator.registerMatchEntrySerializer(Reg0Codec.SERIALIZER_KEY, NiciraMatchCodecs.REG0_CODEC);
         registrator.registerMatchEntryDeserializer(Reg0Codec.DESERIALIZER_KEY, NiciraMatchCodecs.REG0_CODEC);
         registrator.registerMatchEntrySerializer(Reg1Codec.SERIALIZER_KEY, NiciraMatchCodecs.REG1_CODEC);
@@ -84,6 +100,10 @@ public class NiciraExtensionsRegistrator implements AutoCloseable {
         registrator.registerMatchEntryDeserializer(TunIpv4SrcCodec.DESERIALIZER_KEY, NiciraMatchCodecs.TUN_IPV4_SRC_CODEC);
         registrator.registerMatchEntrySerializer(EthTypeCodec.SERIALIZER_KEY, NiciraMatchCodecs.ETH_TYPE_CODEC);
         registrator.registerMatchEntryDeserializer(EthTypeCodec.DESERIALIZER_KEY, NiciraMatchCodecs.ETH_TYPE_CODEC);
+        registrator.registerMatchEntrySerializer(NspCodec.SERIALIZER_KEY, NiciraMatchCodecs.NSP_CODEC);
+        registrator.registerMatchEntryDeserializer(NspCodec.DESERIALIZER_KEY, NiciraMatchCodecs.NSP_CODEC);
+        registrator.registerMatchEntrySerializer(NsiCodec.SERIALIZER_KEY, NiciraMatchCodecs.NSI_CODEC);
+        registrator.registerMatchEntryDeserializer(NsiCodec.DESERIALIZER_KEY, NiciraMatchCodecs.NSI_CODEC);
     }
 
     public void unregisterExtensions() {
@@ -93,6 +113,16 @@ public class NiciraExtensionsRegistrator implements AutoCloseable {
         registrator.unregisterActionSerializer(RegMoveCodec.SERIALIZER_KEY);
         registrator.unregisterActionDeserializer(OutputRegCodec.DESERIALIZER_KEY);
         registrator.unregisterActionSerializer(OutputRegCodec.SERIALIZER_KEY);
+        registrator.unregisterActionSerializer(ResubmitCodec.SERIALIZER_KEY);
+        registrator.unregisterActionDeserializer(ResubmitCodec.TABLE_DESERIALIZER_KEY);
+        registrator.unregisterActionDeserializer(ResubmitCodec.DESERIALIZER_KEY);
+        registrator.unregisterActionSerializer(MultipathCodec.SERIALIZER_KEY);
+        registrator.unregisterActionDeserializer(MultipathCodec.DESERIALIZER_KEY);
+        registrator.unregisterActionDeserializer(SetNsiCodec.DESERIALIZER_KEY);
+        registrator.unregisterActionSerializer(SetNsiCodec.SERIALIZER_KEY);
+        registrator.unregisterActionDeserializer(SetNspCodec.DESERIALIZER_KEY);
+        registrator.unregisterActionSerializer(SetNspCodec.SERIALIZER_KEY);
+
         registrator.unregisterMatchEntrySerializer(Reg0Codec.SERIALIZER_KEY);
         registrator.unregisterMatchEntryDeserializer(Reg0Codec.DESERIALIZER_KEY);
         registrator.unregisterMatchEntrySerializer(Reg1Codec.SERIALIZER_KEY);
@@ -131,6 +161,10 @@ public class NiciraExtensionsRegistrator implements AutoCloseable {
         registrator.unregisterMatchEntryDeserializer(TunIpv4SrcCodec.DESERIALIZER_KEY);
         registrator.unregisterMatchEntrySerializer(EthTypeCodec.SERIALIZER_KEY);
         registrator.unregisterMatchEntryDeserializer(EthTypeCodec.DESERIALIZER_KEY);
+        registrator.unregisterMatchEntrySerializer(NspCodec.SERIALIZER_KEY);
+        registrator.unregisterMatchEntryDeserializer(NspCodec.DESERIALIZER_KEY);
+        registrator.unregisterMatchEntrySerializer(NsiCodec.SERIALIZER_KEY);
+        registrator.unregisterMatchEntryDeserializer(NsiCodec.DESERIALIZER_KEY);
     }
 
     @Override
index b9422f51925229887d06e1742723b423ba41bcfb..5e2f41305ab50937513f6b275e4047900a06bbaa 100644 (file)
@@ -26,6 +26,8 @@ import org.opendaylight.openflowjava.nx.codec.match.Reg7Codec;
 import org.opendaylight.openflowjava.nx.codec.match.TunIdCodec;
 import org.opendaylight.openflowjava.nx.codec.match.TunIpv4DstCodec;
 import org.opendaylight.openflowjava.nx.codec.match.TunIpv4SrcCodec;
+import org.opendaylight.openflowjava.nx.codec.match.NspCodec;
+import org.opendaylight.openflowjava.nx.codec.match.NsiCodec;
 
 /**
  * @author msunal
@@ -52,5 +54,6 @@ public class NiciraMatchCodecs {
     public static final TunIpv4DstCodec TUN_IPV4_DST_CODEC = new TunIpv4DstCodec();
     public static final TunIpv4SrcCodec TUN_IPV4_SRC_CODEC = new TunIpv4SrcCodec();
     public static final EthTypeCodec ETH_TYPE_CODEC = new EthTypeCodec();
-
+    public static final NspCodec NSP_CODEC = new NspCodec();
+    public static final NsiCodec NSI_CODEC = new NsiCodec();
 }
diff --git a/extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/action/MultipathCodec.java b/extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/action/MultipathCodec.java
new file mode 100644 (file)
index 0000000..4039ede
--- /dev/null
@@ -0,0 +1,87 @@
+/*
+ * Copyright (C) 2014 SDN Hub, LLC.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Authors : Srini Seetharaman
+ */
+
+package org.opendaylight.openflowjava.nx.codec.action;
+
+import io.netty.buffer.ByteBuf;
+
+import org.opendaylight.openflowjava.nx.api.NiciraActionDeserializerKey;
+import org.opendaylight.openflowjava.nx.api.NiciraActionSerializerKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ExperimenterIdAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.ActionBuilder;
+import org.opendaylight.openflowjava.nx.codec.action.AbstractActionCodec;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.NxmNxMultipath;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.OfjNxMpAlgorithm;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.OfjNxHashFields;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.OfjAugNxAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.OfjAugNxActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.multipath.grouping.ActionMultipath;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.multipath.grouping.ActionMultipathBuilder;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Codec for the NX_MULTIPATH
+ */
+public class MultipathCodec extends AbstractActionCodec {
+    private static final Logger logger = LoggerFactory.getLogger(MultipathCodec.class);
+
+    public static final int LENGTH = 32;
+    public static final byte NXAST_MULTIPATH_SUBTYPE = 10;
+    public static final NiciraActionSerializerKey SERIALIZER_KEY =
+            new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, NxmNxMultipath.class);
+    public static final NiciraActionDeserializerKey DESERIALIZER_KEY =
+            new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, NXAST_MULTIPATH_SUBTYPE);
+
+    @Override
+    public void serialize(Action input, ByteBuf outBuffer) {
+        ActionMultipath action = input.getAugmentation(OfjAugNxAction.class).getActionMultipath();
+        serializeHeader(LENGTH, NXAST_MULTIPATH_SUBTYPE, outBuffer);
+
+        outBuffer.writeShort(action.getFields().getIntValue());
+        outBuffer.writeShort(action.getBasis().shortValue());
+        outBuffer.writeZero(2);
+
+        outBuffer.writeShort(action.getAlgorithm().getIntValue());
+        outBuffer.writeShort(action.getMaxLink().shortValue());
+        outBuffer.writeInt(action.getArg().intValue());
+        outBuffer.writeZero(2);
+
+        outBuffer.writeShort(action.getOfsNbits().shortValue());
+        outBuffer.writeInt(action.getDst().intValue());
+    }
+
+    @Override
+    public Action deserialize(ByteBuf message) {
+        ActionBuilder actionBuilder = deserializeHeader(message);
+        ActionMultipathBuilder builder = new ActionMultipathBuilder();
+        builder.setFields(OfjNxHashFields.forValue(message.readUnsignedShort()));
+        builder.setBasis(message.readUnsignedShort());
+        message.skipBytes(2); //two bytes
+
+        builder.setAlgorithm(OfjNxMpAlgorithm.forValue(message.readUnsignedShort()));
+        builder.setMaxLink(message.readUnsignedShort());
+        builder.setArg(message.readUnsignedInt());
+        message.skipBytes(2); //two bytes
+
+        builder.setOfsNbits(message.readUnsignedShort());
+        builder.setDst(message.readUnsignedInt());
+
+        OfjAugNxActionBuilder augNxActionBuilder = new OfjAugNxActionBuilder();
+        augNxActionBuilder.setActionMultipath(builder.build());
+        actionBuilder.addAugmentation(ExperimenterIdAction.class,
+                                      createExperimenterIdAction(NxmNxMultipath.class));
+        actionBuilder.addAugmentation(OfjAugNxAction.class, augNxActionBuilder.build());
+        return actionBuilder.build();
+    }
+}
index 1c7d105b3c64d75b65f300c6e5ebf8ce63bd748d..7e1f1ac70fe009c8ded5093a161774e78b5e82f8 100644 (file)
@@ -16,4 +16,8 @@ public class NiciraActionCodecs {
     public static final RegMoveCodec REG_MOVE_CODEC = new RegMoveCodec();
     public static final RegLoadCodec REG_LOAD_CODEC = new RegLoadCodec();
     public static final OutputRegCodec OUTPUT_REG_CODEC = new OutputRegCodec();
+    public static final ResubmitCodec RESUBMIT_CODEC = new ResubmitCodec();
+    public static final MultipathCodec MULTIPATH_CODEC = new MultipathCodec();
+    public static final SetNspCodec SET_NSP_CODEC = new SetNspCodec();
+    public static final SetNsiCodec SET_NSI_CODEC = new SetNsiCodec();
 }
diff --git a/extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/action/ResubmitCodec.java b/extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/action/ResubmitCodec.java
new file mode 100644 (file)
index 0000000..94121d3
--- /dev/null
@@ -0,0 +1,81 @@
+/*
+ * Copyright (C) 2014 Red Hat, Inc.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Authors : Madhu Venugopal
+ */
+
+package org.opendaylight.openflowjava.nx.codec.action;
+
+import io.netty.buffer.ByteBuf;
+
+import org.opendaylight.openflowjava.nx.api.NiciraActionDeserializerKey;
+import org.opendaylight.openflowjava.nx.api.NiciraActionSerializerKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ExperimenterIdAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.ActionBuilder;
+import org.opendaylight.openflowjava.nx.codec.action.AbstractActionCodec;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.NxmNxResubmit;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.OfjAugNxAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.OfjAugNxActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.resubmit.grouping.ActionResubmit;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.resubmit.grouping.ActionResubmitBuilder;
+
+/**
+ * Codec for the NX_RESUBMIT and NX_RESUBMIT_TABLE
+ */
+public class ResubmitCodec extends AbstractActionCodec {
+    public static final int LENGTH = 16;
+    public static final byte NXAST_RESUBMIT_SUBTYPE = 1;
+    public static final byte NXAST_RESUBMIT_TABLE_SUBTYPE = 14;
+    public static final NiciraActionSerializerKey SERIALIZER_KEY =
+            new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, NxmNxResubmit.class);
+    public static final NiciraActionDeserializerKey DESERIALIZER_KEY =
+            new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, NXAST_RESUBMIT_SUBTYPE);
+    public static final NiciraActionDeserializerKey TABLE_DESERIALIZER_KEY =
+            new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, NXAST_RESUBMIT_TABLE_SUBTYPE);
+
+    private static final byte OFP_TABLE_ALL = (byte)255;
+    private static final short OFP_IN_PORT = (short)0xfff8;
+    private static final int padding = 3; // nx_action_resubmit : uint8_t pad[3];
+
+    public byte getSubType(ActionResubmit action) {
+        if ((action.getTable() == null) || (action.getTable().byteValue() == OFP_TABLE_ALL)) return NXAST_RESUBMIT_SUBTYPE;
+        return NXAST_RESUBMIT_TABLE_SUBTYPE;
+    }
+
+    @Override
+    public void serialize(Action input, ByteBuf outBuffer) {
+        byte table = OFP_TABLE_ALL;
+        short inPort = OFP_IN_PORT;
+
+        ActionResubmit action = input.getAugmentation(OfjAugNxAction.class).getActionResubmit();
+        serializeHeader(LENGTH, getSubType(action), outBuffer);
+
+        if (action.getInPort() != null) inPort = action.getInPort().shortValue();
+        if (action.getTable() != null) table = action.getTable().byteValue();
+        outBuffer.writeShort(inPort);
+        outBuffer.writeByte(table);
+        outBuffer.writeZero(padding);
+    }
+
+    @Override
+    public Action deserialize(ByteBuf message) {
+        ActionBuilder actionBuilder = deserializeHeader(message);
+        ActionResubmitBuilder builder = new ActionResubmitBuilder();
+        builder.setInPort(message.readUnsignedShort());
+        builder.setTable(message.readUnsignedByte());
+        message.skipBytes(padding);
+        OfjAugNxActionBuilder augNxActionBuilder = new OfjAugNxActionBuilder();
+        augNxActionBuilder.setActionResubmit(builder.build());
+        actionBuilder.addAugmentation(ExperimenterIdAction.class,
+                                      createExperimenterIdAction(NxmNxResubmit.class));
+        actionBuilder.addAugmentation(OfjAugNxAction.class, augNxActionBuilder.build());
+        return actionBuilder.build();
+    }
+
+}
diff --git a/extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/action/SetNsiCodec.java b/extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/action/SetNsiCodec.java
new file mode 100644 (file)
index 0000000..424113c
--- /dev/null
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2014 Red Hat, Inc.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Authors : Madhu Venugopal
+ */
+
+package org.opendaylight.openflowjava.nx.codec.action;
+
+import io.netty.buffer.ByteBuf;
+
+import org.opendaylight.openflowjava.nx.api.NiciraActionDeserializerKey;
+import org.opendaylight.openflowjava.nx.api.NiciraActionSerializerKey;
+import org.opendaylight.openflowjava.nx.codec.action.AbstractActionCodec;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ExperimenterIdAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.ActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.NxmNxSetNsi;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.OfjAugNxAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.OfjAugNxActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.set.nsi.grouping.ActionSetNsi;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.set.nsi.grouping.ActionSetNsiBuilder;
+
+/**
+ * Codec for the NX_SetNsi and NX_SetNsi_TABLE
+ */
+public class SetNsiCodec extends AbstractActionCodec {
+    public static final int LENGTH = 16;
+    public static final byte NXAST_SET_NSI_SUBTYPE = 33;
+    public static final NiciraActionSerializerKey SERIALIZER_KEY =
+            new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, NxmNxSetNsi.class);
+    public static final NiciraActionDeserializerKey DESERIALIZER_KEY =
+            new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, NXAST_SET_NSI_SUBTYPE);
+    private static final int padding = 5; // nx_action_SetNsi : uint8_t pad[3];
+
+    @Override
+    public void serialize(Action input, ByteBuf outBuffer) {
+        ActionSetNsi action = input.getAugmentation(OfjAugNxAction.class).getActionSetNsi();
+        serializeHeader(LENGTH, NXAST_SET_NSI_SUBTYPE, outBuffer);
+        outBuffer.writeByte(action.getNsi().byteValue());
+        outBuffer.writeZero(padding);
+    }
+
+    @Override
+    public Action deserialize(ByteBuf message) {
+        ActionBuilder actionBuilder = deserializeHeader(message);
+        ActionSetNsiBuilder builder = new ActionSetNsiBuilder();
+        builder.setNsi(message.readUnsignedByte());
+        message.skipBytes(padding);
+
+        OfjAugNxActionBuilder augNxActionBuilder = new OfjAugNxActionBuilder();
+        augNxActionBuilder.setActionSetNsi(builder.build());
+        actionBuilder.addAugmentation(ExperimenterIdAction.class,
+                                      createExperimenterIdAction(NxmNxSetNsi.class));
+        actionBuilder.addAugmentation(OfjAugNxAction.class, augNxActionBuilder.build());
+        return actionBuilder.build();
+    }
+
+}
diff --git a/extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/action/SetNspCodec.java b/extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/action/SetNspCodec.java
new file mode 100644 (file)
index 0000000..05b03b3
--- /dev/null
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2014 Red Hat, Inc.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Authors : Madhu Venugopal
+ */
+
+package org.opendaylight.openflowjava.nx.codec.action;
+
+import io.netty.buffer.ByteBuf;
+
+import org.opendaylight.openflowjava.nx.api.NiciraActionDeserializerKey;
+import org.opendaylight.openflowjava.nx.api.NiciraActionSerializerKey;
+import org.opendaylight.openflowjava.nx.codec.action.AbstractActionCodec;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ExperimenterIdAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.ActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.NxmNxSetNsp;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.OfjAugNxAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.OfjAugNxActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.set.nsp.grouping.ActionSetNsp;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.set.nsp.grouping.ActionSetNspBuilder;
+
+/**
+ * Codec for the NX_SetNsp and NX_SetNsp_TABLE
+ */
+public class SetNspCodec extends AbstractActionCodec {
+    public static final int LENGTH = 16;
+    public static final byte NXAST_SET_NSP_SUBTYPE = 32;
+    public static final NiciraActionSerializerKey SERIALIZER_KEY =
+            new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, NxmNxSetNsp.class);
+    public static final NiciraActionDeserializerKey DESERIALIZER_KEY =
+            new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, NXAST_SET_NSP_SUBTYPE);
+    private static final int padding = 2; // nx_action_SetNsp : uint8_t pad[3];
+
+    @Override
+    public void serialize(Action input, ByteBuf outBuffer) {
+        ActionSetNsp action = input.getAugmentation(OfjAugNxAction.class).getActionSetNsp();
+        serializeHeader(LENGTH, NXAST_SET_NSP_SUBTYPE, outBuffer);
+        outBuffer.writeZero(padding);
+        outBuffer.writeInt(action.getNsp().intValue());
+    }
+
+    @Override
+    public Action deserialize(ByteBuf message) {
+        ActionBuilder actionBuilder = deserializeHeader(message);
+        ActionSetNspBuilder builder = new ActionSetNspBuilder();
+        message.skipBytes(padding);
+        builder.setNsp(message.readUnsignedInt());
+
+        OfjAugNxActionBuilder augNxActionBuilder = new OfjAugNxActionBuilder();
+        augNxActionBuilder.setActionSetNsp(builder.build());
+        actionBuilder.addAugmentation(ExperimenterIdAction.class,
+                                      createExperimenterIdAction(NxmNxSetNsp.class));
+        actionBuilder.addAugmentation(OfjAugNxAction.class, augNxActionBuilder.build());
+        return actionBuilder.build();
+    }
+
+}
diff --git a/extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/match/NsiCodec.java b/extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/match/NsiCodec.java
new file mode 100644 (file)
index 0000000..10c5cd3
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+ * Copyright (C) 2014 Red Hat, Inc.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Authors : Madhu Venugopal
+ */
+
+package org.opendaylight.openflowjava.nx.codec.match;
+import io.netty.buffer.ByteBuf;
+
+import org.opendaylight.openflowjava.nx.codec.match.AbstractMatchCodec;
+import org.opendaylight.openflowjava.protocol.api.keys.MatchEntryDeserializerKey;
+import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MatchField;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Nxm1Class;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OxmClassBase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxNsi;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.OfjAugNxMatch;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.OfjAugNxMatchBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.nx.match.nsi.grouping.NsiValuesBuilder;
+
+public class NsiCodec extends AbstractMatchCodec {
+
+    private static final int VALUE_LENGTH = 1;
+    private static final int NXM_FIELD_CODE = 38;
+    public static final MatchEntrySerializerKey<Nxm1Class, NxmNxNsi> SERIALIZER_KEY = new MatchEntrySerializerKey<>(
+            EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxNsi.class);
+    public static final MatchEntryDeserializerKey DESERIALIZER_KEY = new MatchEntryDeserializerKey(
+            EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, NXM_FIELD_CODE);
+
+    @Override
+    public void serialize(MatchEntries input, ByteBuf outBuffer) {
+        serializeHeader(input, outBuffer);
+        Short nsi = input.getAugmentation(OfjAugNxMatch.class).getNsiValues().getNsi();
+        outBuffer.writeByte(nsi.byteValue());
+    }
+
+    @Override
+    public MatchEntries deserialize(ByteBuf message) {
+        MatchEntriesBuilder matchEntriesBuilder = deserializeHeader(message);
+        OfjAugNxMatchBuilder augNxMatchBuilder = new OfjAugNxMatchBuilder();
+        augNxMatchBuilder.setNsiValues(new NsiValuesBuilder().setNsi(message.readUnsignedByte()).build());
+        matchEntriesBuilder.addAugmentation(OfjAugNxMatch.class, augNxMatchBuilder.build());
+        return matchEntriesBuilder.build();
+    }
+
+    @Override
+    public int getNxmFieldCode() {
+        return NXM_FIELD_CODE;
+    }
+
+    @Override
+    public int getOxmClassCode() {
+        return OxmMatchConstants.NXM_1_CLASS;
+    }
+
+    @Override
+    public int getValueLength() {
+        return VALUE_LENGTH;
+    }
+
+    @Override
+    public Class<? extends MatchField> getNxmField() {
+        return NxmNxNsi.class;
+    }
+
+    @Override
+    public Class<? extends OxmClassBase> getOxmClass() {
+        return Nxm1Class.class;
+    }
+}
diff --git a/extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/match/NspCodec.java b/extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/match/NspCodec.java
new file mode 100644 (file)
index 0000000..be989f2
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+ * Copyright (C) 2014 Red Hat, Inc.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Authors : Madhu Venugopal
+ */
+
+package org.opendaylight.openflowjava.nx.codec.match;
+import io.netty.buffer.ByteBuf;
+
+import org.opendaylight.openflowjava.nx.codec.match.AbstractMatchCodec;
+import org.opendaylight.openflowjava.protocol.api.keys.MatchEntryDeserializerKey;
+import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MatchField;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Nxm1Class;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OxmClassBase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxNsp;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.OfjAugNxMatch;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.OfjAugNxMatchBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.nx.match.nsp.grouping.NspValuesBuilder;
+
+public class NspCodec extends AbstractMatchCodec {
+
+    private static final int VALUE_LENGTH = 4;
+    private static final int NXM_FIELD_CODE = 37;
+    public static final MatchEntrySerializerKey<Nxm1Class, NxmNxNsp> SERIALIZER_KEY = new MatchEntrySerializerKey<>(
+            EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxNsp.class);
+    public static final MatchEntryDeserializerKey DESERIALIZER_KEY = new MatchEntryDeserializerKey(
+            EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, NXM_FIELD_CODE);
+
+    @Override
+    public void serialize(MatchEntries input, ByteBuf outBuffer) {
+        serializeHeader(input, outBuffer);
+        Long nsp = input.getAugmentation(OfjAugNxMatch.class).getNspValues().getNsp();
+        outBuffer.writeInt(nsp.intValue());
+    }
+
+    @Override
+    public MatchEntries deserialize(ByteBuf message) {
+        MatchEntriesBuilder matchEntriesBuilder = deserializeHeader(message);
+        OfjAugNxMatchBuilder augNxMatchBuilder = new OfjAugNxMatchBuilder();
+        augNxMatchBuilder.setNspValues(new NspValuesBuilder().setNsp(message.readUnsignedInt()).build());
+        matchEntriesBuilder.addAugmentation(OfjAugNxMatch.class, augNxMatchBuilder.build());
+        return matchEntriesBuilder.build();
+    }
+
+    @Override
+    public int getNxmFieldCode() {
+        return NXM_FIELD_CODE;
+    }
+
+    @Override
+    public int getOxmClassCode() {
+        return OxmMatchConstants.NXM_1_CLASS;
+    }
+
+    @Override
+    public int getValueLength() {
+        return VALUE_LENGTH;
+    }
+
+    @Override
+    public Class<? extends MatchField> getNxmField() {
+        return NxmNxNsp.class;
+    }
+
+    @Override
+    public Class<? extends OxmClassBase> getOxmClass() {
+        return Nxm1Class.class;
+    }
+}
diff --git a/extension/openflowjava-extension-nicira/src/main/resources/initial/44-openflowjava-nx-config.xml b/extension/openflowjava-extension-nicira/src/main/resources/initial/44-openflowjava-nx-config.xml
deleted file mode 100644 (file)
index 756bd15..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- vi: set et smarttab sw=4 tabstop=4: -->
-<snapshot>
-  <required-capabilities>
-    <capability>urn:opendaylight:params:xml:ns:yang:openflowplugin:ofjava:nx:config?module=openflowjava-nx-config&amp;revision=2014-07-11</capability>
-  </required-capabilities>
-
-  <configuration>
-
-    <data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
-      <modules xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
-        <module>
-          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:openflowplugin:ofjava:nx:config">prefix:openflowjava-extension-nicira</type>
-          <name>openflow-nx-bundle</name>
-          <nicira-extension-codec-registrator>
-            <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:openflowplugin:ofjava:nx:api:config">prefix:nicira-extension-codec-registrator</type>
-            <name>openflowjava-nicira-ext-registrator</name>
-          </nicira-extension-codec-registrator>
-        </module>
-      </modules>
-    </data>
-
-  </configuration>
-</snapshot>
index ac3fb1df4aa2f09122dea7c540db41cf0421da58..c218ce9a44c43aa3a81849606b96b53f4eb86fb2 100644 (file)
@@ -24,6 +24,18 @@ module nicira-action {
     identity nxm-nx-output-reg {
         base ofaction:experimenter-action-sub-type;
     }
+    identity nxm-nx-resubmit {
+        base ofaction:experimenter-action-sub-type;
+    }
+    identity nxm-nx-multipath {
+        base ofaction:experimenter-action-sub-type;
+    }
+    identity nxm-nx-set-nsp {
+        base ofaction:experimenter-action-sub-type;
+    }
+    identity nxm-nx-set-nsi {
+        base ofaction:experimenter-action-sub-type;
+    }
 
     grouping ofj-nx-action-reg-load-grouping {
         container action-reg-load {
@@ -71,11 +83,102 @@ module nicira-action {
         }
     }
 
+    grouping ofj-nx-action-resubmit-grouping {
+        container action-resubmit {
+            leaf in-port {
+                type uint16;
+                default 0xfff8; // OFPP_INPORT
+            }
+            leaf table {
+                type uint8 {
+                    range "0 .. 255";
+                }
+                default 255; // Current Table
+            }
+        }
+    }
+
+    typedef ofj-nx-hash-fields {
+        type enumeration {
+            enum NX_HASH_FIELDS_ETH_SRC {
+                value 0;
+                description "eth src address only";
+            }
+            enum NX_HASH_FIELDS_SYMMETRIC_L4 {
+                value 1;
+                description "L2 through L4 fields";
+            }
+        }
+    }
+
+    typedef ofj-nx-mp-algorithm {
+        type enumeration {
+            enum NX_MP_ALG_MODULO_N {
+                value 0;
+            }
+            enum NX_MP_ALG_HASH_THRESHOLD {
+                value 1;
+            }
+            enum NX_MP_ALG_HRW {
+                value 2;
+            }
+            enum NX_MP_ALG_ITER_HASH {
+                value 3;
+            }
+        }
+    }
+
+    grouping ofj-nx-action-multipath-grouping {
+        container action-multipath {
+            leaf fields {
+                type ofj-nx-hash-fields;
+            }
+            leaf basis {
+                type uint16;
+                default 0x400;
+            }
+            leaf algorithm {
+                type ofj-nx-mp-algorithm;
+            }
+            leaf max-link {
+                type uint16;
+            }
+            leaf arg {
+                type uint32;
+            }
+            leaf ofs-nbits {
+                type uint16;
+            }
+            leaf dst {
+                type uint32;
+            }
+        }
+    }
+
+    grouping ofj-nx-action-set-nsp-grouping {
+        container action-set-nsp {
+            leaf nsp {
+                type uint32;
+            }
+        }
+    }
+
+    grouping ofj-nx-action-set-nsi-grouping {
+        container action-set-nsi {
+            leaf nsi {
+                type uint8;
+            }
+        }
+    }
+
     augment "/ofaction:actions-container/ofaction:action" {
         ext:augment-identifier "ofj-aug-nx-action";
         uses ofj-nx-action-reg-load-grouping;
         uses ofj-nx-action-reg-move-grouping;
         uses ofj-nx-action-output-reg-grouping;
+        uses ofj-nx-action-resubmit-grouping;
+        uses ofj-nx-action-multipath-grouping;
+        uses ofj-nx-action-set-nsp-grouping;
+        uses ofj-nx-action-set-nsi-grouping;
     }
-
-}
\ No newline at end of file
+}
index 05814d2cc0ac9a63c3cc385849702e13aae3f2b1..d4233f807934509e5e021f4cb0357d1785e044c3 100644 (file)
@@ -77,6 +77,12 @@ module nicira-match {
     identity nxm-of-eth-type {
         base ofoxm:match-field;
     }
+    identity nxm-nx-nsp {
+        base ofoxm:match-field;
+    }
+    identity nxm-nx-nsi {
+        base ofoxm:match-field;
+    }
 
     grouping ofj-nxm-nx-match-reg-grouping {
         container reg-values {
@@ -163,6 +169,22 @@ module nicira-match {
         }
     }
 
+    grouping ofj-nxm-nx-match-nsp-grouping {
+        container nsp-values {
+            leaf nsp {
+                type uint32;
+            }
+        }
+    }
+
+    grouping ofj-nxm-nx-match-nsi-grouping {
+        container nsi-values {
+            leaf nsi {
+                type uint8;
+            }
+        }
+    }
+
     augment "/ofoxm:oxm-container/ofoxm:match-entries" {
         ext:augment-identifier "ofj-aug_nx_match";
         uses ofj-nxm-nx-match-reg-grouping;
@@ -177,6 +199,8 @@ module nicira-match {
         uses ofj-nxm-of-match-eth-src-grouping;
         uses ofj-nxm-of-match-eth-dst-grouping;
         uses ofj-nxm-of-match-eth-type-grouping;
+        uses ofj-nxm-nx-match-nsp-grouping;
+        uses ofj-nxm-nx-match-nsi-grouping;
     }
 
-}
\ No newline at end of file
+}
diff --git a/extension/openflowplugin-extension-nicira-config/pom.xml b/extension/openflowplugin-extension-nicira-config/pom.xml
new file mode 100644 (file)
index 0000000..fb4cb2d
--- /dev/null
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+      <groupId>org.opendaylight.openflowplugin</groupId>
+      <artifactId>openflowplugin-extension-parent</artifactId>
+      <version>0.1.0-SNAPSHOT</version>
+      <relativePath>../</relativePath>
+    </parent>
+
+    <artifactId>openflowplugin-extension-nicira-config</artifactId>
+    <description>Controller Configuration files for Nicira extensions</description>
+    <packaging>jar</packaging>
+    <build>
+      <plugins>
+          <plugin>
+          <groupId>org.codehaus.mojo</groupId>
+          <artifactId>build-helper-maven-plugin</artifactId>
+          <executions>
+            <execution>
+              <id>attach-artifacts-nicira-extension-config</id>
+              <goals>
+                <goal>attach-artifact</goal>
+              </goals>
+              <phase>package</phase>
+              <configuration>
+                <artifacts>
+                  <artifact>
+                    <file>${project.build.directory}/classes/initial/43-openflowjava-nx-config.xml</file>
+                    <type>xml</type>
+                    <classifier>config</classifier>
+                  </artifact>
+                </artifacts>
+              </configuration>
+            </execution>
+          </executions>
+        </plugin>
+      </plugins>
+    </build>
+</project>
similarity index 55%
rename from extension/openflowjava-extension-nicira-api/src/main/resources/initial/43-openflowjava-nx-api-config.xml
rename to extension/openflowplugin-extension-nicira-config/src/main/resources/initial/43-openflowjava-nx-config.xml
index 1964e4d3296490ac0343bfa1ea63a87956ea414b..6e999ec5ca657ba8f6c36aaa243ba8762d4eba91 100644 (file)
@@ -3,6 +3,8 @@
 <snapshot>
   <required-capabilities>
     <capability>urn:opendaylight:params:xml:ns:yang:openflowplugin:ofjava:nx:api:config?module=openflowjava-nx-api-config&amp;revision=2014-07-11</capability>
+    <capability>urn:opendaylight:params:xml:ns:yang:openflowplugin:ofjava:nx:config?module=openflowjava-nx-config&amp;revision=2014-07-11</capability>
+    <capability>urn:opendaylight:params:xml:ns:yang:openflow:common:config?module=openflow-provider&amp;revision=2014-03-26</capability>    
   </required-capabilities>
 
   <configuration>
     <data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
       <modules xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
         <module>
+          <!-- openflowjava codec registry provider -->
           <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:openflowplugin:ofjava:nx:api:config">prefix:openflowjava-extension-nicira-api</type>
           <name>openflowjava-extension-nx-api-bundle</name>
+          
           <openflow-switch-connection-provider>
             <type xmlns:ofSwitch="urn:opendaylight:params:xml:ns:yang:openflow:switch:connection:provider">ofSwitch:openflow-switch-connection-provider</type>
             <name>openflow-switch-connection-provider-legacy</name>
             <name>openflow-switch-connection-provider-default</name>
           </openflow-switch-connection-provider>
         </module>
+        
+        <module>
+          <!-- openflowjava codecs -->
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:openflowplugin:ofjava:nx:config">prefix:openflowjava-extension-nicira</type>
+          <name>openflow-nx-bundle</name>
+          
+          <nicira-extension-codec-registrator>
+            <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:openflowplugin:ofjava:nx:api:config">prefix:nicira-extension-codec-registrator</type>
+            <name>openflowjava-nicira-ext-registrator</name>
+          </nicira-extension-codec-registrator>
+        </module>
+        
+        <module>
+          <!-- openflowplugin codecs/converters -->
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:openflowplugin:nx:config:impl">prefix:nicira-extension-provider-impl</type>
+          <name>nicira-extension-provider-default-impl</name>
+          
+          <openflow-plugin-provider>
+            <type xmlns:opfprov="urn:opendaylight:params:xml:ns:yang:openflow:common:config">opfprov:openflow-provider</type>
+            <name>openflow-provider</name>
+          </openflow-plugin-provider>
+        </module>
       </modules>
 
       <services xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
         <service>
+          <!-- exposing openflowjava codec registry provider -->
           <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:openflowplugin:ofjava:nx:api:config">prefix:nicira-extension-codec-registrator</type>
           <instance>
             <name>openflowjava-nicira-ext-registrator</name>
index 3e638647fcfcd31acd201866ffb3b5ea4f365259..3b7cf0a9ef35784b312590d62e074a7bcc86cb3d 100644 (file)
@@ -1,6 +1,6 @@
 /**
  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
- * 
+ *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
@@ -14,6 +14,10 @@ import org.opendaylight.openflowjava.nx.api.NiciraUtil;
 import org.opendaylight.openflowjava.nx.codec.action.OutputRegCodec;
 import org.opendaylight.openflowjava.nx.codec.action.RegLoadCodec;
 import org.opendaylight.openflowjava.nx.codec.action.RegMoveCodec;
+import org.opendaylight.openflowjava.nx.codec.action.ResubmitCodec;
+import org.opendaylight.openflowjava.nx.codec.action.MultipathCodec;
+import org.opendaylight.openflowjava.nx.codec.action.SetNspCodec;
+import org.opendaylight.openflowjava.nx.codec.action.SetNsiCodec;
 import org.opendaylight.openflowjava.nx.codec.match.ArpOpCodec;
 import org.opendaylight.openflowjava.nx.codec.match.ArpShaCodec;
 import org.opendaylight.openflowjava.nx.codec.match.ArpSpaCodec;
@@ -33,6 +37,8 @@ import org.opendaylight.openflowjava.nx.codec.match.Reg7Codec;
 import org.opendaylight.openflowjava.nx.codec.match.TunIdCodec;
 import org.opendaylight.openflowjava.nx.codec.match.TunIpv4DstCodec;
 import org.opendaylight.openflowjava.nx.codec.match.TunIpv4SrcCodec;
+import org.opendaylight.openflowjava.nx.codec.match.NspCodec;
+import org.opendaylight.openflowjava.nx.codec.match.NsiCodec;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowplugin.extension.api.ConverterExtensionKey;
 import org.opendaylight.openflowplugin.extension.api.ConvertorActionToOFJava;
@@ -41,6 +47,10 @@ import org.opendaylight.openflowplugin.extension.api.TypeVersionKey;
 import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.action.OutputRegConvertor;
 import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.action.RegLoadConvertor;
 import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.action.RegMoveConvertor;
+import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.action.ResubmitConvertor;
+import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.action.MultipathConvertor;
+import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.action.SetNspConvertor;
+import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.action.SetNsiConvertor;
 import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.match.ArpOpConvertor;
 import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.match.ArpShaConvertor;
 import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.match.ArpSpaConvertor;
@@ -53,34 +63,74 @@ import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.match.R
 import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.match.TunIdConvertor;
 import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.match.TunIpv4DstConvertor;
 import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.match.TunIpv4SrcConvertor;
+import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.match.NsiConvertor;
+import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.match.NspConvertor;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action;
+
+
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.add.flow.input.instructions.instruction.instruction.apply.actions._case.apply.actions.action.action.NxActionOutputRegRpcAddFlowApplyActionsCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.add.flow.input.instructions.instruction.instruction.apply.actions._case.apply.actions.action.action.NxActionRegLoadRpcAddFlowApplyActionsCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.add.flow.input.instructions.instruction.instruction.apply.actions._case.apply.actions.action.action.NxActionRegMoveRpcAddFlowApplyActionsCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.add.flow.input.instructions.instruction.instruction.apply.actions._case.apply.actions.action.action.NxActionResubmitRpcAddFlowApplyActionsCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.add.flow.input.instructions.instruction.instruction.apply.actions._case.apply.actions.action.action.NxActionMultipathRpcAddFlowApplyActionsCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.add.flow.input.instructions.instruction.instruction.apply.actions._case.apply.actions.action.action.NxActionSetNspRpcAddFlowApplyActionsCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.add.flow.input.instructions.instruction.instruction.apply.actions._case.apply.actions.action.action.NxActionSetNsiRpcAddFlowApplyActionsCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.add.flow.input.instructions.instruction.instruction.write.actions._case.write.actions.action.action.NxActionOutputRegRpcAddFlowWriteActionsCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.add.flow.input.instructions.instruction.instruction.write.actions._case.write.actions.action.action.NxActionRegLoadRpcAddFlowWriteActionsCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.add.flow.input.instructions.instruction.instruction.write.actions._case.write.actions.action.action.NxActionRegMoveRpcAddFlowWriteActionsCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.add.flow.input.instructions.instruction.instruction.write.actions._case.write.actions.action.action.NxActionResubmitRpcAddFlowWriteActionsCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.add.flow.input.instructions.instruction.instruction.write.actions._case.write.actions.action.action.NxActionMultipathRpcAddFlowWriteActionsCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.add.flow.input.instructions.instruction.instruction.write.actions._case.write.actions.action.action.NxActionSetNspRpcAddFlowWriteActionsCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.add.flow.input.instructions.instruction.instruction.write.actions._case.write.actions.action.action.NxActionSetNsiRpcAddFlowWriteActionsCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.add.group.input.buckets.bucket.action.action.NxActionOutputRegRpcAddGroupCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.add.group.input.buckets.bucket.action.action.NxActionRegLoadRpcAddGroupCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.add.group.input.buckets.bucket.action.action.NxActionRegMoveRpcAddGroupCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.add.group.input.buckets.bucket.action.action.NxActionResubmitRpcAddGroupCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.add.group.input.buckets.bucket.action.action.NxActionMultipathRpcAddGroupCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.add.group.input.buckets.bucket.action.action.NxActionSetNspRpcAddGroupCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.add.group.input.buckets.bucket.action.action.NxActionSetNsiRpcAddGroupCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.group.buckets.bucket.action.action.NxActionOutputRegNodesNodeGroupBucketsBucketActionsCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.group.buckets.bucket.action.action.NxActionRegLoadNodesNodeGroupBucketsBucketActionsCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.group.buckets.bucket.action.action.NxActionRegMoveNodesNodeGroupBucketsBucketActionsCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.group.buckets.bucket.action.action.NxActionResubmitNodesNodeGroupBucketsBucketActionsCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.group.buckets.bucket.action.action.NxActionMultipathNodesNodeGroupBucketsBucketActionsCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.group.buckets.bucket.action.action.NxActionSetNspNodesNodeGroupBucketsBucketActionsCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.group.buckets.bucket.action.action.NxActionSetNsiNodesNodeGroupBucketsBucketActionsCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.table.flow.instructions.instruction.instruction.apply.actions._case.apply.actions.action.action.NxActionOutputRegNodesNodeTableFlowApplyActionsCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.table.flow.instructions.instruction.instruction.apply.actions._case.apply.actions.action.action.NxActionRegLoadNodesNodeTableFlowApplyActionsCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.table.flow.instructions.instruction.instruction.apply.actions._case.apply.actions.action.action.NxActionRegMoveNodesNodeTableFlowApplyActionsCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.table.flow.instructions.instruction.instruction.apply.actions._case.apply.actions.action.action.NxActionResubmitNodesNodeTableFlowApplyActionsCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.table.flow.instructions.instruction.instruction.apply.actions._case.apply.actions.action.action.NxActionMultipathNodesNodeTableFlowApplyActionsCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.table.flow.instructions.instruction.instruction.apply.actions._case.apply.actions.action.action.NxActionSetNspNodesNodeTableFlowApplyActionsCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.table.flow.instructions.instruction.instruction.apply.actions._case.apply.actions.action.action.NxActionSetNsiNodesNodeTableFlowApplyActionsCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.table.flow.instructions.instruction.instruction.write.actions._case.write.actions.action.action.NxActionOutputRegNodesNodeTableFlowWriteActionsCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.table.flow.instructions.instruction.instruction.write.actions._case.write.actions.action.action.NxActionRegLoadNodesNodeTableFlowWriteActionsCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.table.flow.instructions.instruction.instruction.write.actions._case.write.actions.action.action.NxActionRegMoveNodesNodeTableFlowWriteActionsCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.table.flow.instructions.instruction.instruction.write.actions._case.write.actions.action.action.NxActionResubmitNodesNodeTableFlowWriteActionsCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.table.flow.instructions.instruction.instruction.write.actions._case.write.actions.action.action.NxActionMultipathNodesNodeTableFlowWriteActionsCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.table.flow.instructions.instruction.instruction.write.actions._case.write.actions.action.action.NxActionSetNspNodesNodeTableFlowWriteActionsCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.table.flow.instructions.instruction.instruction.write.actions._case.write.actions.action.action.NxActionSetNsiNodesNodeTableFlowWriteActionsCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.remove.group.input.buckets.bucket.action.action.NxActionOutputRegRpcRemoveGroupCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.remove.group.input.buckets.bucket.action.action.NxActionRegLoadRpcRemoveGroupCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.remove.group.input.buckets.bucket.action.action.NxActionRegMoveRpcRemoveGroupCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.remove.group.input.buckets.bucket.action.action.NxActionResubmitRpcRemoveGroupCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.remove.group.input.buckets.bucket.action.action.NxActionMultipathRpcRemoveGroupCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.remove.group.input.buckets.bucket.action.action.NxActionSetNspRpcRemoveGroupCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.remove.group.input.buckets.bucket.action.action.NxActionSetNsiRpcRemoveGroupCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.update.group.input.original.group.buckets.bucket.action.action.NxActionOutputRegRpcUpdateGroupOriginalCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.update.group.input.original.group.buckets.bucket.action.action.NxActionRegLoadRpcUpdateGroupOriginalCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.update.group.input.original.group.buckets.bucket.action.action.NxActionRegMoveRpcUpdateGroupOriginalCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.update.group.input.original.group.buckets.bucket.action.action.NxActionResubmitRpcUpdateGroupOriginalCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.update.group.input.original.group.buckets.bucket.action.action.NxActionMultipathRpcUpdateGroupOriginalCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.update.group.input.original.group.buckets.bucket.action.action.NxActionSetNspRpcUpdateGroupOriginalCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.update.group.input.original.group.buckets.bucket.action.action.NxActionSetNsiRpcUpdateGroupOriginalCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.update.group.input.updated.group.buckets.bucket.action.action.NxActionOutputRegRpcUpdateGroupUpdatedCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.update.group.input.updated.group.buckets.bucket.action.action.NxActionRegLoadRpcUpdateGroupUpdatedCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.update.group.input.updated.group.buckets.bucket.action.action.NxActionRegMoveRpcUpdateGroupUpdatedCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.update.group.input.updated.group.buckets.bucket.action.action.NxActionResubmitRpcUpdateGroupUpdatedCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.update.group.input.updated.group.buckets.bucket.action.action.NxActionMultipathRpcUpdateGroupUpdatedCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.update.group.input.updated.group.buckets.bucket.action.action.NxActionSetNspRpcUpdateGroupUpdatedCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.update.group.input.updated.group.buckets.bucket.action.action.NxActionSetNsiRpcUpdateGroupUpdatedCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxArpShaKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxArpThaKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxReg0Key;
@@ -100,6 +150,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.ni
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmOfEthDstKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmOfEthSrcKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmOfEthTypeKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxNspKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxNsiKey;
 import org.opendaylight.yangtools.concepts.ObjectRegistration;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -107,10 +159,10 @@ import org.slf4j.LoggerFactory;
 import com.google.common.base.Preconditions;
 
 /**
- * 
+ *
  */
 public class NiciraExtensionProvider implements AutoCloseable {
-    
+
     private static final Logger LOG = LoggerFactory
             .getLogger(NiciraExtensionProvider.class);
 
@@ -132,6 +184,12 @@ public class NiciraExtensionProvider implements AutoCloseable {
     private final static RegMoveConvertor REG_MOVE_CONVERTOR = new RegMoveConvertor();
     private final static OutputRegConvertor OUTPUT_REG_CONVERTOR = new OutputRegConvertor();
     private final static EthTypeConvertor ETH_TYPE_CONVERTOR = new EthTypeConvertor();
+    private final static ResubmitConvertor RESUBMIT_CONVERTOR = new ResubmitConvertor();
+    private final static MultipathConvertor MULTIPATH_CONVERTOR = new MultipathConvertor();
+    private final static SetNspConvertor SET_NSP_CONVERTOR = new SetNspConvertor();
+    private final static SetNsiConvertor SET_NSI_CONVERTOR = new SetNsiConvertor();
+    private final static NspConvertor NSP_CONVERTOR = new NspConvertor();
+    private final static NsiConvertor NSI_CONVERTOR = new NsiConvertor();
 
     @Override
     public void close() {
@@ -163,21 +221,43 @@ public class NiciraExtensionProvider implements AutoCloseable {
         registerAction13(NxActionRegLoadNodesNodeTableFlowApplyActionsCase.class, REG_LOAD_CONVERTOR);
         registerAction13(NxActionRegMoveNodesNodeTableFlowApplyActionsCase.class, REG_MOVE_CONVERTOR);
         registerAction13(NxActionOutputRegNodesNodeTableFlowApplyActionsCase.class, OUTPUT_REG_CONVERTOR);
+        registerAction13(NxActionResubmitNodesNodeTableFlowApplyActionsCase.class, RESUBMIT_CONVERTOR);
+        registerAction13(NxActionMultipathNodesNodeTableFlowApplyActionsCase.class, MULTIPATH_CONVERTOR);
+        registerAction13(NxActionSetNspNodesNodeTableFlowApplyActionsCase.class, SET_NSP_CONVERTOR);
+        registerAction13(NxActionSetNsiNodesNodeTableFlowApplyActionsCase.class, SET_NSI_CONVERTOR);
+
         registerAction13(NxActionRegLoadNodesNodeTableFlowWriteActionsCase.class, REG_LOAD_CONVERTOR);
         registerAction13(NxActionRegMoveNodesNodeTableFlowWriteActionsCase.class, REG_MOVE_CONVERTOR);
         registerAction13(NxActionOutputRegNodesNodeTableFlowWriteActionsCase.class, OUTPUT_REG_CONVERTOR);
+        registerAction13(NxActionResubmitNodesNodeTableFlowWriteActionsCase.class, RESUBMIT_CONVERTOR);
+        registerAction13(NxActionMultipathNodesNodeTableFlowWriteActionsCase.class, MULTIPATH_CONVERTOR);
+        registerAction13(NxActionSetNspNodesNodeTableFlowWriteActionsCase.class, SET_NSP_CONVERTOR);
+        registerAction13(NxActionSetNsiNodesNodeTableFlowWriteActionsCase.class, SET_NSI_CONVERTOR);
+
         registerAction13(NxActionRegLoadNodesNodeGroupBucketsBucketActionsCase.class, REG_LOAD_CONVERTOR);
         registerAction13(NxActionRegMoveNodesNodeGroupBucketsBucketActionsCase.class, REG_MOVE_CONVERTOR);
         registerAction13(NxActionOutputRegNodesNodeGroupBucketsBucketActionsCase.class, OUTPUT_REG_CONVERTOR);
+        registerAction13(NxActionResubmitNodesNodeGroupBucketsBucketActionsCase.class, RESUBMIT_CONVERTOR);
+        registerAction13(NxActionMultipathNodesNodeGroupBucketsBucketActionsCase.class, MULTIPATH_CONVERTOR);
+        registerAction13(NxActionSetNspNodesNodeGroupBucketsBucketActionsCase.class, SET_NSP_CONVERTOR);
+        registerAction13(NxActionSetNsiNodesNodeGroupBucketsBucketActionsCase.class, SET_NSI_CONVERTOR);
 
         // src=rpc-addFlow
         registerAction13(NxActionRegLoadRpcAddFlowApplyActionsCase.class, REG_LOAD_CONVERTOR);
         registerAction13(NxActionRegMoveRpcAddFlowApplyActionsCase.class, REG_MOVE_CONVERTOR);
         registerAction13(NxActionOutputRegRpcAddFlowApplyActionsCase.class, OUTPUT_REG_CONVERTOR);
+        registerAction13(NxActionResubmitRpcAddFlowApplyActionsCase.class, RESUBMIT_CONVERTOR);
+        registerAction13(NxActionMultipathRpcAddFlowApplyActionsCase.class, MULTIPATH_CONVERTOR);
+        registerAction13(NxActionSetNspRpcAddFlowApplyActionsCase.class, SET_NSP_CONVERTOR);
+        registerAction13(NxActionSetNsiRpcAddFlowApplyActionsCase.class, SET_NSI_CONVERTOR);
 
         registerAction13(NxActionRegLoadRpcAddFlowWriteActionsCase.class, REG_LOAD_CONVERTOR);
         registerAction13(NxActionRegMoveRpcAddFlowWriteActionsCase.class, REG_MOVE_CONVERTOR);
         registerAction13(NxActionOutputRegRpcAddFlowWriteActionsCase.class, OUTPUT_REG_CONVERTOR);
+        registerAction13(NxActionResubmitRpcAddFlowWriteActionsCase.class, RESUBMIT_CONVERTOR);
+        registerAction13(NxActionMultipathRpcAddFlowWriteActionsCase.class, MULTIPATH_CONVERTOR);
+        registerAction13(NxActionSetNspRpcAddFlowWriteActionsCase.class, SET_NSP_CONVERTOR);
+        registerAction13(NxActionSetNsiRpcAddFlowWriteActionsCase.class, SET_NSI_CONVERTOR);
 
         registerAction13(NxActionRegLoadRpcAddGroupCase.class, REG_LOAD_CONVERTOR);
         registerAction13(NxActionRegLoadRpcRemoveGroupCase.class, REG_LOAD_CONVERTOR);
@@ -191,10 +271,30 @@ public class NiciraExtensionProvider implements AutoCloseable {
         registerAction13(NxActionOutputRegRpcRemoveGroupCase.class, OUTPUT_REG_CONVERTOR);
         registerAction13(NxActionOutputRegRpcUpdateGroupOriginalCase.class, OUTPUT_REG_CONVERTOR);
         registerAction13(NxActionOutputRegRpcUpdateGroupUpdatedCase.class, OUTPUT_REG_CONVERTOR);
+        registerAction13(NxActionResubmitRpcAddGroupCase.class, RESUBMIT_CONVERTOR);
+        registerAction13(NxActionResubmitRpcRemoveGroupCase.class, RESUBMIT_CONVERTOR);
+        registerAction13(NxActionResubmitRpcUpdateGroupOriginalCase.class, RESUBMIT_CONVERTOR);
+        registerAction13(NxActionResubmitRpcUpdateGroupUpdatedCase.class, RESUBMIT_CONVERTOR);
+        registerAction13(NxActionMultipathRpcAddGroupCase.class, MULTIPATH_CONVERTOR);
+        registerAction13(NxActionMultipathRpcRemoveGroupCase.class, MULTIPATH_CONVERTOR);
+        registerAction13(NxActionMultipathRpcUpdateGroupOriginalCase.class, MULTIPATH_CONVERTOR);
+        registerAction13(NxActionMultipathRpcUpdateGroupUpdatedCase.class, MULTIPATH_CONVERTOR);
+        registerAction13(NxActionSetNspRpcAddGroupCase.class, SET_NSP_CONVERTOR);
+        registerAction13(NxActionSetNspRpcRemoveGroupCase.class, SET_NSP_CONVERTOR);
+        registerAction13(NxActionSetNspRpcUpdateGroupOriginalCase.class, SET_NSP_CONVERTOR);
+        registerAction13(NxActionSetNspRpcUpdateGroupUpdatedCase.class, SET_NSP_CONVERTOR);
+        registerAction13(NxActionSetNsiRpcAddGroupCase.class, SET_NSI_CONVERTOR);
+        registerAction13(NxActionSetNsiRpcRemoveGroupCase.class, SET_NSI_CONVERTOR);
+        registerAction13(NxActionSetNsiRpcUpdateGroupOriginalCase.class, SET_NSI_CONVERTOR);
+        registerAction13(NxActionSetNsiRpcUpdateGroupUpdatedCase.class, SET_NSI_CONVERTOR);
 
         registrations.add(extensionConverterRegistrator.registerActionConvertor(NiciraUtil.createOfJavaKeyFrom(RegLoadCodec.SERIALIZER_KEY), REG_LOAD_CONVERTOR));
         registrations.add(extensionConverterRegistrator.registerActionConvertor(NiciraUtil.createOfJavaKeyFrom(RegMoveCodec.SERIALIZER_KEY), REG_MOVE_CONVERTOR));
         registrations.add(extensionConverterRegistrator.registerActionConvertor(NiciraUtil.createOfJavaKeyFrom(OutputRegCodec.SERIALIZER_KEY), OUTPUT_REG_CONVERTOR));
+        registrations.add(extensionConverterRegistrator.registerActionConvertor(NiciraUtil.createOfJavaKeyFrom(ResubmitCodec.SERIALIZER_KEY), RESUBMIT_CONVERTOR));
+        registrations.add(extensionConverterRegistrator.registerActionConvertor(NiciraUtil.createOfJavaKeyFrom(MultipathCodec.SERIALIZER_KEY), MULTIPATH_CONVERTOR));
+        registrations.add(extensionConverterRegistrator.registerActionConvertor(NiciraUtil.createOfJavaKeyFrom(SetNspCodec.SERIALIZER_KEY), SET_NSP_CONVERTOR));
+        registrations.add(extensionConverterRegistrator.registerActionConvertor(NiciraUtil.createOfJavaKeyFrom(SetNsiCodec.SERIALIZER_KEY), SET_NSI_CONVERTOR));
 
         registrations.add(extensionConverterRegistrator.registerMatchConvertor(new ConverterExtensionKey<>(NxmNxReg0Key.class, EncodeConstants.OF13_VERSION_ID), REG_CONVERTOR));
         registrations.add(extensionConverterRegistrator.registerMatchConvertor(new ConverterExtensionKey<>(NxmNxReg1Key.class, EncodeConstants.OF13_VERSION_ID), REG_CONVERTOR));
@@ -235,6 +335,10 @@ public class NiciraExtensionProvider implements AutoCloseable {
         registrations.add(extensionConverterRegistrator.registerMatchConvertor(EthDstCodec.SERIALIZER_KEY, ETH_DST_CONVERTOR));
         registrations.add(extensionConverterRegistrator.registerMatchConvertor(new ConverterExtensionKey<>(NxmOfEthTypeKey.class, EncodeConstants.OF13_VERSION_ID), ETH_TYPE_CONVERTOR));
         registrations.add(extensionConverterRegistrator.registerMatchConvertor(EthTypeCodec.SERIALIZER_KEY, ETH_TYPE_CONVERTOR));
+        registrations.add(extensionConverterRegistrator.registerMatchConvertor(new ConverterExtensionKey<>(NxmNxNspKey.class, EncodeConstants.OF13_VERSION_ID), NSP_CONVERTOR));
+        registrations.add(extensionConverterRegistrator.registerMatchConvertor(NspCodec.SERIALIZER_KEY, NSP_CONVERTOR));
+        registrations.add(extensionConverterRegistrator.registerMatchConvertor(new ConverterExtensionKey<>(NxmNxNsiKey.class, EncodeConstants.OF13_VERSION_ID), NSI_CONVERTOR));
+        registrations.add(extensionConverterRegistrator.registerMatchConvertor(NsiCodec.SERIALIZER_KEY, NSI_CONVERTOR));
     }
 
     /**
diff --git a/extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/action/MultipathConvertor.java b/extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/action/MultipathConvertor.java
new file mode 100644 (file)
index 0000000..542a022
--- /dev/null
@@ -0,0 +1,106 @@
+/*
+ * Copyright (C) 2014 SDN Hub, LLC.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Authors : Srini Seetharaman
+ */
+package org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.action;
+
+import org.opendaylight.openflowplugin.extension.api.ConvertorActionFromOFJava;
+import org.opendaylight.openflowplugin.extension.api.ConvertorActionToOFJava;
+import org.opendaylight.openflowplugin.extension.api.path.ActionPath;
+import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.CodecPreconditionException;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.NxmNxMultipath;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.OfjAugNxAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.OfjAugNxActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.multipath.grouping.ActionMultipath;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.multipath.grouping.ActionMultipathBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.NxActionMultipathGrouping;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.flows.statistics.update.flow.and.statistics.map.list.instructions.instruction.instruction.apply.actions._case.apply.actions.action.action.NxActionMultipathNotifFlowsStatisticsUpdateApplyActionsCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.flows.statistics.update.flow.and.statistics.map.list.instructions.instruction.instruction.write.actions._case.write.actions.action.action.NxActionMultipathNotifFlowsStatisticsUpdateWriteActionsCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.group.desc.stats.updated.group.desc.stats.buckets.bucket.action.action.NxActionMultipathNotifGroupDescStatsUpdatedCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.table.flow.instructions.instruction.instruction.write.actions._case.write.actions.action.action.NxActionMultipathNodesNodeTableFlowWriteActionsCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.multipath.grouping.NxMultipath;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.multipath.grouping.NxMultipathBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.multipath.grouping.nx.multipath.Dst;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.multipath.grouping.nx.multipath.DstBuilder;
+import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.action.RegMoveConvertor;
+
+import com.google.common.base.Preconditions;
+
+public class MultipathConvertor implements
+ConvertorActionToOFJava<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action, Action>,
+ConvertorActionFromOFJava<Action, ActionPath> {
+
+    @Override
+    public org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action convert(Action input, ActionPath path) {
+        ActionMultipath action = input.getAugmentation(OfjAugNxAction.class).getActionMultipath();
+        DstBuilder dstBuilder = new DstBuilder();
+        dstBuilder.setDstChoice(RegMoveConvertor.resolveDst(action.getDst()));
+        dstBuilder.setStart(resolveStart(action.getOfsNbits()));
+        dstBuilder.setEnd(resolveEnd(action.getOfsNbits()));
+        NxMultipathBuilder builder = new NxMultipathBuilder();
+        builder.setBasis(action.getBasis());
+        builder.setAlgorithm(action.getAlgorithm());
+        builder.setMaxLink(action.getMaxLink());
+        builder.setArg(action.getArg());
+        builder.setDst(dstBuilder.build());
+        return resolveAction(builder.build(), path);
+    }
+
+    private static int resolveStart(int ofsNBints) {
+        return extractSub(ofsNBints, 10, 6);
+    }
+
+    private static int resolveEnd(int ofsNBints) {
+        int ofs = extractSub(ofsNBints, 10, 6);
+        int nBits = extractSub(ofsNBints, 6, 0);
+        return ofs + nBits;
+    }
+
+    private static int extractSub(final int l, final int nrBits, final int offset) {
+        final int rightShifted = l >>> offset;
+        final int mask = (1 << nrBits) - 1;
+        return rightShifted & mask;
+    }
+
+    private static org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action resolveAction(NxMultipath value, ActionPath path) {
+        switch (path) {
+        case NODES_NODE_TABLE_FLOW_INSTRUCTIONS_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION_EXTENSIONLIST_EXTENSION:
+            return new NxActionMultipathNodesNodeTableFlowWriteActionsCaseBuilder().setNxMultipath(value).build();
+        case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION:
+            return new NxActionMultipathNotifFlowsStatisticsUpdateWriteActionsCaseBuilder().setNxMultipath(value).build();
+        case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION:
+            return new NxActionMultipathNotifFlowsStatisticsUpdateApplyActionsCaseBuilder().setNxMultipath(value).build();
+        case GROUPDESCSTATSUPDATED_GROUPDESCSTATS_BUCKETS_BUCKET_ACTION:
+            return new NxActionMultipathNotifGroupDescStatsUpdatedCaseBuilder().setNxMultipath(value).build();
+        default:
+            throw new CodecPreconditionException(path);
+        }
+    }
+
+    @Override
+    public Action convert(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action nxActionArg) {
+        Preconditions.checkArgument(nxActionArg instanceof NxActionMultipathGrouping);
+        NxActionMultipathGrouping nxAction = (NxActionMultipathGrouping) nxActionArg;
+        ActionMultipathBuilder builder = new ActionMultipathBuilder();
+
+        builder.setFields(nxAction.getNxMultipath().getFields());
+        builder.setBasis(nxAction.getNxMultipath().getBasis());
+        builder.setAlgorithm(nxAction.getNxMultipath().getAlgorithm());
+        builder.setMaxLink(nxAction.getNxMultipath().getMaxLink());
+        builder.setArg(nxAction.getNxMultipath().getArg());
+        Dst dst = nxAction.getNxMultipath().getDst();
+        builder.setOfsNbits((dst.getStart() << 6) | (dst.getEnd() - dst.getStart()));
+        builder.setDst(RegMoveConvertor.resolveDst(dst.getDstChoice()));
+
+        OfjAugNxActionBuilder augNxActionBuilder = new OfjAugNxActionBuilder();
+        augNxActionBuilder.setActionMultipath(builder.build());
+        return ActionUtil.createNiciraAction(augNxActionBuilder.build(), NxmNxMultipath.class);
+    }
+
+}
diff --git a/extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/action/ResubmitConvertor.java b/extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/action/ResubmitConvertor.java
new file mode 100644 (file)
index 0000000..81553b4
--- /dev/null
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2014 Red Hat, Inc.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Authors : Madhu Venugopal
+ */
+
+package org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.action;
+
+import org.opendaylight.openflowplugin.extension.api.ConvertorActionFromOFJava;
+import org.opendaylight.openflowplugin.extension.api.ConvertorActionToOFJava;
+import org.opendaylight.openflowplugin.extension.api.path.ActionPath;
+import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.CodecPreconditionException;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.NxmNxResubmit;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.OfjAugNxAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.OfjAugNxActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.resubmit.grouping.ActionResubmit;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.resubmit.grouping.ActionResubmitBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.NxActionResubmitGrouping;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.flows.statistics.update.flow.and.statistics.map.list.instructions.instruction.instruction.apply.actions._case.apply.actions.action.action.NxActionResubmitNotifFlowsStatisticsUpdateApplyActionsCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.flows.statistics.update.flow.and.statistics.map.list.instructions.instruction.instruction.write.actions._case.write.actions.action.action.NxActionResubmitNotifFlowsStatisticsUpdateWriteActionsCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.group.desc.stats.updated.group.desc.stats.buckets.bucket.action.action.NxActionResubmitNotifGroupDescStatsUpdatedCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.table.flow.instructions.instruction.instruction.write.actions._case.write.actions.action.action.NxActionResubmitNodesNodeTableFlowWriteActionsCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.resubmit.grouping.NxResubmit;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.resubmit.grouping.NxResubmitBuilder;
+
+import com.google.common.base.Preconditions;
+
+/**
+ * Convert to/from SAL flow model to openflowjava model for Resubmit action
+ */
+public class ResubmitConvertor implements
+ConvertorActionToOFJava<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action, Action>,
+ConvertorActionFromOFJava<Action, ActionPath> {
+
+    @Override
+    public org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action convert(Action input, ActionPath path) {
+        ActionResubmit action = input.getAugmentation(OfjAugNxAction.class).getActionResubmit();
+        NxResubmitBuilder builder = new NxResubmitBuilder();
+        builder.setInPort(action.getInPort());
+        builder.setTable(action.getTable());
+        return resolveAction(builder.build(), path);
+    }
+
+    private static org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action resolveAction(NxResubmit value, ActionPath path) {
+        switch (path) {
+        case NODES_NODE_TABLE_FLOW_INSTRUCTIONS_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION_EXTENSIONLIST_EXTENSION:
+            return new NxActionResubmitNodesNodeTableFlowWriteActionsCaseBuilder().setNxResubmit(value).build();
+        case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION:
+            return new NxActionResubmitNotifFlowsStatisticsUpdateWriteActionsCaseBuilder().setNxResubmit(value).build();
+        case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION:
+            return new NxActionResubmitNotifFlowsStatisticsUpdateApplyActionsCaseBuilder().setNxResubmit(value).build();
+        case GROUPDESCSTATSUPDATED_GROUPDESCSTATS_BUCKETS_BUCKET_ACTION:
+            return new NxActionResubmitNotifGroupDescStatsUpdatedCaseBuilder().setNxResubmit(value).build();
+        default:
+            throw new CodecPreconditionException(path);
+        }
+    }
+
+    @Override
+    public Action convert(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action nxActionArg) {
+        Preconditions.checkArgument(nxActionArg instanceof NxActionResubmitGrouping);
+        NxActionResubmitGrouping nxAction = (NxActionResubmitGrouping) nxActionArg;
+        ActionResubmitBuilder builder = new ActionResubmitBuilder();
+        builder.setInPort(nxAction.getNxResubmit().getInPort());
+        builder.setTable(nxAction.getNxResubmit().getTable());
+        OfjAugNxActionBuilder augNxActionBuilder = new OfjAugNxActionBuilder();
+        augNxActionBuilder.setActionResubmit(builder.build());
+        return ActionUtil.createNiciraAction(augNxActionBuilder.build(), NxmNxResubmit.class);
+    }
+
+}
diff --git a/extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/action/SetNsiConvertor.java b/extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/action/SetNsiConvertor.java
new file mode 100644 (file)
index 0000000..12e5afa
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2014 Red Hat, Inc.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Authors : Madhu Venugopal
+ */
+package org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.action;
+
+import org.opendaylight.openflowplugin.extension.api.ConvertorActionFromOFJava;
+import org.opendaylight.openflowplugin.extension.api.ConvertorActionToOFJava;
+import org.opendaylight.openflowplugin.extension.api.path.ActionPath;
+import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.CodecPreconditionException;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.NxmNxSetNsi;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.OfjAugNxAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.OfjAugNxActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.set.nsi.grouping.ActionSetNsi;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.set.nsi.grouping.ActionSetNsiBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.NxActionSetNsiGrouping;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.flows.statistics.update.flow.and.statistics.map.list.instructions.instruction.instruction.apply.actions._case.apply.actions.action.action.NxActionSetNsiNotifFlowsStatisticsUpdateApplyActionsCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.flows.statistics.update.flow.and.statistics.map.list.instructions.instruction.instruction.write.actions._case.write.actions.action.action.NxActionSetNsiNotifFlowsStatisticsUpdateWriteActionsCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.group.desc.stats.updated.group.desc.stats.buckets.bucket.action.action.NxActionSetNsiNotifGroupDescStatsUpdatedCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.table.flow.instructions.instruction.instruction.write.actions._case.write.actions.action.action.NxActionSetNsiNodesNodeTableFlowWriteActionsCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.set.nsi.grouping.NxSetNsi;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.set.nsi.grouping.NxSetNsiBuilder;
+
+import com.google.common.base.Preconditions;
+
+public class SetNsiConvertor implements
+ConvertorActionToOFJava<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action, Action>,
+ConvertorActionFromOFJava<Action, ActionPath> {
+
+    @Override
+    public org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action convert(Action input, ActionPath path) {
+        ActionSetNsi action = input.getAugmentation(OfjAugNxAction.class).getActionSetNsi();
+        NxSetNsiBuilder builder = new NxSetNsiBuilder();
+        builder.setNsi(action.getNsi());
+        return resolveAction(builder.build(), path);
+    }
+
+    private static org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action resolveAction(NxSetNsi value, ActionPath path) {
+        switch (path) {
+        case NODES_NODE_TABLE_FLOW_INSTRUCTIONS_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION_EXTENSIONLIST_EXTENSION:
+            return new NxActionSetNsiNodesNodeTableFlowWriteActionsCaseBuilder().setNxSetNsi(value).build();
+        case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION:
+            return new NxActionSetNsiNotifFlowsStatisticsUpdateWriteActionsCaseBuilder().setNxSetNsi(value).build();
+        case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION:
+            return new NxActionSetNsiNotifFlowsStatisticsUpdateApplyActionsCaseBuilder().setNxSetNsi(value).build();
+        case GROUPDESCSTATSUPDATED_GROUPDESCSTATS_BUCKETS_BUCKET_ACTION:
+            return new NxActionSetNsiNotifGroupDescStatsUpdatedCaseBuilder().setNxSetNsi(value).build();
+        default:
+            throw new CodecPreconditionException(path);
+        }
+    }
+
+    @Override
+    public Action convert(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action nxActionArg) {
+        Preconditions.checkArgument(nxActionArg instanceof NxActionSetNsiGrouping);
+        NxActionSetNsiGrouping nxAction = (NxActionSetNsiGrouping) nxActionArg;
+        ActionSetNsiBuilder builder = new ActionSetNsiBuilder();
+        builder.setNsi(nxAction.getNxSetNsi().getNsi());
+        OfjAugNxActionBuilder augNxActionBuilder = new OfjAugNxActionBuilder();
+        augNxActionBuilder.setActionSetNsi(builder.build());
+        return ActionUtil.createNiciraAction(augNxActionBuilder.build(), NxmNxSetNsi.class);
+    }
+
+}
\ No newline at end of file
diff --git a/extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/action/SetNspConvertor.java b/extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/action/SetNspConvertor.java
new file mode 100644 (file)
index 0000000..39f34ab
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2014 Red Hat, Inc.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Authors : Madhu Venugopal
+ */
+package org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.action;
+
+import org.opendaylight.openflowplugin.extension.api.ConvertorActionFromOFJava;
+import org.opendaylight.openflowplugin.extension.api.ConvertorActionToOFJava;
+import org.opendaylight.openflowplugin.extension.api.path.ActionPath;
+import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.CodecPreconditionException;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.NxmNxSetNsp;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.OfjAugNxAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.OfjAugNxActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.set.nsp.grouping.ActionSetNsp;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.set.nsp.grouping.ActionSetNspBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.NxActionSetNspGrouping;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.flows.statistics.update.flow.and.statistics.map.list.instructions.instruction.instruction.apply.actions._case.apply.actions.action.action.NxActionSetNspNotifFlowsStatisticsUpdateApplyActionsCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.flows.statistics.update.flow.and.statistics.map.list.instructions.instruction.instruction.write.actions._case.write.actions.action.action.NxActionSetNspNotifFlowsStatisticsUpdateWriteActionsCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.group.desc.stats.updated.group.desc.stats.buckets.bucket.action.action.NxActionSetNspNotifGroupDescStatsUpdatedCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.table.flow.instructions.instruction.instruction.write.actions._case.write.actions.action.action.NxActionSetNspNodesNodeTableFlowWriteActionsCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.set.nsp.grouping.NxSetNsp;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.set.nsp.grouping.NxSetNspBuilder;
+
+import com.google.common.base.Preconditions;
+
+public class SetNspConvertor implements
+ConvertorActionToOFJava<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action, Action>,
+ConvertorActionFromOFJava<Action, ActionPath> {
+
+    @Override
+    public org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action convert(Action input, ActionPath path) {
+        ActionSetNsp action = input.getAugmentation(OfjAugNxAction.class).getActionSetNsp();
+        NxSetNspBuilder builder = new NxSetNspBuilder();
+        builder.setNsp(action.getNsp());
+        return resolveAction(builder.build(), path);
+    }
+
+    private static org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action resolveAction(NxSetNsp value, ActionPath path) {
+        switch (path) {
+        case NODES_NODE_TABLE_FLOW_INSTRUCTIONS_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION_EXTENSIONLIST_EXTENSION:
+            return new NxActionSetNspNodesNodeTableFlowWriteActionsCaseBuilder().setNxSetNsp(value).build();
+        case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION:
+            return new NxActionSetNspNotifFlowsStatisticsUpdateWriteActionsCaseBuilder().setNxSetNsp(value).build();
+        case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION:
+            return new NxActionSetNspNotifFlowsStatisticsUpdateApplyActionsCaseBuilder().setNxSetNsp(value).build();
+        case GROUPDESCSTATSUPDATED_GROUPDESCSTATS_BUCKETS_BUCKET_ACTION:
+            return new NxActionSetNspNotifGroupDescStatsUpdatedCaseBuilder().setNxSetNsp(value).build();
+        default:
+            throw new CodecPreconditionException(path);
+        }
+    }
+
+    @Override
+    public Action convert(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action nxActionArg) {
+        Preconditions.checkArgument(nxActionArg instanceof NxActionSetNspGrouping);
+        NxActionSetNspGrouping nxAction = (NxActionSetNspGrouping) nxActionArg;
+        ActionSetNspBuilder builder = new ActionSetNspBuilder();
+        builder.setNsp(nxAction.getNxSetNsp().getNsp());
+        OfjAugNxActionBuilder augNxActionBuilder = new OfjAugNxActionBuilder();
+        augNxActionBuilder.setActionSetNsp(builder.build());
+        return ActionUtil.createNiciraAction(augNxActionBuilder.build(), NxmNxSetNsp.class);
+    }
+
+}
\ No newline at end of file
index 3ba9bbe95dff1c648404f8ffc8ecae9eab2223fb..ac3449e4dbbfb11a840b2e16e41c03e0ad740a8d 100644 (file)
@@ -41,6 +41,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.ni
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmOfEthDstGrouping;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmOfEthSrcGrouping;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmOfEthTypeGrouping;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxNspGrouping;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxNsiGrouping;
 import org.opendaylight.yangtools.yang.binding.Augmentation;
 
 /**
@@ -74,6 +76,10 @@ public class MatchUtil {
             NxmOfEthSrcGrouping.class);
     public final static GroupingResolver<NxmOfEthTypeGrouping, Extension> ethTypeResolver = new GroupingResolver<>(
             NxmOfEthTypeGrouping.class);
+    public final static GroupingResolver<NxmNxNsiGrouping, Extension> nsiResolver = new GroupingResolver<>(
+            NxmNxNsiGrouping.class);
+    public final static GroupingResolver<NxmNxNspGrouping, Extension> nspResolver = new GroupingResolver<>(
+            NxmNxNspGrouping.class);
     public final static ExperimenterIdMatchEntry EXPERIMENTER_ID_MATCH_ENTRY;
 
     static {
@@ -97,6 +103,8 @@ public class MatchUtil {
         ethDstResolver.setAugmentations(augmentationsOfExtension);
         ethSrcResolver.setAugmentations(augmentationsOfExtension);
         ethTypeResolver.setAugmentations(augmentationsOfExtension);
+        nspResolver.setAugmentations(augmentationsOfExtension);
+        nsiResolver.setAugmentations(augmentationsOfExtension);
         ExperimenterIdMatchEntryBuilder experimenterIdMatchEntryBuilder = new ExperimenterIdMatchEntryBuilder();
         experimenterIdMatchEntryBuilder.setExperimenter(new ExperimenterId(NiciraConstants.NX_VENDOR_ID));
         EXPERIMENTER_ID_MATCH_ENTRY = experimenterIdMatchEntryBuilder.build();
diff --git a/extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/NsiConvertor.java b/extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/NsiConvertor.java
new file mode 100644 (file)
index 0000000..8828b17
--- /dev/null
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2014 Red Hat, Inc.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Authors : Madhu Venugopal
+ */
+package org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.match;
+
+import org.opendaylight.openflowplugin.extension.api.ConvertorFromOFJava;
+import org.opendaylight.openflowplugin.extension.api.ConvertorToOFJava;
+import org.opendaylight.openflowplugin.extension.api.ExtensionAugment;
+import org.opendaylight.openflowplugin.extension.api.path.MatchPath;
+import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.CodecPreconditionException;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Nxm1Class;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.OfjAugNxMatch;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.OfjAugNxMatchBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.nx.match.nsi.grouping.NsiValues;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.nx.match.nsi.grouping.NsiValuesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.ExtensionKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.general.extension.grouping.Extension;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxAugMatchNotifPacketIn;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxAugMatchNotifPacketInBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxAugMatchNotifSwitchFlowRemoved;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxAugMatchNotifSwitchFlowRemovedBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxAugMatchNotifUpdateFlowStats;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxAugMatchNotifUpdateFlowStatsBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxNsiGrouping;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxNsiKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.nxm.nx.nsi.grouping.NxmNxNsi;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.nxm.nx.nsi.grouping.NxmNxNsiBuilder;
+import org.opendaylight.yangtools.yang.binding.Augmentation;
+
+import com.google.common.base.Optional;
+public class NsiConvertor implements ConvertorToOFJava<MatchEntries>, ConvertorFromOFJava<MatchEntries, MatchPath> {
+    @Override
+    public ExtensionAugment<? extends Augmentation<Extension>> convert(MatchEntries input, MatchPath path) {
+        NsiValues values = input.getAugmentation(OfjAugNxMatch.class).getNsiValues();
+        return resolveAugmentation(new NxmNxNsiBuilder().setNsi(values.getNsi()).build(), path,
+                NxmNxNsiKey.class);
+    }
+
+    private static ExtensionAugment<? extends Augmentation<Extension>> resolveAugmentation(NxmNxNsi value,
+            MatchPath path, Class<? extends ExtensionKey> key) {
+        switch (path) {
+        case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH:
+            return new ExtensionAugment<>(NxAugMatchNotifUpdateFlowStats.class,
+                    new NxAugMatchNotifUpdateFlowStatsBuilder().setNxmNxNsi(value).build(), key);
+        case PACKETRECEIVED_MATCH:
+            return new ExtensionAugment<>(NxAugMatchNotifPacketIn.class, new NxAugMatchNotifPacketInBuilder()
+                    .setNxmNxNsi(value).build(), key);
+        case SWITCHFLOWREMOVED_MATCH:
+            return new ExtensionAugment<>(NxAugMatchNotifSwitchFlowRemoved.class,
+                    new NxAugMatchNotifSwitchFlowRemovedBuilder().setNxmNxNsi(value).build(), key);
+        default:
+            throw new CodecPreconditionException(path);
+        }
+    }
+
+    @Override
+    public MatchEntries convert(Extension extension) {
+        Optional<NxmNxNsiGrouping> matchGrouping = MatchUtil.nsiResolver.getExtension(extension);
+        if (!matchGrouping.isPresent()) {
+            throw new CodecPreconditionException(extension);
+        }
+        Short value = matchGrouping.get().getNxmNxNsi().getNsi();
+        OfjAugNxMatchBuilder augNxMatchBuilder = new OfjAugNxMatchBuilder().setNsiValues(new NsiValuesBuilder()
+                .setNsi(value).build());
+        return MatchUtil
+                .createNiciraMatchEntries(
+                        Nxm1Class.class,
+                        org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxNsi.class,
+                        false, augNxMatchBuilder.build());
+    }
+
+}
diff --git a/extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/NspConvertor.java b/extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/NspConvertor.java
new file mode 100644 (file)
index 0000000..91db426
--- /dev/null
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2014 Red Hat, Inc.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Authors : Madhu Venugopal
+ */
+package org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.match;
+
+import org.opendaylight.openflowplugin.extension.api.ConvertorFromOFJava;
+import org.opendaylight.openflowplugin.extension.api.ConvertorToOFJava;
+import org.opendaylight.openflowplugin.extension.api.ExtensionAugment;
+import org.opendaylight.openflowplugin.extension.api.path.MatchPath;
+import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.CodecPreconditionException;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Nxm1Class;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.OfjAugNxMatch;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.OfjAugNxMatchBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.nx.match.nsp.grouping.NspValues;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.nx.match.nsp.grouping.NspValuesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.ExtensionKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.general.extension.grouping.Extension;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxAugMatchNotifPacketIn;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxAugMatchNotifPacketInBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxAugMatchNotifSwitchFlowRemoved;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxAugMatchNotifSwitchFlowRemovedBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxAugMatchNotifUpdateFlowStats;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxAugMatchNotifUpdateFlowStatsBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxNspGrouping;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxNspKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.nxm.nx.nsp.grouping.NxmNxNsp;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.nxm.nx.nsp.grouping.NxmNxNspBuilder;
+import org.opendaylight.yangtools.yang.binding.Augmentation;
+
+import com.google.common.base.Optional;
+public class NspConvertor implements ConvertorToOFJava<MatchEntries>, ConvertorFromOFJava<MatchEntries, MatchPath> {
+    @Override
+    public ExtensionAugment<? extends Augmentation<Extension>> convert(MatchEntries input, MatchPath path) {
+        NspValues values = input.getAugmentation(OfjAugNxMatch.class).getNspValues();
+        return resolveAugmentation(new NxmNxNspBuilder().setValue(values.getNsp()).build(), path,
+                NxmNxNspKey.class);
+    }
+
+    private static ExtensionAugment<? extends Augmentation<Extension>> resolveAugmentation(NxmNxNsp value,
+            MatchPath path, Class<? extends ExtensionKey> key) {
+        switch (path) {
+        case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH:
+            return new ExtensionAugment<>(NxAugMatchNotifUpdateFlowStats.class,
+                    new NxAugMatchNotifUpdateFlowStatsBuilder().setNxmNxNsp(value).build(), key);
+        case PACKETRECEIVED_MATCH:
+            return new ExtensionAugment<>(NxAugMatchNotifPacketIn.class, new NxAugMatchNotifPacketInBuilder()
+                    .setNxmNxNsp(value).build(), key);
+        case SWITCHFLOWREMOVED_MATCH:
+            return new ExtensionAugment<>(NxAugMatchNotifSwitchFlowRemoved.class,
+                    new NxAugMatchNotifSwitchFlowRemovedBuilder().setNxmNxNsp(value).build(), key);
+        default:
+            throw new CodecPreconditionException(path);
+        }
+    }
+
+    @Override
+    public MatchEntries convert(Extension extension) {
+        Optional<NxmNxNspGrouping> matchGrouping = MatchUtil.nspResolver.getExtension(extension);
+        if (!matchGrouping.isPresent()) {
+            throw new CodecPreconditionException(extension);
+        }
+        Long value = matchGrouping.get().getNxmNxNsp().getValue();
+        OfjAugNxMatchBuilder augNxMatchBuilder = new OfjAugNxMatchBuilder().setNspValues(new NspValuesBuilder()
+                .setNsp(value).build());
+        return MatchUtil
+                .createNiciraMatchEntries(
+                        Nxm1Class.class,
+                        org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxNsp.class,
+                        false, augNxMatchBuilder.build());
+    }
+
+}
diff --git a/extension/openflowplugin-extension-nicira/src/main/resources/initial/44-nicira-extension.xml b/extension/openflowplugin-extension-nicira/src/main/resources/initial/44-nicira-extension.xml
deleted file mode 100644 (file)
index 8ab4fd9..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- vi: set et smarttab sw=4 tabstop=4: -->
-<!--
-Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
-
-This program and the accompanying materials are made available under the
-terms of the Eclipse Public License v1.0 which accompanies this distribution,
-and is available at http://www.eclipse.org/legal/epl-v10.html
--->
-<snapshot>
-  <required-capabilities>
-  <capability>urn:opendaylight:params:xml:ns:yang:openflowplugin:nx:config:impl?module=nicira-extension-impl&amp;revision=2014-07-11</capability>
-    <!-- openflowplugin -->
-    <capability>urn:opendaylight:params:xml:ns:yang:openflow:common:config?module=openflow-provider&amp;revision=2014-03-26</capability>
-  </required-capabilities>
-
-  <configuration>
-
-    <data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
-      <modules xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
-        <module>
-          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:openflowplugin:nx:config:impl">prefix:nicira-extension-provider-impl</type>
-          <name>nicira-extension-provider-default-impl</name>
-          
-          <openflow-plugin-provider>
-            <type xmlns:opfprov="urn:opendaylight:params:xml:ns:yang:openflow:common:config">opfprov:openflow-provider</type>
-            <name>openflow-provider</name>
-          </openflow-plugin-provider>
-        </module>
-      </modules>
-    </data>
-
-  </configuration>
-</snapshot>
index 25b28eefa6bbcca3b2bb0a7fdbe87c8b7ac2d4e8..41b86b27c1d5eec388217f259cb6adbea6b829c2 100644 (file)
@@ -15,6 +15,7 @@ module openflowplugin-extension-nicira-action {
     import nicira-match {prefix nicira-match;revision-date "2014-04-21";}
     import openflowplugin-extension-general {prefix ext-gen;revision-date "2014-07-14";}
     import openflow-action {prefix ofaction;revision-date "2013-07-31";}
+    import nicira-action {prefix nicira-action;revision-date "2014-04-21";}
 
     description 
         "Nicira openflow action extensions.";
@@ -226,6 +227,69 @@ bits specified from the register.";
             }
         }
     }
+
+    grouping nx-action-resubmit-grouping {
+        container nx-resubmit {
+            description "Re-searches OpenFlow flow table (or the table whose number is specified by table)
+            with the in-port field replaced  by port (if port is specified) and executes the actions found";
+            leaf in-port {
+                type uint16;
+                default 0xfff8; // OFPP_INPORT
+            }
+            leaf table {
+                type uint8 {
+                    range "0 .. 255";
+                }
+                default 255; // Current Table
+            }
+        }
+    }
+
+    grouping nx-action-multipath-grouping {
+        container nx-multipath {
+            leaf fields {
+                type nicira-action:ofj-nx-hash-fields;
+            }
+            leaf basis {
+                type uint16;
+                default 0x400;
+            }
+            leaf algorithm {
+                type nicira-action:ofj-nx-mp-algorithm;
+            }
+            leaf max-link {
+                type uint16;
+            }
+            leaf arg {
+                type uint32;
+            }
+            container dst {
+                description "Writes value to bits start through end, inclusive, in field dst.";
+                uses dst-choice-grouping;
+                uses range-grouping;
+            }
+        }
+    }
+
+    grouping nx-action-set-nsp-grouping {
+        container nx-set-nsp {
+            description "Sets NSP header";
+            description "Sets NSH Service Path ID (NSP) header";
+            leaf nsp {
+                type uint32;
+            }
+        }
+    }
+
+    grouping nx-action-set-nsi-grouping {
+        container nx-set-nsi {
+            description "Sets NSH Service Index (NSI) header";
+            leaf nsi {
+                type uint8;
+            }
+        }
+    }
+
     // ACTION augmentations
     // RPCS
     augment "/sal-flow:add-flow/sal-flow:input/sal-flow:instructions/sal-flow:instruction/sal-flow:instruction/sal-flow:write-actions-case/sal-flow:write-actions/sal-flow:action/sal-flow:action" {
@@ -243,6 +307,27 @@ bits specified from the register.";
             uses nx-action-output-reg-grouping;
         }
     }
+    augment "/sal-flow:add-flow/sal-flow:input/sal-flow:instructions/sal-flow:instruction/sal-flow:instruction/sal-flow:write-actions-case/sal-flow:write-actions/sal-flow:action/sal-flow:action" {
+        case nx-action-resubmit-rpc-add-flow-write-actions-case {
+            uses nx-action-resubmit-grouping;
+        }
+    }
+    augment "/sal-flow:add-flow/sal-flow:input/sal-flow:instructions/sal-flow:instruction/sal-flow:instruction/sal-flow:write-actions-case/sal-flow:write-actions/sal-flow:action/sal-flow:action" {
+        case nx-action-multipath-rpc-add-flow-write-actions-case {
+            uses nx-action-multipath-grouping;
+        }
+    }
+    augment "/sal-flow:add-flow/sal-flow:input/sal-flow:instructions/sal-flow:instruction/sal-flow:instruction/sal-flow:write-actions-case/sal-flow:write-actions/sal-flow:action/sal-flow:action" {
+        case nx-action-set-nsp-rpc-add-flow-write-actions-case {
+            uses nx-action-set-nsp-grouping;
+        }
+    }
+    augment "/sal-flow:add-flow/sal-flow:input/sal-flow:instructions/sal-flow:instruction/sal-flow:instruction/sal-flow:write-actions-case/sal-flow:write-actions/sal-flow:action/sal-flow:action" {
+        case nx-action-set-nsi-rpc-add-flow-write-actions-case {
+            uses nx-action-set-nsi-grouping;
+        }
+    }
+
     augment "/sal-flow:add-flow/sal-flow:input/sal-flow:instructions/sal-flow:instruction/sal-flow:instruction/sal-flow:apply-actions-case/sal-flow:apply-actions/sal-flow:action/sal-flow:action" {
         case nx-action-reg-load-rpc-add-flow-apply-actions-case {
             uses nx-action-reg-load-grouping;
@@ -258,6 +343,26 @@ bits specified from the register.";
             uses nx-action-output-reg-grouping;
         }
     }
+    augment "/sal-flow:add-flow/sal-flow:input/sal-flow:instructions/sal-flow:instruction/sal-flow:instruction/sal-flow:apply-actions-case/sal-flow:apply-actions/sal-flow:action/sal-flow:action" {
+        case nx-action-resubmit-rpc-add-flow-apply-actions-case {
+            uses nx-action-resubmit-grouping;
+        }
+    }
+    augment "/sal-flow:add-flow/sal-flow:input/sal-flow:instructions/sal-flow:instruction/sal-flow:instruction/sal-flow:apply-actions-case/sal-flow:apply-actions/sal-flow:action/sal-flow:action" {
+        case nx-action-multipath-rpc-add-flow-apply-actions-case {
+            uses nx-action-multipath-grouping;
+        }
+    }
+    augment "/sal-flow:add-flow/sal-flow:input/sal-flow:instructions/sal-flow:instruction/sal-flow:instruction/sal-flow:apply-actions-case/sal-flow:apply-actions/sal-flow:action/sal-flow:action" {
+        case nx-action-set-nsp-rpc-add-flow-apply-actions-case {
+            uses nx-action-set-nsp-grouping;
+        }
+    }
+    augment "/sal-flow:add-flow/sal-flow:input/sal-flow:instructions/sal-flow:instruction/sal-flow:instruction/sal-flow:apply-actions-case/sal-flow:apply-actions/sal-flow:action/sal-flow:action" {
+        case nx-action-set-nsi-rpc-add-flow-apply-actions-case {
+            uses nx-action-set-nsi-grouping;
+        }
+    }
     
     augment "/sal-flow:remove-flow/sal-flow:input/sal-flow:instructions/sal-flow:instruction/sal-flow:instruction/sal-flow:write-actions-case/sal-flow:write-actions/sal-flow:action/sal-flow:action" {
         case "nx-action-reg-load-rpc-remove-flow-write-actions-case" {
@@ -274,6 +379,27 @@ bits specified from the register.";
             uses nx-action-output-reg-grouping;
         }
     }
+    augment "/sal-flow:remove-flow/sal-flow:input/sal-flow:instructions/sal-flow:instruction/sal-flow:instruction/sal-flow:write-actions-case/sal-flow:write-actions/sal-flow:action/sal-flow:action" {
+        case nx-action-resubmit-rpc-remove-flow-write-actions-case {
+            uses nx-action-resubmit-grouping;
+        }
+    }
+    augment "/sal-flow:remove-flow/sal-flow:input/sal-flow:instructions/sal-flow:instruction/sal-flow:instruction/sal-flow:write-actions-case/sal-flow:write-actions/sal-flow:action/sal-flow:action" {
+        case nx-action-multipath-rpc-remove-flow-write-actions-case {
+            uses nx-action-multipath-grouping;
+        }
+    }
+    augment "/sal-flow:remove-flow/sal-flow:input/sal-flow:instructions/sal-flow:instruction/sal-flow:instruction/sal-flow:write-actions-case/sal-flow:write-actions/sal-flow:action/sal-flow:action" {
+        case nx-action-set-nsp-rpc-remove-flow-write-actions-case {
+            uses nx-action-set-nsp-grouping;
+        }
+    }
+    augment "/sal-flow:remove-flow/sal-flow:input/sal-flow:instructions/sal-flow:instruction/sal-flow:instruction/sal-flow:write-actions-case/sal-flow:write-actions/sal-flow:action/sal-flow:action" {
+        case nx-action-set-nsi-rpc-remove-flow-write-actions-case {
+            uses nx-action-set-nsi-grouping;
+        }
+    }
+
     augment "/sal-flow:remove-flow/sal-flow:input/sal-flow:instructions/sal-flow:instruction/sal-flow:instruction/sal-flow:apply-actions-case/sal-flow:apply-actions/sal-flow:action/sal-flow:action" {
         case "nx-action-reg-load-rpc-remove-flow-apply-actions-case" {
             uses nx-action-reg-load-grouping;
@@ -289,6 +415,26 @@ bits specified from the register.";
             uses nx-action-output-reg-grouping;
         }
     }
+    augment "/sal-flow:remove-flow/sal-flow:input/sal-flow:instructions/sal-flow:instruction/sal-flow:instruction/sal-flow:apply-actions-case/sal-flow:apply-actions/sal-flow:action/sal-flow:action" {
+        case nx-action-resubmit-rpc-remove-flow-apply-actions-case {
+            uses nx-action-resubmit-grouping;
+        }
+    }
+    augment "/sal-flow:remove-flow/sal-flow:input/sal-flow:instructions/sal-flow:instruction/sal-flow:instruction/sal-flow:apply-actions-case/sal-flow:apply-actions/sal-flow:action/sal-flow:action" {
+        case nx-action-multipath-rpc-remove-flow-apply-actions-case {
+            uses nx-action-multipath-grouping;
+        }
+    }
+    augment "/sal-flow:remove-flow/sal-flow:input/sal-flow:instructions/sal-flow:instruction/sal-flow:instruction/sal-flow:apply-actions-case/sal-flow:apply-actions/sal-flow:action/sal-flow:action" {
+        case nx-action-set-nsp-rpc-remove-flow-apply-actions-case {
+            uses nx-action-set-nsp-grouping;
+        }
+    }
+    augment "/sal-flow:remove-flow/sal-flow:input/sal-flow:instructions/sal-flow:instruction/sal-flow:instruction/sal-flow:apply-actions-case/sal-flow:apply-actions/sal-flow:action/sal-flow:action" {
+        case nx-action-set-nsi-rpc-remove-flow-apply-actions-case {
+            uses nx-action-set-nsi-grouping;
+        }
+    }
     
     augment "/sal-flow:update-flow/sal-flow:input/sal-flow:original-flow/sal-flow:instructions/sal-flow:instruction/sal-flow:instruction/sal-flow:write-actions-case/sal-flow:write-actions/sal-flow:action/sal-flow:action" {
         case "nx-action-reg-load-rpc-update-flow-original-write-actions-case" {
@@ -305,6 +451,27 @@ bits specified from the register.";
             uses nx-action-output-reg-grouping;
         }
     }
+    augment "/sal-flow:update-flow/sal-flow:input/sal-flow:original-flow/sal-flow:instructions/sal-flow:instruction/sal-flow:instruction/sal-flow:write-actions-case/sal-flow:write-actions/sal-flow:action/sal-flow:action" {
+        case "nx-action-resubmit-rpc-update-flow-original-write-actions-case" {
+            uses nx-action-resubmit-grouping;
+        }
+    }
+    augment "/sal-flow:update-flow/sal-flow:input/sal-flow:original-flow/sal-flow:instructions/sal-flow:instruction/sal-flow:instruction/sal-flow:write-actions-case/sal-flow:write-actions/sal-flow:action/sal-flow:action" {
+        case "nx-action-multipath-rpc-update-flow-original-write-actions-case" {
+            uses nx-action-multipath-grouping;
+        }
+    }
+    augment "/sal-flow:update-flow/sal-flow:input/sal-flow:original-flow/sal-flow:instructions/sal-flow:instruction/sal-flow:instruction/sal-flow:write-actions-case/sal-flow:write-actions/sal-flow:action/sal-flow:action" {
+        case "nx-action-set-nsp-rpc-update-flow-original-write-actions-case" {
+            uses nx-action-set-nsp-grouping;
+        }
+    }
+    augment "/sal-flow:update-flow/sal-flow:input/sal-flow:original-flow/sal-flow:instructions/sal-flow:instruction/sal-flow:instruction/sal-flow:write-actions-case/sal-flow:write-actions/sal-flow:action/sal-flow:action" {
+        case "nx-action-set-nsi-rpc-update-flow-original-write-actions-case" {
+            uses nx-action-set-nsi-grouping;
+        }
+    }
+
     augment "/sal-flow:update-flow/sal-flow:input/sal-flow:original-flow/sal-flow:instructions/sal-flow:instruction/sal-flow:instruction/sal-flow:apply-actions-case/sal-flow:apply-actions/sal-flow:action/sal-flow:action" {
         case "nx-action-reg-load-rpc-update-flow-original-apply-actions-case" {
             uses nx-action-reg-load-grouping;
@@ -320,6 +487,27 @@ bits specified from the register.";
             uses nx-action-output-reg-grouping;
         }
     }
+    augment "/sal-flow:update-flow/sal-flow:input/sal-flow:original-flow/sal-flow:instructions/sal-flow:instruction/sal-flow:instruction/sal-flow:apply-actions-case/sal-flow:apply-actions/sal-flow:action/sal-flow:action" {
+        case "nx-action-resubmit-rpc-update-flow-original-apply-actions-case" {
+            uses nx-action-resubmit-grouping;
+        }
+    }
+    augment "/sal-flow:update-flow/sal-flow:input/sal-flow:original-flow/sal-flow:instructions/sal-flow:instruction/sal-flow:instruction/sal-flow:apply-actions-case/sal-flow:apply-actions/sal-flow:action/sal-flow:action" {
+        case "nx-action-multipath-rpc-update-flow-original-apply-actions-case" {
+            uses nx-action-multipath-grouping;
+        }
+    }
+    augment "/sal-flow:update-flow/sal-flow:input/sal-flow:original-flow/sal-flow:instructions/sal-flow:instruction/sal-flow:instruction/sal-flow:apply-actions-case/sal-flow:apply-actions/sal-flow:action/sal-flow:action" {
+        case "nx-action-set-nsp-rpc-update-flow-original-apply-actions-case" {
+            uses nx-action-set-nsp-grouping;
+        }
+    }
+    augment "/sal-flow:update-flow/sal-flow:input/sal-flow:original-flow/sal-flow:instructions/sal-flow:instruction/sal-flow:instruction/sal-flow:apply-actions-case/sal-flow:apply-actions/sal-flow:action/sal-flow:action" {
+        case "nx-action-set-nsi-rpc-update-flow-original-apply-actions-case" {
+            uses nx-action-set-nsi-grouping;
+        }
+    }
+
     augment "/sal-flow:update-flow/sal-flow:input/sal-flow:updated-flow/sal-flow:instructions/sal-flow:instruction/sal-flow:instruction/sal-flow:write-actions-case/sal-flow:write-actions/sal-flow:action/sal-flow:action" {
         case "nx-action-reg-load-rpc-update-flow-updated-write-actions-case" {
             uses nx-action-reg-load-grouping;
@@ -335,6 +523,27 @@ bits specified from the register.";
             uses nx-action-output-reg-grouping;
         }
     }
+    augment "/sal-flow:update-flow/sal-flow:input/sal-flow:updated-flow/sal-flow:instructions/sal-flow:instruction/sal-flow:instruction/sal-flow:write-actions-case/sal-flow:write-actions/sal-flow:action/sal-flow:action" {
+        case "nx-action-resubmit-rpc-update-flow-updated-write-actions-case" {
+            uses nx-action-resubmit-grouping;
+        }
+    }
+    augment "/sal-flow:update-flow/sal-flow:input/sal-flow:updated-flow/sal-flow:instructions/sal-flow:instruction/sal-flow:instruction/sal-flow:write-actions-case/sal-flow:write-actions/sal-flow:action/sal-flow:action" {
+        case "nx-action-multipath-rpc-update-flow-updated-write-actions-case" {
+            uses nx-action-multipath-grouping;
+        }
+    }
+    augment "/sal-flow:update-flow/sal-flow:input/sal-flow:updated-flow/sal-flow:instructions/sal-flow:instruction/sal-flow:instruction/sal-flow:write-actions-case/sal-flow:write-actions/sal-flow:action/sal-flow:action" {
+        case "nx-action-set-nsp-rpc-update-flow-updated-write-actions-case" {
+            uses nx-action-set-nsp-grouping;
+        }
+    }
+    augment "/sal-flow:update-flow/sal-flow:input/sal-flow:updated-flow/sal-flow:instructions/sal-flow:instruction/sal-flow:instruction/sal-flow:write-actions-case/sal-flow:write-actions/sal-flow:action/sal-flow:action" {
+        case "nx-action-set-nsi-rpc-update-flow-updated-write-actions-case" {
+            uses nx-action-set-nsi-grouping;
+        }
+    }
+
     augment "/sal-flow:update-flow/sal-flow:input/sal-flow:updated-flow/sal-flow:instructions/sal-flow:instruction/sal-flow:instruction/sal-flow:apply-actions-case/sal-flow:apply-actions/sal-flow:action/sal-flow:action" {
         case "nx-action-reg-load-rpc-update-flow-updated-apply-actions-case" {
             uses nx-action-reg-load-grouping;
@@ -350,6 +559,26 @@ bits specified from the register.";
             uses nx-action-output-reg-grouping;
         }
     }
+    augment "/sal-flow:update-flow/sal-flow:input/sal-flow:updated-flow/sal-flow:instructions/sal-flow:instruction/sal-flow:instruction/sal-flow:apply-actions-case/sal-flow:apply-actions/sal-flow:action/sal-flow:action" {
+        case "nx-action-resubmit-rpc-update-flow-updated-apply-actions-case" {
+            uses nx-action-resubmit-grouping;
+        }
+    }
+    augment "/sal-flow:update-flow/sal-flow:input/sal-flow:updated-flow/sal-flow:instructions/sal-flow:instruction/sal-flow:instruction/sal-flow:apply-actions-case/sal-flow:apply-actions/sal-flow:action/sal-flow:action" {
+        case "nx-action-multipath-rpc-update-flow-updated-apply-actions-case" {
+            uses nx-action-multipath-grouping;
+        }
+    }
+    augment "/sal-flow:update-flow/sal-flow:input/sal-flow:updated-flow/sal-flow:instructions/sal-flow:instruction/sal-flow:instruction/sal-flow:apply-actions-case/sal-flow:apply-actions/sal-flow:action/sal-flow:action" {
+        case "nx-action-set-nsp-rpc-update-flow-updated-apply-actions-case" {
+            uses nx-action-set-nsp-grouping;
+        }
+    }
+    augment "/sal-flow:update-flow/sal-flow:input/sal-flow:updated-flow/sal-flow:instructions/sal-flow:instruction/sal-flow:instruction/sal-flow:apply-actions-case/sal-flow:apply-actions/sal-flow:action/sal-flow:action" {
+        case "nx-action-set-nsi-rpc-update-flow-updated-apply-actions-case" {
+            uses nx-action-set-nsi-grouping;
+        }
+    }
     
     augment "/sal-group:add-group/sal-group:input/sal-group:buckets/sal-group:bucket/sal-group:action/sal-group:action" {
         case "nx-action-reg-load-rpc-add-group-case" {
@@ -366,6 +595,26 @@ bits specified from the register.";
             uses nx-action-output-reg-grouping;
         }
     }
+    augment "/sal-group:add-group/sal-group:input/sal-group:buckets/sal-group:bucket/sal-group:action/sal-group:action" {
+        case "nx-action-resubmit-rpc-add-group-case" {
+            uses nx-action-resubmit-grouping;
+        }
+    }
+    augment "/sal-group:add-group/sal-group:input/sal-group:buckets/sal-group:bucket/sal-group:action/sal-group:action" {
+        case "nx-action-multipath-rpc-add-group-case" {
+            uses nx-action-multipath-grouping;
+        }
+    }
+    augment "/sal-group:add-group/sal-group:input/sal-group:buckets/sal-group:bucket/sal-group:action/sal-group:action" {
+        case "nx-action-set-nsp-rpc-add-group-case" {
+            uses nx-action-set-nsp-grouping;
+        }
+    }
+    augment "/sal-group:add-group/sal-group:input/sal-group:buckets/sal-group:bucket/sal-group:action/sal-group:action" {
+        case "nx-action-set-nsi-rpc-add-group-case" {
+            uses nx-action-set-nsi-grouping;
+        }
+    }
     
     augment "/sal-group:remove-group/sal-group:input/sal-group:buckets/sal-group:bucket/sal-group:action/sal-group:action" {
         case "nx-action-reg-load-rpc-remove-group-case" {
@@ -382,6 +631,26 @@ bits specified from the register.";
             uses nx-action-output-reg-grouping;
         }
     }
+    augment "/sal-group:remove-group/sal-group:input/sal-group:buckets/sal-group:bucket/sal-group:action/sal-group:action" {
+        case "nx-action-resubmit-rpc-remove-group-case" {
+            uses nx-action-resubmit-grouping;
+        }
+    }
+    augment "/sal-group:remove-group/sal-group:input/sal-group:buckets/sal-group:bucket/sal-group:action/sal-group:action" {
+        case "nx-action-multipath-rpc-remove-group-case" {
+            uses nx-action-multipath-grouping;
+        }
+    }
+    augment "/sal-group:remove-group/sal-group:input/sal-group:buckets/sal-group:bucket/sal-group:action/sal-group:action" {
+        case "nx-action-set-nsp-rpc-remove-group-case" {
+            uses nx-action-set-nsp-grouping;
+        }
+    }
+    augment "/sal-group:remove-group/sal-group:input/sal-group:buckets/sal-group:bucket/sal-group:action/sal-group:action" {
+        case "nx-action-set-nsi-rpc-remove-group-case" {
+            uses nx-action-set-nsi-grouping;
+        }
+    }
     
     augment "/sal-group:update-group/sal-group:input/sal-group:original-group/sal-group:buckets/sal-group:bucket/sal-group:action/sal-group:action" {
         case "nx-action-reg-load-rpc-update-group-original-case" {
@@ -398,6 +667,27 @@ bits specified from the register.";
             uses nx-action-output-reg-grouping;
         }
     }
+    augment "/sal-group:update-group/sal-group:input/sal-group:original-group/sal-group:buckets/sal-group:bucket/sal-group:action/sal-group:action" {
+        case "nx-action-resubmit-rpc-update-group-original-case" {
+            uses nx-action-resubmit-grouping;
+        }
+    }
+    augment "/sal-group:update-group/sal-group:input/sal-group:original-group/sal-group:buckets/sal-group:bucket/sal-group:action/sal-group:action" {
+        case "nx-action-multipath-rpc-update-group-original-case" {
+            uses nx-action-multipath-grouping;
+        }
+    }
+    augment "/sal-group:update-group/sal-group:input/sal-group:original-group/sal-group:buckets/sal-group:bucket/sal-group:action/sal-group:action" {
+        case "nx-action-set-nsp-rpc-update-group-original-case" {
+            uses nx-action-set-nsp-grouping;
+        }
+    }
+    augment "/sal-group:update-group/sal-group:input/sal-group:original-group/sal-group:buckets/sal-group:bucket/sal-group:action/sal-group:action" {
+        case "nx-action-set-nsi-rpc-update-group-original-case" {
+            uses nx-action-set-nsi-grouping;
+        }
+    }
+
     augment "/sal-group:update-group/sal-group:input/sal-group:updated-group/sal-group:buckets/sal-group:bucket/sal-group:action/sal-group:action" {
         case "nx-action-reg-load-rpc-update-group-updated-case" {
             uses nx-action-reg-load-grouping;
@@ -413,6 +703,26 @@ bits specified from the register.";
             uses nx-action-output-reg-grouping;
         }
     }
+    augment "/sal-group:update-group/sal-group:input/sal-group:updated-group/sal-group:buckets/sal-group:bucket/sal-group:action/sal-group:action" {
+        case "nx-action-resubmit-rpc-update-group-updated-case" {
+            uses nx-action-resubmit-grouping;
+        }
+    }
+    augment "/sal-group:update-group/sal-group:input/sal-group:updated-group/sal-group:buckets/sal-group:bucket/sal-group:action/sal-group:action" {
+        case "nx-action-multipath-rpc-update-group-updated-case" {
+            uses nx-action-multipath-grouping;
+        }
+    }
+    augment "/sal-group:update-group/sal-group:input/sal-group:updated-group/sal-group:buckets/sal-group:bucket/sal-group:action/sal-group:action" {
+        case "nx-action-set-nsp-rpc-update-group-updated-case" {
+            uses nx-action-set-nsp-grouping;
+        }
+    }
+    augment "/sal-group:update-group/sal-group:input/sal-group:updated-group/sal-group:buckets/sal-group:bucket/sal-group:action/sal-group:action" {
+        case "nx-action-set-nsi-rpc-update-group-updated-case" {
+            uses nx-action-set-nsi-grouping;
+        }
+    }
     
     augment "/sal-packet:transmit-packet/sal-packet:input/sal-packet:action/sal-packet:action" {
         case "nx-action-reg-load-rpc-transmit-packet-case" {
@@ -429,6 +739,26 @@ bits specified from the register.";
             uses nx-action-output-reg-grouping;
         }
     }
+    augment "/sal-packet:transmit-packet/sal-packet:input/sal-packet:action/sal-packet:action" {
+        case "nx-action-resubmit-rpc-transmit-packet-case" {
+            uses nx-action-resubmit-grouping;
+        }
+    }
+    augment "/sal-packet:transmit-packet/sal-packet:input/sal-packet:action/sal-packet:action" {
+        case "nx-action-multipath-rpc-transmit-packet-case" {
+            uses nx-action-multipath-grouping;
+        }
+    }
+    augment "/sal-packet:transmit-packet/sal-packet:input/sal-packet:action/sal-packet:action" {
+        case "nx-action-set-nsp-rpc-transmit-packet-case" {
+            uses nx-action-set-nsp-grouping;
+        }
+    }
+    augment "/sal-packet:transmit-packet/sal-packet:input/sal-packet:action/sal-packet:action" {
+        case "nx-action-set-nsi-rpc-transmit-packet-case" {
+            uses nx-action-set-nsi-grouping;
+        }
+    }
     
     // DATA
     augment "/inv:nodes/inv:node/fni:table/fni:flow/fni:instructions/fni:instruction/fni:instruction/fni:write-actions-case/fni:write-actions/fni:action/fni:action" {
@@ -446,6 +776,27 @@ bits specified from the register.";
             uses nx-action-output-reg-grouping;
         }
     }
+    augment "/inv:nodes/inv:node/fni:table/fni:flow/fni:instructions/fni:instruction/fni:instruction/fni:write-actions-case/fni:write-actions/fni:action/fni:action" {
+        case "nx-action-resubmit-nodes-node-table-flow-write-actions-case" {
+            uses nx-action-resubmit-grouping;
+        }
+    }
+    augment "/inv:nodes/inv:node/fni:table/fni:flow/fni:instructions/fni:instruction/fni:instruction/fni:write-actions-case/fni:write-actions/fni:action/fni:action" {
+        case "nx-action-multipath-nodes-node-table-flow-write-actions-case" {
+            uses nx-action-multipath-grouping;
+        }
+    }
+    augment "/inv:nodes/inv:node/fni:table/fni:flow/fni:instructions/fni:instruction/fni:instruction/fni:write-actions-case/fni:write-actions/fni:action/fni:action" {
+        case "nx-action-set-nsp-nodes-node-table-flow-write-actions-case" {
+            uses nx-action-set-nsp-grouping;
+        }
+    }
+    augment "/inv:nodes/inv:node/fni:table/fni:flow/fni:instructions/fni:instruction/fni:instruction/fni:write-actions-case/fni:write-actions/fni:action/fni:action" {
+        case "nx-action-set-nsi-nodes-node-table-flow-write-actions-case" {
+            uses nx-action-set-nsi-grouping;
+        }
+    }
+
     augment "/inv:nodes/inv:node/fni:table/fni:flow/fni:instructions/fni:instruction/fni:instruction/fni:apply-actions-case/fni:apply-actions/fni:action/fni:action" {
         case "nx-action-reg-load-nodes-node-table-flow-apply-actions-case" {
             uses nx-action-reg-load-grouping;
@@ -461,6 +812,26 @@ bits specified from the register.";
             uses nx-action-output-reg-grouping;
         }
     }
+    augment "/inv:nodes/inv:node/fni:table/fni:flow/fni:instructions/fni:instruction/fni:instruction/fni:apply-actions-case/fni:apply-actions/fni:action/fni:action" {
+        case "nx-action-resubmit-nodes-node-table-flow-apply-actions-case" {
+            uses nx-action-resubmit-grouping;
+        }
+    }
+    augment "/inv:nodes/inv:node/fni:table/fni:flow/fni:instructions/fni:instruction/fni:instruction/fni:apply-actions-case/fni:apply-actions/fni:action/fni:action" {
+        case "nx-action-multipath-nodes-node-table-flow-apply-actions-case" {
+            uses nx-action-multipath-grouping;
+        }
+    }
+    augment "/inv:nodes/inv:node/fni:table/fni:flow/fni:instructions/fni:instruction/fni:instruction/fni:apply-actions-case/fni:apply-actions/fni:action/fni:action" {
+        case "nx-action-set-nsp-nodes-node-table-flow-apply-actions-case" {
+            uses nx-action-set-nsp-grouping;
+        }
+    }
+    augment "/inv:nodes/inv:node/fni:table/fni:flow/fni:instructions/fni:instruction/fni:instruction/fni:apply-actions-case/fni:apply-actions/fni:action/fni:action" {
+        case "nx-action-set-nsi-nodes-node-table-flow-apply-actions-case" {
+            uses nx-action-set-nsi-grouping;
+        }
+    }
     
     augment "/inv:nodes/inv:node/fni:group/fni:buckets/fni:bucket/fni:action/fni:action" {
         case "nx-action-reg-load-nodes-node-group-buckets-bucket-actions-case" {
@@ -477,6 +848,26 @@ bits specified from the register.";
             uses nx-action-output-reg-grouping;
         }
     }
+    augment "/inv:nodes/inv:node/fni:group/fni:buckets/fni:bucket/fni:action/fni:action" {
+        case "nx-action-resubmit-nodes-node-group-buckets-bucket-actions-case" {
+            uses nx-action-resubmit-grouping;
+        }
+    }
+    augment "/inv:nodes/inv:node/fni:group/fni:buckets/fni:bucket/fni:action/fni:action" {
+        case "nx-action-multipath-nodes-node-group-buckets-bucket-actions-case" {
+            uses nx-action-multipath-grouping;
+        }
+    }
+    augment "/inv:nodes/inv:node/fni:group/fni:buckets/fni:bucket/fni:action/fni:action" {
+        case "nx-action-set-nsp-nodes-node-group-buckets-bucket-actions-case" {
+            uses nx-action-set-nsp-grouping;
+        }
+    }
+    augment "/inv:nodes/inv:node/fni:group/fni:buckets/fni:bucket/fni:action/fni:action" {
+        case "nx-action-set-nsi-nodes-node-group-buckets-bucket-actions-case" {
+            uses nx-action-set-nsi-grouping;
+        }
+    }
     
     // NOTIFICATIONS
     augment "/odl-flow-stats:flows-statistics-update/odl-flow-stats:flow-and-statistics-map-list/odl-flow-stats:instructions/odl-flow-stats:instruction/odl-flow-stats:instruction/odl-flow-stats:write-actions-case/odl-flow-stats:write-actions/odl-flow-stats:action/odl-flow-stats:action" {
@@ -494,6 +885,27 @@ bits specified from the register.";
             uses nx-action-output-reg-grouping;
         }
     }
+    augment "/odl-flow-stats:flows-statistics-update/odl-flow-stats:flow-and-statistics-map-list/odl-flow-stats:instructions/odl-flow-stats:instruction/odl-flow-stats:instruction/odl-flow-stats:write-actions-case/odl-flow-stats:write-actions/odl-flow-stats:action/odl-flow-stats:action" {
+        case "nx-action-resubmit-notif-flows-statistics-update-write-actions-case" {
+            uses nx-action-resubmit-grouping;
+        }
+    }
+    augment "/odl-flow-stats:flows-statistics-update/odl-flow-stats:flow-and-statistics-map-list/odl-flow-stats:instructions/odl-flow-stats:instruction/odl-flow-stats:instruction/odl-flow-stats:write-actions-case/odl-flow-stats:write-actions/odl-flow-stats:action/odl-flow-stats:action" {
+        case "nx-action-multipath-notif-flows-statistics-update-write-actions-case" {
+            uses nx-action-multipath-grouping;
+        }
+    }
+    augment "/odl-flow-stats:flows-statistics-update/odl-flow-stats:flow-and-statistics-map-list/odl-flow-stats:instructions/odl-flow-stats:instruction/odl-flow-stats:instruction/odl-flow-stats:write-actions-case/odl-flow-stats:write-actions/odl-flow-stats:action/odl-flow-stats:action" {
+        case "nx-action-set-nsp-notif-flows-statistics-update-write-actions-case" {
+            uses nx-action-set-nsp-grouping;
+        }
+    }
+    augment "/odl-flow-stats:flows-statistics-update/odl-flow-stats:flow-and-statistics-map-list/odl-flow-stats:instructions/odl-flow-stats:instruction/odl-flow-stats:instruction/odl-flow-stats:write-actions-case/odl-flow-stats:write-actions/odl-flow-stats:action/odl-flow-stats:action" {
+        case "nx-action-set-nsi-notif-flows-statistics-update-write-actions-case" {
+            uses nx-action-set-nsi-grouping;
+        }
+    }
+
     augment "/odl-flow-stats:flows-statistics-update/odl-flow-stats:flow-and-statistics-map-list/odl-flow-stats:instructions/odl-flow-stats:instruction/odl-flow-stats:instruction/odl-flow-stats:apply-actions-case/odl-flow-stats:apply-actions/odl-flow-stats:action/odl-flow-stats:action" {
         case "nx-action-reg-load-notif-flows-statistics-update-apply-actions-case" {
             uses nx-action-reg-load-grouping;
@@ -509,6 +921,26 @@ bits specified from the register.";
             uses nx-action-output-reg-grouping;
         }
     }
+    augment "/odl-flow-stats:flows-statistics-update/odl-flow-stats:flow-and-statistics-map-list/odl-flow-stats:instructions/odl-flow-stats:instruction/odl-flow-stats:instruction/odl-flow-stats:apply-actions-case/odl-flow-stats:apply-actions/odl-flow-stats:action/odl-flow-stats:action" {
+        case "nx-action-resubmit-notif-flows-statistics-update-apply-actions-case" {
+            uses nx-action-resubmit-grouping;
+        }
+    }
+    augment "/odl-flow-stats:flows-statistics-update/odl-flow-stats:flow-and-statistics-map-list/odl-flow-stats:instructions/odl-flow-stats:instruction/odl-flow-stats:instruction/odl-flow-stats:apply-actions-case/odl-flow-stats:apply-actions/odl-flow-stats:action/odl-flow-stats:action" {
+        case "nx-action-multipath-notif-flows-statistics-update-apply-actions-case" {
+            uses nx-action-multipath-grouping;
+        }
+    }
+    augment "/odl-flow-stats:flows-statistics-update/odl-flow-stats:flow-and-statistics-map-list/odl-flow-stats:instructions/odl-flow-stats:instruction/odl-flow-stats:instruction/odl-flow-stats:apply-actions-case/odl-flow-stats:apply-actions/odl-flow-stats:action/odl-flow-stats:action" {
+        case "nx-action-set-nsp-notif-flows-statistics-update-apply-actions-case" {
+            uses nx-action-set-nsp-grouping;
+        }
+    }
+    augment "/odl-flow-stats:flows-statistics-update/odl-flow-stats:flow-and-statistics-map-list/odl-flow-stats:instructions/odl-flow-stats:instruction/odl-flow-stats:instruction/odl-flow-stats:apply-actions-case/odl-flow-stats:apply-actions/odl-flow-stats:action/odl-flow-stats:action" {
+        case "nx-action-set-nsi-notif-flows-statistics-update-apply-actions-case" {
+            uses nx-action-set-nsi-grouping;
+        }
+    }
     
     augment "/odl-group-stats:group-desc-stats-updated/odl-group-stats:group-desc-stats/odl-group-stats:buckets/odl-group-stats:bucket/odl-group-stats:action/odl-group-stats:action" {
         case "nx-action-reg-load-notif-group-desc-stats-updated-case" {
@@ -525,5 +957,24 @@ bits specified from the register.";
             uses nx-action-output-reg-grouping;
         }
     }
-
-}
\ No newline at end of file
+    augment "/odl-group-stats:group-desc-stats-updated/odl-group-stats:group-desc-stats/odl-group-stats:buckets/odl-group-stats:bucket/odl-group-stats:action/odl-group-stats:action" {
+        case "nx-action-resubmit-notif-group-desc-stats-updated-case" {
+            uses nx-action-resubmit-grouping;
+        }
+    }
+    augment "/odl-group-stats:group-desc-stats-updated/odl-group-stats:group-desc-stats/odl-group-stats:buckets/odl-group-stats:bucket/odl-group-stats:action/odl-group-stats:action" {
+        case "nx-action-multipath-notif-group-desc-stats-updated-case" {
+            uses nx-action-multipath-grouping;
+        }
+    }
+    augment "/odl-group-stats:group-desc-stats-updated/odl-group-stats:group-desc-stats/odl-group-stats:buckets/odl-group-stats:bucket/odl-group-stats:action/odl-group-stats:action" {
+        case "nx-action-set-nsp-notif-group-desc-stats-updated-case" {
+            uses nx-action-set-nsp-grouping;
+        }
+    }
+    augment "/odl-group-stats:group-desc-stats-updated/odl-group-stats:group-desc-stats/odl-group-stats:buckets/odl-group-stats:bucket/odl-group-stats:action/odl-group-stats:action" {
+        case "nx-action-set-nsi-notif-group-desc-stats-updated-case" {
+            uses nx-action-set-nsi-grouping;
+        }
+    }
+}
index af6797aeab9f70a4517293493b9d16fd913baf6d..c3efdfb38571b1c4bbf3388ea9adc55ac47c2ce1 100644 (file)
@@ -3,11 +3,11 @@ module openflowplugin-extension-nicira-match {
 
     namespace "urn:opendaylight:openflowplugin:extension:nicira:match";
     prefix "openflowplugin-nicira-match";
-       
-       import yang-ext {prefix ext; revision-date "2013-07-09";}
-       import flow-node-inventory {prefix fni; revision-date 2013-08-19; }
-       import opendaylight-inventory {prefix inv;revision-date "2013-08-19";}
-       import sal-flow {prefix sal-flow;revision-date "2013-08-19";}
+
+    import yang-ext {prefix ext; revision-date "2013-07-09";}
+    import flow-node-inventory {prefix fni; revision-date 2013-08-19; }
+    import opendaylight-inventory {prefix inv;revision-date "2013-08-19";}
+    import sal-flow {prefix sal-flow;revision-date "2013-08-19";}
     import packet-processing {prefix sal-packet;revision-date "2013-07-09";}
     import openflowplugin-extension-general {prefix ext-gen;revision-date "2014-07-14";}
     import opendaylight-flow-statistics {prefix odl-flow-stats;revision-date "2013-08-19";}
@@ -79,6 +79,12 @@ module openflowplugin-extension-nicira-match {
     identity nxm-of-eth-type-key {
         base ext-gen:extension-key;
     }
+    identity nxm-nx-nsp-key {
+        base ext-gen:extension-key;
+    }
+    identity nxm-nx-nsi-key {
+        base ext-gen:extension-key;
+    }
     
     grouping ipv4-address-grouping {
         leaf ipv4-address {
@@ -91,18 +97,18 @@ module openflowplugin-extension-nicira-match {
         }
     }
 
-       grouping nxm-nx-reg-grouping {
-               container nxm-nx-reg {
-                       leaf reg {
+    grouping nxm-nx-reg-grouping {
+        container nxm-nx-reg {
+            leaf reg {
                 type identityref {
                     base nicira-match:nxm-nx-reg;
                 }
             }
-                       leaf value {
+            leaf value {
                 type uint32;
             }
-               }
-       }
+        }
+    }
     grouping nxm-nx-tun-id-grouping {
         container nxm-nx-tun-id {
             leaf value {
@@ -167,6 +173,21 @@ module openflowplugin-extension-nicira-match {
             }
         }
     }
+    grouping nxm-nx-nsp-grouping {
+        container nxm-nx-nsp {
+            leaf value {
+                type uint32;
+            }
+        }
+    }
+    grouping nxm-nx-nsi-grouping {
+        container nxm-nx-nsi {
+            leaf nsi {
+                type uint8;
+            }
+        }
+    }
+
     
     grouping all-matches-grouping {
         uses nxm-nx-reg-grouping;
@@ -181,6 +202,8 @@ module openflowplugin-extension-nicira-match {
         uses nxm-of-eth-src-grouping;
         uses nxm-of-eth-dst-grouping;
         uses nxm-of-eth-type-grouping;
+        uses nxm-nx-nsp-grouping;
+        uses nxm-nx-nsi-grouping;
     }
     
     // MATCH augmentations
@@ -222,4 +245,4 @@ module openflowplugin-extension-nicira-match {
         uses all-matches-grouping;
     }
 
-}
\ No newline at end of file
+}
index 00487329602bd2255642616b32307d8d81a9ce4b..71c8f66a0c6451d0148e43809f883c0dae76df43 100644 (file)
@@ -22,6 +22,8 @@
         <module>openflowjava-extension-nicira</module>
         <module>openflowplugin-extension-api</module>
         <module>openflowplugin-extension-nicira</module>
+        <module>openflowplugin-extension-nicira-config</module>
+        <module>features</module>
         <module>test-extension</module>
     </modules>
 
@@ -39,4 +41,4 @@
             </dependency>
         </dependencies>
     </dependencyManagement>
-</project>
\ No newline at end of file
+</project>
index d05cef55a8476f79dc6d354ddd3581291c7fc497..bd1c903df3233bcebbaa9dac79fe8fc4bf06ea98 100644 (file)
@@ -67,5 +67,5 @@
         <bundle>mvn:org.opendaylight.openflowplugin.applications/lldp-speaker/${project.version}</bundle>
         <configfile finalname="etc/opendaylight/karaf/71-lldp-speaker.xml">mvn:org.opendaylight.openflowplugin.applications/lldp-speaker/${project.version}/xml/config</configfile>
     </feature>
-    
+
 </features>
diff --git a/openflowplugin-api/src/main/java/org/opendaylight/openflowplugin/api/openflow/md/util/PollableQueuesPriorityZipper.java b/openflowplugin-api/src/main/java/org/opendaylight/openflowplugin/api/openflow/md/util/PollableQueuesPriorityZipper.java
new file mode 100644 (file)
index 0000000..f28876e
--- /dev/null
@@ -0,0 +1,63 @@
+/**
+ * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ * 
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.openflowplugin.api.openflow.md.util;
+
+import java.util.Queue;
+
+/**
+ * Zipper groups together a list of queues and exposes one poll method. Polling
+ * iterates through all groups and returns first not-null result of poll method
+ * on each queue. If after polling each grouped queue for one time there is
+ * still null result, poll will return null. <br/>
+ * Iterating keeps last position so this polling is supposed to be fairly
+ * distributed.
+ * 
+ * @param <T>
+ *            common item type of zipped queues
+ */
+public class PollableQueuesPriorityZipper<T> {
+
+    private Queue<T> prioritizedSource;
+    private PollableQueuesZipper<T> zipper;
+
+    /**
+     * default ctor
+     */
+    public PollableQueuesPriorityZipper() {
+        zipper = new PollableQueuesZipper<>();
+    }
+
+    /**
+     * Add all member queues before first invocation of
+     * {@link PollableQueuesPriorityZipper#poll()}
+     * 
+     * @param queue
+     *            to be added to group
+     */
+    public void addSource(Queue<T> queue) {
+        zipper.addSource(queue);
+    }
+
+    /**
+     * @return next common product of polling member groups
+     */
+    public T poll() {
+        T item = null;
+
+        item = prioritizedSource.poll();
+        if (item == null) {
+            item = zipper.poll();
+        }
+
+        return item;
+    }
+
+    public void setPrioritizedSource(Queue<T> prioritizedSource) {
+        this.prioritizedSource = prioritizedSource;
+    }
+}
index 8da0d7bd040993c95140eb128b841c9623524471..348795112f16118da44c4967a2b21132c3ef7332 100644 (file)
@@ -91,7 +91,7 @@ public class FlowConvertor {
     public static final Integer DEFAULT_HARD_TIMEOUT = 10 * 60;
     /** Default priority */
     public static final Integer DEFAULT_PRIORITY = Integer.parseInt("8000", 16);
-    private static final Long DEFAULT_BUFFER_ID = Long.parseLong("ffffffff", 16);
+    private static final Long DEFAULT_BUFFER_ID = OFConstants.OFP_NO_BUFFER;
     private static final Long OFPP_ANY = Long.parseLong("ffffffff", 16);
     private static final Long DEFAULT_OUT_PORT = OFPP_ANY;
     private static final Long OFPG_ANY = Long.parseLong("ffffffff", 16);
@@ -199,7 +199,7 @@ public class FlowConvertor {
             flowMod.setOutGroup(DEFAULT_OUT_GROUP);
         }
 
-        
+
         // convert and inject flowFlags
         FlowFlagReactor.getInstance().convert(flow.getFlags(), version, flowMod,datapathid);
 
@@ -211,7 +211,7 @@ public class FlowConvertor {
             flowMod.setAction(getActions(version,datapathid, flow));
         }
         flowMod.setVersion(version);
-        
+
         return flowMod;
     }
 
@@ -298,12 +298,12 @@ public class FlowConvertor {
         }
         return instructionsList;
     }
-    
+
     /*private static List<Action> getActions(
             org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Instructions instructions,
             short version,BigInteger datapathid) {*/
     private static List<Action> getActions(short version,BigInteger datapathid, Flow flow) {
-        
+
         org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Instructions instructions = flow.getInstructions();
         List<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction> sortedInstructions =
             Ordering.from(OrderComparator.<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction>build())
@@ -454,13 +454,13 @@ public class FlowConvertor {
 
         org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionBuilder instructionBuilder =
                 new org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionBuilder();
-        
+
         for (int i=0; i < srcInstructionList.size(); i++) {
-            org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction srcInstruction = 
+            org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction srcInstruction =
                     srcInstructionList.get(i);
-            org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.Instruction curSrcInstruction = 
+            org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.Instruction curSrcInstruction =
                     srcInstruction.getInstruction();
-            
+
             if (curSrcInstruction instanceof ApplyActionsCase) {
                 ApplyActionsCase applyActionscase = (ApplyActionsCase) curSrcInstruction;
                 ApplyActions applyActions = applyActionscase.getApplyActions();
@@ -502,7 +502,7 @@ public class FlowConvertor {
                         actionBuilder.setOrder(actionItem.getOrder() + offset);
                         actionItem = actionBuilder.build();
                     }
-                    
+
                     targetActionList.add(actionItem);
                 }
 
@@ -510,17 +510,17 @@ public class FlowConvertor {
                 ApplyActionsBuilder applyActionsBuilder = new ApplyActionsBuilder();
                 applyActionsBuilder.setAction(targetActionList);
                 applyActionsCaseBuilder.setApplyActions(applyActionsBuilder.build());
-                    
+
                 instructionBuilder.setInstruction(applyActionsCaseBuilder.build());
             } else {
                 instructionBuilder.setInstruction(curSrcInstruction);
             }
-            
+
             instructionBuilder
                 .setKey(srcInstruction.getKey())
                 .setOrder(srcInstruction.getOrder());
             targetInstructionList.add(instructionBuilder.build());
-            
+
         }
 
         return targetInstructionList;
index 04b708416c0911ec82b8f70520b7b6f3f5106928..dbf7d4d2d330ef9c44092cfbe66d09b9230d144f 100644 (file)
@@ -15,7 +15,7 @@ import org.opendaylight.openflowplugin.api.openflow.md.core.ConnectionConductor;
 import org.opendaylight.openflowplugin.api.openflow.md.queue.HarvesterHandle;
 import org.opendaylight.openflowplugin.api.openflow.md.queue.QueueItem;
 import org.opendaylight.openflowplugin.api.openflow.md.queue.QueueKeeper;
-import org.opendaylight.openflowplugin.api.openflow.md.util.PollableQueuesZipper;
+import org.opendaylight.openflowplugin.api.openflow.md.util.PollableQueuesPriorityZipper;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -23,34 +23,34 @@ import org.slf4j.LoggerFactory;
 import com.google.common.base.Preconditions;
 
 /**
- * QueueKeeper implementation based on {@link OfHeader} 
+ * QueueKeeper implementation based on {@link OfHeader}
  */
 public class QueueKeeperFairImpl implements QueueKeeper<OfHeader> {
 
     private static Logger LOG = LoggerFactory
             .getLogger(QueueKeeperFairImpl.class);
-    
+
     private Queue<QueueItem<OfHeader>> queueDefault;
     private BlockingQueue<QueueItem<OfHeader>> queueUnordered;
     private AutoCloseable pollRegistration;
     private int capacity = 5000;
     private HarvesterHandle harvesterHandle;
-    private PollableQueuesZipper<QueueItem<OfHeader>> queueZipper;
+    private PollableQueuesPriorityZipper<QueueItem<OfHeader>> queueZipper;
 
     @Override
     public void close() throws Exception {
-        Preconditions.checkNotNull(pollRegistration, "pollRegistration not available");
+        Preconditions.checkNotNull(pollRegistration,
+                "pollRegistration not available");
         pollRegistration.close();
     }
 
     @Override
-    public void push(
-            OfHeader message,
-            ConnectionConductor conductor,
+    public void push(OfHeader message, ConnectionConductor conductor,
             QueueKeeper.QueueType queueType) {
-        QueueItemOFImpl qItem = new QueueItemOFImpl(message, conductor, queueType);
+        QueueItemOFImpl qItem = new QueueItemOFImpl(message, conductor,
+                queueType);
         boolean enqueued = false;
-        
+
         switch (queueType) {
         case DEFAULT:
             enqueued = queueDefault.offer(qItem);
@@ -59,18 +59,19 @@ public class QueueKeeperFairImpl implements QueueKeeper<OfHeader> {
             enqueued = queueUnordered.offer(qItem);
             break;
         default:
-            LOG.warn("unsupported queue type: [{}] -> dropping message [{}]", queueType, message.getImplementedInterface());
+            LOG.warn("unsupported queue type: [{}] -> dropping message [{}]",
+                    queueType, message.getImplementedInterface());
         }
-        
+
         if (enqueued) {
             harvesterHandle.ping();
         } else {
             LOG.debug("ingress throttling is use -> {}", queueType);
         }
-        
-        // if enqueueing fails -> message will be dropped 
+
+        // if enqueueing fails -> message will be dropped
     }
-    
+
     /**
      * @return the ingressQueue
      */
@@ -81,29 +82,31 @@ public class QueueKeeperFairImpl implements QueueKeeper<OfHeader> {
     }
 
     /**
-     * @param processingRegistration the processingRegistration to set
+     * @param processingRegistration
+     *            the processingRegistration to set
      */
     @Override
     public void setPollRegistration(AutoCloseable processingRegistration) {
         this.pollRegistration = processingRegistration;
     }
-    
+
     /**
-     * @param capacity the capacity of internal blocking queue
+     * @param capacity
+     *            the capacity of internal blocking queue
      */
     public void setCapacity(int capacity) {
         this.capacity = capacity;
     }
-    
+
     /**
      * init blocking queue
      */
     public void init() {
         queueUnordered = new ArrayBlockingQueue<>(capacity);
         queueDefault = new ArrayBlockingQueue<>(capacity);
-        queueZipper = new PollableQueuesZipper<>();
-        queueZipper.addSource(queueDefault);
+        queueZipper = new PollableQueuesPriorityZipper<>();
         queueZipper.addSource(queueUnordered);
+        queueZipper.setPrioritizedSource(queueDefault);
     }
 
     /**
diff --git a/openflowplugin/src/test/java/org/opendaylight/openflowplugin/openflow/md/util/PollableQueuesPriorityZipperTest.java b/openflowplugin/src/test/java/org/opendaylight/openflowplugin/openflow/md/util/PollableQueuesPriorityZipperTest.java
new file mode 100644 (file)
index 0000000..a6a8da2
--- /dev/null
@@ -0,0 +1,90 @@
+/**
+ * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ * 
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.openflowplugin.openflow.md.util;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Queue;
+import java.util.concurrent.LinkedBlockingQueue;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.opendaylight.openflowplugin.api.openflow.md.util.PollableQueuesPriorityZipper;
+
+import com.google.common.collect.Lists;
+
+/**
+ * test for {@link PollableQueuesPriorityZipper}
+ */
+public class PollableQueuesPriorityZipperTest {
+
+    /**
+     * Test method for
+     * {@link org.opendaylight.openflowplugin.api.openflow.md.util.PollableQueuesPriorityZipper#poll()}
+     * .
+     */
+    @Test
+    public void testPoll3() {
+        Queue<String> l1 = new LinkedBlockingQueue<String>(Lists.newArrayList(
+                "1", "2", "3"));
+        Queue<String> l2 = new LinkedBlockingQueue<String>(Lists.newArrayList(
+                "a", "b", "c", "d"));
+        Queue<String> l3 = new LinkedBlockingQueue<String>(Lists.newArrayList(
+                "A", "B"));
+
+        PollableQueuesPriorityZipper<String> zipper = new PollableQueuesPriorityZipper<>();
+        zipper.setPrioritizedSource(l1);
+        zipper.addSource(l2);
+        zipper.addSource(l3);
+
+        String[] expected = new String[] { "1", "2", "3", "a", "A", "b", "B",
+                "c", "d", null, "XXX" };
+        List<String> result = new ArrayList<>();
+        while (true) {
+            String data = zipper.poll();
+            result.add(data);
+            if (data == null) {
+                break;
+            }
+        }
+        l1.offer("XXX");
+        result.add(zipper.poll());
+        Assert.assertArrayEquals(expected, result.toArray());
+    }
+
+    /**
+     * Test method for
+     * {@link org.opendaylight.openflowplugin.api.openflow.md.util.PollableQueuesPriorityZipper#poll()}
+     * .
+     */
+    @Test
+    public void testPoll2() {
+        Queue<String> l1 = new LinkedBlockingQueue<String>(Lists.newArrayList(
+                "1", "2", "3"));
+        Queue<String> l3 = new LinkedBlockingQueue<String>(Lists.newArrayList(
+                "A", "B"));
+
+        PollableQueuesPriorityZipper<String> zipper = new PollableQueuesPriorityZipper<>();
+        zipper.setPrioritizedSource(l1);
+        zipper.addSource(l3);
+
+        String[] expected = new String[] { "1", "2", "3", "A", "B", null, "XXX" };
+        List<String> result = new ArrayList<>();
+        while (true) {
+            String data = zipper.poll();
+            result.add(data);
+            if (data == null) {
+                break;
+            }
+        }
+        l1.offer("XXX");
+        result.add(zipper.poll());
+        Assert.assertArrayEquals(expected, result.toArray());
+    }
+
+}
index 0d9345241737267e96e10ca279f2fecdf4ddb0a6..972cd1b45f601606ed163e000c3b8377a381ea19 100644 (file)
             <groupId>org.opendaylight.yangtools</groupId>
             <artifactId>yang-binding</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.opendaylight.openflowplugin</groupId>
+            <artifactId>openflowplugin-api</artifactId>
+        </dependency>
         <dependency>
           <groupId>org.osgi</groupId>
           <artifactId>org.osgi.core</artifactId>
index 95f40ab8c411cf0a995fe633cddfa6cf9ec32899..a469992c3dbbeecb1fda36050fda935ef7c423ae 100644 (file)
@@ -3,6 +3,7 @@ package org.opendaylight.openflowplugin.learningswitch;
 import java.util.ArrayList;
 import java.util.List;
 
+import org.opendaylight.openflowplugin.api.OFConstants;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Uri;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.OutputActionCaseBuilder;
@@ -95,7 +96,7 @@ public class FlowUtils {
                         .setInstruction(ImmutableList.of(applyActionsInstruction)) //
                         .build()) //
                 .setPriority(priority) //
-                .setBufferId(0L) //
+                .setBufferId(OFConstants.OFP_NO_BUFFER) //
                 .setHardTimeout(0) //
                 .setIdleTimeout(0) //
                 .setFlags(new FlowModFlags(false, false, false, false, false));
@@ -149,7 +150,7 @@ public class FlowUtils {
             .setMatch(matchBuilder.build()) //
             .setInstructions(isb.build()) //
             .setPriority(priority) //
-            .setBufferId(0L) //
+            .setBufferId(OFConstants.OFP_NO_BUFFER) //
             .setHardTimeout(0) //
             .setIdleTimeout(0) //
             .setFlags(new FlowModFlags(false, false, false, false, false));