Example usage for io.netty.buffer ByteBuf readUnsignedInt

List of usage examples for io.netty.buffer ByteBuf readUnsignedInt

Introduction

In this page you can find the example usage for io.netty.buffer ByteBuf readUnsignedInt.

Prototype

public abstract long readUnsignedInt();

Source Link

Document

Gets an unsigned 32-bit integer at the current readerIndex and increases the readerIndex by 4 in this buffer.

Usage

From source file:org.opendaylight.openflowjava.nx.codec.action.ConntrackCodec.java

License:Open Source License

@Override
public Action deserialize(final ByteBuf message) {
    ActionBuilder actionBuilder = deserializeHeader(message);
    ActionConntrackBuilder actionConntrackBuilder = new ActionConntrackBuilder();

    NxActionConntrackBuilder nxActionConntrackBuilder = new NxActionConntrackBuilder();
    nxActionConntrackBuilder.setFlags(message.readUnsignedShort());
    nxActionConntrackBuilder.setZoneSrc(message.readUnsignedInt());
    nxActionConntrackBuilder.setConntrackZone(message.readUnsignedShort());
    nxActionConntrackBuilder.setRecircTable(message.readUnsignedByte());
    message.skipBytes(5);//from  ww  w  . j av  a2s.c  o  m
    actionConntrackBuilder.setNxActionConntrack(nxActionConntrackBuilder.build());
    actionBuilder.setActionChoice(actionConntrackBuilder.build());

    return actionBuilder.build();
}

From source file:org.opendaylight.openflowjava.nx.codec.action.MultipathCodec.java

License:Open Source License

@Override
public Action deserialize(final ByteBuf message) {
    ActionBuilder actionBuilder = deserializeHeader(message);
    ActionMultipathBuilder actionMultipathBuilder = new ActionMultipathBuilder();

    NxActionMultipathBuilder nxActionMultipathBuilder = new NxActionMultipathBuilder();
    nxActionMultipathBuilder.setFields(OfjNxHashFields.forValue(message.readUnsignedShort()));
    nxActionMultipathBuilder.setBasis(message.readUnsignedShort());
    message.skipBytes(2); //two bytes

    nxActionMultipathBuilder.setAlgorithm(OfjNxMpAlgorithm.forValue(message.readUnsignedShort()));
    nxActionMultipathBuilder.setMaxLink(message.readUnsignedShort());
    nxActionMultipathBuilder.setArg(message.readUnsignedInt());
    message.skipBytes(2); //two bytes

    nxActionMultipathBuilder.setOfsNbits(message.readUnsignedShort());
    nxActionMultipathBuilder.setDst(message.readUnsignedInt());
    actionMultipathBuilder.setNxActionMultipath(nxActionMultipathBuilder.build());
    actionBuilder.setActionChoice(actionMultipathBuilder.build());

    return actionBuilder.build();
}

From source file:org.opendaylight.openflowjava.nx.codec.action.OutputRegCodec.java

License:Open Source License

@Override
public Action deserialize(final ByteBuf message) {
    ActionBuilder actionBuilder = deserializeHeader(message);
    ActionOutputRegBuilder builder = new ActionOutputRegBuilder();
    NxActionOutputRegBuilder nxActionOutputRegBuilder = new NxActionOutputRegBuilder();
    nxActionOutputRegBuilder.setNBits(message.readUnsignedShort());
    nxActionOutputRegBuilder.setSrc(message.readUnsignedInt());
    nxActionOutputRegBuilder.setMaxLen(message.readUnsignedShort());
    message.skipBytes(PADDING_IN_OUTPUT_REG_ACTION);
    builder.setNxActionOutputReg(nxActionOutputRegBuilder.build());
    actionBuilder.setActionChoice(builder.build());
    return actionBuilder.build();
}

From source file:org.opendaylight.openflowjava.nx.codec.action.RegLoadCodec.java

License:Open Source License

@Override
public Action deserialize(final ByteBuf message) {
    ActionBuilder actionBuilder = deserializeHeader(message);
    NxActionRegLoadBuilder nxActionRegLoadBuilder = new NxActionRegLoadBuilder();
    ActionRegLoadBuilder actionRegLoadBuilder = new ActionRegLoadBuilder();
    nxActionRegLoadBuilder.setOfsNbits(message.readUnsignedShort());
    nxActionRegLoadBuilder.setDst(message.readUnsignedInt());
    nxActionRegLoadBuilder.setValue(BigInteger.valueOf(message.readLong()));
    actionRegLoadBuilder.setNxActionRegLoad(nxActionRegLoadBuilder.build());
    actionBuilder.setActionChoice(actionRegLoadBuilder.build());
    return actionBuilder.build();
}

From source file:org.opendaylight.openflowjava.nx.codec.action.RegMoveCodec.java

