]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/network/networkd-radv.h
network: rename settings about DHCPv6 Prefix Delegation
[thirdparty/systemd.git] / src / network / networkd-radv.h
1 /* SPDX-License-Identifier: LGPL-2.1+ */
2 #pragma once
3
4 /***
5 Copyright © 2017 Intel Corporation. All rights reserved.
6 ***/
7
8 #include "conf-parser.h"
9 #include "networkd-address.h"
10 #include "networkd-link.h"
11 #include "networkd-util.h"
12
13 typedef struct Prefix Prefix;
14 typedef struct RoutePrefix RoutePrefix;
15
16 typedef enum RADVPrefixDelegation {
17 RADV_PREFIX_DELEGATION_NONE = 0,
18 RADV_PREFIX_DELEGATION_STATIC = 1 << 0,
19 RADV_PREFIX_DELEGATION_DHCP6 = 1 << 1,
20 RADV_PREFIX_DELEGATION_BOTH = RADV_PREFIX_DELEGATION_STATIC | RADV_PREFIX_DELEGATION_DHCP6,
21 _RADV_PREFIX_DELEGATION_MAX,
22 _RADV_PREFIX_DELEGATION_INVALID = -1,
23 } RADVPrefixDelegation;
24
25 struct Prefix {
26 Network *network;
27 NetworkConfigSection *section;
28
29 sd_radv_prefix *radv_prefix;
30
31 bool assign;
32
33 LIST_FIELDS(Prefix, prefixes);
34 };
35
36 struct RoutePrefix {
37 Network *network;
38 NetworkConfigSection *section;
39
40 sd_radv_route_prefix *radv_route_prefix;
41
42 LIST_FIELDS(RoutePrefix, route_prefixes);
43 };
44
45 void prefix_free(Prefix *prefix);
46
47 DEFINE_NETWORK_SECTION_FUNCTIONS(Prefix, prefix_free);
48
49 void route_prefix_free(RoutePrefix *prefix);
50
51 DEFINE_NETWORK_SECTION_FUNCTIONS(RoutePrefix, route_prefix_free);
52
53 int radv_emit_dns(Link *link);
54 int radv_configure(Link *link);
55 int radv_add_prefix(Link *link, const struct in6_addr *prefix, uint8_t prefix_len,
56 uint32_t lifetime_preferred, uint32_t lifetime_valid);
57
58 const char* radv_prefix_delegation_to_string(RADVPrefixDelegation i) _const_;
59 RADVPrefixDelegation radv_prefix_delegation_from_string(const char *s) _pure_;
60
61 CONFIG_PARSER_PROTOTYPE(config_parse_router_prefix_delegation);
62 CONFIG_PARSER_PROTOTYPE(config_parse_router_preference);
63 CONFIG_PARSER_PROTOTYPE(config_parse_prefix);
64 CONFIG_PARSER_PROTOTYPE(config_parse_prefix_flags);
65 CONFIG_PARSER_PROTOTYPE(config_parse_prefix_lifetime);
66 CONFIG_PARSER_PROTOTYPE(config_parse_prefix_assign);
67 CONFIG_PARSER_PROTOTYPE(config_parse_radv_dns);
68 CONFIG_PARSER_PROTOTYPE(config_parse_radv_search_domains);
69 CONFIG_PARSER_PROTOTYPE(config_parse_route_prefix);
70 CONFIG_PARSER_PROTOTYPE(config_parse_route_prefix_lifetime);