private final List<PcapPacket> mUpperBound;
private final double mEps;
private int mInclusionTimeMillis;
+ private int mSkippedPackets;
/**
* Create a {@code Layer2RangeMatcher}.
mEps = eps;
mInclusionTimeMillis =
inclusionTimeMillis == 0 ? TriggerTrafficExtractor.INCLUSION_WINDOW_MILLIS : inclusionTimeMillis;
+ mSkippedPackets = 0;
}
/**
PcapPacket expectedUpperBound = mUpperBound.get(mMatchedPackets.size());
int lowerBound = expectedLowerBound.getOriginalLength();
int upperBound = expectedUpperBound.getOriginalLength();
-// int lowerBound = expectedLowerBound.getOriginalLength() - (int) mEps;
-// int upperBound = expectedUpperBound.getOriginalLength() + (int) mEps;
// Do strict matching if the lower and upper bounds are the same length
// Do range matching with eps otherwise
if (lowerBound != upperBound) {
if (!packet.getTimestamp().isAfter(mMatchedPackets.get(getMatchedPacketsCount()-1).getTimestamp())) {
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))) {
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.
+ // constraints, so we store it and advance.zzzz
mMatchedPackets.add(packet);
if (mMatchedPackets.size() == mLowerBound.size()) {
// TODO report (to observers?) that we are done?