]>
Commit | Line | Data |
---|---|---|
53e1b683 | 1 | /* SPDX-License-Identifier: LGPL-2.1+ */ |
95b74ef6 SS |
2 | #pragma once |
3 | ||
95b74ef6 SS |
4 | #include <inttypes.h> |
5 | #include <stdbool.h> | |
6 | ||
a2106925 | 7 | #include "conf-parser.h" |
95b74ef6 SS |
8 | #include "in-addr-util.h" |
9 | ||
10 | typedef struct AddressLabel AddressLabel; | |
11 | ||
12 | #include "networkd-link.h" | |
13 | #include "networkd-network.h" | |
fcbf4cb7 | 14 | #include "networkd-util.h" |
95b74ef6 SS |
15 | |
16 | typedef struct Network Network; | |
17 | typedef struct Link Link; | |
18 | typedef struct NetworkConfigSection NetworkConfigSection; | |
19 | ||
20 | struct AddressLabel { | |
21 | Network *network; | |
95b74ef6 SS |
22 | NetworkConfigSection *section; |
23 | ||
95b74ef6 SS |
24 | unsigned char prefixlen; |
25 | uint32_t label; | |
26 | ||
27 | union in_addr_union in_addr; | |
28 | ||
29 | LIST_FIELDS(AddressLabel, labels); | |
30 | }; | |
31 | ||
95b74ef6 SS |
32 | void address_label_free(AddressLabel *label); |
33 | ||
fcbf4cb7 | 34 | DEFINE_NETWORK_SECTION_FUNCTIONS(AddressLabel, address_label_free); |
95b74ef6 | 35 | |
302a796f | 36 | int address_label_configure(AddressLabel *address, Link *link, link_netlink_message_handler_t callback, bool update); |
95b74ef6 | 37 | |
a2106925 LP |
38 | CONFIG_PARSER_PROTOTYPE(config_parse_address_label); |
39 | CONFIG_PARSER_PROTOTYPE(config_parse_address_label_prefix); |