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. |
Jonathan Hart | 6261dcd | 2013-07-22 17:58:35 +1200 | [diff] [blame] | 32 | * @param ipAddress |
| 33 | * @param requester |
Jonathan Hart | 4dfc365 | 2013-08-02 20:22:36 +1200 | [diff] [blame] | 34 | * @param retry Whether to keep sending requests until the MAC is learnt |
Jonathan Hart | 6261dcd | 2013-07-22 17:58:35 +1200 | [diff] [blame] | 35 | * @return |
| 36 | */ |
Jonathan Hart | 4dfc365 | 2013-08-02 20:22:36 +1200 | [diff] [blame] | 37 | public void sendArpRequest(InetAddress ipAddress, IArpRequester requester, |
| 38 | boolean retry); |
Jonathan Hart | 6261dcd | 2013-07-22 17:58:35 +1200 | [diff] [blame] | 39 | } |