Search in sources :

Example 16 with DhcpServerInfo

use of org.onosproject.dhcprelay.api.DhcpServerInfo in project onos by opennetworkinglab.

the class Dhcp6HandlerImpl method getServerInterface.

/**
 * Gets Interface facing to the server for default host.
 *
 * @return the Interface facing to the server; null if not found
 */
private Interface getServerInterface() {
    DhcpServerInfo serverInfo;
    ConnectPoint dhcpServerConnectPoint;
    VlanId dhcpConnectVlan;
    if (!defaultServerInfoList.isEmpty()) {
        serverInfo = defaultServerInfoList.get(0);
        dhcpServerConnectPoint = serverInfo.getDhcpServerConnectPoint().orElse(null);
        dhcpConnectVlan = serverInfo.getDhcpConnectVlan().orElse(null);
    } else {
        return null;
    }
    if (dhcpServerConnectPoint == null || dhcpConnectVlan == null) {
        log.info("Default DHCP server {} not resolve yet", serverInfo.getDhcpGatewayIp6());
        return null;
    }
    return interfaceService.getInterfacesByPort(dhcpServerConnectPoint).stream().filter(iface -> Dhcp6HandlerUtil.interfaceContainsVlan(iface, dhcpConnectVlan)).findFirst().orElse(null);
}
Also used : ConnectPoint(org.onosproject.net.ConnectPoint) DhcpServerInfo(org.onosproject.dhcprelay.api.DhcpServerInfo) VlanId(org.onlab.packet.VlanId)

Example 17 with DhcpServerInfo

use of org.onosproject.dhcprelay.api.DhcpServerInfo in project onos by opennetworkinglab.

the class Dhcp4HandlerImpl method getServerInterface.

/**
 * Gets Interface facing to the server for default host.
 *
 * @param serverInfo server information
 * @return the Interface facing to the server; null if not found
 */
