use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.dhcp.rev160428.designated.switches._for.external.tunnels.DesignatedSwitchForTunnel in project netvirt by opendaylight.
the class DhcpDesignatedDpnListener method add.
@Override
protected void add(InstanceIdentifier<DesignatedSwitchForTunnel> identifier, DesignatedSwitchForTunnel add) {
LOG.debug("Add for DesignatedSwitchForTunnel : {}", add);
BigInteger designatedDpnId = BigInteger.valueOf(add.getDpId());
IpAddress tunnelRemoteIpAddress = add.getTunnelRemoteIpAddress();
String elanInstanceName = add.getElanInstanceName();
dhcpExternalTunnelManager.updateLocalCache(designatedDpnId, tunnelRemoteIpAddress, elanInstanceName);
dhcpExternalTunnelManager.installRemoteMcastMac(designatedDpnId, tunnelRemoteIpAddress, elanInstanceName);
LOG.trace("Configuring DHCP Arp Flows for Designated dpn {} Elan {}", designatedDpnId, elanInstanceName);
java.util.Optional<SubnetToDhcpPort> subnetDhcpData = dhcpExternalTunnelManager.getSubnetDhcpPortData(elanInstanceName);
if (subnetDhcpData.isPresent()) {
dhcpExternalTunnelManager.configureDhcpArpRequestResponseFlow(designatedDpnId, elanInstanceName, true, tunnelRemoteIpAddress, subnetDhcpData.get().getPortFixedip(), subnetDhcpData.get().getPortMacaddress());
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.dhcp.rev160428.designated.switches._for.external.tunnels.DesignatedSwitchForTunnel in project netvirt by opendaylight.
the class DhcpDesignatedDpnListener method update.
@Override
protected void update(InstanceIdentifier<DesignatedSwitchForTunnel> identifier, DesignatedSwitchForTunnel original, DesignatedSwitchForTunnel update) {
LOG.debug("Update for DesignatedSwitchForTunnel original {}, update {}", original, update);
dhcpExternalTunnelManager.removeFromLocalCache(BigInteger.valueOf(original.getDpId()), original.getTunnelRemoteIpAddress(), original.getElanInstanceName());
BigInteger designatedDpnId = BigInteger.valueOf(update.getDpId());
IpAddress tunnelRemoteIpAddress = update.getTunnelRemoteIpAddress();
String elanInstanceName = update.getElanInstanceName();
dhcpExternalTunnelManager.updateLocalCache(designatedDpnId, tunnelRemoteIpAddress, elanInstanceName);
dhcpExternalTunnelManager.installRemoteMcastMac(designatedDpnId, tunnelRemoteIpAddress, elanInstanceName);
java.util.Optional<SubnetToDhcpPort> subnetDhcpData = dhcpExternalTunnelManager.getSubnetDhcpPortData(elanInstanceName);
if (subnetDhcpData.isPresent()) {
LOG.trace("Removing Designated DPN {} DHCP Arp Flows for Elan {}.", original.getDpId(), original.getElanInstanceName());
dhcpExternalTunnelManager.configureDhcpArpRequestResponseFlow(BigInteger.valueOf(original.getDpId()), original.getElanInstanceName(), false, original.getTunnelRemoteIpAddress(), subnetDhcpData.get().getPortFixedip(), subnetDhcpData.get().getPortMacaddress());
LOG.trace("Configuring DHCP Arp Flows for Designated dpn {} Elan {}", designatedDpnId, elanInstanceName);
dhcpExternalTunnelManager.configureDhcpArpRequestResponseFlow(designatedDpnId, elanInstanceName, true, tunnelRemoteIpAddress, subnetDhcpData.get().getPortFixedip(), subnetDhcpData.get().getPortMacaddress());
}
}
Aggregations