Search in sources :

Example 56 with Dst

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.move.grouping.nx.reg.move.Dst in project bgpcep by opendaylight.

the class LUNlriParser method parseNlri.

@Override
public void parseNlri(final ByteBuf nlri, final MpReachNlriBuilder builder, final PeerSpecificParserConstraint constraint) throws BGPParsingException {
    if (!nlri.isReadable()) {
        return;
    }
    final Class<? extends AddressFamily> afi = builder.getAfi();
    final boolean mPathSupported = MultiPathSupportUtil.isTableTypeSupported(constraint, new BgpTableTypeImpl(builder.getAfi(), builder.getSafi()));
    final List<CLabeledUnicastDestination> dst = parseNlri(nlri, afi, mPathSupported);
    DestinationType destination = null;
    if (afi == Ipv4AddressFamily.class) {
        destination = new DestinationLabeledUnicastCaseBuilder().setDestinationLabeledUnicast(new DestinationLabeledUnicastBuilder().setCLabeledUnicastDestination(dst).build()).build();
    } else if (afi == Ipv6AddressFamily.class) {
        destination = new DestinationIpv6LabeledUnicastCaseBuilder().setDestinationIpv6LabeledUnicast(new DestinationIpv6LabeledUnicastBuilder().setCLabeledUnicastDestination(dst).build()).build();
    }
    builder.setAdvertizedRoutes(new AdvertizedRoutesBuilder().setDestinationType(destination).build());
}
Also used : Ipv6AddressFamily(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.Ipv6AddressFamily) AdvertizedRoutesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev171207.update.attributes.mp.reach.nlri.AdvertizedRoutesBuilder) CLabeledUnicastDestination(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev171207.labeled.unicast.destination.CLabeledUnicastDestination) DestinationLabeledUnicastCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev171207.update.attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationLabeledUnicastCaseBuilder) DestinationLabeledUnicastBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev171207.update.attributes.mp.reach.nlri.advertized.routes.destination.type.destination.labeled.unicast._case.DestinationLabeledUnicastBuilder) DestinationIpv6LabeledUnicastBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev171207.update.attributes.mp.reach.nlri.advertized.routes.destination.type.destination.ipv6.labeled.unicast._case.DestinationIpv6LabeledUnicastBuilder) DestinationIpv6LabeledUnicastCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev171207.update.attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationIpv6LabeledUnicastCaseBuilder) BgpTableTypeImpl(org.opendaylight.protocol.bgp.parser.BgpTableTypeImpl) DestinationType(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev171207.destination.DestinationType)

Example 57 with Dst

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.move.grouping.nx.reg.move.Dst in project netvirt by opendaylight.

the class TestBuilders method buildRemoteMcastMacs.

public static RemoteMcastMacs buildRemoteMcastMacs(InstanceIdentifier<Node> iid, String mac, String logicalSwitchName, String[] tepIps) {
    RemoteMcastMacsBuilder remoteMcastMacsBuilder = new RemoteMcastMacsBuilder();
    if (mac.equals("unknown-dst")) {
        remoteMcastMacsBuilder.setMacEntryKey(new MacAddress("00:00:00:00:00:00"));
    } else {
        remoteMcastMacsBuilder.setMacEntryKey(new MacAddress(mac));
    }
    remoteMcastMacsBuilder.setMacEntryUuid(getUUid(mac));
    // mMacLocalBuilder.setIpaddr(new IpAddress(ip.toCharArray()));
    remoteMcastMacsBuilder.setLogicalSwitchRef(buildLogicalSwitchesRef(iid, logicalSwitchName));
    List<LocatorSet> locatorSets = new ArrayList<>();
    for (String tepIp : tepIps) {
        locatorSets.add(new LocatorSetBuilder().setLocatorRef(buildLocatorRef(iid, tepIp)).build());
    }
    remoteMcastMacsBuilder.setLocatorSet(locatorSets);
    return remoteMcastMacsBuilder.build();
}
Also used : LocatorSet(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.physical.locator.set.attributes.LocatorSet) ArrayList(java.util.ArrayList) MacAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress) RemoteMcastMacsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.RemoteMcastMacsBuilder) LocatorSetBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.physical.locator.set.attributes.LocatorSetBuilder)

Example 58 with Dst

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.move.grouping.nx.reg.move.Dst in project netvirt by opendaylight.

the class ElanItmUtils method getExternalTunnelInterfaceName.

/**
 * Gets the external tunnel interface name.
 *
 * @param sourceNode
 *            the source node
 * @param dstNode
 *            the dst node
 * @return the external tunnel interface name
 */
