@Override public final void sendMsg(OFMessage m) { OFMessage newMsg = m; if (m.getType() == OFType.STATS_REQUEST) { OFStatsRequest sr = (OFStatsRequest) m; log.debug("Rebuilding stats request type {}", sr.getStatsType()); switch (sr.getStatsType()) { case FLOW: OFCalientFlowStatsRequest request = this.factory().buildCalientFlowStatsRequest() .setCookie(((OFFlowStatsRequest) sr).getCookie()) .setCookieMask(((OFFlowStatsRequest) sr).getCookieMask()) .setMatch(this.factory().matchWildcardAll()) .setOutGroup(((OFFlowStatsRequest) sr).getOutGroup().getGroupNumber()) .setOutPort(OFPort.ANY) .setTableId(TableId.ALL) .setXid(sr.getXid()) .setFlags(sr.getFlags()) .build(); newMsg = request; break; case PORT: // TODO break; default: break; } } super.sendMsg(newMsg); }