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%2FOF10EnqueueActionSerializer.java;h=4b0876817624ac235ae6bf78c88c6b6efc907fa9;hb=29a2a074c78708f6d18583779ece96bb6573f0c6;hp=8c55a7323a2be6cc5a17daddca37601130cd6525;hpb=87150bd287f792c118e906ffb8e9593a83f50c9e;p=openflowjava.git diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/action/OF10EnqueueActionSerializer.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/action/OF10EnqueueActionSerializer.java index 8c55a732..4b087681 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/action/OF10EnqueueActionSerializer.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/action/OF10EnqueueActionSerializer.java @@ -1,45 +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.openflowjava.util.ByteBufUtils; -import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortAction; -import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.QueueIdAction; -import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action; - -/** - * @author michal.polkorab - * - */ -public class OF10EnqueueActionSerializer extends AbstractActionSerializer { - - @Override - public void serialize(Action action, ByteBuf outBuffer) { - super.serialize(action, outBuffer); - PortAction port = action.getAugmentation(PortAction.class); - outBuffer.writeShort(port.getPort().getValue().intValue()); - ByteBufUtils.padBuffer(ActionConstants.PADDING_IN_ENQUEUE_ACTION, outBuffer); - QueueIdAction queueId = action.getAugmentation(QueueIdAction.class); - outBuffer.writeInt(queueId.getQueueId().intValue()); - } - - @Override - protected int getType() { - return ActionConstants.ENQUEUE_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.rev150225.PortAction; +import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.QueueIdAction; +import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action; + +/** + * @author michal.polkorab + * + */ +public class OF10EnqueueActionSerializer extends AbstractActionSerializer { + + @Override + public void serialize(Action action, ByteBuf outBuffer) { + super.serialize(action, outBuffer); + PortAction port = action.getAugmentation(PortAction.class); + outBuffer.writeShort(port.getPort().getValue().intValue()); + outBuffer.writeZero(ActionConstants.PADDING_IN_ENQUEUE_ACTION); + QueueIdAction queueId = action.getAugmentation(QueueIdAction.class); + outBuffer.writeInt(queueId.getQueueId().intValue()); + } + + @Override + protected int getType() { + return ActionConstants.ENQUEUE_CODE; + } + + @Override + protected int getLength() { + return ActionConstants.LARGER_ACTION_LENGTH; + } + +}