blob: 1e29a02f95ef027386869330d464f9f83dccecb4 [file] [log] [blame]
alshabibb7b40632014-09-28 21:30:00 -07001package org.onlab.onos.net.proxyarp;
2
Jonathan Hartdbdbdbb2014-10-06 18:35:30 -07003import org.onlab.onos.net.ConnectPoint;
alshabibc274c902014-10-03 14:58:27 -07004import org.onlab.onos.net.packet.PacketContext;
alshabibb7b40632014-09-28 21:30:00 -07005import org.onlab.packet.Ethernet;
6import org.onlab.packet.IpPrefix;
7
8/**
9 * Service for processing arp requests on behalf of applications.
10 */
tomf5d85d42014-10-02 05:27:56 -070011// TODO: move to the peer host package
alshabibb7b40632014-09-28 21:30:00 -070012public interface ProxyArpService {
13
14 /**
15 * Returns whether this particular ip address is known to the system.
16 *
tom44179d62014-10-02 05:31:25 -070017 * @param addr a ip address
alshabibb7b40632014-09-28 21:30:00 -070018 * @return true if know, false otherwise
19 */
20 boolean known(IpPrefix addr);
21
22 /**
23 * Sends a reply for a given request. If the host is not known then the arp
24 * will be flooded at all edge ports.
25 *
tom44179d62014-10-02 05:31:25 -070026 * @param eth an arp request
Jonathan Hartdbdbdbb2014-10-06 18:35:30 -070027 * @param inPort the port the request was received on
alshabibb7b40632014-09-28 21:30:00 -070028 */
Jonathan Hartdbdbdbb2014-10-06 18:35:30 -070029 void reply(Ethernet eth, ConnectPoint inPort);
alshabibb5522ff2014-09-29 19:20:00 -070030
31 /**
32 * Forwards an ARP request to its destination. Floods at the edge the ARP request if the
33 * destination is not known.
tom44179d62014-10-02 05:31:25 -070034 *
alshabibb5522ff2014-09-29 19:20:00 -070035 * @param eth an ethernet frame containing an ARP request.
36 */
37 void forward(Ethernet eth);
alshabibb7b40632014-09-28 21:30:00 -070038
alshabibc274c902014-10-03 14:58:27 -070039 /**
40 * Handles a arp packet.
41 * Replies to arp requests and forwards request to the right place.
42 * @param context the packet context to handle
43 * @return true if handled, false otherwise.
44 */
45 boolean handleArp(PacketContext context);
46
alshabibb7b40632014-09-28 21:30:00 -070047}