private Interface getServerInterface(DhcpServerInfo serverInfo) {
    Interface serverInterface = null;
    ConnectPoint dhcpServerConnectPoint = serverInfo.getDhcpServerConnectPoint().orElse(null);
    VlanId dhcpConnectVlan = serverInfo.getDhcpConnectVlan().orElse(null);
    if (dhcpServerConnectPoint != null && dhcpConnectVlan != null) {
        serverInterface = interfaceService.getInterfacesByPort(dhcpServerConnectPoint).stream().filter(iface -> Dhcp4HandlerUtil.interfaceContainsVlan(iface, dhcpConnectVlan)).findFirst().orElse(null);
    } else {
        log.warn("DHCP server {} not resolve yet connectPoint {} vlan {}", serverInfo.getDhcpServerIp6(), dhcpServerConnectPoint, dhcpConnectVlan);
    }
    return serverInterface;
}
Also used : DeviceService(org.onosproject.net.device.DeviceService) DefaultTrafficTreatment(org.onosproject.net.flow.DefaultTrafficTreatment) ConnectPoint(org.onosproject.net.ConnectPoint) ObjectiveError(org.onosproject.net.flowobjective.ObjectiveError) OptionCode_END(org.onlab.packet.DHCP.DHCPOptionCode.OptionCode_END) IgnoreDhcpConfig(org.onosproject.dhcprelay.config.IgnoreDhcpConfig) Port(org.onosproject.net.Port) ApplicationId(org.onosproject.core.ApplicationId) DhcpRelayStore(org.onosproject.dhcprelay.store.DhcpRelayStore) Ip4Address(org.onlab.packet.Ip4Address) Deactivate(org.osgi.service.component.annotations.Deactivate) OptionCode_MessageType(org.onlab.packet.DHCP.DHCPOptionCode.OptionCode_MessageType) Set(java.util.Set) MacAddress.valueOf(org.onlab.packet.MacAddress.valueOf) PacketService(org.onosproject.net.packet.PacketService) DhcpServerConfig(org.onosproject.dhcprelay.config.DhcpServerConfig) DeviceId(org.onosproject.net.DeviceId) LEARN_ROUTE_FROM_LEASE_QUERY_DEFAULT(org.onosproject.dhcprelay.OsgiPropertyConstants.LEARN_ROUTE_FROM_LEASE_QUERY_DEFAULT) Dictionary(java.util.Dictionary) CopyOnWriteArrayList(java.util.concurrent.CopyOnWriteArrayList) Pipeliner(org.onosproject.net.behaviour.Pipeliner) REMOVE(org.onosproject.net.flowobjective.Objective.Operation.REMOVE) HostProviderRegistry(org.onosproject.net.host.HostProviderRegistry) Tools(org.onlab.util.Tools) Host(org.onosproject.net.Host) RouteStore(org.onosproject.routeservice.RouteStore) ComponentContext(org.osgi.service.component.ComponentContext) LEARN_ROUTE_FROM_LEASE_QUERY(org.onosproject.dhcprelay.OsgiPropertyConstants.LEARN_ROUTE_FROM_LEASE_QUERY) HostListener(org.onosproject.net.host.HostListener) InterfaceService(org.onosproject.net.intf.InterfaceService) HostService(org.onosproject.net.host.HostService) Multimaps(com.google.common.collect.Multimaps) ArrayList(java.util.ArrayList) Component(org.osgi.service.component.annotations.Component) Lists(com.google.common.collect.Lists) TrafficSelector(org.onosproject.net.flow.TrafficSelector) CIRCUIT_ID(org.onlab.packet.dhcp.DhcpRelayAgentOption.RelayAgentInfoOptions.CIRCUIT_ID) OptionCode_CircuitID(org.onlab.packet.DHCP.DHCPOptionCode.OptionCode_CircuitID) CircuitId(org.onlab.packet.dhcp.CircuitId) DhcpRelayAgentOption(org.onlab.packet.dhcp.DhcpRelayAgentOption) DefaultTrafficSelector(org.onosproject.net.flow.DefaultTrafficSelector) TpPort(org.onlab.packet.TpPort) ComponentConfigService(org.onosproject.cfg.ComponentConfigService) BasePacket(org.onlab.packet.BasePacket) Executor(java.util.concurrent.Executor) HostProvider(org.onosproject.net.host.HostProvider) VlanId(org.onlab.packet.VlanId) ProviderId(org.onosproject.net.provider.ProviderId) IPv4(org.onlab.packet.IPv4) DhcpRecord(org.onosproject.dhcprelay.store.DhcpRecord) Objective(org.onosproject.net.flowobjective.Objective) MacAddress(org.onlab.packet.MacAddress) DHCP(org.onlab.packet.DHCP) DefaultOutboundPacket(org.onosproject.net.packet.DefaultOutboundPacket) Route(org.onosproject.routeservice.Route) HostLocation(org.onosproject.net.HostLocation) Interface(org.onosproject.net.intf.Interface) CoreService(org.onosproject.core.CoreService) LoggerFactory(org.slf4j.LoggerFactory) Tools.groupedThreads(org.onlab.util.Tools.groupedThreads) ForwardingObjective(org.onosproject.net.flowobjective.ForwardingObjective) ByteBuffer(java.nio.ByteBuffer) Ethernet(org.onlab.packet.Ethernet) HostProviderService(org.onosproject.net.host.HostProviderService) HashMultimap(com.google.common.collect.HashMultimap) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) DhcpServerInfo(org.onosproject.dhcprelay.api.DhcpServerInfo) ImmutableSet(com.google.common.collect.ImmutableSet) Device(org.onosproject.net.Device) Collection(java.util.Collection) Executors.newSingleThreadExecutor(java.util.concurrent.Executors.newSingleThreadExecutor) DefaultForwardingObjective(org.onosproject.net.flowobjective.DefaultForwardingObjective) InterfaceIpAddress(org.onosproject.net.host.InterfaceIpAddress) Collectors(java.util.stream.Collectors) Sets(com.google.common.collect.Sets) Preconditions.checkState(com.google.common.base.Preconditions.checkState) List(java.util.List) ObjectiveContext(org.onosproject.net.flowobjective.ObjectiveContext) PacketContext(org.onosproject.net.packet.PacketContext) Optional(java.util.Optional) HostDescription(org.onosproject.net.host.HostDescription) ADD(org.onosproject.net.flowobjective.Objective.Operation.ADD) Multimap(com.google.common.collect.Multimap) FlowObjectiveService(org.onosproject.net.flowobjective.FlowObjectiveService) DefaultHostDescription(org.onosproject.net.host.DefaultHostDescription) OutboundPacket(org.onosproject.net.packet.OutboundPacket) HostEvent(org.onosproject.net.host.HostEvent) Activate(org.osgi.service.component.annotations.Activate) HostId(org.onosproject.net.HostId) IpAddress(org.onlab.packet.IpAddress) TrafficTreatment(org.onosproject.net.flow.TrafficTreatment) Logger(org.slf4j.Logger) Preconditions.checkNotNull(com.google.common.base.Preconditions.checkNotNull) UDP(org.onlab.packet.UDP) DhcpHandler(org.onosproject.dhcprelay.api.DhcpHandler) DhcpOption(org.onlab.packet.dhcp.DhcpOption) ReferenceCardinality(org.osgi.service.component.annotations.ReferenceCardinality) Modified(org.osgi.service.component.annotations.Modified) PacketPriority(org.onosproject.net.packet.PacketPriority) Reference(org.osgi.service.component.annotations.Reference) Collections(java.util.Collections) ConnectPoint(org.onosproject.net.ConnectPoint) Interface(org.onosproject.net.intf.Interface) VlanId(org.onlab.packet.VlanId)

