blob: 57993e58c4fa27316f4d2215cba79af8a7d288f4 [file] [log] [blame]
Jonathan Hart6261dcd2013-07-22 17:58:35 +12001package net.onrc.onos.ofcontroller.proxyarp;
2
3import java.net.InetAddress;
Jonathan Hart5afde492013-10-01 12:30:53 +13004import java.util.List;
Jonathan Hart6261dcd2013-07-22 17:58:35 +12005
Jonathan Harte93aed42013-12-05 18:39:50 -08006import net.floodlightcontroller.core.module.IFloodlightService;
Jonathan Hartabad6a52013-09-30 18:17:21 +13007import net.floodlightcontroller.util.MACAddress;
Jonathan Hart6261dcd2013-07-22 17:58:35 +12008
Jonathan Hart7c9a2fb2014-03-27 09:51:41 -07009// Extends IFloodlightService so we can access it from REST API resources
10/**
11 * Provides ARP services to other modules.
12 */
Jonathan Harte93aed42013-12-05 18:39:50 -080013public interface IProxyArpService extends IFloodlightService {
Jonathan Hart7c9a2fb2014-03-27 09:51:41 -070014 /**
15 * Returns the MAC address if there is a valid entry in the cache. Otherwise
16 * returns null.
17 *
18 * @param ipAddress the IP address to request the ARP mapping for
19 * @return the MACAddress that maps to the specified IP address, or null if
20 * no mapping is found
21 */
22 public MACAddress getMacAddress(InetAddress ipAddress);
23
24 /**
25 * Tell the IProxyArpService to send an ARP request for the IP address. The
26 * request will be broadcast out all edge ports in the network.
27 *
28 * @param ipAddress the IP address to send an ARP request for
29 * @param requester the {@link IArpRequester} object that will be called if
30 * a reply is received
31 * @param retry whether to keep sending requests until the MAC is learnt
32 */
33 public void sendArpRequest(InetAddress ipAddress, IArpRequester requester,
34 boolean retry);
35
36 /**
37 * Returns a snapshot of the entire ARP cache.
38 *
39 * @return a list of mappings formatted as a human-readable string
40 */
41 public List<String> getMappings();
Jonathan Hart6261dcd2013-07-22 17:58:35 +120042}