blob: 8ed4a61092f3df42f139200c51b64eda4edb7dc1 [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
Brian O'Connorabafb502014-12-02 22:26:20 -080018import org.onosproject.net.ConnectPoint;
19import org.onosproject.net.packet.PacketContext;
alshabibb7b40632014-09-28 21:30:00 -070020import org.onlab.packet.Ethernet;
Pavlin Radoslavov5b5dc482014-11-05 14:48:08 -080021import org.onlab.packet.Ip4Address;
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 */
Pavlin Radoslavov5b5dc482014-11-05 14:48:08 -080035 boolean known(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.
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}