|
@@ -47,6 +47,7 @@ void statistics::checkTCPChecksum(const std::string &ipAddressSender, const std:
|
|
*/
|
|
*/
|
|
std::vector<float> statistics::calculateLastIntervalIPsEntropy(std::chrono::microseconds intervalStartTimestamp){
|
|
std::vector<float> statistics::calculateLastIntervalIPsEntropy(std::chrono::microseconds intervalStartTimestamp){
|
|
if(this->getDoExtraTests()) {
|
|
if(this->getDoExtraTests()) {
|
|
|
|
+ std::cout << "interval start timestamp: " << intervalStartTimestamp.count() << std::endl;
|
|
// TODO: change datastructures
|
|
// TODO: change datastructures
|
|
std::vector<int> IPsSrcPktsCounts;
|
|
std::vector<int> IPsSrcPktsCounts;
|
|
std::vector<int> IPsDstPktsCounts;
|
|
std::vector<int> IPsDstPktsCounts;
|
|
@@ -79,6 +80,9 @@ std::vector<float> statistics::calculateLastIntervalIPsEntropy(std::chrono::micr
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ std::cout << "ip src count: " << IPsSrcPktsCounts.size() << std::endl;
|
|
|
|
+ std::cout << "pkts sent total: " << pktsSent << std::endl;
|
|
|
|
+
|
|
for (auto i = IPsSrcPktsCounts.begin(); i != IPsSrcPktsCounts.end(); i++) {
|
|
for (auto i = IPsSrcPktsCounts.begin(); i != IPsSrcPktsCounts.end(); i++) {
|
|
IPsSrcProb.push_back(static_cast<double>(*i) / static_cast<double>(pktsSent));
|
|
IPsSrcProb.push_back(static_cast<double>(*i) / static_cast<double>(pktsSent));
|
|
}
|
|
}
|