Example 18 with DhcpServerInfo

use of org.onosproject.dhcprelay.api.DhcpServerInfo in project onos by opennetworkinglab.

the class Dhcp4HandlerImpl method processDhcpPacketFromServer.

/**
 * Build the DHCP offer/ack with proper client port.
 *
 * @param ethernetPacket the original packet comes from server
 * @return new packet which will send to the client
 */
private InternalPacket processDhcpPacketFromServer(PacketContext context, Ethernet ethernetPacket) {
    // get dhcp header.
    Ethernet etherReply = (Ethernet) ethernetPacket.clone();
    IPv4 ipv4Packet = (IPv4) etherReply.getPayload();
    UDP udpPacket = (UDP) ipv4Packet.getPayload();
    DHCP dhcpPayload = (DHCP) udpPacket.getPayload();
    // determine the vlanId of the client host - note that this vlan id
    // could be different from the vlan in the packet from the server
    Interface clientInterface = getClientInterface(ethernetPacket, dhcpPayload).orElse(null);
    if (clientInterface == null) {
        log.warn("Cannot find the interface for the DHCP {}", dhcpPayload);
        return null;
    }
    VlanId vlanId;
    ConnectPoint inPort = context.inPacket().receivedFrom();
    boolean directConnFlag = directlyConnected(dhcpPayload);
    DhcpServerInfo foundServerInfo = findServerInfoFromServer(directConnFlag, inPort);
    if (foundServerInfo == null) {
        log.warn("Cannot find server info for {} server, inPort {}", directConnFlag ? "direct" : "indirect", inPort);
        return null;
    } else {
        if (Dhcp4HandlerUtil.isServerIpEmpty(foundServerInfo)) {
            log.warn("Cannot find server info's ipaddress");
            return null;
        }
    }
    if (clientInterface.vlanTagged().isEmpty()) {
        vlanId = clientInterface.vlan();
    } else {
        // might be multiple vlan in same interface
        vlanId = getVlanIdFromRelayAgentOption(dhcpPayload);
    }
    if (vlanId == null) {
        vlanId = VlanId.NONE;
    }
    etherReply.setVlanID(vlanId.toShort());
    etherReply.setSourceMACAddress(clientInterface.mac());
    if (!directlyConnected(dhcpPayload)) {
        // if client is indirectly connected, try use next hop mac address
        MacAddress macAddress = MacAddress.valueOf(dhcpPayload.getClientHardwareAddress());
        HostId hostId = HostId.hostId(macAddress, vlanId);
        if (((int) dhcpPayload.getFlags() & 0x8000) == 0x0000) {
            DhcpRecord record = dhcpRelayStore.getDhcpRecord(hostId).orElse(null);
            if (record != null) {
                // if next hop can be found, use mac address of next hop
                record.nextHop().ifPresent(etherReply::setDestinationMACAddress);
            } else {
                // otherwise, discard the packet
                log.warn("Can't find record for host id {}, discard packet", hostId);
                return null;
            }
        } else {
            etherReply.setDestinationMACAddress(MacAddress.BROADCAST);
        }
    } else {
        etherReply.setDestinationMACAddress(dhcpPayload.getClientHardwareAddress());
    }
    Ip4Address ipFacingClient = getFirstIpFromInterface(clientInterface);
    if (directlyConnected(dhcpPayload)) {
        // figure out the relay agent IP corresponding to the original request
        if (ipFacingClient == null) {
            log.warn("Cannot determine relay agent interface Ipv4 addr for host {}/{}. " + "Aborting relay for dhcp packet from server {}", etherReply.getDestinationMAC(), clientInterface.vlan(), ethernetPacket);
            return null;
        }
        // SRC_IP: IP facing client
        ipv4Packet.setSourceAddress(ipFacingClient.toInt());
    } else {
        // Get the IP address of the relay agent
        Ip4Address relayAgentIp = foundServerInfo.getRelayAgentIp4(clientInterface.connectPoint().deviceId()).orElse(null);
        if (relayAgentIp == null) {
            if (ipFacingClient == null) {
                log.warn("Cannot determine relay agent interface Ipv4 addr for host {}/{}. " + "Aborting relay for dhcp packet from server for indirect host {}", etherReply.getDestinationMAC(), clientInterface.vlan(), ethernetPacket);
                return null;
            } else {
                // SRC_IP: IP facing client
                ipv4Packet.setSourceAddress(ipFacingClient.toInt());
            }
        } else {
            // SRC_IP: relay agent IP
            ipv4Packet.setSourceAddress(relayAgentIp.toInt());
        }
    }
    // DST_IP: offered IP
    if (((int) dhcpPayload.getFlags() & 0x8000) == 0x0000) {
        ipv4Packet.setDestinationAddress(dhcpPayload.getYourIPAddress());
    } else {
        ipv4Packet.setDestinationAddress(BROADCAST_IP);
    }
    udpPacket.setSourcePort(UDP.DHCP_SERVER_PORT);
    if (directlyConnected(dhcpPayload)) {
        udpPacket.setDestinationPort(UDP.DHCP_CLIENT_PORT);
    } else {
        // TODO Implement component config to support for both L2 and L3 relay
        // L2 relay expects destination port to be CLIENT_PORT while L3 relay expects SERVER_PORT
        // Currently we only support L2 relay for DHCPv4
        udpPacket.setDestinationPort(UDP.DHCP_CLIENT_PORT);
    }
    udpPacket.setPayload(dhcpPayload);
    ipv4Packet.setPayload(udpPacket);
    etherReply.setPayload(ipv4Packet);
    return InternalPacket.internalPacket(etherReply, clientInterface.connectPoint());
}
Also used : UDP(org.onlab.packet.UDP) IPv4(org.onlab.packet.IPv4) Ip4Address(org.onlab.packet.Ip4Address) DhcpRecord(org.onosproject.dhcprelay.store.DhcpRecord) MacAddress(org.onlab.packet.MacAddress) HostId(org.onosproject.net.HostId) ConnectPoint(org.onosproject.net.ConnectPoint) DHCP(org.onlab.packet.DHCP) Ethernet(org.onlab.packet.Ethernet) Interface(org.onosproject.net.intf.Interface) VlanId(org.onlab.packet.VlanId) DhcpServerInfo(org.onosproject.dhcprelay.api.DhcpServerInfo)

