]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/libsystemd-network/network-internal.h
udev: introduce NAMING_STABLE_VIRTUAL_MACS (retroactively)
[thirdparty/systemd.git] / src / libsystemd-network / network-internal.h
1 /* SPDX-License-Identifier: LGPL-2.1+ */
2 #pragma once
3
4 #include <stdbool.h>
5
6 #include "sd-device.h"
7 #include "sd-dhcp-lease.h"
8
9 #include "conf-parser.h"
10 #include "def.h"
11 #include "set.h"
12 #include "strv.h"
13
14 #define LINK_BRIDGE_PORT_PRIORITY_INVALID 128
15 #define LINK_BRIDGE_PORT_PRIORITY_MAX 63
16
17 bool net_match_config(Set *match_mac,
18 char * const *match_path,
19 char * const *match_driver,
20 char * const *match_type,
21 char * const *match_name,
22 const struct ether_addr *dev_mac,
23 const char *dev_path,
24 const char *dev_driver,
25 const char *dev_type,
26 const char *dev_name);
27
28 CONFIG_PARSER_PROTOTYPE(config_parse_net_condition);
29 CONFIG_PARSER_PROTOTYPE(config_parse_hwaddr);
30 CONFIG_PARSER_PROTOTYPE(config_parse_hwaddrs);
31 CONFIG_PARSER_PROTOTYPE(config_parse_ifnames);
32 CONFIG_PARSER_PROTOTYPE(config_parse_ifalias);
33 CONFIG_PARSER_PROTOTYPE(config_parse_bridge_port_priority);
34
35 int net_get_unique_predictable_data(sd_device *device, bool use_sysname, uint64_t *result);
36 const char *net_get_name_persistent(sd_device *device);
37
38 size_t serialize_in_addrs(FILE *f,
39 const struct in_addr *addresses,
40 size_t size,
41 bool with_leading_space,
42 bool (*predicate)(const struct in_addr *addr));
43 int deserialize_in_addrs(struct in_addr **addresses, const char *string);
44 void serialize_in6_addrs(FILE *f, const struct in6_addr *addresses,
45 size_t size);
46 int deserialize_in6_addrs(struct in6_addr **addresses, const char *string);
47
48 /* don't include "dhcp-lease-internal.h" as it causes conflicts between netinet/ip.h and linux/ip.h */
49 struct sd_dhcp_route;
50
51 void serialize_dhcp_routes(FILE *f, const char *key, sd_dhcp_route **routes, size_t size);
52 int deserialize_dhcp_routes(struct sd_dhcp_route **ret, size_t *ret_size, size_t *ret_allocated, const char *string);
53
54 /* It is not necessary to add deserialize_dhcp_option(). Use unhexmem() instead. */
55 int serialize_dhcp_option(FILE *f, const char *key, const void *data, size_t size);
56
57 #define NETWORK_DIRS ((const char* const*) CONF_PATHS_STRV("systemd/network"))