#include "dev.h"
#include "ipaddr.h"
#include <map>
+#include <istream>
/// Tabla de ruteo
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
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);
};
+/// 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 :