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%2FAbstractEthertypeActionSerializer.java;h=33858e336e46f04ac4acbca5acdd020390e8ed69;hb=519a86d1ddcfb8f0fe264174e62e5424e1efba1f;hp=7af91fd61c0a59eadb6180695e3aaf232c539bf6;hpb=87150bd287f792c118e906ffb8e9593a83f50c9e;p=openflowjava.git diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/action/AbstractEthertypeActionSerializer.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/action/AbstractEthertypeActionSerializer.java index 7af91fd6..33858e33 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/action/AbstractEthertypeActionSerializer.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/action/AbstractEthertypeActionSerializer.java @@ -1,36 +1,35 @@ -/* - * 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.augments.rev131002.EthertypeAction; -import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action; - -/** - * @author michal.polkorab - * - */ -public abstract class AbstractEthertypeActionSerializer extends AbstractActionSerializer { - - @Override - public void serialize(Action action, ByteBuf outBuffer) { - super.serialize(action, outBuffer); - EthertypeAction ethertype = action.getAugmentation(EthertypeAction.class); - outBuffer.writeShort(ethertype.getEthertype().getValue()); - ByteBufUtils.padBuffer(ActionConstants.ETHERTYPE_ACTION_PADDING, outBuffer); - } - - @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.EthertypeAction; +import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action; + +/** + * @author michal.polkorab + * + */ +public abstract class AbstractEthertypeActionSerializer extends AbstractActionSerializer { + + @Override + public void serialize(Action action, ByteBuf outBuffer) { + super.serialize(action, outBuffer); + EthertypeAction ethertype = action.getAugmentation(EthertypeAction.class); + outBuffer.writeShort(ethertype.getEthertype().getValue()); + outBuffer.writeZero(ActionConstants.ETHERTYPE_ACTION_PADDING); + } + + @Override + protected int getLength() { + return ActionConstants.GENERAL_ACTION_LENGTH; + } +}