blob: 37fe1f7482ec42a8ab49cf98f86b07ade82a4010 [file] [log] [blame]
Jonathan Hart41349e92015-02-09 14:14:02 -08001/*
Jonathan Hartf4bd0482017-01-27 15:11:18 -08002 * Copyright 2017-present Open Networking Laboratory
Jonathan Hart41349e92015-02-09 14:14:02 -08003 *
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 Hart3930f632015-10-19 12:12:51 -070016
17package org.onosproject.routing.fpm;
18
19import org.onosproject.routing.fpm.protocol.FpmHeader;
Jonathan Hart41349e92015-02-09 14:14:02 -080020
Jonathan Hart6b045582016-02-03 10:00:08 -080021import java.net.SocketAddress;
22
Jonathan Hart41349e92015-02-09 14:14:02 -080023/**
Jonathan Hart6b045582016-02-03 10:00:08 -080024 * Listener for events from the route source.
Jonathan Hart41349e92015-02-09 14:14:02 -080025 */
Jonathan Hart6b045582016-02-03 10:00:08 -080026public interface FpmListener {
Jonathan Hart41349e92015-02-09 14:14:02 -080027
28 /**
Jonathan Hart3930f632015-10-19 12:12:51 -070029 * Handles an FPM message.
Jonathan Hart41349e92015-02-09 14:14:02 -080030 *
Jonathan Hart3930f632015-10-19 12:12:51 -070031 * @param fpmMessage FPM message
Jonathan Hart41349e92015-02-09 14:14:02 -080032 */
Jonathan Hart3930f632015-10-19 12:12:51 -070033 void fpmMessage(FpmHeader fpmMessage);
Jonathan Hart6b045582016-02-03 10:00:08 -080034
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 Hart41349e92015-02-09 14:14:02 -080049}