]>
Commit | Line | Data |
---|---|---|
53e1b683 | 1 | /* SPDX-License-Identifier: LGPL-2.1+ */ |
1e7a0e21 LP |
2 | #pragma once |
3 | ||
e520ce64 | 4 | #include "conf-parser.h" |
50550722 | 5 | #include "networkd-address.h" |
1e7a0e21 | 6 | #include "networkd-link.h" |
50550722 | 7 | #include "networkd-route.h" |
ca78ad1d | 8 | #include "time-util.h" |
1e7a0e21 | 9 | |
5f506a55 SS |
10 | typedef struct IPv6Token IPv6Token; |
11 | ||
12 | typedef enum IPv6TokenAddressGeneration { | |
13 | IPV6_TOKEN_ADDRESS_GENERATION_NONE, | |
e2c4070e | 14 | IPV6_TOKEN_ADDRESS_GENERATION_STATIC, |
5f506a55 SS |
15 | IPV6_TOKEN_ADDRESS_GENERATION_PREFIXSTABLE, |
16 | _IPV6_TOKEN_ADDRESS_GENERATION_MAX, | |
17 | _IPV6_TOKEN_ADDRESS_GENERATION_INVALID = -1, | |
18 | } IPv6TokenAddressGeneration; | |
19 | ||
ac24e418 SS |
20 | typedef enum IPv6AcceptRAStartDHCP6Client { |
21 | IPV6_ACCEPT_RA_START_DHCP6_CLIENT_NO, | |
22 | IPV6_ACCEPT_RA_START_DHCP6_CLIENT_ALWAYS, | |
23 | IPV6_ACCEPT_RA_START_DHCP6_CLIENT_YES, | |
24 | _IPV6_ACCEPT_RA_START_DHCP6_CLIENT_MAX, | |
25 | _IPV6_ACCEPT_RA_START_DHCP6_CLIENT_INVALID = -1, | |
26 | } IPv6AcceptRAStartDHCP6Client; | |
27 | ||
50550722 YW |
28 | typedef struct NDiscAddress { |
29 | /* Used when GC'ing old DNS servers when configuration changes. */ | |
30 | bool marked; | |
31 | struct in6_addr router; | |
32 | Address *address; | |
33 | } NDiscAddress; | |
34 | ||
35 | typedef struct NDiscRoute { | |
36 | /* Used when GC'ing old DNS servers when configuration changes. */ | |
37 | bool marked; | |
38 | struct in6_addr router; | |
39 | Route *route; | |
40 | } NDiscRoute; | |
41 | ||
1e7a0e21 | 42 | typedef struct NDiscRDNSS { |
b0b97766 YW |
43 | /* Used when GC'ing old DNS servers when configuration changes. */ |
44 | bool marked; | |
50550722 | 45 | struct in6_addr router; |
1e7a0e21 LP |
46 | usec_t valid_until; |
47 | struct in6_addr address; | |
48 | } NDiscRDNSS; | |
49 | ||
50 | typedef struct NDiscDNSSL { | |
b0b97766 YW |
51 | /* Used when GC'ing old domains when configuration changes. */ |
52 | bool marked; | |
50550722 | 53 | struct in6_addr router; |
1e7a0e21 LP |
54 | usec_t valid_until; |
55 | /* The domain name follows immediately. */ | |
56 | } NDiscDNSSL; | |
57 | ||
5f506a55 SS |
58 | struct IPv6Token { |
59 | IPv6TokenAddressGeneration address_generation_type; | |
60 | ||
61 | uint8_t dad_counter; | |
62 | struct in6_addr prefix; | |
63 | }; | |
64 | ||
65 | int ipv6token_new(IPv6Token **ret); | |
66 | DEFINE_TRIVIAL_CLEANUP_FUNC(IPv6Token *, freep); | |
67 | ||
1e7a0e21 LP |
68 | static inline char* NDISC_DNSSL_DOMAIN(const NDiscDNSSL *n) { |
69 | return ((char*) n) + ALIGN(sizeof(NDiscDNSSL)); | |
70 | } | |
71 | ||
062c020f YW |
72 | bool link_ipv6_accept_ra_enabled(Link *link); |
73 | ||
3773eb54 YW |
74 | void network_adjust_ipv6_accept_ra(Network *network); |
75 | ||
1e7a0e21 LP |
76 | int ndisc_configure(Link *link); |
77 | void ndisc_vacuum(Link *link); | |
c69305ff | 78 | void ndisc_flush(Link *link); |
e520ce64 | 79 | |
6b000af4 | 80 | CONFIG_PARSER_PROTOTYPE(config_parse_ndisc_deny_listed_prefix); |
5f506a55 | 81 | CONFIG_PARSER_PROTOTYPE(config_parse_address_generation_type); |
ac24e418 SS |
82 | CONFIG_PARSER_PROTOTYPE(config_parse_ipv6_accept_ra_start_dhcp6_client); |
83 | ||
84 | const char* ipv6_accept_ra_start_dhcp6_client_to_string(IPv6AcceptRAStartDHCP6Client i) _const_; | |
85 | IPv6AcceptRAStartDHCP6Client ipv6_accept_ra_start_dhcp6_client_from_string(const char *s) _pure_; |