X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=openflowjava%2Fopenflow-protocol-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fopenflowjava%2Fprotocol%2Fimpl%2Fdeserialization%2Faction%2FOF13PushPbbActionDeserializer.java;fp=openflowjava%2Fopenflow-protocol-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fopenflowjava%2Fprotocol%2Fimpl%2Fdeserialization%2Faction%2FOF13PushPbbActionDeserializer.java;h=33c81495807f323aafcf5f6daec256ec9436ff3e;hb=99b3fc9c75db8dc1f4cbadd76056bc5d0053b33c;hp=01ed3bf9affffa1733030cb37150edc3cb81bf8f;hpb=810e4557ca7ff87c966332cd99646ec75e0ab7cf;p=openflowplugin.git diff --git a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13PushPbbActionDeserializer.java b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13PushPbbActionDeserializer.java index 01ed3bf9af..33c8149580 100644 --- a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13PushPbbActionDeserializer.java +++ b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/action/OF13PushPbbActionDeserializer.java @@ -5,7 +5,6 @@ * 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.deserialization.action; import io.netty.buffer.ByteBuf; @@ -17,6 +16,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev1 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action; import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.EtherType; +import org.opendaylight.yangtools.yang.common.netty.ByteBufUtils; /** * OF13PushPbbActionDeserializer. @@ -24,16 +24,15 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev13 * @author michal.polkorab */ public class OF13PushPbbActionDeserializer extends AbstractActionDeserializer { - @Override public Action deserialize(ByteBuf input) { - final ActionBuilder builder = new ActionBuilder(); input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES); - PushPbbCaseBuilder caseBuilder = new PushPbbCaseBuilder(); - PushPbbActionBuilder pbbBuilder = new PushPbbActionBuilder(); - pbbBuilder.setEthertype(new EtherType(input.readUnsignedShort())); - caseBuilder.setPushPbbAction(pbbBuilder.build()); - builder.setActionChoice(caseBuilder.build()); + final ActionBuilder builder = new ActionBuilder() + .setActionChoice(new PushPbbCaseBuilder() + .setPushPbbAction(new PushPbbActionBuilder() + .setEthertype(new EtherType(ByteBufUtils.readUint16(input))) + .build()) + .build()); input.skipBytes(ActionConstants.ETHERTYPE_ACTION_PADDING); return builder.build(); } @@ -42,5 +41,4 @@ public class OF13PushPbbActionDeserializer extends AbstractActionDeserializer { protected ActionChoice getType() { return new PushPbbCaseBuilder().build(); } - }