|
@@ -116,7 +116,7 @@ void pcap_processor::collect_statistics() {
|
|
// Aidmar
|
|
// Aidmar
|
|
int counter=0;
|
|
int counter=0;
|
|
int timeIntervalNum = 1;
|
|
int timeIntervalNum = 1;
|
|
- std::chrono::duration<int, std::micro> timeInterval(10000000); // 5 sec
|
|
|
|
|
|
+ std::chrono::duration<int, std::micro> timeInterval(10000000); // 10 sec
|
|
std::chrono::microseconds intervalStartTimestamp = stats.getTimestampFirstPacket();
|
|
std::chrono::microseconds intervalStartTimestamp = stats.getTimestampFirstPacket();
|
|
std::chrono::microseconds firstTimestamp = stats.getTimestampFirstPacket();
|
|
std::chrono::microseconds firstTimestamp = stats.getTimestampFirstPacket();
|
|
int pktsInterval = 1000;
|
|
int pktsInterval = 1000;
|
|
@@ -132,19 +132,14 @@ void pcap_processor::collect_statistics() {
|
|
|
|
|
|
// Aidmar
|
|
// Aidmar
|
|
std::chrono::microseconds lastPktTimestamp = i->timestamp();
|
|
std::chrono::microseconds lastPktTimestamp = i->timestamp();
|
|
- //Tins::Timestamp tt = i->timestamp();
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+ //Tins::Timestamp tt = i->timestamp();
|
|
std::chrono::microseconds currentCaptureDuration = lastPktTimestamp - firstTimestamp;
|
|
std::chrono::microseconds currentCaptureDuration = lastPktTimestamp - firstTimestamp;
|
|
std::chrono::microseconds barrier = timeIntervalNum*timeInterval;
|
|
std::chrono::microseconds barrier = timeIntervalNum*timeInterval;
|
|
if(currentCaptureDuration>barrier){
|
|
if(currentCaptureDuration>barrier){
|
|
- //std::cout<<"LastpkstTimstamp:" << lastPktTimestamp.count() << ", currentCaptureDuration:"<< currentCaptureDuration.count() << ", barrier:" <<barrier.count()<<", interval:" << timeIntervalNum << ", interval time:"<<timeInterval.count()<<"\n";
|
|
|
|
-
|
|
|
|
|
|
+ //std::cout<<"LastpkstTimstamp:" << lastPktTimestamp.count() << ", currentCaptureDuration:"<< currentCaptureDuration.count() << ", barrier:" <<barrier.count()<<", interval:" << timeIntervalNum << ", interval time:"<<timeInterval.count()<<"\n";
|
|
stats.addIntervalStat(timeInterval, intervalStartTimestamp, previousPacketCount);
|
|
stats.addIntervalStat(timeInterval, intervalStartTimestamp, previousPacketCount);
|
|
stats.calculateLastIntervalIPsEntropy(filePath, intervalStartTimestamp);
|
|
stats.calculateLastIntervalIPsEntropy(filePath, intervalStartTimestamp);
|
|
- stats.calculateLastIntervalPacketRate(timeInterval, intervalStartTimestamp);
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+ stats.calculateLastIntervalPacketRate(timeInterval, intervalStartTimestamp);
|
|
timeIntervalNum++;
|
|
timeIntervalNum++;
|
|
intervalStartTimestamp = lastPktTimestamp;
|
|
intervalStartTimestamp = lastPktTimestamp;
|
|
previousPacketCount = stats.getPacketCount();
|
|
previousPacketCount = stats.getPacketCount();
|