OF10ActionDeserializer and ActionDeserializer split into separate classes 22/6622/1
authorMichal Polkorab <michal.polkorab@pantheon.sk>
Wed, 30 Apr 2014 10:26:24 +0000 (12:26 +0200)
committerMichal Polkorab <michal.polkorab@pantheon.sk>
Wed, 30 Apr 2014 13:26:35 +0000 (15:26 +0200)
 - updated deserializer initializers

Signed-off-by: Michal Polkorab <michal.polkorab@pantheon.sk>
41 files changed:
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/ActionDeserializerInitializer.java [new file with mode: 0644]
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/DefaultExperimenterDeserializerInitializer.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/DeserializerRegistryImpl.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/AbstractActionDeserializer.java [new file with mode: 0644]
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/AbstractEthertypeActionDeserializer.java [new file with mode: 0644]
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/AbstractHeaderActionDeserializer.java [new file with mode: 0644]
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF10AbstractIpAddressActionDeserializer.java [new file with mode: 0644]
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF10AbstractMacAddressActionDeserializer.java [new file with mode: 0644]
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF10AbstractPortActionDeserializer.java [new file with mode: 0644]
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF10EnqueueActionDeserializer.java [new file with mode: 0644]
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF10OutputActionDeserializer.java [new file with mode: 0644]
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF10SetDlDstActionDeserializer.java [new file with mode: 0644]
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF10SetDlSrcActionDeserializer.java [new file with mode: 0644]
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF10SetNwDstActionDeserializer.java [new file with mode: 0644]
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF10SetNwSrcActionDeserializer.java [new file with mode: 0644]
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF10SetNwTosActionDeserializer.java [new file with mode: 0644]
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF10SetTpDstActionDeserializer.java [new file with mode: 0644]
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF10SetTpSrcActionDeserializer.java [new file with mode: 0644]
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF10SetVlanPcpActionDeserializer.java [new file with mode: 0644]
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF10SetVlanVidActionDeserializer.java [new file with mode: 0644]
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF10StripVlanActionDeserializer.java [new file with mode: 0644]
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13CopyTtlInActionDeserializer.java [new file with mode: 0644]
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13CopyTtlOutActionDeserializer.java [new file with mode: 0644]
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13DecMplsTtlActionDeserializer.java [new file with mode: 0644]
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13DecNwTtlActionDeserializer.java [new file with mode: 0644]
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13GroupActionDeserializer.java [new file with mode: 0644]
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13OutputActionDeserializer.java [new file with mode: 0644]
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13PopMplsActionDeserializer.java [new file with mode: 0644]
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13PopPbbActionDeserializer.java [new file with mode: 0644]
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13PopVlanActionDeserializer.java [new file with mode: 0644]
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13PushMplsActionDeserializer.java [new file with mode: 0644]
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13PushPbbActionDeserializer.java [new file with mode: 0644]
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13PushVlanActionDeserializer.java [new file with mode: 0644]
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13SetFieldActionDeserializer.java [new file with mode: 0644]
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13SetMplsTtlActionDeserializer.java [new file with mode: 0644]
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13SetNwTtlActionDeserializer.java [new file with mode: 0644]
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13SetQueueActionDeserializer.java [new file with mode: 0644]
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/experimenters/ExperimenterActionDeserializer.java [new file with mode: 0644]
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/ActionsDeserializer.java [deleted file]
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/CodeKeyMakerFactory.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/OF10ActionsDeserializer.java [deleted file]

diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/ActionDeserializerInitializer.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/ActionDeserializerInitializer.java
new file mode 100644 (file)
index 0000000..a1ed619
--- /dev/null
@@ -0,0 +1,89 @@
+/*\r
+ * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
+\r
+package org.opendaylight.openflowjava.protocol.impl.deserialization;\r
+\r
+import org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerRegistry;\r
+import org.opendaylight.openflowjava.protocol.impl.deserialization.action.OF10EnqueueActionDeserializer;\r
+import org.opendaylight.openflowjava.protocol.impl.deserialization.action.OF10OutputActionDeserializer;\r
+import org.opendaylight.openflowjava.protocol.impl.deserialization.action.OF10SetDlDstActionDeserializer;\r
+import org.opendaylight.openflowjava.protocol.impl.deserialization.action.OF10SetDlSrcActionDeserializer;\r
+import org.opendaylight.openflowjava.protocol.impl.deserialization.action.OF10SetNwDstActionDeserializer;\r
+import org.opendaylight.openflowjava.protocol.impl.deserialization.action.OF10SetNwSrcActionDeserializer;\r
+import org.opendaylight.openflowjava.protocol.impl.deserialization.action.OF10SetNwTosActionDeserializer;\r
+import org.opendaylight.openflowjava.protocol.impl.deserialization.action.OF10SetTpDstActionDeserializer;\r
+import org.opendaylight.openflowjava.protocol.impl.deserialization.action.OF10SetTpSrcActionDeserializer;\r
+import org.opendaylight.openflowjava.protocol.impl.deserialization.action.OF10SetVlanPcpActionDeserializer;\r
+import org.opendaylight.openflowjava.protocol.impl.deserialization.action.OF10SetVlanVidActionDeserializer;\r
+import org.opendaylight.openflowjava.protocol.impl.deserialization.action.OF10StripVlanActionDeserializer;\r
+import org.opendaylight.openflowjava.protocol.impl.deserialization.action.OF13CopyTtlInActionDeserializer;\r
+import org.opendaylight.openflowjava.protocol.impl.deserialization.action.OF13CopyTtlOutActionDeserializer;\r
+import org.opendaylight.openflowjava.protocol.impl.deserialization.action.OF13DecMplsTtlActionDeserializer;\r
+import org.opendaylight.openflowjava.protocol.impl.deserialization.action.OF13DecNwTtlActionDeserializer;\r
+import org.opendaylight.openflowjava.protocol.impl.deserialization.action.OF13GroupActionDeserializer;\r
+import org.opendaylight.openflowjava.protocol.impl.deserialization.action.OF13OutputActionDeserializer;\r
+import org.opendaylight.openflowjava.protocol.impl.deserialization.action.OF13PopMplsActionDeserializer;\r
+import org.opendaylight.openflowjava.protocol.impl.deserialization.action.OF13PopPbbActionDeserializer;\r
+import org.opendaylight.openflowjava.protocol.impl.deserialization.action.OF13PopVlanActionDeserializer;\r
+import org.opendaylight.openflowjava.protocol.impl.deserialization.action.OF13PushMplsActionDeserializer;\r
+import org.opendaylight.openflowjava.protocol.impl.deserialization.action.OF13PushPbbActionDeserializer;\r
+import org.opendaylight.openflowjava.protocol.impl.deserialization.action.OF13PushVlanActionDeserializer;\r
+import org.opendaylight.openflowjava.protocol.impl.deserialization.action.OF13SetFieldActionDeserializer;\r
+import org.opendaylight.openflowjava.protocol.impl.deserialization.action.OF13SetMplsTtlActionDeserializer;\r
+import org.opendaylight.openflowjava.protocol.impl.deserialization.action.OF13SetNwTtlActionDeserializer;\r
+import org.opendaylight.openflowjava.protocol.impl.deserialization.action.OF13SetQueueActionDeserializer;\r
+import org.opendaylight.openflowjava.protocol.impl.util.EncodeConstants;\r
+import org.opendaylight.openflowjava.protocol.impl.util.SimpleDeserializerRegistryHelper;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;\r
+\r
+/**\r
+ * @author michal.polkorab\r
+ *\r
+ */\r
+public class ActionDeserializerInitializer {\r
+\r
+    /**\r
+     * Registers action deserializers\r
+     * @param registry registry to be filled with deserializers\r
+     */\r
+    public static void registerDeserializers(DeserializerRegistry registry) {\r
+        // register OF v1.0 action deserializers\r
+        SimpleDeserializerRegistryHelper helper =\r
+                new SimpleDeserializerRegistryHelper(EncodeConstants.OF10_VERSION_ID, registry);\r
+        helper.registerDeserializer(0, Action.class, new OF10OutputActionDeserializer());\r
+        helper.registerDeserializer(1, Action.class, new OF10SetVlanVidActionDeserializer());\r
+        helper.registerDeserializer(2, Action.class, new OF10SetVlanPcpActionDeserializer());\r
+        helper.registerDeserializer(3, Action.class, new OF10StripVlanActionDeserializer());\r
+        helper.registerDeserializer(4, Action.class, new OF10SetDlSrcActionDeserializer());\r
+        helper.registerDeserializer(5, Action.class, new OF10SetDlDstActionDeserializer());\r
+        helper.registerDeserializer(6, Action.class, new OF10SetNwSrcActionDeserializer());\r
+        helper.registerDeserializer(7, Action.class, new OF10SetNwDstActionDeserializer());\r
+        helper.registerDeserializer(8, Action.class, new OF10SetNwTosActionDeserializer());\r
+        helper.registerDeserializer(9, Action.class, new OF10SetTpSrcActionDeserializer());\r
+        helper.registerDeserializer(10, Action.class, new OF10SetTpDstActionDeserializer());\r
+        helper.registerDeserializer(11, Action.class, new OF10EnqueueActionDeserializer());\r
+        // register OF v1.3 action deserializers\r
+        helper = new SimpleDeserializerRegistryHelper(EncodeConstants.OF13_VERSION_ID, registry);\r
+        helper.registerDeserializer(0, Action.class, new OF13OutputActionDeserializer());\r
+        helper.registerDeserializer(11, Action.class, new OF13CopyTtlOutActionDeserializer());\r
+        helper.registerDeserializer(12, Action.class, new OF13CopyTtlInActionDeserializer());\r
+        helper.registerDeserializer(15, Action.class, new OF13SetMplsTtlActionDeserializer());\r
+        helper.registerDeserializer(16, Action.class, new OF13DecMplsTtlActionDeserializer());\r
+        helper.registerDeserializer(17, Action.class, new OF13PushVlanActionDeserializer());\r
+        helper.registerDeserializer(18, Action.class, new OF13PopVlanActionDeserializer());\r
+        helper.registerDeserializer(19, Action.class, new OF13PushMplsActionDeserializer());\r
+        helper.registerDeserializer(20, Action.class, new OF13PopMplsActionDeserializer());\r
+        helper.registerDeserializer(21, Action.class, new OF13SetQueueActionDeserializer());\r
+        helper.registerDeserializer(22, Action.class, new OF13GroupActionDeserializer());\r
+        helper.registerDeserializer(23, Action.class, new OF13SetNwTtlActionDeserializer());\r
+        helper.registerDeserializer(24, Action.class, new OF13DecNwTtlActionDeserializer());\r
+        helper.registerDeserializer(25, Action.class, new OF13SetFieldActionDeserializer());\r
+        helper.registerDeserializer(26, Action.class, new OF13PushPbbActionDeserializer());\r
+        helper.registerDeserializer(27, Action.class, new OF13PopPbbActionDeserializer());\r
+    }\r
+}\r
index d32d53d96617264e3b402f2db041b36574fe1f23..7e3a156c4f3f09f2cdc6859e19e4aebfb2d5f7b0 100644 (file)
@@ -9,9 +9,11 @@
 package org.opendaylight.openflowjava.protocol.impl.deserialization;\r
 \r
 import org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerRegistry;\r
