+ List<String> ofportIds = update.getLowerLayerIf();
+ if (ofportIds == null || ofportIds.isEmpty()) {
+ return;
+ }
+ NodeConnectorId nodeConnectorId = new NodeConnectorId(ofportIds.get(0));
+ BigInteger dpId = BigInteger.valueOf(MDSALUtil.getDpnIdFromPortName(nodeConnectorId));
+ String interfaceName = update.getName();
+ org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface iface =
+ DhcpServiceUtils.getInterfaceFromConfigDS(interfaceName, dataBroker);
+ if (iface == null) {
+ logger.trace("Interface {} is not present in the config DS", interfaceName);
+ return;
+ }
+ if (update.getType() == null) {
+ logger.trace("Interface type for interface {} is null", interfaceName);
+ return;
+ }
+ if ((original.getOperStatus().getIntValue() ^ update.getOperStatus().getIntValue()) == 0) {
+ logger.trace("Interface operstatus {} is same", update.getOperStatus());
+ return;
+ }
+ if (Tunnel.class.equals(update.getType())) {
+ IfTunnel tunnelInterface = iface.getAugmentation(IfTunnel.class);
+ if (tunnelInterface != null && !tunnelInterface.isInternal()) {
+ IpAddress tunnelIp = tunnelInterface.getTunnelDestination();
+ List<BigInteger> dpns = DhcpServiceUtils.getListOfDpns(dataBroker);
+ if (dpns.contains(dpId)) {
+ if (update.getOperStatus() == OperStatus.Down) {
+ dhcpExternalTunnelManager.handleTunnelStateDown(tunnelIp, dpId);
+ } else if (update.getOperStatus() == OperStatus.Up) {
+ dhcpExternalTunnelManager.handleTunnelStateUp(tunnelIp, dpId);
+ }
+ }
+ }
+ return;
+ }
+ if (update.getOperStatus() == OperStatus.Down) {
+ unInstallDhcpEntries(interfaceName, dpId);
+ dhcpManager.removeInterfaceCache(interfaceName);
+ } else if (update.getOperStatus() == OperStatus.Up) {
+ if (!dpId.equals(DHCPMConstants.INVALID_DPID)) {
+ installDhcpEntries(interfaceName, dpId);
+ dhcpManager.updateInterfaceCache(interfaceName, new ImmutablePair<BigInteger, String>(dpId, update.getPhysAddress().getValue()));
+ }
+ }