blob: 636c1c85c375bfff206c174087e717fc794a49e0 [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
Shashikanth VH5dd8dbe2015-11-26 13:22:18 +053016import org.onosproject.bgpio.protocol.BgpLSNlri;
Shashikanth VHeca7cec2015-11-18 16:19:58 +053017import org.onosproject.bgpio.protocol.linkstate.PathAttrNlriDetails;
18import org.onosproject.bgpio.types.RouteDistinguisher;
19
20/**
21 * Abstraction of BGP local RIB.
22 */
23public interface BgpLocalRib {
24
25 /**
26 * Add NLRI to local RIB.
27 *
28 * @param sessionInfo session info
29 * @param nlri network layer reach info
30 * @param details nlri details
31 */
Shashikanth VH5dd8dbe2015-11-26 13:22:18 +053032 void add(BgpSessionInfo sessionInfo, BgpLSNlri nlri, PathAttrNlriDetails details);
Shashikanth VHeca7cec2015-11-18 16:19:58 +053033
34 /**
35 * Removes NLRI identifier if it exists.
36 *
37 * @param nlri info
38 */
Shashikanth VH5dd8dbe2015-11-26 13:22:18 +053039 void delete(BgpLSNlri nlri);
Shashikanth VHeca7cec2015-11-18 16:19:58 +053040
41 /**
42 * Update NLRI identifier mapped with route distinguisher if it exists in tree otherwise add NLRI infomation mapped
43 * to respective route distinguisher.
44 *
45 * @param sessionInfo BGP session info
46 * @param nlri info
47 * @param details has pathattribute, protocol id and identifier
48 * @param routeDistinguisher unique for each VPN
49 */
Shashikanth VH5dd8dbe2015-11-26 13:22:18 +053050 void add(BgpSessionInfo sessionInfo, BgpLSNlri nlri, PathAttrNlriDetails details,
Shashikanth VHeca7cec2015-11-18 16:19:58 +053051 RouteDistinguisher routeDistinguisher);
52
53 /**
54 * Removes VPN NLRI identifier mapped to route distinguisher if it exists.
55 *
56 * @param nlri info
57 * @param routeDistinguisher unique for each VPN
58 */
Shashikanth VH5dd8dbe2015-11-26 13:22:18 +053059 void delete(BgpLSNlri nlri, RouteDistinguisher routeDistinguisher);
Shashikanth VHeca7cec2015-11-18 16:19:58 +053060}