blob: 9ecfb77bfe25da7d0fcc0bec8bca978b2f4bdb1a [file] [log] [blame]
Shashikanth VHf9221132015-11-18 17:40:44 +05301/*
2 * Copyright 2015 Open Networking Laboratory
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
5 * the License. You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
10 * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
11 * specific language governing permissions and limitations under the License.
12 */
13package org.onosproject.bgp.controller;
14
Priyanka Bfc51c952016-03-26 14:30:33 +053015import org.onosproject.bgpio.exceptions.BgpParseException;
Shashikanth VHf9221132015-11-18 17:40:44 +053016import org.onosproject.bgpio.protocol.linkstate.BgpLinkLsNlriVer4;
Priyanka Bfc51c952016-03-26 14:30:33 +053017import org.onosproject.bgpio.protocol.linkstate.PathAttrNlriDetails;
Shashikanth VHf9221132015-11-18 17:40:44 +053018
19/**
Priyanka Bfc51c952016-03-26 14:30:33 +053020 * Allows for providers interested in link events to be notified.
Shashikanth VHf9221132015-11-18 17:40:44 +053021 */
22public interface BgpLinkListener {
23
24 /**
Priyanka Bfc51c952016-03-26 14:30:33 +053025 * Notify that got a packet of link from network and adds link.
Shashikanth VHf9221132015-11-18 17:40:44 +053026 *
Priyanka Bfc51c952016-03-26 14:30:33 +053027 * @param linkNlri BGP link NLRI
28 * @param details path attributes and NLRI information
29 * @throws BgpParseException BGP parse exception
Shashikanth VHf9221132015-11-18 17:40:44 +053030 */
Priyanka Bfc51c952016-03-26 14:30:33 +053031 void addLink(BgpLinkLsNlriVer4 linkNlri, PathAttrNlriDetails details) throws BgpParseException;
Shashikanth VHf9221132015-11-18 17:40:44 +053032
33 /**
Priyanka Bfc51c952016-03-26 14:30:33 +053034 * Notify that got a packet of link from network and remove link.
Shashikanth VHf9221132015-11-18 17:40:44 +053035 *
Priyanka Bfc51c952016-03-26 14:30:33 +053036 * @param linkNlri BGP link NLRI
37 * @throws BgpParseException BGP parse exception
Shashikanth VHf9221132015-11-18 17:40:44 +053038 */
Priyanka Bfc51c952016-03-26 14:30:33 +053039 void deleteLink(BgpLinkLsNlriVer4 linkNlri) throws BgpParseException;
Shashikanth VHf9221132015-11-18 17:40:44 +053040}