]>
Commit | Line | Data |
---|---|---|
53e1b683 | 1 | /* SPDX-License-Identifier: LGPL-2.1+ */ |
b30bf55d LP |
2 | #pragma once |
3 | ||
ae8f0ec3 LP |
4 | #include "hash-funcs.h" |
5 | ||
6 | typedef struct DnsStubListenerExtra DnsStubListenerExtra; | |
7 | ||
8 | typedef enum DnsStubListenerMode { | |
9 | DNS_STUB_LISTENER_NO, | |
10 | DNS_STUB_LISTENER_UDP = 1 << 0, | |
11 | DNS_STUB_LISTENER_TCP = 1 << 1, | |
12 | DNS_STUB_LISTENER_YES = DNS_STUB_LISTENER_UDP | DNS_STUB_LISTENER_TCP, | |
13 | _DNS_STUB_LISTENER_MODE_MAX, | |
14 | _DNS_STUB_LISTENER_MODE_INVALID = -1 | |
15 | } DnsStubListenerMode; | |
16 | ||
b30bf55d LP |
17 | #include "resolved-manager.h" |
18 | ||
ae8f0ec3 | 19 | struct DnsStubListenerExtra { |
0354029b LP |
20 | Manager *manager; |
21 | ||
ae8f0ec3 LP |
22 | DnsStubListenerMode mode; |
23 | ||
24 | int family; | |
25 | union in_addr_union address; | |
26 | uint16_t port; | |
27 | ||
28 | sd_event_source *udp_event_source; | |
29 | sd_event_source *tcp_event_source; | |
30 | }; | |
31 | ||
32 | extern const struct hash_ops dns_stub_listener_extra_hash_ops; | |
33 | ||
0354029b | 34 | int dns_stub_listener_extra_new(Manager *m, DnsStubListenerExtra **ret); |
36aaabc3 | 35 | DnsStubListenerExtra *dns_stub_listener_extra_free(DnsStubListenerExtra *p); |
1f05101f | 36 | |
b30bf55d LP |
37 | void manager_dns_stub_stop(Manager *m); |
38 | int manager_dns_stub_start(Manager *m); | |
ae8f0ec3 LP |
39 | |
40 | const char* dns_stub_listener_mode_to_string(DnsStubListenerMode p) _const_; | |
41 | DnsStubListenerMode dns_stub_listener_mode_from_string(const char *s) _pure_; |