blob: 4632abac60abe5b57785fae73f9ccb405e19d09c [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;
6
7public 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 Hartf0c0dcb2013-07-24 15:28:42 +120027 public byte[] getMacAddress(InetAddress ipAddress);
Jonathan Hart6261dcd2013-07-22 17:58:35 +120028
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}