tom | be98831 | 2014-09-19 18:38:47 -0700 | [diff] [blame] | 1 | package org.onlab.onos.net.flow.impl; |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 2 | |
alshabib | bb42cad | 2014-09-25 11:43:05 -0700 | [diff] [blame] | 3 | import static com.google.common.base.Preconditions.checkNotNull; |
| 4 | import static org.slf4j.LoggerFactory.getLogger; |
Yuta HIGUCHI | 9def047 | 2014-10-23 15:51:10 -0700 | [diff] [blame^] | 5 | import static org.onlab.util.Tools.namedThreads; |
alshabib | bb42cad | 2014-09-25 11:43:05 -0700 | [diff] [blame] | 6 | |
alshabib | bb42cad | 2014-09-25 11:43:05 -0700 | [diff] [blame] | 7 | import java.util.List; |
Yuta HIGUCHI | f6f50a6 | 2014-10-19 15:58:49 -0700 | [diff] [blame] | 8 | import java.util.Map; |
Madan Jampani | 117aaae | 2014-10-23 10:04:05 -0700 | [diff] [blame] | 9 | import java.util.Set; |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 10 | import java.util.concurrent.CancellationException; |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 11 | import java.util.concurrent.ExecutionException; |
Yuta HIGUCHI | 9def047 | 2014-10-23 15:51:10 -0700 | [diff] [blame^] | 12 | import java.util.concurrent.ExecutorService; |
Madan Jampani | 117aaae | 2014-10-23 10:04:05 -0700 | [diff] [blame] | 13 | import java.util.concurrent.Executors; |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 14 | import java.util.concurrent.Future; |
| 15 | import java.util.concurrent.TimeUnit; |
| 16 | import java.util.concurrent.TimeoutException; |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 17 | import java.util.concurrent.atomic.AtomicReference; |
alshabib | bb42cad | 2014-09-25 11:43:05 -0700 | [diff] [blame] | 18 | |
alshabib | 57044ba | 2014-09-16 15:58:01 -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; |
alshabib | a68eb96 | 2014-09-24 20:34:13 -0700 | [diff] [blame] | 25 | import org.onlab.onos.ApplicationId; |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 26 | import org.onlab.onos.event.AbstractListenerRegistry; |
| 27 | import org.onlab.onos.event.EventDeliveryService; |
| 28 | import org.onlab.onos.net.Device; |
| 29 | import org.onlab.onos.net.DeviceId; |
| 30 | import org.onlab.onos.net.device.DeviceService; |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 31 | import org.onlab.onos.net.flow.CompletedBatchOperation; |
alshabib | cf36991 | 2014-10-13 14:16:42 -0700 | [diff] [blame] | 32 | import org.onlab.onos.net.flow.DefaultFlowEntry; |
alshabib | 1c319ff | 2014-10-04 20:29:09 -0700 | [diff] [blame] | 33 | import org.onlab.onos.net.flow.FlowEntry; |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 34 | import org.onlab.onos.net.flow.FlowRule; |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 35 | import org.onlab.onos.net.flow.FlowRuleBatchEntry; |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 36 | import org.onlab.onos.net.flow.FlowRuleBatchEntry.FlowRuleOperation; |
Madan Jampani | 117aaae | 2014-10-23 10:04:05 -0700 | [diff] [blame] | 37 | import org.onlab.onos.net.flow.FlowRuleBatchEvent; |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 38 | import org.onlab.onos.net.flow.FlowRuleBatchOperation; |
Madan Jampani | 117aaae | 2014-10-23 10:04:05 -0700 | [diff] [blame] | 39 | import org.onlab.onos.net.flow.FlowRuleBatchRequest; |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 40 | import org.onlab.onos.net.flow.FlowRuleEvent; |
| 41 | import org.onlab.onos.net.flow.FlowRuleListener; |
| 42 | import org.onlab.onos.net.flow.FlowRuleProvider; |
| 43 | import org.onlab.onos.net.flow.FlowRuleProviderRegistry; |
| 44 | import org.onlab.onos.net.flow.FlowRuleProviderService; |
| 45 | import org.onlab.onos.net.flow.FlowRuleService; |
tom | be98831 | 2014-09-19 18:38:47 -0700 | [diff] [blame] | 46 | import org.onlab.onos.net.flow.FlowRuleStore; |
tom | c78acee | 2014-09-24 15:16:55 -0700 | [diff] [blame] | 47 | import org.onlab.onos.net.flow.FlowRuleStoreDelegate; |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 48 | import org.onlab.onos.net.provider.AbstractProviderRegistry; |
| 49 | import org.onlab.onos.net.provider.AbstractProviderService; |
| 50 | import org.slf4j.Logger; |
| 51 | |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 52 | import com.google.common.collect.ArrayListMultimap; |
alshabib | bb42cad | 2014-09-25 11:43:05 -0700 | [diff] [blame] | 53 | import com.google.common.collect.Lists; |
Yuta HIGUCHI | f6f50a6 | 2014-10-19 15:58:49 -0700 | [diff] [blame] | 54 | import com.google.common.collect.Maps; |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 55 | import com.google.common.collect.Multimap; |
Madan Jampani | 117aaae | 2014-10-23 10:04:05 -0700 | [diff] [blame] | 56 | import com.google.common.collect.Sets; |
| 57 | import com.google.common.util.concurrent.Futures; |
| 58 | import com.google.common.util.concurrent.ListenableFuture; |
alshabib | a7f7ca8 | 2014-09-22 11:41:23 -0700 | [diff] [blame] | 59 | |
tom | e472987 | 2014-09-23 00:37:37 -0700 | [diff] [blame] | 60 | /** |
| 61 | * Provides implementation of the flow NB & SB APIs. |
| 62 | */ |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 63 | @Component(immediate = true) |
| 64 | @Service |
tom | 202175a | 2014-09-19 19:00:11 -0700 | [diff] [blame] | 65 | public class FlowRuleManager |
tom | 9b4030d | 2014-10-06 10:39:03 -0700 | [diff] [blame] | 66 | extends AbstractProviderRegistry<FlowRuleProvider, FlowRuleProviderService> |
| 67 | implements FlowRuleService, FlowRuleProviderRegistry { |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 68 | |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 69 | enum BatchState { STARTED, FINISHED, CANCELLED }; |
| 70 | |
Ayaka Koshibe | 08eabaa | 2014-09-17 14:59:25 -0700 | [diff] [blame] | 71 | public static final String FLOW_RULE_NULL = "FlowRule cannot be null"; |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 72 | private final Logger log = getLogger(getClass()); |
| 73 | |
| 74 | private final AbstractListenerRegistry<FlowRuleEvent, FlowRuleListener> |
tom | 9b4030d | 2014-10-06 10:39:03 -0700 | [diff] [blame] | 75 | listenerRegistry = new AbstractListenerRegistry<>(); |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 76 | |
alshabib | bb42cad | 2014-09-25 11:43:05 -0700 | [diff] [blame] | 77 | private final FlowRuleStoreDelegate delegate = new InternalStoreDelegate(); |
tom | c78acee | 2014-09-24 15:16:55 -0700 | [diff] [blame] | 78 | |
Yuta HIGUCHI | 9def047 | 2014-10-23 15:51:10 -0700 | [diff] [blame^] | 79 | private final ExecutorService futureListeners = Executors.newCachedThreadPool(namedThreads("provider-future-listeners")); |
| 80 | |
tom | be98831 | 2014-09-19 18:38:47 -0700 | [diff] [blame] | 81 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) |
| 82 | protected FlowRuleStore store; |
Ayaka Koshibe | 08eabaa | 2014-09-17 14:59:25 -0700 | [diff] [blame] | 83 | |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 84 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) |
Ayaka Koshibe | b55524f | 2014-09-18 09:59:24 -0700 | [diff] [blame] | 85 | protected EventDeliveryService eventDispatcher; |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 86 | |
| 87 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) |
Ayaka Koshibe | b55524f | 2014-09-18 09:59:24 -0700 | [diff] [blame] | 88 | protected DeviceService deviceService; |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 89 | |
| 90 | @Activate |
| 91 | public void activate() { |
tom | c78acee | 2014-09-24 15:16:55 -0700 | [diff] [blame] | 92 | store.setDelegate(delegate); |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 93 | eventDispatcher.addSink(FlowRuleEvent.class, listenerRegistry); |
| 94 | log.info("Started"); |
| 95 | } |
| 96 | |
| 97 | @Deactivate |
| 98 | public void deactivate() { |
Yuta HIGUCHI | 9def047 | 2014-10-23 15:51:10 -0700 | [diff] [blame^] | 99 | futureListeners.shutdownNow(); |
| 100 | |
tom | c78acee | 2014-09-24 15:16:55 -0700 | [diff] [blame] | 101 | store.unsetDelegate(delegate); |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 102 | eventDispatcher.removeSink(FlowRuleEvent.class); |
| 103 | log.info("Stopped"); |
| 104 | } |
| 105 | |
| 106 | @Override |
tom | 9b4030d | 2014-10-06 10:39:03 -0700 | [diff] [blame] | 107 | public int getFlowRuleCount() { |
| 108 | return store.getFlowRuleCount(); |
| 109 | } |
| 110 | |
| 111 | @Override |
alshabib | 1c319ff | 2014-10-04 20:29:09 -0700 | [diff] [blame] | 112 | public Iterable<FlowEntry> getFlowEntries(DeviceId deviceId) { |
Ayaka Koshibe | 08eabaa | 2014-09-17 14:59:25 -0700 | [diff] [blame] | 113 | return store.getFlowEntries(deviceId); |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 114 | } |
| 115 | |
| 116 | @Override |
alshabib | 219ebaa | 2014-09-22 15:41:24 -0700 | [diff] [blame] | 117 | public void applyFlowRules(FlowRule... flowRules) { |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 118 | for (int i = 0; i < flowRules.length; i++) { |
alshabib | a68eb96 | 2014-09-24 20:34:13 -0700 | [diff] [blame] | 119 | FlowRule f = flowRules[i]; |
Madan Jampani | 117aaae | 2014-10-23 10:04:05 -0700 | [diff] [blame] | 120 | store.storeFlowRule(f); |
Yuta HIGUCHI | f3d51bd | 2014-10-21 01:05:33 -0700 | [diff] [blame] | 121 | } |
| 122 | } |
| 123 | |
| 124 | private void applyFlowRulesToProviders(FlowRule... flowRules) { |
| 125 | DeviceId did = null; |
| 126 | FlowRuleProvider frp = null; |
| 127 | for (FlowRule f : flowRules) { |
| 128 | if (!f.deviceId().equals(did)) { |
| 129 | did = f.deviceId(); |
| 130 | final Device device = deviceService.getDevice(did); |
| 131 | frp = getProvider(device.providerId()); |
| 132 | } |
| 133 | if (frp != null) { |
| 134 | frp.applyFlowRule(f); |
| 135 | } |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 136 | } |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 137 | } |
| 138 | |
| 139 | @Override |
| 140 | public void removeFlowRules(FlowRule... flowRules) { |
alshabib | bb8b128 | 2014-09-22 17:00:18 -0700 | [diff] [blame] | 141 | FlowRule f; |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 142 | for (int i = 0; i < flowRules.length; i++) { |
alshabib | a68eb96 | 2014-09-24 20:34:13 -0700 | [diff] [blame] | 143 | f = flowRules[i]; |
Madan Jampani | 117aaae | 2014-10-23 10:04:05 -0700 | [diff] [blame] | 144 | store.deleteFlowRule(f); |
Yuta HIGUCHI | f3d51bd | 2014-10-21 01:05:33 -0700 | [diff] [blame] | 145 | } |
| 146 | } |
| 147 | |
| 148 | private void removeFlowRulesFromProviders(FlowRule... flowRules) { |
| 149 | DeviceId did = null; |
| 150 | FlowRuleProvider frp = null; |
| 151 | for (FlowRule f : flowRules) { |
| 152 | if (!f.deviceId().equals(did)) { |
| 153 | did = f.deviceId(); |
| 154 | final Device device = deviceService.getDevice(did); |
tom | 7951b23 | 2014-10-06 13:35:30 -0700 | [diff] [blame] | 155 | frp = getProvider(device.providerId()); |
Yuta HIGUCHI | f3d51bd | 2014-10-21 01:05:33 -0700 | [diff] [blame] | 156 | } |
| 157 | if (frp != null) { |
tom | 7951b23 | 2014-10-06 13:35:30 -0700 | [diff] [blame] | 158 | frp.removeFlowRule(f); |
| 159 | } |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 160 | } |
alshabib | a68eb96 | 2014-09-24 20:34:13 -0700 | [diff] [blame] | 161 | } |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 162 | |
alshabib | a68eb96 | 2014-09-24 20:34:13 -0700 | [diff] [blame] | 163 | @Override |
| 164 | public void removeFlowRulesById(ApplicationId id) { |
tom | 9b4030d | 2014-10-06 10:39:03 -0700 | [diff] [blame] | 165 | Iterable<FlowRule> rules = getFlowRulesById(id); |
alshabib | a68eb96 | 2014-09-24 20:34:13 -0700 | [diff] [blame] | 166 | FlowRuleProvider frp; |
| 167 | Device device; |
alshabib | bb42cad | 2014-09-25 11:43:05 -0700 | [diff] [blame] | 168 | |
alshabib | a68eb96 | 2014-09-24 20:34:13 -0700 | [diff] [blame] | 169 | for (FlowRule f : rules) { |
| 170 | store.deleteFlowRule(f); |
Yuta HIGUCHI | f3d51bd | 2014-10-21 01:05:33 -0700 | [diff] [blame] | 171 | // FIXME: only accept request and push to provider on internal event |
alshabib | a68eb96 | 2014-09-24 20:34:13 -0700 | [diff] [blame] | 172 | device = deviceService.getDevice(f.deviceId()); |
| 173 | frp = getProvider(device.providerId()); |
Yuta HIGUCHI | f3d51bd | 2014-10-21 01:05:33 -0700 | [diff] [blame] | 174 | // FIXME: flows removed from store and flows removed from might diverge |
| 175 | // get rid of #removeRulesById? |
alshabib | a68eb96 | 2014-09-24 20:34:13 -0700 | [diff] [blame] | 176 | frp.removeRulesById(id, f); |
| 177 | } |
| 178 | } |
| 179 | |
| 180 | @Override |
| 181 | public Iterable<FlowRule> getFlowRulesById(ApplicationId id) { |
alshabib | 1c319ff | 2014-10-04 20:29:09 -0700 | [diff] [blame] | 182 | return store.getFlowRulesByAppId(id); |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 183 | } |
| 184 | |
| 185 | @Override |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 186 | public Future<CompletedBatchOperation> applyBatch( |
| 187 | FlowRuleBatchOperation batch) { |
Madan Jampani | 117aaae | 2014-10-23 10:04:05 -0700 | [diff] [blame] | 188 | Multimap<DeviceId, FlowRuleBatchEntry> perDeviceBatches = |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 189 | ArrayListMultimap.create(); |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 190 | List<Future<CompletedBatchOperation>> futures = Lists.newArrayList(); |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 191 | for (FlowRuleBatchEntry fbe : batch.getOperations()) { |
| 192 | final FlowRule f = fbe.getTarget(); |
Madan Jampani | 117aaae | 2014-10-23 10:04:05 -0700 | [diff] [blame] | 193 | perDeviceBatches.put(f.deviceId(), fbe); |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 194 | } |
Madan Jampani | 117aaae | 2014-10-23 10:04:05 -0700 | [diff] [blame] | 195 | |
| 196 | for (DeviceId deviceId : perDeviceBatches.keySet()) { |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 197 | FlowRuleBatchOperation b = |
Madan Jampani | 117aaae | 2014-10-23 10:04:05 -0700 | [diff] [blame] | 198 | new FlowRuleBatchOperation(perDeviceBatches.get(deviceId)); |
| 199 | Future<CompletedBatchOperation> future = store.storeBatch(b); |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 200 | futures.add(future); |
| 201 | } |
Madan Jampani | 117aaae | 2014-10-23 10:04:05 -0700 | [diff] [blame] | 202 | return new FlowRuleBatchFuture(futures, perDeviceBatches); |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 203 | } |
| 204 | |
| 205 | @Override |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 206 | public void addListener(FlowRuleListener listener) { |
| 207 | listenerRegistry.addListener(listener); |
| 208 | } |
| 209 | |
| 210 | @Override |
| 211 | public void removeListener(FlowRuleListener listener) { |
| 212 | listenerRegistry.removeListener(listener); |
| 213 | } |
| 214 | |
| 215 | @Override |
| 216 | protected FlowRuleProviderService createProviderService( |
| 217 | FlowRuleProvider provider) { |
| 218 | return new InternalFlowRuleProviderService(provider); |
| 219 | } |
| 220 | |
| 221 | private class InternalFlowRuleProviderService |
tom | 9b4030d | 2014-10-06 10:39:03 -0700 | [diff] [blame] | 222 | extends AbstractProviderService<FlowRuleProvider> |
| 223 | implements FlowRuleProviderService { |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 224 | |
Yuta HIGUCHI | f6f50a6 | 2014-10-19 15:58:49 -0700 | [diff] [blame] | 225 | final Map<FlowEntry, Long> lastSeen = Maps.newConcurrentMap(); |
| 226 | |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 227 | protected InternalFlowRuleProviderService(FlowRuleProvider provider) { |
| 228 | super(provider); |
| 229 | } |
| 230 | |
| 231 | @Override |
alshabib | 1c319ff | 2014-10-04 20:29:09 -0700 | [diff] [blame] | 232 | public void flowRemoved(FlowEntry flowEntry) { |
| 233 | checkNotNull(flowEntry, FLOW_RULE_NULL); |
Ayaka Koshibe | 08eabaa | 2014-09-17 14:59:25 -0700 | [diff] [blame] | 234 | checkValidity(); |
Yuta HIGUCHI | f6f50a6 | 2014-10-19 15:58:49 -0700 | [diff] [blame] | 235 | lastSeen.remove(flowEntry); |
alshabib | 1c319ff | 2014-10-04 20:29:09 -0700 | [diff] [blame] | 236 | FlowEntry stored = store.getFlowEntry(flowEntry); |
alshabib | a68eb96 | 2014-09-24 20:34:13 -0700 | [diff] [blame] | 237 | if (stored == null) { |
alshabib | 1c319ff | 2014-10-04 20:29:09 -0700 | [diff] [blame] | 238 | log.info("Rule already evicted from store: {}", flowEntry); |
alshabib | a68eb96 | 2014-09-24 20:34:13 -0700 | [diff] [blame] | 239 | return; |
| 240 | } |
alshabib | 1c319ff | 2014-10-04 20:29:09 -0700 | [diff] [blame] | 241 | Device device = deviceService.getDevice(flowEntry.deviceId()); |
alshabib | a68eb96 | 2014-09-24 20:34:13 -0700 | [diff] [blame] | 242 | FlowRuleProvider frp = getProvider(device.providerId()); |
| 243 | FlowRuleEvent event = null; |
| 244 | switch (stored.state()) { |
tom | 9b4030d | 2014-10-06 10:39:03 -0700 | [diff] [blame] | 245 | case ADDED: |
| 246 | case PENDING_ADD: |
alshabib | 6eb438a | 2014-10-01 16:39:37 -0700 | [diff] [blame] | 247 | frp.applyFlowRule(stored); |
tom | 9b4030d | 2014-10-06 10:39:03 -0700 | [diff] [blame] | 248 | break; |
| 249 | case PENDING_REMOVE: |
| 250 | case REMOVED: |
| 251 | event = store.removeFlowRule(stored); |
| 252 | break; |
| 253 | default: |
| 254 | break; |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 255 | |
alshabib | a68eb96 | 2014-09-24 20:34:13 -0700 | [diff] [blame] | 256 | } |
Ayaka Koshibe | 08eabaa | 2014-09-17 14:59:25 -0700 | [diff] [blame] | 257 | if (event != null) { |
alshabib | 1c319ff | 2014-10-04 20:29:09 -0700 | [diff] [blame] | 258 | log.debug("Flow {} removed", flowEntry); |
Ayaka Koshibe | 08eabaa | 2014-09-17 14:59:25 -0700 | [diff] [blame] | 259 | post(event); |
| 260 | } |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 261 | } |
| 262 | |
alshabib | ba5ac48 | 2014-10-02 17:15:20 -0700 | [diff] [blame] | 263 | |
alshabib | 1c319ff | 2014-10-04 20:29:09 -0700 | [diff] [blame] | 264 | private void flowMissing(FlowEntry flowRule) { |
Ayaka Koshibe | 08eabaa | 2014-09-17 14:59:25 -0700 | [diff] [blame] | 265 | checkNotNull(flowRule, FLOW_RULE_NULL); |
| 266 | checkValidity(); |
alshabib | a68eb96 | 2014-09-24 20:34:13 -0700 | [diff] [blame] | 267 | Device device = deviceService.getDevice(flowRule.deviceId()); |
| 268 | FlowRuleProvider frp = getProvider(device.providerId()); |
alshabib | bb42cad | 2014-09-25 11:43:05 -0700 | [diff] [blame] | 269 | FlowRuleEvent event = null; |
alshabib | a68eb96 | 2014-09-24 20:34:13 -0700 | [diff] [blame] | 270 | switch (flowRule.state()) { |
tom | 9b4030d | 2014-10-06 10:39:03 -0700 | [diff] [blame] | 271 | case PENDING_REMOVE: |
| 272 | case REMOVED: |
| 273 | event = store.removeFlowRule(flowRule); |
| 274 | frp.removeFlowRule(flowRule); |
| 275 | break; |
| 276 | case ADDED: |
| 277 | case PENDING_ADD: |
| 278 | frp.applyFlowRule(flowRule); |
| 279 | break; |
| 280 | default: |
| 281 | log.debug("Flow {} has not been installed.", flowRule); |
alshabib | a68eb96 | 2014-09-24 20:34:13 -0700 | [diff] [blame] | 282 | } |
| 283 | |
alshabib | bb42cad | 2014-09-25 11:43:05 -0700 | [diff] [blame] | 284 | if (event != null) { |
| 285 | log.debug("Flow {} removed", flowRule); |
| 286 | post(event); |
| 287 | } |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 288 | |
| 289 | } |
| 290 | |
alshabib | ba5ac48 | 2014-10-02 17:15:20 -0700 | [diff] [blame] | 291 | |
| 292 | private void extraneousFlow(FlowRule flowRule) { |
alshabib | 219ebaa | 2014-09-22 15:41:24 -0700 | [diff] [blame] | 293 | checkNotNull(flowRule, FLOW_RULE_NULL); |
| 294 | checkValidity(); |
alshabib | 2374fc9 | 2014-10-22 11:03:23 -0700 | [diff] [blame] | 295 | FlowRuleProvider frp = getProvider(flowRule.deviceId()); |
| 296 | frp.removeFlowRule(flowRule); |
alshabib | 54ce589 | 2014-09-23 17:50:51 -0700 | [diff] [blame] | 297 | log.debug("Flow {} is on switch but not in store.", flowRule); |
alshabib | 219ebaa | 2014-09-22 15:41:24 -0700 | [diff] [blame] | 298 | } |
| 299 | |
alshabib | ba5ac48 | 2014-10-02 17:15:20 -0700 | [diff] [blame] | 300 | |
alshabib | 1c319ff | 2014-10-04 20:29:09 -0700 | [diff] [blame] | 301 | private void flowAdded(FlowEntry flowEntry) { |
| 302 | checkNotNull(flowEntry, FLOW_RULE_NULL); |
Ayaka Koshibe | 08eabaa | 2014-09-17 14:59:25 -0700 | [diff] [blame] | 303 | checkValidity(); |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 304 | |
alshabib | 1c319ff | 2014-10-04 20:29:09 -0700 | [diff] [blame] | 305 | if (checkRuleLiveness(flowEntry, store.getFlowEntry(flowEntry))) { |
alshabib | ba5ac48 | 2014-10-02 17:15:20 -0700 | [diff] [blame] | 306 | |
alshabib | 1c319ff | 2014-10-04 20:29:09 -0700 | [diff] [blame] | 307 | FlowRuleEvent event = store.addOrUpdateFlowRule(flowEntry); |
alshabib | ba5ac48 | 2014-10-02 17:15:20 -0700 | [diff] [blame] | 308 | if (event == null) { |
| 309 | log.debug("No flow store event generated."); |
| 310 | } else { |
alshabib | 1c319ff | 2014-10-04 20:29:09 -0700 | [diff] [blame] | 311 | log.debug("Flow {} {}", flowEntry, event.type()); |
alshabib | ba5ac48 | 2014-10-02 17:15:20 -0700 | [diff] [blame] | 312 | post(event); |
| 313 | } |
Ayaka Koshibe | 08eabaa | 2014-09-17 14:59:25 -0700 | [diff] [blame] | 314 | } else { |
Madan Jampani | 117aaae | 2014-10-23 10:04:05 -0700 | [diff] [blame] | 315 | log.info("Removing flow rules...."); |
alshabib | 1c319ff | 2014-10-04 20:29:09 -0700 | [diff] [blame] | 316 | removeFlowRules(flowEntry); |
Ayaka Koshibe | 08eabaa | 2014-09-17 14:59:25 -0700 | [diff] [blame] | 317 | } |
alshabib | 219ebaa | 2014-09-22 15:41:24 -0700 | [diff] [blame] | 318 | |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 319 | } |
| 320 | |
alshabib | 1c319ff | 2014-10-04 20:29:09 -0700 | [diff] [blame] | 321 | private boolean checkRuleLiveness(FlowEntry swRule, FlowEntry storedRule) { |
| 322 | if (storedRule == null) { |
| 323 | return false; |
| 324 | } |
Jonathan Hart | bc4a793 | 2014-10-21 11:46:00 -0700 | [diff] [blame] | 325 | if (storedRule.isPermanent()) { |
| 326 | return true; |
| 327 | } |
| 328 | |
Yuta HIGUCHI | f6f50a6 | 2014-10-19 15:58:49 -0700 | [diff] [blame] | 329 | final long timeout = storedRule.timeout() * 1000; |
| 330 | final long currentTime = System.currentTimeMillis(); |
alshabib | 85c4197 | 2014-10-03 13:48:39 -0700 | [diff] [blame] | 331 | if (storedRule.packets() != swRule.packets()) { |
Yuta HIGUCHI | f6f50a6 | 2014-10-19 15:58:49 -0700 | [diff] [blame] | 332 | lastSeen.put(storedRule, currentTime); |
alshabib | 85c4197 | 2014-10-03 13:48:39 -0700 | [diff] [blame] | 333 | return true; |
| 334 | } |
Yuta HIGUCHI | f6f50a6 | 2014-10-19 15:58:49 -0700 | [diff] [blame] | 335 | if (!lastSeen.containsKey(storedRule)) { |
| 336 | // checking for the first time |
| 337 | lastSeen.put(storedRule, storedRule.lastSeen()); |
| 338 | // Use following if lastSeen attr. was removed. |
| 339 | //lastSeen.put(storedRule, currentTime); |
| 340 | } |
| 341 | Long last = lastSeen.get(storedRule); |
| 342 | if (last == null) { |
| 343 | // concurrently removed? let the liveness check fail |
| 344 | return false; |
| 345 | } |
alshabib | 85c4197 | 2014-10-03 13:48:39 -0700 | [diff] [blame] | 346 | |
Yuta HIGUCHI | f6f50a6 | 2014-10-19 15:58:49 -0700 | [diff] [blame] | 347 | if ((currentTime - last) <= timeout) { |
alshabib | c274c90 | 2014-10-03 14:58:27 -0700 | [diff] [blame] | 348 | return true; |
| 349 | } |
| 350 | return false; |
alshabib | ba5ac48 | 2014-10-02 17:15:20 -0700 | [diff] [blame] | 351 | } |
| 352 | |
Ayaka Koshibe | 08eabaa | 2014-09-17 14:59:25 -0700 | [diff] [blame] | 353 | // Posts the specified event to the local event dispatcher. |
| 354 | private void post(FlowRuleEvent event) { |
| 355 | if (event != null) { |
| 356 | eventDispatcher.post(event); |
| 357 | } |
| 358 | } |
alshabib | 5c370ff | 2014-09-18 10:12:14 -0700 | [diff] [blame] | 359 | |
| 360 | @Override |
alshabib | 1c319ff | 2014-10-04 20:29:09 -0700 | [diff] [blame] | 361 | public void pushFlowMetrics(DeviceId deviceId, Iterable<FlowEntry> flowEntries) { |
| 362 | List<FlowEntry> storedRules = Lists.newLinkedList(store.getFlowEntries(deviceId)); |
alshabib | bb8b128 | 2014-09-22 17:00:18 -0700 | [diff] [blame] | 363 | |
Yuta HIGUCHI | f6f50a6 | 2014-10-19 15:58:49 -0700 | [diff] [blame] | 364 | for (FlowEntry rule : flowEntries) { |
alshabib | a7f7ca8 | 2014-09-22 11:41:23 -0700 | [diff] [blame] | 365 | if (storedRules.remove(rule)) { |
alshabib | 219ebaa | 2014-09-22 15:41:24 -0700 | [diff] [blame] | 366 | // we both have the rule, let's update some info then. |
alshabib | a7f7ca8 | 2014-09-22 11:41:23 -0700 | [diff] [blame] | 367 | flowAdded(rule); |
| 368 | } else { |
alshabib | 219ebaa | 2014-09-22 15:41:24 -0700 | [diff] [blame] | 369 | // the device has a rule the store does not have |
| 370 | extraneousFlow(rule); |
alshabib | a7f7ca8 | 2014-09-22 11:41:23 -0700 | [diff] [blame] | 371 | } |
| 372 | } |
alshabib | 1c319ff | 2014-10-04 20:29:09 -0700 | [diff] [blame] | 373 | for (FlowEntry rule : storedRules) { |
alshabib | a7f7ca8 | 2014-09-22 11:41:23 -0700 | [diff] [blame] | 374 | // there are rules in the store that aren't on the switch |
| 375 | flowMissing(rule); |
alshabib | 54ce589 | 2014-09-23 17:50:51 -0700 | [diff] [blame] | 376 | |
alshabib | a7f7ca8 | 2014-09-22 11:41:23 -0700 | [diff] [blame] | 377 | } |
alshabib | 5c370ff | 2014-09-18 10:12:14 -0700 | [diff] [blame] | 378 | } |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 379 | } |
| 380 | |
tom | c78acee | 2014-09-24 15:16:55 -0700 | [diff] [blame] | 381 | // Store delegate to re-post events emitted from the store. |
| 382 | private class InternalStoreDelegate implements FlowRuleStoreDelegate { |
Madan Jampani | 117aaae | 2014-10-23 10:04:05 -0700 | [diff] [blame] | 383 | // TODO: Right now we only dispatch events at individual flowEntry level. |
| 384 | // It may be more efficient for also dispatch events as a batch. |
tom | c78acee | 2014-09-24 15:16:55 -0700 | [diff] [blame] | 385 | @Override |
Madan Jampani | 117aaae | 2014-10-23 10:04:05 -0700 | [diff] [blame] | 386 | public void notify(FlowRuleBatchEvent event) { |
| 387 | final FlowRuleBatchRequest request = event.subject(); |
Yuta HIGUCHI | f3d51bd | 2014-10-21 01:05:33 -0700 | [diff] [blame] | 388 | switch (event.type()) { |
Madan Jampani | 117aaae | 2014-10-23 10:04:05 -0700 | [diff] [blame] | 389 | case BATCH_OPERATION_REQUESTED: |
Madan Jampani | 31961c1 | 2014-10-23 12:06:58 -0700 | [diff] [blame] | 390 | for (FlowEntry entry : request.toAdd()) { |
| 391 | eventDispatcher.post(new FlowRuleEvent(FlowRuleEvent.Type.RULE_ADD_REQUESTED, entry)); |
| 392 | } |
| 393 | for (FlowEntry entry : request.toRemove()) { |
| 394 | eventDispatcher.post(new FlowRuleEvent(FlowRuleEvent.Type.RULE_REMOVE_REQUESTED, entry)); |
| 395 | } |
| 396 | // FIXME: what about op.equals(FlowRuleOperation.MODIFY) ? |
Yuta HIGUCHI | f3d51bd | 2014-10-21 01:05:33 -0700 | [diff] [blame] | 397 | |
Madan Jampani | 117aaae | 2014-10-23 10:04:05 -0700 | [diff] [blame] | 398 | FlowRuleBatchOperation batchOperation = request.asBatchOperation(); |
Yuta HIGUCHI | f3d51bd | 2014-10-21 01:05:33 -0700 | [diff] [blame] | 399 | |
Madan Jampani | 117aaae | 2014-10-23 10:04:05 -0700 | [diff] [blame] | 400 | FlowRuleProvider flowRuleProvider = |
| 401 | getProvider(batchOperation.getOperations().get(0).getTarget().deviceId()); |
| 402 | final ListenableFuture<CompletedBatchOperation> result = |
| 403 | flowRuleProvider.executeBatch(batchOperation); |
| 404 | result.addListener(new Runnable() { |
| 405 | @Override |
| 406 | public void run() { |
Yuta HIGUCHI | 9def047 | 2014-10-23 15:51:10 -0700 | [diff] [blame^] | 407 | store.batchOperationComplete(FlowRuleBatchEvent.completed(request, Futures.getUnchecked(result))); |
Madan Jampani | 117aaae | 2014-10-23 10:04:05 -0700 | [diff] [blame] | 408 | } |
Yuta HIGUCHI | 9def047 | 2014-10-23 15:51:10 -0700 | [diff] [blame^] | 409 | }, futureListeners); |
Madan Jampani | 117aaae | 2014-10-23 10:04:05 -0700 | [diff] [blame] | 410 | |
| 411 | break; |
| 412 | case BATCH_OPERATION_COMPLETED: |
| 413 | Set<FlowEntry> failedItems = event.result().failedItems(); |
| 414 | for (FlowEntry entry : request.toAdd()) { |
| 415 | if (!failedItems.contains(entry)) { |
| 416 | eventDispatcher.post(new FlowRuleEvent(FlowRuleEvent.Type.RULE_ADDED, entry)); |
| 417 | } |
| 418 | } |
| 419 | for (FlowEntry entry : request.toRemove()) { |
| 420 | if (!failedItems.contains(entry)) { |
| 421 | eventDispatcher.post(new FlowRuleEvent(FlowRuleEvent.Type.RULE_REMOVED, entry)); |
| 422 | } |
| 423 | } |
Yuta HIGUCHI | f3d51bd | 2014-10-21 01:05:33 -0700 | [diff] [blame] | 424 | break; |
| 425 | default: |
| 426 | break; |
| 427 | } |
tom | c78acee | 2014-09-24 15:16:55 -0700 | [diff] [blame] | 428 | } |
| 429 | } |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 430 | |
Madan Jampani | 117aaae | 2014-10-23 10:04:05 -0700 | [diff] [blame] | 431 | private class FlowRuleBatchFuture implements Future<CompletedBatchOperation> { |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 432 | |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 433 | private final List<Future<CompletedBatchOperation>> futures; |
Madan Jampani | 117aaae | 2014-10-23 10:04:05 -0700 | [diff] [blame] | 434 | private final Multimap<DeviceId, FlowRuleBatchEntry> batches; |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 435 | private final AtomicReference<BatchState> state; |
| 436 | private CompletedBatchOperation overall; |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 437 | |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 438 | public FlowRuleBatchFuture(List<Future<CompletedBatchOperation>> futures, |
Madan Jampani | 117aaae | 2014-10-23 10:04:05 -0700 | [diff] [blame] | 439 | Multimap<DeviceId, FlowRuleBatchEntry> batches) { |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 440 | this.futures = futures; |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 441 | this.batches = batches; |
| 442 | state = new AtomicReference<FlowRuleManager.BatchState>(); |
| 443 | state.set(BatchState.STARTED); |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 444 | } |
| 445 | |
| 446 | @Override |
| 447 | public boolean cancel(boolean mayInterruptIfRunning) { |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 448 | if (state.get() == BatchState.FINISHED) { |
| 449 | return false; |
| 450 | } |
| 451 | if (!state.compareAndSet(BatchState.STARTED, BatchState.CANCELLED)) { |
| 452 | return false; |
| 453 | } |
| 454 | cleanUpBatch(); |
| 455 | for (Future<CompletedBatchOperation> f : futures) { |
| 456 | f.cancel(mayInterruptIfRunning); |
| 457 | } |
| 458 | return true; |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 459 | } |
| 460 | |
| 461 | @Override |
| 462 | public boolean isCancelled() { |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 463 | return state.get() == BatchState.CANCELLED; |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 464 | } |
| 465 | |
| 466 | @Override |
| 467 | public boolean isDone() { |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 468 | return state.get() == BatchState.FINISHED; |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 469 | } |
| 470 | |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 471 | |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 472 | @Override |
| 473 | public CompletedBatchOperation get() throws InterruptedException, |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 474 | ExecutionException { |
| 475 | |
| 476 | if (isDone()) { |
| 477 | return overall; |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 478 | } |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 479 | |
| 480 | boolean success = true; |
Madan Jampani | 117aaae | 2014-10-23 10:04:05 -0700 | [diff] [blame] | 481 | Set<FlowEntry> failed = Sets.newHashSet(); |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 482 | CompletedBatchOperation completed; |
| 483 | for (Future<CompletedBatchOperation> future : futures) { |
| 484 | completed = future.get(); |
alshabib | 3effd04 | 2014-10-17 12:00:31 -0700 | [diff] [blame] | 485 | success = validateBatchOperation(failed, completed); |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 486 | } |
| 487 | |
| 488 | return finalizeBatchOperation(success, failed); |
| 489 | |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 490 | } |
| 491 | |
| 492 | @Override |
| 493 | public CompletedBatchOperation get(long timeout, TimeUnit unit) |
| 494 | throws InterruptedException, ExecutionException, |
| 495 | TimeoutException { |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 496 | |
| 497 | if (isDone()) { |
| 498 | return overall; |
| 499 | } |
| 500 | boolean success = true; |
Madan Jampani | 117aaae | 2014-10-23 10:04:05 -0700 | [diff] [blame] | 501 | Set<FlowEntry> failed = Sets.newHashSet(); |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 502 | CompletedBatchOperation completed; |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 503 | long start = System.nanoTime(); |
| 504 | long end = start + unit.toNanos(timeout); |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 505 | |
| 506 | for (Future<CompletedBatchOperation> future : futures) { |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 507 | long now = System.nanoTime(); |
| 508 | long thisTimeout = end - now; |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 509 | completed = future.get(thisTimeout, TimeUnit.NANOSECONDS); |
alshabib | 3effd04 | 2014-10-17 12:00:31 -0700 | [diff] [blame] | 510 | success = validateBatchOperation(failed, completed); |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 511 | } |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 512 | return finalizeBatchOperation(success, failed); |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 513 | } |
| 514 | |
Madan Jampani | 117aaae | 2014-10-23 10:04:05 -0700 | [diff] [blame] | 515 | private boolean validateBatchOperation(Set<FlowEntry> failed, |
alshabib | 3effd04 | 2014-10-17 12:00:31 -0700 | [diff] [blame] | 516 | CompletedBatchOperation completed) { |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 517 | |
| 518 | if (isCancelled()) { |
| 519 | throw new CancellationException(); |
| 520 | } |
| 521 | if (!completed.isSuccess()) { |
| 522 | failed.addAll(completed.failedItems()); |
| 523 | cleanUpBatch(); |
| 524 | cancelAllSubBatches(); |
| 525 | return false; |
| 526 | } |
| 527 | return true; |
| 528 | } |
| 529 | |
| 530 | private void cancelAllSubBatches() { |
| 531 | for (Future<CompletedBatchOperation> f : futures) { |
| 532 | f.cancel(true); |
| 533 | } |
| 534 | } |
| 535 | |
| 536 | private CompletedBatchOperation finalizeBatchOperation(boolean success, |
Madan Jampani | 117aaae | 2014-10-23 10:04:05 -0700 | [diff] [blame] | 537 | Set<FlowEntry> failed) { |
alshabib | 2683458 | 2014-10-08 20:15:46 -0700 | [diff] [blame] | 538 | synchronized (this) { |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 539 | if (!state.compareAndSet(BatchState.STARTED, BatchState.FINISHED)) { |
| 540 | if (state.get() == BatchState.FINISHED) { |
| 541 | return overall; |
| 542 | } |
| 543 | throw new CancellationException(); |
| 544 | } |
| 545 | overall = new CompletedBatchOperation(success, failed); |
| 546 | return overall; |
| 547 | } |
| 548 | } |
| 549 | |
| 550 | private void cleanUpBatch() { |
| 551 | for (FlowRuleBatchEntry fbe : batches.values()) { |
| 552 | if (fbe.getOperator() == FlowRuleOperation.ADD || |
| 553 | fbe.getOperator() == FlowRuleOperation.MODIFY) { |
| 554 | store.deleteFlowRule(fbe.getTarget()); |
| 555 | } else if (fbe.getOperator() == FlowRuleOperation.REMOVE) { |
alshabib | cf36991 | 2014-10-13 14:16:42 -0700 | [diff] [blame] | 556 | store.removeFlowRule(new DefaultFlowEntry(fbe.getTarget())); |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 557 | store.storeFlowRule(fbe.getTarget()); |
| 558 | } |
| 559 | } |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 560 | } |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 561 | } |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 562 | } |