From 7d7f86f108c85b5325f8bea5d3dbf60efca776ce Mon Sep 17 00:00:00 2001 From: Sapan Shah Date: Wed, 29 Jan 2014 01:01:32 -0800 Subject: [PATCH] TS GUI does not show ToS field in flow stats Change-Id: I4b0bfc1988ea4fcc3eae02a73c3aebae1622f382 Signed-off-by: Sapan Shah --- .../controller/troubleshoot/web/Troubleshoot.java | 9 ++++++++- .../web/troubleshoot/src/main/resources/js/page.js | 6 ++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/opendaylight/web/troubleshoot/src/main/java/org/opendaylight/controller/troubleshoot/web/Troubleshoot.java b/opendaylight/web/troubleshoot/src/main/java/org/opendaylight/controller/troubleshoot/web/Troubleshoot.java index e46b89ac2a..6d79f3cb05 100644 --- a/opendaylight/web/troubleshoot/src/main/java/org/opendaylight/controller/troubleshoot/web/Troubleshoot.java +++ b/opendaylight/web/troubleshoot/src/main/java/org/opendaylight/controller/troubleshoot/web/Troubleshoot.java @@ -62,7 +62,7 @@ import org.springframework.web.bind.annotation.ResponseBody; public class Troubleshoot implements IDaylightWeb { private static final UserLevel AUTH_LEVEL = UserLevel.CONTAINERUSER; private static final List flowStatsColumnNames = Arrays.asList("Node", "In Port", - "DL Src", "DL Dst", "DL Type", "DL Vlan", "NW Src", "NW Dst", + "DL Src", "DL Dst", "DL Type", "DL Vlan", "NW Src", "NW Dst","ToS Bits", "NW Proto", "TP Src", "TP Dst", "Actions", "Bytes", "Packets", "Time (s)", "Timeout (s)", "Priority"); @@ -229,6 +229,7 @@ public class Troubleshoot implements IDaylightWeb { private Map convertPortsStatistics( NodeConnectorStatistics ncStats, String containerName) { + Map row = new HashMap(); ISwitchManager switchManager = (ISwitchManager) ServiceHelper @@ -325,6 +326,12 @@ public class Troubleshoot implements IDaylightWeb { } else { row.put(MatchType.NW_DST.id(), "*"); } + if (match.isPresent(MatchType.NW_TOS)) { + row.put(MatchType.NW_TOS.id(), ((Byte) flow.getMatch() + .getField(MatchType.NW_TOS).getValue()).toString()); + } else { + row.put(MatchType.NW_TOS.id(), "*"); + } if (match.isPresent(MatchType.NW_PROTO)) { row.put(MatchType.NW_PROTO.id(), IPProtocols.getProtocolName(((Byte) flow.getMatch() diff --git a/opendaylight/web/troubleshoot/src/main/resources/js/page.js b/opendaylight/web/troubleshoot/src/main/resources/js/page.js index a8673b0031..4b5e51a071 100644 --- a/opendaylight/web/troubleshoot/src/main/resources/js/page.js +++ b/opendaylight/web/troubleshoot/src/main/resources/js/page.js @@ -373,6 +373,11 @@ one.f.troubleshooting.existingNodes = { label: 'NW Dst', sortable: true }, + { + property: 'nwTOS', + label: 'ToS Bits', + sortable: true + }, { property: 'nwProto', label: 'NW Proto', @@ -437,6 +442,7 @@ one.f.troubleshooting.existingNodes = { entry.push(value["dlVlan"]); entry.push(value["nwSrc"]); entry.push(value["nwDst"]); + entry.push(value["nwTOS"]); entry.push(value["nwProto"]); entry.push(value["tpSrc"]); entry.push(value["tpDst"]); -- 2.36.6