Fixed "Intent" problem: Add flow removed event by using "DEL_ACK".
Fixed "Fowarding" to make it work on changed "Intent".
Did cleanup some of "Intent" measurement code.
Deleted unused receiver in FlowProgrammer.java.
Memo:
ReactiveForwarding can set idle timeout.
You can specify it from 1 ~ second.
Out of this range, the application set it to 5 sec (default).
Sample: (in onos.properties file)
net.onrc.onos.apps.forwarding.Forwarding.idletimeout = 5
When you test, please be careful we only set the value to the first switch and the other switches has +2 second idle timeout values.
Change-Id: I1b261a8c771356a412af004c7c0cd93b539ebba7
diff --git a/src/main/java/net/onrc/onos/core/intent/runtime/PlanCalcRuntime.java b/src/main/java/net/onrc/onos/core/intent/runtime/PlanCalcRuntime.java
index 73a31b8..bbd2555 100644
--- a/src/main/java/net/onrc/onos/core/intent/runtime/PlanCalcRuntime.java
+++ b/src/main/java/net/onrc/onos/core/intent/runtime/PlanCalcRuntime.java
@@ -61,6 +61,7 @@
long lastDstSw = -1, lastDstPort = -1, firstSrcSw = -1;
MACAddress srcMac, dstMac;
int idleTimeout = 0, hardTimeout = 0, firstSwitchIdleTimeout = 0, firstSwitchHardTimeout = 0;
+ Long cookieId = null;
if (parent instanceof ShortestPathIntent) {
ShortestPathIntent pathIntent = (ShortestPathIntent) parent;
// Switch srcSwitch = graph.getSwitch(pathIntent.getSrcSwitchDpid());
@@ -77,6 +78,11 @@
hardTimeout = pathIntent.getHardTimeout();
firstSwitchIdleTimeout = pathIntent.getFirstSwitchIdleTimeout();
firstSwitchHardTimeout = pathIntent.getFirstSwitchHardTimetout();
+ try {
+ cookieId = Long.valueOf(pathIntent.getId());
+ } catch (NumberFormatException e) {
+ log.trace("NumberFormatException : ", e);
+ }
} else {
log.warn("Unsupported Intent: {}", parent);
continue;
@@ -99,6 +105,10 @@
fe.setIdleTimeout(firstSwitchIdleTimeout);
fe.setHardTimeout(firstSwitchHardTimeout);
}
+ if (cookieId != null) {
+ log.trace("cookieId is set: {}", cookieId);
+ fe.setFlowEntryId(cookieId);
+ }
entries.add(fe);
// srcPort = link.getDstPort();
srcPort = linkEvent.getDst().getNumber();