X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=openflow-protocol-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fopenflowjava%2Fprotocol%2Fimpl%2Fserialization%2Faction%2FOF10SetDlDstActionSerializer.java;h=e654466a2c981c967926f91a5567149f9235f802;hb=5f5622e79402f70a944fa93fd7ee2d84d1776b08;hp=2e013323527037ea7e557258dab06d37c0e84f70;hpb=7da7ba040e42239389cb6f29b743c9d04af33ea3;p=openflowjava.git diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/action/OF10SetDlDstActionSerializer.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/action/OF10SetDlDstActionSerializer.java index 2e013323..e654466a 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/action/OF10SetDlDstActionSerializer.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/action/OF10SetDlDstActionSerializer.java @@ -1,29 +1,42 @@ -/* - * 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.serialization.action; - -import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants; - -/** - * @author michal.polkorab - * - */ -public class OF10SetDlDstActionSerializer extends OF10AbstractMacAddressActionSerializer { - - @Override - protected int getType() { - return ActionConstants.SET_DL_DST_CODE; - } - - @Override - protected int getLength() { - return ActionConstants.LARGER_ACTION_LENGTH; - } - -} +/* + * 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.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 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() { + return ActionConstants.SET_DL_DST_CODE; + } + + @Override + protected int getLength() { + return ActionConstants.LARGER_ACTION_LENGTH; + } + +}