blob: 94401ccf6a9afb0218343da02e28444dbe428c6f [file] [log] [blame]
Jonathan Hart06e89082016-08-08 17:21:01 -07001/*
2 * Copyright 2016-present Open Networking Laboratory
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
17package org.onosproject.incubator.net.neighbour;
18
19import com.google.common.annotations.Beta;
20import org.onosproject.incubator.net.intf.Interface;
21import org.onosproject.net.ConnectPoint;
22
23/**
24 * Provides a means of registering logic for handling neighbour messages.
25 */
26@Beta
27public interface NeighbourResolutionService {
28
29 /**
30 * Registers a neighbour message handler for all neighbour messages
31 * incoming on the given connect point.
32 *
33 * @param connectPoint connect point
34 * @param handler neighbour message handler
35 */
36 void registerNeighbourHandler(ConnectPoint connectPoint, NeighbourMessageHandler handler);
37
38 /**
39 * Registers a neighbour message handler for all neighbour messages incoming
40 * on the given interface. Neighbour packets must match the fields of the
41 * interface in order to be handled by this message handler.
42 *
43 * @param intf interface
44 * @param handler neighbour message handler
45 */
46 void registerNeighbourHandler(Interface intf, NeighbourMessageHandler handler);
47
Jonathan Hart9bdaaec2016-08-22 13:33:45 -070048 /**
49 * Unregisters a neighbour message handler that was assigned to a connect
50 * point.
51 *
52 * @param connectPoint connect point
53 * @param handler neighbour message handler
54 */
55 void unregisterNeighbourHandler(ConnectPoint connectPoint, NeighbourMessageHandler handler);
56
57 /**
58 * Unregisters a neighbour message handler that was assigned to an interface.
59 *
60 * @param intf interface
61 * @param handler neighbour message handler
62 */
63 void unregisterNeighbourHandler(Interface intf, NeighbourMessageHandler handler);
Jonathan Hart06e89082016-08-08 17:21:01 -070064}