use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.move.grouping.nx.reg.move.DstBuilder 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.move.grouping.nx.reg.move.DstBuilder 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.move.grouping.nx.reg.move.DstBuilder in project netvirt by opendaylight.
the class NodeConnectedHandler method copyChildPSOpToHAPS.
/**
* Copy child physical switch node data to HA physical switch data of Operational data tree.
*
* @param childPsNode HA child PS node
* @param haPath HA node path
* @param haPspath Ha Physical Switch Node path
* @param tx Transaction
* @throws ReadFailedException Exception thrown if read fails
*/
public void copyChildPSOpToHAPS(Node childPsNode, InstanceIdentifier<Node> haPath, InstanceIdentifier<Node> haPspath, ReadWriteTransaction tx) throws ReadFailedException {
NodeBuilder haPSNodeBuilder = HwvtepHAUtil.getNodeBuilderForPath(haPspath);
PhysicalSwitchAugmentationBuilder dstBuilder = new PhysicalSwitchAugmentationBuilder();
PhysicalSwitchAugmentation src = childPsNode.getAugmentation(PhysicalSwitchAugmentation.class);
Node existingHAPSNode = HwvtepHAUtil.readNode(tx, OPERATIONAL, haPspath);
PhysicalSwitchAugmentation existingHAPSAugumentation = HwvtepHAUtil.getPhysicalSwitchAugmentationOfNode(existingHAPSNode);
psAugmentationMerger.mergeOperationalData(dstBuilder, existingHAPSAugumentation, src, haPath);
psNodeMerger.mergeOperationalData(haPSNodeBuilder, existingHAPSNode, childPsNode, haPath);
mergeOpManagedByAttributes(src, dstBuilder, haPath);
haPSNodeBuilder.addAugmentation(PhysicalSwitchAugmentation.class, dstBuilder.build());
Node haPsNode = haPSNodeBuilder.build();
tx.merge(OPERATIONAL, haPspath, haPsNode, true);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.move.grouping.nx.reg.move.DstBuilder in project openflowplugin by opendaylight.
the class RegMoveConvertor method convert.
@Override
public org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action convert(Action input, ActionPath path) {
NxActionRegMove actionRegMove = ((ActionRegMove) input.getActionChoice()).getNxActionRegMove();
DstBuilder dstBuilder = new DstBuilder();
dstBuilder.setDstChoice(resolveDstValue(actionRegMove.getDst()));
dstBuilder.setStart(actionRegMove.getDstOfs());
dstBuilder.setEnd(actionRegMove.getDstOfs() + actionRegMove.getNBits() - 1);
SrcBuilder srcBuilder = new SrcBuilder();
srcBuilder.setSrcChoice(resolveSrcValue(actionRegMove.getSrc()));
srcBuilder.setStart(actionRegMove.getSrcOfs());
srcBuilder.setEnd(actionRegMove.getSrcOfs() + actionRegMove.getNBits() - 1);
NxRegMoveBuilder nxRegMoveBuilder = new NxRegMoveBuilder();
nxRegMoveBuilder.setDst(dstBuilder.build());
nxRegMoveBuilder.setSrc(srcBuilder.build());
return resolveAction(nxRegMoveBuilder.build(), path);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.move.grouping.nx.reg.move.DstBuilder in project openflowplugin by opendaylight.
the class MultipathConvertor method convert.
@Override
public org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action convert(final Action input, final ActionPath path) {
NxActionMultipath action = ((ActionMultipath) input.getActionChoice()).getNxActionMultipath();
DstBuilder dstBuilder = new DstBuilder();
dstBuilder.setDstChoice(RegMoveConvertor.resolveDstValue(action.getDst()));
dstBuilder.setStart(resolveStart(action.getOfsNbits()));
dstBuilder.setEnd(resolveEnd(action.getOfsNbits()));
NxMultipathBuilder builder = new NxMultipathBuilder();
builder.setBasis(action.getBasis());
builder.setAlgorithm(action.getAlgorithm());
builder.setMaxLink(action.getMaxLink());
builder.setArg(action.getArg());
builder.setDst(dstBuilder.build());
return resolveAction(builder.build(), path);
}
Aggregations