X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fweb%2Ftroubleshoot%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Ftroubleshoot%2Fweb%2FTroubleshoot.java;h=36b5043dd94ebf6956c499da4ad4909864a9c936;hp=eab07418b46fa51ff9fd3524dc0160337537c70c;hb=6fd408a04fe4a3611843e2246ece6d7c34b76903;hpb=5a092f4edd202f6e94626a1bdc0e7f64b223da40 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 eab07418b4..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", + "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"); @@ -229,6 +229,7 @@ public class Troubleshoot implements IDaylightWeb { private Map convertPortsStatistics( NodeConnectorStatistics ncStats, String containerName) { + Map row = new HashMap(); ISwitchManager switchManager = (ISwitchManager) ServiceHelper @@ -313,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()); @@ -325,6 +339,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() @@ -361,57 +381,46 @@ public class Troubleshoot implements IDaylightWeb { if (outPorts.length() > 0) { outPorts.append(" "); } - actions.append(action.getType().toString() + " = " - + ao.getPort().getNodeConnectorIdAsString() + "
"); + actions.append(action.getType().toString()).append(" = ").append(ao.getPort().getNodeConnectorIdAsString()).append("
"); } else if (action instanceof SetVlanId) { SetVlanId av = (SetVlanId) action; String outVlanId = String.valueOf(av.getVlanId()); - actions.append(action.getType().toString() + " = " + outVlanId - + "
"); + actions.append(action.getType().toString()).append(" = ").append(outVlanId).append("
"); } else if (action instanceof SetDlSrc) { SetDlSrc ads = (SetDlSrc) action; - actions.append(action.getType().toString() + " = " - + HexEncode.bytesToHexStringFormat(ads.getDlAddress()) + "
"); + actions.append(action.getType().toString()).append(" = ").append(HexEncode.bytesToHexStringFormat(ads.getDlAddress())).append("
"); } else if (action instanceof SetDlDst) { SetDlDst add = (SetDlDst) action; - actions.append(action.getType().toString() + " = " - + HexEncode.bytesToHexStringFormat(add.getDlAddress()) - + "
"); + actions.append(action.getType().toString()).append(" = ").append(HexEncode.bytesToHexStringFormat(add.getDlAddress())).append("
"); } else if (action instanceof SetNwSrc) { SetNwSrc ans = (SetNwSrc) action; - actions.append(action.getType().toString() + " = " - + ans.getAddressAsString() + "
"); + actions.append(action.getType().toString()).append(" = ").append(ans.getAddressAsString()).append("
"); } else if (action instanceof SetNwDst) { SetNwDst and = (SetNwDst) action; - actions.append(action.getType().toString() + " = " - + and.getAddressAsString() + "
"); + actions.append(action.getType().toString()).append(" = ").append(and.getAddressAsString()).append("
"); } else if (action instanceof SetNwTos) { SetNwTos ant = (SetNwTos) action; - actions.append(action.getType().toString() + " = " - + ant.getNwTos() + "
"); + actions.append(action.getType().toString()).append(" = ").append(ant.getNwTos()).append("
"); } else if (action instanceof SetTpSrc) { SetTpSrc ads = (SetTpSrc) action; - actions.append(action.getType().toString() + " = " - + ads.getPort() + "
"); + actions.append(action.getType().toString()).append(" = ").append(ads.getPort()).append("
"); } else if (action instanceof SetTpDst) { SetTpDst atd = (SetTpDst) action; - actions.append(action.getType().toString() + " = " - + atd.getPort() + "
"); + actions.append(action.getType().toString()).append(" = ").append(atd.getPort()).append("
"); } else if (action instanceof SetVlanPcp) { SetVlanPcp avp = (SetVlanPcp) action; - actions.append(action.getType().toString() + " = " - + avp.getPcp() + "
"); + actions.append(action.getType().toString()).append(" = ").append(avp.getPcp()).append("
"); // } else if (action instanceof SetDlSrc) { // SetDlSrc ads = (SetDlSrc) action; } else { - actions.append(action.getType().toString() + "
"); + actions.append(action.getType().toString()).append("
"); } } row.put("actions", actions.toString()); 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; }