Shashikanth VH | 1ca26ce | 2015-11-20 23:19:49 +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 | 1ca26ce | 2015-11-20 23:19:49 +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.provider.bgp.topology.impl; |
| 15 | |
Ray Milkey | d84f89b | 2018-08-17 14:54:17 -0700 | [diff] [blame] | 16 | import org.osgi.service.component.annotations.Activate; |
| 17 | import org.osgi.service.component.annotations.Component; |
| 18 | import org.osgi.service.component.annotations.Deactivate; |
| 19 | import org.osgi.service.component.annotations.Reference; |
| 20 | import org.osgi.service.component.annotations.ReferenceCardinality; |
Satish K | 690d5cf | 2017-04-04 15:12:38 +0530 | [diff] [blame] | 21 | import org.onlab.packet.ChassisId; |
| 22 | import org.onlab.packet.Ip4Address; |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame] | 23 | import org.onosproject.bgp.controller.BgpController; |
Shashikanth VH | 1ca26ce | 2015-11-20 23:19:49 +0530 | [diff] [blame] | 24 | import org.onosproject.bgp.controller.BgpDpid; |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 25 | import org.onosproject.bgp.controller.BgpLinkListener; |
Shashikanth VH | 1ca26ce | 2015-11-20 23:19:49 +0530 | [diff] [blame] | 26 | import org.onosproject.bgp.controller.BgpNodeListener; |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 27 | import org.onosproject.bgpio.exceptions.BgpParseException; |
| 28 | import org.onosproject.bgpio.protocol.linkstate.BgpLinkLSIdentifier; |
| 29 | import org.onosproject.bgpio.protocol.linkstate.BgpLinkLsNlriVer4; |
| 30 | import org.onosproject.bgpio.protocol.linkstate.BgpNodeLSIdentifier; |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame] | 31 | import org.onosproject.bgpio.protocol.linkstate.BgpNodeLSNlriVer4; |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 32 | import org.onosproject.bgpio.protocol.linkstate.NodeDescriptors; |
| 33 | import org.onosproject.bgpio.protocol.linkstate.PathAttrNlriDetails; |
| 34 | import org.onosproject.bgpio.types.AutonomousSystemTlv; |
| 35 | import org.onosproject.bgpio.types.BgpLSIdentifierTlv; |
| 36 | import org.onosproject.bgpio.types.BgpValueType; |
| 37 | import org.onosproject.bgpio.types.IPv4AddressTlv; |
| 38 | import org.onosproject.bgpio.types.IsIsNonPseudonode; |
| 39 | import org.onosproject.bgpio.types.IsIsPseudonode; |
| 40 | import org.onosproject.bgpio.types.LinkLocalRemoteIdentifiersTlv; |
Priyanka B | 658aa698 | 2016-05-27 21:34:49 +0530 | [diff] [blame] | 41 | import org.onosproject.bgpio.types.LinkStateAttributes; |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 42 | import org.onosproject.bgpio.types.OspfNonPseudonode; |
| 43 | import org.onosproject.bgpio.types.OspfPseudonode; |
Priyanka B | 658aa698 | 2016-05-27 21:34:49 +0530 | [diff] [blame] | 44 | import org.onosproject.bgpio.types.attr.BgpAttrNodeFlagBitTlv; |
| 45 | import org.onosproject.bgpio.types.attr.BgpAttrNodeIsIsAreaId; |
| 46 | import org.onosproject.bgpio.types.attr.BgpAttrRouterIdV4; |
| 47 | import org.onosproject.bgpio.types.attr.BgpLinkAttrIgpMetric; |
| 48 | import org.onosproject.bgpio.types.attr.BgpLinkAttrMaxLinkBandwidth; |
| 49 | import org.onosproject.bgpio.types.attr.BgpLinkAttrTeDefaultMetric; |
Satish K | 690d5cf | 2017-04-04 15:12:38 +0530 | [diff] [blame] | 50 | import org.onosproject.bgpio.types.attr.BgpLinkAttrUnRsrvdLinkBandwidth; |
Priyanka B | 658aa698 | 2016-05-27 21:34:49 +0530 | [diff] [blame] | 51 | import org.onosproject.incubator.net.resource.label.LabelResourceAdminService; |
| 52 | import org.onosproject.incubator.net.resource.label.LabelResourceId; |
Priyanka B | 658aa698 | 2016-05-27 21:34:49 +0530 | [diff] [blame] | 53 | import org.onosproject.mastership.MastershipService; |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 54 | import org.onosproject.net.AnnotationKeys; |
| 55 | import org.onosproject.net.ConnectPoint; |
| 56 | import org.onosproject.net.DefaultAnnotations; |
Shashikanth VH | 1ca26ce | 2015-11-20 23:19:49 +0530 | [diff] [blame] | 57 | import org.onosproject.net.Device; |
| 58 | import org.onosproject.net.DeviceId; |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 59 | import org.onosproject.net.Link; |
Satish K | 690d5cf | 2017-04-04 15:12:38 +0530 | [diff] [blame] | 60 | import org.onosproject.net.LinkKey; |
Shashikanth VH | 1ca26ce | 2015-11-20 23:19:49 +0530 | [diff] [blame] | 61 | import org.onosproject.net.MastershipRole; |
Saurav Das | a2d3750 | 2016-03-25 17:50:40 -0700 | [diff] [blame] | 62 | import org.onosproject.net.PortNumber; |
Priyanka B | 658aa698 | 2016-05-27 21:34:49 +0530 | [diff] [blame] | 63 | import org.onosproject.net.config.NetworkConfigService; |
Shashikanth VH | 1ca26ce | 2015-11-20 23:19:49 +0530 | [diff] [blame] | 64 | import org.onosproject.net.device.DefaultDeviceDescription; |
Priyanka B | 658aa698 | 2016-05-27 21:34:49 +0530 | [diff] [blame] | 65 | import org.onosproject.net.device.DefaultPortDescription; |
Shashikanth VH | 1ca26ce | 2015-11-20 23:19:49 +0530 | [diff] [blame] | 66 | import org.onosproject.net.device.DeviceDescription; |
Priyanka B | 4c3b451 | 2016-07-22 11:41:49 +0530 | [diff] [blame] | 67 | import org.onosproject.net.device.DeviceEvent; |
| 68 | import org.onosproject.net.device.DeviceListener; |
Shashikanth VH | 1ca26ce | 2015-11-20 23:19:49 +0530 | [diff] [blame] | 69 | import org.onosproject.net.device.DeviceProvider; |
| 70 | import org.onosproject.net.device.DeviceProviderRegistry; |
| 71 | import org.onosproject.net.device.DeviceProviderService; |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 72 | import org.onosproject.net.device.DeviceService; |
Priyanka B | 658aa698 | 2016-05-27 21:34:49 +0530 | [diff] [blame] | 73 | import org.onosproject.net.device.PortDescription; |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 74 | import org.onosproject.net.link.DefaultLinkDescription; |
| 75 | import org.onosproject.net.link.LinkDescription; |
| 76 | import org.onosproject.net.link.LinkProvider; |
| 77 | import org.onosproject.net.link.LinkProviderRegistry; |
| 78 | import org.onosproject.net.link.LinkProviderService; |
| 79 | import org.onosproject.net.link.LinkService; |
Shashikanth VH | 1ca26ce | 2015-11-20 23:19:49 +0530 | [diff] [blame] | 80 | import org.onosproject.net.provider.AbstractProvider; |
| 81 | import org.onosproject.net.provider.ProviderId; |
Satish K | 690d5cf | 2017-04-04 15:12:38 +0530 | [diff] [blame] | 82 | import org.onosproject.pcep.api.TeLinkConfig; |
Shashikanth VH | 1ca26ce | 2015-11-20 23:19:49 +0530 | [diff] [blame] | 83 | import org.slf4j.Logger; |
| 84 | import org.slf4j.LoggerFactory; |
| 85 | |
Satish K | 690d5cf | 2017-04-04 15:12:38 +0530 | [diff] [blame] | 86 | import java.util.ArrayList; |
| 87 | import java.util.HashMap; |
| 88 | import java.util.List; |
| 89 | import java.util.Set; |
| 90 | |
| 91 | import static java.util.stream.Collectors.toList; |
| 92 | import static org.onosproject.bgp.controller.BgpDpid.uri; |
| 93 | import static org.onosproject.incubator.net.resource.label.LabelResourceId.labelResourceId; |
| 94 | import static org.onosproject.net.Device.Type.ROUTER; |
| 95 | import static org.onosproject.net.Device.Type.VIRTUAL; |
| 96 | import static org.onosproject.net.DeviceId.deviceId; |
| 97 | |
Shashikanth VH | 1ca26ce | 2015-11-20 23:19:49 +0530 | [diff] [blame] | 98 | /** |
| 99 | * Provider which uses an BGP controller to detect network infrastructure topology. |
| 100 | */ |
| 101 | @Component(immediate = true) |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 102 | public class BgpTopologyProvider extends AbstractProvider implements DeviceProvider, LinkProvider { |
Shashikanth VH | 1ca26ce | 2015-11-20 23:19:49 +0530 | [diff] [blame] | 103 | |
Priyanka B | 9bee080 | 2016-04-27 22:06:02 +0530 | [diff] [blame] | 104 | /** |
| 105 | * Creates an instance of BGP topology provider. |
| 106 | */ |
Shashikanth VH | 1ca26ce | 2015-11-20 23:19:49 +0530 | [diff] [blame] | 107 | public BgpTopologyProvider() { |
Priyanka B | 9bee080 | 2016-04-27 22:06:02 +0530 | [diff] [blame] | 108 | super(new ProviderId("l3", "org.onosproject.provider.bgp")); |
Shashikanth VH | 1ca26ce | 2015-11-20 23:19:49 +0530 | [diff] [blame] | 109 | } |
| 110 | |
| 111 | private static final Logger log = LoggerFactory.getLogger(BgpTopologyProvider.class); |
| 112 | |
Ray Milkey | d84f89b | 2018-08-17 14:54:17 -0700 | [diff] [blame] | 113 | @Reference(cardinality = ReferenceCardinality.MANDATORY) |
Shashikanth VH | 1ca26ce | 2015-11-20 23:19:49 +0530 | [diff] [blame] | 114 | protected DeviceProviderRegistry deviceProviderRegistry; |
| 115 | |
Ray Milkey | d84f89b | 2018-08-17 14:54:17 -0700 | [diff] [blame] | 116 | @Reference(cardinality = ReferenceCardinality.MANDATORY) |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 117 | protected LinkProviderRegistry linkProviderRegistry; |
| 118 | |
Ray Milkey | d84f89b | 2018-08-17 14:54:17 -0700 | [diff] [blame] | 119 | @Reference(cardinality = ReferenceCardinality.MANDATORY) |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame] | 120 | protected BgpController controller; |
Shashikanth VH | 1ca26ce | 2015-11-20 23:19:49 +0530 | [diff] [blame] | 121 | |
Ray Milkey | d84f89b | 2018-08-17 14:54:17 -0700 | [diff] [blame] | 122 | @Reference(cardinality = ReferenceCardinality.MANDATORY) |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 123 | protected LinkService linkService; |
| 124 | |
Ray Milkey | d84f89b | 2018-08-17 14:54:17 -0700 | [diff] [blame] | 125 | @Reference(cardinality = ReferenceCardinality.MANDATORY) |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 126 | protected DeviceService deviceService; |
| 127 | |
Ray Milkey | d84f89b | 2018-08-17 14:54:17 -0700 | [diff] [blame] | 128 | @Reference(cardinality = ReferenceCardinality.MANDATORY) |
Priyanka B | 658aa698 | 2016-05-27 21:34:49 +0530 | [diff] [blame] | 129 | protected MastershipService mastershipService; |
| 130 | |
Ray Milkey | d84f89b | 2018-08-17 14:54:17 -0700 | [diff] [blame] | 131 | @Reference(cardinality = ReferenceCardinality.MANDATORY) |
Priyanka B | 658aa698 | 2016-05-27 21:34:49 +0530 | [diff] [blame] | 132 | protected LabelResourceAdminService labelResourceAdminService; |
| 133 | |
Ray Milkey | d84f89b | 2018-08-17 14:54:17 -0700 | [diff] [blame] | 134 | @Reference(cardinality = ReferenceCardinality.MANDATORY) |
Priyanka B | 658aa698 | 2016-05-27 21:34:49 +0530 | [diff] [blame] | 135 | protected NetworkConfigService networkConfigService; |
| 136 | |
Shashikanth VH | 1ca26ce | 2015-11-20 23:19:49 +0530 | [diff] [blame] | 137 | private DeviceProviderService deviceProviderService; |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 138 | private LinkProviderService linkProviderService; |
Shashikanth VH | 1ca26ce | 2015-11-20 23:19:49 +0530 | [diff] [blame] | 139 | |
Priyanka B | 4c3b451 | 2016-07-22 11:41:49 +0530 | [diff] [blame] | 140 | private DeviceListener deviceListener = new InternalDeviceListener(); |
Shashikanth VH | 1ca26ce | 2015-11-20 23:19:49 +0530 | [diff] [blame] | 141 | private InternalBgpProvider listener = new InternalBgpProvider(); |
| 142 | private static final String UNKNOWN = "unknown"; |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 143 | public static final long IDENTIFIER_SET = 0x100000000L; |
| 144 | public static final String AS_NUMBER = "asNumber"; |
| 145 | public static final String DOMAIN_IDENTIFIER = "domainIdentifier"; |
| 146 | public static final String ROUTING_UNIVERSE = "routingUniverse"; |
Priyanka B | 658aa698 | 2016-05-27 21:34:49 +0530 | [diff] [blame] | 147 | |
| 148 | public static final String EXTERNAL_BIT = "externalBit"; |
| 149 | public static final String ABR_BIT = "abrBit"; |
| 150 | public static final String INTERNAL_BIT = "internalBit"; |
| 151 | public static final String PSEUDO = "psuedo"; |
| 152 | public static final String AREAID = "areaId"; |
| 153 | public static final String LSRID = "lsrId"; |
| 154 | public static final String COST = "cost"; |
| 155 | public static final String TE_COST = "teCost"; |
| 156 | |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 157 | public static final long PSEUDO_PORT = 0xffffffff; |
Priyanka B | 658aa698 | 2016-05-27 21:34:49 +0530 | [diff] [blame] | 158 | public static final int DELAY = 2; |
| 159 | private LabelResourceId beginLabel = labelResourceId(5122); |
| 160 | private LabelResourceId endLabel = labelResourceId(9217); |
Priyanka B | 2312d22 | 2016-06-06 14:15:07 +0530 | [diff] [blame] | 161 | private HashMap<DeviceId, List<PortDescription>> portMap = new HashMap<>(); |
Shashikanth VH | 1ca26ce | 2015-11-20 23:19:49 +0530 | [diff] [blame] | 162 | |
| 163 | @Activate |
| 164 | public void activate() { |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 165 | log.debug("BgpTopologyProvider activate"); |
Shashikanth VH | 1ca26ce | 2015-11-20 23:19:49 +0530 | [diff] [blame] | 166 | deviceProviderService = deviceProviderRegistry.register(this); |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 167 | linkProviderService = linkProviderRegistry.register(this); |
Shashikanth VH | 1ca26ce | 2015-11-20 23:19:49 +0530 | [diff] [blame] | 168 | controller.addListener(listener); |
Priyanka B | 4c3b451 | 2016-07-22 11:41:49 +0530 | [diff] [blame] | 169 | deviceService.addListener(deviceListener); |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 170 | controller.addLinkListener(listener); |
Shashikanth VH | 1ca26ce | 2015-11-20 23:19:49 +0530 | [diff] [blame] | 171 | } |
| 172 | |
| 173 | @Deactivate |
| 174 | public void deactivate() { |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 175 | log.debug("BgpTopologyProvider deactivate"); |
| 176 | deviceProviderRegistry.unregister(this); |
| 177 | deviceProviderService = null; |
| 178 | linkProviderRegistry.unregister(this); |
| 179 | linkProviderService = null; |
Shashikanth VH | 1ca26ce | 2015-11-20 23:19:49 +0530 | [diff] [blame] | 180 | controller.removeListener(listener); |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 181 | controller.removeLinkListener(listener); |
Priyanka B | 4c3b451 | 2016-07-22 11:41:49 +0530 | [diff] [blame] | 182 | deviceService.removeListener(deviceListener); |
Priyanka B | 658aa698 | 2016-05-27 21:34:49 +0530 | [diff] [blame] | 183 | } |
| 184 | |
Priyanka B | 4c3b451 | 2016-07-22 11:41:49 +0530 | [diff] [blame] | 185 | private class InternalDeviceListener implements DeviceListener { |
Priyanka B | 658aa698 | 2016-05-27 21:34:49 +0530 | [diff] [blame] | 186 | @Override |
Thomas Vachuska | 5b38dc0 | 2018-05-10 15:24:40 -0700 | [diff] [blame] | 187 | public boolean isRelevant(DeviceEvent event) { |
| 188 | return event.type() == DeviceEvent.Type.DEVICE_ADDED && |
| 189 | mastershipService.isLocalMaster(event.subject().id()); |
| 190 | } |
| 191 | |
| 192 | @Override |
Priyanka B | 4c3b451 | 2016-07-22 11:41:49 +0530 | [diff] [blame] | 193 | public void event(DeviceEvent event) { |
| 194 | Device device = event.subject(); |
Thomas Vachuska | 5b38dc0 | 2018-05-10 15:24:40 -0700 | [diff] [blame] | 195 | // Reserve device label pool for L3 devices |
| 196 | if (device.annotations().value(LSRID) != null) { |
| 197 | createDevicePool(device.id()); |
Priyanka B | 658aa698 | 2016-05-27 21:34:49 +0530 | [diff] [blame] | 198 | } |
| 199 | } |
Shashikanth VH | 1ca26ce | 2015-11-20 23:19:49 +0530 | [diff] [blame] | 200 | } |
| 201 | |
| 202 | /* |
| 203 | * Implements device and link update. |
| 204 | */ |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 205 | private class InternalBgpProvider implements BgpNodeListener, BgpLinkListener { |
Shashikanth VH | 1ca26ce | 2015-11-20 23:19:49 +0530 | [diff] [blame] | 206 | |
| 207 | @Override |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 208 | public void addNode(BgpNodeLSNlriVer4 nodeNlri, PathAttrNlriDetails details) { |
Shashikanth VH | 1ca26ce | 2015-11-20 23:19:49 +0530 | [diff] [blame] | 209 | log.debug("Add node {}", nodeNlri.toString()); |
| 210 | |
Priyanka B | 658aa698 | 2016-05-27 21:34:49 +0530 | [diff] [blame] | 211 | if (deviceProviderService == null || deviceService == null) { |
Shashikanth VH | 1ca26ce | 2015-11-20 23:19:49 +0530 | [diff] [blame] | 212 | return; |
| 213 | } |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 214 | Device.Type deviceType = ROUTER; |
Shashikanth VH | 1ca26ce | 2015-11-20 23:19:49 +0530 | [diff] [blame] | 215 | BgpDpid nodeUri = new BgpDpid(nodeNlri); |
| 216 | DeviceId deviceId = deviceId(uri(nodeUri.toString())); |
| 217 | ChassisId cId = new ChassisId(); |
| 218 | |
Priyanka B | 658aa698 | 2016-05-27 21:34:49 +0530 | [diff] [blame] | 219 | /* |
| 220 | * Check if device is already there (available) , if yes not updating to core. |
| 221 | */ |
| 222 | if (deviceService.isAvailable(deviceId)) { |
| 223 | return; |
| 224 | } |
| 225 | |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 226 | DefaultAnnotations.Builder newBuilder = DefaultAnnotations.builder(); |
| 227 | |
| 228 | newBuilder.set(AnnotationKeys.TYPE, "L3"); |
| 229 | newBuilder.set(ROUTING_UNIVERSE, Long.toString(nodeNlri.getIdentifier())); |
| 230 | |
| 231 | List<BgpValueType> tlvs = nodeNlri.getLocalNodeDescriptors().getNodedescriptors().getSubTlvs(); |
| 232 | for (BgpValueType tlv : tlvs) { |
| 233 | if (tlv instanceof AutonomousSystemTlv) { |
| 234 | newBuilder.set(AS_NUMBER, Integer.toString(((AutonomousSystemTlv) tlv).getAsNum())); |
| 235 | } else if (tlv instanceof BgpLSIdentifierTlv) { |
| 236 | newBuilder.set(DOMAIN_IDENTIFIER, |
| 237 | Integer.toString(((BgpLSIdentifierTlv) tlv).getBgpLsIdentifier())); |
| 238 | } |
| 239 | if (tlv.getType() == NodeDescriptors.IGP_ROUTERID_TYPE) { |
| 240 | if (tlv instanceof IsIsPseudonode) { |
| 241 | deviceType = VIRTUAL; |
Priyanka B | 19c0873 | 2016-06-04 21:11:19 +0530 | [diff] [blame] | 242 | newBuilder.set(AnnotationKeys.ROUTER_ID, nodeUri.isoNodeIdString(((IsIsPseudonode) tlv) |
| 243 | .getIsoNodeId())); |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 244 | } else if (tlv instanceof OspfPseudonode) { |
| 245 | deviceType = VIRTUAL; |
| 246 | newBuilder |
| 247 | .set(AnnotationKeys.ROUTER_ID, Integer.toString(((OspfPseudonode) tlv).getrouterID())); |
| 248 | } else if (tlv instanceof IsIsNonPseudonode) { |
Priyanka B | 19c0873 | 2016-06-04 21:11:19 +0530 | [diff] [blame] | 249 | newBuilder.set(AnnotationKeys.ROUTER_ID, nodeUri.isoNodeIdString(((IsIsNonPseudonode) tlv) |
| 250 | .getIsoNodeId())); |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 251 | } else if (tlv instanceof OspfNonPseudonode) { |
| 252 | newBuilder.set(AnnotationKeys.ROUTER_ID, |
| 253 | Integer.toString(((OspfNonPseudonode) tlv).getrouterID())); |
| 254 | } |
| 255 | } |
| 256 | } |
Priyanka B | 658aa698 | 2016-05-27 21:34:49 +0530 | [diff] [blame] | 257 | DefaultAnnotations.Builder anntotations = DefaultAnnotations.builder(); |
| 258 | anntotations = getAnnotations(newBuilder, true, details); |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 259 | |
| 260 | DeviceDescription description = new DefaultDeviceDescription(uri(nodeUri.toString()), deviceType, UNKNOWN, |
Priyanka B | 658aa698 | 2016-05-27 21:34:49 +0530 | [diff] [blame] | 261 | UNKNOWN, UNKNOWN, UNKNOWN, cId, anntotations.build()); |
Shashikanth VH | 1ca26ce | 2015-11-20 23:19:49 +0530 | [diff] [blame] | 262 | |
Priyanka B | 658aa698 | 2016-05-27 21:34:49 +0530 | [diff] [blame] | 263 | deviceProviderService.deviceConnected(deviceId, description); |
Shashikanth VH | 1ca26ce | 2015-11-20 23:19:49 +0530 | [diff] [blame] | 264 | } |
| 265 | |
| 266 | @Override |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame] | 267 | public void deleteNode(BgpNodeLSNlriVer4 nodeNlri) { |
Shashikanth VH | 1ca26ce | 2015-11-20 23:19:49 +0530 | [diff] [blame] | 268 | log.debug("Delete node {}", nodeNlri.toString()); |
| 269 | |
| 270 | if (deviceProviderService == null) { |
| 271 | return; |
| 272 | } |
| 273 | |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 274 | BgpDpid deviceUri = new BgpDpid(nodeNlri); |
| 275 | DeviceId deviceId = deviceId(uri(deviceUri.toString())); |
Priyanka B | 658aa698 | 2016-05-27 21:34:49 +0530 | [diff] [blame] | 276 | |
| 277 | if (labelResourceAdminService != null) { |
| 278 | //Destroy local device label pool reserved for that device |
| 279 | labelResourceAdminService.destroyDevicePool(deviceId); |
| 280 | } |
| 281 | |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 282 | deviceProviderService.deviceDisconnected(deviceId); |
| 283 | } |
| 284 | |
Priyanka B | 2312d22 | 2016-06-06 14:15:07 +0530 | [diff] [blame] | 285 | private List<PortDescription> buildPortDescriptions(DeviceId deviceId, |
| 286 | PortNumber portNumber) { |
| 287 | |
| 288 | List<PortDescription> portList; |
| 289 | |
| 290 | if (portMap.containsKey(deviceId)) { |
| 291 | portList = portMap.get(deviceId); |
| 292 | } else { |
| 293 | portList = new ArrayList<>(); |
| 294 | } |
| 295 | if (portNumber != null) { |
Yuta HIGUCHI | 53e4796 | 2018-03-01 23:50:48 -0800 | [diff] [blame] | 296 | PortDescription portDescriptions = DefaultPortDescription.builder().withPortNumber(portNumber) |
| 297 | .isEnabled(true).build(); |
Priyanka B | 2312d22 | 2016-06-06 14:15:07 +0530 | [diff] [blame] | 298 | portList.add(portDescriptions); |
| 299 | } |
| 300 | |
| 301 | portMap.put(deviceId, portList); |
| 302 | return portList; |
| 303 | } |
| 304 | |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 305 | @Override |
| 306 | public void addLink(BgpLinkLsNlriVer4 linkNlri, PathAttrNlriDetails details) throws BgpParseException { |
| 307 | log.debug("Addlink {}", linkNlri.toString()); |
| 308 | |
Priyanka B | 2312d22 | 2016-06-06 14:15:07 +0530 | [diff] [blame] | 309 | LinkDescription linkDes = buildLinkDes(linkNlri, details, true); |
| 310 | |
Satish K | 690d5cf | 2017-04-04 15:12:38 +0530 | [diff] [blame] | 311 | |
Priyanka B | 658aa698 | 2016-05-27 21:34:49 +0530 | [diff] [blame] | 312 | |
| 313 | /* |
| 314 | * Update link ports and configure bandwidth on source and destination port using networkConfig service |
| 315 | * Only master of source link registers for bandwidth |
| 316 | */ |
| 317 | if (mastershipService.isLocalMaster(linkDes.src().deviceId())) { |
Satish K | 690d5cf | 2017-04-04 15:12:38 +0530 | [diff] [blame] | 318 | registerBandwidthAndTeMetric(linkDes, details); |
Priyanka B | 658aa698 | 2016-05-27 21:34:49 +0530 | [diff] [blame] | 319 | } |
| 320 | |
| 321 | //Updating ports of the link |
Priyanka B | 2312d22 | 2016-06-06 14:15:07 +0530 | [diff] [blame] | 322 | deviceProviderService.updatePorts(linkDes.src().deviceId(), buildPortDescriptions(linkDes.src().deviceId(), |
| 323 | linkDes.src().port())); |
Priyanka B | 658aa698 | 2016-05-27 21:34:49 +0530 | [diff] [blame] | 324 | |
Priyanka B | 2312d22 | 2016-06-06 14:15:07 +0530 | [diff] [blame] | 325 | deviceProviderService.updatePorts(linkDes.dst().deviceId(), buildPortDescriptions(linkDes.dst().deviceId(), |
| 326 | linkDes.dst().port())); |
Priyanka B | 658aa698 | 2016-05-27 21:34:49 +0530 | [diff] [blame] | 327 | |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 328 | linkProviderService.linkDetected(linkDes); |
| 329 | } |
| 330 | |
| 331 | //Build link description. |
| 332 | private LinkDescription buildLinkDes(BgpLinkLsNlriVer4 linkNlri, PathAttrNlriDetails details, boolean isAddLink) |
| 333 | throws BgpParseException { |
| 334 | long srcAddress = 0; |
| 335 | long dstAddress = 0; |
| 336 | boolean localPseduo = false; |
| 337 | boolean remotePseduo = false; |
| 338 | |
| 339 | List<BgpValueType> localTlvs = linkNlri.getLinkIdentifier().localNodeDescriptors().getSubTlvs(); |
| 340 | for (BgpValueType localTlv : localTlvs) { |
| 341 | if (localTlv instanceof IsIsPseudonode || localTlv instanceof OspfPseudonode) { |
| 342 | localPseduo = true; |
| 343 | } |
| 344 | } |
| 345 | List<BgpValueType> remoteTlvs = linkNlri.getLinkIdentifier().remoteNodeDescriptors().getSubTlvs(); |
| 346 | for (BgpValueType remoteTlv : remoteTlvs) { |
| 347 | if (remoteTlv instanceof IsIsPseudonode || remoteTlv instanceof OspfPseudonode) { |
| 348 | remotePseduo = true; |
| 349 | } |
| 350 | } |
| 351 | |
| 352 | List<BgpValueType> tlvs = linkNlri.getLinkIdentifier().linkDescriptors(); |
| 353 | for (BgpValueType tlv : tlvs) { |
| 354 | if (tlv instanceof LinkLocalRemoteIdentifiersTlv) { |
| 355 | srcAddress = ((LinkLocalRemoteIdentifiersTlv) tlv).getLinkLocalIdentifier(); |
| 356 | //Set 32nd bit. |
| 357 | srcAddress = srcAddress | IDENTIFIER_SET; |
| 358 | dstAddress = ((LinkLocalRemoteIdentifiersTlv) tlv).getLinkRemoteIdentifier(); |
| 359 | dstAddress = dstAddress | IDENTIFIER_SET; |
| 360 | } else if (tlv instanceof IPv4AddressTlv) { |
| 361 | if (tlv.getType() == BgpLinkLSIdentifier.IPV4_INTERFACE_ADDRESS_TYPE) { |
| 362 | srcAddress = ((IPv4AddressTlv) tlv).address().toInt(); |
| 363 | } else { |
| 364 | dstAddress = ((IPv4AddressTlv) tlv).address().toInt(); |
| 365 | } |
| 366 | } |
| 367 | } |
| 368 | |
| 369 | DeviceId srcId = deviceId(uri(new BgpDpid(linkNlri, BgpDpid.NODE_DESCRIPTOR_LOCAL).toString())); |
| 370 | DeviceId dstId = deviceId(uri(new BgpDpid(linkNlri, BgpDpid.NODE_DESCRIPTOR_REMOTE).toString())); |
| 371 | |
| 372 | if (localPseduo && srcAddress == 0) { |
| 373 | srcAddress = PSEUDO_PORT; |
| 374 | } else if (remotePseduo && dstAddress == 0) { |
| 375 | dstAddress = PSEUDO_PORT; |
| 376 | } |
| 377 | |
| 378 | ConnectPoint src = new ConnectPoint(srcId, PortNumber.portNumber(srcAddress)); |
| 379 | ConnectPoint dst = new ConnectPoint(dstId, PortNumber.portNumber(dstAddress)); |
| 380 | BgpNodeLSNlriVer4 srcNodeNlri = new BgpNodeLSNlriVer4(linkNlri.getIdentifier(), linkNlri.getProtocolId() |
| 381 | .getType(), new BgpNodeLSIdentifier(linkNlri.getLinkIdentifier().localNodeDescriptors()), false, |
| 382 | linkNlri.getRouteDistinguisher()); |
| 383 | |
| 384 | BgpNodeLSNlriVer4 dstNodeNlri = new BgpNodeLSNlriVer4(linkNlri.getIdentifier(), linkNlri.getProtocolId() |
| 385 | .getType(), new BgpNodeLSIdentifier(linkNlri.getLinkIdentifier().remoteNodeDescriptors()), false, |
| 386 | linkNlri.getRouteDistinguisher()); |
| 387 | |
| 388 | addOrDeletePseudoNode(isAddLink, localPseduo, remotePseduo, srcNodeNlri, |
| 389 | dstNodeNlri, srcId, dstId, details); |
Priyanka B | 658aa698 | 2016-05-27 21:34:49 +0530 | [diff] [blame] | 390 | DefaultAnnotations.Builder annotationBuilder = DefaultAnnotations.builder(); |
| 391 | if (details != null) { |
| 392 | annotationBuilder = getAnnotations(annotationBuilder, false, details); |
| 393 | } |
| 394 | |
| 395 | return new DefaultLinkDescription(src, dst, Link.Type.DIRECT, false, annotationBuilder.build()); |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 396 | } |
| 397 | |
| 398 | private void addOrDeletePseudoNode(boolean isAddLink, boolean localPseduo, boolean remotePseduo, |
| 399 | BgpNodeLSNlriVer4 srcNodeNlri, BgpNodeLSNlriVer4 dstNodeNlri, DeviceId srcId, DeviceId dstId, |
| 400 | PathAttrNlriDetails details) { |
| 401 | if (isAddLink) { |
| 402 | if (localPseduo) { |
| 403 | if (deviceService.getDevice(srcId) == null) { |
| 404 | for (BgpNodeListener l : controller.listener()) { |
| 405 | l.addNode(srcNodeNlri, details); |
| 406 | } |
| 407 | } |
| 408 | } else if (remotePseduo) { |
| 409 | if (deviceService.getDevice(dstId) == null) { |
| 410 | for (BgpNodeListener l : controller.listener()) { |
| 411 | l.addNode(dstNodeNlri, details); |
| 412 | } |
| 413 | } |
| 414 | } |
| 415 | } else { |
| 416 | if (localPseduo) { |
| 417 | Set<Link> links = linkService.getDeviceLinks(srcId); |
| 418 | if (links == null || links.isEmpty()) { |
| 419 | for (BgpNodeListener l : controller.listener()) { |
| 420 | l.deleteNode(srcNodeNlri); |
| 421 | } |
| 422 | } |
| 423 | } else if (remotePseduo) { |
| 424 | log.info("Remote pseudo delete link "); |
| 425 | Set<Link> links = linkService.getDeviceLinks(dstId); |
| 426 | if (links == null || links.isEmpty()) { |
| 427 | for (BgpNodeListener l : controller.listener()) { |
| 428 | l.deleteNode(dstNodeNlri); |
| 429 | } |
| 430 | } |
| 431 | } |
| 432 | } |
| 433 | } |
| 434 | |
| 435 | @Override |
| 436 | public void deleteLink(BgpLinkLsNlriVer4 linkNlri) throws BgpParseException { |
| 437 | log.debug("Delete link {}", linkNlri.toString()); |
| 438 | |
| 439 | if (linkProviderService == null) { |
| 440 | return; |
| 441 | } |
| 442 | |
| 443 | LinkDescription linkDes = buildLinkDes(linkNlri, null, false); |
Priyanka B | 658aa698 | 2016-05-27 21:34:49 +0530 | [diff] [blame] | 444 | |
| 445 | /* |
| 446 | * Only master for the link src will release the bandwidth resource. |
| 447 | */ |
| 448 | if (networkConfigService != null && mastershipService.isLocalMaster(linkDes.src().deviceId())) { |
| 449 | // Releases registered resource for this link |
Satish K | 690d5cf | 2017-04-04 15:12:38 +0530 | [diff] [blame] | 450 | networkConfigService.removeConfig(LinkKey.linkKey(linkDes.src(), linkDes.dst()), TeLinkConfig.class); |
Priyanka B | 658aa698 | 2016-05-27 21:34:49 +0530 | [diff] [blame] | 451 | } |
| 452 | |
Priyanka B | fc51c95 | 2016-03-26 14:30:33 +0530 | [diff] [blame] | 453 | linkProviderService.linkVanished(linkDes); |
Priyanka B | 4c3b451 | 2016-07-22 11:41:49 +0530 | [diff] [blame] | 454 | |
| 455 | linkDes = new DefaultLinkDescription(linkDes.dst(), linkDes.src(), Link.Type.DIRECT, |
| 456 | false, linkDes.annotations()); |
| 457 | linkProviderService.linkVanished(linkDes); |
Satish K | 690d5cf | 2017-04-04 15:12:38 +0530 | [diff] [blame] | 458 | if (networkConfigService != null && mastershipService.isLocalMaster(linkDes.src().deviceId())) { |
| 459 | // Releases registered resource for this link |
| 460 | networkConfigService.removeConfig(LinkKey.linkKey(linkDes.src(), linkDes.dst()), TeLinkConfig.class); |
| 461 | } |
| 462 | |
Shashikanth VH | 1ca26ce | 2015-11-20 23:19:49 +0530 | [diff] [blame] | 463 | } |
Shashikanth VH | 1ca26ce | 2015-11-20 23:19:49 +0530 | [diff] [blame] | 464 | } |
| 465 | |
Priyanka B | 658aa698 | 2016-05-27 21:34:49 +0530 | [diff] [blame] | 466 | // Creates label resource pool for the specific device. For all devices label range is 5122-9217 |
| 467 | private void createDevicePool(DeviceId deviceId) { |
| 468 | if (labelResourceAdminService == null) { |
| 469 | return; |
| 470 | } |
| 471 | |
| 472 | labelResourceAdminService.createDevicePool(deviceId, beginLabel, endLabel); |
| 473 | } |
| 474 | |
Satish K | 690d5cf | 2017-04-04 15:12:38 +0530 | [diff] [blame] | 475 | private void registerBandwidthAndTeMetric(LinkDescription linkDes, PathAttrNlriDetails details) { |
Priyanka B | 658aa698 | 2016-05-27 21:34:49 +0530 | [diff] [blame] | 476 | if (details == null) { |
Thomas Vachuska | 5b38dc0 | 2018-05-10 15:24:40 -0700 | [diff] [blame] | 477 | log.error("Unable to register bandwidth "); |
Priyanka B | 658aa698 | 2016-05-27 21:34:49 +0530 | [diff] [blame] | 478 | return; |
| 479 | } |
| 480 | |
| 481 | List<BgpValueType> attribute = details.pathAttributes().stream() |
| 482 | .filter(attr -> attr instanceof LinkStateAttributes).collect(toList()); |
| 483 | if (attribute.isEmpty()) { |
| 484 | return; |
| 485 | } |
| 486 | |
| 487 | List<BgpValueType> tlvs = ((LinkStateAttributes) attribute.iterator().next()).linkStateAttributes(); |
Satish K | 690d5cf | 2017-04-04 15:12:38 +0530 | [diff] [blame] | 488 | double maxReservableBw = 0; |
| 489 | List<Float> unreservedBw = new ArrayList<>(); |
| 490 | int teMetric = 0; |
| 491 | int igpMetric = 0; |
Priyanka B | 658aa698 | 2016-05-27 21:34:49 +0530 | [diff] [blame] | 492 | |
| 493 | for (BgpValueType tlv : tlvs) { |
| 494 | switch (tlv.getType()) { |
| 495 | case LinkStateAttributes.ATTR_LINK_MAX_RES_BANDWIDTH: |
| 496 | maxReservableBw = ((BgpLinkAttrMaxLinkBandwidth) tlv).linkAttrMaxLinkBandwidth(); |
Priyanka B | c1e4e4c | 2016-07-01 14:57:19 +0530 | [diff] [blame] | 497 | //will get in bits/second , convert to MBPS to store in network config service |
| 498 | maxReservableBw = maxReservableBw / 1000000; |
Priyanka B | 658aa698 | 2016-05-27 21:34:49 +0530 | [diff] [blame] | 499 | break; |
Satish K | 690d5cf | 2017-04-04 15:12:38 +0530 | [diff] [blame] | 500 | case LinkStateAttributes.ATTR_LINK_UNRES_BANDWIDTH: |
| 501 | unreservedBw = ((BgpLinkAttrUnRsrvdLinkBandwidth) tlv).getLinkAttrUnRsrvdLinkBandwidth(); |
| 502 | break; |
| 503 | case LinkStateAttributes.ATTR_LINK_TE_DEFAULT_METRIC: |
| 504 | teMetric = ((BgpLinkAttrTeDefaultMetric) tlv).attrLinkDefTeMetric(); |
| 505 | break; |
| 506 | case LinkStateAttributes.ATTR_LINK_IGP_METRIC: |
| 507 | igpMetric = ((BgpLinkAttrIgpMetric) tlv).attrLinkIgpMetric(); |
| 508 | break; |
Priyanka B | 658aa698 | 2016-05-27 21:34:49 +0530 | [diff] [blame] | 509 | default: // do nothing |
| 510 | } |
| 511 | } |
| 512 | |
Satish K | 690d5cf | 2017-04-04 15:12:38 +0530 | [diff] [blame] | 513 | //Configure bandwidth for src and dst port |
| 514 | TeLinkConfig config = networkConfigService.addConfig(LinkKey.linkKey(linkDes.src(), linkDes.dst()), |
| 515 | TeLinkConfig.class); |
| 516 | Double bw = 0.0; |
| 517 | if (unreservedBw.size() > 0) { |
| 518 | bw = unreservedBw.get(0).doubleValue(); //Low priority |
Priyanka B | 658aa698 | 2016-05-27 21:34:49 +0530 | [diff] [blame] | 519 | } |
| 520 | |
Satish K | 690d5cf | 2017-04-04 15:12:38 +0530 | [diff] [blame] | 521 | config.maxResvBandwidth(maxReservableBw) |
| 522 | .unResvBandwidth(bw).teCost(teMetric).igpCost(igpMetric); |
| 523 | //.apply(); |
Priyanka B | 658aa698 | 2016-05-27 21:34:49 +0530 | [diff] [blame] | 524 | |
Satish K | 690d5cf | 2017-04-04 15:12:38 +0530 | [diff] [blame] | 525 | networkConfigService.applyConfig(LinkKey.linkKey(linkDes.src(), |
| 526 | linkDes.dst()), TeLinkConfig.class, config.node()); |
Priyanka B | 658aa698 | 2016-05-27 21:34:49 +0530 | [diff] [blame] | 527 | } |
| 528 | |
| 529 | private DefaultAnnotations.Builder getAnnotations(DefaultAnnotations.Builder annotationBuilder, boolean isNode, |
| 530 | PathAttrNlriDetails details) { |
| 531 | |
| 532 | List<BgpValueType> attribute = details.pathAttributes().stream() |
| 533 | .filter(attr -> attr instanceof LinkStateAttributes).collect(toList()); |
| 534 | if (attribute.isEmpty()) { |
| 535 | return annotationBuilder; |
| 536 | } |
| 537 | List<BgpValueType> tlvs = ((LinkStateAttributes) attribute.iterator().next()).linkStateAttributes(); |
| 538 | boolean abrBit = false; |
| 539 | boolean externalBit = false; |
| 540 | boolean pseudo = false; |
Priyanka B | 658aa698 | 2016-05-27 21:34:49 +0530 | [diff] [blame] | 541 | byte[] areaId = null; |
| 542 | Ip4Address routerId = null; |
| 543 | for (BgpValueType tlv : tlvs) { |
| 544 | switch (tlv.getType()) { |
| 545 | case LinkStateAttributes.ATTR_NODE_FLAG_BITS: |
| 546 | abrBit = ((BgpAttrNodeFlagBitTlv) tlv).abrBit(); |
| 547 | externalBit = ((BgpAttrNodeFlagBitTlv) tlv).externalBit(); |
| 548 | break; |
| 549 | case NodeDescriptors.IGP_ROUTERID_TYPE: |
| 550 | if (tlv instanceof IsIsPseudonode || tlv instanceof OspfPseudonode) { |
| 551 | pseudo = true; |
| 552 | } |
| 553 | break; |
| 554 | case LinkStateAttributes.ATTR_NODE_ISIS_AREA_ID: |
| 555 | areaId = ((BgpAttrNodeIsIsAreaId) tlv).attrNodeIsIsAreaId(); |
| 556 | break; |
| 557 | case LinkStateAttributes.ATTR_NODE_IPV4_LOCAL_ROUTER_ID: |
| 558 | routerId = ((BgpAttrRouterIdV4) tlv).attrRouterId(); |
| 559 | break; |
Priyanka B | 658aa698 | 2016-05-27 21:34:49 +0530 | [diff] [blame] | 560 | default: // do nothing |
| 561 | } |
| 562 | } |
| 563 | |
| 564 | // Annotations for device |
| 565 | if (isNode) { |
| 566 | boolean internalBit = false; |
| 567 | if (!abrBit && !externalBit) { |
| 568 | internalBit = true; |
| 569 | } |
| 570 | |
| 571 | annotationBuilder.set(EXTERNAL_BIT, String.valueOf(externalBit)); |
| 572 | annotationBuilder.set(ABR_BIT, String.valueOf(abrBit)); |
| 573 | annotationBuilder.set(INTERNAL_BIT, String.valueOf(internalBit)); |
| 574 | annotationBuilder.set(PSEUDO, String.valueOf(pseudo)); |
| 575 | |
| 576 | if (areaId != null) { |
| 577 | annotationBuilder.set(AREAID, new String(areaId)); |
| 578 | } |
| 579 | if (routerId != null) { |
| 580 | // LsrID |
| 581 | annotationBuilder.set(LSRID, String.valueOf(routerId)); |
| 582 | } |
Priyanka B | 658aa698 | 2016-05-27 21:34:49 +0530 | [diff] [blame] | 583 | } |
| 584 | return annotationBuilder; |
| 585 | } |
| 586 | |
Shashikanth VH | 1ca26ce | 2015-11-20 23:19:49 +0530 | [diff] [blame] | 587 | @Override |
| 588 | public void triggerProbe(DeviceId deviceId) { |
| 589 | // TODO Auto-generated method stub |
| 590 | } |
| 591 | |
| 592 | @Override |
| 593 | public void roleChanged(DeviceId deviceId, MastershipRole newRole) { |
| 594 | } |
| 595 | |
| 596 | @Override |
| 597 | public boolean isReachable(DeviceId deviceId) { |
| 598 | // TODO Auto-generated method stub |
| 599 | return true; |
| 600 | } |
Saurav Das | a2d3750 | 2016-03-25 17:50:40 -0700 | [diff] [blame] | 601 | |
| 602 | @Override |
| 603 | public void changePortState(DeviceId deviceId, PortNumber portNumber, |
| 604 | boolean enable) { |
| 605 | } |
Shashikanth VH | 1ca26ce | 2015-11-20 23:19:49 +0530 | [diff] [blame] | 606 | } |