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());
}
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();
}
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;
}
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;
}
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();
}
Aggregations