blob: e3b74d2a244e4724645b9b308f4bc6b579f56774 [file] [log] [blame]
Jonathan Hart06e89082016-08-08 17:21:01 -07001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2016-present Open Networking Foundation
Jonathan Hart06e89082016-08-08 17:21:01 -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 */
16
Ray Milkeyb65d7842017-08-03 16:28:24 -070017package org.onosproject.net.neighbour;
Jonathan Hart06e89082016-08-08 17:21:01 -070018
Jonathan Hart06e89082016-08-08 17:21:01 -070019import org.onlab.packet.MacAddress;
Ray Milkeyfacf2862017-08-03 11:58:29 -070020import org.onosproject.net.intf.Interface;
Jonathan Hart06e89082016-08-08 17:21:01 -070021import org.onosproject.net.ConnectPoint;
22
23/**
24 * Performs actions on a neighbour message contexts.
25 */
Jonathan Hart06e89082016-08-08 17:21:01 -070026public interface NeighbourMessageActions {
27
28 /**
29 * Replies to an incoming request with the given MAC address.
30 *
31 * @param context incoming message context
32 * @param targetMac target MAC address.
33 */
34 void reply(NeighbourMessageContext context, MacAddress targetMac);
35
36 /**
Jonathan Hart1e393bb2016-09-14 08:51:09 -070037 * Forwards the incoming message to the given connect point.
Jonathan Hart06e89082016-08-08 17:21:01 -070038 *
39 * @param context incoming message context
40 * @param outPort port to send the message out
41 */
Jonathan Hart1e393bb2016-09-14 08:51:09 -070042 void forward(NeighbourMessageContext context, ConnectPoint outPort);
Jonathan Hart06e89082016-08-08 17:21:01 -070043
44 /**
Jonathan Hart1e393bb2016-09-14 08:51:09 -070045 * Forwards the incoming message to a given interface. The message will be
46 * modified to fit the parameters of the outgoing interface.
Jonathan Hart06e89082016-08-08 17:21:01 -070047 *
48 * @param context incoming message context
Jonathan Hart1e393bb2016-09-14 08:51:09 -070049 * @param outIntf interface to send the message out
Jonathan Hart06e89082016-08-08 17:21:01 -070050 */
Jonathan Hart1e393bb2016-09-14 08:51:09 -070051 void forward(NeighbourMessageContext context, Interface outIntf);
Jonathan Hart06e89082016-08-08 17:21:01 -070052
53 /**
54 * Floods the incoming message to all edge ports except the in port.
55 *
56 * @param context incoming message context
57 */
58 void flood(NeighbourMessageContext context);
59
60 /**
61 * Drops the incoming message.
62 *
63 * @param context incoming message context
64 */
65 void drop(NeighbourMessageContext context);
66}