]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/network/networkd-address-label.h
tree-wide: drop license boilerplate
[thirdparty/systemd.git] / src / network / networkd-address-label.h
1 /* SPDX-License-Identifier: LGPL-2.1+ */
2 #pragma once
3
4 /***
5 This file is part of systemd.
6
7 Copyright 2017 Susant Sahani
8 ***/
9
10 #include <inttypes.h>
11 #include <stdbool.h>
12
13 #include "in-addr-util.h"
14
15 typedef struct AddressLabel AddressLabel;
16
17 #include "networkd-link.h"
18 #include "networkd-network.h"
19
20 typedef struct Network Network;
21 typedef struct Link Link;
22 typedef struct NetworkConfigSection NetworkConfigSection;
23
24 struct AddressLabel {
25 Network *network;
26 Link *link;
27 NetworkConfigSection *section;
28
29 unsigned char prefixlen;
30 uint32_t label;
31
32 union in_addr_union in_addr;
33
34 LIST_FIELDS(AddressLabel, labels);
35 };
36
37 int address_label_new(AddressLabel **ret);
38 void address_label_free(AddressLabel *label);
39
40 DEFINE_TRIVIAL_CLEANUP_FUNC(AddressLabel*, address_label_free);
41 #define _cleanup_address_label_free_ _cleanup_(address_label_freep)
42
43 int address_label_configure(AddressLabel *address, Link *link, sd_netlink_message_handler_t callback, bool update);
44
45 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);
46 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);