Thomas Vachuska | 781d18b | 2014-10-27 10:31:25 -0700 | [diff] [blame] | 1 | /* |
Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 2 | * Copyright 2014 Open Networking Laboratory |
Thomas Vachuska | 781d18b | 2014-10-27 10:31:25 -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 |
Thomas Vachuska | 781d18b | 2014-10-27 10:31:25 -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 | */ |
alshabib | 1cc04f7 | 2014-09-16 16:09:58 -0700 | [diff] [blame] | 16 | package org.onlab.onos.provider.of.flow.impl; |
| 17 | |
Thomas Vachuska | 9b2da21 | 2014-11-10 19:30:25 -0800 | [diff] [blame] | 18 | import com.google.common.collect.ArrayListMultimap; |
| 19 | import com.google.common.collect.Maps; |
| 20 | import com.google.common.collect.Multimap; |
| 21 | import com.google.common.collect.Sets; |
alshabib | 1cc04f7 | 2014-09-16 16:09:58 -0700 | [diff] [blame] | 22 | import org.apache.felix.scr.annotations.Activate; |
| 23 | import org.apache.felix.scr.annotations.Component; |
| 24 | import org.apache.felix.scr.annotations.Deactivate; |
| 25 | import org.apache.felix.scr.annotations.Reference; |
| 26 | import org.apache.felix.scr.annotations.ReferenceCardinality; |
Thomas Vachuska | e0f804a | 2014-10-27 23:40:48 -0700 | [diff] [blame] | 27 | import org.onlab.onos.core.ApplicationId; |
alshabib | a7f7ca8 | 2014-09-22 11:41:23 -0700 | [diff] [blame] | 28 | import org.onlab.onos.net.DeviceId; |
Jonathan Hart | 86e5935 | 2014-10-22 10:42:16 -0700 | [diff] [blame] | 29 | import org.onlab.onos.net.flow.BatchOperation; |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 30 | import org.onlab.onos.net.flow.CompletedBatchOperation; |
| 31 | import org.onlab.onos.net.flow.DefaultFlowEntry; |
alshabib | 1c319ff | 2014-10-04 20:29:09 -0700 | [diff] [blame] | 32 | import org.onlab.onos.net.flow.FlowEntry; |
alshabib | 1cc04f7 | 2014-09-16 16:09:58 -0700 | [diff] [blame] | 33 | import org.onlab.onos.net.flow.FlowRule; |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 34 | import org.onlab.onos.net.flow.FlowRuleBatchEntry; |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 35 | import org.onlab.onos.net.flow.FlowRuleBatchEntry.FlowRuleOperation; |
alshabib | 1cc04f7 | 2014-09-16 16:09:58 -0700 | [diff] [blame] | 36 | import org.onlab.onos.net.flow.FlowRuleProvider; |
| 37 | import org.onlab.onos.net.flow.FlowRuleProviderRegistry; |
| 38 | import org.onlab.onos.net.flow.FlowRuleProviderService; |
| 39 | import org.onlab.onos.net.provider.AbstractProvider; |
| 40 | import org.onlab.onos.net.provider.ProviderId; |
| 41 | import org.onlab.onos.net.topology.TopologyService; |
tom | 9c94c5b | 2014-09-17 13:14:42 -0700 | [diff] [blame] | 42 | import org.onlab.onos.openflow.controller.Dpid; |
| 43 | import org.onlab.onos.openflow.controller.OpenFlowController; |
alshabib | eec3a06 | 2014-09-17 18:01:26 -0700 | [diff] [blame] | 44 | import org.onlab.onos.openflow.controller.OpenFlowEventListener; |
tom | 9c94c5b | 2014-09-17 13:14:42 -0700 | [diff] [blame] | 45 | import org.onlab.onos.openflow.controller.OpenFlowSwitch; |
alshabib | ce4e578 | 2014-09-17 14:56:42 -0700 | [diff] [blame] | 46 | import org.onlab.onos.openflow.controller.OpenFlowSwitchListener; |
Ayaka Koshibe | ab91cc4 | 2014-09-25 10:20:52 -0700 | [diff] [blame] | 47 | import org.onlab.onos.openflow.controller.RoleState; |
alshabib | 19fdc12 | 2014-10-03 11:38:19 -0700 | [diff] [blame] | 48 | import org.projectfloodlight.openflow.protocol.OFActionType; |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 49 | import org.projectfloodlight.openflow.protocol.OFBarrierRequest; |
| 50 | import org.projectfloodlight.openflow.protocol.OFErrorMsg; |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 51 | import org.projectfloodlight.openflow.protocol.OFFlowMod; |
alshabib | 8f1cf4a | 2014-09-17 14:44:48 -0700 | [diff] [blame] | 52 | import org.projectfloodlight.openflow.protocol.OFFlowRemoved; |
alshabib | 5c370ff | 2014-09-18 10:12:14 -0700 | [diff] [blame] | 53 | import org.projectfloodlight.openflow.protocol.OFFlowStatsEntry; |
| 54 | import org.projectfloodlight.openflow.protocol.OFFlowStatsReply; |
alshabib | 19fdc12 | 2014-10-03 11:38:19 -0700 | [diff] [blame] | 55 | import org.projectfloodlight.openflow.protocol.OFInstructionType; |
alshabib | 8f1cf4a | 2014-09-17 14:44:48 -0700 | [diff] [blame] | 56 | import org.projectfloodlight.openflow.protocol.OFMessage; |
| 57 | import org.projectfloodlight.openflow.protocol.OFPortStatus; |
alshabib | 5c370ff | 2014-09-18 10:12:14 -0700 | [diff] [blame] | 58 | import org.projectfloodlight.openflow.protocol.OFStatsReply; |
alshabib | 54ce589 | 2014-09-23 17:50:51 -0700 | [diff] [blame] | 59 | import org.projectfloodlight.openflow.protocol.OFStatsReplyFlags; |
alshabib | 5c370ff | 2014-09-18 10:12:14 -0700 | [diff] [blame] | 60 | import org.projectfloodlight.openflow.protocol.OFStatsType; |
alshabib | 19fdc12 | 2014-10-03 11:38:19 -0700 | [diff] [blame] | 61 | import org.projectfloodlight.openflow.protocol.OFVersion; |
| 62 | import org.projectfloodlight.openflow.protocol.action.OFAction; |
| 63 | import org.projectfloodlight.openflow.protocol.action.OFActionOutput; |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 64 | import org.projectfloodlight.openflow.protocol.errormsg.OFBadActionErrorMsg; |
| 65 | import org.projectfloodlight.openflow.protocol.errormsg.OFBadInstructionErrorMsg; |
| 66 | import org.projectfloodlight.openflow.protocol.errormsg.OFBadMatchErrorMsg; |
| 67 | import org.projectfloodlight.openflow.protocol.errormsg.OFBadRequestErrorMsg; |
| 68 | import org.projectfloodlight.openflow.protocol.errormsg.OFFlowModFailedErrorMsg; |
alshabib | 19fdc12 | 2014-10-03 11:38:19 -0700 | [diff] [blame] | 69 | import org.projectfloodlight.openflow.protocol.instruction.OFInstruction; |
| 70 | import org.projectfloodlight.openflow.protocol.instruction.OFInstructionApplyActions; |
| 71 | import org.projectfloodlight.openflow.types.OFPort; |
alshabib | 1cc04f7 | 2014-09-16 16:09:58 -0700 | [diff] [blame] | 72 | import org.slf4j.Logger; |
| 73 | |
Thomas Vachuska | 9b2da21 | 2014-11-10 19:30:25 -0800 | [diff] [blame] | 74 | import java.util.Collections; |
| 75 | import java.util.HashMap; |
| 76 | import java.util.List; |
| 77 | import java.util.Map; |
Brian O'Connor | 427a176 | 2014-11-19 18:40:32 -0800 | [diff] [blame^] | 78 | import java.util.Optional; |
Thomas Vachuska | 9b2da21 | 2014-11-10 19:30:25 -0800 | [diff] [blame] | 79 | import java.util.Set; |
| 80 | import java.util.concurrent.ConcurrentHashMap; |
| 81 | import java.util.concurrent.CountDownLatch; |
| 82 | import java.util.concurrent.ExecutionException; |
| 83 | import java.util.concurrent.Future; |
| 84 | import java.util.concurrent.TimeUnit; |
| 85 | import java.util.concurrent.TimeoutException; |
| 86 | import java.util.concurrent.atomic.AtomicBoolean; |
| 87 | import java.util.concurrent.atomic.AtomicLong; |
| 88 | |
| 89 | import static org.slf4j.LoggerFactory.getLogger; |
alshabib | eec3a06 | 2014-09-17 18:01:26 -0700 | [diff] [blame] | 90 | |
alshabib | 1cc04f7 | 2014-09-16 16:09:58 -0700 | [diff] [blame] | 91 | /** |
| 92 | * Provider which uses an OpenFlow controller to detect network |
| 93 | * end-station hosts. |
| 94 | */ |
| 95 | @Component(immediate = true) |
| 96 | public class OpenFlowRuleProvider extends AbstractProvider implements FlowRuleProvider { |
| 97 | |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 98 | enum BatchState { STARTED, FINISHED, CANCELLED }; |
| 99 | |
alshabib | 1cc04f7 | 2014-09-16 16:09:58 -0700 | [diff] [blame] | 100 | private final Logger log = getLogger(getClass()); |
| 101 | |
| 102 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) |
| 103 | protected FlowRuleProviderRegistry providerRegistry; |
| 104 | |
| 105 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) |
| 106 | protected OpenFlowController controller; |
| 107 | |
| 108 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) |
| 109 | protected TopologyService topologyService; |
| 110 | |
| 111 | private FlowRuleProviderService providerService; |
| 112 | |
alshabib | eec3a06 | 2014-09-17 18:01:26 -0700 | [diff] [blame] | 113 | private final InternalFlowProvider listener = new InternalFlowProvider(); |
| 114 | |
Madan Jampani | 117aaae | 2014-10-23 10:04:05 -0700 | [diff] [blame] | 115 | // FIXME: This should be an expiring map to ensure futures that don't have |
| 116 | // a future eventually get garbage collected. |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 117 | private final Map<Long, InstallationFuture> pendingFutures = |
| 118 | new ConcurrentHashMap<Long, InstallationFuture>(); |
| 119 | |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 120 | private final Map<Long, InstallationFuture> pendingFMs = |
| 121 | new ConcurrentHashMap<Long, InstallationFuture>(); |
| 122 | |
alshabib | 3d643ec | 2014-10-22 18:33:00 -0700 | [diff] [blame] | 123 | private final Map<Dpid, FlowStatsCollector> collectors = Maps.newHashMap(); |
| 124 | |
Brian O'Connor | 427a176 | 2014-11-19 18:40:32 -0800 | [diff] [blame^] | 125 | private final AtomicLong xidCounter = new AtomicLong(1); |
Thomas Vachuska | 9b2da21 | 2014-11-10 19:30:25 -0800 | [diff] [blame] | 126 | |
alshabib | 1cc04f7 | 2014-09-16 16:09:58 -0700 | [diff] [blame] | 127 | /** |
| 128 | * Creates an OpenFlow host provider. |
| 129 | */ |
| 130 | public OpenFlowRuleProvider() { |
tom | 7e02cda | 2014-09-18 12:05:46 -0700 | [diff] [blame] | 131 | super(new ProviderId("of", "org.onlab.onos.provider.openflow")); |
alshabib | 1cc04f7 | 2014-09-16 16:09:58 -0700 | [diff] [blame] | 132 | } |
| 133 | |
| 134 | @Activate |
| 135 | public void activate() { |
| 136 | providerService = providerRegistry.register(this); |
alshabib | eec3a06 | 2014-09-17 18:01:26 -0700 | [diff] [blame] | 137 | controller.addListener(listener); |
| 138 | controller.addEventListener(listener); |
alshabib | 3d643ec | 2014-10-22 18:33:00 -0700 | [diff] [blame] | 139 | |
| 140 | for (OpenFlowSwitch sw : controller.getSwitches()) { |
| 141 | FlowStatsCollector fsc = new FlowStatsCollector(sw, POLL_INTERVAL); |
| 142 | fsc.start(); |
| 143 | collectors.put(new Dpid(sw.getId()), fsc); |
| 144 | } |
| 145 | |
| 146 | |
alshabib | 1cc04f7 | 2014-09-16 16:09:58 -0700 | [diff] [blame] | 147 | log.info("Started"); |
| 148 | } |
| 149 | |
| 150 | @Deactivate |
| 151 | public void deactivate() { |
| 152 | providerRegistry.unregister(this); |
| 153 | providerService = null; |
| 154 | |
| 155 | log.info("Stopped"); |
| 156 | } |
Thomas Vachuska | 9b2da21 | 2014-11-10 19:30:25 -0800 | [diff] [blame] | 157 | |
alshabib | 1cc04f7 | 2014-09-16 16:09:58 -0700 | [diff] [blame] | 158 | @Override |
| 159 | public void applyFlowRule(FlowRule... flowRules) { |
alshabib | 35edb1a | 2014-09-16 17:44:44 -0700 | [diff] [blame] | 160 | for (int i = 0; i < flowRules.length; i++) { |
| 161 | applyRule(flowRules[i]); |
| 162 | } |
alshabib | 1cc04f7 | 2014-09-16 16:09:58 -0700 | [diff] [blame] | 163 | } |
| 164 | |
alshabib | 35edb1a | 2014-09-16 17:44:44 -0700 | [diff] [blame] | 165 | private void applyRule(FlowRule flowRule) { |
| 166 | OpenFlowSwitch sw = controller.getSwitch(Dpid.dpid(flowRule.deviceId().uri())); |
Brian O'Connor | 427a176 | 2014-11-19 18:40:32 -0800 | [diff] [blame^] | 167 | sw.sendMsg(FlowModBuilder.builder(flowRule, sw.factory(), |
| 168 | Optional.empty()).buildFlowAdd()); |
alshabib | 35edb1a | 2014-09-16 17:44:44 -0700 | [diff] [blame] | 169 | } |
| 170 | |
alshabib | 35edb1a | 2014-09-16 17:44:44 -0700 | [diff] [blame] | 171 | |
alshabib | 1cc04f7 | 2014-09-16 16:09:58 -0700 | [diff] [blame] | 172 | @Override |
| 173 | public void removeFlowRule(FlowRule... flowRules) { |
alshabib | 219ebaa | 2014-09-22 15:41:24 -0700 | [diff] [blame] | 174 | for (int i = 0; i < flowRules.length; i++) { |
| 175 | removeRule(flowRules[i]); |
| 176 | } |
alshabib | 1cc04f7 | 2014-09-16 16:09:58 -0700 | [diff] [blame] | 177 | |
| 178 | } |
| 179 | |
alshabib | 219ebaa | 2014-09-22 15:41:24 -0700 | [diff] [blame] | 180 | private void removeRule(FlowRule flowRule) { |
| 181 | OpenFlowSwitch sw = controller.getSwitch(Dpid.dpid(flowRule.deviceId().uri())); |
Brian O'Connor | 427a176 | 2014-11-19 18:40:32 -0800 | [diff] [blame^] | 182 | sw.sendMsg(FlowModBuilder.builder(flowRule, sw.factory(), |
| 183 | Optional.empty()).buildFlowDel()); |
alshabib | 219ebaa | 2014-09-22 15:41:24 -0700 | [diff] [blame] | 184 | } |
| 185 | |
alshabib | a68eb96 | 2014-09-24 20:34:13 -0700 | [diff] [blame] | 186 | @Override |
| 187 | public void removeRulesById(ApplicationId id, FlowRule... flowRules) { |
| 188 | // TODO: optimize using the ApplicationId |
| 189 | removeFlowRule(flowRules); |
| 190 | } |
| 191 | |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 192 | @Override |
Thomas Vachuska | 9b2da21 | 2014-11-10 19:30:25 -0800 | [diff] [blame] | 193 | public Future<CompletedBatchOperation> executeBatch(BatchOperation<FlowRuleBatchEntry> batch) { |
Jonathan Hart | 1109640 | 2014-10-20 17:31:49 -0700 | [diff] [blame] | 194 | final Set<Dpid> sws = |
| 195 | Collections.newSetFromMap(new ConcurrentHashMap<Dpid, Boolean>()); |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 196 | final Map<Long, FlowRuleBatchEntry> fmXids = new HashMap<Long, FlowRuleBatchEntry>(); |
Thomas Vachuska | 9b2da21 | 2014-11-10 19:30:25 -0800 | [diff] [blame] | 197 | /* |
| 198 | * Use identity hash map for reference equality as we could have equal |
| 199 | * flow mods for different switches. |
| 200 | */ |
| 201 | Map<OFFlowMod, OpenFlowSwitch> mods = Maps.newIdentityHashMap(); |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 202 | for (FlowRuleBatchEntry fbe : batch.getOperations()) { |
| 203 | FlowRule flowRule = fbe.getTarget(); |
| 204 | OpenFlowSwitch sw = controller.getSwitch(Dpid.dpid(flowRule.deviceId().uri())); |
alshabib | 7911a05 | 2014-10-16 17:49:37 -0700 | [diff] [blame] | 205 | if (sw == null) { |
alshabib | 3effd04 | 2014-10-17 12:00:31 -0700 | [diff] [blame] | 206 | /* |
| 207 | * if a switch we are supposed to install to is gone then |
| 208 | * cancel (ie. rollback) the work that has been done so far |
| 209 | * and return the associated future. |
| 210 | */ |
| 211 | InstallationFuture failed = new InstallationFuture(sws, fmXids); |
| 212 | failed.cancel(true); |
| 213 | return failed; |
alshabib | 7911a05 | 2014-10-16 17:49:37 -0700 | [diff] [blame] | 214 | } |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 215 | sws.add(new Dpid(sw.getId())); |
Brian O'Connor | 427a176 | 2014-11-19 18:40:32 -0800 | [diff] [blame^] | 216 | Long flowModXid = xidCounter.getAndIncrement(); |
| 217 | FlowModBuilder builder = |
| 218 | FlowModBuilder.builder(flowRule, sw.factory(), |
| 219 | Optional.of(flowModXid)); |
Thomas Vachuska | 9b2da21 | 2014-11-10 19:30:25 -0800 | [diff] [blame] | 220 | OFFlowMod mod = null; |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 221 | switch (fbe.getOperator()) { |
| 222 | case ADD: |
| 223 | mod = builder.buildFlowAdd(); |
| 224 | break; |
| 225 | case REMOVE: |
| 226 | mod = builder.buildFlowDel(); |
| 227 | break; |
| 228 | case MODIFY: |
| 229 | mod = builder.buildFlowMod(); |
| 230 | break; |
| 231 | default: |
| 232 | log.error("Unsupported batch operation {}", fbe.getOperator()); |
| 233 | } |
| 234 | if (mod != null) { |
Thomas Vachuska | 9b2da21 | 2014-11-10 19:30:25 -0800 | [diff] [blame] | 235 | mods.put(mod, sw); |
Brian O'Connor | 427a176 | 2014-11-19 18:40:32 -0800 | [diff] [blame^] | 236 | fmXids.put(flowModXid, fbe); |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 237 | } else { |
| 238 | log.error("Conversion of flowrule {} failed.", flowRule); |
| 239 | } |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 240 | } |
| 241 | InstallationFuture installation = new InstallationFuture(sws, fmXids); |
| 242 | for (Long xid : fmXids.keySet()) { |
| 243 | pendingFMs.put(xid, installation); |
| 244 | } |
Brian O'Connor | 427a176 | 2014-11-19 18:40:32 -0800 | [diff] [blame^] | 245 | |
Thomas Vachuska | 9b2da21 | 2014-11-10 19:30:25 -0800 | [diff] [blame] | 246 | pendingFutures.put(installation.xid(), installation); |
| 247 | for (Map.Entry<OFFlowMod, OpenFlowSwitch> entry : mods.entrySet()) { |
| 248 | OpenFlowSwitch sw = entry.getValue(); |
| 249 | OFFlowMod mod = entry.getKey(); |
| 250 | sw.sendMsg(mod); |
| 251 | } |
| 252 | installation.verify(); |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 253 | return installation; |
| 254 | } |
| 255 | |
| 256 | |
alshabib | 8f1cf4a | 2014-09-17 14:44:48 -0700 | [diff] [blame] | 257 | private class InternalFlowProvider |
Thomas Vachuska | 9b2da21 | 2014-11-10 19:30:25 -0800 | [diff] [blame] | 258 | implements OpenFlowSwitchListener, OpenFlowEventListener { |
alshabib | 8f1cf4a | 2014-09-17 14:44:48 -0700 | [diff] [blame] | 259 | |
alshabib | 3d643ec | 2014-10-22 18:33:00 -0700 | [diff] [blame] | 260 | |
alshabib | 1c319ff | 2014-10-04 20:29:09 -0700 | [diff] [blame] | 261 | private final Multimap<DeviceId, FlowEntry> completeEntries = |
alshabib | 54ce589 | 2014-09-23 17:50:51 -0700 | [diff] [blame] | 262 | ArrayListMultimap.create(); |
alshabib | 8f1cf4a | 2014-09-17 14:44:48 -0700 | [diff] [blame] | 263 | |
| 264 | @Override |
| 265 | public void switchAdded(Dpid dpid) { |
alshabib | ba5ac48 | 2014-10-02 17:15:20 -0700 | [diff] [blame] | 266 | FlowStatsCollector fsc = new FlowStatsCollector(controller.getSwitch(dpid), POLL_INTERVAL); |
alshabib | eec3a06 | 2014-09-17 18:01:26 -0700 | [diff] [blame] | 267 | fsc.start(); |
| 268 | collectors.put(dpid, fsc); |
alshabib | 8f1cf4a | 2014-09-17 14:44:48 -0700 | [diff] [blame] | 269 | } |
| 270 | |
| 271 | @Override |
| 272 | public void switchRemoved(Dpid dpid) { |
alshabib | dfc7afb | 2014-10-21 20:13:27 -0700 | [diff] [blame] | 273 | FlowStatsCollector collector = collectors.remove(dpid); |
| 274 | if (collector != null) { |
| 275 | collector.stop(); |
| 276 | } |
alshabib | 8f1cf4a | 2014-09-17 14:44:48 -0700 | [diff] [blame] | 277 | } |
| 278 | |
| 279 | @Override |
Ayaka Koshibe | 38594c2 | 2014-10-22 13:36:12 -0700 | [diff] [blame] | 280 | public void switchChanged(Dpid dpid) { |
| 281 | } |
| 282 | |
| 283 | @Override |
alshabib | 8f1cf4a | 2014-09-17 14:44:48 -0700 | [diff] [blame] | 284 | public void portChanged(Dpid dpid, OFPortStatus status) { |
| 285 | //TODO: Decide whether to evict flows internal store. |
| 286 | } |
| 287 | |
| 288 | @Override |
| 289 | public void handleMessage(Dpid dpid, OFMessage msg) { |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 290 | InstallationFuture future = null; |
alshabib | 8f1cf4a | 2014-09-17 14:44:48 -0700 | [diff] [blame] | 291 | switch (msg.getType()) { |
Thomas Vachuska | 9b2da21 | 2014-11-10 19:30:25 -0800 | [diff] [blame] | 292 | case FLOW_REMOVED: |
| 293 | OFFlowRemoved removed = (OFFlowRemoved) msg; |
alshabib | 6b5cfec | 2014-09-18 17:42:18 -0700 | [diff] [blame] | 294 | |
Thomas Vachuska | 9b2da21 | 2014-11-10 19:30:25 -0800 | [diff] [blame] | 295 | FlowEntry fr = new FlowEntryBuilder(dpid, removed).build(); |
| 296 | providerService.flowRemoved(fr); |
| 297 | break; |
| 298 | case STATS_REPLY: |
| 299 | pushFlowMetrics(dpid, (OFStatsReply) msg); |
| 300 | break; |
| 301 | case BARRIER_REPLY: |
| 302 | future = pendingFutures.get(msg.getXid()); |
| 303 | if (future != null) { |
| 304 | future.satisfyRequirement(dpid); |
| 305 | } |
| 306 | break; |
| 307 | case ERROR: |
| 308 | future = pendingFMs.get(msg.getXid()); |
| 309 | if (future != null) { |
| 310 | future.fail((OFErrorMsg) msg, dpid); |
| 311 | } |
| 312 | break; |
| 313 | default: |
| 314 | log.debug("Unhandled message type: {}", msg.getType()); |
alshabib | 8f1cf4a | 2014-09-17 14:44:48 -0700 | [diff] [blame] | 315 | } |
| 316 | |
| 317 | } |
| 318 | |
Ayaka Koshibe | ab91cc4 | 2014-09-25 10:20:52 -0700 | [diff] [blame] | 319 | @Override |
Ayaka Koshibe | 3ef2b0d | 2014-10-31 13:58:27 -0700 | [diff] [blame] | 320 | public void receivedRoleReply(Dpid dpid, RoleState requested, |
Thomas Vachuska | 9b2da21 | 2014-11-10 19:30:25 -0800 | [diff] [blame] | 321 | RoleState response) { |
Ayaka Koshibe | 3ef2b0d | 2014-10-31 13:58:27 -0700 | [diff] [blame] | 322 | // Do nothing here for now. |
| 323 | } |
Ayaka Koshibe | ab91cc4 | 2014-09-25 10:20:52 -0700 | [diff] [blame] | 324 | |
alshabib | 54ce589 | 2014-09-23 17:50:51 -0700 | [diff] [blame] | 325 | private synchronized void pushFlowMetrics(Dpid dpid, OFStatsReply stats) { |
alshabib | 5c370ff | 2014-09-18 10:12:14 -0700 | [diff] [blame] | 326 | if (stats.getStatsType() != OFStatsType.FLOW) { |
| 327 | return; |
| 328 | } |
alshabib | 54ce589 | 2014-09-23 17:50:51 -0700 | [diff] [blame] | 329 | DeviceId did = DeviceId.deviceId(Dpid.uri(dpid)); |
alshabib | 5c370ff | 2014-09-18 10:12:14 -0700 | [diff] [blame] | 330 | final OFFlowStatsReply replies = (OFFlowStatsReply) stats; |
alshabib | 54ce589 | 2014-09-23 17:50:51 -0700 | [diff] [blame] | 331 | //final List<FlowRule> entries = Lists.newLinkedList(); |
| 332 | |
alshabib | 5c370ff | 2014-09-18 10:12:14 -0700 | [diff] [blame] | 333 | for (OFFlowStatsEntry reply : replies.getEntries()) { |
alshabib | 19fdc12 | 2014-10-03 11:38:19 -0700 | [diff] [blame] | 334 | if (!tableMissRule(dpid, reply)) { |
alshabib | 1c319ff | 2014-10-04 20:29:09 -0700 | [diff] [blame] | 335 | completeEntries.put(did, new FlowEntryBuilder(dpid, reply).build()); |
alshabib | 19fdc12 | 2014-10-03 11:38:19 -0700 | [diff] [blame] | 336 | } |
alshabib | 5c370ff | 2014-09-18 10:12:14 -0700 | [diff] [blame] | 337 | } |
alshabib | 54ce589 | 2014-09-23 17:50:51 -0700 | [diff] [blame] | 338 | |
| 339 | if (!stats.getFlags().contains(OFStatsReplyFlags.REPLY_MORE)) { |
| 340 | log.debug("sending flowstats to core {}", completeEntries.get(did)); |
| 341 | providerService.pushFlowMetrics(did, completeEntries.get(did)); |
| 342 | completeEntries.removeAll(did); |
| 343 | } |
alshabib | 5c370ff | 2014-09-18 10:12:14 -0700 | [diff] [blame] | 344 | } |
| 345 | |
alshabib | 19fdc12 | 2014-10-03 11:38:19 -0700 | [diff] [blame] | 346 | private boolean tableMissRule(Dpid dpid, OFFlowStatsEntry reply) { |
alshabib | 19fdc12 | 2014-10-03 11:38:19 -0700 | [diff] [blame] | 347 | if (reply.getVersion().equals(OFVersion.OF_10) || |
| 348 | reply.getMatch().getMatchFields().iterator().hasNext()) { |
| 349 | return false; |
| 350 | } |
| 351 | for (OFInstruction ins : reply.getInstructions()) { |
| 352 | if (ins.getType() == OFInstructionType.APPLY_ACTIONS) { |
| 353 | OFInstructionApplyActions apply = (OFInstructionApplyActions) ins; |
| 354 | List<OFAction> acts = apply.getActions(); |
| 355 | for (OFAction act : acts) { |
| 356 | if (act.getType() == OFActionType.OUTPUT) { |
| 357 | OFActionOutput out = (OFActionOutput) act; |
| 358 | if (out.getPort() == OFPort.CONTROLLER) { |
| 359 | return true; |
| 360 | } |
| 361 | } |
| 362 | } |
| 363 | } |
| 364 | } |
| 365 | return false; |
| 366 | } |
Ayaka Koshibe | 38594c2 | 2014-10-22 13:36:12 -0700 | [diff] [blame] | 367 | |
alshabib | 8f1cf4a | 2014-09-17 14:44:48 -0700 | [diff] [blame] | 368 | } |
alshabib | 1cc04f7 | 2014-09-16 16:09:58 -0700 | [diff] [blame] | 369 | |
Thomas Vachuska | 9b2da21 | 2014-11-10 19:30:25 -0800 | [diff] [blame] | 370 | private class InstallationFuture implements Future<CompletedBatchOperation> { |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 371 | |
Thomas Vachuska | 9b2da21 | 2014-11-10 19:30:25 -0800 | [diff] [blame] | 372 | private final Long xid; |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 373 | private final Set<Dpid> sws; |
| 374 | private final AtomicBoolean ok = new AtomicBoolean(true); |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 375 | private final Map<Long, FlowRuleBatchEntry> fms; |
| 376 | |
Brian O'Connor | 427a176 | 2014-11-19 18:40:32 -0800 | [diff] [blame^] | 377 | |
Madan Jampani | 117aaae | 2014-10-23 10:04:05 -0700 | [diff] [blame] | 378 | private final Set<FlowEntry> offendingFlowMods = Sets.newHashSet(); |
Brian O'Connor | 427a176 | 2014-11-19 18:40:32 -0800 | [diff] [blame^] | 379 | private Long failedId; |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 380 | |
| 381 | private final CountDownLatch countDownLatch; |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 382 | private BatchState state; |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 383 | |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 384 | public InstallationFuture(Set<Dpid> sws, Map<Long, FlowRuleBatchEntry> fmXids) { |
Thomas Vachuska | 9b2da21 | 2014-11-10 19:30:25 -0800 | [diff] [blame] | 385 | this.xid = xidCounter.getAndIncrement(); |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 386 | this.state = BatchState.STARTED; |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 387 | this.sws = sws; |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 388 | this.fms = fmXids; |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 389 | countDownLatch = new CountDownLatch(sws.size()); |
| 390 | } |
| 391 | |
Thomas Vachuska | 9b2da21 | 2014-11-10 19:30:25 -0800 | [diff] [blame] | 392 | public Long xid() { |
| 393 | return xid; |
| 394 | } |
| 395 | |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 396 | public void fail(OFErrorMsg msg, Dpid dpid) { |
Madan Jampani | 117aaae | 2014-10-23 10:04:05 -0700 | [diff] [blame] | 397 | |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 398 | ok.set(false); |
alshabib | 7911a05 | 2014-10-16 17:49:37 -0700 | [diff] [blame] | 399 | removeRequirement(dpid); |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 400 | FlowEntry fe = null; |
| 401 | FlowRuleBatchEntry fbe = fms.get(msg.getXid()); |
Brian O'Connor | 427a176 | 2014-11-19 18:40:32 -0800 | [diff] [blame^] | 402 | failedId = fbe.id(); |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 403 | FlowRule offending = fbe.getTarget(); |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 404 | //TODO handle specific error msgs |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 405 | switch (msg.getErrType()) { |
| 406 | case BAD_ACTION: |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 407 | OFBadActionErrorMsg bad = (OFBadActionErrorMsg) msg; |
| 408 | fe = new DefaultFlowEntry(offending, bad.getErrType().ordinal(), |
Thomas Vachuska | 9b2da21 | 2014-11-10 19:30:25 -0800 | [diff] [blame] | 409 | bad.getCode().ordinal()); |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 410 | break; |
| 411 | case BAD_INSTRUCTION: |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 412 | OFBadInstructionErrorMsg badins = (OFBadInstructionErrorMsg) msg; |
| 413 | fe = new DefaultFlowEntry(offending, badins.getErrType().ordinal(), |
Thomas Vachuska | 9b2da21 | 2014-11-10 19:30:25 -0800 | [diff] [blame] | 414 | badins.getCode().ordinal()); |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 415 | break; |
| 416 | case BAD_MATCH: |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 417 | OFBadMatchErrorMsg badMatch = (OFBadMatchErrorMsg) msg; |
| 418 | fe = new DefaultFlowEntry(offending, badMatch.getErrType().ordinal(), |
Thomas Vachuska | 9b2da21 | 2014-11-10 19:30:25 -0800 | [diff] [blame] | 419 | badMatch.getCode().ordinal()); |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 420 | break; |
| 421 | case BAD_REQUEST: |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 422 | OFBadRequestErrorMsg badReq = (OFBadRequestErrorMsg) msg; |
| 423 | fe = new DefaultFlowEntry(offending, badReq.getErrType().ordinal(), |
Thomas Vachuska | 9b2da21 | 2014-11-10 19:30:25 -0800 | [diff] [blame] | 424 | badReq.getCode().ordinal()); |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 425 | break; |
| 426 | case FLOW_MOD_FAILED: |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 427 | OFFlowModFailedErrorMsg fmFail = (OFFlowModFailedErrorMsg) msg; |
| 428 | fe = new DefaultFlowEntry(offending, fmFail.getErrType().ordinal(), |
Thomas Vachuska | 9b2da21 | 2014-11-10 19:30:25 -0800 | [diff] [blame] | 429 | fmFail.getCode().ordinal()); |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 430 | break; |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 431 | case EXPERIMENTER: |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 432 | case GROUP_MOD_FAILED: |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 433 | case HELLO_FAILED: |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 434 | case METER_MOD_FAILED: |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 435 | case PORT_MOD_FAILED: |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 436 | case QUEUE_OP_FAILED: |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 437 | case ROLE_REQUEST_FAILED: |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 438 | case SWITCH_CONFIG_FAILED: |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 439 | case TABLE_FEATURES_FAILED: |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 440 | case TABLE_MOD_FAILED: |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 441 | fe = new DefaultFlowEntry(offending, msg.getErrType().ordinal(), 0); |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 442 | break; |
| 443 | default: |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 444 | log.error("Unknown error type {}", msg.getErrType()); |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 445 | |
| 446 | } |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 447 | offendingFlowMods.add(fe); |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 448 | |
| 449 | } |
| 450 | |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 451 | |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 452 | public void satisfyRequirement(Dpid dpid) { |
alshabib | 3effd04 | 2014-10-17 12:00:31 -0700 | [diff] [blame] | 453 | log.debug("Satisfaction from switch {}", dpid); |
alshabib | 7911a05 | 2014-10-16 17:49:37 -0700 | [diff] [blame] | 454 | removeRequirement(dpid); |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 455 | } |
| 456 | |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 457 | |
Thomas Vachuska | 9b2da21 | 2014-11-10 19:30:25 -0800 | [diff] [blame] | 458 | public void verify() { |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 459 | for (Dpid dpid : sws) { |
| 460 | OpenFlowSwitch sw = controller.getSwitch(dpid); |
| 461 | OFBarrierRequest.Builder builder = sw.factory() |
| 462 | .buildBarrierRequest() |
Thomas Vachuska | 9b2da21 | 2014-11-10 19:30:25 -0800 | [diff] [blame] | 463 | .setXid(xid); |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 464 | sw.sendMsg(builder.build()); |
| 465 | } |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 466 | } |
| 467 | |
| 468 | @Override |
| 469 | public boolean cancel(boolean mayInterruptIfRunning) { |
Madan Jampani | 117aaae | 2014-10-23 10:04:05 -0700 | [diff] [blame] | 470 | if (isDone()) { |
| 471 | return false; |
| 472 | } |
alshabib | 7911a05 | 2014-10-16 17:49:37 -0700 | [diff] [blame] | 473 | ok.set(false); |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 474 | this.state = BatchState.CANCELLED; |
| 475 | cleanUp(); |
| 476 | for (FlowRuleBatchEntry fbe : fms.values()) { |
| 477 | if (fbe.getOperator() == FlowRuleOperation.ADD || |
| 478 | fbe.getOperator() == FlowRuleOperation.MODIFY) { |
| 479 | removeFlowRule(fbe.getTarget()); |
| 480 | } else if (fbe.getOperator() == FlowRuleOperation.REMOVE) { |
| 481 | applyRule(fbe.getTarget()); |
| 482 | } |
| 483 | |
| 484 | } |
Madan Jampani | 117aaae | 2014-10-23 10:04:05 -0700 | [diff] [blame] | 485 | return true; |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 486 | } |
| 487 | |
| 488 | @Override |
| 489 | public boolean isCancelled() { |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 490 | return this.state == BatchState.CANCELLED; |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 491 | } |
| 492 | |
| 493 | @Override |
| 494 | public boolean isDone() { |
Madan Jampani | 117aaae | 2014-10-23 10:04:05 -0700 | [diff] [blame] | 495 | return this.state == BatchState.FINISHED || isCancelled(); |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 496 | } |
| 497 | |
| 498 | @Override |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 499 | public CompletedBatchOperation get() throws InterruptedException, ExecutionException { |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 500 | countDownLatch.await(); |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 501 | this.state = BatchState.FINISHED; |
Brian O'Connor | 427a176 | 2014-11-19 18:40:32 -0800 | [diff] [blame^] | 502 | Set<Long> failedIds = (failedId != null) ? Sets.newHashSet(failedId) : Collections.emptySet(); |
| 503 | CompletedBatchOperation result = |
| 504 | new CompletedBatchOperation(ok.get(), offendingFlowMods, failedIds); |
| 505 | //FIXME do cleanup here (moved by BOC) |
| 506 | cleanUp(); |
Madan Jampani | 117aaae | 2014-10-23 10:04:05 -0700 | [diff] [blame] | 507 | return result; |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 508 | } |
| 509 | |
| 510 | @Override |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 511 | public CompletedBatchOperation get(long timeout, TimeUnit unit) |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 512 | throws InterruptedException, ExecutionException, |
| 513 | TimeoutException { |
alshabib | 2683458 | 2014-10-08 20:15:46 -0700 | [diff] [blame] | 514 | if (countDownLatch.await(timeout, unit)) { |
| 515 | this.state = BatchState.FINISHED; |
Brian O'Connor | 427a176 | 2014-11-19 18:40:32 -0800 | [diff] [blame^] | 516 | Set<Long> failedIds = (failedId != null) ? Sets.newHashSet(failedId) : Collections.emptySet(); |
| 517 | CompletedBatchOperation result = |
| 518 | new CompletedBatchOperation(ok.get(), offendingFlowMods, failedIds); |
| 519 | // FIXME do cleanup here (moved by BOC) |
| 520 | cleanUp(); |
Madan Jampani | 117aaae | 2014-10-23 10:04:05 -0700 | [diff] [blame] | 521 | return result; |
alshabib | 2683458 | 2014-10-08 20:15:46 -0700 | [diff] [blame] | 522 | } |
| 523 | throw new TimeoutException(); |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 524 | } |
| 525 | |
| 526 | private void cleanUp() { |
alshabib | 7911a05 | 2014-10-16 17:49:37 -0700 | [diff] [blame] | 527 | if (isDone() || isCancelled()) { |
Thomas Vachuska | 9b2da21 | 2014-11-10 19:30:25 -0800 | [diff] [blame] | 528 | pendingFutures.remove(xid); |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 529 | for (Long xid : fms.keySet()) { |
| 530 | pendingFMs.remove(xid); |
| 531 | } |
| 532 | } |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 533 | } |
| 534 | |
alshabib | 7911a05 | 2014-10-16 17:49:37 -0700 | [diff] [blame] | 535 | private void removeRequirement(Dpid dpid) { |
| 536 | countDownLatch.countDown(); |
| 537 | sws.remove(dpid); |
Brian O'Connor | 427a176 | 2014-11-19 18:40:32 -0800 | [diff] [blame^] | 538 | //FIXME don't do cleanup here (moved by BOC) |
| 539 | //cleanUp(); |
alshabib | 7911a05 | 2014-10-16 17:49:37 -0700 | [diff] [blame] | 540 | } |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 541 | } |
alshabib | a68eb96 | 2014-09-24 20:34:13 -0700 | [diff] [blame] | 542 | |
alshabib | 1cc04f7 | 2014-09-16 16:09:58 -0700 | [diff] [blame] | 543 | } |