Lines Matching defs:route

81 		"  add                - add a route for the specified interface\n"
82 " delete - deletes the specified route\n"
162 list_routes(int socket, const char *interfaceName, route_entry &route)
213 route_entry& route = interface->ifr_route;
220 BNetworkAddress destination(*route.destination);
222 if (route.mask != NULL) {
224 mask.SetTo(*route.mask);
240 if ((route.flags & RTF_GATEWAY) != 0) {
242 if (route.gateway != NULL)
243 gateway.SetTo(*route.gateway);
250 if (route.flags != 0) {
264 if ((route.flags & kFlags[i].value) != 0) {
278 if (route.destination != NULL)
279 addressSize += route.destination->sa_len;
280 if (route.mask != NULL)
281 addressSize += route.mask->sa_len;
282 if (route.gateway != NULL)
283 addressSize += route.gateway->sa_len;
295 delete_route(int socket, const char *interface, route_entry &route)
301 request.ifr_route = route;
304 fprintf(stderr, "%s: Could not delete route for %s: %s\n",
311 add_route(int socket, const char *interface, route_entry &route)
317 route.flags |= RTF_STATIC;
318 request.ifr_route = route;
321 fprintf(stderr, "%s: Could not add route for %s: %s\n",
328 get_route(int socket, route_entry &route)
335 request = route;
338 fprintf(stderr, "%s: Could not get route: %s\n",
346 if (route.destination->sa_family == kFamilies[i].family) {
385 // delete route
392 // add route
398 // get route for destination
416 route_entry route;
417 memset(&route, 0, sizeof(route_entry));
430 route.flags = RTF_DEFAULT;
488 route.mtu = argv[i + 1] ? strtol(argv[i + 1], NULL, 0) : 0;
489 if (route.mtu <= 500) {
496 route.flags |= RTF_HOST;
498 route.flags |= RTF_LOCAL;
500 route.flags |= RTF_REJECT;
508 route.destination = (sockaddr*)destination;
510 route.mask = (sockaddr*)mask;
512 route.gateway = (sockaddr*)gateway;
513 route.flags |= RTF_GATEWAY;
528 "adding a route.\n", kProgramName);
532 add_route(socket, interface, route);
537 "removing a route.\n", kProgramName);
541 delete_route(socket, interface, route);
546 list_routes(socket, interface, route);
553 list_routes(socket, interface, route);
560 get_route(socket, route);