Jonathan Hart | 6261dcd | 2013-07-22 17:58:35 +1200 | [diff] [blame] | 1 | package net.onrc.onos.ofcontroller.proxyarp; |
| 2 | |
| 3 | import java.net.InetAddress; |
| 4 | |
| 5 | import net.floodlightcontroller.packet.ARP; |
| 6 | |
| 7 | public interface IProxyArpService { |
| 8 | |
| 9 | public final int ARP_REQUEST_TIMEOUT = 2000; //ms |
| 10 | |
| 11 | /** |
| 12 | * Tell the IProxyArpService to send an ARP reply with the targetMac to |
| 13 | * the host on the specified switchport. |
| 14 | * @param arpRequest |
| 15 | * @param dpid |
| 16 | * @param port |
| 17 | * @param targetMac |
| 18 | */ |
| 19 | public void sendArpReply(ARP arpRequest, long dpid, short port, byte[] targetMac); |
| 20 | |
| 21 | /** |
| 22 | * Returns the mac address if there is a valid entry in the cache. |
| 23 | * Otherwise returns null. |
| 24 | * @param ipAddress |
| 25 | * @return |
| 26 | */ |
Jonathan Hart | f0c0dcb | 2013-07-24 15:28:42 +1200 | [diff] [blame] | 27 | public byte[] getMacAddress(InetAddress ipAddress); |
Jonathan Hart | 6261dcd | 2013-07-22 17:58:35 +1200 | [diff] [blame] | 28 | |
| 29 | /** |
| 30 | * Tell the IProxyArpService to send an ARP request for the IP address. |
| 31 | * The request will be broadcast out all edge ports in the network. |
| 32 | * As an optimization, the IProxyArpService will first check its cache and |
| 33 | * return the MAC address if it is already known. If not, the request will be |
| 34 | * sent and the callback will be called when the MAC address is known |
| 35 | * (or if the request times out). |
| 36 | * @param ipAddress |
| 37 | * @param requester |
| 38 | * @return |
| 39 | */ |
| 40 | public byte[] sendArpRequest(InetAddress ipAddress, IArpRequester requester); |
| 41 | } |