Display Vlan Priority in Flow Stats in TS GUI 46/5046/3
authorSapan Shah <sapshah@cisco.com>
Thu, 30 Jan 2014 22:09:42 +0000 (14:09 -0800)
committerSapan Shah <sapshah@cisco.com>
Fri, 31 Jan 2014 02:37:18 +0000 (18:37 -0800)
also display Priority values, greater than 32767

Change-Id: Idc067ffe3b9e859c1f2ce2eeec7d5e569f318db6
Signed-off-by: Sapan Shah <sapshah@cisco.com>
opendaylight/web/troubleshoot/src/main/java/org/opendaylight/controller/troubleshoot/web/Troubleshoot.java
opendaylight/web/troubleshoot/src/main/resources/js/page.js

index 6d79f3cb05cc7faf2469e3144fb6be44d9d21e81..36b5043dd94ebf6956c499da4ad4909864a9c936 100644 (file)
@@ -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<String> 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;
     }
 
index 4b5e51a0718377e449c799dd807cc2cf798992ec..4bc4c76fc4c7edadf6f8e4994890a162044d76b7 100644 (file)
@@ -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',