]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/libsystemd-network/network-internal.h
Merge branch 'predictable-interface-names'
[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 "condition.h"
10 #include "conf-parser.h"
11 #include "set.h"
12
13 #define LINK_BRIDGE_PORT_PRIORITY_INVALID 128
14 #define LINK_BRIDGE_PORT_PRIORITY_MAX 63
15
16 bool net_match_config(Set *match_mac,
17 char * const *match_path,
18 char * const *match_driver,
19 char * const *match_type,
20 char * const *match_name,
21 Condition *match_host,
22 Condition *match_virt,
23 Condition *match_kernel_cmdline,
24 Condition *match_kernel_version,
25 Condition *match_arch,
26 const struct ether_addr *dev_mac,
27 const char *dev_path,
28 const char *dev_parent_driver,
29 const char *dev_driver,
30 const char *dev_type,
31 const char *dev_name);
32
33 CONFIG_PARSER_PROTOTYPE(config_parse_net_condition);
34 CONFIG_PARSER_PROTOTYPE(config_parse_hwaddr);
35 CONFIG_PARSER_PROTOTYPE(config_parse_hwaddrs);
36 CONFIG_PARSER_PROTOTYPE(config_parse_ifnames);
37 CONFIG_PARSER_PROTOTYPE(config_parse_ifalias);
38 CONFIG_PARSER_PROTOTYPE(config_parse_bridge_port_priority);
39
40 int net_get_unique_predictable_data(sd_device *device, uint64_t *result);
41 const char *net_get_name(sd_device *device);
42
43 void serialize_in_addrs(FILE *f, const struct in_addr *addresses, size_t size);
44 int deserialize_in_addrs(struct in_addr **addresses, const char *string);
45 void serialize_in6_addrs(FILE *f, const struct in6_addr *addresses,
46 size_t size);
47 int deserialize_in6_addrs(struct in6_addr **addresses, const char *string);
48
49 /* don't include "dhcp-lease-internal.h" as it causes conflicts between netinet/ip.h and linux/ip.h */
50 struct sd_dhcp_route;
51
52 void serialize_dhcp_routes(FILE *f, const char *key, sd_dhcp_route **routes, size_t size);
53 int deserialize_dhcp_routes(struct sd_dhcp_route **ret, size_t *ret_size, size_t *ret_allocated, const char *string);
54
55 /* It is not necessary to add deserialize_dhcp_option(). Use unhexmem() instead. */
56 int serialize_dhcp_option(FILE *f, const char *key, const void *data, size_t size);