|
|
@ -158,7 +158,6 @@ void NATRouter::sNAT(Packet *packet) |
|
|
|
stringstream ss; |
|
|
|
|
|
|
|
// mozliwe, ze juz port zostal zaalokowany, to trzeba wykorzystac
|
|
|
|
// TO
|
|
|
|
port = this->getAllocatedPort(packet->getSrcIp(), packet->getSrcPort()); |
|
|
|
if (port == -1) |
|
|
|
while ((port = this->getFreePort()) == -1) |
|
|
@ -283,7 +282,7 @@ void NATRouter::freePorts() |
|
|
|
if (ports < peak) |
|
|
|
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.printProgressBar(4, 4, "Utilization", (float)(NAT_TABLE_LEN-ports-1)/(NAT_TABLE_LEN-1)); |
|
|
|