Bug 2756 - Action model update
[openflowjava.git] / openflow-protocol-impl / src / main / java / org / opendaylight / openflowjava / protocol / impl / serialization / action / OF10SetDlDstActionSerializer.java
index b174b0f92f2bf72ec18d335f6e995c844c57efca..e654466a2c981c967926f91a5567149f9235f802 100644 (file)
@@ -8,13 +8,26 @@
 
 package org.opendaylight.openflowjava.protocol.impl.serialization.action;
 
+import io.netty.buffer.ByteBuf;
+
 import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
+import org.opendaylight.openflowjava.util.ByteBufUtils;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetDlDstCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
 
 /**
  * @author michal.polkorab
  *
  */
-public class OF10SetDlDstActionSerializer extends OF10AbstractMacAddressActionSerializer {
+public class OF10SetDlDstActionSerializer extends AbstractActionSerializer {
+
+    @Override
+    public void serialize(Action action, ByteBuf outBuffer) {
+        super.serialize(action, outBuffer);
+        outBuffer.writeBytes(ByteBufUtils.macAddressToBytes(((SetDlDstCase) action.getActionChoice())
+                .getSetDlDstAction().getDlDstAddress().getValue()));
+        outBuffer.writeZero(ActionConstants.PADDING_IN_DL_ADDRESS_ACTION);
+    }
 
     @Override
     protected int getType() {