Thomas Vachuska | 33979fd | 2015-07-31 11:41:14 -0700 | [diff] [blame] | 1 | /* |
Brian O'Connor | 5ab426f | 2016-04-09 01:19:45 -0700 | [diff] [blame] | 2 | * Copyright 2015-present Open Networking Laboratory |
Thomas Vachuska | 33979fd | 2015-07-31 11:41:14 -0700 | [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 | package org.onosproject.incubator.net.virtual.impl; |
| 17 | |
Brian Stanke | 8691428 | 2016-05-25 15:36:50 -0400 | [diff] [blame] | 18 | import com.google.common.collect.Maps; |
Thomas Vachuska | 33979fd | 2015-07-31 11:41:14 -0700 | [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.Reference; |
| 23 | import org.apache.felix.scr.annotations.ReferenceCardinality; |
| 24 | import org.apache.felix.scr.annotations.Service; |
Brian Stanke | 11f6d53 | 2016-07-05 16:17:59 -0400 | [diff] [blame] | 25 | import org.onlab.osgi.DefaultServiceDirectory; |
yoonseon | c6a6927 | 2017-01-12 18:22:20 -0800 | [diff] [blame] | 26 | import org.onlab.osgi.ServiceDirectory; |
Brian Stanke | 7a81b53 | 2016-06-14 15:43:51 -0400 | [diff] [blame] | 27 | import org.onlab.packet.IpAddress; |
| 28 | import org.onlab.packet.MacAddress; |
| 29 | import org.onlab.packet.VlanId; |
yoonseon | 322c9c3 | 2016-12-07 16:47:02 -0800 | [diff] [blame] | 30 | import org.onosproject.core.ApplicationId; |
| 31 | import org.onosproject.core.CoreService; |
Thomas Vachuska | 33979fd | 2015-07-31 11:41:14 -0700 | [diff] [blame] | 32 | import org.onosproject.incubator.net.tunnel.TunnelId; |
Brian Stanke | fb61df4 | 2016-07-25 11:47:51 -0400 | [diff] [blame] | 33 | import org.onosproject.incubator.net.virtual.DefaultVirtualLink; |
Thomas Vachuska | 33979fd | 2015-07-31 11:41:14 -0700 | [diff] [blame] | 34 | import org.onosproject.incubator.net.virtual.NetworkId; |
| 35 | import org.onosproject.incubator.net.virtual.TenantId; |
| 36 | import org.onosproject.incubator.net.virtual.VirtualDevice; |
Brian Stanke | 7a81b53 | 2016-06-14 15:43:51 -0400 | [diff] [blame] | 37 | import org.onosproject.incubator.net.virtual.VirtualHost; |
Thomas Vachuska | 33979fd | 2015-07-31 11:41:14 -0700 | [diff] [blame] | 38 | import org.onosproject.incubator.net.virtual.VirtualLink; |
| 39 | import org.onosproject.incubator.net.virtual.VirtualNetwork; |
| 40 | import org.onosproject.incubator.net.virtual.VirtualNetworkAdminService; |
| 41 | import org.onosproject.incubator.net.virtual.VirtualNetworkEvent; |
Brian Stanke | 11f6d53 | 2016-07-05 16:17:59 -0400 | [diff] [blame] | 42 | import org.onosproject.incubator.net.virtual.VirtualNetworkIntent; |
Thomas Vachuska | 33979fd | 2015-07-31 11:41:14 -0700 | [diff] [blame] | 43 | import org.onosproject.incubator.net.virtual.VirtualNetworkListener; |
| 44 | import org.onosproject.incubator.net.virtual.VirtualNetworkService; |
| 45 | import org.onosproject.incubator.net.virtual.VirtualNetworkStore; |
| 46 | import org.onosproject.incubator.net.virtual.VirtualNetworkStoreDelegate; |
| 47 | import org.onosproject.incubator.net.virtual.VirtualPort; |
yoonseon | 214963b | 2016-11-21 15:41:07 -0800 | [diff] [blame] | 48 | import org.onosproject.incubator.net.virtual.VnetService; |
Claudine Chiu | 465a260 | 2017-03-17 18:33:36 -0400 | [diff] [blame] | 49 | import org.onosproject.incubator.net.virtual.event.VirtualEvent; |
| 50 | import org.onosproject.incubator.net.virtual.event.VirtualListenerRegistryManager; |
yoonseon | 6b972c3 | 2016-12-06 16:45:03 -0800 | [diff] [blame] | 51 | import org.onosproject.incubator.net.virtual.provider.VirtualNetworkProvider; |
| 52 | import org.onosproject.incubator.net.virtual.provider.VirtualNetworkProviderRegistry; |
| 53 | import org.onosproject.incubator.net.virtual.provider.VirtualNetworkProviderService; |
Thomas Vachuska | 33979fd | 2015-07-31 11:41:14 -0700 | [diff] [blame] | 54 | import org.onosproject.net.ConnectPoint; |
| 55 | import org.onosproject.net.DeviceId; |
Brian Stanke | 7a81b53 | 2016-06-14 15:43:51 -0400 | [diff] [blame] | 56 | import org.onosproject.net.HostId; |
| 57 | import org.onosproject.net.HostLocation; |
Brian Stanke | 612cebf | 2016-05-02 10:21:33 -0400 | [diff] [blame] | 58 | import org.onosproject.net.Link; |
Thomas Vachuska | 33979fd | 2015-07-31 11:41:14 -0700 | [diff] [blame] | 59 | import org.onosproject.net.PortNumber; |
Brian Stanke | 8691428 | 2016-05-25 15:36:50 -0400 | [diff] [blame] | 60 | import org.onosproject.net.device.DeviceService; |
Claudine Chiu | 70222ad | 2016-11-17 22:29:20 -0500 | [diff] [blame] | 61 | import org.onosproject.net.flow.FlowRuleService; |
yoonseon | 86bebed | 2017-02-03 15:23:57 -0800 | [diff] [blame] | 62 | import org.onosproject.net.flowobjective.FlowObjectiveService; |
Claudine Chiu | 465a260 | 2017-03-17 18:33:36 -0400 | [diff] [blame] | 63 | import org.onosproject.net.group.GroupService; |
Claudine Chiu | 30a8a2a | 2016-07-14 17:09:04 -0400 | [diff] [blame] | 64 | import org.onosproject.net.host.HostService; |
Brian Stanke | 11f6d53 | 2016-07-05 16:17:59 -0400 | [diff] [blame] | 65 | import org.onosproject.net.intent.IntentEvent; |
| 66 | import org.onosproject.net.intent.IntentListener; |
| 67 | import org.onosproject.net.intent.IntentService; |
| 68 | import org.onosproject.net.intent.IntentState; |
Brian Stanke | 8691428 | 2016-05-25 15:36:50 -0400 | [diff] [blame] | 69 | import org.onosproject.net.link.LinkService; |
yoonseon | 322c9c3 | 2016-12-07 16:47:02 -0800 | [diff] [blame] | 70 | import org.onosproject.net.packet.PacketService; |
Thomas Vachuska | 3d62fd7 | 2015-09-25 14:58:13 -0700 | [diff] [blame] | 71 | import org.onosproject.net.provider.AbstractListenerProviderRegistry; |
| 72 | import org.onosproject.net.provider.AbstractProviderService; |
Claudine Chiu | 45920dd | 2016-07-28 19:19:46 +0000 | [diff] [blame] | 73 | import org.onosproject.net.topology.PathService; |
Brian Stanke | 8e9f8d1 | 2016-06-08 14:48:33 -0400 | [diff] [blame] | 74 | import org.onosproject.net.topology.TopologyService; |
Thomas Vachuska | 33979fd | 2015-07-31 11:41:14 -0700 | [diff] [blame] | 75 | import org.slf4j.Logger; |
| 76 | import org.slf4j.LoggerFactory; |
| 77 | |
Brian Stanke | 8691428 | 2016-05-25 15:36:50 -0400 | [diff] [blame] | 78 | import java.util.Map; |
Claudine Chiu | e7f6b91 | 2017-02-24 14:13:30 -0500 | [diff] [blame] | 79 | import java.util.Objects; |
Thomas Vachuska | 33979fd | 2015-07-31 11:41:14 -0700 | [diff] [blame] | 80 | import java.util.Set; |
| 81 | |
| 82 | import static com.google.common.base.Preconditions.checkNotNull; |
| 83 | |
| 84 | /** |
| 85 | * Implementation of the virtual network service. |
| 86 | */ |
| 87 | @Component(immediate = true) |
| 88 | @Service |
| 89 | public class VirtualNetworkManager |
yoonseon | 214963b | 2016-11-21 15:41:07 -0800 | [diff] [blame] | 90 | extends AbstractListenerProviderRegistry<VirtualNetworkEvent, |
| 91 | VirtualNetworkListener, VirtualNetworkProvider, VirtualNetworkProviderService> |
| 92 | implements VirtualNetworkService, VirtualNetworkAdminService, |
| 93 | VirtualNetworkProviderRegistry { |
Thomas Vachuska | 33979fd | 2015-07-31 11:41:14 -0700 | [diff] [blame] | 94 | |
| 95 | private final Logger log = LoggerFactory.getLogger(getClass()); |
| 96 | |
| 97 | private static final String TENANT_NULL = "Tenant ID cannot be null"; |
| 98 | private static final String NETWORK_NULL = "Network ID cannot be null"; |
| 99 | private static final String DEVICE_NULL = "Device ID cannot be null"; |
| 100 | private static final String LINK_POINT_NULL = "Link end-point cannot be null"; |
| 101 | |
yoonseon | 322c9c3 | 2016-12-07 16:47:02 -0800 | [diff] [blame] | 102 | private static final String VIRTUAL_NETWORK_APP_ID_STRING = |
| 103 | "org.onosproject.virtual-network"; |
| 104 | |
Thomas Vachuska | 33979fd | 2015-07-31 11:41:14 -0700 | [diff] [blame] | 105 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) |
| 106 | protected VirtualNetworkStore store; |
| 107 | |
Brian Stanke | 11f6d53 | 2016-07-05 16:17:59 -0400 | [diff] [blame] | 108 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) |
| 109 | protected IntentService intentService; |
| 110 | |
yoonseon | 322c9c3 | 2016-12-07 16:47:02 -0800 | [diff] [blame] | 111 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) |
| 112 | protected CoreService coreService; |
| 113 | |
yoonseon | 214963b | 2016-11-21 15:41:07 -0800 | [diff] [blame] | 114 | private final InternalVirtualIntentListener intentListener = |
| 115 | new InternalVirtualIntentListener(); |
Brian Stanke | 11f6d53 | 2016-07-05 16:17:59 -0400 | [diff] [blame] | 116 | |
Brian Stanke | 0e5c94e | 2016-03-08 11:20:04 -0500 | [diff] [blame] | 117 | private VirtualNetworkStoreDelegate delegate = this::post; |
Thomas Vachuska | 33979fd | 2015-07-31 11:41:14 -0700 | [diff] [blame] | 118 | |
yoonseon | c6a6927 | 2017-01-12 18:22:20 -0800 | [diff] [blame] | 119 | private ServiceDirectory serviceDirectory = new DefaultServiceDirectory(); |
yoonseon | 322c9c3 | 2016-12-07 16:47:02 -0800 | [diff] [blame] | 120 | private ApplicationId appId; |
yoonseon | c6a6927 | 2017-01-12 18:22:20 -0800 | [diff] [blame] | 121 | |
Thomas Vachuska | 3d62fd7 | 2015-09-25 14:58:13 -0700 | [diff] [blame] | 122 | // TODO: figure out how to coordinate "implementation" of a virtual network in a cluster |
Thomas Vachuska | 33979fd | 2015-07-31 11:41:14 -0700 | [diff] [blame] | 123 | |
Brian Stanke | 11f6d53 | 2016-07-05 16:17:59 -0400 | [diff] [blame] | 124 | /** |
| 125 | * Only used for Junit test methods outside of this package. |
| 126 | * |
| 127 | * @param store virtual network store |
| 128 | */ |
| 129 | public void setStore(VirtualNetworkStore store) { |
| 130 | this.store = store; |
| 131 | } |
| 132 | |
| 133 | /** |
| 134 | * Only used for Junit test methods outside of this package. |
| 135 | * |
| 136 | * @param intentService intent service |
| 137 | */ |
| 138 | |
| 139 | public void setIntentService(IntentService intentService) { |
| 140 | this.intentService = intentService; |
| 141 | } |
| 142 | |
Thomas Vachuska | 33979fd | 2015-07-31 11:41:14 -0700 | [diff] [blame] | 143 | @Activate |
Brian Stanke | 11f6d53 | 2016-07-05 16:17:59 -0400 | [diff] [blame] | 144 | public void activate() { |
Brian Stanke | 0e5c94e | 2016-03-08 11:20:04 -0500 | [diff] [blame] | 145 | eventDispatcher.addSink(VirtualNetworkEvent.class, listenerRegistry); |
Claudine Chiu | 465a260 | 2017-03-17 18:33:36 -0400 | [diff] [blame] | 146 | eventDispatcher.addSink(VirtualEvent.class, |
| 147 | VirtualListenerRegistryManager.getInstance()); |
Yoonseon Han | b14461b | 2017-03-07 14:08:01 +0900 | [diff] [blame] | 148 | store.setDelegate(delegate); |
Brian Stanke | 11f6d53 | 2016-07-05 16:17:59 -0400 | [diff] [blame] | 149 | intentService.addListener(intentListener); |
yoonseon | 322c9c3 | 2016-12-07 16:47:02 -0800 | [diff] [blame] | 150 | appId = coreService.registerApplication(VIRTUAL_NETWORK_APP_ID_STRING); |
Thomas Vachuska | 33979fd | 2015-07-31 11:41:14 -0700 | [diff] [blame] | 151 | log.info("Started"); |
| 152 | } |
| 153 | |
| 154 | @Deactivate |
Brian Stanke | 11f6d53 | 2016-07-05 16:17:59 -0400 | [diff] [blame] | 155 | public void deactivate() { |
Thomas Vachuska | 33979fd | 2015-07-31 11:41:14 -0700 | [diff] [blame] | 156 | store.unsetDelegate(delegate); |
Brian Stanke | 0e5c94e | 2016-03-08 11:20:04 -0500 | [diff] [blame] | 157 | eventDispatcher.removeSink(VirtualNetworkEvent.class); |
Claudine Chiu | 465a260 | 2017-03-17 18:33:36 -0400 | [diff] [blame] | 158 | eventDispatcher.removeSink(VirtualEvent.class); |
Brian Stanke | 11f6d53 | 2016-07-05 16:17:59 -0400 | [diff] [blame] | 159 | intentService.removeListener(intentListener); |
Thomas Vachuska | 33979fd | 2015-07-31 11:41:14 -0700 | [diff] [blame] | 160 | log.info("Stopped"); |
| 161 | } |
| 162 | |
| 163 | @Override |
| 164 | public void registerTenantId(TenantId tenantId) { |
| 165 | checkNotNull(tenantId, TENANT_NULL); |
| 166 | store.addTenantId(tenantId); |
| 167 | } |
| 168 | |
| 169 | @Override |
| 170 | public void unregisterTenantId(TenantId tenantId) { |
| 171 | checkNotNull(tenantId, TENANT_NULL); |
| 172 | store.removeTenantId(tenantId); |
| 173 | } |
| 174 | |
| 175 | @Override |
| 176 | public Set<TenantId> getTenantIds() { |
| 177 | return store.getTenantIds(); |
| 178 | } |
| 179 | |
| 180 | @Override |
| 181 | public VirtualNetwork createVirtualNetwork(TenantId tenantId) { |
| 182 | checkNotNull(tenantId, TENANT_NULL); |
| 183 | return store.addNetwork(tenantId); |
| 184 | } |
| 185 | |
| 186 | @Override |
| 187 | public void removeVirtualNetwork(NetworkId networkId) { |
| 188 | checkNotNull(networkId, NETWORK_NULL); |
| 189 | store.removeNetwork(networkId); |
| 190 | } |
| 191 | |
| 192 | @Override |
| 193 | public VirtualDevice createVirtualDevice(NetworkId networkId, DeviceId deviceId) { |
| 194 | checkNotNull(networkId, NETWORK_NULL); |
| 195 | checkNotNull(deviceId, DEVICE_NULL); |
| 196 | return store.addDevice(networkId, deviceId); |
| 197 | } |
| 198 | |
| 199 | @Override |
| 200 | public void removeVirtualDevice(NetworkId networkId, DeviceId deviceId) { |
| 201 | checkNotNull(networkId, NETWORK_NULL); |
| 202 | checkNotNull(deviceId, DEVICE_NULL); |
| 203 | store.removeDevice(networkId, deviceId); |
| 204 | } |
| 205 | |
| 206 | @Override |
yoonseon | 214963b | 2016-11-21 15:41:07 -0800 | [diff] [blame] | 207 | public VirtualHost createVirtualHost(NetworkId networkId, HostId hostId, |
| 208 | MacAddress mac, VlanId vlan, |
| 209 | HostLocation location, Set<IpAddress> ips) { |
Brian Stanke | 7a81b53 | 2016-06-14 15:43:51 -0400 | [diff] [blame] | 210 | checkNotNull(networkId, NETWORK_NULL); |
| 211 | checkNotNull(hostId, DEVICE_NULL); |
| 212 | return store.addHost(networkId, hostId, mac, vlan, location, ips); |
| 213 | } |
| 214 | |
| 215 | @Override |
| 216 | public void removeVirtualHost(NetworkId networkId, HostId hostId) { |
| 217 | checkNotNull(networkId, NETWORK_NULL); |
| 218 | checkNotNull(hostId, DEVICE_NULL); |
| 219 | store.removeHost(networkId, hostId); |
| 220 | } |
| 221 | |
| 222 | @Override |
Thomas Vachuska | 33979fd | 2015-07-31 11:41:14 -0700 | [diff] [blame] | 223 | public VirtualLink createVirtualLink(NetworkId networkId, |
Brian Stanke | 9a10897 | 2016-04-11 15:25:17 -0400 | [diff] [blame] | 224 | ConnectPoint src, ConnectPoint dst) { |
Thomas Vachuska | 33979fd | 2015-07-31 11:41:14 -0700 | [diff] [blame] | 225 | checkNotNull(networkId, NETWORK_NULL); |
| 226 | checkNotNull(src, LINK_POINT_NULL); |
| 227 | checkNotNull(dst, LINK_POINT_NULL); |
Brian Stanke | fb61df4 | 2016-07-25 11:47:51 -0400 | [diff] [blame] | 228 | ConnectPoint physicalSrc = mapVirtualToPhysicalPort(networkId, src); |
| 229 | checkNotNull(physicalSrc, LINK_POINT_NULL); |
| 230 | ConnectPoint physicalDst = mapVirtualToPhysicalPort(networkId, dst); |
| 231 | checkNotNull(physicalDst, LINK_POINT_NULL); |
| 232 | |
| 233 | VirtualNetworkProvider provider = getProvider(DefaultVirtualLink.PID); |
| 234 | Link.State state = Link.State.INACTIVE; |
| 235 | if (provider != null) { |
| 236 | boolean traversable = provider.isTraversable(physicalSrc, physicalDst); |
| 237 | state = traversable ? Link.State.ACTIVE : Link.State.INACTIVE; |
| 238 | } |
| 239 | return store.addLink(networkId, src, dst, state, null); |
| 240 | } |
| 241 | |
| 242 | /** |
| 243 | * Maps the virtual connect point to a physical connect point. |
| 244 | * |
| 245 | * @param networkId network identifier |
| 246 | * @param virtualCp virtual connect point |
| 247 | * @return physical connect point |
| 248 | */ |
| 249 | private ConnectPoint mapVirtualToPhysicalPort(NetworkId networkId, |
| 250 | ConnectPoint virtualCp) { |
| 251 | Set<VirtualPort> ports = store.getPorts(networkId, virtualCp.deviceId()); |
| 252 | for (VirtualPort port : ports) { |
| 253 | if (port.number().equals(virtualCp.port())) { |
Yoonseon Han | 6c60389 | 2016-09-01 11:52:21 -0700 | [diff] [blame] | 254 | return new ConnectPoint(port.realizedBy().deviceId(), |
| 255 | port.realizedBy().port()); |
Brian Stanke | fb61df4 | 2016-07-25 11:47:51 -0400 | [diff] [blame] | 256 | } |
| 257 | } |
| 258 | return null; |
Thomas Vachuska | 33979fd | 2015-07-31 11:41:14 -0700 | [diff] [blame] | 259 | } |
| 260 | |
Brian Stanke | 612cebf | 2016-05-02 10:21:33 -0400 | [diff] [blame] | 261 | /** |
| 262 | * Maps the physical connect point to a virtual connect point. |
| 263 | * |
Brian Stanke | 11f6d53 | 2016-07-05 16:17:59 -0400 | [diff] [blame] | 264 | * @param networkId network identifier |
Brian Stanke | 612cebf | 2016-05-02 10:21:33 -0400 | [diff] [blame] | 265 | * @param physicalCp physical connect point |
| 266 | * @return virtual connect point |
| 267 | */ |
| 268 | private ConnectPoint mapPhysicalToVirtualToPort(NetworkId networkId, |
Brian Stanke | 11f6d53 | 2016-07-05 16:17:59 -0400 | [diff] [blame] | 269 | ConnectPoint physicalCp) { |
Brian Stanke | 612cebf | 2016-05-02 10:21:33 -0400 | [diff] [blame] | 270 | Set<VirtualPort> ports = store.getPorts(networkId, null); |
| 271 | for (VirtualPort port : ports) { |
Yoonseon Han | 6c60389 | 2016-09-01 11:52:21 -0700 | [diff] [blame] | 272 | if (port.realizedBy().deviceId().equals(physicalCp.elementId()) && |
| 273 | port.realizedBy().port().equals(physicalCp.port())) { |
Brian Stanke | 612cebf | 2016-05-02 10:21:33 -0400 | [diff] [blame] | 274 | return new ConnectPoint(port.element().id(), port.number()); |
| 275 | } |
| 276 | } |
| 277 | return null; |
| 278 | } |
| 279 | |
Thomas Vachuska | 33979fd | 2015-07-31 11:41:14 -0700 | [diff] [blame] | 280 | @Override |
yoonseon | 214963b | 2016-11-21 15:41:07 -0800 | [diff] [blame] | 281 | public void removeVirtualLink(NetworkId networkId, ConnectPoint src, |
| 282 | ConnectPoint dst) { |
Thomas Vachuska | 33979fd | 2015-07-31 11:41:14 -0700 | [diff] [blame] | 283 | checkNotNull(networkId, NETWORK_NULL); |
| 284 | checkNotNull(src, LINK_POINT_NULL); |
| 285 | checkNotNull(dst, LINK_POINT_NULL); |
Brian Stanke | 11f6d53 | 2016-07-05 16:17:59 -0400 | [diff] [blame] | 286 | store.removeLink(networkId, src, dst); |
Thomas Vachuska | 33979fd | 2015-07-31 11:41:14 -0700 | [diff] [blame] | 287 | } |
| 288 | |
| 289 | @Override |
| 290 | public VirtualPort createVirtualPort(NetworkId networkId, DeviceId deviceId, |
Yoonseon Han | 6c60389 | 2016-09-01 11:52:21 -0700 | [diff] [blame] | 291 | PortNumber portNumber, ConnectPoint realizedBy) { |
Thomas Vachuska | 33979fd | 2015-07-31 11:41:14 -0700 | [diff] [blame] | 292 | checkNotNull(networkId, NETWORK_NULL); |
| 293 | checkNotNull(deviceId, DEVICE_NULL); |
| 294 | checkNotNull(portNumber, "Port description cannot be null"); |
| 295 | return store.addPort(networkId, deviceId, portNumber, realizedBy); |
| 296 | } |
| 297 | |
| 298 | @Override |
Yoonseon Han | 6c60389 | 2016-09-01 11:52:21 -0700 | [diff] [blame] | 299 | public void bindVirtualPort(NetworkId networkId, DeviceId deviceId, |
| 300 | PortNumber portNumber, ConnectPoint realizedBy) { |
| 301 | checkNotNull(networkId, NETWORK_NULL); |
| 302 | checkNotNull(deviceId, DEVICE_NULL); |
| 303 | checkNotNull(portNumber, "Port description cannot be null"); |
| 304 | checkNotNull(realizedBy, "Physical port description cannot be null"); |
| 305 | |
| 306 | store.bindPort(networkId, deviceId, portNumber, realizedBy); |
| 307 | } |
| 308 | |
| 309 | @Override |
yoonseon | 214963b | 2016-11-21 15:41:07 -0800 | [diff] [blame] | 310 | public void removeVirtualPort(NetworkId networkId, DeviceId deviceId, |
| 311 | PortNumber portNumber) { |
Thomas Vachuska | 33979fd | 2015-07-31 11:41:14 -0700 | [diff] [blame] | 312 | checkNotNull(networkId, NETWORK_NULL); |
| 313 | checkNotNull(deviceId, DEVICE_NULL); |
| 314 | checkNotNull(portNumber, "Port number cannot be null"); |
| 315 | store.removePort(networkId, deviceId, portNumber); |
| 316 | } |
| 317 | |
| 318 | @Override |
yoonseon | c6a6927 | 2017-01-12 18:22:20 -0800 | [diff] [blame] | 319 | public ServiceDirectory getServiceDirectory() { |
| 320 | return serviceDirectory; |
| 321 | } |
| 322 | |
| 323 | @Override |
Thomas Vachuska | 33979fd | 2015-07-31 11:41:14 -0700 | [diff] [blame] | 324 | public Set<VirtualNetwork> getVirtualNetworks(TenantId tenantId) { |
| 325 | checkNotNull(tenantId, TENANT_NULL); |
| 326 | return store.getNetworks(tenantId); |
| 327 | } |
| 328 | |
Brian Stanke | 11f6d53 | 2016-07-05 16:17:59 -0400 | [diff] [blame] | 329 | /** |
| 330 | * Returns the virtual network matching the network identifier. |
| 331 | * |
| 332 | * @param networkId network identifier |
| 333 | * @return virtual network |
| 334 | */ |
Brian Stanke | 8691428 | 2016-05-25 15:36:50 -0400 | [diff] [blame] | 335 | private VirtualNetwork getVirtualNetwork(NetworkId networkId) { |
| 336 | checkNotNull(networkId, NETWORK_NULL); |
| 337 | return store.getNetwork(networkId); |
| 338 | } |
| 339 | |
Thomas Vachuska | 33979fd | 2015-07-31 11:41:14 -0700 | [diff] [blame] | 340 | @Override |
| 341 | public Set<VirtualDevice> getVirtualDevices(NetworkId networkId) { |
| 342 | checkNotNull(networkId, NETWORK_NULL); |
| 343 | return store.getDevices(networkId); |
| 344 | } |
| 345 | |
| 346 | @Override |
Brian Stanke | 7a81b53 | 2016-06-14 15:43:51 -0400 | [diff] [blame] | 347 | public Set<VirtualHost> getVirtualHosts(NetworkId networkId) { |
| 348 | checkNotNull(networkId, NETWORK_NULL); |
| 349 | return store.getHosts(networkId); |
| 350 | } |
| 351 | |
| 352 | @Override |
Thomas Vachuska | 33979fd | 2015-07-31 11:41:14 -0700 | [diff] [blame] | 353 | public Set<VirtualLink> getVirtualLinks(NetworkId networkId) { |
| 354 | checkNotNull(networkId, NETWORK_NULL); |
| 355 | return store.getLinks(networkId); |
| 356 | } |
| 357 | |
| 358 | @Override |
| 359 | public Set<VirtualPort> getVirtualPorts(NetworkId networkId, DeviceId deviceId) { |
| 360 | checkNotNull(networkId, NETWORK_NULL); |
Thomas Vachuska | 33979fd | 2015-07-31 11:41:14 -0700 | [diff] [blame] | 361 | return store.getPorts(networkId, deviceId); |
| 362 | } |
| 363 | |
Brian Stanke | 8691428 | 2016-05-25 15:36:50 -0400 | [diff] [blame] | 364 | private final Map<ServiceKey, VnetService> networkServices = Maps.newConcurrentMap(); |
| 365 | |
Thomas Vachuska | 33979fd | 2015-07-31 11:41:14 -0700 | [diff] [blame] | 366 | @Override |
Yoonseon Han | b14461b | 2017-03-07 14:08:01 +0900 | [diff] [blame] | 367 | @SuppressWarnings("unchecked") |
Thomas Vachuska | 33979fd | 2015-07-31 11:41:14 -0700 | [diff] [blame] | 368 | public <T> T get(NetworkId networkId, Class<T> serviceClass) { |
| 369 | checkNotNull(networkId, NETWORK_NULL); |
Brian Stanke | 8691428 | 2016-05-25 15:36:50 -0400 | [diff] [blame] | 370 | ServiceKey serviceKey = networkServiceKey(networkId, serviceClass); |
| 371 | VnetService service = lookup(serviceKey); |
| 372 | if (service == null) { |
| 373 | service = create(serviceKey); |
| 374 | } |
| 375 | return (T) service; |
| 376 | } |
| 377 | |
yoonseon | 322c9c3 | 2016-12-07 16:47:02 -0800 | [diff] [blame] | 378 | @Override |
| 379 | public ApplicationId getVirtualNetworkApplicationId(NetworkId networkId) { |
| 380 | return appId; |
| 381 | } |
| 382 | |
Brian Stanke | 11f6d53 | 2016-07-05 16:17:59 -0400 | [diff] [blame] | 383 | /** |
| 384 | * Returns the Vnet service matching the service key. |
| 385 | * |
| 386 | * @param serviceKey service key |
| 387 | * @return vnet service |
| 388 | */ |
Brian Stanke | 8691428 | 2016-05-25 15:36:50 -0400 | [diff] [blame] | 389 | private VnetService lookup(ServiceKey serviceKey) { |
| 390 | return networkServices.get(serviceKey); |
| 391 | } |
| 392 | |
Brian Stanke | 11f6d53 | 2016-07-05 16:17:59 -0400 | [diff] [blame] | 393 | /** |
| 394 | * Creates a new service key using the specified network identifier and service class. |
| 395 | * |
| 396 | * @param networkId network identifier |
| 397 | * @param serviceClass service class |
| 398 | * @param <T> type of service |
| 399 | * @return service key |
| 400 | */ |
Brian Stanke | 8691428 | 2016-05-25 15:36:50 -0400 | [diff] [blame] | 401 | private <T> ServiceKey networkServiceKey(NetworkId networkId, Class<T> serviceClass) { |
| 402 | return new ServiceKey(networkId, serviceClass); |
| 403 | } |
| 404 | |
| 405 | |
Brian Stanke | 11f6d53 | 2016-07-05 16:17:59 -0400 | [diff] [blame] | 406 | /** |
| 407 | * Create a new vnet service instance. |
| 408 | * |
| 409 | * @param serviceKey service key |
| 410 | * @return vnet service |
| 411 | */ |
Brian Stanke | 8691428 | 2016-05-25 15:36:50 -0400 | [diff] [blame] | 412 | private VnetService create(ServiceKey serviceKey) { |
| 413 | VirtualNetwork network = getVirtualNetwork(serviceKey.networkId()); |
Brian Stanke | 11f6d53 | 2016-07-05 16:17:59 -0400 | [diff] [blame] | 414 | checkNotNull(network, NETWORK_NULL); |
yoonseon | c6a6927 | 2017-01-12 18:22:20 -0800 | [diff] [blame] | 415 | |
Brian Stanke | 8691428 | 2016-05-25 15:36:50 -0400 | [diff] [blame] | 416 | VnetService service; |
| 417 | if (serviceKey.serviceClass.equals(DeviceService.class)) { |
yoonseon | c6a6927 | 2017-01-12 18:22:20 -0800 | [diff] [blame] | 418 | service = new VirtualNetworkDeviceManager(this, network.id()); |
Brian Stanke | 8691428 | 2016-05-25 15:36:50 -0400 | [diff] [blame] | 419 | } else if (serviceKey.serviceClass.equals(LinkService.class)) { |
yoonseon | c6a6927 | 2017-01-12 18:22:20 -0800 | [diff] [blame] | 420 | service = new VirtualNetworkLinkManager(this, network.id()); |
Brian Stanke | 8e9f8d1 | 2016-06-08 14:48:33 -0400 | [diff] [blame] | 421 | } else if (serviceKey.serviceClass.equals(TopologyService.class)) { |
yoonseon | c6a6927 | 2017-01-12 18:22:20 -0800 | [diff] [blame] | 422 | service = new VirtualNetworkTopologyManager(this, network.id()); |
Brian Stanke | 11f6d53 | 2016-07-05 16:17:59 -0400 | [diff] [blame] | 423 | } else if (serviceKey.serviceClass.equals(IntentService.class)) { |
yoonseon | c6a6927 | 2017-01-12 18:22:20 -0800 | [diff] [blame] | 424 | service = new VirtualNetworkIntentManager(this, network.id()); |
Claudine Chiu | 30a8a2a | 2016-07-14 17:09:04 -0400 | [diff] [blame] | 425 | } else if (serviceKey.serviceClass.equals(HostService.class)) { |
yoonseon | c6a6927 | 2017-01-12 18:22:20 -0800 | [diff] [blame] | 426 | service = new VirtualNetworkHostManager(this, network.id()); |
Claudine Chiu | 45920dd | 2016-07-28 19:19:46 +0000 | [diff] [blame] | 427 | } else if (serviceKey.serviceClass.equals(PathService.class)) { |
yoonseon | c6a6927 | 2017-01-12 18:22:20 -0800 | [diff] [blame] | 428 | service = new VirtualNetworkPathManager(this, network.id()); |
Claudine Chiu | 70222ad | 2016-11-17 22:29:20 -0500 | [diff] [blame] | 429 | } else if (serviceKey.serviceClass.equals(FlowRuleService.class)) { |
yoonseon | c6a6927 | 2017-01-12 18:22:20 -0800 | [diff] [blame] | 430 | service = new VirtualNetworkFlowRuleManager(this, network.id()); |
yoonseon | 322c9c3 | 2016-12-07 16:47:02 -0800 | [diff] [blame] | 431 | } else if (serviceKey.serviceClass.equals(PacketService.class)) { |
| 432 | service = new VirtualNetworkPacketManager(this, network.id()); |
yoonseon | dc3210d | 2017-01-25 16:03:10 -0800 | [diff] [blame] | 433 | } else if (serviceKey.serviceClass.equals(GroupService.class)) { |
| 434 | service = new VirtualNetworkGroupManager(this, network.id()); |
yoonseon | 86bebed | 2017-02-03 15:23:57 -0800 | [diff] [blame] | 435 | } else if (serviceKey.serviceClass.equals(FlowObjectiveService.class)) { |
| 436 | service = new VirtualNetworkFlowObjectiveManager(this, network.id()); |
Brian Stanke | 8691428 | 2016-05-25 15:36:50 -0400 | [diff] [blame] | 437 | } else { |
| 438 | return null; |
| 439 | } |
| 440 | networkServices.put(serviceKey, service); |
| 441 | return service; |
| 442 | } |
| 443 | |
Brian Stanke | 11f6d53 | 2016-07-05 16:17:59 -0400 | [diff] [blame] | 444 | /** |
| 445 | * Service key class. |
| 446 | */ |
Claudine Chiu | 9a18f49 | 2017-02-27 15:57:06 -0500 | [diff] [blame] | 447 | private static class ServiceKey { |
Brian Stanke | 8691428 | 2016-05-25 15:36:50 -0400 | [diff] [blame] | 448 | final NetworkId networkId; |
| 449 | final Class serviceClass; |
| 450 | |
Brian Stanke | 11f6d53 | 2016-07-05 16:17:59 -0400 | [diff] [blame] | 451 | /** |
| 452 | * Constructor for service key. |
| 453 | * |
| 454 | * @param networkId network identifier |
| 455 | * @param serviceClass service class |
| 456 | */ |
Yoonseon Han | b14461b | 2017-03-07 14:08:01 +0900 | [diff] [blame] | 457 | ServiceKey(NetworkId networkId, Class serviceClass) { |
yoonseon | 214963b | 2016-11-21 15:41:07 -0800 | [diff] [blame] | 458 | |
Brian Stanke | 8691428 | 2016-05-25 15:36:50 -0400 | [diff] [blame] | 459 | checkNotNull(networkId, NETWORK_NULL); |
| 460 | this.networkId = networkId; |
| 461 | this.serviceClass = serviceClass; |
| 462 | } |
| 463 | |
Brian Stanke | 11f6d53 | 2016-07-05 16:17:59 -0400 | [diff] [blame] | 464 | /** |
| 465 | * Returns the network identifier. |
| 466 | * |
| 467 | * @return network identifier |
| 468 | */ |
Brian Stanke | 8691428 | 2016-05-25 15:36:50 -0400 | [diff] [blame] | 469 | public NetworkId networkId() { |
| 470 | return networkId; |
| 471 | } |
| 472 | |
Brian Stanke | 11f6d53 | 2016-07-05 16:17:59 -0400 | [diff] [blame] | 473 | /** |
| 474 | * Returns the service class. |
| 475 | * |
| 476 | * @return service class |
| 477 | */ |
Brian Stanke | 8691428 | 2016-05-25 15:36:50 -0400 | [diff] [blame] | 478 | public Class serviceClass() { |
| 479 | return serviceClass; |
| 480 | } |
Claudine Chiu | e7f6b91 | 2017-02-24 14:13:30 -0500 | [diff] [blame] | 481 | |
| 482 | @Override |
| 483 | public int hashCode() { |
| 484 | return Objects.hash(networkId, serviceClass); |
| 485 | } |
| 486 | |
| 487 | @Override |
| 488 | public boolean equals(Object obj) { |
| 489 | if (this == obj) { |
| 490 | return true; |
| 491 | } |
| 492 | if (obj instanceof ServiceKey) { |
| 493 | ServiceKey that = (ServiceKey) obj; |
| 494 | return Objects.equals(this.networkId, that.networkId) && |
| 495 | Objects.equals(this.serviceClass, that.serviceClass); |
| 496 | } |
| 497 | return false; |
| 498 | } |
Thomas Vachuska | 33979fd | 2015-07-31 11:41:14 -0700 | [diff] [blame] | 499 | } |
| 500 | |
Brian Stanke | 11f6d53 | 2016-07-05 16:17:59 -0400 | [diff] [blame] | 501 | /** |
| 502 | * Internal intent event listener. |
| 503 | */ |
| 504 | private class InternalVirtualIntentListener implements IntentListener { |
yoonseon | 214963b | 2016-11-21 15:41:07 -0800 | [diff] [blame] | 505 | |
Brian Stanke | 11f6d53 | 2016-07-05 16:17:59 -0400 | [diff] [blame] | 506 | @Override |
| 507 | public void event(IntentEvent event) { |
| 508 | |
| 509 | // Ignore intent events that are not relevant. |
| 510 | if (!isRelevant(event)) { |
| 511 | return; |
| 512 | } |
| 513 | |
| 514 | VirtualNetworkIntent intent = (VirtualNetworkIntent) event.subject(); |
| 515 | |
| 516 | switch (event.type()) { |
| 517 | case INSTALL_REQ: |
| 518 | store.addOrUpdateIntent(intent, IntentState.INSTALL_REQ); |
| 519 | break; |
| 520 | case INSTALLED: |
| 521 | store.addOrUpdateIntent(intent, IntentState.INSTALLED); |
| 522 | break; |
| 523 | case WITHDRAW_REQ: |
| 524 | store.addOrUpdateIntent(intent, IntentState.WITHDRAW_REQ); |
| 525 | break; |
| 526 | case WITHDRAWN: |
| 527 | store.addOrUpdateIntent(intent, IntentState.WITHDRAWN); |
| 528 | break; |
| 529 | case FAILED: |
| 530 | store.addOrUpdateIntent(intent, IntentState.FAILED); |
| 531 | break; |
| 532 | case CORRUPT: |
| 533 | store.addOrUpdateIntent(intent, IntentState.CORRUPT); |
| 534 | break; |
| 535 | case PURGED: |
| 536 | store.removeIntent(intent.key()); |
| 537 | default: |
| 538 | break; |
| 539 | } |
| 540 | } |
| 541 | |
| 542 | @Override |
| 543 | public boolean isRelevant(IntentEvent event) { |
| 544 | if (event.subject() instanceof VirtualNetworkIntent) { |
| 545 | return true; |
| 546 | } |
| 547 | return false; |
| 548 | } |
| 549 | } |
| 550 | |
| 551 | |
Thomas Vachuska | 3d62fd7 | 2015-09-25 14:58:13 -0700 | [diff] [blame] | 552 | @Override |
yoonseon | 214963b | 2016-11-21 15:41:07 -0800 | [diff] [blame] | 553 | protected VirtualNetworkProviderService |
| 554 | createProviderService(VirtualNetworkProvider provider) { |
Thomas Vachuska | 3d62fd7 | 2015-09-25 14:58:13 -0700 | [diff] [blame] | 555 | return new InternalVirtualNetworkProviderService(provider); |
| 556 | } |
| 557 | |
yoonseon | 6b972c3 | 2016-12-06 16:45:03 -0800 | [diff] [blame] | 558 | |
Brian Stanke | fb61df4 | 2016-07-25 11:47:51 -0400 | [diff] [blame] | 559 | /** |
| 560 | * Service issued to registered virtual network providers so that they |
| 561 | * can interact with the core. |
| 562 | */ |
Thomas Vachuska | 3d62fd7 | 2015-09-25 14:58:13 -0700 | [diff] [blame] | 563 | private class InternalVirtualNetworkProviderService |
| 564 | extends AbstractProviderService<VirtualNetworkProvider> |
| 565 | implements VirtualNetworkProviderService { |
Brian Stanke | fb61df4 | 2016-07-25 11:47:51 -0400 | [diff] [blame] | 566 | /** |
| 567 | * Constructor. |
| 568 | * @param provider virtual network provider |
| 569 | */ |
Thomas Vachuska | 3d62fd7 | 2015-09-25 14:58:13 -0700 | [diff] [blame] | 570 | InternalVirtualNetworkProviderService(VirtualNetworkProvider provider) { |
| 571 | super(provider); |
| 572 | } |
Brian Stanke | 4d57988 | 2016-04-22 13:28:46 -0400 | [diff] [blame] | 573 | |
| 574 | @Override |
Brian Stanke | fb61df4 | 2016-07-25 11:47:51 -0400 | [diff] [blame] | 575 | public void topologyChanged(Set<Set<ConnectPoint>> clusters) { |
Brian Stanke | fb61df4 | 2016-07-25 11:47:51 -0400 | [diff] [blame] | 576 | Set<TenantId> tenantIds = getTenantIds(); |
| 577 | tenantIds.forEach(tenantId -> { |
| 578 | Set<VirtualNetwork> virtualNetworks = getVirtualNetworks(tenantId); |
| 579 | |
| 580 | virtualNetworks.forEach(virtualNetwork -> { |
| 581 | Set<VirtualLink> virtualLinks = getVirtualLinks(virtualNetwork.id()); |
| 582 | |
| 583 | virtualLinks.forEach(virtualLink -> { |
yoonseon | 214963b | 2016-11-21 15:41:07 -0800 | [diff] [blame] | 584 | if (isVirtualLinkInCluster(virtualNetwork.id(), |
| 585 | virtualLink, clusters)) { |
| 586 | store.updateLink(virtualLink, virtualLink.tunnelId(), |
| 587 | Link.State.ACTIVE); |
Brian Stanke | fb61df4 | 2016-07-25 11:47:51 -0400 | [diff] [blame] | 588 | } else { |
yoonseon | 214963b | 2016-11-21 15:41:07 -0800 | [diff] [blame] | 589 | store.updateLink(virtualLink, virtualLink.tunnelId(), |
| 590 | Link.State.INACTIVE); |
Brian Stanke | fb61df4 | 2016-07-25 11:47:51 -0400 | [diff] [blame] | 591 | } |
| 592 | }); |
| 593 | }); |
| 594 | }); |
| 595 | } |
| 596 | |
| 597 | /** |
yoonseon | 214963b | 2016-11-21 15:41:07 -0800 | [diff] [blame] | 598 | * Determines if the virtual link (both source and destination connect point) |
| 599 | * is in a cluster. |
Brian Stanke | fb61df4 | 2016-07-25 11:47:51 -0400 | [diff] [blame] | 600 | * |
| 601 | * @param networkId virtual network identifier |
| 602 | * @param virtualLink virtual link |
| 603 | * @param clusters topology clusters |
| 604 | * @return true if the virtual link is in a cluster. |
| 605 | */ |
| 606 | private boolean isVirtualLinkInCluster(NetworkId networkId, VirtualLink virtualLink, |
| 607 | Set<Set<ConnectPoint>> clusters) { |
yoonseon | 214963b | 2016-11-21 15:41:07 -0800 | [diff] [blame] | 608 | ConnectPoint srcPhysicalCp = |
| 609 | mapVirtualToPhysicalPort(networkId, virtualLink.src()); |
| 610 | ConnectPoint dstPhysicalCp = |
| 611 | mapVirtualToPhysicalPort(networkId, virtualLink.dst()); |
Brian Stanke | fb61df4 | 2016-07-25 11:47:51 -0400 | [diff] [blame] | 612 | |
| 613 | final boolean[] foundSrc = {false}; |
| 614 | final boolean[] foundDst = {false}; |
| 615 | clusters.forEach(connectPoints -> { |
| 616 | connectPoints.forEach(connectPoint -> { |
| 617 | if (connectPoint.equals(srcPhysicalCp)) { |
| 618 | foundSrc[0] = true; |
| 619 | } else if (connectPoint.equals(dstPhysicalCp)) { |
| 620 | foundDst[0] = true; |
| 621 | } |
| 622 | }); |
| 623 | if (foundSrc[0] && foundDst[0]) { |
| 624 | return; |
| 625 | } |
| 626 | }); |
| 627 | return foundSrc[0] && foundDst[0]; |
| 628 | } |
| 629 | |
| 630 | @Override |
yoonseon | 214963b | 2016-11-21 15:41:07 -0800 | [diff] [blame] | 631 | public void tunnelUp(NetworkId networkId, ConnectPoint src, |
| 632 | ConnectPoint dst, TunnelId tunnelId) { |
Brian Stanke | 612cebf | 2016-05-02 10:21:33 -0400 | [diff] [blame] | 633 | ConnectPoint srcVirtualCp = mapPhysicalToVirtualToPort(networkId, src); |
| 634 | ConnectPoint dstVirtualCp = mapPhysicalToVirtualToPort(networkId, dst); |
| 635 | if ((srcVirtualCp == null) || (dstVirtualCp == null)) { |
| 636 | log.error("Src or dst virtual connection point was not found."); |
| 637 | } |
| 638 | |
| 639 | VirtualLink virtualLink = store.getLink(networkId, srcVirtualCp, dstVirtualCp); |
| 640 | if (virtualLink != null) { |
| 641 | store.updateLink(virtualLink, tunnelId, Link.State.ACTIVE); |
| 642 | } |
Brian Stanke | 4d57988 | 2016-04-22 13:28:46 -0400 | [diff] [blame] | 643 | } |
| 644 | |
| 645 | @Override |
yoonseon | 214963b | 2016-11-21 15:41:07 -0800 | [diff] [blame] | 646 | public void tunnelDown(NetworkId networkId, ConnectPoint src, |
| 647 | ConnectPoint dst, TunnelId tunnelId) { |
Brian Stanke | 612cebf | 2016-05-02 10:21:33 -0400 | [diff] [blame] | 648 | ConnectPoint srcVirtualCp = mapPhysicalToVirtualToPort(networkId, src); |
| 649 | ConnectPoint dstVirtualCp = mapPhysicalToVirtualToPort(networkId, dst); |
| 650 | if ((srcVirtualCp == null) || (dstVirtualCp == null)) { |
| 651 | log.error("Src or dst virtual connection point was not found."); |
| 652 | } |
Brian Stanke | 4d57988 | 2016-04-22 13:28:46 -0400 | [diff] [blame] | 653 | |
Brian Stanke | 612cebf | 2016-05-02 10:21:33 -0400 | [diff] [blame] | 654 | VirtualLink virtualLink = store.getLink(networkId, srcVirtualCp, dstVirtualCp); |
| 655 | if (virtualLink != null) { |
| 656 | store.updateLink(virtualLink, tunnelId, Link.State.INACTIVE); |
| 657 | } |
Brian Stanke | 4d57988 | 2016-04-22 13:28:46 -0400 | [diff] [blame] | 658 | } |
Thomas Vachuska | 3d62fd7 | 2015-09-25 14:58:13 -0700 | [diff] [blame] | 659 | } |
Thomas Vachuska | 33979fd | 2015-07-31 11:41:14 -0700 | [diff] [blame] | 660 | } |