X-Git-Url: https://git.llucax.com/z.facultad/75.74/practicos.git/blobdiff_plain/810ed30ec72d5339d6efa8a88702b74d95693503..f17a708ff0e870baf2709bb0d63f32f166e082d3:/practicas/pipi/src/ip.cpp?ds=sidebyside diff --git a/practicas/pipi/src/ip.cpp b/practicas/pipi/src/ip.cpp index f3fed6e..6bffcfd 100644 --- a/practicas/pipi/src/ip.cpp +++ b/practicas/pipi/src/ip.cpp @@ -28,7 +28,7 @@ int main(int argc, char* argv[]) { bool router = false; bool forward = false; - unsigned proto = 0; + uint8_t proto = 0; uint16_t port = DEVTCP_DEFAULT_PORT; std::string fname = "route.txt"; if (argc < 2) @@ -97,7 +97,8 @@ int main(int argc, char* argv[]) IPAddr src, dst; std::string s = ipin.recv(proto, src, dst); std::cout << "Recibido '" << s << "' (len " << s.size() << ") de " - << src << " para " << dst << " (proto = " << proto << ")\n"; + << src << " para " << dst << " (proto = " << unsigned(proto) + << ")\n"; } return 0; } @@ -132,7 +133,7 @@ void add_routes(RouteTable& rt, std::istream& is, Dev& dev) iss >> net >> gw >> mtu >> metric; if (net == "0") net = "0.0.0.0"; if (gw == "0") gw = "0.0.0.0"; - rt.add(net.c_str(), gw.c_str(), metric, mtu, dev); + rt.add(net, gw, metric, mtu, dev); } }