Bug 2756 - Action model update
[openflowjava.git] / openflow-protocol-impl / src / main / java / org / opendaylight / openflowjava / protocol / impl / serialization / action / OF10SetTpDstActionSerializer.java
index 929db82b87a1285d4cc7f4468376893e7a733db8..d11a1fae2ae2e92fc0982e74546ad4cc611de26a 100644 (file)
@@ -8,13 +8,25 @@
 
 package org.opendaylight.openflowjava.protocol.impl.serialization.action;
 
+import io.netty.buffer.ByteBuf;
+
 import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetTpDstCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
 
 /**
  * @author michal.polkorab
  *
  */
-public class OF10SetTpDstActionSerializer extends OF10AbstractPortActionSerializer {
+public class OF10SetTpDstActionSerializer extends AbstractActionSerializer {
+
+    @Override
+    public void serialize(Action action, ByteBuf outBuffer) {
+        super.serialize(action, outBuffer);
+        outBuffer.writeShort(((SetTpDstCase) action.getActionChoice()).getSetTpDstAction()
+                .getPort().getValue().intValue());
+        outBuffer.writeZero(ActionConstants.PADDING_IN_TP_PORT_ACTION);
+    }
 
     @Override
     protected int getType() {