X-Git-Url: http://plrg.eecs.uci.edu/git/?p=pingpong.git;a=blobdiff_plain;f=Code%2FProjects%2FPacketLevelSignatureExtractor%2Fsrc%2Fmain%2Fjava%2Fedu%2Fuci%2Fiotproject%2Fdetection%2Flayer2%2FLayer2SequenceMatcher.java;h=99aabf57386f9e9e9db7cb8422b9f3685948c24c;hp=49951f0ef050bc9479fa5a5e68d969f171bd7c4e;hb=987ea910fed24a1f3f51ded41b6aa98c4e2618ae;hpb=39172356d48f5cd574ef15ec276a33de9146155a diff --git a/Code/Projects/PacketLevelSignatureExtractor/src/main/java/edu/uci/iotproject/detection/layer2/Layer2SequenceMatcher.java b/Code/Projects/PacketLevelSignatureExtractor/src/main/java/edu/uci/iotproject/detection/layer2/Layer2SequenceMatcher.java index 49951f0..99aabf5 100644 --- a/Code/Projects/PacketLevelSignatureExtractor/src/main/java/edu/uci/iotproject/detection/layer2/Layer2SequenceMatcher.java +++ b/Code/Projects/PacketLevelSignatureExtractor/src/main/java/edu/uci/iotproject/detection/layer2/Layer2SequenceMatcher.java @@ -91,29 +91,22 @@ public class Layer2SequenceMatcher extends Layer2AbstractMatcher { mPacketDirections[getMatchedPacketsCount()-1], packet); boolean expectedDirection = mPacketDirections[getMatchedPacketsCount()]; if (actualDirection != expectedDirection) { - mSkippedPackets++; return false; } // Next apply timing constraints: // 1: to be a match, the packet must have a later timestamp than any other packet currently matched // 2: does adding the packet cause the max allowed time between first packet and last packet to be exceeded? if (!packet.getTimestamp().isAfter(mMatchedPackets.get(getMatchedPacketsCount()-1).getTimestamp())) { - mSkippedPackets++; return false; } // if (packet.getTimestamp().isAfter(mMatchedPackets.get(0).getTimestamp(). // plusMillis(TriggerTrafficExtractor.INCLUSION_WINDOW_MILLIS))) { if (packet.getTimestamp().isAfter(mMatchedPackets.get(0).getTimestamp(). plusMillis(mInclusionTimeMillis))) { - mSkippedPackets++; return false; } // If we made it here, it means that this packet has the expected length, direction, and obeys the timing // constraints, so we store it and advance. - if (mMaxSkippedPackets < mSkippedPackets) { - mMaxSkippedPackets = mSkippedPackets; - mSkippedPackets = 0; - } mMatchedPackets.add(packet); if (mMatchedPackets.size() == mSequence.size()) { // TODO report (to observers?) that we are done?