Jonathan Hart | 41349e9 | 2015-02-09 14:14:02 -0800 | [diff] [blame] | 1 | /* |
Jonathan Hart | f4bd048 | 2017-01-27 15:11:18 -0800 | [diff] [blame^] | 2 | * Copyright 2017-present Open Networking Laboratory |
Jonathan Hart | 41349e9 | 2015-02-09 14:14:02 -0800 | [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 | */ |
Jonathan Hart | 3930f63 | 2015-10-19 12:12:51 -0700 | [diff] [blame] | 16 | |
| 17 | package org.onosproject.routing.fpm; |
| 18 | |
| 19 | import org.onosproject.routing.fpm.protocol.FpmHeader; |
Jonathan Hart | 41349e9 | 2015-02-09 14:14:02 -0800 | [diff] [blame] | 20 | |
Jonathan Hart | 6b04558 | 2016-02-03 10:00:08 -0800 | [diff] [blame] | 21 | import java.net.SocketAddress; |
| 22 | |
Jonathan Hart | 41349e9 | 2015-02-09 14:14:02 -0800 | [diff] [blame] | 23 | /** |
Jonathan Hart | 6b04558 | 2016-02-03 10:00:08 -0800 | [diff] [blame] | 24 | * Listener for events from the route source. |
Jonathan Hart | 41349e9 | 2015-02-09 14:14:02 -0800 | [diff] [blame] | 25 | */ |
Jonathan Hart | 6b04558 | 2016-02-03 10:00:08 -0800 | [diff] [blame] | 26 | public interface FpmListener { |
Jonathan Hart | 41349e9 | 2015-02-09 14:14:02 -0800 | [diff] [blame] | 27 | |
| 28 | /** |
Jonathan Hart | 3930f63 | 2015-10-19 12:12:51 -0700 | [diff] [blame] | 29 | * Handles an FPM message. |
Jonathan Hart | 41349e9 | 2015-02-09 14:14:02 -0800 | [diff] [blame] | 30 | * |
Jonathan Hart | 3930f63 | 2015-10-19 12:12:51 -0700 | [diff] [blame] | 31 | * @param fpmMessage FPM message |
Jonathan Hart | 41349e9 | 2015-02-09 14:14:02 -0800 | [diff] [blame] | 32 | */ |
Jonathan Hart | 3930f63 | 2015-10-19 12:12:51 -0700 | [diff] [blame] | 33 | void fpmMessage(FpmHeader fpmMessage); |
Jonathan Hart | 6b04558 | 2016-02-03 10:00:08 -0800 | [diff] [blame] | 34 | |
| 35 | /** |
| 36 | * Signifies that a new peer has attempted to initiate an FPM connection. |
| 37 | * |
| 38 | * @param address remote address of the peer |
| 39 | * @return true if the connection should be admitted, otherwise false |
| 40 | */ |
| 41 | boolean peerConnected(SocketAddress address); |
| 42 | |
| 43 | /** |
| 44 | * Signifies that an FPM connection has been disconnected. |
| 45 | * |
| 46 | * @param address remote address of the peer |
| 47 | */ |
| 48 | void peerDisconnected(SocketAddress address); |
Jonathan Hart | 41349e9 | 2015-02-09 14:14:02 -0800 | [diff] [blame] | 49 | } |