Jonathan Hart | 06e8908 | 2016-08-08 17:21:01 -0700 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2016-present Open Networking Foundation |
Jonathan Hart | 06e8908 | 2016-08-08 17:21:01 -0700 | [diff] [blame] | 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 | */ |
| 16 | |
Ray Milkey | b65d784 | 2017-08-03 16:28:24 -0700 | [diff] [blame] | 17 | package org.onosproject.net.neighbour; |
Jonathan Hart | 06e8908 | 2016-08-08 17:21:01 -0700 | [diff] [blame] | 18 | |
Jonathan Hart | 06e8908 | 2016-08-08 17:21:01 -0700 | [diff] [blame] | 19 | import org.onlab.packet.MacAddress; |
Ray Milkey | facf286 | 2017-08-03 11:58:29 -0700 | [diff] [blame] | 20 | import org.onosproject.net.intf.Interface; |
Jonathan Hart | 06e8908 | 2016-08-08 17:21:01 -0700 | [diff] [blame] | 21 | import org.onosproject.net.ConnectPoint; |
| 22 | |
| 23 | /** |
| 24 | * Performs actions on a neighbour message contexts. |
| 25 | */ |
Jonathan Hart | 06e8908 | 2016-08-08 17:21:01 -0700 | [diff] [blame] | 26 | public 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 Hart | 1e393bb | 2016-09-14 08:51:09 -0700 | [diff] [blame] | 37 | * Forwards the incoming message to the given connect point. |
Jonathan Hart | 06e8908 | 2016-08-08 17:21:01 -0700 | [diff] [blame] | 38 | * |
| 39 | * @param context incoming message context |
| 40 | * @param outPort port to send the message out |
| 41 | */ |
Jonathan Hart | 1e393bb | 2016-09-14 08:51:09 -0700 | [diff] [blame] | 42 | void forward(NeighbourMessageContext context, ConnectPoint outPort); |
Jonathan Hart | 06e8908 | 2016-08-08 17:21:01 -0700 | [diff] [blame] | 43 | |
| 44 | /** |
Jonathan Hart | 1e393bb | 2016-09-14 08:51:09 -0700 | [diff] [blame] | 45 | * Forwards the incoming message to a given interface. The message will be |
| 46 | * modified to fit the parameters of the outgoing interface. |
Jonathan Hart | 06e8908 | 2016-08-08 17:21:01 -0700 | [diff] [blame] | 47 | * |
| 48 | * @param context incoming message context |
Jonathan Hart | 1e393bb | 2016-09-14 08:51:09 -0700 | [diff] [blame] | 49 | * @param outIntf interface to send the message out |
Jonathan Hart | 06e8908 | 2016-08-08 17:21:01 -0700 | [diff] [blame] | 50 | */ |
Jonathan Hart | 1e393bb | 2016-09-14 08:51:09 -0700 | [diff] [blame] | 51 | void forward(NeighbourMessageContext context, Interface outIntf); |
Jonathan Hart | 06e8908 | 2016-08-08 17:21:01 -0700 | [diff] [blame] | 52 | |
| 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 | } |