License:Open Source License

@Override
public Action deserialize(final ByteBuf message) {
    ActionBuilder actionBuilder = deserializeHeader(message);
    ActionRegMoveBuilder actionRegMoveBuilder = new ActionRegMoveBuilder();
    NxActionRegMoveBuilder nxActionRegMoveBuilder = new NxActionRegMoveBuilder();
    nxActionRegMoveBuilder.setNBits(message.readUnsignedShort());
    nxActionRegMoveBuilder.setSrcOfs(message.readUnsignedShort());
    nxActionRegMoveBuilder.setDstOfs(message.readUnsignedShort());
    nxActionRegMoveBuilder.setSrc(message.readUnsignedInt());
    nxActionRegMoveBuilder.setDst(message.readUnsignedInt());
    actionRegMoveBuilder.setNxActionRegMove(nxActionRegMoveBuilder.build());
    actionBuilder.setActionChoice(actionRegMoveBuilder.build());
    return actionBuilder.build();
}

From source file:org.opendaylight.openflowjava.nx.codec.action.SetNshc1Codec.java

License:Open Source License

@Override
public Action deserialize(ByteBuf message) {
    ActionBuilder actionBuilder = deserializeHeader(message);
    ActionSetNshc1Builder builder = new ActionSetNshc1Builder();
    NxActionSetNshc1Builder nxActionSetNspBuilder = new NxActionSetNshc1Builder();
    message.skipBytes(padding);//from ww  w .j av a2 s.c o  m
    nxActionSetNspBuilder.setNshc(message.readUnsignedInt());
    builder.setNxActionSetNshc1(nxActionSetNspBuilder.build());
    actionBuilder.setActionChoice(builder.build());
    return actionBuilder.build();
}

From source file:org.opendaylight.openflowjava.nx.codec.action.SetNshc2Codec.java

License:Open Source License

@Override
public Action deserialize(ByteBuf message) {
    ActionBuilder actionBuilder = deserializeHeader(message);
    ActionSetNshc2Builder builder = new ActionSetNshc2Builder();
    NxActionSetNshc2Builder nxActionSetNspBuilder = new NxActionSetNshc2Builder();
    message.skipBytes(padding);/*from w ww .  ja v a 2s  . c  o m*/
    nxActionSetNspBuilder.setNshc(message.readUnsignedInt());
    builder.setNxActionSetNshc2(nxActionSetNspBuilder.build());
    actionBuilder.setActionChoice(builder.build());
    return actionBuilder.build();
}

From source file:org.opendaylight.openflowjava.nx.codec.action.SetNshc3Codec.java

License:Open Source License

@Override
public Action deserialize(ByteBuf message) {
    ActionBuilder actionBuilder = deserializeHeader(message);
    ActionSetNshc3Builder builder = new ActionSetNshc3Builder();
    NxActionSetNshc3Builder nxActionSetNspBuilder = new NxActionSetNshc3Builder();
    message.skipBytes(padding);//w  w  w  . j a va2 s .  co m
    nxActionSetNspBuilder.setNshc(message.readUnsignedInt());
    builder.setNxActionSetNshc3(nxActionSetNspBuilder.build());
    actionBuilder.setActionChoice(builder.build());
    return actionBuilder.build();
}

From source file:org.opendaylight.openflowjava.nx.codec.action.SetNshc4Codec.java

License:Open Source License

@Override
public Action deserialize(ByteBuf message) {
    ActionBuilder actionBuilder = deserializeHeader(message);
    ActionSetNshc4Builder builder = new ActionSetNshc4Builder();
    NxActionSetNshc4Builder nxActionSetNspBuilder = new NxActionSetNshc4Builder();
    message.skipBytes(padding);//www  .  j  a v a  2  s.c  o  m
    nxActionSetNspBuilder.setNshc(message.readUnsignedInt());
    builder.setNxActionSetNshc4(nxActionSetNspBuilder.build());
    actionBuilder.setActionChoice(builder.build());
    return actionBuilder.build();
}

From source file:org.opendaylight.openflowjava.nx.codec.action.SetNspCodec.java

License:Open Source License

@Override
public Action deserialize(ByteBuf message) {
    ActionBuilder actionBuilder = deserializeHeader(message);
    ActionSetNspBuilder builder = new ActionSetNspBuilder();
    NxActionSetNspBuilder nxActionSetNspBuilder = new NxActionSetNspBuilder();
    message.skipBytes(padding);/*www  . j  a  v a 2  s  .  c om*/
    nxActionSetNspBuilder.setNsp(message.readUnsignedInt());
    builder.setNxActionSetNsp(nxActionSetNspBuilder.build());
    actionBuilder.setActionChoice(builder.build());
    return actionBuilder.build();
}