use of org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sl.rev140701.Mac in project netvirt by opendaylight.
the class ElanDmacUtils method installDmacFlowsToExternalRemoteMac.
/**
* Installs a Flow in the specified DPN's DMAC table. The flow is for a MAC
* that is connected remotely in an External Device (TOR) and that is
* accessible through an external tunnel. It also installs the flow for
* dropping the packet if it came over an ITM tunnel (that is, if the
* Split-Horizon flag is set)
*
* @param dpnId
* Id of the DPN where the flow must be installed
* @param extDeviceNodeId
* the ext device node id
* @param elanTag
* the elan tag
* @param vni
* the vni
* @param macAddress
* the mac address
* @param displayName
* the display name
* @param interfaceName
* the interface name
*
* @return the dmac flows
* @throws ElanException in case of issues creating the flow objects
*/
public List<ListenableFuture<Void>> installDmacFlowsToExternalRemoteMac(BigInteger dpnId, String extDeviceNodeId, Long elanTag, Long vni, String macAddress, String displayName, String interfaceName) throws ElanException {
synchronized (ElanUtils.getElanMacDPNKey(elanTag, macAddress, dpnId)) {
Flow flow = buildDmacFlowForExternalRemoteMac(dpnId, extDeviceNodeId, elanTag, vni, macAddress, displayName);
ResourceBatchingManager.getInstance().put(ResourceBatchingManager.ShardResource.CONFIG_TOPOLOGY, ElanUtils.getFlowIid(flow, dpnId), flow);
Flow dropFlow = buildDmacFlowDropIfPacketComingFromTunnel(dpnId, extDeviceNodeId, elanTag, macAddress);
ResourceBatchingManager.getInstance().put(ResourceBatchingManager.ShardResource.CONFIG_TOPOLOGY, ElanUtils.getFlowIid(dropFlow, dpnId), dropFlow);
installEtreeDmacFlowsToExternalRemoteMac(dpnId, extDeviceNodeId, elanTag, vni, macAddress, displayName, interfaceName);
}
return Collections.emptyList();
}
use of org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sl.rev140701.Mac in project netvirt by opendaylight.
the class ElanForwardingEntriesHandler method createElanInterfaceForwardingTablesList.
public void createElanInterfaceForwardingTablesList(String interfaceName, MacEntry mac, WriteTransaction tx) {
InstanceIdentifier<MacEntry> existingMacEntryId = ElanUtils.getInterfaceMacEntriesIdentifierOperationalDataPath(interfaceName, mac.getMacAddress());
MacEntry existingInterfaceMacEntry = elanUtils.getInterfaceMacEntriesOperationalDataPathFromId(existingMacEntryId);
if (existingInterfaceMacEntry == null) {
MacEntry macEntry = new MacEntryBuilder().setMacAddress(mac.getMacAddress()).setIpPrefix(mac.getIpPrefix()).setInterface(interfaceName).setIsStaticAddress(true).setKey(new MacEntryKey(mac.getMacAddress())).build();
tx.put(LogicalDatastoreType.OPERATIONAL, existingMacEntryId, macEntry, WriteTransaction.CREATE_MISSING_PARENTS);
}
}
use of org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sl.rev140701.Mac in project netvirt by opendaylight.
the class ElanForwardingEntriesHandler method deleteElanInterfaceForwardingTablesList.
public void deleteElanInterfaceForwardingTablesList(String interfaceName, MacEntry mac, WriteTransaction tx) {
InstanceIdentifier<MacEntry> existingMacEntryId = ElanUtils.getInterfaceMacEntriesIdentifierOperationalDataPath(interfaceName, mac.getMacAddress());
MacEntry existingInterfaceMacEntry = elanUtils.getInterfaceMacEntriesOperationalDataPathFromId(existingMacEntryId);
if (existingInterfaceMacEntry != null) {
tx.delete(LogicalDatastoreType.OPERATIONAL, existingMacEntryId);
}
}
use of org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sl.rev140701.Mac in project netvirt by opendaylight.
the class ElanForwardingEntriesHandler method updateElanForwardingTablesList.
public void updateElanForwardingTablesList(String elanName, String interfaceName, MacEntry mac, WriteTransaction tx) {
InstanceIdentifier<MacEntry> macEntryId = ElanUtils.getMacEntryOperationalDataPath(elanName, mac.getMacAddress());
MacEntry existingMacEntry = elanUtils.getMacEntryFromElanMacId(macEntryId);
if (existingMacEntry != null && elanUtils.getElanMacTable(elanName) != null) {
MacEntry newMacEntry = new MacEntryBuilder().setInterface(interfaceName).setIsStaticAddress(true).setMacAddress(mac.getMacAddress()).setIpPrefix(mac.getIpPrefix()).setKey(new MacEntryKey(mac.getMacAddress())).build();
tx.put(LogicalDatastoreType.OPERATIONAL, macEntryId, newMacEntry);
}
}
use of org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sl.rev140701.Mac in project netvirt by opendaylight.
the class ElanUtils method setupOrigDmacFlows.
private void setupOrigDmacFlows(ElanInstance elanInfo, InterfaceInfo interfaceInfo, String macAddress, boolean configureRemoteFlows, IMdsalApiManager mdsalApiManager, WriteTransaction writeFlowGroupTx) throws ElanException {
BigInteger dpId = interfaceInfo.getDpId();
String ifName = interfaceInfo.getInterfaceName();
long ifTag = interfaceInfo.getInterfaceTag();
String elanInstanceName = elanInfo.getElanInstanceName();
Long elanTag = elanInfo.getElanTag();
setupLocalDmacFlow(elanTag, dpId, ifName, macAddress, elanInfo, mdsalApiManager, ifTag, writeFlowGroupTx);
LOG.debug("Dmac flow entry created for elan Name:{}, logical port Name:{} mand mac address:{} " + "on dpn:{}", elanInstanceName, interfaceInfo.getPortName(), macAddress, dpId);
if (!configureRemoteFlows) {
return;
}
List<DpnInterfaces> elanDpns = getInvolvedDpnsInElan(elanInstanceName);
for (DpnInterfaces elanDpn : elanDpns) {
if (elanDpn.getDpId().equals(dpId)) {
continue;
}
// Check for the Remote DPN present in Inventory Manager
if (!isDpnPresent(elanDpn.getDpId())) {
continue;
}
// For remote DPNs a flow is needed to indicate that packets of this ELAN going to this MAC need to be
// forwarded through the appropriate ITM tunnel
setupRemoteDmacFlow(// srcDpn (the remote DPN in this case)
elanDpn.getDpId(), // dstDpn (the local DPN)
dpId, // lportTag of the local interface
interfaceInfo.getInterfaceTag(), // identifier of the Elan
elanTag, // MAC to be programmed in remote DPN
macAddress, elanInstanceName, writeFlowGroupTx, ifName, elanInfo);
LOG.debug("Remote Dmac flow entry created for elan Name:{}, logical port Name:{} and mac address:{} on" + " dpn:{}", elanInstanceName, interfaceInfo.getPortName(), macAddress, elanDpn.getDpId());
}
// TODO: Make sure that the same is performed against the ElanDevices.
}
Aggregations