]> git.ipfire.org Git - thirdparty/systemd.git/blob - 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
1 /* SPDX-License-Identifier: LGPL-2.1+ */
2 #pragma once
3
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
23 #include <stdbool.h>
24
25 #include "sd-dhcp-lease.h"
26
27 #include "condition.h"
28 #include "udev.h"
29
30 #define LINK_BRIDGE_PORT_PRIORITY_INVALID 128
31 #define LINK_BRIDGE_PORT_PRIORITY_MAX 63
32
33 bool net_match_config(const struct ether_addr *match_mac,
34 char * const *match_path,
35 char * const *match_driver,
36 char * const *match_type,
37 char * const *match_name,
38 Condition *match_host,
39 Condition *match_virt,
40 Condition *match_kernel,
41 Condition *match_arch,
42 const struct ether_addr *dev_mac,
43 const char *dev_path,
44 const char *dev_parent_driver,
45 const char *dev_driver,
46 const char *dev_type,
47 const char *dev_name);
48
49 int 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
53 int config_parse_hwaddr(const char *unit, const char *filename, unsigned line,
54 const char *section, unsigned section_line, const char *lvalue,
55 int ltype, const char *rvalue, void *data, void *userdata);
56
57 int 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);
60
61 int config_parse_ifalias(const char *unit, const char *filename, unsigned line,
62 const char *section, unsigned section_line, const char *lvalue,
63 int ltype, const char *rvalue, void *data, void *userdata);
64
65 int 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);
68
69 int 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);
72
73 int net_get_unique_predictable_data(struct udev_device *device, uint64_t *result);
74 const char *net_get_name(struct udev_device *device);
75
76 void serialize_in_addrs(FILE *f, const struct in_addr *addresses, size_t size);
77 int deserialize_in_addrs(struct in_addr **addresses, const char *string);
78 void serialize_in6_addrs(FILE *f, const struct in6_addr *addresses,
79 size_t size);
80 int deserialize_in6_addrs(struct in6_addr **addresses, const char *string);
81
82 /* don't include "dhcp-lease-internal.h" as it causes conflicts between netinet/ip.h and linux/ip.h */
83 struct sd_dhcp_route;
84
85 void serialize_dhcp_routes(FILE *f, const char *key, sd_dhcp_route **routes, size_t size);
86 int deserialize_dhcp_routes(struct sd_dhcp_route **ret, size_t *ret_size, size_t *ret_allocated, const char *string);
87
88 int serialize_dhcp_option(FILE *f, const char *key, const void *data, size_t size);
89 int deserialize_dhcp_option(void **data, size_t *data_len, const char *string);