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%2FOF13OutputActionSerializer.java;h=0b6c56586612ec54df7949ae46d9ef8315c7110c;hb=519a86d1ddcfb8f0fe264174e62e5424e1efba1f;hp=2ac79f7dc1985302d90de1ae3c5713a497efe82a;hpb=d58ee5d9fb3dffc8bf395d2e29342dd5e16c9932;p=openflowjava.git diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/action/OF13OutputActionSerializer.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/action/OF13OutputActionSerializer.java index 2ac79f7d..0b6c5658 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/action/OF13OutputActionSerializer.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/action/OF13OutputActionSerializer.java @@ -1,44 +1,44 @@ -/* - * 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.MaxLengthAction; -import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortAction; -import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action; - -/** - * @author michal.polkorab - * - */ -public class OF13OutputActionSerializer extends AbstractActionSerializer { - - @Override - public void serialize(Action action, ByteBuf outBuffer) { - super.serialize(action, outBuffer); - PortAction port = action.getAugmentation(PortAction.class); - outBuffer.writeInt(port.getPort().getValue().intValue()); - MaxLengthAction maxlength = action.getAugmentation(MaxLengthAction.class); - outBuffer.writeShort(maxlength.getMaxLength()); - outBuffer.writeZero(ActionConstants.OUTPUT_PADDING); - } - - @Override - protected int getType() { - return ActionConstants.OUTPUT_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.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaxLengthAction; +import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortAction; +import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action; + +/** + * @author michal.polkorab + * + */ +public class OF13OutputActionSerializer extends AbstractActionSerializer { + + @Override + public void serialize(Action action, ByteBuf outBuffer) { + super.serialize(action, outBuffer); + PortAction port = action.getAugmentation(PortAction.class); + outBuffer.writeInt(port.getPort().getValue().intValue()); + MaxLengthAction maxlength = action.getAugmentation(MaxLengthAction.class); + outBuffer.writeShort(maxlength.getMaxLength()); + outBuffer.writeZero(ActionConstants.OUTPUT_PADDING); + } + + @Override + protected int getType() { + return ActionConstants.OUTPUT_CODE; + } + + @Override + protected int getLength() { + return ActionConstants.LARGER_ACTION_LENGTH; + } + +}