blob: 77d1208cd63371c47cedaaf33d09a37150bac4a3 [file] [log] [blame]
alshabibb7b40632014-09-28 21:30:00 -07001package org.onlab.onos.net.proxyarp;
2
alshabibc274c902014-10-03 14:58:27 -07003import org.onlab.onos.net.packet.PacketContext;
alshabibb7b40632014-09-28 21:30:00 -07004import org.onlab.packet.Ethernet;
5import org.onlab.packet.IpPrefix;
6
7/**
8 * Service for processing arp requests on behalf of applications.
9 */
tomf5d85d42014-10-02 05:27:56 -070010// TODO: move to the peer host package
alshabibb7b40632014-09-28 21:30:00 -070011public interface ProxyArpService {
12
13 /**
14 * Returns whether this particular ip address is known to the system.
15 *
tom44179d62014-10-02 05:31:25 -070016 * @param addr a ip address
alshabibb7b40632014-09-28 21:30:00 -070017 * @return true if know, false otherwise
18 */
19 boolean known(IpPrefix addr);
20
21 /**
22 * Sends a reply for a given request. If the host is not known then the arp
23 * will be flooded at all edge ports.
24 *
tom44179d62014-10-02 05:31:25 -070025 * @param eth an arp request
alshabibb7b40632014-09-28 21:30:00 -070026 */
alshabibb5522ff2014-09-29 19:20:00 -070027 void reply(Ethernet eth);
28
29 /**
30 * Forwards an ARP request to its destination. Floods at the edge the ARP request if the
31 * destination is not known.
tom44179d62014-10-02 05:31:25 -070032 *
alshabibb5522ff2014-09-29 19:20:00 -070033 * @param eth an ethernet frame containing an ARP request.
34 */
35 void forward(Ethernet eth);
alshabibb7b40632014-09-28 21:30:00 -070036
alshabibc274c902014-10-03 14:58:27 -070037 /**
38 * Handles a arp packet.
39 * Replies to arp requests and forwards request to the right place.
40 * @param context the packet context to handle
41 * @return true if handled, false otherwise.
42 */
43 boolean handleArp(PacketContext context);
44
alshabibb7b40632014-09-28 21:30:00 -070045}