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%2FOF10SetVlanVidActionSerializer.java;h=afe000c9f3a245bb085b68ea7a3c6de48a57cca1;hb=519a86d1ddcfb8f0fe264174e62e5424e1efba1f;hp=ca1f8dcdd9239adb91610a4adbb75a43b4e52358;hpb=7da7ba040e42239389cb6f29b743c9d04af33ea3;p=openflowjava.git diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/action/OF10SetVlanVidActionSerializer.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/action/OF10SetVlanVidActionSerializer.java index ca1f8dcd..afe000c9 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/action/OF10SetVlanVidActionSerializer.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/action/OF10SetVlanVidActionSerializer.java @@ -1,41 +1,40 @@ -/* - * 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.protocol.impl.util.ByteBufUtils; -import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.VlanVidAction; -import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action; - -/** - * @author michal.polkorab - * - */ -public class OF10SetVlanVidActionSerializer extends AbstractActionSerializer { - - @Override - public void serialize(Action action, ByteBuf outBuffer) { - super.serialize(action, outBuffer); - outBuffer.writeShort(action.getAugmentation(VlanVidAction.class).getVlanVid()); - ByteBufUtils.padBuffer(ActionConstants.PADDING_IN_SET_VLAN_VID_ACTION, outBuffer); - } - - @Override - protected int getType() { - return ActionConstants.SET_VLAN_VID_CODE; - } - - @Override - protected int getLength() { - return ActionConstants.GENERAL_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.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.VlanVidAction; +import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action; + +/** + * @author michal.polkorab + * + */ +public class OF10SetVlanVidActionSerializer extends AbstractActionSerializer { + + @Override + public void serialize(Action action, ByteBuf outBuffer) { + super.serialize(action, outBuffer); + outBuffer.writeShort(action.getAugmentation(VlanVidAction.class).getVlanVid()); + outBuffer.writeZero(ActionConstants.PADDING_IN_SET_VLAN_VID_ACTION); + } + + @Override + protected int getType() { + return ActionConstants.SET_VLAN_VID_CODE; + } + + @Override + protected int getLength() { + return ActionConstants.GENERAL_ACTION_LENGTH; + } + +}