X-Git-Url: https://git.llucax.com/z.facultad/75.74/practicos.git/blobdiff_plain/6758589f5ff68b1775d5a83b01d7ac49f1b612ef..55584999e396fae97c47a9d83d35d6b45c7bed97:/practicas/pipi/src/ipout.cpp?ds=sidebyside diff --git a/practicas/pipi/src/ipout.cpp b/practicas/pipi/src/ipout.cpp index 6e0c807..6829d2f 100644 --- a/practicas/pipi/src/ipout.cpp +++ b/practicas/pipi/src/ipout.cpp @@ -19,12 +19,14 @@ IPOut::IPOut(const IPAddr& ip, RouteTable& rtable, Dev& forward_que, std::ostrea void IPOut::drop(const std::string& msg, const std::string& buf) { - log << "IPOut::drop: " << msg << "\n\tBuffer: " << buf << "\n"; + log << "IPOut::drop (" << ip << "): " << msg << "\n\tBuffer: " << buf + << "\n"; } void IPOut::drop(const std::string& msg, const IPHeader& iph) { - log << "IPOut::drop: " << msg << "\n\tIPHeader: " << iph << "\n"; + log << "IPOut::drop (" << ip << "): " << msg << "\n\tIPHeader: " << iph + << "\n"; } /// Envía un paquete IP @@ -38,7 +40,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 - std::cout << "IPOut::send: A forwardear\n"; + std::cout << "IPOut::send (" << ip << "): A forwardear\n"; #endif send(iph, buf.substr(iph.header_len())); } @@ -85,7 +87,8 @@ 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 - std::cout << "IPOut::send: Fragmento 0 => IPHeader: " << iph2 << "\n"; + std::cout << "IPOut::send (" << ip << "): Fragmento " << i + << " => IPHeader: " << iph2 << "\n"; std::string tmp = data.substr(i * max_payload, max_payload); std::cout << "\tdata (" << tmp.size() << ") = " << tmp << "\n"; #endif