blob: 2bb32f447aacd4645487e2ab57a940ca99fd1b8c [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.
Jonathan Hart6261dcd2013-07-22 17:58:35 +120032 * @param ipAddress
33 * @param requester
Jonathan Hart4dfc3652013-08-02 20:22:36 +120034 * @param retry Whether to keep sending requests until the MAC is learnt
Jonathan Hart6261dcd2013-07-22 17:58:35 +120035 * @return
36 */
Jonathan Hart4dfc3652013-08-02 20:22:36 +120037 public void sendArpRequest(InetAddress ipAddress, IArpRequester requester,
38 boolean retry);
Jonathan Hart6261dcd2013-07-22 17:58:35 +120039}