|
@@ -226,10 +226,10 @@ void statistics::addIntervalStat(std::chrono::duration<int, std::micro> interval
|
|
* @param dport The destination port.
|
|
* @param dport The destination port.
|
|
* @param timestamp The timestamp of the packet.
|
|
* @param timestamp The timestamp of the packet.
|
|
*/
|
|
*/
|
|
-void statistics::addConvStat(const IPv4Address ipAddressSender,int sport,const IPv4Address ipAddressReceiver,int dport, std::chrono::microseconds timestamp){
|
|
|
|
|
|
+void statistics::addConvStat(const IPv4Address ipAddressSender, std::uint16_t sport,const IPv4Address ipAddressReceiver, std::uint16_t dport, std::chrono::microseconds timestamp){
|
|
|
|
|
|
- conv f1 = {ipAddressReceiver, dport, ipAddressSender, sport};
|
|
|
|
- conv f2 = {ipAddressSender, sport, ipAddressReceiver, dport};
|
|
|
|
|
|
+ conv f1 = {ipAddressReceiver, ipAddressSender, dport, sport};
|
|
|
|
+ conv f2 = {ipAddressSender, ipAddressReceiver, sport, dport};
|
|
|
|
|
|
// if already exist A(ipAddressReceiver, dport), B(ipAddressSender, sport) conversation
|
|
// if already exist A(ipAddressReceiver, dport), B(ipAddressSender, sport) conversation
|
|
if (conv_statistics.count(f1)>0){
|
|
if (conv_statistics.count(f1)>0){
|
|
@@ -259,10 +259,10 @@ void statistics::addConvStat(const IPv4Address ipAddressSender,int sport,const I
|
|
* @param protocol The used protocol.
|
|
* @param protocol The used protocol.
|
|
* @param timestamp The timestamp of the packet.
|
|
* @param timestamp The timestamp of the packet.
|
|
*/
|
|
*/
|
|
-void statistics::addConvStatExt(const IPv4Address ipAddressSender,int sport, const IPv4Address ipAddressReceiver,int dport,const std::string &protocol, std::chrono::microseconds timestamp){
|
|
|
|
|
|
+void statistics::addConvStatExt(const IPv4Address ipAddressSender, std::uint16_t sport, const IPv4Address ipAddressReceiver, std::uint16_t dport, const std::string &protocol, std::chrono::microseconds timestamp){
|
|
if(this->getDoExtraTests()) {
|
|
if(this->getDoExtraTests()) {
|
|
- convWithProt f1 = {ipAddressReceiver, dport, ipAddressSender, sport, protocol};
|
|
|
|
- convWithProt f2 = {ipAddressSender, sport, ipAddressReceiver, dport, protocol};
|
|
|
|
|
|
+ convWithProt f1 = {ipAddressReceiver, ipAddressSender, dport, sport, protocol};
|
|
|
|
+ convWithProt f2 = {ipAddressSender, ipAddressReceiver, sport, dport, protocol};
|
|
convWithProt f;
|
|
convWithProt f;
|
|
|
|
|
|
// if there already exists a communication interval for the specified conversation
|
|
// if there already exists a communication interval for the specified conversation
|
|
@@ -431,8 +431,8 @@ float statistics::getProtocolByteCount(const IPv4Address ipAddress, const std::s
|
|
* @param ipAddressReceiver The IP address of the packet receiver.
|
|
* @param ipAddressReceiver The IP address of the packet receiver.
|
|
* @param incomingPort The port used by the receiver.
|
|
* @param incomingPort The port used by the receiver.
|
|
*/
|
|
*/
|
|
-void statistics::incrementPortCount(const IPv4Address ipAddressSender, int outgoingPort, const IPv4Address ipAddressReceiver,
|
|
|
|
- int incomingPort, const std::string &protocol) {
|
|
|
|
|
|
+void statistics::incrementPortCount(const IPv4Address ipAddressSender, std::uint16_t outgoingPort, const IPv4Address ipAddressReceiver,
|
|
|
|
+ std::uint16_t incomingPort, const std::string &protocol) {
|
|
port_values[outgoingPort]++;
|
|
port_values[outgoingPort]++;
|
|
port_values[incomingPort]++;
|
|
port_values[incomingPort]++;
|
|
ip_ports[{ipAddressSender, "out", outgoingPort, protocol}].count++;
|
|
ip_ports[{ipAddressSender, "out", outgoingPort, protocol}].count++;
|
|
@@ -449,8 +449,8 @@ void statistics::incrementPortCount(const IPv4Address ipAddressSender, int outgo
|
|
* @param incomingPort The port used by the receiver.
|
|
* @param incomingPort The port used by the receiver.
|
|
* @param byteSent The packet's size.
|
|
* @param byteSent The packet's size.
|
|
*/
|
|
*/
|
|
-void statistics::increasePortByteCount(const IPv4Address ipAddressSender, int outgoingPort, const IPv4Address ipAddressReceiver,
|
|
|
|
- int incomingPort, long bytesSent, const std::string &protocol) {
|
|
|
|
|
|
+void statistics::increasePortByteCount(const IPv4Address ipAddressSender, std::uint16_t outgoingPort, const IPv4Address ipAddressReceiver,
|
|
|
|
+ std::uint16_t incomingPort, long bytesSent, const std::string &protocol) {
|
|
ip_ports[{ipAddressSender, "out", outgoingPort, protocol}].byteCount += bytesSent;
|
|
ip_ports[{ipAddressSender, "out", outgoingPort, protocol}].byteCount += bytesSent;
|
|
ip_ports[{ipAddressReceiver, "in", incomingPort, protocol}].byteCount += bytesSent;
|
|
ip_ports[{ipAddressReceiver, "in", incomingPort, protocol}].byteCount += bytesSent;
|
|
}
|
|
}
|