Shashikanth VH | eca7cec | 2015-11-18 16:19:58 +0530 | [diff] [blame] | 1 | /* |
Brian O'Connor | 5ab426f | 2016-04-09 01:19:45 -0700 | [diff] [blame] | 2 | * Copyright 2015-present Open Networking Laboratory |
Shashikanth VH | eca7cec | 2015-11-18 16:19:58 +0530 | [diff] [blame] | 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 | |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 16 | import org.onosproject.bgpio.exceptions.BgpParseException; |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame] | 17 | import org.onosproject.bgpio.protocol.BgpLSNlri; |
Shashikanth VH | eca7cec | 2015-11-18 16:19:58 +0530 | [diff] [blame] | 18 | import org.onosproject.bgpio.protocol.linkstate.PathAttrNlriDetails; |
| 19 | import org.onosproject.bgpio.types.RouteDistinguisher; |
| 20 | |
| 21 | /** |
| 22 | * Abstraction of BGP local RIB. |
| 23 | */ |
| 24 | public interface BgpLocalRib { |
| 25 | |
| 26 | /** |
| 27 | * Add NLRI to local RIB. |
| 28 | * |
| 29 | * @param sessionInfo session info |
| 30 | * @param nlri network layer reach info |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 31 | * @param details path attributes and NLRI information |
| 32 | * @throws BgpParseException while adding NLRI to local rib |
Shashikanth VH | eca7cec | 2015-11-18 16:19:58 +0530 | [diff] [blame] | 33 | */ |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 34 | void add(BgpSessionInfo sessionInfo, BgpLSNlri nlri, PathAttrNlriDetails details) throws BgpParseException; |
Shashikanth VH | eca7cec | 2015-11-18 16:19:58 +0530 | [diff] [blame] | 35 | |
| 36 | /** |
| 37 | * Removes NLRI identifier if it exists. |
| 38 | * |
| 39 | * @param nlri info |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 40 | * @throws BgpParseException while deleting NLRI from local rib |
Shashikanth VH | eca7cec | 2015-11-18 16:19:58 +0530 | [diff] [blame] | 41 | */ |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 42 | void delete(BgpLSNlri nlri) throws BgpParseException; |
Shashikanth VH | eca7cec | 2015-11-18 16:19:58 +0530 | [diff] [blame] | 43 | |
| 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 B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 52 | * @throws BgpParseException while adding NLRI updation |
Shashikanth VH | eca7cec | 2015-11-18 16:19:58 +0530 | [diff] [blame] | 53 | */ |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame] | 54 | void add(BgpSessionInfo sessionInfo, BgpLSNlri nlri, PathAttrNlriDetails details, |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 55 | RouteDistinguisher routeDistinguisher) throws BgpParseException; |
Shashikanth VH | eca7cec | 2015-11-18 16:19:58 +0530 | [diff] [blame] | 56 | |
| 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 B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 62 | * @throws BgpParseException while deleting NLRI from local rib |
Shashikanth VH | eca7cec | 2015-11-18 16:19:58 +0530 | [diff] [blame] | 63 | */ |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 64 | void delete(BgpLSNlri nlri, RouteDistinguisher routeDistinguisher) throws BgpParseException; |
Shashikanth VH | eca7cec | 2015-11-18 16:19:58 +0530 | [diff] [blame] | 65 | } |