public String getExternalTunnelInterfaceName(String sourceNode, String dstNode) {
    Class<? extends TunnelTypeBase> tunType = TunnelTypeVxlan.class;
    String tunnelInterfaceName = null;
    try {
        Future<RpcResult<GetExternalTunnelInterfaceNameOutput>> output = itmRpcService.getExternalTunnelInterfaceName(new GetExternalTunnelInterfaceNameInputBuilder().setSourceNode(sourceNode).setDestinationNode(dstNode).setTunnelType(tunType).build());
        RpcResult<GetExternalTunnelInterfaceNameOutput> rpcResult = output.get();
        if (rpcResult.isSuccessful()) {
            tunnelInterfaceName = rpcResult.getResult().getInterfaceName();
            LOG.debug("Tunnel interface name: {} for sourceNode: {} and dstNode: {}", tunnelInterfaceName, sourceNode, dstNode);
        } else {
            LOG.warn("RPC call to ITM.GetExternalTunnelInterfaceName failed with error: {}", rpcResult.getErrors());
        }
    } catch (NullPointerException | InterruptedException | ExecutionException e) {
        LOG.error("Failed to get external tunnel interface name for sourceNode: {} and dstNode: {}", sourceNode, dstNode, e);
    }
    return tunnelInterfaceName;
}
Also used : GetExternalTunnelInterfaceNameOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rpcs.rev160406.GetExternalTunnelInterfaceNameOutput) RpcResult(org.opendaylight.yangtools.yang.common.RpcResult) TunnelTypeVxlan(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.TunnelTypeVxlan) ExecutionException(java.util.concurrent.ExecutionException) GetExternalTunnelInterfaceNameInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rpcs.rev160406.GetExternalTunnelInterfaceNameInputBuilder)

Example 59 with Dst

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.move.grouping.nx.reg.move.Dst in project netvirt by opendaylight.

the class ElanItmUtils method getSourceDpnTepIp.

/**
 * Gets the source dpn tep ip.
 *
 * @param srcDpnId
 *            the src dpn id
 * @param dstHwVtepNodeId
 *            the dst hw vtep node id
 * @return the dpn tep ip
 */
public IpAddress getSourceDpnTepIp(BigInteger srcDpnId, org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId dstHwVtepNodeId) {
    IpAddress dpnTepIp = null;
    String tunnelInterfaceName = getExternalTunnelInterfaceName(String.valueOf(srcDpnId), dstHwVtepNodeId.getValue());
    if (tunnelInterfaceName != null) {
        Interface tunnelInterface = ElanL2GatewayUtils.getInterfaceFromConfigDS(new InterfaceKey(tunnelInterfaceName), broker);
        if (tunnelInterface != null) {
            dpnTepIp = tunnelInterface.getAugmentation(IfTunnel.class).getTunnelSource();
        } else {
            LOG.warn("Tunnel interface not found for tunnelInterfaceName {}", tunnelInterfaceName);
        }
    } else {
        LOG.warn("Tunnel interface name not found for srcDpnId {} and dstHwVtepNodeId {}", srcDpnId, dstHwVtepNodeId);
    }
    return dpnTepIp;
}
Also used : IpAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress) InterfaceKey(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.InterfaceKey) Interface(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface)

Example 60 with Dst

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.move.grouping.nx.reg.move.Dst in project netvirt by opendaylight.

the class ElanInterfaceManager method installDMacAddressTables.

// Install DMAC entry on dst DPN
public List<ListenableFuture<Void>> installDMacAddressTables(ElanInstance elanInfo, InterfaceInfo interfaceInfo, BigInteger dstDpId) throws ElanException {
    String interfaceName = interfaceInfo.getInterfaceName();
    ElanInterfaceMac elanInterfaceMac = elanUtils.getElanInterfaceMacByInterfaceName(interfaceName);
    if (elanInterfaceMac != null && elanInterfaceMac.getMacEntry() != null) {
        List<MacEntry> macEntries = elanInterfaceMac.getMacEntry();
        WriteTransaction writeFlowTx = broker.newWriteOnlyTransaction();
        for (MacEntry macEntry : macEntries) {
            String macAddress = macEntry.getMacAddress().getValue();
            LOG.info("Installing remote dmac for mac address {} and interface {}", macAddress, interfaceName);
            synchronized (ElanUtils.getElanMacDPNKey(elanInfo.getElanTag(), macAddress, interfaceInfo.getDpId())) {
                LOG.info("Acquired lock for mac : {}, proceeding with remote dmac install operation", macAddress);
                elanUtils.setupDMacFlowOnRemoteDpn(elanInfo, interfaceInfo, dstDpId, macAddress, writeFlowTx);
            }
        }
        return Collections.singletonList(ElanUtils.waitForTransactionToComplete(writeFlowTx));
    }
    return Collections.emptyList();
}
Also used : ReadWriteTransaction(org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction) WriteTransaction(org.opendaylight.controller.md.sal.binding.api.WriteTransaction) MacEntry(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.forwarding.entries.MacEntry) ElanInterfaceMac(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan._interface.forwarding.entries.ElanInterfaceMac)

Aggregations

Test (org.junit.Test)50 BigInteger (java.math.BigInteger)30 MatchEntry (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry)23 ArrayList (java.util.ArrayList)22 VersionDatapathIdConvertorData (org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.data.VersionDatapathIdConvertorData)20 MacAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress)19 Ipv4Match (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv4Match)18 UdpMatch (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.UdpMatch)18 TcpMatch (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.TcpMatch)17 Ipv4Address (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address)16 MatchEntryBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder)15 MatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.MatchBuilder)15 Ipv6Match (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv6Match)14 MatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder)13 SctpMatch (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.SctpMatch)13 Match (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match)12 ArpMatch (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.ArpMatch)12 FlowWildcardsV10 (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.FlowWildcardsV10)12 Match (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.Match)12 IpMatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.IpMatchBuilder)9