blob: 3a93b309d2dcd794b1beab430aa13f2cd3297c24 [file] [log] [blame]
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07001/*
2 * Copyright 2014 Open Networking Laboratory
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
alshabibb7b40632014-09-28 21:30:00 -070016package org.onlab.onos.net.proxyarp;
17
Jonathan Hartdbdbdbb2014-10-06 18:35:30 -070018import org.onlab.onos.net.ConnectPoint;
alshabibc274c902014-10-03 14:58:27 -070019import org.onlab.onos.net.packet.PacketContext;
alshabibb7b40632014-09-28 21:30:00 -070020import org.onlab.packet.Ethernet;
Pavlin Radoslavov33f228a2014-10-27 19:33:16 -070021import org.onlab.packet.IpAddress;
alshabibb7b40632014-09-28 21:30:00 -070022
23/**
24 * Service for processing arp requests on behalf of applications.
25 */
tomf5d85d42014-10-02 05:27:56 -070026// TODO: move to the peer host package
alshabibb7b40632014-09-28 21:30:00 -070027public interface ProxyArpService {
28
29 /**
30 * Returns whether this particular ip address is known to the system.
31 *
tom44179d62014-10-02 05:31:25 -070032 * @param addr a ip address
alshabibb7b40632014-09-28 21:30:00 -070033 * @return true if know, false otherwise
34 */
Pavlin Radoslavov33f228a2014-10-27 19:33:16 -070035 boolean known(IpAddress addr);
alshabibb7b40632014-09-28 21:30:00 -070036
37 /**
38 * Sends a reply for a given request. If the host is not known then the arp
39 * will be flooded at all edge ports.
40 *
tom44179d62014-10-02 05:31:25 -070041 * @param eth an arp request
Jonathan Hartdbdbdbb2014-10-06 18:35:30 -070042 * @param inPort the port the request was received on
alshabibb7b40632014-09-28 21:30:00 -070043 */
Jonathan Hartdbdbdbb2014-10-06 18:35:30 -070044 void reply(Ethernet eth, ConnectPoint inPort);
alshabibb5522ff2014-09-29 19:20:00 -070045
46 /**
47 * Forwards an ARP request to its destination. Floods at the edge the ARP request if the
48 * destination is not known.
tom44179d62014-10-02 05:31:25 -070049 *
alshabibb5522ff2014-09-29 19:20:00 -070050 * @param eth an ethernet frame containing an ARP request.
51 */
52 void forward(Ethernet eth);
alshabibb7b40632014-09-28 21:30:00 -070053
alshabibc274c902014-10-03 14:58:27 -070054 /**
55 * Handles a arp packet.
56 * Replies to arp requests and forwards request to the right place.
57 * @param context the packet context to handle
58 * @return true if handled, false otherwise.
59 */
60 boolean handleArp(PacketContext context);
61
alshabibb7b40632014-09-28 21:30:00 -070062}