]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/libsystemd-network/network-internal.h
Add SPDX license identifiers to source files under the LGPL
[thirdparty/systemd.git] / src / libsystemd-network / network-internal.h
CommitLineData
53e1b683 1/* SPDX-License-Identifier: LGPL-2.1+ */
44e7b949
LP
2#pragma once
3
be32eb9b
TG
4/***
5 This file is part of systemd.
6
7 Copyright (C) 2013 Tom Gundersen <teg@jklm.no>
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
b3e01314 23#include <stdbool.h>
be32eb9b 24
f8693fc7
BG
25#include "sd-dhcp-lease.h"
26
134e56dc 27#include "condition.h"
71d35b6b 28#include "udev.h"
2cc412b5 29
f00ff0de
DJL
30#define LINK_BRIDGE_PORT_PRIORITY_INVALID 128
31#define LINK_BRIDGE_PORT_PRIORITY_MAX 63
32
be32eb9b 33bool net_match_config(const struct ether_addr *match_mac,
5256e00e
TG
34 char * const *match_path,
35 char * const *match_driver,
36 char * const *match_type,
37 char * const *match_name,
2cc412b5
TG
38 Condition *match_host,
39 Condition *match_virt,
40 Condition *match_kernel,
edbb03e9 41 Condition *match_arch,
505f8da7 42 const struct ether_addr *dev_mac,
b3e01314 43 const char *dev_path,
bf175aaf 44 const char *dev_parent_driver,
b3e01314
TG
45 const char *dev_driver,
46 const char *dev_type,
32bc8adc 47 const char *dev_name);
be32eb9b 48
2cc412b5
TG
49int config_parse_net_condition(const char *unit, const char *filename, unsigned line,
50 const char *section, unsigned section_line, const char *lvalue,
51 int ltype, const char *rvalue, void *data, void *userdata);
52
be32eb9b 53int config_parse_hwaddr(const char *unit, const char *filename, unsigned line,
71a61510
TG
54 const char *section, unsigned section_line, const char *lvalue,
55 int ltype, const char *rvalue, void *data, void *userdata);
be32eb9b 56
5256e00e
TG
57int config_parse_ifnames(const char *unit, const char *filename, unsigned line,
58 const char *section, unsigned section_line, const char *lvalue,
59 int ltype, const char *rvalue, void *data, void *userdata);
f5284182 60
d2df0d0e 61int config_parse_ifalias(const char *unit, const char *filename, unsigned line,
71a61510
TG
62 const char *section, unsigned section_line, const char *lvalue,
63 int ltype, const char *rvalue, void *data, void *userdata);
413708d1
VK
64
65int config_parse_iaid(const char *unit, const char *filename, unsigned line,
66 const char *section, unsigned section_line, const char *lvalue,
67 int ltype, const char *rvalue, void *data, void *userdata);
f00ff0de
DJL
68
69int config_parse_bridge_port_priority(const char *unit, const char *filename, unsigned line,
70 const char *section, unsigned section_line, const char *lvalue,
71 int ltype, const char *rvalue, void *data, void *userdata);
d2df0d0e 72
dbe81cbd 73int net_get_unique_predictable_data(struct udev_device *device, uint64_t *result);
fc541430 74const char *net_get_name(struct udev_device *device);
7951dea2 75
b0e39c82 76void serialize_in_addrs(FILE *f, const struct in_addr *addresses, size_t size);
a2ba62c7 77int deserialize_in_addrs(struct in_addr **addresses, const char *string);
b729fa14
PF
78void serialize_in6_addrs(FILE *f, const struct in6_addr *addresses,
79 size_t size);
a2ba62c7 80int deserialize_in6_addrs(struct in6_addr **addresses, const char *string);
e1ea665e
EY
81
82/* don't include "dhcp-lease-internal.h" as it causes conflicts between netinet/ip.h and linux/ip.h */
83struct sd_dhcp_route;
84
f8693fc7 85void serialize_dhcp_routes(FILE *f, const char *key, sd_dhcp_route **routes, size_t size);
e1ea665e 86int deserialize_dhcp_routes(struct sd_dhcp_route **ret, size_t *ret_size, size_t *ret_allocated, const char *string);
a073309f 87
e4735228
LP
88int serialize_dhcp_option(FILE *f, const char *key, const void *data, size_t size);
89int deserialize_dhcp_option(void **data, size_t *data_len, const char *string);