blob: d811b27ebbab13d31064515a60e3c504807be8a5 [file] [log] [blame]
Shashikanth VHeca7cec2015-11-18 16:19:58 +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 */
13
14package org.onosproject.bgp.controller;
15
Priyanka Bfc51c952016-03-26 14:30:33 +053016import org.onosproject.bgpio.exceptions.BgpParseException;
Shashikanth VH5dd8dbe2015-11-26 13:22:18 +053017import org.onosproject.bgpio.protocol.BgpLSNlri;
Shashikanth VHeca7cec2015-11-18 16:19:58 +053018import org.onosproject.bgpio.protocol.linkstate.PathAttrNlriDetails;
19import org.onosproject.bgpio.types.RouteDistinguisher;
20
21/**
22 * Abstraction of BGP local RIB.
23 */
24public interface BgpLocalRib {
25
26 /**
27 * Add NLRI to local RIB.
28 *
29 * @param sessionInfo session info
30 * @param nlri network layer reach info
Priyanka Bfc51c952016-03-26 14:30:33 +053031 * @param details path attributes and NLRI information
32 * @throws BgpParseException while adding NLRI to local rib
Shashikanth VHeca7cec2015-11-18 16:19:58 +053033 */
Priyanka Bfc51c952016-03-26 14:30:33 +053034 void add(BgpSessionInfo sessionInfo, BgpLSNlri nlri, PathAttrNlriDetails details) throws BgpParseException;
Shashikanth VHeca7cec2015-11-18 16:19:58 +053035
36 /**
37 * Removes NLRI identifier if it exists.
38 *
39 * @param nlri info
Priyanka Bfc51c952016-03-26 14:30:33 +053040 * @throws BgpParseException while deleting NLRI from local rib
Shashikanth VHeca7cec2015-11-18 16:19:58 +053041 */
Priyanka Bfc51c952016-03-26 14:30:33 +053042 void delete(BgpLSNlri nlri) throws BgpParseException;
Shashikanth VHeca7cec2015-11-18 16:19:58 +053043
44 /**
45 * Update NLRI identifier mapped with route distinguisher if it exists in tree otherwise add NLRI infomation mapped
46 * to respective route distinguisher.
47 *
48 * @param sessionInfo BGP session info
49 * @param nlri info
50 * @param details has pathattribute, protocol id and identifier
51 * @param routeDistinguisher unique for each VPN
Priyanka Bfc51c952016-03-26 14:30:33 +053052 * @throws BgpParseException while adding NLRI updation
Shashikanth VHeca7cec2015-11-18 16:19:58 +053053 */
Shashikanth VH5dd8dbe2015-11-26 13:22:18 +053054 void add(BgpSessionInfo sessionInfo, BgpLSNlri nlri, PathAttrNlriDetails details,
Priyanka Bfc51c952016-03-26 14:30:33 +053055 RouteDistinguisher routeDistinguisher) throws BgpParseException;
Shashikanth VHeca7cec2015-11-18 16:19:58 +053056
57 /**
58 * Removes VPN NLRI identifier mapped to route distinguisher if it exists.
59 *
60 * @param nlri info
61 * @param routeDistinguisher unique for each VPN
Priyanka Bfc51c952016-03-26 14:30:33 +053062 * @throws BgpParseException while deleting NLRI from local rib
Shashikanth VHeca7cec2015-11-18 16:19:58 +053063 */
Priyanka Bfc51c952016-03-26 14:30:33 +053064 void delete(BgpLSNlri nlri, RouteDistinguisher routeDistinguisher) throws BgpParseException;
Shashikanth VHeca7cec2015-11-18 16:19:58 +053065}