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