+ return interfaceManager.isExternalInterface(interfaceName);
+ }
+
+ @Override
+ public ElanInterface getElanInterfaceByElanInterfaceName(String interfaceName) {
+ return ElanUtils.getElanInterfaceByElanInterfaceName(broker, interfaceName);
+ }
+
+ @Override
+ public void handleKnownL3DmacAddress(String macAddress, String elanInstanceName, int addOrRemove) {
+ if (!isL2BeforeL3) {
+ LOG.trace("ELAN service is after L3VPN in the Netvirt pipeline skip known L3DMAC flows installation");
+ return;
+ }
+ ElanInstance elanInstance = ElanUtils.getElanInstanceByName(broker, elanInstanceName);
+ if (elanInstance == null) {
+ LOG.warn("Null elan instance {}", elanInstanceName);
+ return;
+ }
+
+ List<BigInteger> dpnsIdsForElanInstance = elanUtils.getParticipatingDpnsInElanInstance(elanInstanceName);
+ if (dpnsIdsForElanInstance == null || dpnsIdsForElanInstance.isEmpty()) {
+ LOG.warn("No DPNs for elan instance {}", elanInstance);
+ return;
+ }
+
+ elanUtils.handleDmacRedirectToDispatcherFlows(elanInstance.getElanTag(), elanInstanceName, macAddress,
+ addOrRemove, dpnsIdsForElanInstance);
+ }
+
+ @Override
+ public List<MatchInfoBase> getEgressMatchesForElanInstance(String elanInstanceName) {
+ ElanInstance elanInstance = getElanInstance(elanInstanceName);
+ if (elanInstance == null) {
+ LOG.debug("No ELAN instance found for {}", elanInstanceName);
+ return Collections.emptyList();
+ }
+
+ Long elanTag = elanInstance.getElanTag();
+ if (elanTag == null) {
+ LOG.debug("No ELAN tag found for {}", elanInstanceName);
+ return Collections.emptyList();
+ }
+ return Collections.singletonList(
+ new NxMatchRegister(ElanConstants.ELAN_REG_ID, elanTag, MetaDataUtil.getElanMaskForReg()));