1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
5 Copyright © 2017 Intel Corporation. All rights reserved.
8 #include "ndisc-option.h"
9 #include "networkd-forward.h"
11 typedef enum RADVPrefixDelegation
{
12 RADV_PREFIX_DELEGATION_NONE
= 0,
13 RADV_PREFIX_DELEGATION_STATIC
= 1 << 0,
14 RADV_PREFIX_DELEGATION_DHCP6
= 1 << 1,
15 RADV_PREFIX_DELEGATION_BOTH
= RADV_PREFIX_DELEGATION_STATIC
| RADV_PREFIX_DELEGATION_DHCP6
,
16 _RADV_PREFIX_DELEGATION_MAX
,
17 _RADV_PREFIX_DELEGATION_INVALID
= -EINVAL
,
18 } RADVPrefixDelegation
;
20 typedef struct Prefix
{
22 ConfigSection
*section
;
24 sd_ndisc_prefix prefix
;
27 uint32_t route_metric
;
31 typedef struct RoutePrefix
{
33 ConfigSection
*section
;
38 typedef struct Prefix64
{
40 ConfigSection
*section
;
42 sd_ndisc_prefix64 prefix64
;
45 void network_adjust_radv(Network
*network
);
47 int link_request_radv_addresses(Link
*link
);
48 int link_reconfigure_radv_address(Address
*address
, Link
*link
);
50 bool link_radv_enabled(Link
*link
);
51 int radv_start(Link
*link
);
52 int radv_update_mac(Link
*link
);
53 int radv_add_prefix(Link
*link
, const struct in6_addr
*prefix
, uint8_t prefix_len
,
54 usec_t lifetime_preferred_usec
, usec_t lifetime_valid_usec
);
56 int link_request_radv(Link
*link
);
57 int link_drop_radv_config(Link
*link
, Network
*network
);
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_lifetime
);
64 CONFIG_PARSER_PROTOTYPE(config_parse_router_uint32_msec_usec
);
65 CONFIG_PARSER_PROTOTYPE(config_parse_router_preference
);
66 CONFIG_PARSER_PROTOTYPE(config_parse_prefix
);
67 CONFIG_PARSER_PROTOTYPE(config_parse_prefix_boolean
);
68 CONFIG_PARSER_PROTOTYPE(config_parse_prefix_lifetime
);
69 CONFIG_PARSER_PROTOTYPE(config_parse_prefix_metric
);
70 CONFIG_PARSER_PROTOTYPE(config_parse_prefix_token
);
71 CONFIG_PARSER_PROTOTYPE(config_parse_radv_dns
);
72 CONFIG_PARSER_PROTOTYPE(config_parse_radv_search_domains
);
73 CONFIG_PARSER_PROTOTYPE(config_parse_route_prefix
);
74 CONFIG_PARSER_PROTOTYPE(config_parse_route_prefix_lifetime
);
75 CONFIG_PARSER_PROTOTYPE(config_parse_route_prefix_preference
);
76 CONFIG_PARSER_PROTOTYPE(config_parse_pref64_prefix
);
77 CONFIG_PARSER_PROTOTYPE(config_parse_pref64_prefix_lifetime
);
78 CONFIG_PARSER_PROTOTYPE(config_parse_router_home_agent_lifetime
);