Lines Matching refs:item
21 static void etc_hosts_item_free(EtcHostsItem *item) { in etc_hosts_item_free() argument
22 strv_free(item->names); in etc_hosts_item_free()
23 free(item); in etc_hosts_item_free()
26 static void etc_hosts_item_by_name_free(EtcHostsItemByName *item) { in etc_hosts_item_by_name_free() argument
27 free(item->name); in etc_hosts_item_by_name_free()
28 free(item->addresses); in etc_hosts_item_by_name_free()
29 free(item); in etc_hosts_item_by_name_free()
47 EtcHostsItem *item; in parse_line() local
72 item = NULL; in parse_line()
76 item = hashmap_get(hosts->by_address, &address); in parse_line()
77 if (!item) { in parse_line()
82 item = new(EtcHostsItem, 1); in parse_line()
83 if (!item) in parse_line()
86 *item = (EtcHostsItem) { in parse_line()
90 r = hashmap_put(hosts->by_address, &item->address, item); in parse_line()
92 free(item); in parse_line()
119 if (!item) { in parse_line()
130 r = strv_extend(&item->names, name); in parse_line()
156 bn->addresses[bn->n_addresses++] = &item->address; in parse_line()
182 EtcHostsItem *item; in strip_localhost() local
196 item = hashmap_get(hosts->by_address, local_in_addrs + j); in strip_localhost()
197 if (!item) in strip_localhost()
202 STRV_FOREACH(i, item->names) in strip_localhost()
214 STRV_FOREACH(i, item->names) { in strip_localhost()
240 STRV_FOREACH(i, item->names) { in strip_localhost()
248 assert_se(hashmap_remove(hosts->by_address, local_in_addrs + j) == item); in strip_localhost()
249 etc_hosts_item_free(item); in strip_localhost()
368 EtcHostsItem *item; in manager_etc_hosts_lookup() local
371 item = hashmap_get(m->etc_hosts.by_address, &k); in manager_etc_hosts_lookup()
372 if (!item) in manager_etc_hosts_lookup()
394 r = dns_answer_reserve(answer, strv_length(item->names)); in manager_etc_hosts_lookup()
398 STRV_FOREACH(n, item->names) { in manager_etc_hosts_lookup()