Shashikanth VH | eca7cec | 2015-11-18 16:19:58 +0530 | [diff] [blame] | 1 | /* |
| 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 | |
| 14 | package org.onosproject.bgp.controller; |
| 15 | |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame] | 16 | import org.onosproject.bgpio.protocol.BgpLSNlri; |
Shashikanth VH | eca7cec | 2015-11-18 16:19:58 +0530 | [diff] [blame] | 17 | import org.onosproject.bgpio.protocol.linkstate.PathAttrNlriDetails; |
| 18 | import org.onosproject.bgpio.types.RouteDistinguisher; |
| 19 | |
| 20 | /** |
| 21 | * Abstraction of BGP local RIB. |
| 22 | */ |
| 23 | public 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 VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame] | 32 | void add(BgpSessionInfo sessionInfo, BgpLSNlri nlri, PathAttrNlriDetails details); |
Shashikanth VH | eca7cec | 2015-11-18 16:19:58 +0530 | [diff] [blame] | 33 | |
| 34 | /** |
| 35 | * Removes NLRI identifier if it exists. |
| 36 | * |
| 37 | * @param nlri info |
| 38 | */ |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame] | 39 | void delete(BgpLSNlri nlri); |
Shashikanth VH | eca7cec | 2015-11-18 16:19:58 +0530 | [diff] [blame] | 40 | |
| 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 VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame] | 50 | void add(BgpSessionInfo sessionInfo, BgpLSNlri nlri, PathAttrNlriDetails details, |
Shashikanth VH | eca7cec | 2015-11-18 16:19:58 +0530 | [diff] [blame] | 51 | 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 VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame] | 59 | void delete(BgpLSNlri nlri, RouteDistinguisher routeDistinguisher); |
Shashikanth VH | eca7cec | 2015-11-18 16:19:58 +0530 | [diff] [blame] | 60 | } |