blob: 7093d3b22495860739ffb379a0a03619efa72c3e [file] [log] [blame]
Jonathan Hart0961fe82014-04-03 09:56:25 -07001package net.onrc.onos.apps.proxyarp;
Jonathan Hart6261dcd2013-07-22 17:58:35 +12002
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
Ray Milkey269ffb92014-04-03 14:43:30 -070010
Jonathan Hart7c9a2fb2014-03-27 09:51:41 -070011/**
12 * Provides ARP services to other modules.
13 */
Jonathan Harte93aed42013-12-05 18:39:50 -080014public interface IProxyArpService extends IFloodlightService {
Jonathan Hart7c9a2fb2014-03-27 09:51:41 -070015 /**
16 * Returns the MAC address if there is a valid entry in the cache. Otherwise
17 * returns null.
18 *
19 * @param ipAddress the IP address to request the ARP mapping for
20 * @return the MACAddress that maps to the specified IP address, or null if
Ray Milkey269ffb92014-04-03 14:43:30 -070021 * no mapping is found
Jonathan Hart7c9a2fb2014-03-27 09:51:41 -070022 */
23 public MACAddress getMacAddress(InetAddress ipAddress);
24
25 /**
26 * Tell the IProxyArpService to send an ARP request for the IP address. The
27 * request will be broadcast out all edge ports in the network.
28 *
29 * @param ipAddress the IP address to send an ARP request for
30 * @param requester the {@link IArpRequester} object that will be called if
31 * a reply is received
Ray Milkey269ffb92014-04-03 14:43:30 -070032 * @param retry whether to keep sending requests until the MAC is learnt
Jonathan Hart7c9a2fb2014-03-27 09:51:41 -070033 */
34 public void sendArpRequest(InetAddress ipAddress, IArpRequester requester,
Ray Milkey269ffb92014-04-03 14:43:30 -070035 boolean retry);
Jonathan Hart7c9a2fb2014-03-27 09:51:41 -070036
37 /**
38 * Returns a snapshot of the entire ARP cache.
39 *
40 * @return a list of mappings formatted as a human-readable string
41 */
42 public List<String> getMappings();
Jonathan Hart6261dcd2013-07-22 17:58:35 +120043}