Example 19 with DhcpServerInfo

use of org.onosproject.dhcprelay.api.DhcpServerInfo in project onos by opennetworkinglab.

the class Dhcp4HandlerImpl method processLeaseQueryFromAgent.

/**
 * Do a basic routing for a packet from client (used for LQ processing).
 *
 * @param context the packet context
 * @param ethernetPacket the ethernet payload to process
 * @return processed packet
 */
private List<InternalPacket> processLeaseQueryFromAgent(PacketContext context, Ethernet ethernetPacket) {
    ConnectPoint receivedFrom = context.inPacket().receivedFrom();
    DeviceId receivedFromDevice = receivedFrom.deviceId();
    // get dhcp header.
    Ethernet etherReply = (Ethernet) ethernetPacket.clone();
    IPv4 ipv4Packet = (IPv4) etherReply.getPayload();
    UDP udpPacket = (UDP) ipv4Packet.getPayload();
    DHCP dhcpPacket = (DHCP) udpPacket.getPayload();
    Ip4Address relayAgentIp;
    Ip4Address clientInterfaceIp = interfaceService.getInterfacesByPort(context.inPacket().receivedFrom()).stream().map(Interface::ipAddressesList).flatMap(Collection::stream).map(InterfaceIpAddress::ipAddress).filter(IpAddress::isIp4).map(IpAddress::getIp4Address).findFirst().orElse(null);
    if (clientInterfaceIp == null) {
        log.warn("Can't find interface IP for client interface for port {}", context.inPacket().receivedFrom());
        return null;
    }
    boolean isDirectlyConnected = directlyConnected(dhcpPacket);
    boolean directConnFlag = directlyConnected(dhcpPacket);
    // Multi DHCP Start
    List<InternalPacket> internalPackets = new ArrayList<>();
    List<DhcpServerInfo> serverInfoList = findValidServerInfo(directConnFlag);
    List<DhcpServerInfo> copyServerInfoList = new ArrayList<>(serverInfoList);
    for (DhcpServerInfo serverInfo : copyServerInfoList) {
        // get dhcp header.
        etherReply = (Ethernet) ethernetPacket.clone();
        ipv4Packet = (IPv4) etherReply.getPayload();
        udpPacket = (UDP) ipv4Packet.getPayload();
        dhcpPacket = (DHCP) udpPacket.getPayload();
        if (!checkDhcpServerConnPt(directConnFlag, serverInfo)) {
            log.warn("Can't get server connect point, ignore");
            continue;
        }
        DhcpServerInfo newServerInfo = getHostInfoForServerInfo(serverInfo, serverInfoList);
        if (newServerInfo == null) {
            log.warn("Can't get server interface with host info resolved, ignore");
            continue;
        }
        Interface serverInterface = getServerInterface(newServerInfo);
        if (serverInterface == null) {
            log.warn("Can't get server interface, ignore");
            continue;
        }
        Ip4Address ipFacingServer = getFirstIpFromInterface(serverInterface);
        MacAddress macFacingServer = serverInterface.mac();
        if (ipFacingServer == null || macFacingServer == null) {
            log.warn("No IP address for server Interface {}", serverInterface);
            continue;
        }
        etherReply.setSourceMACAddress(macFacingServer);
        etherReply.setDestinationMACAddress(newServerInfo.getDhcpConnectMac().get());
        etherReply.setVlanID(newServerInfo.getDhcpConnectVlan().get().toShort());
        ipv4Packet.setSourceAddress(ipFacingServer.toInt());
        ipv4Packet.setDestinationAddress(newServerInfo.getDhcpServerIp4().get().toInt());
        if (isDirectlyConnected) {
            // set default info and replace with indirect if available later on.
            if (newServerInfo.getDhcpConnectMac().isPresent()) {
                etherReply.setDestinationMACAddress(newServerInfo.getDhcpConnectMac().get());
            }
            if (newServerInfo.getDhcpConnectVlan().isPresent()) {
                etherReply.setVlanID(serverInfo.getDhcpConnectVlan().get().toShort());
            }
            if (learnRouteFromLeasequery) {
                relayAgentIp = newServerInfo.getRelayAgentIp4(receivedFromDevice).orElse(null);
                // Sets relay agent IP
                int effectiveRelayAgentIp = relayAgentIp != null ? relayAgentIp.toInt() : clientInterfaceIp.toInt();
                dhcpPacket.setGatewayIPAddress(effectiveRelayAgentIp);
            }
        } else {
            if (!newServerInfo.getDhcpServerIp4().isPresent()) {
            // do nothing
            } else if (!newServerInfo.getDhcpConnectMac().isPresent()) {
                continue;
            } else if (learnRouteFromLeasequery) {
                relayAgentIp = newServerInfo.getRelayAgentIp4(receivedFromDevice).orElse(null);
                // Sets relay agent IP
                int effectiveRelayAgentIp = relayAgentIp != null ? relayAgentIp.toInt() : clientInterfaceIp.toInt();
                dhcpPacket.setGatewayIPAddress(effectiveRelayAgentIp);
                log.debug("Relay Agent IP {}", relayAgentIp);
            }
            log.trace("Indirect");
        }
        // Remove broadcast flag
        dhcpPacket.setFlags((short) 0);
        udpPacket.setPayload(dhcpPacket);
        // As a DHCP relay, the source port should be server port( instead
        // of client port.
        udpPacket.setSourcePort(UDP.DHCP_SERVER_PORT);
        udpPacket.setDestinationPort(UDP.DHCP_SERVER_PORT);
        ipv4Packet.setPayload(udpPacket);
        ipv4Packet.setTtl((byte) 64);
        etherReply.setPayload(ipv4Packet);
        udpPacket.resetChecksum();
        // //return etherReply;
        InternalPacket internalPacket = InternalPacket.internalPacket(etherReply, newServerInfo.getDhcpServerConnectPoint().get());
        internalPackets.add(internalPacket);
    }
    log.debug("num of processLeaseQueryFromAgent packets to send is: {}", internalPackets.size());
    return internalPackets;
}
Also used : UDP(org.onlab.packet.UDP) DeviceId(org.onosproject.net.DeviceId) IPv4(org.onlab.packet.IPv4) Ip4Address(org.onlab.packet.Ip4Address) CopyOnWriteArrayList(java.util.concurrent.CopyOnWriteArrayList) ArrayList(java.util.ArrayList) MacAddress(org.onlab.packet.MacAddress) ConnectPoint(org.onosproject.net.ConnectPoint) DHCP(org.onlab.packet.DHCP) ConnectPoint(org.onosproject.net.ConnectPoint) Ethernet(org.onlab.packet.Ethernet) InterfaceIpAddress(org.onosproject.net.host.InterfaceIpAddress) IpAddress(org.onlab.packet.IpAddress) Interface(org.onosproject.net.intf.Interface) InterfaceIpAddress(org.onosproject.net.host.InterfaceIpAddress) DhcpServerInfo(org.onosproject.dhcprelay.api.DhcpServerInfo)

