Handle OF1.5 case for OFFlowStats message
@@ -182,9 +182,14 @@ public class StatisticsCollector implements IFloodlightModule, IStatisticsServic
flowStats.clear(); // to clear expired flows
Map<DatapathId, List<OFStatsReply>> replies = getSwitchStatistics(switchService.getAllSwitchDpids(), OFStatsType.FLOW);
for (Entry<DatapathId, List<OFStatsReply>> e : replies.entrySet()) {
+ IOFSwitch sw = switchService.getSwitch(e.getKey());
for (OFStatsReply r : e.getValue()) {
OFFlowStatsReply psr = (OFFlowStatsReply) r;
for (OFFlowStatsEntry pse : psr.getEntries()) {
+ if(sw.getOFFactory().getVersion().compareTo(OFVersion.OF_15) == 0){
+ log.warn("Flow Stats not supported in OpenFlow 1.5.");
+
+ } else {
Pair<Match, DatapathId> pair = new Pair<Match,DatapathId>(pse.getMatch(),e.getKey());
flowStats.put(pair,FlowRuleStats.of(
e.getKey(),
@@ -199,6 +204,7 @@ public class StatisticsCollector implements IFloodlightModule, IStatisticsServic
}
}
}
+ }
/**
* Single thread for collecting switch statistics and