+import org.opendaylight.openflowjava.protocol.api.extensibility.MessageCodeKey;\r
+import org.opendaylight.openflowjava.protocol.impl.deserialization.experimenters.ExperimenterActionDeserializer;\r
 import org.opendaylight.openflowjava.protocol.impl.deserialization.experimenters.OF13ExperimenterInstructionDeserializer;\r
 import org.opendaylight.openflowjava.protocol.impl.util.EncodeConstants;\r
-import org.opendaylight.openflowjava.protocol.impl.util.SimpleDeserializerRegistryHelper;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.Instruction;\r
 \r
 /**\r
@@ -25,9 +27,16 @@ public class DefaultExperimenterDeserializerInitializer {
      * @param registry registry to be filled with deserializers\r
      */\r
     public static void registerDeserializers(DeserializerRegistry registry) {\r
-        SimpleDeserializerRegistryHelper helper =\r
-                new SimpleDeserializerRegistryHelper(EncodeConstants.OF13_VERSION_ID, registry);\r
-        helper.registerDeserializer(EncodeConstants.EXPERIMENTER_VALUE,\r
-                Instruction.class, new OF13ExperimenterInstructionDeserializer());\r
+        // register OF v1.0 default experimenter deserializers\r
+        // - default action deserializer\r
+        registry.registerDeserializer(new MessageCodeKey(EncodeConstants.OF10_VERSION_ID,\r
+                EncodeConstants.EXPERIMENTER_VALUE, Action.class), new ExperimenterActionDeserializer());\r
+        // register OF v1.3 default experimenter deserializers\r
+        // - default action deserializer\r
+        registry.registerDeserializer(new MessageCodeKey(EncodeConstants.OF13_VERSION_ID,\r
+                EncodeConstants.EXPERIMENTER_VALUE, Action.class), new ExperimenterActionDeserializer());\r
+        // - default instruction deserializer\r
+        registry.registerDeserializer(new MessageCodeKey(EncodeConstants.OF13_VERSION_ID,\r
+                EncodeConstants.EXPERIMENTER_VALUE, Instruction.class), new OF13ExperimenterInstructionDeserializer());\r
     }\r
 }\r
index 6a08db8c40262137b2eadfdcc9e1b0c5df6e8389..8808569f50a14154dd14386deef24ff4bae4a8b7 100644 (file)
@@ -15,12 +15,9 @@ import org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerRegi
 import org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerRegistryInjector;
 import org.opendaylight.openflowjava.protocol.api.extensibility.MessageCodeKey;
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFGeneralDeserializer;
-import org.opendaylight.openflowjava.protocol.impl.util.ActionsDeserializer;
 import org.opendaylight.openflowjava.protocol.impl.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.util.MatchDeserializer;
-import org.opendaylight.openflowjava.protocol.impl.util.OF10ActionsDeserializer;
 import org.opendaylight.openflowjava.protocol.impl.util.OF10MatchDeserializer;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.match.grouping.Match;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.match.v10.grouping.MatchV10;
 
