X-Git-Url: https://git.llucax.com/z.facultad/75.74/practicos.git/blobdiff_plain/093ef819f410add240cf97b72f9e7dcab5abd16c..26fc1173c5122fd73d1cd2191e20d49fef1e1f32:/practicas/pipi/src/ipin.cpp diff --git a/practicas/pipi/src/ipin.cpp b/practicas/pipi/src/ipin.cpp index a9029c6..c191b90 100644 --- a/practicas/pipi/src/ipin.cpp +++ b/practicas/pipi/src/ipin.cpp @@ -1,6 +1,9 @@ #include "ipin.h" #include "ipheader.h" +#ifdef DEBUG +#include +#endif /// Constructor IPIn::IPIn(const IPAddr& ip, Dev& dev, Dev& forward_que, bool router, @@ -35,7 +38,9 @@ std::string IPIn::recv(uint8_t proto, IPAddr& src, IPAddr& dst) throw (std::runt } IPHeader iph(buf); #ifdef DEBUG - log << "IPIn::recv: IPHeader: " << iph << "\n"; + std::cout << "IPIn::recv: IPHeader: " << iph << "\n"; + std::string tmp = buf.substr(iph.header_len()); + std::cout << "\tdata (" << tmp.size() << ") = " << tmp << "\n"; #endif if (iph.version != 4) { @@ -80,7 +85,7 @@ std::string IPIn::recv(uint8_t proto, IPAddr& src, IPAddr& dst) throw (std::runt data += i->second; } #ifdef DEBUG - log << "IPIn::recv: Paquete completo: data = '" << data << "'\n"; + std::cout << "IPIn::recv: Paquete completo: data = '" << data << "'\n"; #endif buffer.erase(iph); //TODO faltaría limpiar fragmentos viejos cada tanto (timer?)