blob: 7dde89bd33a9ae886aaf1598ccc9b48a9b7d973a [file] [log] [blame]
Jonathan Hart6261dcd2013-07-22 17:58:35 +12001package net.onrc.onos.ofcontroller.proxyarp;
2
3import java.net.InetAddress;
4
5import net.floodlightcontroller.packet.ARP;
Jonathan Hartabad6a52013-09-30 18:17:21 +13006import net.floodlightcontroller.util.MACAddress;
Jonathan Hart6261dcd2013-07-22 17:58:35 +12007
8public interface IProxyArpService {
9
10 public final int ARP_REQUEST_TIMEOUT = 2000; //ms
11
12 /**
13 * Tell the IProxyArpService to send an ARP reply with the targetMac to
14 * the host on the specified switchport.
15 * @param arpRequest
16 * @param dpid
17 * @param port
18 * @param targetMac
19 */
Jonathan Hartabad6a52013-09-30 18:17:21 +130020 public void sendArpReply(ARP arpRequest, long dpid, short port, MACAddress targetMac);
Jonathan Hart6261dcd2013-07-22 17:58:35 +120021
22 /**
23 * Returns the mac address if there is a valid entry in the cache.
24 * Otherwise returns null.
25 * @param ipAddress
26 * @return
27 */
Jonathan Hartabad6a52013-09-30 18:17:21 +130028 public MACAddress getMacAddress(InetAddress ipAddress);
Jonathan Hart6261dcd2013-07-22 17:58:35 +120029
30 /**
31 * Tell the IProxyArpService to send an ARP request for the IP address.
32 * The request will be broadcast out all edge ports in the network.
Jonathan Hart6261dcd2013-07-22 17:58:35 +120033 * @param ipAddress
34 * @param requester
Jonathan Hart4dfc3652013-08-02 20:22:36 +120035 * @param retry Whether to keep sending requests until the MAC is learnt
Jonathan Hart6261dcd2013-07-22 17:58:35 +120036 * @return
37 */
Jonathan Hart4dfc3652013-08-02 20:22:36 +120038 public void sendArpRequest(InetAddress ipAddress, IArpRequester requester,
39 boolean retry);
Jonathan Hart6261dcd2013-07-22 17:58:35 +120040}