]>
Commit | Line | Data |
---|---|---|
db9ecf05 | 1 | /* SPDX-License-Identifier: LGPL-2.1-or-later */ |
091214b6 PF |
2 | #pragma once |
3 | ||
4 | /*** | |
96b2fb93 | 5 | Copyright © 2017 Intel Corporation. All rights reserved. |
091214b6 PF |
6 | ***/ |
7 | ||
d11ba681 | 8 | #include "ndisc-option.h" |
baa3fadf | 9 | #include "networkd-forward.h" |
6e849e95 | 10 | |
ca5ad760 | 11 | typedef enum RADVPrefixDelegation { |
61c0ef4f YW |
12 | RADV_PREFIX_DELEGATION_NONE = 0, |
13 | RADV_PREFIX_DELEGATION_STATIC = 1 << 0, | |
14 | RADV_PREFIX_DELEGATION_DHCP6 = 1 << 1, | |
15 | RADV_PREFIX_DELEGATION_BOTH = RADV_PREFIX_DELEGATION_STATIC | RADV_PREFIX_DELEGATION_DHCP6, | |
ca5ad760 | 16 | _RADV_PREFIX_DELEGATION_MAX, |
2d93c20e | 17 | _RADV_PREFIX_DELEGATION_INVALID = -EINVAL, |
ca5ad760 YW |
18 | } RADVPrefixDelegation; |
19 | ||
b5ce4047 | 20 | typedef struct Prefix { |
6e849e95 | 21 | Network *network; |
307fe3cd | 22 | ConfigSection *section; |
6e849e95 | 23 | |
d11ba681 | 24 | sd_ndisc_prefix prefix; |
2ac41679 | 25 | |
bd6379ec | 26 | bool assign; |
0e1fb1d0 | 27 | uint32_t route_metric; |
e609cd06 | 28 | Set *tokens; |
b5ce4047 | 29 | } Prefix; |
6e849e95 | 30 | |
b5ce4047 | 31 | typedef struct RoutePrefix { |
95081e08 | 32 | Network *network; |
307fe3cd | 33 | ConfigSection *section; |
95081e08 | 34 | |
d11ba681 | 35 | sd_ndisc_route route; |
b5ce4047 | 36 | } RoutePrefix; |
95081e08 | 37 | |
29d9672e | 38 | typedef struct Prefix64 { |
1925f829 SS |
39 | Network *network; |
40 | ConfigSection *section; | |
41 | ||
d11ba681 | 42 | sd_ndisc_prefix64 prefix64; |
29d9672e | 43 | } Prefix64; |
1925f829 | 44 | |
69e0f833 | 45 | void network_adjust_radv(Network *network); |
1a7deb2f | 46 | |
3b6a3bde | 47 | int link_request_radv_addresses(Link *link); |
e14679ff | 48 | int link_reconfigure_radv_address(Address *address, Link *link); |
3b6a3bde | 49 | |
0f96a823 YW |
50 | bool link_radv_enabled(Link *link); |
51 | int radv_start(Link *link); | |
be9363cc | 52 | int radv_update_mac(Link *link); |
1633c457 | 53 | int radv_add_prefix(Link *link, const struct in6_addr *prefix, uint8_t prefix_len, |
16bc8635 | 54 | usec_t lifetime_preferred_usec, usec_t lifetime_valid_usec); |
ca5ad760 | 55 | |
a254fab2 | 56 | int link_request_radv(Link *link); |
451c2baf | 57 | int link_drop_radv_config(Link *link, Network *network); |
a254fab2 | 58 | |
ca5ad760 YW |
59 | const char* radv_prefix_delegation_to_string(RADVPrefixDelegation i) _const_; |
60 | RADVPrefixDelegation radv_prefix_delegation_from_string(const char *s) _pure_; | |
61 | ||
a2106925 | 62 | CONFIG_PARSER_PROTOTYPE(config_parse_router_prefix_delegation); |
4f1ac4a3 | 63 | CONFIG_PARSER_PROTOTYPE(config_parse_router_lifetime); |
59d475ba | 64 | CONFIG_PARSER_PROTOTYPE(config_parse_router_uint32_msec_usec); |
a2106925 LP |
65 | CONFIG_PARSER_PROTOTYPE(config_parse_router_preference); |
66 | CONFIG_PARSER_PROTOTYPE(config_parse_prefix); | |
2ac41679 | 67 | CONFIG_PARSER_PROTOTYPE(config_parse_prefix_boolean); |
a2106925 | 68 | CONFIG_PARSER_PROTOTYPE(config_parse_prefix_lifetime); |
0e1fb1d0 | 69 | CONFIG_PARSER_PROTOTYPE(config_parse_prefix_metric); |
e609cd06 | 70 | CONFIG_PARSER_PROTOTYPE(config_parse_prefix_token); |
ca5ad760 YW |
71 | CONFIG_PARSER_PROTOTYPE(config_parse_radv_dns); |
72 | CONFIG_PARSER_PROTOTYPE(config_parse_radv_search_domains); | |
203d4df5 SS |
73 | CONFIG_PARSER_PROTOTYPE(config_parse_route_prefix); |
74 | CONFIG_PARSER_PROTOTYPE(config_parse_route_prefix_lifetime); | |
fe975384 | 75 | CONFIG_PARSER_PROTOTYPE(config_parse_route_prefix_preference); |
1925f829 SS |
76 | CONFIG_PARSER_PROTOTYPE(config_parse_pref64_prefix); |
77 | CONFIG_PARSER_PROTOTYPE(config_parse_pref64_prefix_lifetime); | |
6a6d27bc | 78 | CONFIG_PARSER_PROTOTYPE(config_parse_router_home_agent_lifetime); |