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