| 1 |
/* SPDX-License-Identifier: LGPL-2.1-or-later */ |
| 2 |
#pragma once |
| 3 |
|
| 4 |
#include <netinet/in.h> |
| 5 |
|
| 6 |
#include "networkd-forward.h" |
| 7 |
|
| 8 |
typedef struct AddressLabel { |
| 9 |
Manager *manager; |
| 10 |
Network *network; |
| 11 |
ConfigSection *section; |
| 12 |
|
| 13 |
uint32_t label; |
| 14 |
struct in6_addr prefix; |
| 15 |
unsigned char prefixlen; |
| 16 |
bool prefix_set; |
| 17 |
} AddressLabel; |
| 18 |
|
| 19 |
AddressLabel *address_label_free(AddressLabel *label); |
| 20 |
|
| 21 |
void network_drop_invalid_address_labels(Network *network); |
| 22 |
void manager_drop_invalid_address_labels(Manager *manager); |
| 23 |
|
| 24 |
int link_request_static_address_labels(Link *link); |
| 25 |
int manager_request_static_address_labels(Manager *manager); |
| 26 |
|
| 27 |
typedef enum IPv6AddressLabelConfParserType { |
| 28 |
IPV6_ADDRESS_LABEL, |
| 29 |
IPV6_ADDRESS_LABEL_PREFIX, |
| 30 |
_IPV6_ADDRESS_LABEL_CONF_PARSER_MAX, |
| 31 |
_IPV6_ADDRESS_LABEL_CONF_PARSER_INVALID = -EINVAL, |
| 32 |
|
| 33 |
IPV6_ADDRESS_LABEL_BY_MANAGER = 1 << 16, |
| 34 |
IPV6_ADDRESS_LABEL_SECTION_MASK = IPV6_ADDRESS_LABEL_BY_MANAGER - 1, |
| 35 |
} IPv6AddressLabelConfParserType; |
| 36 |
|
| 37 |
assert_cc(IPV6_ADDRESS_LABEL_BY_MANAGER >= _IPV6_ADDRESS_LABEL_CONF_PARSER_MAX); |
| 38 |
|
| 39 |
CONFIG_PARSER_PROTOTYPE(config_parse_ipv6_address_label_section); |