Search in sources :

Example 1 with NxActionRegLoadBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.reg.load.grouping.NxActionRegLoadBuilder in project openflowplugin by opendaylight.

the class RegLoadConvertor method convert.

@Override
public Action convert(final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action nxActionArg) {
    Preconditions.checkArgument(nxActionArg instanceof NxActionRegLoadGrouping);
    NxActionRegLoadGrouping nxAction = (NxActionRegLoadGrouping) nxActionArg;
    Dst dst = nxAction.getNxRegLoad().getDst();
    final ActionRegLoadBuilder actionRegLoadBuilder = new ActionRegLoadBuilder();
    NxActionRegLoadBuilder nxActionRegLoadBuilder = new NxActionRegLoadBuilder();
    nxActionRegLoadBuilder.setDst(RegMoveConvertor.resolveDst(dst.getDstChoice()));
    nxActionRegLoadBuilder.setOfsNbits(dst.getStart() << 6 | dst.getEnd() - dst.getStart());
    nxActionRegLoadBuilder.setValue(nxAction.getNxRegLoad().getValue());
    actionRegLoadBuilder.setNxActionRegLoad(nxActionRegLoadBuilder.build());
    return ActionUtil.createAction(actionRegLoadBuilder.build());
}
Also used : Dst(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.load.grouping.nx.reg.load.Dst) NxActionRegLoadGrouping(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.NxActionRegLoadGrouping) ActionRegLoadBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionRegLoadBuilder) NxActionRegLoadBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.reg.load.grouping.NxActionRegLoadBuilder) NxActionRegLoadBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.reg.load.grouping.NxActionRegLoadBuilder)

Example 2 with NxActionRegLoadBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.reg.load.grouping.NxActionRegLoadBuilder in project openflowplugin by opendaylight.

the class RegLoadCodecTest method createAction.

private Action createAction() {
    ExperimenterId experimenterId = new ExperimenterId(NiciraConstants.NX_VENDOR_ID);
    ActionBuilder actionBuilder = new ActionBuilder();
    actionBuilder.setExperimenterId(experimenterId);
    final ActionRegLoadBuilder actionRegLoadBuilder = new ActionRegLoadBuilder();
    NxActionRegLoadBuilder nxActionRegLoadBuilder = new NxActionRegLoadBuilder();
    nxActionRegLoadBuilder.setOfsNbits(1);
    nxActionRegLoadBuilder.setDst((long) 2);
    nxActionRegLoadBuilder.setValue(BigInteger.valueOf(3));
    actionRegLoadBuilder.setNxActionRegLoad(nxActionRegLoadBuilder.build());
    actionBuilder.setActionChoice(actionRegLoadBuilder.build());
    return actionBuilder.build();
}
Also used : ActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder) ActionRegLoadBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionRegLoadBuilder) NxActionRegLoadBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.reg.load.grouping.NxActionRegLoadBuilder) NxActionRegLoadBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.reg.load.grouping.NxActionRegLoadBuilder) ExperimenterId(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ExperimenterId)

Example 3 with NxActionRegLoadBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.reg.load.grouping.NxActionRegLoadBuilder in project openflowplugin by opendaylight.

the class RegLoadCodec method deserialize.

@Override
public Action deserialize(final ByteBuf message) {
    final ActionBuilder actionBuilder = deserializeHeader(message);
    NxActionRegLoadBuilder nxActionRegLoadBuilder = new NxActionRegLoadBuilder();
    final 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();
}
Also used : ActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder) NxActionRegLoadBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.reg.load.grouping.NxActionRegLoadBuilder) ActionRegLoadBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionRegLoadBuilder) NxActionRegLoadBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.reg.load.grouping.NxActionRegLoadBuilder)

Aggregations

ActionRegLoadBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionRegLoadBuilder)3 NxActionRegLoadBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.reg.load.grouping.NxActionRegLoadBuilder)3 ActionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder)2 ExperimenterId (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ExperimenterId)1 NxActionRegLoadGrouping (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.NxActionRegLoadGrouping)1 Dst (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.load.grouping.nx.reg.load.Dst)1