@@ -44,16 +41,14 @@ public class DeserializerRegistryImpl implements DeserializerRegistry {
         // register common structure deserializers
         registerDeserializer(new MessageCodeKey(EncodeConstants.OF10_VERSION_ID,
                 EncodeConstants.EMPTY_VALUE, MatchV10.class), new OF10MatchDeserializer());
-        registerDeserializer(new MessageCodeKey(EncodeConstants.OF10_VERSION_ID,
-                EncodeConstants.EMPTY_VALUE, Action.class), new OF10ActionsDeserializer());
         registerDeserializer(new MessageCodeKey(EncodeConstants.OF13_VERSION_ID,
                 EncodeConstants.EMPTY_VALUE, Match.class), new MatchDeserializer());
-        registerDeserializer(new MessageCodeKey(EncodeConstants.OF13_VERSION_ID,
-                EncodeConstants.EMPTY_VALUE, Action.class), new ActionsDeserializer());
 
         // register match entry deserializers
         MatchEntryDeserializerInitializer.registerMatchEntryDeserializers(this);
-        //register instruction deserializers
+        // register action deserializers
+        ActionDeserializerInitializer.registerDeserializers(this);
+        // register instruction deserializers
         InstructionDeserializerInitializer.registerDeserializers(this);
         // register default experimenter deserializers
         DefaultExperimenterDeserializerInitializer.registerDeserializers(this);
diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/AbstractActionDeserializer.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/AbstractActionDeserializer.java
new file mode 100644 (file)
index 0000000..a5b1763
--- /dev/null
@@ -0,0 +1,38 @@
+/*\r
+ * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
+\r
+package org.opendaylight.openflowjava.protocol.impl.deserialization.action;\r
+\r
+import io.netty.buffer.ByteBuf;\r
+\r
+import org.opendaylight.openflowjava.protocol.api.extensibility.HeaderDeserializer;\r
+import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;\r
+import org.opendaylight.openflowjava.protocol.impl.util.EncodeConstants;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.ActionBuilder;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionBase;\r
+\r
+/**\r
+ * @author michal.polkorab\r
+ *\r
+ */\r
+public abstract class AbstractActionDeserializer implements OFDeserializer<Action>,\r
+        HeaderDeserializer<Action> {\r
+\r
+    @Override\r
+    public Action deserializeHeader(ByteBuf input) {\r
+        ActionBuilder actionBuilder = new ActionBuilder();\r
+        input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);\r
+        actionBuilder.setType(getType());\r
+        input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);\r
+        return actionBuilder.build();\r
+    }\r
+\r
+    protected abstract Class<? extends ActionBase> getType();\r
+\r
+}\r
diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/AbstractEthertypeActionDeserializer.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/AbstractEthertypeActionDeserializer.java
new file mode 100644 (file)
index 0000000..db85917
--- /dev/null
@@ -0,0 +1,38 @@
+/*\r
+ * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
+\r
+package org.opendaylight.openflowjava.protocol.impl.deserialization.action;\r
+\r
+import io.netty.buffer.ByteBuf;\r
+\r
+import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;\r
+import org.opendaylight.openflowjava.protocol.impl.util.EncodeConstants;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.EthertypeAction;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.EthertypeActionBuilder;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.ActionBuilder;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.EtherType;\r
+\r
+/**\r
+ * @author michal.polkorab\r
+ *\r
+ */\r
+public abstract class AbstractEthertypeActionDeserializer extends AbstractActionDeserializer {\r
+\r
+    @Override\r
+    public Action deserialize(ByteBuf input) {\r
+        ActionBuilder builder = new ActionBuilder();\r
+        builder.setType(getType());\r
+        input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);\r
+        EthertypeActionBuilder etherType = new EthertypeActionBuilder();\r
+        etherType.setEthertype(new EtherType(input.readUnsignedShort()));\r
+        builder.addAugmentation(EthertypeAction.class, etherType.build());\r
+        input.skipBytes(ActionConstants.ETHERTYPE_ACTION_PADDING);\r
+        return builder.build();\r
+    }\r
+}\r
diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/AbstractHeaderActionDeserializer.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/AbstractHeaderActionDeserializer.java
new file mode 100644 (file)
index 0000000..a04453e
--- /dev/null
@@ -0,0 +1,33 @@
+/*\r
+ * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
+\r
+package org.opendaylight.openflowjava.protocol.impl.deserialization.action;\r
+\r
+import io.netty.buffer.ByteBuf;\r
+\r
+import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;\r
+import org.opendaylight.openflowjava.protocol.impl.util.EncodeConstants;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.ActionBuilder;\r
+\r
+/**\r
+ * @author michal.polkorab\r
+ *\r
+ */\r
+public abstract class AbstractHeaderActionDeserializer extends AbstractActionDeserializer {\r
+\r
+    @Override\r
+    public Action deserialize(ByteBuf input) {\r
+        ActionBuilder builder = new ActionBuilder();\r
+        input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);\r
+        builder.setType(getType());\r
+        input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);\r
+        input.skipBytes(ActionConstants.PADDING_IN_ACTION_HEADER);\r
+        return builder.build();\r
+    }\r
+}\r
diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF10AbstractIpAddressActionDeserializer.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF10AbstractIpAddressActionDeserializer.java
new file mode 100644 (file)
index 0000000..49e96ef
--- /dev/null
@@ -0,0 +1,54 @@
+/*\r
+ * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
+\r
+package org.opendaylight.openflowjava.protocol.impl.deserialization.action;\r
+\r
+import io.netty.buffer.ByteBuf;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+\r
+import org.opendaylight.openflowjava.protocol.impl.util.EncodeConstants;\r
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.IpAddressAction;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.IpAddressActionBuilder;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.ActionBuilder;\r
+import org.opendaylight.yangtools.yang.binding.Augmentation;\r
+\r
+import com.google.common.base.Joiner;\r
+\r
+/**\r
+ * @author michal.polkorab\r
+ *\r
+ */\r
+public abstract class OF10AbstractIpAddressActionDeserializer extends AbstractActionDeserializer {\r
+\r
+    @Override\r
+    public Action deserialize(ByteBuf input) {\r
+        ActionBuilder builder = new ActionBuilder();\r
+        input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);\r
+        builder.setType(getType());\r
+        input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);\r
+        builder.addAugmentation(IpAddressAction.class,\r
+                createNwAddressAugmentationAndPad(input));\r
+        return builder.build();\r
+    }\r
+\r
+    private static Augmentation<Action> createNwAddressAugmentationAndPad(ByteBuf input) {\r
+        IpAddressActionBuilder ipBuilder = new IpAddressActionBuilder();\r
+        List<String> groups = new ArrayList<>();\r
+        for (int i = 0; i < EncodeConstants.GROUPS_IN_IPV4_ADDRESS; i++) {\r
+            groups.add(Short.toString(input.readUnsignedByte()));\r
+        }\r
+        Joiner joiner = Joiner.on(".");\r
+        ipBuilder.setIpAddress(new Ipv4Address(joiner.join(groups)));\r
+        return ipBuilder.build();\r
+    }\r
+\r
+}\r
diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF10AbstractMacAddressActionDeserializer.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF10AbstractMacAddressActionDeserializer.java
new file mode 100644 (file)
index 0000000..e2a7095
--- /dev/null
@@ -0,0 +1,46 @@
+/*\r
+ * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
+\r
+package org.opendaylight.openflowjava.protocol.impl.deserialization.action;\r
+\r
+import io.netty.buffer.ByteBuf;\r
+\r
+import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;\r
+import org.opendaylight.openflowjava.protocol.impl.util.ByteBufUtils;\r
+import org.opendaylight.openflowjava.protocol.impl.util.EncodeConstants;\r
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.DlAddressAction;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.DlAddressActionBuilder;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.ActionBuilder;\r
+\r
+/**\r
+ * @author michal.polkorab\r
+ *\r
+ */\r
+public abstract class OF10AbstractMacAddressActionDeserializer extends AbstractActionDeserializer {\r
+\r
+    @Override\r
+    public Action deserialize(ByteBuf input) {\r
+        ActionBuilder builder = new ActionBuilder();\r
+        input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);\r
+        builder.setType(getType());\r
+        input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);\r
+        builder.addAugmentation(DlAddressAction.class, createDlAugmentationAndPad(input));\r
+        return builder.build();\r
+    }\r
+\r
+    private static DlAddressAction createDlAugmentationAndPad(ByteBuf input) {\r
+        DlAddressActionBuilder dlBuilder = new DlAddressActionBuilder();\r
+        byte[] address = new byte[EncodeConstants.MAC_ADDRESS_LENGTH];\r
+        input.readBytes(address);\r
+        dlBuilder.setDlAddress(new MacAddress(ByteBufUtils.macAddressToString(address)));\r
+        input.skipBytes(ActionConstants.PADDING_IN_DL_ADDRESS_ACTION);\r
+        return dlBuilder.build();\r
+    }\r
+}\r
diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF10AbstractPortActionDeserializer.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF10AbstractPortActionDeserializer.java
new file mode 100644 (file)
index 0000000..9819f86
--- /dev/null
@@ -0,0 +1,43 @@
+/*\r
+ * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
+\r
+package org.opendaylight.openflowjava.protocol.impl.deserialization.action;\r
+\r
+import io.netty.buffer.ByteBuf;\r
+\r
+import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;\r
+import org.opendaylight.openflowjava.protocol.impl.util.EncodeConstants;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortAction;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortActionBuilder;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.ActionBuilder;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber;\r
+\r
+/**\r
+ * @author michal.polkorab\r
+ *\r
+ */\r
+public abstract class OF10AbstractPortActionDeserializer extends AbstractActionDeserializer {\r
+\r
+    @Override\r
+    public Action deserialize(ByteBuf input) {\r
+        ActionBuilder builder = new ActionBuilder();\r
+        input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);\r
+        builder.setType(getType());\r
+        input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);\r
+        createPortAugmentation(input, builder);\r
+        input.skipBytes(ActionConstants.PADDING_IN_TP_PORT_ACTION);\r
+        return builder.build();\r
+    }\r
+\r
+    protected static void createPortAugmentation(ByteBuf input, ActionBuilder actionBuilder) {\r
+        PortActionBuilder portBuilder = new PortActionBuilder();\r
+        portBuilder.setPort(new PortNumber((long) input.readUnsignedShort()));\r
+        actionBuilder.addAugmentation(PortAction.class, portBuilder.build());\r
+    }\r
+}\r
diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF10EnqueueActionDeserializer.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF10EnqueueActionDeserializer.java
new file mode 100644 (file)
index 0000000..b9286e1
--- /dev/null
@@ -0,0 +1,47 @@
+/*\r
+ * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
+\r
+package org.opendaylight.openflowjava.protocol.impl.deserialization.action;\r
+\r
+import io.netty.buffer.ByteBuf;\r
+\r
+import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;\r
+import org.opendaylight.openflowjava.protocol.impl.util.EncodeConstants;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.QueueIdAction;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.QueueIdActionBuilder;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.Enqueue;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.ActionBuilder;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionBase;\r
+\r
+/**\r
+ * @author michal.polkorab\r
+ *\r
+ */\r
+public class OF10EnqueueActionDeserializer extends OF10AbstractPortActionDeserializer {\r
+\r
+    @Override\r
+    public Action deserialize(ByteBuf input) {\r
+        ActionBuilder builder = new ActionBuilder();\r
+        input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);\r
+        builder.setType(getType());\r
+        input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);\r
+        createPortAugmentation(input, builder);\r
+        input.skipBytes(ActionConstants.PADDING_IN_ENQUEUE_ACTION);\r
+        QueueIdActionBuilder queueBuilder = new QueueIdActionBuilder();\r
+        queueBuilder.setQueueId(input.readUnsignedInt());\r
+        builder.addAugmentation(QueueIdAction.class, queueBuilder.build());\r
+        return builder.build();\r
+    }\r
+\r
+    @Override\r
+    protected Class<? extends ActionBase> getType() {\r
+        return Enqueue.class;\r
+    }\r
+\r
+}\r
diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF10OutputActionDeserializer.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF10OutputActionDeserializer.java
new file mode 100644 (file)
index 0000000..25e1b2b
--- /dev/null
@@ -0,0 +1,45 @@
+/*\r
+ * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
+\r
+package org.opendaylight.openflowjava.protocol.impl.deserialization.action;\r
+\r
+import io.netty.buffer.ByteBuf;\r
+\r
+import org.opendaylight.openflowjava.protocol.impl.util.EncodeConstants;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaxLengthAction;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaxLengthActionBuilder;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.Output;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.ActionBuilder;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionBase;\r
+\r
+/**\r
+ * @author michal.polkorab\r
+ *\r
+ */\r
+public class OF10OutputActionDeserializer extends OF10AbstractPortActionDeserializer {\r
+\r
+    @Override\r
+    public Action deserialize(ByteBuf input) {\r
+        ActionBuilder builder = new ActionBuilder();\r
+        input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);\r
+        builder.setType(getType());\r
+        input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);\r
+        createPortAugmentation(input, builder);\r
+        MaxLengthActionBuilder maxLen = new MaxLengthActionBuilder();\r
+        maxLen.setMaxLength(input.readUnsignedShort());\r
+        builder.addAugmentation(MaxLengthAction.class, maxLen.build());\r
+        return builder.build();\r
+    }\r
+\r
+    @Override\r
+    protected Class<? extends ActionBase> getType() {\r
+        return Output.class;\r
+    }\r
+\r
+}\r
diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF10SetDlDstActionDeserializer.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF10SetDlDstActionDeserializer.java
new file mode 100644 (file)
index 0000000..2cdc5d0
--- /dev/null
@@ -0,0 +1,25 @@
+/*\r
+ * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
+\r
+package org.opendaylight.openflowjava.protocol.impl.deserialization.action;\r
+\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetDlDst;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionBase;\r
+\r
+/**\r
+ * @author michal.polkorab\r
+ *\r
+ */\r
+public class OF10SetDlDstActionDeserializer extends OF10AbstractMacAddressActionDeserializer {\r
+\r
+    @Override\r
+    protected Class<? extends ActionBase> getType() {\r
+        return SetDlDst.class;\r
+    }\r
+\r
+}\r
diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF10SetDlSrcActionDeserializer.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF10SetDlSrcActionDeserializer.java
new file mode 100644 (file)
index 0000000..34b16b4
--- /dev/null
@@ -0,0 +1,25 @@
+/*\r
+ * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
+\r
+package org.opendaylight.openflowjava.protocol.impl.deserialization.action;\r
+\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetDlSrc;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionBase;\r
+\r
+/**\r
+ * @author michal.polkorab\r
+ *\r
+ */\r
+public class OF10SetDlSrcActionDeserializer extends OF10AbstractMacAddressActionDeserializer {\r
+\r
+    @Override\r
+    protected Class<? extends ActionBase> getType() {\r
+        return SetDlSrc.class;\r
+    }\r
+\r
+}\r
diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF10SetNwDstActionDeserializer.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF10SetNwDstActionDeserializer.java
new file mode 100644 (file)
index 0000000..c41021d
--- /dev/null
@@ -0,0 +1,25 @@
+/*\r
+ * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
+\r
+package org.opendaylight.openflowjava.protocol.impl.deserialization.action;\r
+\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetNwDst;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionBase;\r
+\r
+/**\r
+ * @author michal.polkorab\r
+ *\r
+ */\r
+public class OF10SetNwDstActionDeserializer extends OF10AbstractIpAddressActionDeserializer {\r
+\r
+    @Override\r
+    protected Class<? extends ActionBase> getType() {\r
+        return SetNwDst.class;\r
+    }\r
+\r
+}\r
diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF10SetNwSrcActionDeserializer.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF10SetNwSrcActionDeserializer.java
new file mode 100644 (file)
index 0000000..3155013
--- /dev/null
@@ -0,0 +1,25 @@
+/*\r
+ * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
+\r
+package org.opendaylight.openflowjava.protocol.impl.deserialization.action;\r
+\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetNwSrc;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionBase;\r
+\r
+/**\r
+ * @author michal.polkorab\r
+ *\r
+ */\r
+public class OF10SetNwSrcActionDeserializer extends OF10AbstractIpAddressActionDeserializer {\r
+\r
+    @Override\r
+    protected Class<? extends ActionBase> getType() {\r
+        return SetNwSrc.class;\r
+    }\r
+\r
+}\r
diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF10SetNwTosActionDeserializer.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF10SetNwTosActionDeserializer.java
new file mode 100644 (file)
index 0000000..bdb9510
--- /dev/null
@@ -0,0 +1,46 @@
+/*\r
+ * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
+\r
+package org.opendaylight.openflowjava.protocol.impl.deserialization.action;\r
+\r
+import io.netty.buffer.ByteBuf;\r
+\r
+import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;\r
+import org.opendaylight.openflowjava.protocol.impl.util.EncodeConstants;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.NwTosAction;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.NwTosActionBuilder;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetNwTos;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.ActionBuilder;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionBase;\r
+\r
+/**\r
+ * @author michal.polkorab\r
+ *\r
+ */\r
+public class OF10SetNwTosActionDeserializer extends AbstractActionDeserializer {\r
+\r
+    @Override\r
+    public Action deserialize(ByteBuf input) {\r
+        ActionBuilder builder = new ActionBuilder();\r
+        input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);\r
+        builder.setType(getType());\r
+        input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);\r
+        NwTosActionBuilder tosBuilder = new NwTosActionBuilder();\r
+        tosBuilder.setNwTos(input.readUnsignedByte());\r
+        builder.addAugmentation(NwTosAction.class, tosBuilder.build());\r
+        input.skipBytes(ActionConstants.PADDING_IN_SET_NW_TOS_ACTION);\r
+        return builder.build();\r
+    }\r
+\r
+    @Override\r
+    protected Class<? extends ActionBase> getType() {\r
+        return SetNwTos.class;\r
+    }\r
+\r
+}\r
diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF10SetTpDstActionDeserializer.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF10SetTpDstActionDeserializer.java
new file mode 100644 (file)
index 0000000..96a41ff
--- /dev/null
@@ -0,0 +1,25 @@
+/*\r
+ * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
+\r
+package org.opendaylight.openflowjava.protocol.impl.deserialization.action;\r
+\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetTpDst;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionBase;\r
+\r
+/**\r
+ * @author michal.polkorab\r
+ *\r
+ */\r
+public class OF10SetTpDstActionDeserializer extends OF10AbstractPortActionDeserializer {\r
+\r
+    @Override\r
+    protected Class<? extends ActionBase> getType() {\r
+        return SetTpDst.class;\r
+    }\r
+\r
+}\r
diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF10SetTpSrcActionDeserializer.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF10SetTpSrcActionDeserializer.java
new file mode 100644 (file)
index 0000000..31271a4
--- /dev/null
@@ -0,0 +1,25 @@
+/*\r
+ * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
+\r
+package org.opendaylight.openflowjava.protocol.impl.deserialization.action;\r
+\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetTpSrc;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionBase;\r
+\r
+/**\r
+ * @author michal.polkorab\r
+ *\r
+ */\r
+public class OF10SetTpSrcActionDeserializer extends OF10AbstractPortActionDeserializer {\r
+\r
+    @Override\r
+    protected Class<? extends ActionBase> getType() {\r
+        return SetTpSrc.class;\r
+    }\r
+\r
+}\r
diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF10SetVlanPcpActionDeserializer.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF10SetVlanPcpActionDeserializer.java
new file mode 100644 (file)
index 0000000..f46779d
--- /dev/null
@@ -0,0 +1,46 @@
+/*\r
+ * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
+\r
+package org.opendaylight.openflowjava.protocol.impl.deserialization.action;\r
+\r
+import io.netty.buffer.ByteBuf;\r
+\r
+import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;\r
+import org.opendaylight.openflowjava.protocol.impl.util.EncodeConstants;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.VlanPcpAction;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.VlanPcpActionBuilder;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetVlanPcp;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.ActionBuilder;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionBase;\r
+\r
+/**\r
+ * @author michal.polkorab\r
+ *\r
+ */\r
+public class OF10SetVlanPcpActionDeserializer extends AbstractActionDeserializer {\r
+\r
+    @Override\r
+    public Action deserialize(ByteBuf input) {\r
+        ActionBuilder builder = new ActionBuilder();\r
+        input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);\r
+        builder.setType(getType());\r
+        input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);\r
+        VlanPcpActionBuilder vlanBuilder = new VlanPcpActionBuilder();\r
+        vlanBuilder.setVlanPcp(input.readUnsignedByte());\r
+        input.skipBytes(ActionConstants.PADDING_IN_SET_VLAN_PCP_ACTION);\r
+        builder.addAugmentation(VlanPcpAction.class, vlanBuilder.build());\r
+        return builder.build();\r
+    }\r
+\r
+    @Override\r
+    protected Class<? extends ActionBase> getType() {\r
+        return SetVlanPcp.class;\r
+    }\r
+\r
+}\r
diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF10SetVlanVidActionDeserializer.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF10SetVlanVidActionDeserializer.java
new file mode 100644 (file)
index 0000000..b422d88
--- /dev/null
@@ -0,0 +1,46 @@
+/*\r
+ * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
+\r
+package org.opendaylight.openflowjava.protocol.impl.deserialization.action;\r
+\r
+import io.netty.buffer.ByteBuf;\r
+\r
+import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;\r
+import org.opendaylight.openflowjava.protocol.impl.util.EncodeConstants;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.VlanVidAction;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.VlanVidActionBuilder;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetVlanVid;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.ActionBuilder;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionBase;\r
+\r
+/**\r
+ * @author michal.polkorab\r
+ *\r
+ */\r
+public class OF10SetVlanVidActionDeserializer extends AbstractActionDeserializer {\r
+\r
+    @Override\r
+    public Action deserialize(ByteBuf input) {\r
+        ActionBuilder builder = new ActionBuilder();\r
+        input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);\r
+        builder.setType(getType());\r
+        input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);\r
+        VlanVidActionBuilder vlanBuilder = new VlanVidActionBuilder();\r
+        vlanBuilder.setVlanVid(input.readUnsignedShort());\r
+        input.skipBytes(ActionConstants.PADDING_IN_SET_VLAN_VID_ACTION);\r
+        builder.addAugmentation(VlanVidAction.class, vlanBuilder.build());\r
+        return builder.build();\r
+    }\r
+\r
+    @Override\r
+    protected Class<? extends ActionBase> getType() {\r
+        return SetVlanVid.class;\r
+    }\r
+\r
+}\r
diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF10StripVlanActionDeserializer.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF10StripVlanActionDeserializer.java
new file mode 100644 (file)
index 0000000..bb5c4a4
--- /dev/null
@@ -0,0 +1,25 @@
+/*\r
+ * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
+\r
+package org.opendaylight.openflowjava.protocol.impl.deserialization.action;\r
+\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.StripVlan;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionBase;\r
+\r
+/**\r
+ * @author michal.polkorab\r
+ *\r
+ */\r
+public class OF10StripVlanActionDeserializer extends AbstractHeaderActionDeserializer {\r
+\r
+    @Override\r
+    protected Class<? extends ActionBase> getType() {\r
+        return StripVlan.class;\r
+    }\r
+\r
+}\r
diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13CopyTtlInActionDeserializer.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13CopyTtlInActionDeserializer.java
new file mode 100644 (file)
index 0000000..e56c581
--- /dev/null
@@ -0,0 +1,25 @@
+/*\r
+ * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
+\r
+package org.opendaylight.openflowjava.protocol.impl.deserialization.action;\r
+\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.CopyTtlIn;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionBase;\r
+\r
+/**\r
+ * @author michal.polkorab\r
+ *\r
+ */\r
+public class OF13CopyTtlInActionDeserializer extends AbstractHeaderActionDeserializer {\r
+\r
+    @Override\r
+    protected Class<? extends ActionBase> getType() {\r
+        return CopyTtlIn.class;\r
+    }\r
+\r
+}\r
diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13CopyTtlOutActionDeserializer.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13CopyTtlOutActionDeserializer.java
new file mode 100644 (file)
index 0000000..731a82a
--- /dev/null
@@ -0,0 +1,25 @@
+/*\r
+ * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
+\r
+package org.opendaylight.openflowjava.protocol.impl.deserialization.action;\r
+\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.CopyTtlOut;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionBase;\r
+\r
+/**\r
+ * @author michal.polkorab\r
+ *\r
+ */\r
+public class OF13CopyTtlOutActionDeserializer extends AbstractHeaderActionDeserializer {\r
+\r
+    @Override\r
+    protected Class<? extends ActionBase> getType() {\r
+        return CopyTtlOut.class;\r
+    }\r
+\r
+}\r
diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13DecMplsTtlActionDeserializer.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13DecMplsTtlActionDeserializer.java
new file mode 100644 (file)
index 0000000..bab50a9
--- /dev/null
@@ -0,0 +1,25 @@
+/*\r
+ * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
+\r
+package org.opendaylight.openflowjava.protocol.impl.deserialization.action;\r
+\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.DecMplsTtl;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionBase;\r
+\r
+/**\r
+ * @author michal.polkorab\r
+ *\r
+ */\r
+public class OF13DecMplsTtlActionDeserializer extends AbstractHeaderActionDeserializer {\r
+\r
+    @Override\r
+    protected Class<? extends ActionBase> getType() {\r
+        return DecMplsTtl.class;\r
+    }\r
+\r
+}\r
diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13DecNwTtlActionDeserializer.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13DecNwTtlActionDeserializer.java
new file mode 100644 (file)
index 0000000..8f112ff
--- /dev/null
@@ -0,0 +1,25 @@
+/*\r
+ * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
+\r
+package org.opendaylight.openflowjava.protocol.impl.deserialization.action;\r
+\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.DecNwTtl;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionBase;\r
+\r
+/**\r
+ * @author michal.polkorab\r
+ *\r
+ */\r
+public class OF13DecNwTtlActionDeserializer extends AbstractHeaderActionDeserializer {\r
+\r
+    @Override\r
+    protected Class<? extends ActionBase> getType() {\r
+        return DecNwTtl.class;\r
+    }\r
+\r
+}\r
diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13GroupActionDeserializer.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13GroupActionDeserializer.java
new file mode 100644 (file)
index 0000000..aa8803f
--- /dev/null
@@ -0,0 +1,43 @@
+/*\r
+ * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
+\r
+package org.opendaylight.openflowjava.protocol.impl.deserialization.action;\r
+\r
+import io.netty.buffer.ByteBuf;\r
+\r
+import org.opendaylight.openflowjava.protocol.impl.util.EncodeConstants;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.GroupIdAction;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.GroupIdActionBuilder;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.Group;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.ActionBuilder;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionBase;\r
+\r
+/**\r
+ * @author michal.polkorab\r
+ *\r
+ */\r
+public class OF13GroupActionDeserializer extends AbstractActionDeserializer {\r
+\r
+    @Override\r
+    public Action deserialize(ByteBuf input) {\r
+        ActionBuilder builder = new ActionBuilder();\r
+        builder.setType(getType());\r
+        input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);\r
+        GroupIdActionBuilder group = new GroupIdActionBuilder();\r
+        group.setGroupId(input.readUnsignedInt());\r
+        builder.addAugmentation(GroupIdAction.class, group.build());\r
+        return builder.build();\r
+    }\r
+\r
+    @Override\r
+    protected Class<? extends ActionBase> getType() {\r
+        return Group.class;\r
+    }\r
+\r
+}\r
diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13OutputActionDeserializer.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13OutputActionDeserializer.java
new file mode 100644 (file)
index 0000000..90cf669
--- /dev/null
@@ -0,0 +1,51 @@
+/*\r
+ * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
+\r
+package org.opendaylight.openflowjava.protocol.impl.deserialization.action;\r
+\r
+import io.netty.buffer.ByteBuf;\r
+\r
+import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;\r
+import org.opendaylight.openflowjava.protocol.impl.util.EncodeConstants;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaxLengthAction;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaxLengthActionBuilder;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortAction;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortActionBuilder;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.Output;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.ActionBuilder;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionBase;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber;\r
+\r
+/**\r
+ * @author michal.polkorab\r
+ *\r
+ */\r
+public class OF13OutputActionDeserializer extends AbstractActionDeserializer {\r
+\r
+    @Override\r
+    public Action deserialize(ByteBuf input) {\r
+        ActionBuilder builder = new ActionBuilder();\r
+        builder.setType(getType());\r
+        input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);\r
+        PortActionBuilder port = new PortActionBuilder();\r
+        port.setPort(new PortNumber(input.readUnsignedInt()));\r
+        builder.addAugmentation(PortAction.class, port.build());\r
+        MaxLengthActionBuilder maxLen = new MaxLengthActionBuilder();\r
+        maxLen.setMaxLength(input.readUnsignedShort());\r
+        builder.addAugmentation(MaxLengthAction.class, maxLen.build());\r
+        input.skipBytes(ActionConstants.OUTPUT_PADDING);\r
+        return builder.build();\r
+    }\r
+\r
+    @Override\r
+    protected Class<? extends ActionBase> getType() {\r
+        return Output.class;\r
+    }\r
+\r
+}\r
diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13PopMplsActionDeserializer.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13PopMplsActionDeserializer.java
new file mode 100644 (file)
index 0000000..408e5b3
--- /dev/null
@@ -0,0 +1,25 @@
+/*\r
+ * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
+\r
+package org.opendaylight.openflowjava.protocol.impl.deserialization.action;\r
+\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.PopMpls;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionBase;\r
+\r
+/**\r
+ * @author michal.polkorab\r
+ *\r
+ */\r
+public class OF13PopMplsActionDeserializer extends AbstractEthertypeActionDeserializer {\r
+\r
+    @Override\r
+    protected Class<? extends ActionBase> getType() {\r
+        return PopMpls.class;\r
+    }\r
+\r
+}\r
diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13PopPbbActionDeserializer.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13PopPbbActionDeserializer.java
new file mode 100644 (file)
index 0000000..99ec038
--- /dev/null
@@ -0,0 +1,25 @@
+/*\r
+ * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
+\r
+package org.opendaylight.openflowjava.protocol.impl.deserialization.action;\r
+\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.PopPbb;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionBase;\r
+\r
+/**\r
+ * @author michal.polkorab\r
+ *\r
+ */\r
+public class OF13PopPbbActionDeserializer extends AbstractHeaderActionDeserializer {\r
+\r
+    @Override\r
+    protected Class<? extends ActionBase> getType() {\r
+        return PopPbb.class;\r
+    }\r
+\r
+}\r
diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13PopVlanActionDeserializer.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13PopVlanActionDeserializer.java
new file mode 100644 (file)
index 0000000..e31a9bf
--- /dev/null
@@ -0,0 +1,25 @@
+/*\r
+ * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
+\r
+package org.opendaylight.openflowjava.protocol.impl.deserialization.action;\r
+\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.PopVlan;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionBase;\r
+\r
+/**\r
+ * @author michal.polkorab\r
+ *\r
+ */\r
+public class OF13PopVlanActionDeserializer extends AbstractHeaderActionDeserializer {\r
+\r
+    @Override\r
+    protected Class<? extends ActionBase> getType() {\r
+        return PopVlan.class;\r
+    }\r
+\r
+}\r
diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13PushMplsActionDeserializer.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13PushMplsActionDeserializer.java
new file mode 100644 (file)
index 0000000..121e1e9
--- /dev/null
@@ -0,0 +1,25 @@
+/*\r
+ * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
+\r
+package org.opendaylight.openflowjava.protocol.impl.deserialization.action;\r
+\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.PushMpls;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionBase;\r
+\r
+/**\r
+ * @author michal.polkorab\r
+ *\r
+ */\r
+public class OF13PushMplsActionDeserializer extends AbstractEthertypeActionDeserializer {\r
+\r
+    @Override\r
+    protected Class<? extends ActionBase> getType() {\r
+        return PushMpls.class;\r
+    }\r
+\r
+}\r
diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13PushPbbActionDeserializer.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13PushPbbActionDeserializer.java
new file mode 100644 (file)
index 0000000..6a44f04
--- /dev/null
@@ -0,0 +1,25 @@
+/*\r
+ * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
+\r
+package org.opendaylight.openflowjava.protocol.impl.deserialization.action;\r
+\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.PushPbb;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionBase;\r
+\r
+/**\r
+ * @author michal.polkorab\r
+ *\r
+ */\r
+public class OF13PushPbbActionDeserializer extends AbstractEthertypeActionDeserializer {\r
+\r
+    @Override\r
+    protected Class<? extends ActionBase> getType() {\r
+        return PushPbb.class;\r
+    }\r
+\r
+}\r
diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13PushVlanActionDeserializer.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13PushVlanActionDeserializer.java
new file mode 100644 (file)
index 0000000..eb0b059
--- /dev/null
@@ -0,0 +1,25 @@
+/*\r
+ * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
+\r
+package org.opendaylight.openflowjava.protocol.impl.deserialization.action;\r
+\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.PushVlan;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionBase;\r
+\r
+/**\r
+ * @author michal.polkorab\r
+ *\r
+ */\r
+public class OF13PushVlanActionDeserializer extends AbstractEthertypeActionDeserializer {\r
+\r
+    @Override\r
+    protected Class<? extends ActionBase> getType() {\r
+        return PushVlan.class;\r
+    }\r
+\r
+}\r
diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13SetFieldActionDeserializer.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13SetFieldActionDeserializer.java
new file mode 100644 (file)
index 0000000..aba3e78
--- /dev/null
@@ -0,0 +1,73 @@
+/*\r
+ * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
+\r
+package org.opendaylight.openflowjava.protocol.impl.deserialization.action;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+\r
+import io.netty.buffer.ByteBuf;\r
+\r
+import org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerRegistry;\r
+import org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerRegistryInjector;\r
+import org.opendaylight.openflowjava.protocol.api.extensibility.EnhancedMessageCodeKey;\r
+import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;\r
+import org.opendaylight.openflowjava.protocol.impl.util.EncodeConstants;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.OxmFieldsAction;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.OxmFieldsActionBuilder;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetField;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.ActionBuilder;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionBase;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;\r
+\r
+/**\r
+ * @author michal.polkorab\r
+ *\r
+ */\r
+public class OF13SetFieldActionDeserializer extends AbstractActionDeserializer\r
+        implements DeserializerRegistryInjector {\r
+\r
+    private DeserializerRegistry registry;\r
+\r
+    @Override\r
+    public Action deserialize(ByteBuf input) {\r
+        ActionBuilder builder = new ActionBuilder();\r
+        builder.setType(getType());\r
+        int startIndex = input.readerIndex();\r
+        input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);\r
+        OxmFieldsActionBuilder matchEntries = new OxmFieldsActionBuilder();\r
+        int oxmClass = input.getUnsignedShort(input.readerIndex());\r
+        // get oxm_field & hasMask byte and extract the field value\r
+        int oxmField = input.getUnsignedByte(input.readerIndex()\r
+                + EncodeConstants.SIZE_OF_SHORT_IN_BYTES) >>> 1;\r
+        OFDeserializer<MatchEntries> matchDeserializer = registry.getDeserializer(\r
+                new EnhancedMessageCodeKey(EncodeConstants.OF13_VERSION_ID, oxmClass,\r
+                        oxmField, MatchEntries.class));\r
+        List<MatchEntries> entry = new ArrayList<>();\r
+        entry.add(matchDeserializer.deserialize(input));\r
+        matchEntries.setMatchEntries(entry);\r
+        builder.addAugmentation(OxmFieldsAction.class, matchEntries.build());\r
+        int paddingRemainder = (input.readerIndex() - startIndex) % EncodeConstants.PADDING;\r
+        if (paddingRemainder != 0) {\r
+            input.skipBytes(EncodeConstants.PADDING - paddingRemainder);\r
+        }\r
+        return builder.build();\r
+    }\r
+\r
+    @Override\r
+    protected Class<? extends ActionBase> getType() {\r
+        return SetField.class;\r
+    }\r
+\r
+    @Override\r
+    public void injectDeserializerRegistry(DeserializerRegistry deserializerRegistry) {\r
+        this.registry = deserializerRegistry;\r
+    }\r
+\r
+}\r
diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13SetMplsTtlActionDeserializer.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13SetMplsTtlActionDeserializer.java
new file mode 100644 (file)
index 0000000..b70d830
--- /dev/null
@@ -0,0 +1,45 @@
+/*\r
+ * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
+\r
+package org.opendaylight.openflowjava.protocol.impl.deserialization.action;\r
+\r
+import io.netty.buffer.ByteBuf;\r
+\r
+import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;\r
+import org.opendaylight.openflowjava.protocol.impl.util.EncodeConstants;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MplsTtlAction;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MplsTtlActionBuilder;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetMplsTtl;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.ActionBuilder;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionBase;\r
+\r
+/**\r
+ * @author michal.polkorab\r
+ *\r
+ */\r
+public class OF13SetMplsTtlActionDeserializer extends AbstractActionDeserializer {\r
+\r
+    @Override\r
+    public Action deserialize(ByteBuf input) {\r
+        ActionBuilder builder = new ActionBuilder();\r
+        builder.setType(getType());\r
+        input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);\r
+        MplsTtlActionBuilder mplsTtl = new MplsTtlActionBuilder();\r
+        mplsTtl.setMplsTtl(input.readUnsignedByte());\r
+        builder.addAugmentation(MplsTtlAction.class, mplsTtl.build());\r
+        input.skipBytes(ActionConstants.SET_MPLS_TTL_PADDING);\r
+        return builder.build();\r
+    }\r
+\r
+    @Override\r
+    protected Class<? extends ActionBase> getType() {\r
+        return SetMplsTtl.class;\r
+    }\r
+\r
+}\r
diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13SetNwTtlActionDeserializer.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13SetNwTtlActionDeserializer.java
new file mode 100644 (file)
index 0000000..f3f119e
--- /dev/null
@@ -0,0 +1,45 @@
+/*\r
+ * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
+\r
+package org.opendaylight.openflowjava.protocol.impl.deserialization.action;\r
+\r
+import io.netty.buffer.ByteBuf;\r
+\r
+import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;\r
+import org.opendaylight.openflowjava.protocol.impl.util.EncodeConstants;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.NwTtlAction;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.NwTtlActionBuilder;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetNwTtl;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.ActionBuilder;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionBase;\r
+\r
+/**\r
+ * @author michal.polkorab\r
+ *\r
+ */\r
+public class OF13SetNwTtlActionDeserializer extends AbstractActionDeserializer {\r
+\r
+    @Override\r
+    public Action deserialize(ByteBuf input) {\r
+        ActionBuilder builder = new ActionBuilder();\r
+        builder.setType(getType());\r
+        input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);\r
+        NwTtlActionBuilder nwTtl = new NwTtlActionBuilder();\r
+        nwTtl.setNwTtl(input.readUnsignedByte());\r
+        builder.addAugmentation(NwTtlAction.class, nwTtl.build());\r
+        input.skipBytes(ActionConstants.SET_NW_TTL_PADDING);\r
+        return builder.build();\r
+    }\r
+\r
+    @Override\r
+    protected Class<? extends ActionBase> getType() {\r
+        return SetNwTtl.class;\r
+    }\r
+\r
+}\r
diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13SetQueueActionDeserializer.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13SetQueueActionDeserializer.java
new file mode 100644 (file)
index 0000000..0ac4671
--- /dev/null
@@ -0,0 +1,43 @@
+/*\r
+ * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
+\r
+package org.opendaylight.openflowjava.protocol.impl.deserialization.action;\r
+\r
+import io.netty.buffer.ByteBuf;\r
+\r
+import org.opendaylight.openflowjava.protocol.impl.util.EncodeConstants;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.QueueIdAction;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.QueueIdActionBuilder;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetQueue;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.ActionBuilder;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionBase;\r
+\r
+/**\r
+ * @author michal.polkorab\r
+ *\r
+ */\r
+public class OF13SetQueueActionDeserializer extends AbstractActionDeserializer {\r
+\r
+    @Override\r
+    public Action deserialize(ByteBuf input) {\r
+        ActionBuilder builder = new ActionBuilder();\r
+        builder.setType(getType());\r
+        input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);\r
+        QueueIdActionBuilder queueId = new QueueIdActionBuilder();\r
+        queueId.setQueueId(input.readUnsignedInt());\r
+        builder.addAugmentation(QueueIdAction.class, queueId.build());\r
+        return builder.build();\r
+    }\r
+\r
+    @Override\r
+    protected Class<? extends ActionBase> getType() {\r
+        return SetQueue.class;\r
+    }\r
+\r
+}\r
diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/experimenters/ExperimenterActionDeserializer.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/experimenters/ExperimenterActionDeserializer.java
new file mode 100644 (file)
index 0000000..9a851a1
--- /dev/null
@@ -0,0 +1,60 @@
+/*\r
+ * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
+\r
+package org.opendaylight.openflowjava.protocol.impl.deserialization.experimenters;\r
+\r
+import io.netty.buffer.ByteBuf;\r
+\r
+import org.opendaylight.openflowjava.protocol.api.extensibility.HeaderDeserializer;\r
+import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;\r
+import org.opendaylight.openflowjava.protocol.impl.util.EncodeConstants;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ExperimenterAction;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ExperimenterActionBuilder;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.Experimenter;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.ActionBuilder;\r
+\r
+/**\r
+ * @author michal.polkorab\r
+ *\r
+ */\r
+public class ExperimenterActionDeserializer implements OFDeserializer<Action>,\r
+        HeaderDeserializer<Action> {\r
+\r
+    @Override\r
+    public Action deserializeHeader(ByteBuf input) {\r
+        ActionBuilder builder = new ActionBuilder();\r
+        input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);\r
+        builder.setType(Experimenter.class);\r
+        input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);\r
+        ExperimenterActionBuilder expBuilder = new ExperimenterActionBuilder();\r
+        expBuilder.setExperimenter(input.readUnsignedInt());\r
+        builder.addAugmentation(ExperimenterAction.class, expBuilder.build());\r
+        return builder.build();\r
+    }\r
+\r
+    @Override\r
+    public Action deserialize(ByteBuf input) {\r
+        ActionBuilder builder = new ActionBuilder();\r
+        input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);\r
+        builder.setType(Experimenter.class);\r
+        int length = input.readUnsignedShort();\r
+        // subtract experimenter header length\r
+        length -= EncodeConstants.EXPERIMENTER_IDS_LENGTH;\r
+        ExperimenterActionBuilder expBuilder = new ExperimenterActionBuilder();\r
+        expBuilder.setExperimenter(input.readUnsignedInt());\r
+        if (length > 0) {\r
+            byte[] data = new byte[length];\r
+            input.readBytes(data);\r
+            expBuilder.setData(data);\r
+        }\r
+        builder.addAugmentation(ExperimenterAction.class, expBuilder.build());\r
+        return builder.build();\r
+    }\r
+\r
+}\r
diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/ActionsDeserializer.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/ActionsDeserializer.java
deleted file mode 100644 (file)
index 16e9808..0000000
+++ /dev/null
@@ -1,349 +0,0 @@
-/*
- * Copyright (c) 2013 Pantheon Technologies s.r.o. 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.openflowjava.protocol.impl.util;
-
-import io.netty.buffer.ByteBuf;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerRegistry;
-import org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerRegistryInjector;
-import org.opendaylight.openflowjava.protocol.api.extensibility.EnhancedMessageCodeKey;
-import org.opendaylight.openflowjava.protocol.api.extensibility.HeaderDeserializer;
-import org.opendaylight.openflowjava.protocol.api.extensibility.MessageCodeKey;
-import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.EthertypeAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.EthertypeActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ExperimenterAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.GroupIdAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.GroupIdActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaxLengthAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaxLengthActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MplsTtlAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MplsTtlActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.NwTtlAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.NwTtlActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.OxmFieldsAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.OxmFieldsActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.QueueIdAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.QueueIdActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.CopyTtlIn;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.CopyTtlOut;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.DecMplsTtl;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.DecNwTtl;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.Experimenter;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.Group;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.Output;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.PopMpls;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.PopPbb;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.PopVlan;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.PushMpls;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.PushPbb;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.PushVlan;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetField;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetMplsTtl;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetNwTtl;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetQueue;
-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.openflow.common.types.rev130731.ActionBase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.EtherType;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
-
-/**
- * Deserializes ofp_actions (OpenFlow v1.3)
- * @author timotej.kubas
- * @author michal.polkorab
- */
-public class ActionsDeserializer implements OFDeserializer<Action>,
-        HeaderDeserializer<Action>, DeserializerRegistryInjector {
-    
-    private static final byte PADDING_IN_ACTIONS_HEADER = 4;
-    private static final byte PADDING_IN_OUTPUT_ACTIONS_HEADER = 6;
-    private static final byte PADDING_IN_SET_MPLS_TTL_ACTIONS_HEADER = 3;
-    private static final byte PADDING_IN_PUSH_VLAN_ACTIONS_HEADER = 2;
-    private static final byte PADDING_IN_NW_TTL_ACTIONS_HEADER = 3;
-    private DeserializerRegistry registry;
-
-    @Override
-    public Action deserialize(ByteBuf input) {
-        Action action = null;
-        ActionBuilder actionBuilder = new ActionBuilder();
-        int type = input.getUnsignedShort(input.readerIndex());
-        switch(type) {
-        case 0:
-            action = createOutputAction(input, actionBuilder);
-            break;
-        case 11:
-            action = createCopyTtlOutAction(input, actionBuilder);
-            break;
-        case 12:
-            action = createCopyTtlInAction(input, actionBuilder);
-            break;
-        case 15:
-            action = createSetMplsTtlAction(input, actionBuilder);
-            break;
-        case 16:
-            action = createDecMplsTtlOutAction(input, actionBuilder);
-            break;
-        case 17:
-            action = createPushVlanAction(input, actionBuilder);
-            break;
-        case 18:
-            action = createPopVlanAction(input, actionBuilder);
-            break;
-        case 19:
-            action = createPushMplsAction(input, actionBuilder);
-            break;
-        case 20:
-            action = createPopMplsAction(input, actionBuilder);
-            break;
-        case 21:
-            action = createSetQueueAction(input, actionBuilder);
-            break;
-        case 22:
-            action = createGroupAction(input, actionBuilder);
-            break;
-        case 23:
-            action = createSetNwTtlAction(input, actionBuilder);
-            break;
-        case 24:
-            action = createDecNwTtlAction(input, actionBuilder);
-            break;
-        case 25:
-            action = createSetFieldAction(input, actionBuilder);
-            break;
-        case 26:
-            action = createPushPbbAction(input, actionBuilder);
-            break;
-        case 27:
-            action = createPopPbbAction(input, actionBuilder);
-            break;
-        case 0xFFFF:
-            OFDeserializer<ExperimenterAction> expDeserializer = registry.getDeserializer(
-                    new MessageCodeKey(EncodeConstants.OF13_VERSION_ID, 0xFFFF, ExperimenterAction.class));
-            ExperimenterAction expAction = expDeserializer.deserialize(input);
-            actionBuilder.addAugmentation(ExperimenterAction.class, expAction);
-            break;
-        default:
-            break;
-        }
-        return action;
-    }
-
-    @Override
-    public Action deserializeHeader(ByteBuf input) {
-        ActionBuilder builder;
-        builder = new ActionBuilder();
-        int type = input.readUnsignedShort();
-        input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
-        switch(type) {
-        case 0:
-            builder.setType(Output.class);
-            break;
-        case 11:
-            builder.setType(CopyTtlOut.class);
-            break;
-        case 12:
-            builder.setType(CopyTtlIn.class);
-            break;
-        case 15:
-            builder.setType(SetMplsTtl.class);
-            break;
-        case 16:
-            builder.setType(DecMplsTtl.class);
-            break;
-        case 17:
-            builder.setType(PushVlan.class);
-            break;
-        case 18:
-            builder.setType(PopVlan.class);
-            break;
-        case 19:
-            builder.setType(PushMpls.class);
-            break;
-        case 20:
-            builder.setType(PopMpls.class);
-            break;
-        case 21:
-            builder.setType(SetQueue.class);
-            break;
-        case 22:
-            builder.setType(Group.class);
-            break;
-        case 23:
-            builder.setType(SetNwTtl.class);
-            break;
-        case 24:
-            builder.setType(DecNwTtl.class);
-            break;
-        case 25:
-            builder.setType(SetField.class);
-            break; 
-        case 26:
-            builder.setType(PushPbb.class);
-            break;
-        case 27:
-            builder.setType(PopPbb.class);
-            break;
-        case 0xFFFF:
-            HeaderDeserializer<ExperimenterAction> expDeserializer = registry.getDeserializer(
-                    new MessageCodeKey(EncodeConstants.OF13_VERSION_ID, 0xFFFF, ExperimenterAction.class));
-            ExperimenterAction expAction = expDeserializer.deserializeHeader(input);
-            builder.setType(Experimenter.class);
-            builder.addAugmentation(ExperimenterAction.class, expAction);
-            break;
-        default: 
-            break;
-        }
-        return builder.build();
-    }
-
-    private static Action createEmptyHeader(Class<? extends ActionBase> action,
-            ByteBuf in, ActionBuilder actionBuilder) {
-        actionBuilder.setType(action);
-        in.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
-        in.skipBytes(PADDING_IN_ACTIONS_HEADER);
-        return actionBuilder.build();
-    }
-    
-    private static Action createCopyTtlInAction(ByteBuf in, ActionBuilder actionBuilder) {
-        return createEmptyHeader(CopyTtlIn.class, in, actionBuilder);
-    }
-
-    private static Action createCopyTtlOutAction(ByteBuf in, ActionBuilder actionBuilder) {
-        return createEmptyHeader(CopyTtlOut.class, in, actionBuilder);
-    }
-    
-    private static Action createDecMplsTtlOutAction(ByteBuf in, ActionBuilder actionBuilder) {
-        return createEmptyHeader(DecMplsTtl.class, in, actionBuilder);
-    }
-    
-    private static Action createPopVlanAction(ByteBuf in, ActionBuilder actionBuilder) {
-        return createEmptyHeader(PopVlan.class, in, actionBuilder);
-    }
-    
-    private static Action createDecNwTtlAction(ByteBuf in, ActionBuilder actionBuilder) {
-        return createEmptyHeader(DecNwTtl.class, in, actionBuilder);
-    }
-    
-    private static Action createPopPbbAction(ByteBuf in, ActionBuilder actionBuilder) {
-        return createEmptyHeader(PopPbb.class, in, actionBuilder);
-    }
-    
-    private static Action createOutputAction(ByteBuf in, ActionBuilder actionBuilder) {
-        actionBuilder.setType(Output.class);
-        in.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
-        PortActionBuilder port = new PortActionBuilder();
-        port.setPort(new PortNumber(in.readUnsignedInt()));
-        actionBuilder.addAugmentation(PortAction.class, port.build());
-        MaxLengthActionBuilder maxLen = new MaxLengthActionBuilder();
-        maxLen.setMaxLength(in.readUnsignedShort());
-        actionBuilder.addAugmentation(MaxLengthAction.class, maxLen.build());
-        in.skipBytes(PADDING_IN_OUTPUT_ACTIONS_HEADER);
-        return actionBuilder.build();
-    }
-    
-    private static Action createSetMplsTtlAction(ByteBuf in, ActionBuilder actionBuilder) {
-        actionBuilder.setType(SetMplsTtl.class);
-        in.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
-        MplsTtlActionBuilder mplsTtl = new MplsTtlActionBuilder();
-        mplsTtl.setMplsTtl(in.readUnsignedByte());
-        actionBuilder.addAugmentation(MplsTtlAction.class, mplsTtl.build());
-        in.skipBytes(PADDING_IN_SET_MPLS_TTL_ACTIONS_HEADER);
-        return actionBuilder.build();
-    }
-    
-    private static Action createPushAction(Class<? extends ActionBase> action,
-            ByteBuf in, ActionBuilder actionBuilder) {
-        actionBuilder.setType(action);
-        in.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
-        EthertypeActionBuilder etherType = new EthertypeActionBuilder();
-        etherType.setEthertype(new EtherType(in.readUnsignedShort()));
-        actionBuilder.addAugmentation(EthertypeAction.class, etherType.build());
-        in.skipBytes(PADDING_IN_PUSH_VLAN_ACTIONS_HEADER);
-        return actionBuilder.build();
-    }
-    
-    private static Action createPushVlanAction(ByteBuf in, ActionBuilder actionBuilder) {
-        return createPushAction(PushVlan.class, in, actionBuilder);
-    }
-    
-    private static Action createPushMplsAction(ByteBuf in, ActionBuilder actionBuilder) {
-        return createPushAction(PushMpls.class, in, actionBuilder);
-    }
-    
-    private static Action createPopMplsAction(ByteBuf in, ActionBuilder actionBuilder) {
-        return createPushAction(PopMpls.class, in, actionBuilder);
-    }
-    
-    private static Action createPushPbbAction(ByteBuf in, ActionBuilder actionBuilder) {
-        return createPushAction(PushPbb.class, in, actionBuilder);
-    }
-    
-    private static Action createSetQueueAction(ByteBuf in, ActionBuilder actionBuilder) {
-        actionBuilder.setType(SetQueue.class);
-        in.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
-        QueueIdActionBuilder queueId = new QueueIdActionBuilder();
-        queueId.setQueueId(in.readUnsignedInt());
-        actionBuilder.addAugmentation(QueueIdAction.class, queueId.build());
-        return actionBuilder.build();
-    }
-    
-    private static Action createGroupAction(ByteBuf in, ActionBuilder actionBuilder) {
-        actionBuilder.setType(Group.class);
-        in.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
-        GroupIdActionBuilder group = new GroupIdActionBuilder();
-        group.setGroupId(in.readUnsignedInt());
-        actionBuilder.addAugmentation(GroupIdAction.class, group.build());
-        return actionBuilder.build();
-    }
-
-    private static Action createSetNwTtlAction(ByteBuf in, ActionBuilder actionBuilder) {
-        actionBuilder.setType(SetNwTtl.class);
-        in.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
-        NwTtlActionBuilder nwTtl = new NwTtlActionBuilder();
-        nwTtl.setNwTtl(in.readUnsignedByte());
-        actionBuilder.addAugmentation(NwTtlAction.class, nwTtl.build());
-        in.skipBytes(PADDING_IN_NW_TTL_ACTIONS_HEADER);
-        return actionBuilder.build();
-    }
-    
-    private Action createSetFieldAction(ByteBuf in, ActionBuilder actionBuilder) {
-        actionBuilder.setType(SetField.class);
-        int startIndex = in.readerIndex();
-        in.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
-        OxmFieldsActionBuilder matchEntries = new OxmFieldsActionBuilder();
-        int oxmClass = in.getUnsignedShort(in.readerIndex());
-        // get oxm_field & hasMask byte and extract the field value
-        int oxmField = in.getUnsignedByte(in.readerIndex()
-                + EncodeConstants.SIZE_OF_SHORT_IN_BYTES) >>> 1;
-        OFDeserializer<MatchEntries> matchDeserializer = registry.getDeserializer(
-                new EnhancedMessageCodeKey(EncodeConstants.OF13_VERSION_ID, oxmClass,
-                        oxmField, MatchEntries.class));
-        List<MatchEntries> entry = new ArrayList<>();
-        entry.add(matchDeserializer.deserialize(in));
-        matchEntries.setMatchEntries(entry);
-        actionBuilder.addAugmentation(OxmFieldsAction.class, matchEntries.build());
-        int paddingRemainder = (in.readerIndex() - startIndex) % EncodeConstants.PADDING;
-        if (paddingRemainder != 0) {
-            in.skipBytes(EncodeConstants.PADDING - paddingRemainder);
-        }
-        return actionBuilder.build();
-    }
-
-    @Override
-    public void injectDeserializerRegistry(DeserializerRegistry deserializerRegistry) {
-        registry = deserializerRegistry;
-    }
-}
index f4002122b667e5dcdfd69fcc978b6cdcb9dfa957..941140a0304a8e48d72d47dc7f83dc9e405d3505 100644 (file)
@@ -47,11 +47,8 @@ public abstract class CodeKeyMakerFactory {
         return new AbstractCodeKeyMaker(version) {\r
             @Override\r
             public MessageCodeKey make(ByteBuf input) {\r
-                // EncodeConstants.EMPTY_VALUE used as temporary value\r
-                // until action deserializers are split\r
-//                int type = input.getUnsignedShort(input.readerIndex());\r
-//                return new MessageCodeKey(getVersion(), type, Action.class);\r
-                return new MessageCodeKey(getVersion(), EncodeConstants.EMPTY_VALUE, Action.class);\r
+                int type = input.getUnsignedShort(input.readerIndex());\r
+                return new MessageCodeKey(getVersion(), type, Action.class);\r
             }\r
         };\r
     }\r
diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/OF10ActionsDeserializer.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/OF10ActionsDeserializer.java
deleted file mode 100644 (file)
index 75be481..0000000
+++ /dev/null
@@ -1,253 +0,0 @@
-/*
- * Copyright (c) 2013 Pantheon Technologies s.r.o. 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.openflowjava.protocol.impl.util;
-
-import io.netty.buffer.ByteBuf;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerRegistry;
-import org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerRegistryInjector;
-import org.opendaylight.openflowjava.protocol.api.extensibility.MessageCodeKey;
-import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
-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.openflow.augments.rev131002.DlAddressAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.DlAddressActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ExperimenterAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.IpAddressAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.IpAddressActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaxLengthAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaxLengthActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.NwTosAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.NwTosActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.QueueIdAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.QueueIdActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.VlanPcpAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.VlanPcpActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.VlanVidAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.VlanVidActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.Enqueue;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.Output;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetDlDst;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetDlSrc;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetNwDst;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetNwSrc;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetNwTos;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetTpDst;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetTpSrc;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetVlanPcp;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetVlanVid;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.StripVlan;
-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.openflow.common.types.rev130731.PortNumber;
-import org.opendaylight.yangtools.yang.binding.Augmentation;
-
-import com.google.common.base.Joiner;
-
-/**
- * Deserializes ofp_action (OpenFlow v1.0) structures
- * @author michal.polkorab
- */
-public class OF10ActionsDeserializer implements OFDeserializer<Action>,
-        DeserializerRegistryInjector {
-    
-    private static final byte PADDING_IN_SET_VLAN_VID_ACTION = 2;
-    private static final byte PADDING_IN_SET_VLAN_PCP_ACTION = 3;
-    private static final byte PADDING_IN_STRIP_VLAN_ACTION = 4;
-    private static final byte PADDING_IN_SET_DL_ACTION = 6;
-    private static final byte PADDING_IN_NW_TOS_ACTION = 3;
-    private static final byte PADDING_IN_TP_ACTION = 2;
-    private static final byte PADDING_IN_ENQUEUE_ACTION = 6;
-    private DeserializerRegistry registry;
-
-    @Override
-    public Action deserialize(ByteBuf input) {
-        int type = input.readUnsignedShort();
-        input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
-        ActionBuilder actionsBuilder = new ActionBuilder();
-        Action actionsList = null;
-        switch(type) {
-        case 0:
-            actionsList = createOutputAction(input, actionsBuilder);
-            break;
-        case 1:
-            actionsList = createSetVlanVidAction(input, actionsBuilder);
-            break;
-        case 2:
-            actionsList = createVlanPcpAction(input, actionsBuilder);
-            break;
-        case 3:
-            actionsList = createStripVlanAction(input, actionsBuilder);
-            break;
-        case 4:
-            actionsList = createSetDlSrcAction(input, actionsBuilder);
-            break;
-        case 5:
-            actionsList = createSetDlDstAction(input, actionsBuilder);
-            break;
-        case 6:
-            actionsList = createSetNwSrcAction(input, actionsBuilder);
-            break;
-        case 7:
-            actionsList = createSetNwDstAction(input, actionsBuilder);
-            break;
-        case 8:
-            actionsList = createSetNwTosAction(input, actionsBuilder);
-            break;
-        case 9:
-            actionsList = createSetTpSrcAction(input, actionsBuilder);
-            break;
-        case 10:
-            actionsList = createSetTpDstAction(input, actionsBuilder);
-            break;
-        case 11:
-            actionsList = createEnqueueAction(input, actionsBuilder);
-            break;
-        case 0xFFFF:
-            OFDeserializer<ExperimenterAction> expDeserializer = registry.getDeserializer(
-                    new MessageCodeKey(EncodeConstants.OF10_VERSION_ID, 0xFFFF, ExperimenterAction.class));
-            expDeserializer.deserialize(input);
-            break;
-        default:
-            break;
-        }
-        return actionsList;
-    }
-
-    /**
-     * @param in input ByteBuf
-     * @param builder 
-     * @return ActionList
-     */
-    public static Action createOutputAction(ByteBuf in, ActionBuilder builder) {
-        builder.setType(Output.class);
-        createPortAugmentation(in, builder);
-        MaxLengthActionBuilder maxLen = new MaxLengthActionBuilder();
-        maxLen.setMaxLength(in.readUnsignedShort());
-        builder.addAugmentation(MaxLengthAction.class, maxLen.build());
-        return builder.build();
-    }
-
-    private static Action createSetVlanVidAction(ByteBuf input, ActionBuilder builder) {
-        builder.setType(SetVlanVid.class);
-        VlanVidActionBuilder vlanBuilder = new VlanVidActionBuilder();
-        vlanBuilder.setVlanVid(input.readUnsignedShort());
-        input.skipBytes(PADDING_IN_SET_VLAN_VID_ACTION);
-        builder.addAugmentation(VlanVidAction.class, vlanBuilder.build());
-        return builder.build();
-    }
-
-    private static Action createVlanPcpAction(ByteBuf input, ActionBuilder builder) {
-        builder.setType(SetVlanPcp.class);
-        VlanPcpActionBuilder vlanBuilder = new VlanPcpActionBuilder();
-        vlanBuilder.setVlanPcp(input.readUnsignedByte());
-        input.skipBytes(PADDING_IN_SET_VLAN_PCP_ACTION);
-        builder.addAugmentation(VlanPcpAction.class, vlanBuilder.build());
-        return builder.build();
-    }
-
-    private static Action createStripVlanAction(ByteBuf input, ActionBuilder builder) {
-        builder.setType(StripVlan.class);
-        input.skipBytes(PADDING_IN_STRIP_VLAN_ACTION);
-        return builder.build();
-    }
-
-    private static Action createSetDlSrcAction(ByteBuf input, ActionBuilder builder) {
-        builder.setType(SetDlSrc.class);
-        builder.addAugmentation(DlAddressAction.class, createDlAugmentationAndPad(input));
-        return builder.build();
-    }
-
-    private static Action createSetDlDstAction(ByteBuf input, ActionBuilder builder) {
-        builder.setType(SetDlDst.class);
-        builder.addAugmentation(DlAddressAction.class, createDlAugmentationAndPad(input));
-        return builder.build();
-    }
-    
-    private static DlAddressAction createDlAugmentationAndPad(ByteBuf input) {
-        DlAddressActionBuilder dlBuilder = new DlAddressActionBuilder();
-        byte[] address = new byte[EncodeConstants.MAC_ADDRESS_LENGTH];
-        input.readBytes(address);
-        dlBuilder.setDlAddress(new MacAddress(ByteBufUtils.macAddressToString(address)));
-        input.skipBytes(PADDING_IN_SET_DL_ACTION);
-        return dlBuilder.build();
-    }
-
-    private static Action createSetNwSrcAction(ByteBuf input, ActionBuilder builder) {
-        builder.setType(SetNwSrc.class);
-        builder.addAugmentation(IpAddressAction.class, createNwAddressAugmentationAndPad(input));
-        return builder.build();
-    }
-
-    private static Action createSetNwDstAction(ByteBuf input, ActionBuilder builder) {
-        builder.setType(SetNwDst.class);
-        builder.addAugmentation(IpAddressAction.class, createNwAddressAugmentationAndPad(input));
-        return builder.build();
-    }
-    
-    private static Augmentation<Action> createNwAddressAugmentationAndPad(ByteBuf input) {
-        IpAddressActionBuilder ipBuilder = new IpAddressActionBuilder();
-        List<String> groups = new ArrayList<>();
-        for (int i = 0; i < EncodeConstants.GROUPS_IN_IPV4_ADDRESS; i++) {
-            groups.add(Short.toString(input.readUnsignedByte()));
-        }
-        Joiner joiner = Joiner.on(".");
-        ipBuilder.setIpAddress(new Ipv4Address(joiner.join(groups)));
-        return ipBuilder.build();
-    }
-
-    private static Action createSetNwTosAction(ByteBuf input, ActionBuilder builder) {
-        builder.setType(SetNwTos.class);
-        NwTosActionBuilder tosBuilder = new NwTosActionBuilder();
-        tosBuilder.setNwTos(input.readUnsignedByte());
-        builder.addAugmentation(NwTosAction.class, tosBuilder.build());
-        input.skipBytes(PADDING_IN_NW_TOS_ACTION);
-        return builder.build();
-    }
-
-    private static Action createSetTpSrcAction(ByteBuf input, ActionBuilder builder) {
-        builder.setType(SetTpSrc.class);
-        createPortAugmentation(input, builder);
-        input.skipBytes(PADDING_IN_TP_ACTION);
-        return builder.build();
-    }
-
-    private static Action createSetTpDstAction(ByteBuf input, ActionBuilder builder) {
-        builder.setType(SetTpDst.class);
-        createPortAugmentation(input, builder);
-        input.skipBytes(PADDING_IN_TP_ACTION);
-        return builder.build();
-    }
-    
-    private static void createPortAugmentation(ByteBuf input, ActionBuilder actionBuilder) {
-        PortActionBuilder portBuilder = new PortActionBuilder();
-        portBuilder.setPort(new PortNumber((long) input.readUnsignedShort()));
-        actionBuilder.addAugmentation(PortAction.class, portBuilder.build());
-    }
-
-    private static Action createEnqueueAction(ByteBuf input, ActionBuilder builder) {
-        builder.setType(Enqueue.class);
-        createPortAugmentation(input, builder);
-        input.skipBytes(PADDING_IN_ENQUEUE_ACTION);
-        QueueIdActionBuilder queueBuilder = new QueueIdActionBuilder();
-        queueBuilder.setQueueId(input.readUnsignedInt());
-        builder.addAugmentation(QueueIdAction.class, queueBuilder.build());
-        return builder.build();
-    }
-
-    @Override
-    public void injectDeserializerRegistry(DeserializerRegistry deserializerRegistry) {
-        registry = deserializerRegistry;
-    }
-}