X-Git-Url: https://git.llucax.com/z.facultad/75.74/practicos.git/blobdiff_plain/0a2739fe97762f57a80599ef170df98e07422a3d..78d6e1ce97611abe9f0d083033197773f93c33f7:/practicas/pipi/src/routetable.h diff --git a/practicas/pipi/src/routetable.h b/practicas/pipi/src/routetable.h index 2fe1586..d534d16 100644 --- a/practicas/pipi/src/routetable.h +++ b/practicas/pipi/src/routetable.h @@ -4,6 +4,7 @@ #include "dev.h" #include "ipaddr.h" #include +#include /// Tabla de ruteo struct RouteTable @@ -13,11 +14,12 @@ struct RouteTable struct Route { IPAddr gateway; + unsigned mtu; unsigned metric; Dev* iface; - Route(): gateway(0), metric(0), iface(0) {} - Route(const IPAddr& gateway, unsigned metric, Dev& iface): - gateway(gateway), metric(metric), iface(&iface) {} + Route(): gateway(0), mtu(0), metric(0), iface(0) {} + Route(const IPAddr& gateway, unsigned mtu, unsigned metric, Dev& iface): + gateway(gateway), mtu(mtu), metric(metric), iface(&iface) {} }; /// Tabla @@ -30,7 +32,7 @@ struct RouteTable RouteTable(Dev& default_iface); /// Agrega ruta - void add(const IPAddr& net, const IPAddr& gw, unsigned metric, Dev& iface); + void add(const IPAddr& net, const IPAddr& gw, unsigned mtu, unsigned metric, Dev& iface); /// Borra ruta void del(const IPAddr& net); @@ -40,6 +42,9 @@ struct RouteTable }; +/// Agrega rutas desde un stream de datos con un cierto dispositivo +void add_routes(RouteTable& rt, std::istream& is, Dev& dev); + #endif // _ROUTETABLE_H_ // vim: set et sw=4 sts=4 :