| 1 |
/* SPDX-License-Identifier: LGPL-2.1-or-later */ |
| 2 |
#pragma once |
| 3 |
|
| 4 |
/*** |
| 5 |
Copyright © 2017 Intel Corporation. All rights reserved. |
| 6 |
***/ |
| 7 |
|
| 8 |
#include "ndisc-option.h" |
| 9 |
#include "networkd-forward.h" |
| 10 |
|
| 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; |
| 19 |
|
| 20 |
typedef struct Prefix { |
| 21 |
Network *network; |
| 22 |
ConfigSection *section; |
| 23 |
|
| 24 |
sd_ndisc_prefix prefix; |
| 25 |
|
| 26 |
bool assign; |
| 27 |
uint32_t route_metric; |
| 28 |
Set *tokens; |
| 29 |
} Prefix; |
| 30 |
|
| 31 |
typedef struct RoutePrefix { |
| 32 |
Network *network; |
| 33 |
ConfigSection *section; |
| 34 |
|
| 35 |
sd_ndisc_route route; |
| 36 |
} RoutePrefix; |
| 37 |
|
| 38 |
typedef struct Prefix64 { |
| 39 |
Network *network; |
| 40 |
ConfigSection *section; |
| 41 |
|
| 42 |
sd_ndisc_prefix64 prefix64; |
| 43 |
} Prefix64; |
| 44 |
|
| 45 |
void network_adjust_radv(Network *network); |
| 46 |
|
| 47 |
int link_request_radv_addresses(Link *link); |
| 48 |
int link_reconfigure_radv_address(Address *address, Link *link); |
| 49 |
|
| 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); |
| 55 |
|
| 56 |
int link_request_radv(Link *link); |
| 57 |
int link_drop_radv_config(Link *link, Network *network); |
| 58 |
|
| 59 |
DECLARE_STRING_TABLE_LOOKUP(radv_prefix_delegation, RADVPrefixDelegation); |
| 60 |
|
| 61 |
CONFIG_PARSER_PROTOTYPE(config_parse_router_prefix_delegation); |
| 62 |
CONFIG_PARSER_PROTOTYPE(config_parse_router_lifetime); |
| 63 |
CONFIG_PARSER_PROTOTYPE(config_parse_router_uint32_msec_usec); |
| 64 |
CONFIG_PARSER_PROTOTYPE(config_parse_router_preference); |
| 65 |
CONFIG_PARSER_PROTOTYPE(config_parse_prefix); |
| 66 |
CONFIG_PARSER_PROTOTYPE(config_parse_prefix_boolean); |
| 67 |
CONFIG_PARSER_PROTOTYPE(config_parse_prefix_lifetime); |
| 68 |
CONFIG_PARSER_PROTOTYPE(config_parse_prefix_metric); |
| 69 |
CONFIG_PARSER_PROTOTYPE(config_parse_prefix_token); |
| 70 |
CONFIG_PARSER_PROTOTYPE(config_parse_radv_dns); |
| 71 |
CONFIG_PARSER_PROTOTYPE(config_parse_radv_search_domains); |
| 72 |
CONFIG_PARSER_PROTOTYPE(config_parse_route_prefix); |
| 73 |
CONFIG_PARSER_PROTOTYPE(config_parse_route_prefix_lifetime); |
| 74 |
CONFIG_PARSER_PROTOTYPE(config_parse_route_prefix_preference); |
| 75 |
CONFIG_PARSER_PROTOTYPE(config_parse_pref64_prefix); |
| 76 |
CONFIG_PARSER_PROTOTYPE(config_parse_pref64_prefix_lifetime); |
| 77 |
CONFIG_PARSER_PROTOTYPE(config_parse_router_home_agent_lifetime); |