use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan.state.Elan in project netvirt by opendaylight.
the class ElanServiceProvider method removeKnownL3DmacAddress.
@Override
public void removeKnownL3DmacAddress(String macAddress, String elanInstanceName) {
if (!isL2BeforeL3) {
LOG.trace("ELAN service is after L3VPN in the Netvirt pipeline skip known L3DMAC flows installation");
return;
}
ElanInstance elanInstance = elanInstanceCache.get(elanInstanceName).orNull();
if (elanInstance == null) {
LOG.warn("Null elan instance {}", elanInstanceName);
return;
}
List<BigInteger> dpnsIdsForElanInstance = elanUtils.getParticipatingDpnsInElanInstance(elanInstanceName);
if (dpnsIdsForElanInstance.isEmpty()) {
LOG.warn("No DPNs for elan instance {}", elanInstance);
return;
}
elanUtils.removeDmacRedirectToDispatcherFlows(elanInstance.getElanTag(), macAddress, dpnsIdsForElanInstance);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan.state.Elan in project netvirt by opendaylight.
the class ElanServiceProvider method createExternalElanNetwork.
protected void createExternalElanNetwork(ElanInstance elanInstance, BigInteger dpId) {
String providerIntfName = bridgeMgr.getProviderInterfaceName(dpId, elanInstance.getPhysicalNetworkName());
String intfName = providerIntfName + IfmConstants.OF_URI_SEPARATOR + elanInstance.getSegmentationId();
Interface memberIntf = interfaceManager.getInterfaceInfoFromConfigDataStore(intfName);
if (memberIntf == null) {
LOG.debug("creating vlan prv intf in elan {}, dpn {}", elanInstance.getElanInstanceName(), dpId);
createExternalElanNetwork(elanInstance, providerIntfName);
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan.state.Elan in project netvirt by opendaylight.
the class ElanServiceProvider method addExternalTunnelArpResponderFlow.
@Override
public void addExternalTunnelArpResponderFlow(ArpResponderInput arpResponderInput, String elanInstanceName) {
BigInteger dpnId = arpResponderInput.getDpId();
String ipAddress = arpResponderInput.getSpa();
String macAddress = arpResponderInput.getSha();
LOG.trace("Installing the ExternalTunnel ARP responder flow on DPN {} for ElanInstance {} with MAC {} & IP {}", dpnId, elanInstanceName, macAddress, ipAddress);
ElanInstance elanInstance = elanInstanceCache.get(elanInstanceName).orNull();
if (elanInstance == null) {
LOG.warn("Null elan instance {}", elanInstanceName);
return;
}
int lportTag = arpResponderInput.getLportTag();
String flowId = ArpResponderUtil.getFlowId(lportTag, ipAddress);
ArpResponderUtil.installFlow(mdsalManager, dpnId, flowId, flowId, NwConstants.DEFAULT_ARP_FLOW_PRIORITY, ArpResponderUtil.generateCookie(lportTag, ipAddress), ArpResponderUtil.getMatchCriteria(lportTag, elanInstance, ipAddress), arpResponderInput.getInstructions());
LOG.trace("Installed the ExternalTunnel ARP Responder flow for ElanInstance {}", elanInstanceName);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan.state.Elan in project netvirt by opendaylight.
the class ElanServiceProvider method flushMACTable.
@Override
public void flushMACTable(String elanInstanceName) {
Elan elanInfo = ElanUtils.getElanByName(broker, elanInstanceName);
if (elanInfo == null) {
return;
}
List<String> elanInterfaces = elanInfo.getElanInterfaces();
if (elanInterfaces == null || elanInterfaces.isEmpty()) {
return;
}
for (String elanInterface : elanInterfaces) {
ElanInterfaceMac elanInterfaceMac = elanUtils.getElanInterfaceMacByInterfaceName(elanInterface);
if (elanInterfaceMac.getMacEntry() != null && elanInterfaceMac.getMacEntry().size() > 0) {
List<MacEntry> macEntries = elanInterfaceMac.getMacEntry();
for (MacEntry macEntry : macEntries) {
deleteStaticMacAddress(elanInterface, macEntry.getMacAddress().getValue());
}
}
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan.state.Elan in project netvirt by opendaylight.
the class ElanServiceProvider method addKnownL3DmacAddress.
@Override
public void addKnownL3DmacAddress(String macAddress, String elanInstanceName) {
if (!isL2BeforeL3) {
LOG.trace("ELAN service is after L3VPN in the Netvirt pipeline skip known L3DMAC flows installation");
return;
}
ElanInstance elanInstance = elanInstanceCache.get(elanInstanceName).orNull();
if (elanInstance == null) {
LOG.warn("Null elan instance {}", elanInstanceName);
return;
}
List<BigInteger> dpnsIdsForElanInstance = elanUtils.getParticipatingDpnsInElanInstance(elanInstanceName);
if (dpnsIdsForElanInstance.isEmpty()) {
LOG.warn("No DPNs for elan instance {}", elanInstance);
return;
}
elanUtils.addDmacRedirectToDispatcherFlows(elanInstance.getElanTag(), elanInstanceName, macAddress, dpnsIdsForElanInstance);
}
Aggregations