use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.etree.rev160614.EtreeLeafTagName in project netvirt by opendaylight.
the class ElanEvpnFlowUtils method evpnDeleteEtreeDmacFlowsToExternalMac.
private List<ListenableFuture<Void>> evpnDeleteEtreeDmacFlowsToExternalMac(long elanTag, BigInteger dpId, String nexthopIp, String macToRemove) {
List<ListenableFuture<Void>> futures = new ArrayList<>();
EtreeLeafTagName etreeLeafTag = elanEtreeUtils.getEtreeLeafTagByElanTag(elanTag);
if (etreeLeafTag != null) {
futures.addAll(evpnRemoveFlowThatSendsThePacketOnAnExternalTunnel(etreeLeafTag.getEtreeLeafTag().getValue(), dpId, nexthopIp, macToRemove));
futures.addAll(evpnRemoveTheDropFlow(etreeLeafTag.getEtreeLeafTag().getValue(), dpId, nexthopIp, macToRemove));
}
return futures;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.etree.rev160614.EtreeLeafTagName in project netvirt by opendaylight.
the class ElanDmacUtils method buildEtreeDmacFlowForExternalRemoteMac.
private ListenableFuture<Void> buildEtreeDmacFlowForExternalRemoteMac(BigInteger dpnId, String extDeviceNodeId, Long vni, String macAddress, String displayName, String interfaceName, EtreeLeafTagName etreeLeafTag) {
boolean isRoot;
if (interfaceName == null) {
isRoot = true;
} else {
Optional<EtreeInterface> etreeInterface = elanInterfaceCache.getEtreeInterface(interfaceName);
isRoot = etreeInterface.isPresent() ? etreeInterface.get().getEtreeInterfaceType() == EtreeInterface.EtreeInterfaceType.Root : false;
}
if (isRoot) {
Flow flow = buildDmacFlowForExternalRemoteMac(dpnId, extDeviceNodeId, etreeLeafTag.getEtreeLeafTag().getValue(), vni, macAddress, displayName);
return ResourceBatchingManager.getInstance().put(ResourceBatchingManager.ShardResource.CONFIG_TOPOLOGY, ElanUtils.getFlowIid(flow, dpnId), flow);
}
return Futures.immediateFuture(null);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.etree.rev160614.EtreeLeafTagName in project netvirt by opendaylight.
the class ElanUtils method installEtreeLocalDmacFlow.
private void installEtreeLocalDmacFlow(long elanTag, BigInteger dpId, String ifName, String macAddress, ElanInstance elanInfo, long ifTag, WriteTransaction writeFlowGroupTx) {
EtreeInterface etreeInterface = elanInterfaceCache.getEtreeInterface(ifName).orNull();
if (etreeInterface != null && etreeInterface.getEtreeInterfaceType() == EtreeInterfaceType.Root) {
EtreeLeafTagName etreeTagName = elanEtreeUtils.getEtreeLeafTagByElanTag(elanTag);
if (etreeTagName == null) {
LOG.warn("Interface {} seems like it belongs to Etree but etreeTagName from elanTag {} is null", ifName, elanTag);
} else {
Flow flowEntity = buildLocalDmacFlowEntry(etreeTagName.getEtreeLeafTag().getValue(), dpId, ifName, macAddress, elanInfo, ifTag);
mdsalManager.addFlowToTx(dpId, flowEntity, writeFlowGroupTx);
}
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.etree.rev160614.EtreeLeafTagName in project netvirt by opendaylight.
the class ElanDmacUtils method buildEtreeDmacFlowForExternalRemoteMacWithBatch.
private ListenableFuture<Void> buildEtreeDmacFlowForExternalRemoteMacWithBatch(BigInteger dpnId, String extDeviceNodeId, Long vni, String macAddress, String displayName, String interfaceName, EtreeLeafTagName etreeLeafTag) {
boolean isRoot;
if (interfaceName == null) {
isRoot = true;
} else {
Optional<EtreeInterface> etreeInterface = elanInterfaceCache.getEtreeInterface(interfaceName);
isRoot = etreeInterface.isPresent() ? etreeInterface.get().getEtreeInterfaceType() == EtreeInterface.EtreeInterfaceType.Root : false;
}
if (isRoot) {
Flow flow = buildDmacFlowForExternalRemoteMac(dpnId, extDeviceNodeId, etreeLeafTag.getEtreeLeafTag().getValue(), vni, macAddress, displayName);
return ResourceBatchingManager.getInstance().put(ResourceBatchingManager.ShardResource.CONFIG_TOPOLOGY, ElanUtils.getFlowIid(flow, dpnId), flow);
}
return Futures.immediateFuture(null);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.etree.rev160614.EtreeLeafTagName in project netvirt by opendaylight.
the class ElanEtreeUtils method getEtreeLeafTagByElanTag.
public EtreeLeafTagName getEtreeLeafTagByElanTag(long elanTag) {
InstanceIdentifier<ElanTagName> elanId = ElanUtils.getElanInfoEntriesOperationalDataPath(elanTag);
Optional<ElanTagName> existingElanInfo = ElanUtils.read(broker, LogicalDatastoreType.OPERATIONAL, elanId);
if (existingElanInfo.isPresent()) {
ElanTagName elanTagName = existingElanInfo.get();
return elanTagName.getAugmentation(EtreeLeafTagName.class);
}
return null;
}
Aggregations