Thomas Vachuska | 781d18b | 2014-10-27 10:31:25 -0700 | [diff] [blame] | 1 | /* |
Ray Milkey | 34c9590 | 2015-04-15 09:47:53 -0700 | [diff] [blame] | 2 | * Copyright 2014-2015 Open Networking Laboratory |
alshabib | 7911a05 | 2014-10-16 17:49:37 -0700 | [diff] [blame] | 3 | * |
Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 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 |
alshabib | 7911a05 | 2014-10-16 17:49:37 -0700 | [diff] [blame] | 7 | * |
Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 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. |
Thomas Vachuska | 781d18b | 2014-10-27 10:31:25 -0700 | [diff] [blame] | 15 | */ |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 16 | package org.onosproject.provider.lldp.impl; |
alshabib | 7911a05 | 2014-10-16 17:49:37 -0700 | [diff] [blame] | 17 | |
Thomas Vachuska | 96f3ea7 | 2015-09-08 13:50:12 -0700 | [diff] [blame] | 18 | import com.google.common.collect.Sets; |
Ayaka Koshibe | 12c8c08 | 2015-12-08 12:48:46 -0800 | [diff] [blame] | 19 | |
alshabib | 7911a05 | 2014-10-16 17:49:37 -0700 | [diff] [blame] | 20 | import org.jboss.netty.util.Timeout; |
| 21 | import org.jboss.netty.util.TimerTask; |
Jonathan Hart | e8600eb | 2015-01-12 10:30:45 -0800 | [diff] [blame] | 22 | import org.onlab.packet.Ethernet; |
| 23 | import org.onlab.packet.ONOSLLDP; |
| 24 | import org.onlab.util.Timer; |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 25 | import org.onosproject.net.ConnectPoint; |
| 26 | import org.onosproject.net.Device; |
| 27 | import org.onosproject.net.DeviceId; |
| 28 | import org.onosproject.net.Link.Type; |
Thomas Vachuska | 05453c9 | 2015-09-09 14:40:49 -0700 | [diff] [blame] | 29 | import org.onosproject.net.LinkKey; |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 30 | import org.onosproject.net.Port; |
| 31 | import org.onosproject.net.PortNumber; |
| 32 | import org.onosproject.net.link.DefaultLinkDescription; |
| 33 | import org.onosproject.net.link.LinkDescription; |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 34 | import org.onosproject.net.packet.DefaultOutboundPacket; |
| 35 | import org.onosproject.net.packet.OutboundPacket; |
| 36 | import org.onosproject.net.packet.PacketContext; |
alshabib | 7911a05 | 2014-10-16 17:49:37 -0700 | [diff] [blame] | 37 | import org.slf4j.Logger; |
| 38 | |
Thomas Vachuska | 96f3ea7 | 2015-09-08 13:50:12 -0700 | [diff] [blame] | 39 | import java.nio.ByteBuffer; |
Thomas Vachuska | 96f3ea7 | 2015-09-08 13:50:12 -0700 | [diff] [blame] | 40 | import java.util.Set; |
Thomas Vachuska | 96f3ea7 | 2015-09-08 13:50:12 -0700 | [diff] [blame] | 41 | |
Thomas Vachuska | 96f3ea7 | 2015-09-08 13:50:12 -0700 | [diff] [blame] | 42 | import static java.util.concurrent.TimeUnit.MILLISECONDS; |
| 43 | import static org.onosproject.net.PortNumber.portNumber; |
| 44 | import static org.onosproject.net.flow.DefaultTrafficTreatment.builder; |
| 45 | import static org.slf4j.LoggerFactory.getLogger; |
| 46 | |
alshabib | 7911a05 | 2014-10-16 17:49:37 -0700 | [diff] [blame] | 47 | /** |
| 48 | * Run discovery process from a physical switch. Ports are initially labeled as |
| 49 | * slow ports. When an LLDP is successfully received, label the remote port as |
| 50 | * fast. Every probeRate milliseconds, loop over all fast ports and send an |
| 51 | * LLDP, send an LLDP for a single slow port. Based on FlowVisor topology |
| 52 | * discovery implementation. |
alshabib | 7911a05 | 2014-10-16 17:49:37 -0700 | [diff] [blame] | 53 | */ |
Thomas Vachuska | e4ebac9 | 2015-09-10 11:39:05 -0700 | [diff] [blame] | 54 | class LinkDiscovery implements TimerTask { |
alshabib | 7911a05 | 2014-10-16 17:49:37 -0700 | [diff] [blame] | 55 | |
alshabib | 7911a05 | 2014-10-16 17:49:37 -0700 | [diff] [blame] | 56 | private final Logger log = getLogger(getClass()); |
Thomas Vachuska | 96f3ea7 | 2015-09-08 13:50:12 -0700 | [diff] [blame] | 57 | |
Thomas Vachuska | 96f3ea7 | 2015-09-08 13:50:12 -0700 | [diff] [blame] | 58 | private static final String SRC_MAC = "DE:AD:BE:EF:BA:11"; |
Thomas Vachuska | 96f3ea7 | 2015-09-08 13:50:12 -0700 | [diff] [blame] | 59 | |
| 60 | private final Device device; |
Thomas Vachuska | 05453c9 | 2015-09-09 14:40:49 -0700 | [diff] [blame] | 61 | private final DiscoveryContext context; |
Thomas Vachuska | 96f3ea7 | 2015-09-08 13:50:12 -0700 | [diff] [blame] | 62 | |
alshabib | 7911a05 | 2014-10-16 17:49:37 -0700 | [diff] [blame] | 63 | private final Ethernet ethPacket; |
HIGUCHI Yuta | 9a9edf8 | 2015-10-21 11:23:20 -0700 | [diff] [blame] | 64 | private final Ethernet bddpEth; |
Thomas Vachuska | 96f3ea7 | 2015-09-08 13:50:12 -0700 | [diff] [blame] | 65 | |
| 66 | private Timeout timeout; |
| 67 | private volatile boolean isStopped; |
Ayaka Koshibe | 12c8c08 | 2015-12-08 12:48:46 -0800 | [diff] [blame] | 68 | // This LinkDiscovery can handle remote link probes (default false). |
| 69 | private volatile boolean fingerprinted; |
Thomas Vachuska | 05453c9 | 2015-09-09 14:40:49 -0700 | [diff] [blame] | 70 | // Set of ports to be probed |
| 71 | private final Set<Long> ports = Sets.newConcurrentHashSet(); |
| 72 | |
alshabib | 7911a05 | 2014-10-16 17:49:37 -0700 | [diff] [blame] | 73 | /** |
| 74 | * Instantiates discovery manager for the given physical switch. Creates a |
| 75 | * generic LLDP packet that will be customized for the port it is sent out on. |
| 76 | * Starts the the timer for the discovery process. |
Thomas Vachuska | e1bcb0b | 2014-10-27 17:45:10 -0700 | [diff] [blame] | 77 | * |
Thomas Vachuska | 05453c9 | 2015-09-09 14:40:49 -0700 | [diff] [blame] | 78 | * @param device the physical switch |
| 79 | * @param context discovery context |
alshabib | 7911a05 | 2014-10-16 17:49:37 -0700 | [diff] [blame] | 80 | */ |
Thomas Vachuska | e4ebac9 | 2015-09-10 11:39:05 -0700 | [diff] [blame] | 81 | LinkDiscovery(Device device, DiscoveryContext context) { |
alshabib | 7911a05 | 2014-10-16 17:49:37 -0700 | [diff] [blame] | 82 | this.device = device; |
Thomas Vachuska | 05453c9 | 2015-09-09 14:40:49 -0700 | [diff] [blame] | 83 | this.context = context; |
alshabib | 3d643ec | 2014-10-22 18:33:00 -0700 | [diff] [blame] | 84 | |
Thomas Vachuska | 96f3ea7 | 2015-09-08 13:50:12 -0700 | [diff] [blame] | 85 | ethPacket = new Ethernet(); |
| 86 | ethPacket.setEtherType(Ethernet.TYPE_LLDP); |
| 87 | ethPacket.setDestinationMACAddress(ONOSLLDP.LLDP_NICIRA); |
Thomas Vachuska | 96f3ea7 | 2015-09-08 13:50:12 -0700 | [diff] [blame] | 88 | ethPacket.setPad(true); |
alshabib | 7911a05 | 2014-10-16 17:49:37 -0700 | [diff] [blame] | 89 | |
Thomas Vachuska | 05453c9 | 2015-09-09 14:40:49 -0700 | [diff] [blame] | 90 | bddpEth = new Ethernet(); |
Thomas Vachuska | 05453c9 | 2015-09-09 14:40:49 -0700 | [diff] [blame] | 91 | bddpEth.setEtherType(Ethernet.TYPE_BSN); |
| 92 | bddpEth.setDestinationMACAddress(ONOSLLDP.BDDP_MULTICAST); |
| 93 | bddpEth.setPad(true); |
alshabib | 7911a05 | 2014-10-16 17:49:37 -0700 | [diff] [blame] | 94 | |
Ayaka Koshibe | 12c8c08 | 2015-12-08 12:48:46 -0800 | [diff] [blame] | 95 | fingerprinted = false; |
Thomas Vachuska | 96f3ea7 | 2015-09-08 13:50:12 -0700 | [diff] [blame] | 96 | isStopped = true; |
alshabib | 7911a05 | 2014-10-16 17:49:37 -0700 | [diff] [blame] | 97 | start(); |
Thomas Vachuska | 96f3ea7 | 2015-09-08 13:50:12 -0700 | [diff] [blame] | 98 | log.debug("Started discovery manager for switch {}", device.id()); |
alshabib | 7911a05 | 2014-10-16 17:49:37 -0700 | [diff] [blame] | 99 | |
| 100 | } |
| 101 | |
Thomas Vachuska | e4ebac9 | 2015-09-10 11:39:05 -0700 | [diff] [blame] | 102 | synchronized void stop() { |
Jon Hall | 3edc08a | 2015-09-14 16:59:07 -0700 | [diff] [blame] | 103 | if (!isStopped) { |
| 104 | isStopped = true; |
| 105 | timeout.cancel(); |
| 106 | } else { |
| 107 | log.warn("LinkDiscovery stopped multiple times?"); |
| 108 | } |
Thomas Vachuska | e4ebac9 | 2015-09-10 11:39:05 -0700 | [diff] [blame] | 109 | } |
| 110 | |
| 111 | synchronized void start() { |
| 112 | if (isStopped) { |
| 113 | isStopped = false; |
| 114 | timeout = Timer.getTimer().newTimeout(this, 0, MILLISECONDS); |
| 115 | } else { |
| 116 | log.warn("LinkDiscovery started multiple times?"); |
| 117 | } |
| 118 | } |
| 119 | |
| 120 | synchronized boolean isStopped() { |
| 121 | return isStopped || timeout.isCancelled(); |
| 122 | } |
| 123 | |
alshabib | 7911a05 | 2014-10-16 17:49:37 -0700 | [diff] [blame] | 124 | /** |
HIGUCHI Yuta | 9a9edf8 | 2015-10-21 11:23:20 -0700 | [diff] [blame] | 125 | * Add physical port to discovery process. |
alshabib | 7911a05 | 2014-10-16 17:49:37 -0700 | [diff] [blame] | 126 | * Send out initial LLDP and label it as slow port. |
| 127 | * |
| 128 | * @param port the port |
| 129 | */ |
Thomas Vachuska | e4ebac9 | 2015-09-10 11:39:05 -0700 | [diff] [blame] | 130 | void addPort(Port port) { |
Thomas Vachuska | 05453c9 | 2015-09-09 14:40:49 -0700 | [diff] [blame] | 131 | boolean newPort = ports.add(port.number().toLong()); |
| 132 | boolean isMaster = context.mastershipService().isLocalMaster(device.id()); |
Jonathan Hart | 45066bc | 2015-07-28 11:18:34 -0700 | [diff] [blame] | 133 | if (newPort && isMaster) { |
Thomas Vachuska | e4ebac9 | 2015-09-10 11:39:05 -0700 | [diff] [blame] | 134 | log.debug("Sending initial probe to port {}@{}", port.number().toLong(), device.id()); |
Jonathan Hart | 45066bc | 2015-07-28 11:18:34 -0700 | [diff] [blame] | 135 | sendProbes(port.number().toLong()); |
alshabib | 7911a05 | 2014-10-16 17:49:37 -0700 | [diff] [blame] | 136 | } |
alshabib | 7911a05 | 2014-10-16 17:49:37 -0700 | [diff] [blame] | 137 | } |
| 138 | |
| 139 | /** |
HIGUCHI Yuta | 9a9edf8 | 2015-10-21 11:23:20 -0700 | [diff] [blame] | 140 | * removed physical port from discovery process. |
| 141 | * @param port the port number |
| 142 | */ |
| 143 | void removePort(PortNumber port) { |
| 144 | ports.remove(port.toLong()); |
| 145 | } |
| 146 | |
| 147 | /** |
Thomas Vachuska | e4ebac9 | 2015-09-10 11:39:05 -0700 | [diff] [blame] | 148 | * Handles an incoming LLDP packet. Creates link in topology and adds the |
| 149 | * link for staleness tracking. |
Thomas Vachuska | 96f3ea7 | 2015-09-08 13:50:12 -0700 | [diff] [blame] | 150 | * |
Thomas Vachuska | 05453c9 | 2015-09-09 14:40:49 -0700 | [diff] [blame] | 151 | * @param packetContext packet context |
Yuta HIGUCHI | 5c94727 | 2014-11-03 21:39:21 -0800 | [diff] [blame] | 152 | * @return true if handled |
alshabib | 7911a05 | 2014-10-16 17:49:37 -0700 | [diff] [blame] | 153 | */ |
Jonathan Hart | b35540a | 2015-11-17 09:30:56 -0800 | [diff] [blame] | 154 | boolean handleLldp(PacketContext packetContext) { |
Thomas Vachuska | 05453c9 | 2015-09-09 14:40:49 -0700 | [diff] [blame] | 155 | Ethernet eth = packetContext.inPacket().parsed(); |
Jonathan Hart | e8600eb | 2015-01-12 10:30:45 -0800 | [diff] [blame] | 156 | if (eth == null) { |
| 157 | return false; |
| 158 | } |
| 159 | |
alshabib | 7911a05 | 2014-10-16 17:49:37 -0700 | [diff] [blame] | 160 | ONOSLLDP onoslldp = ONOSLLDP.parseONOSLLDP(eth); |
| 161 | if (onoslldp != null) { |
Thomas Vachuska | 96f3ea7 | 2015-09-08 13:50:12 -0700 | [diff] [blame] | 162 | PortNumber srcPort = portNumber(onoslldp.getPort()); |
Thomas Vachuska | 05453c9 | 2015-09-09 14:40:49 -0700 | [diff] [blame] | 163 | PortNumber dstPort = packetContext.inPacket().receivedFrom().port(); |
Thomas Vachuska | 96f3ea7 | 2015-09-08 13:50:12 -0700 | [diff] [blame] | 164 | DeviceId srcDeviceId = DeviceId.deviceId(onoslldp.getDeviceString()); |
Thomas Vachuska | 05453c9 | 2015-09-09 14:40:49 -0700 | [diff] [blame] | 165 | DeviceId dstDeviceId = packetContext.inPacket().receivedFrom().deviceId(); |
Thomas Vachuska | 96f3ea7 | 2015-09-08 13:50:12 -0700 | [diff] [blame] | 166 | |
alshabib | 7911a05 | 2014-10-16 17:49:37 -0700 | [diff] [blame] | 167 | ConnectPoint src = new ConnectPoint(srcDeviceId, srcPort); |
| 168 | ConnectPoint dst = new ConnectPoint(dstDeviceId, dstPort); |
| 169 | |
Thomas Vachuska | 96f3ea7 | 2015-09-08 13:50:12 -0700 | [diff] [blame] | 170 | LinkDescription ld = eth.getEtherType() == Ethernet.TYPE_LLDP ? |
| 171 | new DefaultLinkDescription(src, dst, Type.DIRECT) : |
| 172 | new DefaultLinkDescription(src, dst, Type.INDIRECT); |
Sahil Lele | 3a0cdd5 | 2015-07-21 14:16:31 -0700 | [diff] [blame] | 173 | |
| 174 | try { |
Thomas Vachuska | 05453c9 | 2015-09-09 14:40:49 -0700 | [diff] [blame] | 175 | context.providerService().linkDetected(ld); |
Thomas Vachuska | e4ebac9 | 2015-09-10 11:39:05 -0700 | [diff] [blame] | 176 | context.touchLink(LinkKey.linkKey(src, dst)); |
Sahil Lele | 3a0cdd5 | 2015-07-21 14:16:31 -0700 | [diff] [blame] | 177 | } catch (IllegalStateException e) { |
| 178 | return true; |
| 179 | } |
alshabib | 7911a05 | 2014-10-16 17:49:37 -0700 | [diff] [blame] | 180 | return true; |
| 181 | } |
| 182 | return false; |
| 183 | } |
| 184 | |
| 185 | |
alshabib | 7911a05 | 2014-10-16 17:49:37 -0700 | [diff] [blame] | 186 | /** |
| 187 | * Execute this method every t milliseconds. Loops over all ports |
| 188 | * labeled as fast and sends out an LLDP. Send out an LLDP on a single slow |
| 189 | * port. |
| 190 | * |
| 191 | * @param t timeout |
alshabib | 7911a05 | 2014-10-16 17:49:37 -0700 | [diff] [blame] | 192 | */ |
| 193 | @Override |
Thomas Vachuska | 96f3ea7 | 2015-09-08 13:50:12 -0700 | [diff] [blame] | 194 | public void run(Timeout t) { |
Yuta HIGUCHI | 3419858 | 2014-11-10 16:24:58 -0800 | [diff] [blame] | 195 | if (isStopped()) { |
| 196 | return; |
| 197 | } |
Thomas Vachuska | 05453c9 | 2015-09-09 14:40:49 -0700 | [diff] [blame] | 198 | |
Thomas Vachuska | e4ebac9 | 2015-09-10 11:39:05 -0700 | [diff] [blame] | 199 | if (context.mastershipService().isLocalMaster(device.id())) { |
| 200 | log.trace("Sending probes from {}", device.id()); |
| 201 | ports.forEach(this::sendProbes); |
Yuta HIGUCHI | f672588 | 2014-10-29 15:25:51 -0700 | [diff] [blame] | 202 | } |
| 203 | |
Yuta HIGUCHI | 3225578 | 2014-11-04 22:32:14 -0800 | [diff] [blame] | 204 | if (!isStopped()) { |
Thomas Vachuska | 05453c9 | 2015-09-09 14:40:49 -0700 | [diff] [blame] | 205 | timeout = Timer.getTimer().newTimeout(this, context.probeRate(), MILLISECONDS); |
Yuta HIGUCHI | 3225578 | 2014-11-04 22:32:14 -0800 | [diff] [blame] | 206 | } |
alshabib | 7911a05 | 2014-10-16 17:49:37 -0700 | [diff] [blame] | 207 | } |
| 208 | |
alshabib | 7911a05 | 2014-10-16 17:49:37 -0700 | [diff] [blame] | 209 | /** |
| 210 | * Creates packet_out LLDP for specified output port. |
| 211 | * |
| 212 | * @param port the port |
| 213 | * @return Packet_out message with LLDP data |
| 214 | */ |
Jonathan Hart | b35540a | 2015-11-17 09:30:56 -0800 | [diff] [blame] | 215 | private OutboundPacket createOutBoundLldp(Long port) { |
alshabib | 7911a05 | 2014-10-16 17:49:37 -0700 | [diff] [blame] | 216 | if (port == null) { |
| 217 | return null; |
| 218 | } |
Ayaka Koshibe | 12c8c08 | 2015-12-08 12:48:46 -0800 | [diff] [blame] | 219 | ONOSLLDP lldp = getLinkProbe(port); |
| 220 | ethPacket.setSourceMACAddress(SRC_MAC).setPayload(lldp); |
Thomas Vachuska | 96f3ea7 | 2015-09-08 13:50:12 -0700 | [diff] [blame] | 221 | return new DefaultOutboundPacket(device.id(), |
Thomas Vachuska | e1bcb0b | 2014-10-27 17:45:10 -0700 | [diff] [blame] | 222 | builder().setOutput(portNumber(port)).build(), |
Thomas Vachuska | 96f3ea7 | 2015-09-08 13:50:12 -0700 | [diff] [blame] | 223 | ByteBuffer.wrap(ethPacket.serialize())); |
alshabib | 7911a05 | 2014-10-16 17:49:37 -0700 | [diff] [blame] | 224 | } |
| 225 | |
| 226 | /** |
| 227 | * Creates packet_out BDDP for specified output port. |
| 228 | * |
| 229 | * @param port the port |
| 230 | * @return Packet_out message with LLDP data |
| 231 | */ |
Jonathan Hart | b35540a | 2015-11-17 09:30:56 -0800 | [diff] [blame] | 232 | private OutboundPacket createOutBoundBddp(Long port) { |
alshabib | 7911a05 | 2014-10-16 17:49:37 -0700 | [diff] [blame] | 233 | if (port == null) { |
| 234 | return null; |
| 235 | } |
Ayaka Koshibe | 12c8c08 | 2015-12-08 12:48:46 -0800 | [diff] [blame] | 236 | ONOSLLDP lldp = getLinkProbe(port); |
| 237 | bddpEth.setSourceMACAddress(SRC_MAC).setPayload(lldp); |
Thomas Vachuska | 96f3ea7 | 2015-09-08 13:50:12 -0700 | [diff] [blame] | 238 | return new DefaultOutboundPacket(device.id(), |
Thomas Vachuska | e1bcb0b | 2014-10-27 17:45:10 -0700 | [diff] [blame] | 239 | builder().setOutput(portNumber(port)).build(), |
Thomas Vachuska | 96f3ea7 | 2015-09-08 13:50:12 -0700 | [diff] [blame] | 240 | ByteBuffer.wrap(bddpEth.serialize())); |
alshabib | 7911a05 | 2014-10-16 17:49:37 -0700 | [diff] [blame] | 241 | } |
| 242 | |
Ayaka Koshibe | 12c8c08 | 2015-12-08 12:48:46 -0800 | [diff] [blame] | 243 | private ONOSLLDP getLinkProbe(Long port) { |
| 244 | return fingerprinted |
| 245 | ? ONOSLLDP.fingerprintedLLDP(device.id().toString(), device.chassisId(), |
| 246 | port.intValue(), context.fingerprint()) |
| 247 | : ONOSLLDP.onosLLDP(device.id().toString(), device.chassisId(), |
| 248 | port.intValue()); |
| 249 | } |
| 250 | |
alshabib | 7911a05 | 2014-10-16 17:49:37 -0700 | [diff] [blame] | 251 | private void sendProbes(Long portNumber) { |
Yuta HIGUCHI | 4128938 | 2014-12-19 17:47:12 -0800 | [diff] [blame] | 252 | log.trace("Sending probes out to {}@{}", portNumber, device.id()); |
Jonathan Hart | b35540a | 2015-11-17 09:30:56 -0800 | [diff] [blame] | 253 | OutboundPacket pkt = createOutBoundLldp(portNumber); |
Thomas Vachuska | 05453c9 | 2015-09-09 14:40:49 -0700 | [diff] [blame] | 254 | context.packetService().emit(pkt); |
Jonathan Hart | b35540a | 2015-11-17 09:30:56 -0800 | [diff] [blame] | 255 | if (context.useBddp()) { |
| 256 | OutboundPacket bpkt = createOutBoundBddp(portNumber); |
Thomas Vachuska | 05453c9 | 2015-09-09 14:40:49 -0700 | [diff] [blame] | 257 | context.packetService().emit(bpkt); |
Thomas Vachuska | e1bcb0b | 2014-10-27 17:45:10 -0700 | [diff] [blame] | 258 | } |
alshabib | 7911a05 | 2014-10-16 17:49:37 -0700 | [diff] [blame] | 259 | } |
| 260 | |
Thomas Vachuska | 05453c9 | 2015-09-09 14:40:49 -0700 | [diff] [blame] | 261 | boolean containsPort(long portNumber) { |
| 262 | return ports.contains(portNumber); |
| 263 | } |
Thomas Vachuska | e4ebac9 | 2015-09-10 11:39:05 -0700 | [diff] [blame] | 264 | |
Ayaka Koshibe | 12c8c08 | 2015-12-08 12:48:46 -0800 | [diff] [blame] | 265 | protected void enableFingerprint() { |
| 266 | fingerprinted = true; |
| 267 | } |
| 268 | |
| 269 | protected void disableFingerprint() { |
| 270 | fingerprinted = false; |
| 271 | } |
alshabib | 7911a05 | 2014-10-16 17:49:37 -0700 | [diff] [blame] | 272 | } |