Satish K | e107e66 | 2015-09-21 19:00:17 +0530 | [diff] [blame] | 1 | /* |
Brian O'Connor | 5ab426f | 2016-04-09 01:19:45 -0700 | [diff] [blame] | 2 | * Copyright 2015-present Open Networking Laboratory |
Satish K | e107e66 | 2015-09-21 19:00:17 +0530 | [diff] [blame] | 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | package org.onosproject.bgp.controller.impl; |
| 18 | |
Satish K | e107e66 | 2015-09-21 19:00:17 +0530 | [diff] [blame] | 19 | import org.apache.felix.scr.annotations.Activate; |
| 20 | import org.apache.felix.scr.annotations.Component; |
| 21 | import org.apache.felix.scr.annotations.Deactivate; |
| 22 | import org.apache.felix.scr.annotations.Service; |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame] | 23 | import org.onosproject.bgp.controller.BgpCfg; |
| 24 | import org.onosproject.bgp.controller.BgpController; |
| 25 | import org.onosproject.bgp.controller.BgpId; |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 26 | import org.onosproject.bgp.controller.BgpLinkListener; |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 27 | import org.onosproject.bgp.controller.BgpLocalRib; |
Shashikanth VH | f62b5c0 | 2015-11-20 22:23:08 +0530 | [diff] [blame] | 28 | import org.onosproject.bgp.controller.BgpNodeListener; |
Jonathan Hart | 51539b8 | 2015-10-29 09:53:04 -0700 | [diff] [blame] | 29 | import org.onosproject.bgp.controller.BgpPeer; |
Shashikanth VH | 9f8afb4 | 2015-11-04 18:00:30 +0530 | [diff] [blame] | 30 | import org.onosproject.bgp.controller.BgpPeerManager; |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame] | 31 | import org.onosproject.bgpio.exceptions.BgpParseException; |
| 32 | import org.onosproject.bgpio.protocol.BgpMessage; |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 33 | import org.onosproject.bgpio.protocol.BgpUpdateMsg; |
| 34 | import org.onosproject.bgpio.types.BgpValueType; |
| 35 | import org.onosproject.bgpio.types.MpReachNlri; |
| 36 | import org.onosproject.bgpio.types.MpUnReachNlri; |
Satish K | e107e66 | 2015-09-21 19:00:17 +0530 | [diff] [blame] | 37 | import org.slf4j.Logger; |
| 38 | import org.slf4j.LoggerFactory; |
| 39 | |
Jonathan Hart | 51539b8 | 2015-10-29 09:53:04 -0700 | [diff] [blame] | 40 | import java.util.Iterator; |
mohamedrahil | 00f6f26 | 2016-11-24 20:20:41 +0530 | [diff] [blame^] | 41 | import java.util.LinkedList; |
| 42 | import java.util.Map; |
| 43 | import java.util.TreeMap; |
Jonathan Hart | 51539b8 | 2015-10-29 09:53:04 -0700 | [diff] [blame] | 44 | import java.util.List; |
| 45 | import java.util.Set; |
| 46 | import java.util.concurrent.ConcurrentHashMap; |
| 47 | import java.util.concurrent.CopyOnWriteArraySet; |
| 48 | import java.util.concurrent.locks.Lock; |
| 49 | import java.util.concurrent.locks.ReentrantLock; |
| 50 | |
Satish K | e107e66 | 2015-09-21 19:00:17 +0530 | [diff] [blame] | 51 | @Component(immediate = true) |
| 52 | @Service |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame] | 53 | public class BgpControllerImpl implements BgpController { |
Satish K | e107e66 | 2015-09-21 19:00:17 +0530 | [diff] [blame] | 54 | |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame] | 55 | private static final Logger log = LoggerFactory.getLogger(BgpControllerImpl.class); |
mohamedrahil | 00f6f26 | 2016-11-24 20:20:41 +0530 | [diff] [blame^] | 56 | final Controller ctrl = new Controller(this); |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame] | 57 | protected ConcurrentHashMap<BgpId, BgpPeer> connectedPeers = new ConcurrentHashMap<BgpId, BgpPeer>(); |
Satish K | e107e66 | 2015-09-21 19:00:17 +0530 | [diff] [blame] | 58 | |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame] | 59 | protected BgpPeerManagerImpl peerManager = new BgpPeerManagerImpl(); |
Shashikanth VH | f62b5c0 | 2015-11-20 22:23:08 +0530 | [diff] [blame] | 60 | |
Jonathan Hart | 51539b8 | 2015-10-29 09:53:04 -0700 | [diff] [blame] | 61 | private BgpLocalRib bgplocalRib = new BgpLocalRibImpl(this); |
| 62 | private BgpLocalRib bgplocalRibVpn = new BgpLocalRibImpl(this); |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 63 | |
Shashikanth VH | f62b5c0 | 2015-11-20 22:23:08 +0530 | [diff] [blame] | 64 | protected Set<BgpNodeListener> bgpNodeListener = new CopyOnWriteArraySet<>(); |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 65 | protected Set<BgpLinkListener> bgpLinkListener = new CopyOnWriteArraySet<>(); |
mohamedrahil | 00f6f26 | 2016-11-24 20:20:41 +0530 | [diff] [blame^] | 66 | protected BgpController bgpController; |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 67 | private BgpConfig bgpconfig = new BgpConfig(this); |
mohamedrahil | 00f6f26 | 2016-11-24 20:20:41 +0530 | [diff] [blame^] | 68 | private List<String> activeExceptionList = new LinkedList(); |
| 69 | private LinkedList<String> closedExceptionList = new LinkedList<String>(); |
| 70 | private Map<String, List<String>> activeSessionExceptionMap = new TreeMap<>(); |
| 71 | private Map<String, List<String>> closedSessionExceptionMap = new TreeMap<>(); |
| 72 | |
| 73 | @Override |
| 74 | public void activeSessionExceptionAdd(String peerId, String exception) { |
| 75 | if (peerId != null) { |
| 76 | activeExceptionList.add(exception); |
| 77 | activeSessionExceptionMap.put(peerId, activeExceptionList); |
| 78 | } else { |
| 79 | log.debug("Peer Id is null"); |
| 80 | } |
| 81 | if (activeExceptionList.size() > 10) { |
| 82 | activeExceptionList.clear(); |
| 83 | activeExceptionList.add(exception); |
| 84 | activeSessionExceptionMap.put(peerId, activeExceptionList); |
| 85 | } |
| 86 | } |
| 87 | |
| 88 | |
| 89 | @Override |
| 90 | public void closedSessionExceptionAdd(String peerId, String exception) { |
| 91 | if (peerId != null) { |
| 92 | closedExceptionList.add(exception); |
| 93 | closedSessionExceptionMap.put(peerId, closedExceptionList); |
| 94 | } else { |
| 95 | log.debug("Peer Id is null"); |
| 96 | } |
| 97 | if (closedExceptionList.size() > 10) { |
| 98 | closedExceptionList.clear(); |
| 99 | closedExceptionList.add(exception); |
| 100 | closedSessionExceptionMap.put(peerId, closedExceptionList); |
| 101 | } |
| 102 | } |
| 103 | |
| 104 | @Override |
| 105 | public Map<String, List<String>> activeSessionMap() { |
| 106 | return activeSessionExceptionMap; |
| 107 | } |
| 108 | |
| 109 | @Override |
| 110 | public Map<String, List<String>> closedSessionMap() { |
| 111 | return closedSessionExceptionMap; |
| 112 | } |
Satish K | e107e66 | 2015-09-21 19:00:17 +0530 | [diff] [blame] | 113 | |
| 114 | @Activate |
| 115 | public void activate() { |
| 116 | this.ctrl.start(); |
| 117 | log.info("Started"); |
| 118 | } |
| 119 | |
| 120 | @Deactivate |
| 121 | public void deactivate() { |
mohamedrahil | 00f6f26 | 2016-11-24 20:20:41 +0530 | [diff] [blame^] | 122 | activeSessionExceptionMap.clear(); |
| 123 | closedSessionExceptionMap.clear(); |
Satish K | e107e66 | 2015-09-21 19:00:17 +0530 | [diff] [blame] | 124 | // Close all connected peers |
Shashikanth VH | 6de20d3 | 2015-10-09 12:04:13 +0530 | [diff] [blame] | 125 | closeConnectedPeers(); |
Satish K | e107e66 | 2015-09-21 19:00:17 +0530 | [diff] [blame] | 126 | this.ctrl.stop(); |
| 127 | log.info("Stopped"); |
| 128 | } |
| 129 | |
| 130 | @Override |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame] | 131 | public Iterable<BgpPeer> getPeers() { |
Shashikanth VH | 6de20d3 | 2015-10-09 12:04:13 +0530 | [diff] [blame] | 132 | return this.connectedPeers.values(); |
| 133 | } |
| 134 | |
| 135 | @Override |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame] | 136 | public BgpPeer getPeer(BgpId bgpId) { |
Shashikanth VH | 6de20d3 | 2015-10-09 12:04:13 +0530 | [diff] [blame] | 137 | return this.connectedPeers.get(bgpId); |
| 138 | } |
| 139 | |
| 140 | @Override |
Shashikanth VH | f62b5c0 | 2015-11-20 22:23:08 +0530 | [diff] [blame] | 141 | public void addListener(BgpNodeListener listener) { |
| 142 | this.bgpNodeListener.add(listener); |
| 143 | } |
| 144 | |
| 145 | @Override |
| 146 | public void removeListener(BgpNodeListener listener) { |
| 147 | this.bgpNodeListener.remove(listener); |
| 148 | } |
| 149 | |
| 150 | @Override |
| 151 | public Set<BgpNodeListener> listener() { |
| 152 | return bgpNodeListener; |
| 153 | } |
| 154 | |
| 155 | @Override |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame] | 156 | public void writeMsg(BgpId bgpId, BgpMessage msg) { |
Shashikanth VH | 9f8afb4 | 2015-11-04 18:00:30 +0530 | [diff] [blame] | 157 | this.getPeer(bgpId).sendMessage(msg); |
Satish K | e107e66 | 2015-09-21 19:00:17 +0530 | [diff] [blame] | 158 | } |
| 159 | |
| 160 | @Override |
Jonathan Hart | 51539b8 | 2015-10-29 09:53:04 -0700 | [diff] [blame] | 161 | public void processBgpPacket(BgpId bgpId, BgpMessage msg) throws BgpParseException { |
Satish K | e107e66 | 2015-09-21 19:00:17 +0530 | [diff] [blame] | 162 | |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 163 | BgpPeer peer = getPeer(bgpId); |
| 164 | |
Satish K | e107e66 | 2015-09-21 19:00:17 +0530 | [diff] [blame] | 165 | switch (msg.getType()) { |
| 166 | case OPEN: |
| 167 | // TODO: Process Open message |
| 168 | break; |
| 169 | case KEEP_ALIVE: |
| 170 | // TODO: Process keepalive message |
| 171 | break; |
| 172 | case NOTIFICATION: |
| 173 | // TODO: Process notificatoin message |
| 174 | break; |
| 175 | case UPDATE: |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 176 | BgpUpdateMsg updateMsg = (BgpUpdateMsg) msg; |
| 177 | List<BgpValueType> pathAttr = updateMsg.bgpPathAttributes().pathAttributes(); |
| 178 | if (pathAttr == null) { |
| 179 | log.debug("llPathAttr is null, cannot process update message"); |
| 180 | break; |
| 181 | } |
| 182 | Iterator<BgpValueType> listIterator = pathAttr.iterator(); |
| 183 | boolean isLinkstate = false; |
Shashikanth VH | 26fd38a | 2016-04-26 18:11:37 +0530 | [diff] [blame] | 184 | |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 185 | while (listIterator.hasNext()) { |
| 186 | BgpValueType attr = listIterator.next(); |
Shashikanth VH | afb2e00 | 2016-02-12 14:48:29 +0530 | [diff] [blame] | 187 | if (attr instanceof MpReachNlri) { |
| 188 | MpReachNlri mpReach = (MpReachNlri) attr; |
Shashikanth VH | 26fd38a | 2016-04-26 18:11:37 +0530 | [diff] [blame] | 189 | if (mpReach.bgpFlowSpecNlri() == null) { |
Shashikanth VH | afb2e00 | 2016-02-12 14:48:29 +0530 | [diff] [blame] | 190 | isLinkstate = true; |
| 191 | } |
| 192 | } else if (attr instanceof MpUnReachNlri) { |
| 193 | MpUnReachNlri mpUnReach = (MpUnReachNlri) attr; |
Shashikanth VH | 26fd38a | 2016-04-26 18:11:37 +0530 | [diff] [blame] | 194 | if (mpUnReach.bgpFlowSpecNlri() == null) { |
Shashikanth VH | afb2e00 | 2016-02-12 14:48:29 +0530 | [diff] [blame] | 195 | isLinkstate = true; |
| 196 | } |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 197 | } |
| 198 | } |
| 199 | if (isLinkstate) { |
| 200 | peer.buildAdjRibIn(pathAttr); |
| 201 | } |
Satish K | e107e66 | 2015-09-21 19:00:17 +0530 | [diff] [blame] | 202 | break; |
| 203 | default: |
| 204 | // TODO: Process other message |
| 205 | break; |
| 206 | } |
| 207 | } |
| 208 | |
Shashikanth VH | 6de20d3 | 2015-10-09 12:04:13 +0530 | [diff] [blame] | 209 | @Override |
| 210 | public void closeConnectedPeers() { |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame] | 211 | BgpPeer bgpPeer; |
| 212 | for (BgpId id : this.connectedPeers.keySet()) { |
Shashikanth VH | 6de20d3 | 2015-10-09 12:04:13 +0530 | [diff] [blame] | 213 | bgpPeer = getPeer(id); |
| 214 | bgpPeer.disconnectPeer(); |
| 215 | } |
| 216 | } |
| 217 | |
Satish K | e107e66 | 2015-09-21 19:00:17 +0530 | [diff] [blame] | 218 | /** |
Shashikanth VH | 6de20d3 | 2015-10-09 12:04:13 +0530 | [diff] [blame] | 219 | * Implementation of an BGP Peer which is responsible for keeping track of connected peers and the state in which |
| 220 | * they are. |
Satish K | e107e66 | 2015-09-21 19:00:17 +0530 | [diff] [blame] | 221 | */ |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame] | 222 | public class BgpPeerManagerImpl implements BgpPeerManager { |
Shashikanth VH | 6de20d3 | 2015-10-09 12:04:13 +0530 | [diff] [blame] | 223 | |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame] | 224 | private final Logger log = LoggerFactory.getLogger(BgpPeerManagerImpl.class); |
Shashikanth VH | 6de20d3 | 2015-10-09 12:04:13 +0530 | [diff] [blame] | 225 | private final Lock peerLock = new ReentrantLock(); |
| 226 | |
Shashikanth VH | 9f8afb4 | 2015-11-04 18:00:30 +0530 | [diff] [blame] | 227 | @Override |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame] | 228 | public boolean addConnectedPeer(BgpId bgpId, BgpPeer bgpPeer) { |
Shashikanth VH | 6de20d3 | 2015-10-09 12:04:13 +0530 | [diff] [blame] | 229 | |
| 230 | if (connectedPeers.get(bgpId) != null) { |
| 231 | this.log.error("Trying to add connectedPeer but found previous " + "value for bgp ip: {}", |
| 232 | bgpId.toString()); |
| 233 | return false; |
| 234 | } else { |
| 235 | this.log.debug("Added Peer {}", bgpId.toString()); |
| 236 | connectedPeers.put(bgpId, bgpPeer); |
| 237 | return true; |
| 238 | } |
| 239 | } |
| 240 | |
Shashikanth VH | 9f8afb4 | 2015-11-04 18:00:30 +0530 | [diff] [blame] | 241 | @Override |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame] | 242 | public boolean isPeerConnected(BgpId bgpId) { |
Shashikanth VH | 6de20d3 | 2015-10-09 12:04:13 +0530 | [diff] [blame] | 243 | if (connectedPeers.get(bgpId) == null) { |
Shashikanth VH | 9f8afb4 | 2015-11-04 18:00:30 +0530 | [diff] [blame] | 244 | this.log.error("Is peer connected: bgpIp {}.", bgpId.toString()); |
Shashikanth VH | 6de20d3 | 2015-10-09 12:04:13 +0530 | [diff] [blame] | 245 | return false; |
| 246 | } |
| 247 | |
| 248 | return true; |
| 249 | } |
| 250 | |
Shashikanth VH | 9f8afb4 | 2015-11-04 18:00:30 +0530 | [diff] [blame] | 251 | @Override |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame] | 252 | public void removeConnectedPeer(BgpId bgpId) { |
Shashikanth VH | 6de20d3 | 2015-10-09 12:04:13 +0530 | [diff] [blame] | 253 | connectedPeers.remove(bgpId); |
| 254 | } |
| 255 | |
Shashikanth VH | 9f8afb4 | 2015-11-04 18:00:30 +0530 | [diff] [blame] | 256 | @Override |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame] | 257 | public BgpPeer getPeer(BgpId bgpId) { |
Shashikanth VH | 6de20d3 | 2015-10-09 12:04:13 +0530 | [diff] [blame] | 258 | return connectedPeers.get(bgpId); |
| 259 | } |
| 260 | |
| 261 | /** |
Shashikanth VH | 9f8afb4 | 2015-11-04 18:00:30 +0530 | [diff] [blame] | 262 | * Gets bgp peer instance. |
| 263 | * |
| 264 | * @param bgpController controller instance. |
| 265 | * @param sessionInfo bgp session info. |
| 266 | * @param pktStats packet statistics. |
| 267 | * @return BGPPeer peer instance. |
| 268 | */ |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame] | 269 | public BgpPeer getBgpPeerInstance(BgpController bgpController, BgpSessionInfoImpl sessionInfo, |
| 270 | BgpPacketStatsImpl pktStats) { |
| 271 | BgpPeer bgpPeer = new BgpPeerImpl(bgpController, sessionInfo, pktStats); |
Shashikanth VH | 6de20d3 | 2015-10-09 12:04:13 +0530 | [diff] [blame] | 272 | return bgpPeer; |
| 273 | } |
| 274 | |
| 275 | } |
| 276 | |
Vidyashree Rama | 7bd3d78 | 2015-11-23 08:46:33 +0530 | [diff] [blame] | 277 | /** |
| 278 | * Returns controller. |
| 279 | * |
| 280 | * @return controller |
| 281 | */ |
| 282 | public Controller controller() { |
| 283 | return this.ctrl; |
| 284 | } |
| 285 | |
Shashikanth VH | 9f8afb4 | 2015-11-04 18:00:30 +0530 | [diff] [blame] | 286 | @Override |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame] | 287 | public ConcurrentHashMap<BgpId, BgpPeer> connectedPeers() { |
Shashikanth VH | 6de20d3 | 2015-10-09 12:04:13 +0530 | [diff] [blame] | 288 | return connectedPeers; |
| 289 | } |
| 290 | |
Shashikanth VH | 9f8afb4 | 2015-11-04 18:00:30 +0530 | [diff] [blame] | 291 | @Override |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame] | 292 | public BgpPeerManagerImpl peerManager() { |
Shashikanth VH | 6de20d3 | 2015-10-09 12:04:13 +0530 | [diff] [blame] | 293 | return peerManager; |
| 294 | } |
| 295 | |
Satish K | e107e66 | 2015-09-21 19:00:17 +0530 | [diff] [blame] | 296 | @Override |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame] | 297 | public BgpCfg getConfig() { |
Satish K | e107e66 | 2015-09-21 19:00:17 +0530 | [diff] [blame] | 298 | return this.bgpconfig; |
| 299 | } |
Shashikanth VH | 6de20d3 | 2015-10-09 12:04:13 +0530 | [diff] [blame] | 300 | |
| 301 | @Override |
Shashikanth VH | 9f8afb4 | 2015-11-04 18:00:30 +0530 | [diff] [blame] | 302 | public int connectedPeerCount() { |
Shashikanth VH | 6de20d3 | 2015-10-09 12:04:13 +0530 | [diff] [blame] | 303 | return connectedPeers.size(); |
| 304 | } |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 305 | |
| 306 | /** |
| 307 | * Gets the BGP local RIB. |
| 308 | * |
| 309 | * @return bgplocalRIB BGP local RIB. |
| 310 | */ |
| 311 | @Override |
| 312 | public BgpLocalRib bgpLocalRib() { |
Jonathan Hart | 51539b8 | 2015-10-29 09:53:04 -0700 | [diff] [blame] | 313 | return bgplocalRib; |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 314 | } |
| 315 | |
| 316 | /** |
| 317 | * Gets the BGP local RIB with VPN. |
| 318 | * |
| 319 | * @return bgplocalRIBVpn BGP VPN local RIB . |
| 320 | */ |
| 321 | @Override |
| 322 | public BgpLocalRib bgpLocalRibVpn() { |
Jonathan Hart | 51539b8 | 2015-10-29 09:53:04 -0700 | [diff] [blame] | 323 | return bgplocalRibVpn; |
Shashikanth VH | 3fe3798 | 2015-11-30 11:50:07 +0530 | [diff] [blame] | 324 | } |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 325 | |
| 326 | @Override |
| 327 | public void addLinkListener(BgpLinkListener listener) { |
| 328 | this.bgpLinkListener.add(listener); |
| 329 | } |
| 330 | |
| 331 | @Override |
| 332 | public void removeLinkListener(BgpLinkListener listener) { |
| 333 | this.bgpLinkListener.remove(listener); |
| 334 | } |
| 335 | |
| 336 | @Override |
| 337 | public Set<BgpLinkListener> linkListener() { |
| 338 | return bgpLinkListener; |
| 339 | } |
Shashikanth VH | 9f8afb4 | 2015-11-04 18:00:30 +0530 | [diff] [blame] | 340 | } |