Lines Matching refs:prefix
66 Prefix *prefix_free(Prefix *prefix) { in prefix_free() argument
67 if (!prefix) in prefix_free()
70 if (prefix->network) { in prefix_free()
71 assert(prefix->section); in prefix_free()
72 hashmap_remove(prefix->network->prefixes_by_section, prefix->section); in prefix_free()
75 config_section_free(prefix->section); in prefix_free()
76 set_free(prefix->tokens); in prefix_free()
78 return mfree(prefix); in prefix_free()
85 _cleanup_(prefix_freep) Prefix *prefix = NULL; in prefix_new_static()
97 prefix = hashmap_get(network->prefixes_by_section, n); in prefix_new_static()
98 if (prefix) { in prefix_new_static()
99 *ret = TAKE_PTR(prefix); in prefix_new_static()
103 prefix = new(Prefix, 1); in prefix_new_static()
104 if (!prefix) in prefix_new_static()
107 *prefix = (Prefix) { in prefix_new_static()
117 …shmap_ensure_put(&network->prefixes_by_section, &config_section_hash_ops, prefix->section, prefix); in prefix_new_static()
121 *ret = TAKE_PTR(prefix); in prefix_new_static()
125 RoutePrefix *route_prefix_free(RoutePrefix *prefix) { in route_prefix_free() argument
126 if (!prefix) in route_prefix_free()
129 if (prefix->network) { in route_prefix_free()
130 assert(prefix->section); in route_prefix_free()
131 hashmap_remove(prefix->network->route_prefixes_by_section, prefix->section); in route_prefix_free()
134 config_section_free(prefix->section); in route_prefix_free()
136 return mfree(prefix); in route_prefix_free()
143 _cleanup_(route_prefix_freep) RoutePrefix *prefix = NULL; in route_prefix_new_static()
155 prefix = hashmap_get(network->route_prefixes_by_section, n); in route_prefix_new_static()
156 if (prefix) { in route_prefix_new_static()
157 *ret = TAKE_PTR(prefix); in route_prefix_new_static()
161 prefix = new(RoutePrefix, 1); in route_prefix_new_static()
162 if (!prefix) in route_prefix_new_static()
165 *prefix = (RoutePrefix) { in route_prefix_new_static()
172 …ensure_put(&network->route_prefixes_by_section, &config_section_hash_ops, prefix->section, prefix); in route_prefix_new_static()
176 *ret = TAKE_PTR(prefix); in route_prefix_new_static()
200 r = radv_generate_addresses(link, p->tokens, &p->prefix, p->prefixlen, &addresses); in link_request_radv_addresses()
239 static int radv_set_prefix(Link *link, Prefix *prefix) { in radv_set_prefix() argument
245 assert(prefix); in radv_set_prefix()
251 r = sd_radv_prefix_set_prefix(p, &prefix->prefix, prefix->prefixlen); in radv_set_prefix()
255 r = sd_radv_prefix_set_preferred_lifetime(p, prefix->preferred_lifetime, USEC_INFINITY); in radv_set_prefix()
259 r = sd_radv_prefix_set_valid_lifetime(p, prefix->valid_lifetime, USEC_INFINITY); in radv_set_prefix()
263 r = sd_radv_prefix_set_onlink(p, prefix->onlink); in radv_set_prefix()
267 r = sd_radv_prefix_set_address_autoconfiguration(p, prefix->address_auto_configuration); in radv_set_prefix()
274 static int radv_set_route_prefix(Link *link, RoutePrefix *prefix) { in radv_set_route_prefix() argument
280 assert(prefix); in radv_set_route_prefix()
286 r = sd_radv_route_prefix_set_prefix(p, &prefix->prefix, prefix->prefixlen); in radv_set_route_prefix()
290 r = sd_radv_route_prefix_set_lifetime(p, prefix->lifetime, USEC_INFINITY); in radv_set_route_prefix()
658 const struct in6_addr *prefix, in radv_add_prefix() argument
675 r = sd_radv_prefix_set_prefix(p, prefix, prefix_len); in radv_add_prefix()
700 if (in6_addr_is_null(&p->prefix)) in prefix_section_verify()
717 (void) in6_addr_prefix_to_string(&p->prefix, p->prefixlen, &str); in prefix_section_verify()
819 p->prefix = a.in6; in config_parse_prefix()
1030 p->prefix = a.in6; in config_parse_route_prefix()