blob: 37d91a833cadabee6f116404ff533fd815e7d291 [file] [log] [blame]
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2014-present Open Networking Laboratory
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07003 *
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 */
Brian O'Connorabafb502014-12-02 22:26:20 -080016package org.onosproject.net.proxyarp;
alshabibb7b40632014-09-28 21:30:00 -070017
18import org.onlab.packet.Ethernet;
Kunihiro Ishigurof1bff502015-01-30 15:47:06 -080019import org.onlab.packet.IpAddress;
Jonathan Hartf84591d2015-01-16 14:33:43 -080020import org.onosproject.net.ConnectPoint;
21import org.onosproject.net.packet.PacketContext;
alshabibb7b40632014-09-28 21:30:00 -070022
23/**
Jonathan Hart39ee6482015-08-31 16:00:19 +020024 * Service for processing ARP or NDP requests on behalf of applications.
alshabibb7b40632014-09-28 21:30:00 -070025 */
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 /**
Kunihiro Ishigurof1bff502015-01-30 15:47:06 -080030 * Returns whether this particular IP address is known to the system.
alshabibb7b40632014-09-28 21:30:00 -070031 *
Kunihiro Ishigurof1bff502015-01-30 15:47:06 -080032 * @param addr an IP address
alshabibb7b40632014-09-28 21:30:00 -070033 * @return true if know, false otherwise
34 */
Kunihiro Ishigurof1bff502015-01-30 15:47:06 -080035 boolean isKnown(IpAddress addr);
alshabibb7b40632014-09-28 21:30:00 -070036
37 /**
Kunihiro Ishigurof1bff502015-01-30 15:47:06 -080038 * Sends a reply for a given request. If the host is not known then the
39 * arp or neighbor solicitation will be flooded at all edge ports.
alshabibb7b40632014-09-28 21:30:00 -070040 *
Kunihiro Ishigurof1bff502015-01-30 15:47:06 -080041 * @param eth an arp or neighbor solicitation 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 /**
Kunihiro Ishigurof1bff502015-01-30 15:47:06 -080047 * Forwards an ARP or neighbor solicitation request to its destination.
48 * Floods at the edg the request if the destination is not known.
tom44179d62014-10-02 05:31:25 -070049 *
Kunihiro Ishigurof1bff502015-01-30 15:47:06 -080050 * @param eth an ethernet frame containing an ARP or neighbor solicitation
51 * request.
Jonathan Hartf84591d2015-01-16 14:33:43 -080052 * @param inPort the port the request was received on
alshabibb5522ff2014-09-29 19:20:00 -070053 */
Jonathan Hartf84591d2015-01-16 14:33:43 -080054 void forward(Ethernet eth, ConnectPoint inPort);
alshabibb7b40632014-09-28 21:30:00 -070055
alshabibc274c902014-10-03 14:58:27 -070056 /**
Kunihiro Ishigurof1bff502015-01-30 15:47:06 -080057 * Handles a arp or neighbor solicitation packet.
58 * Replies to arp or neighbor solicitation requests and forwards request
59 * to the right place.
alshabibc274c902014-10-03 14:58:27 -070060 * @param context the packet context to handle
61 * @return true if handled, false otherwise.
62 */
Kunihiro Ishigurof1bff502015-01-30 15:47:06 -080063 boolean handlePacket(PacketContext context);
alshabibb7b40632014-09-28 21:30:00 -070064}