]>
Commit | Line | Data |
---|---|---|
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 |
13 | typedef struct Prefix Prefix; |
14 | ||
ca5ad760 YW |
15 | typedef 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 |
24 | struct Prefix { |
25 | Network *network; | |
26 | NetworkConfigSection *section; | |
27 | ||
28 | sd_radv_prefix *radv_prefix; | |
29 | ||
30 | LIST_FIELDS(Prefix, prefixes); | |
31 | }; | |
32 | ||
33 | int prefix_new(Prefix **ret); | |
34 | void prefix_free(Prefix *prefix); | |
6e849e95 | 35 | |
fcbf4cb7 | 36 | DEFINE_NETWORK_SECTION_FUNCTIONS(Prefix, prefix_free); |
6e849e95 | 37 | |
ca5ad760 YW |
38 | int radv_emit_dns(Link *link); |
39 | int radv_configure(Link *link); | |
40 | ||
41 | const char* radv_prefix_delegation_to_string(RADVPrefixDelegation i) _const_; | |
42 | RADVPrefixDelegation radv_prefix_delegation_from_string(const char *s) _pure_; | |
43 | ||
a2106925 LP |
44 | CONFIG_PARSER_PROTOTYPE(config_parse_router_prefix_delegation); |
45 | CONFIG_PARSER_PROTOTYPE(config_parse_router_preference); | |
46 | CONFIG_PARSER_PROTOTYPE(config_parse_prefix); | |
47 | CONFIG_PARSER_PROTOTYPE(config_parse_prefix_flags); | |
48 | CONFIG_PARSER_PROTOTYPE(config_parse_prefix_lifetime); | |
ca5ad760 YW |
49 | CONFIG_PARSER_PROTOTYPE(config_parse_radv_dns); |
50 | CONFIG_PARSER_PROTOTYPE(config_parse_radv_search_domains); |