From 7c5788de6364886747dc616940d5eddbbd615034 Mon Sep 17 00:00:00 2001 From: Sapan Shah Date: Thu, 30 Jan 2014 14:09:42 -0800 Subject: [PATCH] Display Vlan Priority in Flow Stats in TS GUI also display Priority values, greater than 32767 Change-Id: Idc067ffe3b9e859c1f2ce2eeec7d5e569f318db6 Signed-off-by: Sapan Shah --- .../troubleshoot/web/Troubleshoot.java | 17 +++++++++++++++-- .../troubleshoot/src/main/resources/js/page.js | 5 +++++ 2 files changed, 20 insertions(+), 2 deletions(-) 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 6d79f3cb05..36b5043dd9 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","ToS Bits", + "DL Src", "DL Dst", "DL Type", "DL Vlan","Vlan Priority", "NW Src", "NW Dst","ToS Bits", "NW Proto", "TP Src", "TP Dst", "Actions", "Bytes", "Packets", "Time (s)", "Timeout (s)", "Priority"); @@ -314,6 +314,19 @@ public class Troubleshoot implements IDaylightWeb { } else { row.put(MatchType.DL_VLAN.id(), "*"); } + //Vlan Priority + if (match.isPresent(MatchType.DL_VLAN_PR)) { + if (((Byte) flow.getMatch().getField(MatchType.DL_VLAN_PR).getValue()) + .shortValue() < 0) { + row.put(MatchType.DL_VLAN_PR.id(), "0"); + } else { + row.put(MatchType.DL_VLAN_PR.id(), ((Byte) flow.getMatch() + .getField(MatchType.DL_VLAN_PR).getValue()).toString()); + } + } else { + row.put(MatchType.DL_VLAN_PR.id(), "*"); + } + if (match.isPresent(MatchType.NW_SRC)) { row.put(MatchType.NW_SRC.id(), ((InetAddress) flow.getMatch() .getField(MatchType.NW_SRC).getValue()).getHostAddress()); @@ -407,7 +420,7 @@ public class Troubleshoot implements IDaylightWeb { row.put("durationSeconds", ((Integer) flowOnNode.getDurationSeconds()).toString()); row.put("idleTimeout", ((Short) flow.getIdleTimeout()).toString()); - row.put("priority", String.valueOf(flow.getPriority())); + row.put("priority", String.valueOf(NetUtils.getUnsignedShort(flow.getPriority()))); return row; } diff --git a/opendaylight/web/troubleshoot/src/main/resources/js/page.js b/opendaylight/web/troubleshoot/src/main/resources/js/page.js index 4b5e51a071..4bc4c76fc4 100644 --- a/opendaylight/web/troubleshoot/src/main/resources/js/page.js +++ b/opendaylight/web/troubleshoot/src/main/resources/js/page.js @@ -363,6 +363,11 @@ one.f.troubleshooting.existingNodes = { label: 'DL Vlan', sortable: true }, + { + property: 'dlVlanPriority', + label: 'Vlan PCP', + sortable: true + }, { property: 'nwSrc', label: 'NW Src', -- 2.36.6