]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/network/networkd-radv.h
Two follow-ups for recent PRs (#38062)
[thirdparty/systemd.git] / src / network / networkd-radv.h
CommitLineData
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 11typedef 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 20typedef 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 31typedef struct RoutePrefix {
95081e08 32 Network *network;
307fe3cd 33 ConfigSection *section;
95081e08 34
d11ba681 35 sd_ndisc_route route;
b5ce4047 36} RoutePrefix;
95081e08 37
29d9672e 38typedef struct Prefix64 {
1925f829
SS
39 Network *network;
40 ConfigSection *section;
41
d11ba681 42 sd_ndisc_prefix64 prefix64;
29d9672e 43} Prefix64;
1925f829 44
69e0f833 45void network_adjust_radv(Network *network);
1a7deb2f 46
3b6a3bde 47int link_request_radv_addresses(Link *link);
e14679ff 48int link_reconfigure_radv_address(Address *address, Link *link);
3b6a3bde 49
0f96a823
YW
50bool link_radv_enabled(Link *link);
51int radv_start(Link *link);
be9363cc 52int radv_update_mac(Link *link);
1633c457 53int 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 56int link_request_radv(Link *link);
451c2baf 57int link_drop_radv_config(Link *link, Network *network);
a254fab2 58
ca5ad760
YW
59const char* radv_prefix_delegation_to_string(RADVPrefixDelegation i) _const_;
60RADVPrefixDelegation radv_prefix_delegation_from_string(const char *s) _pure_;
61
a2106925 62CONFIG_PARSER_PROTOTYPE(config_parse_router_prefix_delegation);
4f1ac4a3 63CONFIG_PARSER_PROTOTYPE(config_parse_router_lifetime);
59d475ba 64CONFIG_PARSER_PROTOTYPE(config_parse_router_uint32_msec_usec);
a2106925
LP
65CONFIG_PARSER_PROTOTYPE(config_parse_router_preference);
66CONFIG_PARSER_PROTOTYPE(config_parse_prefix);
2ac41679 67CONFIG_PARSER_PROTOTYPE(config_parse_prefix_boolean);
a2106925 68CONFIG_PARSER_PROTOTYPE(config_parse_prefix_lifetime);
0e1fb1d0 69CONFIG_PARSER_PROTOTYPE(config_parse_prefix_metric);
e609cd06 70CONFIG_PARSER_PROTOTYPE(config_parse_prefix_token);
ca5ad760
YW
71CONFIG_PARSER_PROTOTYPE(config_parse_radv_dns);
72CONFIG_PARSER_PROTOTYPE(config_parse_radv_search_domains);
203d4df5
SS
73CONFIG_PARSER_PROTOTYPE(config_parse_route_prefix);
74CONFIG_PARSER_PROTOTYPE(config_parse_route_prefix_lifetime);
fe975384 75CONFIG_PARSER_PROTOTYPE(config_parse_route_prefix_preference);
1925f829
SS
76CONFIG_PARSER_PROTOTYPE(config_parse_pref64_prefix);
77CONFIG_PARSER_PROTOTYPE(config_parse_pref64_prefix_lifetime);
6a6d27bc 78CONFIG_PARSER_PROTOTYPE(config_parse_router_home_agent_lifetime);