void send_loop(IPOut& ipout, unsigned proto);
-void add_routes(RouteTable& rt, std::istream& is, Dev& dev);
-
int main(int argc, char* argv[])
{
bool router = false;
port = atoi(argv[5]);
if (argc > 6)
proto = atoi(argv[6]);
- // Creo cola para comunicar el IPIn con IPOut
- int que_id = msgget(DEVQUE_DEFAULT_KEY-1, IPC_CREAT | 0666); assert(que_id != -1);
// Abro archivo con rutas
std::ifstream ifs(fname.c_str()); assert(ifs);
// Creo medio físico y cola para forwarding
}
}
-void add_routes(RouteTable& rt, std::istream& is, Dev& dev)
-{
- std::string line;
- while (std::getline(is, line))
- {
- std::istringstream iss(line);
- std::string net;
- std::string gw;
- unsigned mtu;
- unsigned metric;
- iss >> net >> gw >> mtu >> metric;
- if (net == "0") net = "0.0.0.0";
- if (gw == "0") gw = "0.0.0.0";
- rt.add(net, gw, metric, mtu, dev);
- }
-}
-
// vim: set et sw=4 sts=4 :