List of usage examples for io.netty.buffer ByteBuf skipBytes
public abstract ByteBuf skipBytes(int length);
From source file:org.opendaylight.openflowjava.protocol.impl.deserialization.action.AbstractEthertypeActionDeserializer.java
License:Open Source License
@Override public Action deserialize(ByteBuf input) { ActionBuilder builder = new ActionBuilder(); builder.setType(getType());/*from w w w. j a v a 2 s .c om*/ input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES); EthertypeActionBuilder etherType = new EthertypeActionBuilder(); etherType.setEthertype(new EtherType(input.readUnsignedShort())); builder.addAugmentation(EthertypeAction.class, etherType.build()); input.skipBytes(ActionConstants.ETHERTYPE_ACTION_PADDING); return builder.build(); }
From source file:org.opendaylight.openflowjava.protocol.impl.deserialization.action.AbstractHeaderActionDeserializer.java
License:Open Source License
@Override public Action deserialize(ByteBuf input) { ActionBuilder builder = new ActionBuilder(); input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES); builder.setType(getType());/*w w w . j a va 2s .c o m*/ input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES); input.skipBytes(ActionConstants.PADDING_IN_ACTION_HEADER); return builder.build(); }
From source file:org.opendaylight.openflowjava.protocol.impl.deserialization.action.OF10AbstractIpAddressActionDeserializer.java
License:Open Source License
@Override public Action deserialize(ByteBuf input) { ActionBuilder builder = new ActionBuilder(); input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES); builder.setType(getType());/* w w w. j ava2s. c om*/ input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES); builder.addAugmentation(IpAddressAction.class, createNwAddressAugmentationAndPad(input)); return builder.build(); }
From source file:org.opendaylight.openflowjava.protocol.impl.deserialization.action.OF10AbstractMacAddressActionDeserializer.java
License:Open Source License
@Override public Action deserialize(ByteBuf input) { ActionBuilder builder = new ActionBuilder(); input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES); builder.setType(getType());/*from www .j av a 2s . c om*/ input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES); builder.addAugmentation(DlAddressAction.class, createDlAugmentationAndPad(input)); return builder.build(); }
From source file:org.opendaylight.openflowjava.protocol.impl.deserialization.action.OF10AbstractMacAddressActionDeserializer.java
License:Open Source License
private static DlAddressAction createDlAugmentationAndPad(ByteBuf input) { DlAddressActionBuilder dlBuilder = new DlAddressActionBuilder(); byte[] address = new byte[EncodeConstants.MAC_ADDRESS_LENGTH]; input.readBytes(address);/* ww w . j av a 2 s . c o m*/ dlBuilder.setDlAddress(new MacAddress(ByteBufUtils.macAddressToString(address))); input.skipBytes(ActionConstants.PADDING_IN_DL_ADDRESS_ACTION); return dlBuilder.build(); }
From source file:org.opendaylight.openflowjava.protocol.impl.deserialization.action.OF10AbstractPortActionDeserializer.java
License:Open Source License
@Override public Action deserialize(ByteBuf input) { ActionBuilder builder = new ActionBuilder(); input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES); builder.setType(getType());/*from www .j a va 2 s.c om*/ input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES); createPortAugmentation(input, builder); input.skipBytes(ActionConstants.PADDING_IN_TP_PORT_ACTION); return builder.build(); }
From source file:org.opendaylight.openflowjava.protocol.impl.deserialization.action.OF10EnqueueActionDeserializer.java
License:Open Source License
@Override public Action deserialize(ByteBuf input) { ActionBuilder builder = new ActionBuilder(); input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES); EnqueueCaseBuilder caseBuilder = new EnqueueCaseBuilder(); EnqueueActionBuilder actionBuilder = new EnqueueActionBuilder(); actionBuilder.setPort(new PortNumber((long) input.readUnsignedShort())); input.skipBytes(ActionConstants.PADDING_IN_ENQUEUE_ACTION); actionBuilder.setQueueId(new QueueId(input.readUnsignedInt())); caseBuilder.setEnqueueAction(actionBuilder.build()); builder.setActionChoice(caseBuilder.build()); return builder.build(); }
From source file:org.opendaylight.openflowjava.protocol.impl.deserialization.action.OF10OutputActionDeserializer.java
License:Open Source License
@Override public Action deserialize(ByteBuf input) { ActionBuilder builder = new ActionBuilder(); input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES); OutputActionCaseBuilder caseBuilder = new OutputActionCaseBuilder(); OutputActionBuilder actionBuilder = new OutputActionBuilder(); actionBuilder.setPort(new PortNumber((long) input.readUnsignedShort())); actionBuilder.setMaxLength(input.readUnsignedShort()); caseBuilder.setOutputAction(actionBuilder.build()); builder.setActionChoice(caseBuilder.build()); return builder.build(); }
From source file:org.opendaylight.openflowjava.protocol.impl.deserialization.action.OF10SetDlDstActionDeserializer.java
License:Open Source License
@Override public Action deserialize(final ByteBuf input) { ActionBuilder builder = new ActionBuilder(); input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES); SetDlDstCaseBuilder caseBuilder = new SetDlDstCaseBuilder(); SetDlDstActionBuilder actionBuilder = new SetDlDstActionBuilder(); actionBuilder.setDlDstAddress(ByteBufUtils.readIetfMacAddress(input)); caseBuilder.setSetDlDstAction(actionBuilder.build()); builder.setActionChoice(caseBuilder.build()); input.skipBytes(ActionConstants.PADDING_IN_DL_ADDRESS_ACTION); return builder.build(); }
From source file:org.opendaylight.openflowjava.protocol.impl.deserialization.action.OF10SetDlSrcActionDeserializer.java
License:Open Source License
@Override public Action deserialize(final ByteBuf input) { ActionBuilder builder = new ActionBuilder(); input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES); SetDlSrcCaseBuilder caseBuilder = new SetDlSrcCaseBuilder(); SetDlSrcActionBuilder actionBuilder = new SetDlSrcActionBuilder(); actionBuilder.setDlSrcAddress(ByteBufUtils.readIetfMacAddress(input)); caseBuilder.setSetDlSrcAction(actionBuilder.build()); builder.setActionChoice(caseBuilder.build()); input.skipBytes(ActionConstants.PADDING_IN_DL_ADDRESS_ACTION); return builder.build(); }