Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2015-present Open Networking Foundation |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +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.impl; |
| 15 | |
ChinmayaAgarwal | a3d7d7e | 2020-02-06 08:23:30 +0000 | [diff] [blame] | 16 | import com.google.common.collect.Maps; |
Jonathan Hart | 51539b8 | 2015-10-29 09:53:04 -0700 | [diff] [blame] | 17 | import com.google.common.base.MoreObjects; |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 18 | import org.onosproject.bgp.controller.BgpController; |
| 19 | import org.onosproject.bgp.controller.BgpId; |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 20 | import org.onosproject.bgp.controller.BgpLinkListener; |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 21 | import org.onosproject.bgp.controller.BgpLocalRib; |
| 22 | import org.onosproject.bgp.controller.BgpNodeListener; |
Maciej Skala | 3251a30 | 2019-03-26 09:16:55 +0100 | [diff] [blame] | 23 | import org.onosproject.bgp.controller.BgpPrefixListener; |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 24 | import org.onosproject.bgp.controller.BgpSessionInfo; |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 25 | import org.onosproject.bgpio.exceptions.BgpParseException; |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 26 | import org.onosproject.bgpio.protocol.BgpLSNlri; |
| 27 | import org.onosproject.bgpio.protocol.linkstate.BgpLinkLSIdentifier; |
| 28 | import org.onosproject.bgpio.protocol.linkstate.BgpLinkLsNlriVer4; |
| 29 | import org.onosproject.bgpio.protocol.linkstate.BgpNodeLSIdentifier; |
| 30 | import org.onosproject.bgpio.protocol.linkstate.BgpNodeLSNlriVer4; |
| 31 | import org.onosproject.bgpio.protocol.linkstate.BgpPrefixIPv4LSNlriVer4; |
| 32 | import org.onosproject.bgpio.protocol.linkstate.BgpPrefixLSIdentifier; |
| 33 | import org.onosproject.bgpio.protocol.linkstate.PathAttrNlriDetails; |
| 34 | import org.onosproject.bgpio.protocol.linkstate.PathAttrNlriDetailsLocalRib; |
| 35 | import org.onosproject.bgpio.types.RouteDistinguisher; |
| 36 | import org.slf4j.Logger; |
| 37 | import org.slf4j.LoggerFactory; |
| 38 | |
Jonathan Hart | 51539b8 | 2015-10-29 09:53:04 -0700 | [diff] [blame] | 39 | import java.util.Map; |
| 40 | import java.util.Set; |
Jonathan Hart | 51539b8 | 2015-10-29 09:53:04 -0700 | [diff] [blame] | 41 | |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 42 | import static com.google.common.base.Preconditions.checkNotNull; |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 43 | |
| 44 | /** |
| 45 | * Implementation of local RIB. |
| 46 | */ |
| 47 | public class BgpLocalRibImpl implements BgpLocalRib { |
| 48 | |
| 49 | private static final Logger log = LoggerFactory.getLogger(BgpLocalRibImpl.class); |
| 50 | private BgpController bgpController; |
| 51 | |
ChinmayaAgarwal | a3d7d7e | 2020-02-06 08:23:30 +0000 | [diff] [blame] | 52 | private final Map<BgpNodeLSIdentifier, PathAttrNlriDetailsLocalRib> nodeTree = Maps.newConcurrentMap(); |
| 53 | private final Map<BgpLinkLSIdentifier, PathAttrNlriDetailsLocalRib> linkTree = Maps.newConcurrentMap(); |
| 54 | private final Map<BgpPrefixLSIdentifier, PathAttrNlriDetailsLocalRib> prefixTree = Maps.newConcurrentMap(); |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 55 | |
ChinmayaAgarwal | a3d7d7e | 2020-02-06 08:23:30 +0000 | [diff] [blame] | 56 | private final Map<RouteDistinguisher, Map<BgpNodeLSIdentifier, PathAttrNlriDetailsLocalRib>> vpnNodeTree |
| 57 | = Maps.newConcurrentMap(); |
| 58 | private final Map<RouteDistinguisher, Map<BgpLinkLSIdentifier, PathAttrNlriDetailsLocalRib>> vpnLinkTree |
| 59 | = Maps.newConcurrentMap(); |
| 60 | private final Map<RouteDistinguisher, Map<BgpPrefixLSIdentifier, PathAttrNlriDetailsLocalRib>> vpnPrefixTree |
| 61 | = Maps.newConcurrentMap(); |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 62 | |
| 63 | public BgpLocalRibImpl(BgpController bgpController) { |
| 64 | this.bgpController = bgpController; |
| 65 | } |
| 66 | |
| 67 | /** |
| 68 | * Gets node NLRI tree. |
| 69 | * |
| 70 | * @return node tree |
| 71 | */ |
mohamedrahil | 00f6f26 | 2016-11-24 20:20:41 +0530 | [diff] [blame] | 72 | @Override |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 73 | public Map<BgpNodeLSIdentifier, PathAttrNlriDetailsLocalRib> nodeTree() { |
| 74 | return nodeTree; |
| 75 | } |
| 76 | |
| 77 | /** |
| 78 | * Gets link NLRI tree. |
| 79 | * |
| 80 | * @return link tree |
| 81 | */ |
mohamedrahil | 00f6f26 | 2016-11-24 20:20:41 +0530 | [diff] [blame] | 82 | @Override |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 83 | public Map<BgpLinkLSIdentifier, PathAttrNlriDetailsLocalRib> linkTree() { |
| 84 | return linkTree; |
| 85 | } |
| 86 | |
| 87 | /** |
| 88 | * Gets prefix NLRI tree. |
| 89 | * |
| 90 | * @return prefix tree |
| 91 | */ |
mohamedrahil | 00f6f26 | 2016-11-24 20:20:41 +0530 | [diff] [blame] | 92 | @Override |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 93 | public Map<BgpPrefixLSIdentifier, PathAttrNlriDetailsLocalRib> prefixTree() { |
| 94 | return prefixTree; |
| 95 | } |
| 96 | |
| 97 | /** |
| 98 | * Gets VPN node NLRI tree. |
| 99 | * |
| 100 | * @return vpn node NLRI tree |
| 101 | */ |
mohamedrahil | 00f6f26 | 2016-11-24 20:20:41 +0530 | [diff] [blame] | 102 | @Override |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 103 | public Map<RouteDistinguisher, Map<BgpNodeLSIdentifier, PathAttrNlriDetailsLocalRib>> vpnNodeTree() { |
| 104 | return vpnNodeTree; |
| 105 | } |
| 106 | |
| 107 | /** |
| 108 | * Gets VPN link NLRI tree. |
| 109 | * |
| 110 | * @return vpn link NLRI Tree |
| 111 | */ |
mohamedrahil | 00f6f26 | 2016-11-24 20:20:41 +0530 | [diff] [blame] | 112 | @Override |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 113 | public Map<RouteDistinguisher, Map<BgpLinkLSIdentifier, PathAttrNlriDetailsLocalRib>> vpnLinkTree() { |
| 114 | return vpnLinkTree; |
| 115 | } |
| 116 | |
| 117 | /** |
| 118 | * Gets VPN prefix NLRI tree. |
| 119 | * |
| 120 | * @return vpn prefix NLRI Tree |
| 121 | */ |
mohamedrahil | 00f6f26 | 2016-11-24 20:20:41 +0530 | [diff] [blame] | 122 | @Override |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 123 | public Map<RouteDistinguisher, Map<BgpPrefixLSIdentifier, PathAttrNlriDetailsLocalRib>> vpnPrefixTree() { |
| 124 | return vpnPrefixTree; |
| 125 | } |
| 126 | |
| 127 | @Override |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 128 | public void add(BgpSessionInfo sessionInfo, BgpLSNlri nlri, PathAttrNlriDetails details) throws BgpParseException { |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 129 | int decisionResult; |
| 130 | |
| 131 | log.debug("Add to local RIB {}", details.toString()); |
| 132 | |
| 133 | PathAttrNlriDetailsLocalRib detailsLocRib = new PathAttrNlriDetailsLocalRib( |
| 134 | sessionInfo.remoteBgpId().ipAddress(), |
| 135 | sessionInfo.remoteBgpIdentifier(), |
| 136 | sessionInfo.remoteBgpASNum(), |
| 137 | sessionInfo.isIbgpSession(), details); |
| 138 | if (nlri instanceof BgpNodeLSNlriVer4) { |
| 139 | BgpNodeLSIdentifier nodeLsIdentifier = ((BgpNodeLSNlriVer4) nlri).getLocalNodeDescriptors(); |
| 140 | if (nodeTree.containsKey(nodeLsIdentifier)) { |
| 141 | BgpSelectionAlgo selectionAlgo = new BgpSelectionAlgo(); |
| 142 | // Compare local RIB entry with the current attribute |
| 143 | decisionResult = selectionAlgo.compare(nodeTree.get(nodeLsIdentifier), detailsLocRib); |
Shashikanth VH | e38c21e | 2016-05-26 21:37:25 +0530 | [diff] [blame] | 144 | if (decisionResult <= 0) { |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 145 | for (BgpNodeListener l : bgpController.listener()) { |
| 146 | l.addNode((BgpNodeLSNlriVer4) nlri, details); |
| 147 | } |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 148 | nodeTree.replace(nodeLsIdentifier, detailsLocRib); |
| 149 | log.debug("Local RIB update node: {}", detailsLocRib.toString()); |
| 150 | } |
| 151 | } else { |
| 152 | nodeTree.put(nodeLsIdentifier, detailsLocRib); |
| 153 | for (BgpNodeListener l : bgpController.listener()) { |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 154 | l.addNode((BgpNodeLSNlriVer4) nlri, details); |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 155 | } |
| 156 | log.debug("Local RIB ad node: {}", detailsLocRib.toString()); |
| 157 | } |
| 158 | } else if (nlri instanceof BgpLinkLsNlriVer4) { |
| 159 | BgpLinkLSIdentifier linkLsIdentifier = ((BgpLinkLsNlriVer4) nlri).getLinkIdentifier(); |
| 160 | if (linkTree.containsKey(linkLsIdentifier)) { |
| 161 | BgpSelectionAlgo selectionAlgo = new BgpSelectionAlgo(); |
| 162 | // Compare local RIB entry with the current attribute |
| 163 | decisionResult = selectionAlgo.compare(linkTree.get(linkLsIdentifier), detailsLocRib); |
Shashikanth VH | e38c21e | 2016-05-26 21:37:25 +0530 | [diff] [blame] | 164 | if (decisionResult <= 0) { |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 165 | linkTree.replace(linkLsIdentifier, detailsLocRib); |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 166 | for (BgpLinkListener l : bgpController.linkListener()) { |
| 167 | l.addLink((BgpLinkLsNlriVer4) nlri, details); |
| 168 | } |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 169 | log.debug("Local RIB update link: {}", detailsLocRib.toString()); |
| 170 | } |
| 171 | } else { |
| 172 | linkTree.put(linkLsIdentifier, detailsLocRib); |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 173 | for (BgpLinkListener l : bgpController.linkListener()) { |
| 174 | l.addLink((BgpLinkLsNlriVer4) nlri, details); |
| 175 | } |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 176 | log.debug("Local RIB add link: {}", detailsLocRib.toString()); |
| 177 | } |
| 178 | } else if (nlri instanceof BgpPrefixIPv4LSNlriVer4) { |
| 179 | BgpPrefixLSIdentifier prefixIdentifier = ((BgpPrefixIPv4LSNlriVer4) nlri).getPrefixIdentifier(); |
| 180 | if (prefixTree.containsKey(prefixIdentifier)) { |
| 181 | BgpSelectionAlgo selectionAlgo = new BgpSelectionAlgo(); |
| 182 | // Compare local RIB entry with the current attribute |
| 183 | decisionResult = selectionAlgo.compare(prefixTree.get(prefixIdentifier), detailsLocRib); |
Shashikanth VH | e38c21e | 2016-05-26 21:37:25 +0530 | [diff] [blame] | 184 | if (decisionResult <= 0) { |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 185 | prefixTree.replace(prefixIdentifier, detailsLocRib); |
Maciej Skala | 3251a30 | 2019-03-26 09:16:55 +0100 | [diff] [blame] | 186 | for (BgpPrefixListener l : bgpController.prefixListener()) { |
| 187 | l.addPrefix((BgpPrefixIPv4LSNlriVer4) nlri, details); |
| 188 | } |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 189 | log.debug("Local RIB update prefix: {}", detailsLocRib.toString()); |
| 190 | } |
| 191 | } else { |
| 192 | prefixTree.put(prefixIdentifier, detailsLocRib); |
Maciej Skala | 3251a30 | 2019-03-26 09:16:55 +0100 | [diff] [blame] | 193 | for (BgpPrefixListener l : bgpController.prefixListener()) { |
| 194 | l.addPrefix((BgpPrefixIPv4LSNlriVer4) nlri, details); |
| 195 | } |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 196 | log.debug("Local RIB add prefix: {}", detailsLocRib.toString()); |
| 197 | } |
| 198 | } |
| 199 | } |
| 200 | |
| 201 | @Override |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 202 | public void delete(BgpLSNlri nlri) throws BgpParseException { |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 203 | log.debug("Delete from local RIB."); |
| 204 | |
| 205 | // Update local RIB |
| 206 | decisionProcess(nlri); |
| 207 | } |
| 208 | |
| 209 | /** |
| 210 | * Update local RIB based on selection algorithm. |
| 211 | * |
| 212 | * @param nlri NLRI to update |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 213 | * @throws BgpParseException while updating to local RIB |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 214 | */ |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 215 | public void decisionProcess(BgpLSNlri nlri) throws BgpParseException { |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 216 | checkNotNull(nlri); |
| 217 | if (nlri instanceof BgpNodeLSNlriVer4) { |
| 218 | selectionProcessNode(nlri, false); |
| 219 | } else if (nlri instanceof BgpLinkLsNlriVer4) { |
| 220 | selectionProcessLink(nlri, false); |
| 221 | } else if (nlri instanceof BgpPrefixIPv4LSNlriVer4) { |
| 222 | selectionProcessPrefix(nlri, false); |
| 223 | } |
| 224 | } |
| 225 | |
| 226 | /** |
| 227 | * Update VPN local RIB . |
| 228 | * |
| 229 | * @param nlri NLRI to update |
| 230 | * @param routeDistinguisher VPN id to update |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 231 | * @throws BgpParseException BGP parse exception |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 232 | */ |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 233 | public void decisionProcess(BgpLSNlri nlri, RouteDistinguisher routeDistinguisher) throws BgpParseException { |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 234 | checkNotNull(nlri); |
| 235 | if (nlri instanceof BgpNodeLSNlriVer4) { |
| 236 | if (vpnNodeTree.containsKey(routeDistinguisher)) { |
| 237 | selectionProcessNode(nlri, true); |
| 238 | if (nodeTree.size() == 0) { |
| 239 | vpnNodeTree.remove(routeDistinguisher); |
| 240 | } |
| 241 | } |
| 242 | } else if (nlri instanceof BgpLinkLsNlriVer4) { |
| 243 | if (vpnLinkTree.containsKey(routeDistinguisher)) { |
| 244 | selectionProcessLink(nlri, true); |
| 245 | if (linkTree.size() == 0) { |
| 246 | vpnLinkTree.remove(routeDistinguisher); |
| 247 | } |
| 248 | } |
| 249 | } else if (nlri instanceof BgpPrefixIPv4LSNlriVer4) { |
| 250 | if (vpnPrefixTree.containsKey(routeDistinguisher)) { |
| 251 | selectionProcessPrefix(nlri, true); |
| 252 | if (prefixTree.size() == 0) { |
| 253 | vpnPrefixTree.remove(routeDistinguisher); |
| 254 | } |
| 255 | } |
| 256 | } |
| 257 | } |
| 258 | |
| 259 | /** |
| 260 | * Selection process for local RIB node. |
| 261 | * |
| 262 | * @param nlri NLRI to update |
| 263 | * @param isVpnRib true if VPN local RIB, otherwise false |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 264 | * @throws BgpParseException throws BGP parse exception |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 265 | */ |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 266 | public void selectionProcessNode(BgpLSNlri nlri, boolean isVpnRib) throws BgpParseException { |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 267 | BgpPeerImpl peer; |
| 268 | BgpSessionInfo sessionInfo; |
| 269 | int decisionResult; |
| 270 | boolean containsKey; |
| 271 | |
| 272 | BgpNodeLSIdentifier nodeLsIdentifier = ((BgpNodeLSNlriVer4) nlri).getLocalNodeDescriptors(); |
ChinmayaAgarwal | a3d7d7e | 2020-02-06 08:23:30 +0000 | [diff] [blame] | 273 | /* Here, we are checking if the given node is contained in the AdjacencyRib of any peer |
| 274 | or not. If none of the peer's AdjacencyRib has it, node can be marked for deletion. |
| 275 | */ |
| 276 | boolean shouldDeleteNode = false; |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 277 | if (nodeTree.containsKey(nodeLsIdentifier)) { |
ChinmayaAgarwal | a3d7d7e | 2020-02-06 08:23:30 +0000 | [diff] [blame] | 278 | shouldDeleteNode = true; |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 279 | } |
| 280 | |
| 281 | for (BgpId bgpId : bgpController.connectedPeers().keySet()) { |
| 282 | peer = (BgpPeerImpl) (bgpController.getPeer(bgpId)); |
| 283 | |
| 284 | if (nodeTree.containsKey(nodeLsIdentifier)) { |
| 285 | containsKey = (!isVpnRib) ? (peer.adjacencyRib().nodeTree().containsKey(nodeLsIdentifier)) : |
| 286 | (peer.vpnAdjacencyRib().nodeTree().containsKey(nodeLsIdentifier)); |
| 287 | |
| 288 | if (!containsKey) { |
| 289 | continue; |
| 290 | } |
| 291 | sessionInfo = peer.sessionInfo(); |
| 292 | PathAttrNlriDetailsLocalRib detailsLocRib = new PathAttrNlriDetailsLocalRib( |
| 293 | sessionInfo.remoteBgpId().ipAddress(), |
| 294 | sessionInfo.remoteBgpIdentifier(), |
| 295 | sessionInfo.remoteBgpASNum(), |
| 296 | sessionInfo.isIbgpSession(), |
| 297 | (!isVpnRib) ? |
| 298 | (peer.adjacencyRib().nodeTree() |
| 299 | .get(nodeLsIdentifier)) : |
| 300 | (peer.vpnAdjacencyRib().nodeTree() |
| 301 | .get(nodeLsIdentifier))); |
| 302 | BgpSelectionAlgo selectionAlgo = new BgpSelectionAlgo(); |
| 303 | decisionResult = selectionAlgo.compare(nodeTree.get(nodeLsIdentifier), detailsLocRib); |
| 304 | if (decisionResult < 0) { |
| 305 | nodeTree.replace(nodeLsIdentifier, detailsLocRib); |
| 306 | log.debug("Local RIB node updated: {}", detailsLocRib.toString()); |
| 307 | } |
ChinmayaAgarwal | a3d7d7e | 2020-02-06 08:23:30 +0000 | [diff] [blame] | 308 | shouldDeleteNode = false; |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 309 | } |
| 310 | } |
ChinmayaAgarwal | a3d7d7e | 2020-02-06 08:23:30 +0000 | [diff] [blame] | 311 | if (shouldDeleteNode) { |
| 312 | log.debug("Local RIB delete node: {}", nodeLsIdentifier.toString()); |
| 313 | for (BgpNodeListener l : bgpController.listener()) { |
| 314 | l.deleteNode((BgpNodeLSNlriVer4) nlri); |
| 315 | } |
| 316 | nodeTree.remove(nodeLsIdentifier); |
| 317 | } |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 318 | } |
| 319 | |
ChinmayaAgarwal | a3d7d7e | 2020-02-06 08:23:30 +0000 | [diff] [blame] | 320 | /** |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 321 | * Selection process for local RIB link. |
| 322 | * |
| 323 | * @param nlri NLRI to update |
| 324 | * @param isVpnRib true if VPN local RIB, otherwise false |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 325 | * @throws BgpParseException BGP parse exception |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 326 | */ |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 327 | public void selectionProcessLink(BgpLSNlri nlri, boolean isVpnRib) throws BgpParseException { |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 328 | BgpPeerImpl peer; |
| 329 | BgpSessionInfo sessionInfo; |
| 330 | int decisionResult; |
| 331 | boolean containsKey; |
| 332 | |
| 333 | BgpLinkLSIdentifier linkLsIdentifier = ((BgpLinkLsNlriVer4) nlri).getLinkIdentifier(); |
ChinmayaAgarwal | a3d7d7e | 2020-02-06 08:23:30 +0000 | [diff] [blame] | 334 | /* Here, we are checking if the given link is contained in the AdjacencyRib of any peer |
| 335 | or not. If none of the peer's AdjacencyRib has it, link can be marked for deletion. |
| 336 | */ |
| 337 | boolean shouldDeleteLink = false; |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 338 | if (linkTree.containsKey(linkLsIdentifier)) { |
ChinmayaAgarwal | a3d7d7e | 2020-02-06 08:23:30 +0000 | [diff] [blame] | 339 | shouldDeleteLink = true; |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 340 | } |
| 341 | |
| 342 | for (BgpId bgpId : bgpController.connectedPeers().keySet()) { |
| 343 | peer = (BgpPeerImpl) (bgpController.getPeer(bgpId)); |
| 344 | |
| 345 | if (linkTree.containsKey(linkLsIdentifier)) { |
| 346 | |
| 347 | containsKey = (!isVpnRib) ? (peer.adjacencyRib().linkTree().containsKey(linkLsIdentifier)) : |
| 348 | (peer.vpnAdjacencyRib().linkTree().containsKey(linkLsIdentifier)); |
| 349 | |
| 350 | if (!containsKey) { |
| 351 | continue; |
| 352 | } |
| 353 | |
| 354 | sessionInfo = peer.sessionInfo(); |
| 355 | |
| 356 | PathAttrNlriDetailsLocalRib detailsLocRib = new PathAttrNlriDetailsLocalRib( |
| 357 | sessionInfo.remoteBgpId().ipAddress(), |
| 358 | sessionInfo.remoteBgpIdentifier(), |
| 359 | sessionInfo.remoteBgpASNum(), |
| 360 | sessionInfo.isIbgpSession(), |
| 361 | ((!isVpnRib) ? |
| 362 | (peer.adjacencyRib().linkTree().get(linkLsIdentifier)) : |
| 363 | (peer.vpnAdjacencyRib().linkTree() |
| 364 | .get(linkLsIdentifier)))); |
| 365 | |
| 366 | BgpSelectionAlgo selectionAlgo = new BgpSelectionAlgo(); |
| 367 | decisionResult = selectionAlgo.compare(linkTree.get(linkLsIdentifier), detailsLocRib); |
| 368 | if (decisionResult < 0) { |
| 369 | linkTree.replace(linkLsIdentifier, detailsLocRib); |
| 370 | log.debug("Local RIB link updated: {}", detailsLocRib.toString()); |
| 371 | } |
ChinmayaAgarwal | a3d7d7e | 2020-02-06 08:23:30 +0000 | [diff] [blame] | 372 | shouldDeleteLink = false; |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 373 | } |
| 374 | } |
ChinmayaAgarwal | a3d7d7e | 2020-02-06 08:23:30 +0000 | [diff] [blame] | 375 | |
| 376 | if (shouldDeleteLink) { |
| 377 | log.debug("Local RIB remove link: {}", linkLsIdentifier.toString()); |
| 378 | for (BgpLinkListener l : bgpController.linkListener()) { |
| 379 | l.deleteLink((BgpLinkLsNlriVer4) nlri); |
| 380 | } |
| 381 | linkTree.remove(linkLsIdentifier); |
| 382 | |
| 383 | } |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 384 | } |
| 385 | |
ChinmayaAgarwal | a3d7d7e | 2020-02-06 08:23:30 +0000 | [diff] [blame] | 386 | /** |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 387 | * Selection process for local RIB prefix. |
| 388 | * |
| 389 | * @param nlri NLRI to update |
| 390 | * @param isVpnRib true if VPN local RIB, otherwise false |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 391 | * @throws BgpParseException BGP parse exception |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 392 | */ |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 393 | public void selectionProcessPrefix(BgpLSNlri nlri, boolean isVpnRib) throws BgpParseException { |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 394 | BgpPeerImpl peer; |
| 395 | BgpSessionInfo sessionInfo; |
| 396 | int decisionResult; |
| 397 | boolean containsKey; |
| 398 | |
| 399 | BgpPrefixLSIdentifier prefixIdentifier = ((BgpPrefixIPv4LSNlriVer4) nlri).getPrefixIdentifier(); |
ChinmayaAgarwal | a3d7d7e | 2020-02-06 08:23:30 +0000 | [diff] [blame] | 400 | /* Here, we are checking if the given prefix is contained in the AdjacencyRib of any peer |
| 401 | or not. If none of the peer's AdjacencyRib has it, prefix can be marked for deletion. |
| 402 | */ |
| 403 | boolean shouldDeletePrefix = false; |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 404 | if (prefixTree.containsKey(prefixIdentifier)) { |
ChinmayaAgarwal | a3d7d7e | 2020-02-06 08:23:30 +0000 | [diff] [blame] | 405 | shouldDeletePrefix = true; |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 406 | } |
| 407 | |
| 408 | for (BgpId bgpId : bgpController.connectedPeers().keySet()) { |
| 409 | peer = (BgpPeerImpl) (bgpController.getPeer(bgpId)); |
| 410 | |
| 411 | if (prefixTree.containsKey(prefixIdentifier)) { |
| 412 | |
| 413 | containsKey = (!isVpnRib) ? (peer.adjacencyRib().prefixTree().containsKey(prefixIdentifier)) : |
| 414 | (peer.vpnAdjacencyRib().prefixTree().containsKey(prefixIdentifier)); |
| 415 | if (!containsKey) { |
| 416 | continue; |
| 417 | } |
| 418 | sessionInfo = peer.sessionInfo(); |
| 419 | |
| 420 | PathAttrNlriDetailsLocalRib detailsLocRib = new PathAttrNlriDetailsLocalRib( |
| 421 | sessionInfo.remoteBgpId().ipAddress(), |
| 422 | sessionInfo.remoteBgpIdentifier(), |
| 423 | sessionInfo.remoteBgpASNum(), |
| 424 | sessionInfo.isIbgpSession(), |
| 425 | ((!isVpnRib) ? |
| 426 | (peer.adjacencyRib().prefixTree() |
| 427 | .get(prefixIdentifier)) : |
| 428 | (peer.vpnAdjacencyRib().prefixTree() |
| 429 | .get(prefixIdentifier)))); |
| 430 | |
| 431 | BgpSelectionAlgo selectionAlgo = new BgpSelectionAlgo(); |
| 432 | decisionResult = selectionAlgo.compare(prefixTree.get(prefixIdentifier), detailsLocRib); |
| 433 | if (decisionResult < 0) { |
| 434 | prefixTree.replace(prefixIdentifier, detailsLocRib); |
mohamedrahil | 00f6f26 | 2016-11-24 20:20:41 +0530 | [diff] [blame] | 435 | log.debug("Local RIB prefix updated: {}", detailsLocRib.toString()); |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 436 | } |
ChinmayaAgarwal | a3d7d7e | 2020-02-06 08:23:30 +0000 | [diff] [blame] | 437 | shouldDeletePrefix = false; |
| 438 | } |
| 439 | if (shouldDeletePrefix) { |
| 440 | log.debug("Local RIB remove prefix: {}", prefixIdentifier.toString()); |
| 441 | for (BgpPrefixListener l : bgpController.prefixListener()) { |
| 442 | l.deletePrefix((BgpPrefixIPv4LSNlriVer4) nlri); |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 443 | } |
ChinmayaAgarwal | a3d7d7e | 2020-02-06 08:23:30 +0000 | [diff] [blame] | 444 | prefixTree.remove(prefixIdentifier); |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 445 | } |
| 446 | } |
| 447 | } |
| 448 | |
| 449 | @Override |
| 450 | public void add(BgpSessionInfo sessionInfo, BgpLSNlri nlri, PathAttrNlriDetails details, |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 451 | RouteDistinguisher routeDistinguisher) throws BgpParseException { |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 452 | add(sessionInfo, nlri, details); |
| 453 | if (nlri instanceof BgpNodeLSNlriVer4) { |
| 454 | if (!vpnNodeTree.containsKey(routeDistinguisher)) { |
| 455 | vpnNodeTree.put(routeDistinguisher, nodeTree); |
| 456 | } |
| 457 | } else if (nlri instanceof BgpLinkLsNlriVer4) { |
| 458 | if (!vpnLinkTree.containsKey(routeDistinguisher)) { |
| 459 | vpnLinkTree.put(routeDistinguisher, linkTree); |
| 460 | } |
| 461 | } else if (nlri instanceof BgpPrefixIPv4LSNlriVer4) { |
| 462 | if (!vpnPrefixTree.containsKey(routeDistinguisher)) { |
| 463 | vpnPrefixTree.put(routeDistinguisher, prefixTree); |
| 464 | } |
| 465 | } |
| 466 | } |
| 467 | |
| 468 | @Override |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 469 | public void delete(BgpLSNlri nlri, RouteDistinguisher routeDistinguisher) throws BgpParseException { |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 470 | // Update local RIB |
| 471 | decisionProcess(nlri, routeDistinguisher); |
| 472 | } |
| 473 | |
| 474 | /** |
Ray Milkey | c108a6b | 2017-08-23 15:23:50 -0700 | [diff] [blame] | 475 | * Update local RIB node based on available peer adjacency RIB. |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 476 | * |
| 477 | * @param o adjacency-in/VPN adjacency-in |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 478 | * @throws BgpParseException BGP parse exception |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 479 | */ |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 480 | public void localRibUpdateNode(Object o) throws BgpParseException { |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 481 | |
| 482 | if (o instanceof AdjRibIn) { |
| 483 | AdjRibIn adjRib = (AdjRibIn) o; |
| 484 | log.debug("Update local RIB node."); |
| 485 | |
| 486 | Set<BgpNodeLSIdentifier> nodeKeys = adjRib.nodeTree().keySet(); |
| 487 | for (BgpNodeLSIdentifier key : nodeKeys) { |
| 488 | PathAttrNlriDetails pathAttrNlri = adjRib.nodeTree().get(key); |
| 489 | |
| 490 | BgpNodeLSNlriVer4 nodeNlri = new BgpNodeLSNlriVer4(pathAttrNlri.identifier(), pathAttrNlri |
| 491 | .protocolID().getType(), key, false, null); |
| 492 | decisionProcess(nodeNlri); |
| 493 | } |
| 494 | } |
| 495 | |
| 496 | if (o instanceof VpnAdjRibIn) { |
| 497 | VpnAdjRibIn vpnAdjRib = (VpnAdjRibIn) o; |
| 498 | log.debug("Update local RIB VPN node."); |
| 499 | Set<RouteDistinguisher> nodeKeysVpn = vpnAdjRib.vpnNodeTree().keySet(); |
| 500 | Map<BgpNodeLSIdentifier, PathAttrNlriDetails> node; |
| 501 | for (RouteDistinguisher keyVpnNode : nodeKeysVpn) { |
| 502 | node = vpnAdjRib.vpnNodeTree().get(keyVpnNode); |
| 503 | |
| 504 | Set<BgpNodeLSIdentifier> vpnNodeKeys = node.keySet(); |
| 505 | for (BgpNodeLSIdentifier key : vpnNodeKeys) { |
| 506 | PathAttrNlriDetails pathAttrNlri = vpnAdjRib.nodeTree().get(key); |
| 507 | BgpNodeLSNlriVer4 nodeNlri = new BgpNodeLSNlriVer4(pathAttrNlri.identifier(), |
| 508 | pathAttrNlri.protocolID().getType(), |
| 509 | key, true, keyVpnNode); |
| 510 | decisionProcess(nodeNlri, keyVpnNode); |
| 511 | } |
| 512 | } |
| 513 | } |
| 514 | } |
| 515 | |
| 516 | /** |
Ray Milkey | c108a6b | 2017-08-23 15:23:50 -0700 | [diff] [blame] | 517 | * Update localRIB link based on available peer adjacency RIB. |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 518 | * |
| 519 | * @param o adjacency-in/VPN adjacency-in |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 520 | * @throws BgpParseException BGP parse exceptions |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 521 | */ |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 522 | public void localRibUpdateLink(Object o) throws BgpParseException { |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 523 | |
| 524 | if (o instanceof AdjRibIn) { |
| 525 | AdjRibIn adjRib = (AdjRibIn) o; |
| 526 | log.debug("Update local RIB link."); |
| 527 | |
| 528 | Set<BgpLinkLSIdentifier> linkKeys = adjRib.linkTree().keySet(); |
| 529 | for (BgpLinkLSIdentifier key : linkKeys) { |
| 530 | PathAttrNlriDetails pathAttrNlri = adjRib.linkTree().get(key); |
| 531 | BgpLinkLsNlriVer4 linkNlri = new BgpLinkLsNlriVer4(pathAttrNlri.protocolID().getType(), |
| 532 | pathAttrNlri.identifier(), key, null, false); |
| 533 | decisionProcess(linkNlri); |
| 534 | } |
| 535 | } |
| 536 | |
| 537 | if (o instanceof VpnAdjRibIn) { |
| 538 | VpnAdjRibIn vpnAdjRib = (VpnAdjRibIn) o; |
| 539 | log.debug("Update local RIB VPN link"); |
| 540 | |
| 541 | Set<RouteDistinguisher> linkKeysVpn = vpnAdjRib.vpnLinkTree().keySet(); |
| 542 | Map<BgpLinkLSIdentifier, PathAttrNlriDetails> link; |
| 543 | for (RouteDistinguisher keyVpnLink : linkKeysVpn) { |
| 544 | link = vpnAdjRib.vpnLinkTree().get(keyVpnLink); |
| 545 | |
| 546 | Set<BgpLinkLSIdentifier> vpnLinkKeys = link.keySet(); |
| 547 | for (BgpLinkLSIdentifier key : vpnLinkKeys) { |
| 548 | PathAttrNlriDetails pathAttrNlri = vpnAdjRib.linkTree().get(key); |
| 549 | BgpLinkLsNlriVer4 linkNlri = new BgpLinkLsNlriVer4(pathAttrNlri.protocolID().getType(), |
| 550 | pathAttrNlri.identifier(), key, keyVpnLink, |
| 551 | true); |
| 552 | decisionProcess(linkNlri, keyVpnLink); |
| 553 | } |
| 554 | } |
| 555 | } |
| 556 | } |
| 557 | |
| 558 | /** |
Ray Milkey | c108a6b | 2017-08-23 15:23:50 -0700 | [diff] [blame] | 559 | * Update localRIB prefix based on available peer adjacency RIB. |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 560 | * |
| 561 | * @param o instance of adjacency-in/VPN adjacency-in |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 562 | * @throws BgpParseException BGP parse exception |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 563 | */ |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 564 | public void localRibUpdatePrefix(Object o) throws BgpParseException { |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 565 | |
| 566 | if (o instanceof AdjRibIn) { |
| 567 | AdjRibIn adjRib = (AdjRibIn) o; |
| 568 | log.debug("Update local RIB prefix."); |
| 569 | |
| 570 | Set<BgpPrefixLSIdentifier> prefixKeys = adjRib.prefixTree().keySet(); |
| 571 | for (BgpPrefixLSIdentifier key : prefixKeys) { |
| 572 | PathAttrNlriDetails pathAttrNlri = adjRib.prefixTree().get(key); |
| 573 | BgpPrefixIPv4LSNlriVer4 prefixNlri = new BgpPrefixIPv4LSNlriVer4( |
| 574 | pathAttrNlri.identifier(), |
| 575 | pathAttrNlri.protocolID().getType(), |
| 576 | key, null, false); |
| 577 | decisionProcess(prefixNlri); |
| 578 | } |
| 579 | } |
| 580 | |
| 581 | if (o instanceof VpnAdjRibIn) { |
| 582 | VpnAdjRibIn vpnAdjRib = (VpnAdjRibIn) o; |
| 583 | log.debug("Update local RIB VPN prefix."); |
| 584 | |
| 585 | Set<RouteDistinguisher> prefixKeysVpn = vpnAdjRib.vpnPrefixTree().keySet(); |
| 586 | Map<BgpPrefixLSIdentifier, PathAttrNlriDetails> prefix; |
| 587 | for (RouteDistinguisher keyVpnPrefix : prefixKeysVpn) { |
| 588 | prefix = vpnAdjRib.vpnPrefixTree().get(keyVpnPrefix); |
| 589 | |
| 590 | Set<BgpPrefixLSIdentifier> vpnPrefixKeys = prefix.keySet(); |
| 591 | for (BgpPrefixLSIdentifier key : vpnPrefixKeys) { |
| 592 | PathAttrNlriDetails pathAttrNlri = vpnAdjRib.prefixTree().get(key); |
| 593 | BgpPrefixIPv4LSNlriVer4 prefixNlri = new BgpPrefixIPv4LSNlriVer4(pathAttrNlri.identifier(), |
| 594 | pathAttrNlri.protocolID() |
| 595 | .getType(), key, |
| 596 | keyVpnPrefix, true); |
| 597 | decisionProcess(prefixNlri, keyVpnPrefix); |
| 598 | } |
| 599 | } |
| 600 | } |
| 601 | } |
| 602 | |
| 603 | /** |
| 604 | * Update localRIB. |
| 605 | * |
| 606 | * @param adjRibIn adjacency RIB-in |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 607 | * @throws BgpParseException BGP parse exception |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 608 | */ |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 609 | public void localRibUpdate(AdjRibIn adjRibIn) throws BgpParseException { |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 610 | log.debug("Update local RIB."); |
| 611 | |
Jonathan Hart | 51539b8 | 2015-10-29 09:53:04 -0700 | [diff] [blame] | 612 | localRibUpdateNode(adjRibIn); |
| 613 | localRibUpdateLink(adjRibIn); |
| 614 | localRibUpdatePrefix(adjRibIn); |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 615 | } |
| 616 | |
| 617 | /** |
| 618 | * Update localRIB. |
| 619 | * |
| 620 | * @param vpnAdjRibIn VPN adjacency RIB-in |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 621 | * @throws BgpParseException BGP parse exception |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 622 | */ |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 623 | public void localRibUpdate(VpnAdjRibIn vpnAdjRibIn) throws BgpParseException { |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 624 | log.debug("Update VPN local RIB."); |
| 625 | |
Jonathan Hart | 51539b8 | 2015-10-29 09:53:04 -0700 | [diff] [blame] | 626 | localRibUpdateNode(vpnAdjRibIn); |
| 627 | localRibUpdateLink(vpnAdjRibIn); |
| 628 | localRibUpdatePrefix(vpnAdjRibIn); |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 629 | } |
| 630 | |
| 631 | @Override |
| 632 | public String toString() { |
| 633 | return MoreObjects.toStringHelper(getClass()).omitNullValues().add("nodeTree", nodeTree) |
| 634 | .add("linkTree", linkTree).add("prefixTree", prefixTree).add("vpnNodeTree", vpnNodeTree) |
| 635 | .add("vpnLinkTree", vpnLinkTree).add("vpnPrefixTree", vpnPrefixTree).toString(); |
| 636 | } |
| 637 | } |