2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.controller.hosttracker;
11 import java.net.InetAddress;
12 import java.util.List;
14 import java.util.concurrent.Future;
16 import org.opendaylight.controller.hosttracker.hostAware.HostNodeConnector;
17 import org.opendaylight.controller.sal.core.NodeConnector;
18 import org.opendaylight.controller.sal.utils.Status;
21 * This interface defines the methods to retrieve information about learned
22 * Hosts. Also provides methods to statically add/remove Hosts from the local
27 public interface IfIptoHost {
29 * Applications call this interface methods to determine IP address to MAC
30 * binding and its connectivity to an OpenFlow switch in term of Node, Port,
31 * and VLAN. These bindings are learned dynamically as well as can be added
32 * statically through Northbound APIs. If a binding is unknown, then an ARP
33 * request is initiated immediately to discover the host.
35 * @param networkAddress
36 * IP Address of the Host encapsulated in class InetAddress
37 * @return {@link org.opendaylight.controller.hosttracker.hostAware.HostNodeConnector}
38 * Class that contains the Host info such as its MAC address, Switch
39 * ID, port, VLAN. If Host is not found, returns NULL
41 public HostNodeConnector hostFind(InetAddress networkAddress);
44 * Checks the local Host Database to see if a Host has been learned for a
47 * @param networkAddress
48 * IP Address of the Host encapsulated in class InetAddress
49 * @return {@link org.opendaylight.controller.hosttracker.hostAware.HostNodeConnector}
50 * Class that contains the Host info such as its MAC address, Switch
51 * ID, port, VLAN. If Host is not found, returns NULL
54 public HostNodeConnector hostQuery(InetAddress networkAddress);
57 * Initiates an immediate discovery of the Host for a given IP address. This
58 * provides for the calling applications to block on the host discovery.
60 * @param networkAddress
61 * IP address encapsulated in InetAddress class
63 * {@link org.opendaylight.controller.hosttracker.HostTrackerCallable}
65 public Future<HostNodeConnector> discoverHost(InetAddress networkAddress);
68 * Returns the Network Hierarchy for a given Host. This API is typically
69 * used by applications like Hadoop for Rack Awareness functionality.
72 * address of the Host encapsulated in InetAddress class
73 * @return List of String ArrayList containing the Hierarchies.
75 public List<List<String>> getHostNetworkHierarchy(InetAddress hostAddress);
78 * Returns all the the Hosts either learned dynamically or added statically
79 * via Northbound APIs.
82 * {@link org.opendaylight.controller.hosttracker.hostAware.HostNodeConnector}
83 * . Class that contains the Host info such as its MAC address,
84 * Switch ID, port, VLAN.
86 public Set<HostNodeConnector> getAllHosts();
89 * Returns all the "Active Hosts" learned "Statically" via Northbound APIs.
90 * These Hosts are categorized as "Active" because the Switch and Port they
91 * are connected to, are in up state.
94 * {@link org.opendaylight.controller.hosttracker.hostAware.HostNodeConnector}
95 * . Class that contains the Host info such as MAC address, Switch
96 * ID, port, VLAN. If Host is not found, returns NULL
98 public Set<HostNodeConnector> getActiveStaticHosts();
101 * Returns all the "Inactive Hosts" learned "Statically" via Northbound
102 * APIs. These Hosts are categorized as "Inactive" because either the Switch
103 * or the Port they are connected to, is in down state.
105 * @return Set of HostNodeConnector
106 * {@link org.opendaylight.controller.hosttracker.hostAware.HostNodeConnector}
107 * . HostNodeConnector is Class that contains the Host info such as
108 * its MAC address, OpenFlowNode ID, port, VLAN.
110 public Set<HostNodeConnector> getInactiveStaticHosts();
113 * Hosts can be learned dynamically or added statically. This method allows
114 * the addition of a Host to the local database statically.
116 * @param networkAddress
117 * IP Address of the Host
118 * @param dataLayerAddress
119 * MAC Address of the Host
121 * NodeConnector to which the host is attached
123 * VLAN the host belongs to (null or empty for no vlan)
124 * @return The status object as described in {@code Status} indicating the
125 * result of this action.
127 public Status addStaticHost(String networkAddress, String dataLayerAddress,
128 NodeConnector nc, String vlan);
131 * Allows the deletion of statically learned Host
133 * @param networkAddress
134 * @return The status object as described in {@code Status} indicating the
135 * result of this action.
137 public Status removeStaticHost(String networkAddress);