|
@ -158,7 +158,6 @@ void NATRouter::sNAT(Packet *packet) |
|
|
stringstream ss; |
|
|
stringstream ss; |
|
|
|
|
|
|
|
|
// mozliwe, ze juz port zostal zaalokowany, to trzeba wykorzystac
|
|
|
// mozliwe, ze juz port zostal zaalokowany, to trzeba wykorzystac
|
|
|
// TO
|
|
|
|
|
|
port = this->getAllocatedPort(packet->getSrcIp(), packet->getSrcPort()); |
|
|
port = this->getAllocatedPort(packet->getSrcIp(), packet->getSrcPort()); |
|
|
if (port == -1) |
|
|
if (port == -1) |
|
|
while ((port = this->getFreePort()) == -1) |
|
|
while ((port = this->getFreePort()) == -1) |
|
@ -283,7 +282,7 @@ void NATRouter::freePorts() |
|
|
if (ports < peak) |
|
|
if (ports < peak) |
|
|
peak = ports; |
|
|
peak = ports; |
|
|
|
|
|
|
|
|
ss << "Free/Reserved:\t" << ports << " (" << peak << ")/" << (NAT_TABLE_LEN-ports-1); // poprawka na nieuzywany port 0
|
|
|
|
|
|
|
|
|
ss << "Free/Reserved:\t" << ports << " (" << peak << ")/" << (NAT_TABLE_LEN-ports-1) << " (" << (NAT_TABLE_LEN-peak-1) << ")"; // poprawka na nieuzywany port 0
|
|
|
|
|
|
|
|
|
portsLog.print(ss.str()); |
|
|
portsLog.print(ss.str()); |
|
|
portsLog.printProgressBar(4, 4, "Utilization", (float)(NAT_TABLE_LEN-ports-1)/(NAT_TABLE_LEN-1)); |
|
|
portsLog.printProgressBar(4, 4, "Utilization", (float)(NAT_TABLE_LEN-ports-1)/(NAT_TABLE_LEN-1)); |
|
|