Jonathan Hart | 0961fe8 | 2014-04-03 09:56:25 -0700 | [diff] [blame] | 1 | package net.onrc.onos.apps.proxyarp; |
Jonathan Hart | 6261dcd | 2013-07-22 17:58:35 +1200 | [diff] [blame] | 2 | |
| 3 | import java.net.InetAddress; |
Jonathan Hart | 5afde49 | 2013-10-01 12:30:53 +1300 | [diff] [blame] | 4 | import java.util.List; |
Jonathan Hart | 6261dcd | 2013-07-22 17:58:35 +1200 | [diff] [blame] | 5 | |
Jonathan Hart | e93aed4 | 2013-12-05 18:39:50 -0800 | [diff] [blame] | 6 | import net.floodlightcontroller.core.module.IFloodlightService; |
Jonathan Hart | abad6a5 | 2013-09-30 18:17:21 +1300 | [diff] [blame] | 7 | import net.floodlightcontroller.util.MACAddress; |
Jonathan Hart | 6261dcd | 2013-07-22 17:58:35 +1200 | [diff] [blame] | 8 | |
Jonathan Hart | 7c9a2fb | 2014-03-27 09:51:41 -0700 | [diff] [blame] | 9 | // Extends IFloodlightService so we can access it from REST API resources |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 10 | |
Jonathan Hart | 7c9a2fb | 2014-03-27 09:51:41 -0700 | [diff] [blame] | 11 | /** |
| 12 | * Provides ARP services to other modules. |
| 13 | */ |
Jonathan Hart | e93aed4 | 2013-12-05 18:39:50 -0800 | [diff] [blame] | 14 | public interface IProxyArpService extends IFloodlightService { |
Jonathan Hart | 7c9a2fb | 2014-03-27 09:51:41 -0700 | [diff] [blame] | 15 | /** |
| 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 Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 21 | * no mapping is found |
Jonathan Hart | 7c9a2fb | 2014-03-27 09:51:41 -0700 | [diff] [blame] | 22 | */ |
| 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 Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 32 | * @param retry whether to keep sending requests until the MAC is learnt |
Jonathan Hart | 7c9a2fb | 2014-03-27 09:51:41 -0700 | [diff] [blame] | 33 | */ |
| 34 | public void sendArpRequest(InetAddress ipAddress, IArpRequester requester, |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 35 | boolean retry); |
Jonathan Hart | 7c9a2fb | 2014-03-27 09:51:41 -0700 | [diff] [blame] | 36 | |
| 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 Hart | 6261dcd | 2013-07-22 17:58:35 +1200 | [diff] [blame] | 43 | } |