blob: 6d75812278409a5bfe4b225a3c4cc4a8fc49b6cb [file] [log] [blame]
Satish Ke107e662015-09-21 19:00:17 +05301/*
2 * Copyright 2015 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.bgp.controller;
18
19import org.onosproject.bgpio.protocol.BGPMessage;
20
21/**
22 * Abstraction of an BGP controller. Serves as a one stop shop for obtaining BGP devices and (un)register listeners
23 * on bgp events
24 */
25public interface BGPController {
26
27 /**
28 * Send a message to a particular bgp peer.
29 *
30 * @param bgpId the id of the peer to send message.
31 * @param msg the message to send
32 */
33 void writeMsg(BGPId bgpId, BGPMessage msg);
34
35 /**
36 * Process a message and notify the appropriate listeners.
37 *
38 * @param bgpId id of the peer the message arrived on
39 * @param msg the message to process.
40 */
41 void processBGPPacket(BGPId bgpId, BGPMessage msg);
42
43 /**
44 * Get the BGPConfig class to the caller.
45 *
46 * @return configuration object
47 */
48 BGPCfg getConfig();
49}