|
|
@ -86,8 +86,7 @@ void NATRouter::onRecv() |
|
|
|
{ |
|
|
|
// TUTAJ ew. implementacja obslugi pakietu adresowanego do routera
|
|
|
|
} |
|
|
|
//usleep(500000);
|
|
|
|
sleep(1); |
|
|
|
this->delay(); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
@ -96,7 +95,7 @@ void NATRouter::onRecv() |
|
|
|
this->print("onRecv() sleeping..."); |
|
|
|
#endif
|
|
|
|
} |
|
|
|
sleep(1); |
|
|
|
this->delay(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
@ -148,7 +147,7 @@ void NATRouter::sNAT(Packet *packet) |
|
|
|
{ |
|
|
|
//TESTOWO
|
|
|
|
this->print("NAT table full, waiting 1s"); |
|
|
|
sleep(1); |
|
|
|
this->delay(1); |
|
|
|
} |
|
|
|
|
|
|
|
// wstawiam do tablicy NAT info ze port zarezerowany na odbior
|
|
|
@ -164,7 +163,7 @@ void NATRouter::sNAT(Packet *packet) |
|
|
|
packet->setSrcPort(port); // zamieniam port lokalny na WAN'owy - z tablicy NAT
|
|
|
|
|
|
|
|
this->print(ss.str()); |
|
|
|
sleep(1); |
|
|
|
this->delay(); |
|
|
|
this->send(*packet, true); // wysylam dalej
|
|
|
|
natItem = NULL; |
|
|
|
} |
|
|
@ -188,7 +187,7 @@ void NATRouter::dNAT(Packet* packet) |
|
|
|
natItem->increaseTimeout(5); // podbijam o kolejne 5 sekund skoro transmisja trwa
|
|
|
|
|
|
|
|
this->print(ss.str()); |
|
|
|
sleep(1); |
|
|
|
this->delay(); |
|
|
|
this->send(*packet, true); // wysylam dalej
|
|
|
|
|
|
|
|
natItem = NULL; |
|
|
|