blob: 1762b13f2dd3c9a07ebb53cb5c03dc8a1305b090 [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 */
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;
Pavlin Radoslavov5b5dc482014-11-05 14:48:08 -080019import org.onlab.packet.Ip4Address;
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/**
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 /**
Pavlin Radoslavov5b5dc482014-11-05 14:48:08 -080030 * Returns whether this particular IPv4 address is known to the system.
alshabibb7b40632014-09-28 21:30:00 -070031 *
Pavlin Radoslavov5b5dc482014-11-05 14:48:08 -080032 * @param addr an IPv4 address
alshabibb7b40632014-09-28 21:30:00 -070033 * @return true if know, false otherwise
34 */
Jonathan Hartf84591d2015-01-16 14:33:43 -080035 boolean isKnown(Ip4Address 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.
Jonathan Hartf84591d2015-01-16 14:33:43 -080051 * @param inPort the port the request was received on
alshabibb5522ff2014-09-29 19:20:00 -070052 */
Jonathan Hartf84591d2015-01-16 14:33:43 -080053 void forward(Ethernet eth, ConnectPoint inPort);
alshabibb7b40632014-09-28 21:30:00 -070054
alshabibc274c902014-10-03 14:58:27 -070055 /**
56 * Handles a arp packet.
57 * Replies to arp requests and forwards request to the right place.
58 * @param context the packet context to handle
59 * @return true if handled, false otherwise.
60 */
61 boolean handleArp(PacketContext context);
62
alshabibb7b40632014-09-28 21:30:00 -070063}