blob: 9561b8919fc090ae3c86625f4930765193287368 [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
17package org.onosproject.incubator.net.neighbour;
18
19import com.google.common.annotations.Beta;
20import org.onlab.packet.MacAddress;
21import org.onosproject.incubator.net.intf.Interface;
22import org.onosproject.net.ConnectPoint;
23
24/**
25 * Performs actions on a neighbour message contexts.
26 */
27@Beta
28public interface NeighbourMessageActions {
29
30 /**
31 * Replies to an incoming request with the given MAC address.
32 *
33 * @param context incoming message context
34 * @param targetMac target MAC address.
35 */
36 void reply(NeighbourMessageContext context, MacAddress targetMac);
37
38 /**
Jonathan Hart1e393bb2016-09-14 08:51:09 -070039 * Forwards the incoming message to the given connect point.
Jonathan Hart06e89082016-08-08 17:21:01 -070040 *
41 * @param context incoming message context
42 * @param outPort port to send the message out
43 */
Jonathan Hart1e393bb2016-09-14 08:51:09 -070044 void forward(NeighbourMessageContext context, ConnectPoint outPort);
Jonathan Hart06e89082016-08-08 17:21:01 -070045
46 /**
Jonathan Hart1e393bb2016-09-14 08:51:09 -070047 * Forwards the incoming message to a given interface. The message will be
48 * modified to fit the parameters of the outgoing interface.
Jonathan Hart06e89082016-08-08 17:21:01 -070049 *
50 * @param context incoming message context
Jonathan Hart1e393bb2016-09-14 08:51:09 -070051 * @param outIntf interface to send the message out
Jonathan Hart06e89082016-08-08 17:21:01 -070052 */
Jonathan Hart1e393bb2016-09-14 08:51:09 -070053 void forward(NeighbourMessageContext context, Interface outIntf);
Jonathan Hart06e89082016-08-08 17:21:01 -070054
55 /**
56 * Floods the incoming message to all edge ports except the in port.
57 *
58 * @param context incoming message context
59 */
60 void flood(NeighbourMessageContext context);
61
62 /**
63 * Drops the incoming message.
64 *
65 * @param context incoming message context
66 */
67 void drop(NeighbourMessageContext context);
68}