Search in sources :

Example 6 with DstBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.multipath.grouping.nx.multipath.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();
}
Also used : DstBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.load.grouping.nx.reg.load.DstBuilder) Dst(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.load.grouping.nx.reg.load.Dst) ActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder) NxRegLoadBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.load.grouping.NxRegLoadBuilder) NxActionRegLoadNodesNodeTableFlowApplyActionsCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.table.flow.instructions.instruction.instruction.apply.actions._case.apply.actions.action.action.NxActionRegLoadNodesNodeTableFlowApplyActionsCaseBuilder) ActionKey(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionKey) DstNxTunIpv4DstCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.dst.choice.grouping.dst.choice.DstNxTunIpv4DstCaseBuilder) NxActionRegLoadNodesNodeGroupBucketsBucketActionsCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.group.buckets.bucket.action.action.NxActionRegLoadNodesNodeGroupBucketsBucketActionsCaseBuilder)

Example 7 with DstBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.multipath.grouping.nx.multipath.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();
}
Also used : DstBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.load.grouping.nx.reg.load.DstBuilder) Dst(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.load.grouping.nx.reg.load.Dst) ActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder) NxRegLoadBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.load.grouping.NxRegLoadBuilder) NxActionRegLoadNodesNodeTableFlowApplyActionsCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.table.flow.instructions.instruction.instruction.apply.actions._case.apply.actions.action.action.NxActionRegLoadNodesNodeTableFlowApplyActionsCaseBuilder) ActionKey(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionKey) DstNxTunIpv4SrcCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.dst.choice.grouping.dst.choice.DstNxTunIpv4SrcCaseBuilder) NxActionRegLoadNodesNodeGroupBucketsBucketActionsCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.group.buckets.bucket.action.action.NxActionRegLoadNodesNodeGroupBucketsBucketActionsCaseBuilder)

Example 8 with DstBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.multipath.grouping.nx.multipath.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);
}
Also used : PhysicalSwitchAugmentationBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.PhysicalSwitchAugmentationBuilder) Node(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node) PhysicalSwitchAugmentation(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.PhysicalSwitchAugmentation) NodeBuilder(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeBuilder)

Example 9 with DstBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.multipath.grouping.nx.multipath.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);
}
Also used : NxRegMoveBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.move.grouping.NxRegMoveBuilder) ActionRegMove(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionRegMove) NxActionRegMove(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.reg.move.grouping.NxActionRegMove) DstBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.move.grouping.nx.reg.move.DstBuilder) NxActionRegMove(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.reg.move.grouping.NxActionRegMove) SrcBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.move.grouping.nx.reg.move.SrcBuilder)

Example 10 with DstBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.multipath.grouping.nx.multipath.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);
}
Also used : NxActionMultipath(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.multipath.grouping.NxActionMultipath) DstBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.multipath.grouping.nx.multipath.DstBuilder) NxActionMultipath(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.multipath.grouping.NxActionMultipath) ActionMultipath(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionMultipath) NxMultipathBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.multipath.grouping.NxMultipathBuilder)

Aggregations

ActionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder)10 ActionKey (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionKey)10 NxRegLoadBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.load.grouping.NxRegLoadBuilder)7 DstBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.load.grouping.nx.reg.load.DstBuilder)7 NxActionRegLoadNodesNodeTableFlowApplyActionsCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.table.flow.instructions.instruction.instruction.apply.actions._case.apply.actions.action.action.NxActionRegLoadNodesNodeTableFlowApplyActionsCaseBuilder)6 NxRegMoveBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.move.grouping.NxRegMoveBuilder)5 DstBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.move.grouping.nx.reg.move.DstBuilder)5 SrcBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.move.grouping.nx.reg.move.SrcBuilder)5 NxActionRegMoveNodesNodeTableFlowApplyActionsCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.table.flow.instructions.instruction.instruction.apply.actions._case.apply.actions.action.action.NxActionRegMoveNodesNodeTableFlowApplyActionsCaseBuilder)4 Dst (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.load.grouping.nx.reg.load.Dst)4 DstNxRegCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.dst.choice.grouping.dst.choice.DstNxRegCaseBuilder)3 NxRegMove (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.move.grouping.NxRegMove)3 Node (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node)3 NodeBuilder (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeBuilder)3 PopVlanActionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.pop.vlan.action._case.PopVlanActionBuilder)2 NxActionRegLoadNodesNodeGroupBucketsBucketActionsCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.group.buckets.bucket.action.action.NxActionRegLoadNodesNodeGroupBucketsBucketActionsCaseBuilder)2 PhysicalSwitchAugmentation (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.PhysicalSwitchAugmentation)2 PhysicalSwitchAugmentationBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.PhysicalSwitchAugmentationBuilder)2 BigInteger (java.math.BigInteger)1 ActionMultipath (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionMultipath)1