Lines Matching refs:p
181 Prefix *p; in link_request_radv_addresses() local
189 HASHMAP_FOREACH(p, link->network->prefixes_by_section) { in link_request_radv_addresses()
193 if (!p->assign) in link_request_radv_addresses()
197 if (p->prefixlen > 64) in link_request_radv_addresses()
200 r = radv_generate_addresses(link, p->tokens, &p->prefix, p->prefixlen, &addresses); in link_request_radv_addresses()
214 address->prefixlen = p->prefixlen; in link_request_radv_addresses()
215 address->route_metric = p->route_metric; in link_request_radv_addresses()
240 _cleanup_(sd_radv_prefix_unrefp) sd_radv_prefix *p = NULL; in radv_set_prefix()
247 r = sd_radv_prefix_new(&p); 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()
271 return sd_radv_add_prefix(link->radv, p); in radv_set_prefix()
275 _cleanup_(sd_radv_route_prefix_unrefp) sd_radv_route_prefix *p = NULL; in radv_set_route_prefix()
282 r = sd_radv_route_prefix_new(&p); 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()
294 return sd_radv_add_route_prefix(link->radv, p); in radv_set_route_prefix()
339 struct in6_addr *p; in radv_set_dns() local
345 p = dns; in radv_set_dns()
349 *(p++) = link->ipv6ll_address; in radv_set_dns()
351 *(p++) = link->network->router_dns[i]; in radv_set_dns()
353 n_dns = p - dns; in radv_set_dns()
444 Prefix *p; in radv_configure() local
487 HASHMAP_FOREACH(p, link->network->prefixes_by_section) { in radv_configure()
488 r = radv_set_prefix(link, p); in radv_configure()
663 _cleanup_(sd_radv_prefix_unrefp) sd_radv_prefix *p = NULL; in radv_add_prefix()
671 r = sd_radv_prefix_new(&p); in radv_add_prefix()
675 r = sd_radv_prefix_set_prefix(p, prefix, prefix_len); in radv_add_prefix()
679 …r = sd_radv_prefix_set_preferred_lifetime(p, RADV_DEFAULT_PREFERRED_LIFETIME_USEC, lifetime_prefer… in radv_add_prefix()
683 … r = sd_radv_prefix_set_valid_lifetime(p, RADV_DEFAULT_VALID_LIFETIME_USEC, lifetime_valid_usec); in radv_add_prefix()
687 r = sd_radv_add_prefix(link->radv, p); in radv_add_prefix()
694 static int prefix_section_verify(Prefix *p) { in prefix_section_verify() argument
695 assert(p); in prefix_section_verify()
697 if (section_is_invalid(p->section)) in prefix_section_verify()
700 if (in6_addr_is_null(&p->prefix)) in prefix_section_verify()
705 p->section->filename, p->section->line); in prefix_section_verify()
707 if (p->prefixlen < 3 || p->prefixlen > 128) in prefix_section_verify()
711 p->section->filename, p->prefixlen, p->section->line); in prefix_section_verify()
713 if (p->prefixlen > 64) { in prefix_section_verify()
716 if (p->assign) in prefix_section_verify()
717 (void) in6_addr_prefix_to_string(&p->prefix, p->prefixlen, &str); in prefix_section_verify()
720 p->section->filename, p->prefixlen, p->section->line, in prefix_section_verify()
721 p->assign ? ", refusing to assign an address in " : "", in prefix_section_verify()
722 p->assign ? strna(str) : ""); in prefix_section_verify()
724 p->assign = false; in prefix_section_verify()
727 if (p->valid_lifetime == 0) in prefix_section_verify()
731 p->section->filename, p->section->line); in prefix_section_verify()
733 if (p->preferred_lifetime > p->valid_lifetime) in prefix_section_verify()
737 p->section->filename, in prefix_section_verify()
738 FORMAT_TIMESPAN(p->preferred_lifetime, USEC_PER_SEC), in prefix_section_verify()
739 FORMAT_TIMESPAN(p->valid_lifetime, USEC_PER_SEC), in prefix_section_verify()
740 p->section->line); in prefix_section_verify()
746 Prefix *p; in network_drop_invalid_prefixes() local
750 HASHMAP_FOREACH(p, network->prefixes_by_section) in network_drop_invalid_prefixes()
751 if (prefix_section_verify(p) < 0) in network_drop_invalid_prefixes()
752 prefix_free(p); in network_drop_invalid_prefixes()
755 static int route_prefix_section_verify(RoutePrefix *p) { in route_prefix_section_verify() argument
756 if (section_is_invalid(p->section)) in route_prefix_section_verify()
759 if (p->prefixlen > 128) in route_prefix_section_verify()
763 p->section->filename, p->prefixlen, p->section->line); in route_prefix_section_verify()
765 if (p->lifetime == 0) in route_prefix_section_verify()
769 p->section->filename, p->section->line); in route_prefix_section_verify()
775 RoutePrefix *p; in network_drop_invalid_route_prefixes() local
779 HASHMAP_FOREACH(p, network->route_prefixes_by_section) in network_drop_invalid_route_prefixes()
780 if (route_prefix_section_verify(p) < 0) in network_drop_invalid_route_prefixes()
781 route_prefix_free(p); in network_drop_invalid_route_prefixes()
796 _cleanup_(prefix_free_or_set_invalidp) Prefix *p = NULL; in config_parse_prefix()
807 r = prefix_new_static(network, filename, section_line, &p); in config_parse_prefix()
811 r = in_addr_prefix_from_string(rvalue, AF_INET6, &a, &p->prefixlen); in config_parse_prefix()
818 (void) in6_addr_mask(&a.in6, p->prefixlen); in config_parse_prefix()
819 p->prefix = a.in6; in config_parse_prefix()
821 TAKE_PTR(p); in config_parse_prefix()
837 _cleanup_(prefix_free_or_set_invalidp) Prefix *p = NULL; in config_parse_prefix_boolean()
847 r = prefix_new_static(network, filename, section_line, &p); in config_parse_prefix_boolean()
859 p->onlink = r; in config_parse_prefix_boolean()
861 p->address_auto_configuration = r; in config_parse_prefix_boolean()
863 p->assign = r; in config_parse_prefix_boolean()
867 TAKE_PTR(p); in config_parse_prefix_boolean()
883 _cleanup_(prefix_free_or_set_invalidp) Prefix *p = NULL; in config_parse_prefix_lifetime()
894 r = prefix_new_static(network, filename, section_line, &p); in config_parse_prefix_lifetime()
912 p->preferred_lifetime = usec; in config_parse_prefix_lifetime()
914 p->valid_lifetime = usec; in config_parse_prefix_lifetime()
918 TAKE_PTR(p); in config_parse_prefix_lifetime()
934 _cleanup_(prefix_free_or_set_invalidp) Prefix *p = NULL; in config_parse_prefix_metric()
944 r = prefix_new_static(network, filename, section_line, &p); in config_parse_prefix_metric()
948 r = safe_atou32(rvalue, &p->route_metric); in config_parse_prefix_metric()
956 TAKE_PTR(p); in config_parse_prefix_metric()
972 _cleanup_(prefix_free_or_set_invalidp) Prefix *p = NULL; in config_parse_prefix_token()
982 r = prefix_new_static(network, filename, section_line, &p); in config_parse_prefix_token()
987 lvalue, ltype, rvalue, &p->tokens, userdata); in config_parse_prefix_token()
991 TAKE_PTR(p); in config_parse_prefix_token()
1007 _cleanup_(route_prefix_free_or_set_invalidp) RoutePrefix *p = NULL; in config_parse_route_prefix()
1018 r = route_prefix_new_static(network, filename, section_line, &p); in config_parse_route_prefix()
1022 r = in_addr_prefix_from_string(rvalue, AF_INET6, &a, &p->prefixlen); in config_parse_route_prefix()
1029 (void) in6_addr_mask(&a.in6, p->prefixlen); in config_parse_route_prefix()
1030 p->prefix = a.in6; in config_parse_route_prefix()
1032 TAKE_PTR(p); in config_parse_route_prefix()
1048 _cleanup_(route_prefix_free_or_set_invalidp) RoutePrefix *p = NULL; in config_parse_route_prefix_lifetime()
1059 r = route_prefix_new_static(network, filename, section_line, &p); in config_parse_route_prefix_lifetime()
1076 p->lifetime = usec; in config_parse_route_prefix_lifetime()
1078 TAKE_PTR(p); in config_parse_route_prefix_lifetime()
1107 for (const char *p = rvalue;;) { in config_parse_radv_dns() local
1111 r = extract_first_word(&p, &w, NULL, 0); in config_parse_radv_dns()
1173 for (const char *p = rvalue;;) { in config_parse_radv_search_domains() local
1176 r = extract_first_word(&p, &w, NULL, 0); in config_parse_radv_search_domains()