Lines Matching refs:label
15 AddressLabel *address_label_free(AddressLabel *label) { in address_label_free() argument
16 if (!label) in address_label_free()
19 if (label->network) { in address_label_free()
20 assert(label->section); in address_label_free()
21 hashmap_remove(label->network->address_labels_by_section, label->section); in address_label_free()
24 config_section_free(label->section); in address_label_free()
25 return mfree(label); in address_label_free()
32 _cleanup_(address_label_freep) AddressLabel *label = NULL; in address_label_new_static()
44 label = hashmap_get(network->address_labels_by_section, n); in address_label_new_static()
45 if (label) { in address_label_new_static()
46 *ret = TAKE_PTR(label); in address_label_new_static()
50 label = new(AddressLabel, 1); in address_label_new_static()
51 if (!label) in address_label_new_static()
54 *label = (AddressLabel) { in address_label_new_static()
57 .label = UINT32_MAX, in address_label_new_static()
60 …p_ensure_put(&network->address_labels_by_section, &config_section_hash_ops, label->section, label); in address_label_new_static()
64 *ret = TAKE_PTR(label); in address_label_new_static()
96 static int address_label_configure(AddressLabel *label, Link *link, Request *req) { in address_label_configure() argument
100 assert(label); in address_label_configure()
112 r = sd_rtnl_message_addrlabel_set_prefixlen(m, label->prefixlen); in address_label_configure()
116 r = sd_netlink_message_append_u32(m, IFAL_LABEL, label->label); in address_label_configure()
120 r = sd_netlink_message_append_in6_addr(m, IFA_ADDRESS, &label->prefix); in address_label_configure()
128 AddressLabel *label = ASSERT_PTR(userdata); in address_label_process_request() local
137 r = address_label_configure(label, link, req); in address_label_process_request()
145 AddressLabel *label; in link_request_static_address_labels() local
153 HASHMAP_FOREACH(label, link->network->address_labels_by_section) { in link_request_static_address_labels()
155 label, NULL, trivial_hash_func, trivial_compare_func, in link_request_static_address_labels()
174 static int address_label_section_verify(AddressLabel *label) { in address_label_section_verify() argument
175 assert(label); in address_label_section_verify()
176 assert(label->section); in address_label_section_verify()
178 if (section_is_invalid(label->section)) in address_label_section_verify()
181 if (!label->prefix_set) in address_label_section_verify()
185 label->section->filename, label->section->line); in address_label_section_verify()
187 if (label->label == UINT32_MAX) in address_label_section_verify()
191 label->section->filename, label->section->line); in address_label_section_verify()
197 AddressLabel *label; in network_drop_invalid_address_labels() local
201 HASHMAP_FOREACH(label, network->address_labels_by_section) in network_drop_invalid_address_labels()
202 if (address_label_section_verify(label) < 0) in network_drop_invalid_address_labels()
203 address_label_free(label); in network_drop_invalid_address_labels()
294 n->label = k; in config_parse_address_label()