use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.load.grouping.NxRegLoadBuilder in project genius by opendaylight.
the class MDSALUtil method createNxOfInPortAction.
public static Action createNxOfInPortAction(final int actionKey, final int inPortVal) {
NxRegLoad regLoad = new NxRegLoadBuilder().setDst(new DstBuilder().setDstChoice(new DstNxOfInPortCaseBuilder().setOfInPort(Boolean.TRUE).build()).setStart(0).setEnd(15).build()).setValue(BigInteger.valueOf(inPortVal)).build();
ActionBuilder abExt = new ActionBuilder();
abExt.setKey(new ActionKey(actionKey));
abExt.setOrder(actionKey);
abExt.setAction(new NxActionRegLoadNodesNodeTableFlowApplyActionsCaseBuilder().setNxRegLoad(regLoad).build());
return abExt.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.load.grouping.NxRegLoadBuilder in project genius by opendaylight.
the class ActionSetTunnelDestinationIp method buildAction.
@Override
public Action buildAction(int newActionKey) {
NxRegLoadBuilder nxRegLoadBuilder = new NxRegLoadBuilder();
Dst dst = new DstBuilder().setDstChoice(new DstNxTunIpv4DstCaseBuilder().setNxTunIpv4Dst(Boolean.TRUE).build()).setStart(0).setEnd(31).build();
nxRegLoadBuilder.setDst(dst);
nxRegLoadBuilder.setValue(destIp);
ActionBuilder ab = new ActionBuilder();
if (groupBucket) {
ab.setAction(new NxActionRegLoadNodesNodeGroupBucketsBucketActionsCaseBuilder().setNxRegLoad(nxRegLoadBuilder.build()).build());
} else {
ab.setAction(new NxActionRegLoadNodesNodeTableFlowApplyActionsCaseBuilder().setNxRegLoad(nxRegLoadBuilder.build()).build());
}
ab.setKey(new ActionKey(newActionKey));
return ab.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.load.grouping.NxRegLoadBuilder in project genius by opendaylight.
the class ActionSetTunnelSourceIp method buildAction.
@Override
public Action buildAction(int newActionKey) {
NxRegLoadBuilder nxRegLoadBuilder = new NxRegLoadBuilder();
Dst dst = new DstBuilder().setDstChoice(new DstNxTunIpv4SrcCaseBuilder().setNxTunIpv4Src(Boolean.TRUE).build()).setStart(0).setEnd(31).build();
nxRegLoadBuilder.setDst(dst);
nxRegLoadBuilder.setValue(sourceIp);
ActionBuilder ab = new ActionBuilder();
if (groupBucket) {
ab.setAction(new NxActionRegLoadNodesNodeGroupBucketsBucketActionsCaseBuilder().setNxRegLoad(nxRegLoadBuilder.build()).build());
} else {
ab.setAction(new NxActionRegLoadNodesNodeTableFlowApplyActionsCaseBuilder().setNxRegLoad(nxRegLoadBuilder.build()).build());
}
ab.setKey(new ActionKey(newActionKey));
return ab.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.load.grouping.NxRegLoadBuilder in project openflowplugin by opendaylight.
the class Test method createNxActionBld.
private static ActionBuilder createNxActionBld(int actionKeyVal) {
// vendor part
DstNxRegCaseBuilder nxRegCaseBld = new DstNxRegCaseBuilder().setNxReg(NxmNxReg0.class);
DstBuilder dstBld = new DstBuilder().setDstChoice(nxRegCaseBld.build()).setStart(0).setEnd(5);
NxRegLoadBuilder nxRegLoadBuilder = new NxRegLoadBuilder();
nxRegLoadBuilder.setDst(dstBld.build());
nxRegLoadBuilder.setValue(BigInteger.valueOf(55L));
NxActionRegLoadNodesNodeTableFlowApplyActionsCaseBuilder topNxActionCaseBld = new NxActionRegLoadNodesNodeTableFlowApplyActionsCaseBuilder();
topNxActionCaseBld.setNxRegLoad(nxRegLoadBuilder.build());
// base part
ActionBuilder abExt = new ActionBuilder();
abExt.setKey(new ActionKey(actionKeyVal));
abExt.setAction(topNxActionCaseBld.build());
return abExt;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.load.grouping.NxRegLoadBuilder in project openflowplugin by opendaylight.
the class RegLoadConvertor method convert.
@Override
public org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action convert(final Action input, final ActionPath path) {
NxActionRegLoad actionRegLoad = ((ActionRegLoad) input.getActionChoice()).getNxActionRegLoad();
DstBuilder dstBuilder = new DstBuilder();
dstBuilder.setDstChoice(RegMoveConvertor.resolveDstValue(actionRegLoad.getDst()));
dstBuilder.setStart(resolveStart(actionRegLoad.getOfsNbits()));
dstBuilder.setEnd(resolveEnd(actionRegLoad.getOfsNbits()));
NxRegLoadBuilder nxRegLoadBuilder = new NxRegLoadBuilder();
nxRegLoadBuilder.setDst(dstBuilder.build());
nxRegLoadBuilder.setValue(actionRegLoad.getValue());
return resolveAction(nxRegLoadBuilder.build(), path);
}
Aggregations