Example 20 with DhcpServerInfo

use of org.onosproject.dhcprelay.api.DhcpServerInfo in project onos by opennetworkinglab.

the class Dhcp6HandlerImpl method getHostInfoForServerInfo.

/**
 * Checks if serverInfo's host info (mac and vlan) is filled in; if not, fills in.
 *
 * @param serverInfo server information
 * @return newServerInfo if host info can be either found or filled in.
 */
private DhcpServerInfo getHostInfoForServerInfo(DhcpServerInfo serverInfo, List<DhcpServerInfo> sererInfoList) {
    DhcpServerInfo newServerInfo = null;
    MacAddress dhcpServerConnectMac = serverInfo.getDhcpConnectMac().orElse(null);
    VlanId dhcpConnectVlan = serverInfo.getDhcpConnectVlan().orElse(null);
    ConnectPoint dhcpServerConnectPoint = serverInfo.getDhcpServerConnectPoint().orElse(null);
    if (dhcpServerConnectMac != null && dhcpConnectVlan != null) {
        newServerInfo = serverInfo;
        log.debug("DHCP server {} host info found. ConnectPt{}  Mac {} vlan {}", serverInfo.getDhcpServerIp6(), dhcpServerConnectPoint, dhcpServerConnectMac, dhcpConnectVlan);
    } else {
        log.debug("DHCP server {} not resolve yet connectPt {} mac {} vlan {}", serverInfo.getDhcpServerIp6(), dhcpServerConnectPoint, dhcpServerConnectMac, dhcpConnectVlan);
        Ip6Address ipToProbe;
        if (serverInfo.getDhcpGatewayIp6().isPresent()) {
            ipToProbe = serverInfo.getDhcpGatewayIp6().get();
        } else {
            ipToProbe = serverInfo.getDhcpServerIp6().orElse(null);
        }
        String hostToProbe = serverInfo.getDhcpGatewayIp6().map(ip -> "gateway").orElse("server");
        log.debug("Dynamically probing to resolve {} IP {}", hostToProbe, ipToProbe);
        hostService.startMonitoringIp(ipToProbe);
        Set<Host> hosts = hostService.getHostsByIp(ipToProbe);
        if (!hosts.isEmpty()) {
            int serverInfoIndex = sererInfoList.indexOf(serverInfo);
            Host host = hosts.iterator().next();
            serverInfo.setDhcpConnectVlan(host.vlan());
            serverInfo.setDhcpConnectMac(host.mac());
            // replace the serverInfo in the list
            sererInfoList.set(serverInfoIndex, serverInfo);
            newServerInfo = serverInfo;
            log.warn("Dynamically host found host {}", host);
        } else {
            log.debug("No host found host ip {} dynamically", ipToProbe);
        }
    }
    return newServerInfo;
}
Also used : Dhcp6IaPdOption(org.onlab.packet.dhcp.Dhcp6IaPdOption) DeviceService(org.onosproject.net.device.DeviceService) DefaultTrafficTreatment(org.onosproject.net.flow.DefaultTrafficTreatment) ConnectPoint(org.onosproject.net.ConnectPoint) ObjectiveError(org.onosproject.net.flowobjective.ObjectiveError) IgnoreDhcpConfig(org.onosproject.dhcprelay.config.IgnoreDhcpConfig) ApplicationId(org.onosproject.core.ApplicationId) Dhcp6IaNaOption(org.onlab.packet.dhcp.Dhcp6IaNaOption) Dhcp6IaTaOption(org.onlab.packet.dhcp.Dhcp6IaTaOption) Ip6Address(org.onlab.packet.Ip6Address) DhcpRelayStore(org.onosproject.dhcprelay.store.DhcpRelayStore) Deactivate(org.osgi.service.component.annotations.Deactivate) Set(java.util.Set) MsgType(org.onlab.packet.DHCP6.MsgType) PacketService(org.onosproject.net.packet.PacketService) DeviceId(org.onosproject.net.DeviceId) DhcpServerConfig(org.onosproject.dhcprelay.config.DhcpServerConfig) LEARN_ROUTE_FROM_LEASE_QUERY_DEFAULT(org.onosproject.dhcprelay.OsgiPropertyConstants.LEARN_ROUTE_FROM_LEASE_QUERY_DEFAULT) Dictionary(java.util.Dictionary) CopyOnWriteArrayList(java.util.concurrent.CopyOnWriteArrayList) Pipeliner(org.onosproject.net.behaviour.Pipeliner) REMOVE(org.onosproject.net.flowobjective.Objective.Operation.REMOVE) DhcpFpmPrefixStore(org.onosproject.dhcprelay.store.DhcpFpmPrefixStore) HostProviderRegistry(org.onosproject.net.host.HostProviderRegistry) Tools(org.onlab.util.Tools) RouteStore(org.onosproject.routeservice.RouteStore) Host(org.onosproject.net.Host) ComponentContext(org.osgi.service.component.ComponentContext) LEARN_ROUTE_FROM_LEASE_QUERY(org.onosproject.dhcprelay.OsgiPropertyConstants.LEARN_ROUTE_FROM_LEASE_QUERY) HostListener(org.onosproject.net.host.HostListener) InterfaceService(org.onosproject.net.intf.InterfaceService) HostService(org.onosproject.net.host.HostService) Multimaps(com.google.common.collect.Multimaps) ArrayList(java.util.ArrayList) Dhcp6InterfaceIdOption(org.onlab.packet.dhcp.Dhcp6InterfaceIdOption) Component(org.osgi.service.component.annotations.Component) Lists(com.google.common.collect.Lists) TrafficSelector(org.onosproject.net.flow.TrafficSelector) FpmRecord(org.onosproject.routing.fpm.api.FpmRecord) Dhcp6LeaseQueryOption(org.onlab.packet.dhcp.Dhcp6LeaseQueryOption) DefaultTrafficSelector(org.onosproject.net.flow.DefaultTrafficSelector) TpPort(org.onlab.packet.TpPort) ComponentConfigService(org.onosproject.cfg.ComponentConfigService) BasePacket(org.onlab.packet.BasePacket) Executor(java.util.concurrent.Executor) HostProvider(org.onosproject.net.host.HostProvider) VlanId(org.onlab.packet.VlanId) ProviderId(org.onosproject.net.provider.ProviderId) Dhcp6IaAddressOption(org.onlab.packet.dhcp.Dhcp6IaAddressOption) IPv6(org.onlab.packet.IPv6) DHCP6(org.onlab.packet.DHCP6) HexString(org.onlab.util.HexString) DhcpRecord(org.onosproject.dhcprelay.store.DhcpRecord) Objective(org.onosproject.net.flowobjective.Objective) MacAddress(org.onlab.packet.MacAddress) Dhcp6Duid(org.onlab.packet.dhcp.Dhcp6Duid) DefaultOutboundPacket(org.onosproject.net.packet.DefaultOutboundPacket) Route(org.onosproject.routeservice.Route) HostLocation(org.onosproject.net.HostLocation) Interface(org.onosproject.net.intf.Interface) CoreService(org.onosproject.core.CoreService) LoggerFactory(org.slf4j.LoggerFactory) Tools.groupedThreads(org.onlab.util.Tools.groupedThreads) ForwardingObjective(org.onosproject.net.flowobjective.ForwardingObjective) Dhcp6ClientIdOption(org.onlab.packet.dhcp.Dhcp6ClientIdOption) ByteBuffer(java.nio.ByteBuffer) Ethernet(org.onlab.packet.Ethernet) HostProviderService(org.onosproject.net.host.HostProviderService) HashMultimap(com.google.common.collect.HashMultimap) Dhcp6IaPrefixOption(org.onlab.packet.dhcp.Dhcp6IaPrefixOption) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) DhcpServerInfo(org.onosproject.dhcprelay.api.DhcpServerInfo) ImmutableSet(com.google.common.collect.ImmutableSet) Device(org.onosproject.net.Device) Collection(java.util.Collection) Executors.newSingleThreadExecutor(java.util.concurrent.Executors.newSingleThreadExecutor) DefaultForwardingObjective(org.onosproject.net.flowobjective.DefaultForwardingObjective) Sets(com.google.common.collect.Sets) Preconditions.checkState(com.google.common.base.Preconditions.checkState) List(java.util.List) ObjectiveContext(org.onosproject.net.flowobjective.ObjectiveContext) PacketContext(org.onosproject.net.packet.PacketContext) Optional(java.util.Optional) HostDescription(org.onosproject.net.host.HostDescription) IpPrefix(org.onlab.packet.IpPrefix) Dhcp6ClientDataOption(org.onlab.packet.dhcp.Dhcp6ClientDataOption) ADD(org.onosproject.net.flowobjective.Objective.Operation.ADD) Multimap(com.google.common.collect.Multimap) Dhcp6RelayOption(org.onlab.packet.dhcp.Dhcp6RelayOption) DhcpRelayCountersStore(org.onosproject.dhcprelay.store.DhcpRelayCountersStore) FlowObjectiveService(org.onosproject.net.flowobjective.FlowObjectiveService) DefaultHostDescription(org.onosproject.net.host.DefaultHostDescription) OutboundPacket(org.onosproject.net.packet.OutboundPacket) Activate(org.osgi.service.component.annotations.Activate) HostEvent(org.onosproject.net.host.HostEvent) HostId(org.onosproject.net.HostId) IpAddress(org.onlab.packet.IpAddress) TrafficTreatment(org.onosproject.net.flow.TrafficTreatment) Logger(org.slf4j.Logger) Semaphore(java.util.concurrent.Semaphore) Preconditions.checkNotNull(com.google.common.base.Preconditions.checkNotNull) Dhcp6Option(org.onlab.packet.dhcp.Dhcp6Option) UDP(org.onlab.packet.UDP) DhcpHandler(org.onosproject.dhcprelay.api.DhcpHandler) ReferenceCardinality(org.osgi.service.component.annotations.ReferenceCardinality) Modified(org.osgi.service.component.annotations.Modified) PacketPriority(org.onosproject.net.packet.PacketPriority) Reference(org.osgi.service.component.annotations.Reference) Ip6Address(org.onlab.packet.Ip6Address) Host(org.onosproject.net.Host) HexString(org.onlab.util.HexString) MacAddress(org.onlab.packet.MacAddress) ConnectPoint(org.onosproject.net.ConnectPoint) DhcpServerInfo(org.onosproject.dhcprelay.api.DhcpServerInfo) VlanId(org.onlab.packet.VlanId) ConnectPoint(org.onosproject.net.ConnectPoint)

Aggregations

DhcpServerInfo (org.onosproject.dhcprelay.api.DhcpServerInfo)22 ConnectPoint (org.onosproject.net.ConnectPoint)16 Ethernet (org.onlab.packet.Ethernet)14 VlanId (org.onlab.packet.VlanId)14 Interface (org.onosproject.net.intf.Interface)14 ArrayList (java.util.ArrayList)13 MacAddress (org.onlab.packet.MacAddress)13 UDP (org.onlab.packet.UDP)13 CopyOnWriteArrayList (java.util.concurrent.CopyOnWriteArrayList)12 IpAddress (org.onlab.packet.IpAddress)12 DhcpRecord (org.onosproject.dhcprelay.store.DhcpRecord)12 List (java.util.List)11 DeviceId (org.onosproject.net.DeviceId)11 Preconditions.checkNotNull (com.google.common.base.Preconditions.checkNotNull)10 Collection (java.util.Collection)10 Optional (java.util.Optional)10 Set (java.util.Set)10 BasePacket (org.onlab.packet.BasePacket)10 Tools (org.onlab.util.Tools)10 Preconditions.checkState (com.google.common.base.Preconditions.checkState)9