Introduced new field FlowPathType to the Flow Path.
The initial set of valid values are:
FP_TYPE_SHORTEST_PATH, // Shortest path flow
FP_TYPE_EXPLICIT_PATH // Flow path with explicit flow entries
For now, the type field is not used (explicitly) yet.
diff --git a/web/add_flow.py b/web/add_flow.py
index 8100f22..0efa550 100755
--- a/web/add_flow.py
+++ b/web/add_flow.py
@@ -352,6 +352,8 @@
flow_path = {}
flow_path['flowId'] = flow_id
flow_path['installerId'] = installer_id
+ # NOTE: The 'flowPathType' might be rewritten later
+ flow_path['flowPathType'] = 'FP_TYPE_EXPLICIT_PATH'
flow_path['flowPathFlags'] = flowPathFlags
if (len(match) > 0):
@@ -440,6 +442,8 @@
parsed_args[idx]['actionOutputEnabled'] = False
flow_path = compute_flow_path(parsed_args[idx], data_path)
+ flow_path['flowPathType'] = 'FP_TYPE_SHORTEST_PATH'
+
add_shortest_path_flow(flow_path)
idx = idx + 1
diff --git a/web/get_flow.py b/web/get_flow.py
index 9ab55da..b17f417 100755
--- a/web/get_flow.py
+++ b/web/get_flow.py
@@ -161,6 +161,7 @@
def print_flow_path(parsedResult):
flowId = parsedResult['flowId']['value']
installerId = parsedResult['installerId']['value']
+ flowPathType = parsedResult['flowPathType']
flowPathFlags = parsedResult['flowPathFlags']['flags']
srcSwitch = parsedResult['dataPath']['srcPort']['dpid']['value']
srcPort = parsedResult['dataPath']['srcPort']['port']['value']
@@ -179,7 +180,7 @@
flowPathFlagsStr += ","
flowPathFlagsStr += "KEEP_ONLY_FIRST_HOP_ENTRY"
- print "FlowPath: (flowId = %s installerId = %s flowPathFlags = 0x%x(%s) src = %s/%s dst = %s/%s)" % (flowId, installerId, flowPathFlags, flowPathFlagsStr, srcSwitch, srcPort, dstSwitch, dstPort)
+ print "FlowPath: (flowId = %s installerId = %s flowPathType = %s flowPathFlags = 0x%x(%s) src = %s/%s dst = %s/%s)" % (flowId, installerId, flowPathType, flowPathFlags, flowPathFlagsStr, srcSwitch, srcPort, dstSwitch, dstPort)
#
# Print the common match conditions