]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/network/networkd-radv.h
Merge pull request #13939 from yuwata/network-fix-memleak-and-13938
[thirdparty/systemd.git] / src / network / networkd-radv.h
CommitLineData
53e1b683 1/* SPDX-License-Identifier: LGPL-2.1+ */
091214b6
PF
2#pragma once
3
4/***
96b2fb93 5 Copyright © 2017 Intel Corporation. All rights reserved.
091214b6
PF
6***/
7
a2106925 8#include "conf-parser.h"
6e849e95 9#include "networkd-address.h"
091214b6 10#include "networkd-link.h"
fcbf4cb7 11#include "networkd-util.h"
091214b6 12
6e849e95
PF
13typedef struct Prefix Prefix;
14
ca5ad760
YW
15typedef enum RADVPrefixDelegation {
16 RADV_PREFIX_DELEGATION_NONE,
17 RADV_PREFIX_DELEGATION_STATIC,
18 RADV_PREFIX_DELEGATION_DHCP6,
19 RADV_PREFIX_DELEGATION_BOTH,
20 _RADV_PREFIX_DELEGATION_MAX,
21 _RADV_PREFIX_DELEGATION_INVALID = -1,
22} RADVPrefixDelegation;
23
6e849e95
PF
24struct Prefix {
25 Network *network;
26 NetworkConfigSection *section;
27
28 sd_radv_prefix *radv_prefix;
203d4df5 29 sd_radv_route_prefix *radv_route_prefix;
6e849e95
PF
30
31 LIST_FIELDS(Prefix, prefixes);
203d4df5 32 LIST_FIELDS(Prefix, route_prefixes);
6e849e95
PF
33};
34
35int prefix_new(Prefix **ret);
36void prefix_free(Prefix *prefix);
6e849e95 37
fcbf4cb7 38DEFINE_NETWORK_SECTION_FUNCTIONS(Prefix, prefix_free);
6e849e95 39
203d4df5
SS
40int route_prefix_new(Prefix **ret);
41void route_prefix_free(Prefix *prefix);
42
43DEFINE_NETWORK_SECTION_FUNCTIONS(Prefix, route_prefix_free);
44
ca5ad760
YW
45int radv_emit_dns(Link *link);
46int radv_configure(Link *link);
47
48const char* radv_prefix_delegation_to_string(RADVPrefixDelegation i) _const_;
49RADVPrefixDelegation radv_prefix_delegation_from_string(const char *s) _pure_;
50
a2106925
LP
51CONFIG_PARSER_PROTOTYPE(config_parse_router_prefix_delegation);
52CONFIG_PARSER_PROTOTYPE(config_parse_router_preference);
53CONFIG_PARSER_PROTOTYPE(config_parse_prefix);
54CONFIG_PARSER_PROTOTYPE(config_parse_prefix_flags);
55CONFIG_PARSER_PROTOTYPE(config_parse_prefix_lifetime);
ca5ad760
YW
56CONFIG_PARSER_PROTOTYPE(config_parse_radv_dns);
57CONFIG_PARSER_PROTOTYPE(config_parse_radv_search_domains);
203d4df5
SS
58CONFIG_PARSER_PROTOTYPE(config_parse_route_prefix);
59CONFIG_PARSER_PROTOTYPE(config_parse_route_prefix_lifetime);