]> git.ipfire.org Git - thirdparty/systemd.git/blame_incremental - src/network/networkd-radv.h
build(deps): bump github/codeql-action from 3.28.18 to 3.29.2
[thirdparty/systemd.git] / src / network / networkd-radv.h
... / ...
CommitLineData
1/* SPDX-License-Identifier: LGPL-2.1-or-later */
2#pragma once
3
4/***
5 Copyright © 2017 Intel Corporation. All rights reserved.
6***/
7
8#include "ndisc-option.h"
9#include "networkd-forward.h"
10
11typedef enum RADVPrefixDelegation {
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,
16 _RADV_PREFIX_DELEGATION_MAX,
17 _RADV_PREFIX_DELEGATION_INVALID = -EINVAL,
18} RADVPrefixDelegation;
19
20typedef struct Prefix {
21 Network *network;
22 ConfigSection *section;
23
24 sd_ndisc_prefix prefix;
25
26 bool assign;
27 uint32_t route_metric;
28 Set *tokens;
29} Prefix;
30
31typedef struct RoutePrefix {
32 Network *network;
33 ConfigSection *section;
34
35 sd_ndisc_route route;
36} RoutePrefix;
37
38typedef struct Prefix64 {
39 Network *network;
40 ConfigSection *section;
41
42 sd_ndisc_prefix64 prefix64;
43} Prefix64;
44
45void network_adjust_radv(Network *network);
46
47int link_request_radv_addresses(Link *link);
48int link_reconfigure_radv_address(Address *address, Link *link);
49
50bool link_radv_enabled(Link *link);
51int radv_start(Link *link);
52int radv_update_mac(Link *link);
53int radv_add_prefix(Link *link, const struct in6_addr *prefix, uint8_t prefix_len,
54 usec_t lifetime_preferred_usec, usec_t lifetime_valid_usec);
55
56int link_request_radv(Link *link);
57int link_drop_radv_config(Link *link, Network *network);
58
59const char* radv_prefix_delegation_to_string(RADVPrefixDelegation i) _const_;
60RADVPrefixDelegation radv_prefix_delegation_from_string(const char *s) _pure_;
61
62CONFIG_PARSER_PROTOTYPE(config_parse_router_prefix_delegation);
63CONFIG_PARSER_PROTOTYPE(config_parse_router_lifetime);
64CONFIG_PARSER_PROTOTYPE(config_parse_router_uint32_msec_usec);
65CONFIG_PARSER_PROTOTYPE(config_parse_router_preference);
66CONFIG_PARSER_PROTOTYPE(config_parse_prefix);
67CONFIG_PARSER_PROTOTYPE(config_parse_prefix_boolean);
68CONFIG_PARSER_PROTOTYPE(config_parse_prefix_lifetime);
69CONFIG_PARSER_PROTOTYPE(config_parse_prefix_metric);
70CONFIG_PARSER_PROTOTYPE(config_parse_prefix_token);
71CONFIG_PARSER_PROTOTYPE(config_parse_radv_dns);
72CONFIG_PARSER_PROTOTYPE(config_parse_radv_search_domains);
73CONFIG_PARSER_PROTOTYPE(config_parse_route_prefix);
74CONFIG_PARSER_PROTOTYPE(config_parse_route_prefix_lifetime);
75CONFIG_PARSER_PROTOTYPE(config_parse_route_prefix_preference);
76CONFIG_PARSER_PROTOTYPE(config_parse_pref64_prefix);
77CONFIG_PARSER_PROTOTYPE(config_parse_pref64_prefix_lifetime);
78CONFIG_PARSER_PROTOTYPE(config_parse_router_home_agent_lifetime);