* Add FlowPathFlags to the FlowPath header.
* Implement DISCARD_FIRST_HOP_ENTRY and KEEP_ONLY_FIRST_HOP_ENTRY flags:
- DISCARD_FIRST_HOP_ENTRY : After computing the shortest-path, the
first-hop entry is discarded
- KEEP_ONLY_FIRST_HOP_ENTRY : After computing the shortest-path,
only the the first hop entry is kept, and the rest are discarded.
diff --git a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/web/AddShortestPathFlowResource.java b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/web/AddShortestPathFlowResource.java
index 9d2e0c9..2a75c6a 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/web/AddShortestPathFlowResource.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/web/AddShortestPathFlowResource.java
@@ -53,10 +53,11 @@
if (flowPath != null) {
FlowPath addedFlowPath =
flowService.addAndMaintainShortestPathFlow(flowPath);
- if (addedFlowPath == null)
+ if (addedFlowPath == null) {
result = new FlowId(); // Error: Return empty Flow Id
- else
+ } else {
result = addedFlowPath.flowId();
+ }
}
return result;