Lines Matching refs:route
111 static Route *route_free(Route *route) { in route_free() argument
112 if (!route) in route_free()
115 if (route->network) in route_free()
116 LIST_REMOVE(routes, route->network->routes, route); in route_free()
118 return mfree(route); in route_free()
123 Route *route; in route_new() local
127 route = new(Route, 1); in route_new()
128 if (!route) in route_new()
131 *route = (Route) { in route_new()
138 LIST_PREPEND(routes, network->routes, route); in route_new()
140 route->network = network; in route_new()
143 *ret = route; in route_new()
149 Route *route; in network_free() local
164 while ((route = network->routes)) in network_free()
165 route_free(route); in network_free()
1062 LIST_FOREACH(routes, route, all->routes) { in context_merge_networks()
1063 … r = route_new(network, route->family, route->prefixlen, &route->dest, &route->gateway, NULL); in context_merge_networks()
1108 static int route_dump(Route *route, FILE *f) { in route_dump() argument
1112 if (in_addr_is_set(route->family, &route->dest)) { in route_dump()
1113 r = in_addr_prefix_to_string(route->family, &route->dest, route->prefixlen, &dest); in route_dump()
1118 r = in_addr_to_string(route->family, &route->gateway, &gateway); in route_dump()
1178 LIST_FOREACH(routes, route, network->routes) in network_dump()
1179 (void) route_dump(route, f); in network_dump()