Search in sources :

Example 6 with DesignatedSwitchForTunnel

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());
    }
}
Also used : SubnetToDhcpPort(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dhcpservice.api.rev150710.subnet.dhcp.port.data.SubnetToDhcpPort) BigInteger(java.math.BigInteger) IpAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress)

Example 7 with DesignatedSwitchForTunnel

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());
    }
}
Also used : SubnetToDhcpPort(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dhcpservice.api.rev150710.subnet.dhcp.port.data.SubnetToDhcpPort) BigInteger(java.math.BigInteger) IpAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress)

Aggregations

DesignatedSwitchForTunnel (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.dhcp.rev160428.designated.switches._for.external.tunnels.DesignatedSwitchForTunnel)5 IpAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress)4 BigInteger (java.math.BigInteger)3 SubnetToDhcpPort (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dhcpservice.api.rev150710.subnet.dhcp.port.data.SubnetToDhcpPort)3 DesignatedSwitchesForExternalTunnels (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.dhcp.rev160428.DesignatedSwitchesForExternalTunnels)2 DesignatedSwitchForTunnelKey (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.dhcp.rev160428.designated.switches._for.external.tunnels.DesignatedSwitchForTunnelKey)2 ImmutablePair (org.apache.commons.lang3.tuple.ImmutablePair)1 Pair (org.apache.commons.lang3.tuple.Pair)1 Uuid (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid)1 DesignatedSwitchForTunnelBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.dhcp.rev160428.designated.switches._for.external.tunnels.DesignatedSwitchForTunnelBuilder)1 Ports (org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.ports.rev150712.ports.attributes.Ports)1 Port (org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.ports.rev150712.ports.attributes.ports.Port)1 NodeId (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId)1