use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dhcpservice.api.rev150710.subnet.dhcp.port.data.SubnetToDhcpPort 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.params.xml.ns.yang.dhcpservice.api.rev150710.subnet.dhcp.port.data.SubnetToDhcpPort 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());
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dhcpservice.api.rev150710.subnet.dhcp.port.data.SubnetToDhcpPort in project netvirt by opendaylight.
the class DhcpExternalTunnelManager method updateCacheAndInstallNewFlows.
public void updateCacheAndInstallNewFlows(List<BigInteger> listOfDpns, Pair<IpAddress, String> pair, WriteTransaction tx) {
BigInteger newDesignatedDpn = chooseDpn(pair.getLeft(), pair.getRight(), listOfDpns);
if (newDesignatedDpn.equals(DhcpMConstants.INVALID_DPID)) {
return;
}
Set<String> setOfVmMacs = tunnelIpElanNameToVmMacCache.get(pair);
if (setOfVmMacs != null && !setOfVmMacs.isEmpty()) {
LOG.trace("Updating DHCP flows for VMs {} with new designated DPN {}", setOfVmMacs, newDesignatedDpn);
installDhcpFlowsForVms(newDesignatedDpn, setOfVmMacs, tx);
}
java.util.Optional<SubnetToDhcpPort> subnetDhcpData = getSubnetDhcpPortData(pair.getRight());
if (subnetDhcpData.isPresent()) {
configureDhcpArpRequestResponseFlow(newDesignatedDpn, pair.getRight(), true, pair.getLeft(), subnetDhcpData.get().getPortFixedip(), subnetDhcpData.get().getPortMacaddress());
}
}
Aggregations