]>
Commit | Line | Data |
---|---|---|
53e1b683 | 1 | /* SPDX-License-Identifier: LGPL-2.1+ */ |
95b74ef6 SS |
2 | #pragma once |
3 | ||
4 | /*** | |
5 | This file is part of systemd. | |
6 | ||
7 | Copyright 2017 Susant Sahani | |
8 | ||
9 | systemd is free software; you can redistribute it and/or modify it | |
10 | under the terms of the GNU Lesser General Public License as published by | |
11 | the Free Software Foundation; either version 2.1 of the License, or | |
12 | (at your option) any later version. | |
13 | ||
14 | systemd is distributed in the hope that it will be useful, but | |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
17 | Lesser General Public License for more details. | |
18 | ||
19 | You should have received a copy of the GNU Lesser General Public License | |
20 | along with systemd; If not, see <http://www.gnu.org/licenses/>. | |
21 | ***/ | |
22 | ||
23 | #include <inttypes.h> | |
24 | #include <stdbool.h> | |
25 | ||
26 | #include "in-addr-util.h" | |
27 | ||
28 | typedef struct AddressLabel AddressLabel; | |
29 | ||
30 | #include "networkd-link.h" | |
31 | #include "networkd-network.h" | |
32 | ||
33 | typedef struct Network Network; | |
34 | typedef struct Link Link; | |
35 | typedef struct NetworkConfigSection NetworkConfigSection; | |
36 | ||
37 | struct AddressLabel { | |
38 | Network *network; | |
39 | Link *link; | |
40 | NetworkConfigSection *section; | |
41 | ||
95b74ef6 SS |
42 | unsigned char prefixlen; |
43 | uint32_t label; | |
44 | ||
45 | union in_addr_union in_addr; | |
46 | ||
47 | LIST_FIELDS(AddressLabel, labels); | |
48 | }; | |
49 | ||
50 | int address_label_new(AddressLabel **ret); | |
51 | void address_label_free(AddressLabel *label); | |
52 | ||
53 | DEFINE_TRIVIAL_CLEANUP_FUNC(AddressLabel*, address_label_free); | |
54 | #define _cleanup_address_label_free_ _cleanup_(address_label_freep) | |
55 | ||
56 | int address_label_configure(AddressLabel *address, Link *link, sd_netlink_message_handler_t callback, bool update); | |
57 | ||
58 | int config_parse_address_label(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); | |
59 | int config_parse_address_label_prefix(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); |