]>
Commit | Line | Data |
---|---|---|
53e1b683 | 1 | /* SPDX-License-Identifier: LGPL-2.1+ */ |
1e7a0e21 LP |
2 | #pragma once |
3 | ||
e520ce64 | 4 | #include "conf-parser.h" |
1e7a0e21 | 5 | #include "networkd-link.h" |
ca78ad1d | 6 | #include "time-util.h" |
1e7a0e21 | 7 | |
5f506a55 SS |
8 | typedef struct IPv6Token IPv6Token; |
9 | ||
10 | typedef enum IPv6TokenAddressGeneration { | |
11 | IPV6_TOKEN_ADDRESS_GENERATION_NONE, | |
e2c4070e | 12 | IPV6_TOKEN_ADDRESS_GENERATION_STATIC, |
5f506a55 SS |
13 | IPV6_TOKEN_ADDRESS_GENERATION_PREFIXSTABLE, |
14 | _IPV6_TOKEN_ADDRESS_GENERATION_MAX, | |
15 | _IPV6_TOKEN_ADDRESS_GENERATION_INVALID = -1, | |
16 | } IPv6TokenAddressGeneration; | |
17 | ||
ac24e418 SS |
18 | typedef enum IPv6AcceptRAStartDHCP6Client { |
19 | IPV6_ACCEPT_RA_START_DHCP6_CLIENT_NO, | |
20 | IPV6_ACCEPT_RA_START_DHCP6_CLIENT_ALWAYS, | |
21 | IPV6_ACCEPT_RA_START_DHCP6_CLIENT_YES, | |
22 | _IPV6_ACCEPT_RA_START_DHCP6_CLIENT_MAX, | |
23 | _IPV6_ACCEPT_RA_START_DHCP6_CLIENT_INVALID = -1, | |
24 | } IPv6AcceptRAStartDHCP6Client; | |
25 | ||
1e7a0e21 LP |
26 | typedef struct NDiscRDNSS { |
27 | usec_t valid_until; | |
28 | struct in6_addr address; | |
29 | } NDiscRDNSS; | |
30 | ||
31 | typedef struct NDiscDNSSL { | |
32 | usec_t valid_until; | |
33 | /* The domain name follows immediately. */ | |
34 | } NDiscDNSSL; | |
35 | ||
5f506a55 SS |
36 | struct IPv6Token { |
37 | IPv6TokenAddressGeneration address_generation_type; | |
38 | ||
39 | uint8_t dad_counter; | |
40 | struct in6_addr prefix; | |
41 | }; | |
42 | ||
43 | int ipv6token_new(IPv6Token **ret); | |
44 | DEFINE_TRIVIAL_CLEANUP_FUNC(IPv6Token *, freep); | |
45 | ||
1e7a0e21 LP |
46 | static inline char* NDISC_DNSSL_DOMAIN(const NDiscDNSSL *n) { |
47 | return ((char*) n) + ALIGN(sizeof(NDiscDNSSL)); | |
48 | } | |
49 | ||
50 | int ndisc_configure(Link *link); | |
51 | void ndisc_vacuum(Link *link); | |
c69305ff | 52 | void ndisc_flush(Link *link); |
e520ce64 | 53 | |
6b000af4 | 54 | CONFIG_PARSER_PROTOTYPE(config_parse_ndisc_deny_listed_prefix); |
5f506a55 | 55 | CONFIG_PARSER_PROTOTYPE(config_parse_address_generation_type); |
ac24e418 SS |
56 | CONFIG_PARSER_PROTOTYPE(config_parse_ipv6_accept_ra_start_dhcp6_client); |
57 | ||
58 | const char* ipv6_accept_ra_start_dhcp6_client_to_string(IPv6AcceptRAStartDHCP6Client i) _const_; | |
59 | IPv6AcceptRAStartDHCP6Client ipv6_accept_ra_start_dhcp6_client_from_string(const char *s) _pure_; |