1 /* SPDX-License-Identifier: LGPL-2.1+ */
5 Copyright © 2017 Intel Corporation. All rights reserved.
8 #include "conf-parser.h"
9 #include "networkd-address.h"
10 #include "networkd-link.h"
11 #include "networkd-util.h"
13 typedef struct Prefix Prefix
;
14 typedef struct RoutePrefix RoutePrefix
;
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
;
27 NetworkConfigSection
*section
;
29 sd_radv_prefix
*radv_prefix
;
36 NetworkConfigSection
*section
;
38 sd_radv_route_prefix
*radv_route_prefix
;
41 Prefix
*prefix_free(Prefix
*prefix
);
42 RoutePrefix
*route_prefix_free(RoutePrefix
*prefix
);
44 void network_verify_prefixes(Network
*network
);
45 void network_verify_route_prefixes(Network
*network
);
47 int radv_emit_dns(Link
*link
);
48 int radv_configure(Link
*link
);
49 int radv_add_prefix(Link
*link
, const struct in6_addr
*prefix
, uint8_t prefix_len
,
50 uint32_t lifetime_preferred
, uint32_t lifetime_valid
);
52 const char* radv_prefix_delegation_to_string(RADVPrefixDelegation i
) _const_
;
53 RADVPrefixDelegation
radv_prefix_delegation_from_string(const char *s
) _pure_
;
55 CONFIG_PARSER_PROTOTYPE(config_parse_router_prefix_delegation
);
56 CONFIG_PARSER_PROTOTYPE(config_parse_router_preference
);
57 CONFIG_PARSER_PROTOTYPE(config_parse_prefix
);
58 CONFIG_PARSER_PROTOTYPE(config_parse_prefix_flags
);
59 CONFIG_PARSER_PROTOTYPE(config_parse_prefix_lifetime
);
60 CONFIG_PARSER_PROTOTYPE(config_parse_prefix_assign
);
61 CONFIG_PARSER_PROTOTYPE(config_parse_radv_dns
);
62 CONFIG_PARSER_PROTOTYPE(config_parse_radv_search_domains
);
63 CONFIG_PARSER_PROTOTYPE(config_parse_route_prefix
);
64 CONFIG_PARSER_PROTOTYPE(config_parse_route_prefix_lifetime
);