Lines Matching refs:route

59         Route *route;  in dhcp4_remove_address_and_routes()  local
64 SET_FOREACH(route, link->routes) { in dhcp4_remove_address_and_routes()
65 if (route->source != NETWORK_CONFIG_SOURCE_DHCP4) in dhcp4_remove_address_and_routes()
67 if (only_marked && !route_is_marked(route)) in dhcp4_remove_address_and_routes()
70 k = route_remove(route); in dhcp4_remove_address_and_routes()
74 route_cancel_request(route, link); in dhcp4_remove_address_and_routes()
180 …p4_route_handler(sd_netlink *rtnl, sd_netlink_message *m, Request *req, Link *link, Route *route) { in dhcp4_route_handler() argument
220 _cleanup_(route_freep) Route *route = in; in dhcp4_request_route()
225 assert(route); in dhcp4_request_route()
233 route->source = NETWORK_CONFIG_SOURCE_DHCP4; in dhcp4_request_route()
234 route->provider.in = server; in dhcp4_request_route()
235 route->family = AF_INET; in dhcp4_request_route()
236 if (!route->protocol_set) in dhcp4_request_route()
237 route->protocol = RTPROT_DHCP; in dhcp4_request_route()
238 if (!route->priority_set) in dhcp4_request_route()
239 route->priority = link->network->dhcp_route_metric; in dhcp4_request_route()
240 if (!route->table_set) in dhcp4_request_route()
241 route->table = link_get_dhcp4_route_table(link); in dhcp4_request_route()
242 if (route->mtu == 0) in dhcp4_request_route()
243 route->mtu = link->network->dhcp_route_mtu; in dhcp4_request_route()
245 if (route_get(NULL, link, route, &existing) < 0) /* This is a new route. */ in dhcp4_request_route()
250 return link_request_route(link, TAKE_PTR(route), true, &link->dhcp4_messages, in dhcp4_request_route()
261 _cleanup_(route_freep) Route *route = NULL; in dhcp4_request_prefix_route()
280 r = route_new(&route); in dhcp4_request_prefix_route()
284 route->dst.in.s_addr = address.s_addr & netmask.s_addr; in dhcp4_request_prefix_route()
285 route->dst_prefixlen = in4_addr_netmask_to_prefixlen(&netmask); in dhcp4_request_prefix_route()
286 route->prefsrc.in = address; in dhcp4_request_prefix_route()
287 route->scope = RT_SCOPE_LINK; in dhcp4_request_prefix_route()
289 return dhcp4_request_route(TAKE_PTR(route), link); in dhcp4_request_prefix_route()
293 _cleanup_(route_freep) Route *route = NULL; in dhcp4_request_route_to_gateway()
305 r = route_new(&route); in dhcp4_request_route_to_gateway()
309 route->dst.in = *gw; in dhcp4_request_route_to_gateway()
310 route->dst_prefixlen = 32; in dhcp4_request_route_to_gateway()
311 route->prefsrc.in = address; in dhcp4_request_route_to_gateway()
312 route->scope = RT_SCOPE_LINK; in dhcp4_request_route_to_gateway()
314 return dhcp4_request_route(TAKE_PTR(route), link); in dhcp4_request_route_to_gateway()
322 _cleanup_(route_freep) Route *route = in; in dhcp4_request_route_auto()
327 assert(route); in dhcp4_request_route_auto()
343 if (in4_addr_is_localhost(&route->dst.in)) { in dhcp4_request_route_auto()
347 … IPV4_ADDRESS_FMT_VAL(route->dst.in), route->dst_prefixlen, IPV4_ADDRESS_FMT_VAL(*gw)); in dhcp4_request_route_auto()
349 route->scope = RT_SCOPE_HOST; in dhcp4_request_route_auto()
350 route->gw_family = AF_UNSPEC; in dhcp4_request_route_auto()
351 route->gw = IN_ADDR_NULL; in dhcp4_request_route_auto()
352 route->prefsrc = IN_ADDR_NULL; in dhcp4_request_route_auto()
354 } else if (in4_addr_equal(&route->dst.in, &address)) { in dhcp4_request_route_auto()
358 … IPV4_ADDRESS_FMT_VAL(route->dst.in), route->dst_prefixlen, IPV4_ADDRESS_FMT_VAL(*gw)); in dhcp4_request_route_auto()
360 route->scope = RT_SCOPE_HOST; in dhcp4_request_route_auto()
361 route->gw_family = AF_UNSPEC; in dhcp4_request_route_auto()
362 route->gw = IN_ADDR_NULL; in dhcp4_request_route_auto()
363 route->prefsrc.in = address; in dhcp4_request_route_auto()
365 } else if (route->dst_prefixlen >= prefixlen && in dhcp4_request_route_auto()
366 (route->dst.in.s_addr & netmask.s_addr) == prefix.s_addr) { in dhcp4_request_route_auto()
370 IPV4_ADDRESS_FMT_VAL(route->dst.in), route->dst_prefixlen, in dhcp4_request_route_auto()
374 route->scope = RT_SCOPE_LINK; in dhcp4_request_route_auto()
375 route->gw_family = AF_UNSPEC; in dhcp4_request_route_auto()
376 route->gw = IN_ADDR_NULL; in dhcp4_request_route_auto()
377 route->prefsrc.in = address; in dhcp4_request_route_auto()
383 IPV4_ADDRESS_FMT_VAL(route->dst.in), route->dst_prefixlen, in dhcp4_request_route_auto()
392 route->scope = RT_SCOPE_UNIVERSE; in dhcp4_request_route_auto()
393 route->gw_family = AF_INET; in dhcp4_request_route_auto()
394 route->gw.in = *gw; in dhcp4_request_route_auto()
395 route->prefsrc.in = address; in dhcp4_request_route_auto()
398 return dhcp4_request_route(TAKE_PTR(route), link); in dhcp4_request_route_auto()
483 _cleanup_(route_freep) Route *route = NULL; in dhcp4_request_static_routes()
486 r = route_new(&route); in dhcp4_request_static_routes()
490 route->gw_family = AF_INET; in dhcp4_request_static_routes()
496 r = sd_dhcp_route_get_destination(routes[i], &route->dst.in); in dhcp4_request_static_routes()
500 r = sd_dhcp_route_get_destination_prefix_length(routes[i], &route->dst_prefixlen); in dhcp4_request_static_routes()
508 in4_addr_is_null(&route->dst.in) && route->dst_prefixlen == 0 && in dhcp4_request_static_routes()
512 r = dhcp4_request_route_auto(TAKE_PTR(route), link, &gw); in dhcp4_request_static_routes()
522 _cleanup_(route_freep) Route *route = NULL; in dhcp4_request_gateway()
563 r = route_new(&route); in dhcp4_request_gateway()
568 route->gw_family = AF_INET; in dhcp4_request_gateway()
569 route->gw.in = router[0]; in dhcp4_request_gateway()
570 route->prefsrc.in = address; in dhcp4_request_gateway()
572 r = dhcp4_request_route(TAKE_PTR(route), link); in dhcp4_request_gateway()
595 _cleanup_(route_freep) Route *route = NULL; in dhcp4_request_semi_static_routes()
607 r = route_dup(rt, &route); in dhcp4_request_semi_static_routes()
611 route->gw.in = *gw; in dhcp4_request_semi_static_routes()
613 r = dhcp4_request_route(TAKE_PTR(route), link); in dhcp4_request_semi_static_routes()
636 _cleanup_(route_freep) Route *route = NULL; in dhcp4_request_routes_to_servers()
641 r = route_new(&route); in dhcp4_request_routes_to_servers()
645 route->dst.in = servers[i]; in dhcp4_request_routes_to_servers()
646 route->dst_prefixlen = 32; in dhcp4_request_routes_to_servers()
648 r = dhcp4_request_route_auto(TAKE_PTR(route), link, gw); in dhcp4_request_routes_to_servers()