1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
5 Copyright © 2017 Intel Corporation. All rights reserved.
13 #include "in-addr-util.h"
14 #include "conf-parser.h"
15 #include "networkd-util.h"
17 typedef struct Network Network
;
18 typedef struct Link Link
;
20 typedef enum RADVPrefixDelegation
{
21 RADV_PREFIX_DELEGATION_NONE
= 0,
22 RADV_PREFIX_DELEGATION_STATIC
= 1 << 0,
23 RADV_PREFIX_DELEGATION_DHCP6
= 1 << 1,
24 RADV_PREFIX_DELEGATION_BOTH
= RADV_PREFIX_DELEGATION_STATIC
| RADV_PREFIX_DELEGATION_DHCP6
,
25 _RADV_PREFIX_DELEGATION_MAX
,
26 _RADV_PREFIX_DELEGATION_INVALID
= -EINVAL
,
27 } RADVPrefixDelegation
;
29 typedef struct Prefix
{
31 NetworkConfigSection
*section
;
33 sd_radv_prefix
*radv_prefix
;
36 uint32_t route_metric
;
39 typedef struct RoutePrefix
{
41 NetworkConfigSection
*section
;
43 sd_radv_route_prefix
*radv_route_prefix
;
46 Prefix
*prefix_free(Prefix
*prefix
);
47 RoutePrefix
*route_prefix_free(RoutePrefix
*prefix
);
49 void network_drop_invalid_prefixes(Network
*network
);
50 void network_drop_invalid_route_prefixes(Network
*network
);
51 void network_adjust_radv(Network
*network
);
53 int radv_emit_dns(Link
*link
);
54 int radv_configure(Link
*link
);
55 int radv_update_mac(Link
*link
);
56 int radv_add_prefix(Link
*link
, const struct in6_addr
*prefix
, uint8_t prefix_len
,
57 uint32_t lifetime_preferred
, uint32_t lifetime_valid
);
59 const char* radv_prefix_delegation_to_string(RADVPrefixDelegation i
) _const_
;
60 RADVPrefixDelegation
radv_prefix_delegation_from_string(const char *s
) _pure_
;
62 CONFIG_PARSER_PROTOTYPE(config_parse_router_prefix_delegation
);
63 CONFIG_PARSER_PROTOTYPE(config_parse_router_preference
);
64 CONFIG_PARSER_PROTOTYPE(config_parse_prefix
);
65 CONFIG_PARSER_PROTOTYPE(config_parse_prefix_flags
);
66 CONFIG_PARSER_PROTOTYPE(config_parse_prefix_lifetime
);
67 CONFIG_PARSER_PROTOTYPE(config_parse_prefix_assign
);
68 CONFIG_PARSER_PROTOTYPE(config_parse_prefix_metric
);
69 CONFIG_PARSER_PROTOTYPE(config_parse_radv_dns
);
70 CONFIG_PARSER_PROTOTYPE(config_parse_radv_search_domains
);
71 CONFIG_PARSER_PROTOTYPE(config_parse_route_prefix
);
72 CONFIG_PARSER_PROTOTYPE(config_parse_route_prefix_lifetime
);