X-Git-Url: https://git.llucax.com/z.facultad/75.74/practicos.git/blobdiff_plain/49f488eb5e757db401a81bc40a30a84d1abcaf88..26fc1173c5122fd73d1cd2191e20d49fef1e1f32:/practicas/pipi/src/ipout.cpp?ds=sidebyside diff --git a/practicas/pipi/src/ipout.cpp b/practicas/pipi/src/ipout.cpp index 3e8dadc..6e0c807 100644 --- a/practicas/pipi/src/ipout.cpp +++ b/practicas/pipi/src/ipout.cpp @@ -7,6 +7,9 @@ #include #include #include +#ifdef DEBUG +#include +#endif /// Constructor IPOut::IPOut(const IPAddr& ip, RouteTable& rtable, Dev& forward_que, std::ostream& log): @@ -35,7 +38,7 @@ bool IPOut::send(const std::string& data, uint8_t proto, IPAddr dst, IPAddr src, std::string buf = forward_que.receive(); IPHeader iph(buf); #ifdef DEBUG - log << "IPOut::send: A forwardear\n"; + std::cout << "IPOut::send: A forwardear\n"; #endif send(iph, buf.substr(iph.header_len())); } @@ -82,9 +85,9 @@ bool IPOut::send(IPHeader iph, std::string data) throw (std::runtime_error) std::string buf((char*) &iph2, sizeof(IPHeader)); buf += data.substr(i * max_payload, max_payload); #ifdef DEBUG - log << "IPOut::send: Fragmento 0 => IPHeader: " << iph2 << "\n"; + std::cout << "IPOut::send: Fragmento 0 => IPHeader: " << iph2 << "\n"; std::string tmp = data.substr(i * max_payload, max_payload); - log << "\tdata (" << tmp.size() << ") = " << tmp << "\n"; + std::cout << "\tdata (" << tmp.size() << ") = " << tmp << "\n"; #endif r->iface->transmit(buf, r->gateway ? r->gateway : IPAddr(iph.dst)); }