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.
36 * IP address and Mac Address combination encapsulated in IHostId
38 * @return {@link org.opendaylight.controller.hosttracker.hostAware.HostNodeConnector}
39 * Class that contains the Host info such as its MAC address, Switch
40 * ID, port, VLAN. If Host is not found, returns NULL
42 public HostNodeConnector hostFind(IHostId id);
45 * Applications call this interface methods to determine IP address to MAC
46 * binding and its connectivity to an OpenFlow switch in term of Node, Port,
47 * and VLAN. These bindings are learned dynamically as well as can be added
48 * statically through Northbound APIs. If a binding is unknown, then an ARP
49 * request is initiated immediately to discover the host.
52 * IP address of the host
53 * @return {@link org.opendaylight.controller.hosttracker.hostAware.HostNodeConnector}
54 * Class that contains the Host info such as its MAC address, Switch
55 * ID, port, VLAN. If Host is not found, returns NULL
57 public HostNodeConnector hostFind(InetAddress addr);
60 * Checks the local Host Database to see if a Host has been learned for a
61 * given IP address and Mac combination using the HostId.
64 * IP address and Mac Address combination encapsulated in IHostId
66 * @return {@link org.opendaylight.controller.hosttracker.hostAware.HostNodeConnector}
67 * Class that contains the Host info such as its MAC address, Switch
68 * ID, port, VLAN. If Host is not found, returns NULL
71 public HostNodeConnector hostQuery(IHostId id);
74 * Checks the local Host Database to see if a Host has been learned for a
75 * given IP address and Mac combination using the HostId.
78 * IP address of the Host
79 * @return {@link org.opendaylight.controller.hosttracker.hostAware.HostNodeConnector}
80 * Class that contains the Host info such as its MAC address, Switch
81 * ID, port, VLAN. If Host is not found, returns NULL
84 public HostNodeConnector hostQuery(InetAddress addr);
87 * Initiates an immediate discovery of the Host for a given Host id. This
88 * provides for the calling applications to block on the host discovery.
91 * IP address and Mac Address combination encapsulated in IHostId
94 * {@link org.opendaylight.controller.hosttracker.HostTrackerCallable}
96 public Future<HostNodeConnector> discoverHost(IHostId id);
99 * Initiates an immediate discovery of the Host for a given Host id. This
100 * provides for the calling applications to block on the host discovery.
103 * IP address of the host
105 * {@link org.opendaylight.controller.hosttracker.HostTrackerCallable}
107 public Future<HostNodeConnector> discoverHost(InetAddress addr);
110 * Returns the Network Hierarchy for a given Host. This API is typically
111 * used by applications like Hadoop for Rack Awareness functionality.
114 * IP address and Mac Address combination encapsulated in IHostId
116 * @return List of String ArrayList containing the Hierarchies.
118 public List<List<String>> getHostNetworkHierarchy(IHostId id);
121 * Returns the Network Hierarchy for a given Host. This API is typically
122 * used by applications like Hadoop for Rack Awareness functionality.
125 * IP address of the host
126 * @return List of String ArrayList containing the Hierarchies.
128 public List<List<String>> getHostNetworkHierarchy(InetAddress addr);
131 * Returns all the the Hosts either learned dynamically or added statically
132 * via Northbound APIs.
135 * {@link org.opendaylight.controller.hosttracker.hostAware.HostNodeConnector}
136 * . Class that contains the Host info such as its MAC address,
137 * Switch ID, port, VLAN.
139 public Set<HostNodeConnector> getAllHosts();
142 * Returns all the "Active Hosts" learned "Statically" via Northbound APIs.
143 * These Hosts are categorized as "Active" because the Switch and Port they
144 * are connected to, are in up state.
147 * {@link org.opendaylight.controller.hosttracker.hostAware.HostNodeConnector}
148 * . Class that contains the Host info such as MAC address, Switch
149 * ID, port, VLAN. If Host is not found, returns NULL
151 public Set<HostNodeConnector> getActiveStaticHosts();
154 * Returns all the "Inactive Hosts" learned "Statically" via Northbound
155 * APIs. These Hosts are categorized as "Inactive" because either the Switch
156 * or the Port they are connected to, is in down state.
158 * @return Set of HostNodeConnector
159 * {@link org.opendaylight.controller.hosttracker.hostAware.HostNodeConnector}
160 * . HostNodeConnector is Class that contains the Host info such as
161 * its MAC address, OpenFlowNode ID, port, VLAN.
163 public Set<HostNodeConnector> getInactiveStaticHosts();
166 * Hosts can be learned dynamically or added statically. This method allows
167 * the addition of a Host to the local database statically.
169 * @param networkAddress
170 * IP Address of the Host
171 * @param dataLayerAddress
172 * MAC Address of the Host
174 * NodeConnector to which the host is attached
176 * VLAN the host belongs to (null or empty for no vlan)
177 * @return The status object as described in {@code Status} indicating the
178 * result of this action.
180 public Status addStaticHost(String networkAddress, String dataLayerAddress, NodeConnector nc, String vlan);
183 * Allows the deletion of statically learned Host
185 * @param networkAddress
186 * @return The status object as described in {@code Status} indicating the
187 * result of this action.
189 public Status removeStaticHost(String networkAddress);
192 * Allows the deletion of statically learned Host
194 * @param networkAddress
196 * @return The status object as described in {@code Status} indicating the
197 * result of this action.
199 public Status removeStaticHostUsingIPAndMac(String networkAddress, String macAddress);