X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=openflow-protocol-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fopenflowjava%2Fprotocol%2Fimpl%2Fcore%2FOFVersionDetector.java;h=0142ebfd671634a89b6604369c201c7fab55a6c0;hb=25d95eb2be97152d7a459a12caa5e51a79556f58;hp=083cf0eca8dc40d6dd3b73f8d779e41ab231886a;hpb=93712d62743380d2dfc2712de4551a0c30afd82a;p=openflowjava.git diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/OFVersionDetector.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/OFVersionDetector.java index 083cf0ec..0142ebfd 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/OFVersionDetector.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/OFVersionDetector.java @@ -13,6 +13,8 @@ import io.netty.channel.ChannelHandlerContext; import io.netty.handler.codec.ByteToMessageDecoder; import java.util.List; import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants; +import org.opendaylight.openflowjava.statistics.CounterEventTypes; +import org.opendaylight.openflowjava.statistics.StatisticsCounters; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -28,6 +30,7 @@ public class OFVersionDetector extends ByteToMessageDecoder { private static final byte OF13_VERSION_ID = EncodeConstants.OF13_VERSION_ID; private static final short OF_PACKETIN = 10; private static final Logger LOGGER = LoggerFactory.getLogger(OFVersionDetector.class); + private final StatisticsCounters statisticsCounters; private volatile boolean filterPacketIns; /** @@ -35,6 +38,7 @@ public class OFVersionDetector extends ByteToMessageDecoder { */ public OFVersionDetector() { LOGGER.trace("Creating OFVersionDetector"); + statisticsCounters = StatisticsCounters.getInstance(); } public void setFilterPacketIns(final boolean enabled) { @@ -58,6 +62,7 @@ public class OFVersionDetector extends ByteToMessageDecoder { messageBuffer.retain(); } else { LOGGER.debug("dropped packetin"); + statisticsCounters.incrementCounter(CounterEventTypes.US_DROPPED_PACKET_IN); } } else { LOGGER.warn("detected version: {} - currently not supported", version);