OPNFLWPLUG-917 : pkt_mark support in nicira extension
[openflowplugin.git] / extension / openflowjava-extension-nicira / src / main / java / org / opendaylight / openflowjava / nx / NiciraExtensionsRegistrator.java
index 29fe00fe47591716dc04da27a3b63e9ff6ae728a..3107832f0893dbc1736a77e332406a0906ef7e42 100644 (file)
@@ -8,18 +8,20 @@
 
 package org.opendaylight.openflowjava.nx;
 
+import com.google.common.base.Preconditions;
 import org.opendaylight.openflowjava.nx.api.NiciraExtensionCodecRegistrator;
 import org.opendaylight.openflowjava.nx.codec.action.ConntrackCodec;
+import org.opendaylight.openflowjava.nx.codec.action.CtClearCodec;
 import org.opendaylight.openflowjava.nx.codec.action.FinTimeoutCodec;
 import org.opendaylight.openflowjava.nx.codec.action.LearnCodec;
 import org.opendaylight.openflowjava.nx.codec.action.MultipathCodec;
 import org.opendaylight.openflowjava.nx.codec.action.NiciraActionCodecs;
 import org.opendaylight.openflowjava.nx.codec.action.OutputRegCodec;
+import org.opendaylight.openflowjava.nx.codec.action.PopNshCodec;
+import org.opendaylight.openflowjava.nx.codec.action.PushNshCodec;
 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.PushNshCodec;
-import org.opendaylight.openflowjava.nx.codec.action.PopNshCodec;
 import org.opendaylight.openflowjava.nx.codec.match.ArpOpCodec;
 import org.opendaylight.openflowjava.nx.codec.match.ArpShaCodec;
 import org.opendaylight.openflowjava.nx.codec.match.ArpSpaCodec;
@@ -27,23 +29,27 @@ import org.opendaylight.openflowjava.nx.codec.match.ArpThaCodec;
 import org.opendaylight.openflowjava.nx.codec.match.ArpTpaCodec;
 import org.opendaylight.openflowjava.nx.codec.match.CtMarkCodec;
 import org.opendaylight.openflowjava.nx.codec.match.CtStateCodec;
+import org.opendaylight.openflowjava.nx.codec.match.CtTpDstCodec;
+import org.opendaylight.openflowjava.nx.codec.match.CtTpSrcCodec;
 import org.opendaylight.openflowjava.nx.codec.match.CtZoneCodec;
+import org.opendaylight.openflowjava.nx.codec.match.EncapEthDstCodec;
+import org.opendaylight.openflowjava.nx.codec.match.EncapEthSrcCodec;
+import org.opendaylight.openflowjava.nx.codec.match.EncapEthTypeCodec;
 import org.opendaylight.openflowjava.nx.codec.match.EthDstCodec;
 import org.opendaylight.openflowjava.nx.codec.match.EthSrcCodec;
 import org.opendaylight.openflowjava.nx.codec.match.EthTypeCodec;
+import org.opendaylight.openflowjava.nx.codec.match.InPortCodec;
+import org.opendaylight.openflowjava.nx.codec.match.MplsLabelCodec;
 import org.opendaylight.openflowjava.nx.codec.match.NiciraMatchCodecs;
+import org.opendaylight.openflowjava.nx.codec.match.NshMdtypeCodec;
+import org.opendaylight.openflowjava.nx.codec.match.NshNpCodec;
 import org.opendaylight.openflowjava.nx.codec.match.Nshc1Codec;
 import org.opendaylight.openflowjava.nx.codec.match.Nshc2Codec;
 import org.opendaylight.openflowjava.nx.codec.match.Nshc3Codec;
 import org.opendaylight.openflowjava.nx.codec.match.Nshc4Codec;
 import org.opendaylight.openflowjava.nx.codec.match.NsiCodec;
 import org.opendaylight.openflowjava.nx.codec.match.NspCodec;
-import org.opendaylight.openflowjava.nx.codec.match.EncapEthTypeCodec;
-import org.opendaylight.openflowjava.nx.codec.match.EncapEthSrcCodec;
-import org.opendaylight.openflowjava.nx.codec.match.EncapEthDstCodec;
-import org.opendaylight.openflowjava.nx.codec.match.NshMdtypeCodec;
-import org.opendaylight.openflowjava.nx.codec.match.NshNpCodec;
-import org.opendaylight.openflowjava.nx.codec.match.TunGpeNpCodec;
+import org.opendaylight.openflowjava.nx.codec.match.PktMarkCodec;
 import org.opendaylight.openflowjava.nx.codec.match.Reg0Codec;
 import org.opendaylight.openflowjava.nx.codec.match.Reg1Codec;
 import org.opendaylight.openflowjava.nx.codec.match.Reg2Codec;
@@ -54,15 +60,12 @@ import org.opendaylight.openflowjava.nx.codec.match.Reg6Codec;
 import org.opendaylight.openflowjava.nx.codec.match.Reg7Codec;
 import org.opendaylight.openflowjava.nx.codec.match.TcpDstCodec;
 import org.opendaylight.openflowjava.nx.codec.match.TcpSrcCodec;
