| 1 |
/* SPDX-License-Identifier: LGPL-2.1-or-later */ |
| 2 |
#pragma once |
| 3 |
|
| 4 |
#include "in-addr-util.h" |
| 5 |
#include "resolved-forward.h" |
| 6 |
|
| 7 |
typedef struct EtcHosts { |
| 8 |
Hashmap *by_address; |
| 9 |
Hashmap *by_name; |
| 10 |
Set *no_address; |
| 11 |
} EtcHosts; |
| 12 |
|
| 13 |
typedef struct EtcHostsItemByAddress { |
| 14 |
struct in_addr_data address; |
| 15 |
Set *names; |
| 16 |
const char *canonical_name; |
| 17 |
} EtcHostsItemByAddress; |
| 18 |
|
| 19 |
typedef struct EtcHostsItemByName { |
| 20 |
char *name; |
| 21 |
Set *addresses; |
| 22 |
} EtcHostsItemByName; |
| 23 |
|
| 24 |
int etc_hosts_parse(EtcHosts *hosts, FILE *f); |
| 25 |
void etc_hosts_clear(EtcHosts *hosts); |
| 26 |
|
| 27 |
void manager_etc_hosts_flush(Manager *m); |
| 28 |
int manager_etc_hosts_lookup(Manager *m, DnsQuestion* q, DnsAnswer **answer); |