Lines Matching refs:prefix
74 static void link_remove_dhcp_pd_subnet_prefix(Link *link, const struct in6_addr *prefix) { in link_remove_dhcp_pd_subnet_prefix() argument
79 assert(prefix); in link_remove_dhcp_pd_subnet_prefix()
81 if (hashmap_get(link->manager->links_by_dhcp_pd_subnet_prefix, prefix) != link) in link_remove_dhcp_pd_subnet_prefix()
84 hashmap_remove2(link->manager->links_by_dhcp_pd_subnet_prefix, prefix, &key); in link_remove_dhcp_pd_subnet_prefix()
88 static int link_add_dhcp_pd_subnet_prefix(Link *link, const struct in6_addr *prefix) { in link_add_dhcp_pd_subnet_prefix() argument
93 assert(prefix); in link_add_dhcp_pd_subnet_prefix()
95 copy = newdup(struct in6_addr, prefix, 1); in link_add_dhcp_pd_subnet_prefix()
108 static int link_get_by_dhcp_pd_subnet_prefix(Manager *manager, const struct in6_addr *prefix, Link … in link_get_by_dhcp_pd_subnet_prefix() argument
112 assert(prefix); in link_get_by_dhcp_pd_subnet_prefix()
114 link = hashmap_get(manager->links_by_dhcp_pd_subnet_prefix, prefix); in link_get_by_dhcp_pd_subnet_prefix()
142 struct in6_addr prefix = address->in_addr.in6; in dhcp_pd_get_assigned_subnet_prefix() local
144 in6_addr_mask(&prefix, 64); in dhcp_pd_get_assigned_subnet_prefix()
145 *ret = prefix; in dhcp_pd_get_assigned_subnet_prefix()
204 struct in6_addr prefix; in dhcp_pd_remove() local
211 prefix = address->in_addr.in6; in dhcp_pd_remove()
212 in6_addr_mask(&prefix, 64); in dhcp_pd_remove()
215 sd_radv_remove_prefix(link->radv, &prefix, 64); in dhcp_pd_remove()
217 link_remove_dhcp_pd_subnet_prefix(link, &prefix); in dhcp_pd_remove()
307 static int dhcp_pd_request_route(Link *link, const struct in6_addr *prefix, usec_t lifetime_usec) { in dhcp_pd_request_route() argument
314 assert(prefix); in dhcp_pd_request_route()
325 route->dst.in6 = *prefix; in dhcp_pd_request_route()
382 const struct in6_addr *prefix, in dhcp_pd_request_address() argument
392 assert(prefix); in dhcp_pd_request_address()
397 r = dhcp_pd_generate_addresses(link, prefix, &addresses); in dhcp_pd_request_address()
440 struct in6_addr prefix; in dhcp_pd_calculate_subnet_prefix() local
449 prefix = *pd_prefix; in dhcp_pd_calculate_subnet_prefix()
452 prefix.s6_addr32[0] |= htobe32(subnet_id >> 32); in dhcp_pd_calculate_subnet_prefix()
454 prefix.s6_addr32[1] |= htobe32(subnet_id & 0xffffffff); in dhcp_pd_calculate_subnet_prefix()
456 *ret = prefix; in dhcp_pd_calculate_subnet_prefix()
466 struct in6_addr prefix; in dhcp_pd_get_preferred_subnet_prefix() local
478 …cp_pd_calculate_subnet_prefix(pd_prefix, pd_prefix_len, link->network->dhcp_pd_subnet_id, &prefix); in dhcp_pd_get_preferred_subnet_prefix()
484 *ret = prefix; in dhcp_pd_get_preferred_subnet_prefix()
495 r = dhcp_pd_calculate_subnet_prefix(pd_prefix, pd_prefix_len, n, &prefix); in dhcp_pd_get_preferred_subnet_prefix()
506 if (link_get_by_dhcp_pd_subnet_prefix(link->manager, &prefix, &assigned_link) < 0 || in dhcp_pd_get_preferred_subnet_prefix()
511 r = link_add_dhcp_pd_subnet_prefix(link, &prefix); in dhcp_pd_get_preferred_subnet_prefix()
515 *ret = prefix; in dhcp_pd_get_preferred_subnet_prefix()
528 struct in6_addr prefix; in dhcp_pd_assign_subnet_prefix() local
535 r = dhcp_pd_get_preferred_subnet_prefix(link, pd_prefix, pd_prefix_len, &prefix); in dhcp_pd_assign_subnet_prefix()
539 (void) in6_addr_prefix_to_string(&prefix, 64, &buf); in dhcp_pd_assign_subnet_prefix()
545 … r = radv_add_prefix(link, &prefix, 64, lifetime_preferred_usec, lifetime_valid_usec); in dhcp_pd_assign_subnet_prefix()
553 r = dhcp_pd_request_route(link, &prefix, lifetime_valid_usec); in dhcp_pd_assign_subnet_prefix()
559 r = dhcp_pd_request_address(link, &prefix, lifetime_preferred_usec, lifetime_valid_usec); in dhcp_pd_assign_subnet_prefix()
772 static int dhcp_pd_prefix_add(Link *link, const struct in6_addr *prefix, uint8_t prefixlen) { in dhcp_pd_prefix_add() argument
778 assert(prefix); in dhcp_pd_prefix_add()
787 .address.in6 = *prefix, in dhcp_pd_prefix_add()
790 (void) in6_addr_prefix_to_string(prefix, prefixlen, &buf); in dhcp_pd_prefix_add()