+import org.opendaylight.openflowjava.nx.codec.match.TunGpeNpCodec;
 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.UdpDstCodec;
 import org.opendaylight.openflowjava.nx.codec.match.UdpSrcCodec;
-import org.opendaylight.openflowjava.nx.codec.match.InPortCodec;
-import org.opendaylight.openflowjava.nx.codec.match.MplsLabelCodec;
-
-import com.google.common.base.Preconditions;
 
 public class NiciraExtensionsRegistrator implements AutoCloseable {
     private final NiciraExtensionCodecRegistrator registrator;
@@ -90,6 +93,8 @@ public class NiciraExtensionsRegistrator implements AutoCloseable {
 
         registrator.registerActionSerializer(ConntrackCodec.SERIALIZER_KEY, NiciraActionCodecs.CONNTRACK_CODEC);
         registrator.registerActionDeserializer(ConntrackCodec.DESERIALIZER_KEY, NiciraActionCodecs.CONNTRACK_CODEC);
+        registrator.registerActionSerializer(CtClearCodec.SERIALIZER_KEY, NiciraActionCodecs.CT_CLEAR_CODEC);
+        registrator.registerActionDeserializer(CtClearCodec.DESERIALIZER_KEY, NiciraActionCodecs.CT_CLEAR_CODEC);
         registrator.registerActionSerializer(LearnCodec.SERIALIZER_KEY, NiciraActionCodecs.LEARN_CODEC);
         registrator.registerActionDeserializer(LearnCodec.DESERIALIZER_KEY, NiciraActionCodecs.LEARN_CODEC);
         // Continue
@@ -184,6 +189,12 @@ public class NiciraExtensionsRegistrator implements AutoCloseable {
         registrator.registerMatchEntryDeserializer(CtZoneCodec.DESERIALIZER_KEY, NiciraMatchCodecs.CT_ZONE_CODEC);
         registrator.registerMatchEntrySerializer(CtMarkCodec.SERIALIZER_KEY, NiciraMatchCodecs.CT_MARK_CODEC);
         registrator.registerMatchEntryDeserializer(CtMarkCodec.DESERIALIZER_KEY, NiciraMatchCodecs.CT_MARK_CODEC);
+        registrator.registerMatchEntrySerializer(CtTpSrcCodec.SERIALIZER_KEY, NiciraMatchCodecs.CT_TP_SRC_CODEC);
+        registrator.registerMatchEntryDeserializer(CtTpSrcCodec.DESERIALIZER_KEY, NiciraMatchCodecs.CT_TP_SRC_CODEC);
+        registrator.registerMatchEntrySerializer(CtTpDstCodec.SERIALIZER_KEY, NiciraMatchCodecs.CT_TP_DST_CODEC);
+        registrator.registerMatchEntryDeserializer(CtTpDstCodec.DESERIALIZER_KEY, NiciraMatchCodecs.CT_TP_DST_CODEC);
+        registrator.registerMatchEntrySerializer(PktMarkCodec.SERIALIZER_KEY, NiciraMatchCodecs.PKT_MARK_CODEC);
+        registrator.registerMatchEntryDeserializer(PktMarkCodec.DESERIALIZER_KEY, NiciraMatchCodecs.PKT_MARK_CODEC);
     }
 
     @Override
@@ -207,6 +218,8 @@ public class NiciraExtensionsRegistrator implements AutoCloseable {
         registrator.unregisterActionSerializer(PopNshCodec.SERIALIZER_KEY);
         registrator.unregisterActionSerializer(ConntrackCodec.SERIALIZER_KEY);
         registrator.unregisterActionDeserializer(ConntrackCodec.DESERIALIZER_KEY);
+        registrator.unregisterActionSerializer(CtClearCodec.SERIALIZER_KEY);
+        registrator.unregisterActionDeserializer(CtClearCodec.DESERIALIZER_KEY);
         registrator.unregisterActionSerializer(LearnCodec.SERIALIZER_KEY);
         registrator.unregisterActionDeserializer(LearnCodec.DESERIALIZER_KEY);
         // CONTINUE
@@ -290,6 +303,11 @@ public class NiciraExtensionsRegistrator implements AutoCloseable {
         registrator.unregisterMatchEntryDeserializer(CtZoneCodec.DESERIALIZER_KEY);
         registrator.unregisterMatchEntrySerializer(CtMarkCodec.SERIALIZER_KEY);
         registrator.unregisterMatchEntryDeserializer(CtMarkCodec.DESERIALIZER_KEY);
+        registrator.unregisterMatchEntrySerializer(CtTpSrcCodec.SERIALIZER_KEY);
+        registrator.unregisterMatchEntryDeserializer(CtTpSrcCodec.DESERIALIZER_KEY);
+        registrator.unregisterMatchEntrySerializer(CtTpDstCodec.SERIALIZER_KEY);
+        registrator.unregisterMatchEntryDeserializer(CtTpDstCodec.DESERIALIZER_KEY);
+        registrator.unregisterMatchEntrySerializer(PktMarkCodec.SERIALIZER_KEY);
+        registrator.unregisterMatchEntryDeserializer(PktMarkCodec.DESERIALIZER_KEY);
     }
-
 }