projects
/
pingpong.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Changing the mechanism to count and correlate skipped packets.
[pingpong.git]
/
Code
/
Projects
/
PacketLevelSignatureExtractor
/
src
/
main
/
java
/
edu
/
uci
/
iotproject
/
detection
/
layer2
/
Layer2SequenceMatcher.java
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 2db22287210d412f97b0ccf6783e7b79401c4a25..99aabf57386f9e9e9db7cb8422b9f3685948c24c 100644
(file)
--- 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
@@
-22,11
+22,14
@@
public class Layer2SequenceMatcher extends Layer2AbstractMatcher {
*/
private final List<PcapPacket> mSequence;
*/
private final List<PcapPacket> mSequence;
+ private int mInclusionTimeMillis;
+
+
/**
* Create a {@code Layer2SequenceMatcher}.
* @param sequence The sequence to match against (search for).
*/
/**
* Create a {@code Layer2SequenceMatcher}.
* @param sequence The sequence to match against (search for).
*/
- public Layer2SequenceMatcher(List<PcapPacket> sequence) {
+ public Layer2SequenceMatcher(List<PcapPacket> sequence
, int inclusionTimeMillis
) {
super(sequence);
mSequence = sequence;
// Compute packet directions for sequence.
super(sequence);
mSequence = sequence;
// Compute packet directions for sequence.
@@
-41,6
+44,8
@@
public class Layer2SequenceMatcher extends Layer2AbstractMatcher {
mPacketDirections[i] = getPacketDirection(prevPkt, prevPktDirection, sequence.get(i));
}
}
mPacketDirections[i] = getPacketDirection(prevPkt, prevPktDirection, sequence.get(i));
}
}
+ mInclusionTimeMillis =
+ inclusionTimeMillis == 0 ? TriggerTrafficExtractor.INCLUSION_WINDOW_MILLIS : inclusionTimeMillis;
}
/**
}
/**
@@
-94,8
+99,10
@@
public class Layer2SequenceMatcher extends Layer2AbstractMatcher {
if (!packet.getTimestamp().isAfter(mMatchedPackets.get(getMatchedPacketsCount()-1).getTimestamp())) {
return false;
}
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().
if (packet.getTimestamp().isAfter(mMatchedPackets.get(0).getTimestamp().
-
plusMillis(TriggerTrafficExtractor.INCLUSION_WINDOW_MILLIS
))) {
+
plusMillis(mInclusionTimeMillis
))) {
return false;
}
// If we made it here, it means that this packet has the expected length, direction, and obeys the timing
return false;
}
// If we made it here, it means that this packet has the expected length, direction, and obeys the timing