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