]>
Commit | Line | Data |
---|---|---|
53e1b683 | 1 | /* SPDX-License-Identifier: LGPL-2.1+ */ |
44e7b949 LP |
2 | #pragma once |
3 | ||
b3e01314 | 4 | #include <stdbool.h> |
be32eb9b | 5 | |
51517f9e | 6 | #include "sd-device.h" |
f8693fc7 BG |
7 | #include "sd-dhcp-lease.h" |
8 | ||
134e56dc | 9 | #include "condition.h" |
a2106925 | 10 | #include "conf-parser.h" |
dc0d4078 | 11 | #include "def.h" |
206b63ee | 12 | #include "set.h" |
dc0d4078 | 13 | #include "strv.h" |
2cc412b5 | 14 | |
f00ff0de DJL |
15 | #define LINK_BRIDGE_PORT_PRIORITY_INVALID 128 |
16 | #define LINK_BRIDGE_PORT_PRIORITY_MAX 63 | |
17 | ||
e90d0374 | 18 | bool net_match_config(Set *match_mac, |
5256e00e TG |
19 | char * const *match_path, |
20 | char * const *match_driver, | |
21 | char * const *match_type, | |
22 | char * const *match_name, | |
2cc412b5 TG |
23 | Condition *match_host, |
24 | Condition *match_virt, | |
5022f08a LP |
25 | Condition *match_kernel_cmdline, |
26 | Condition *match_kernel_version, | |
edbb03e9 | 27 | Condition *match_arch, |
505f8da7 | 28 | const struct ether_addr *dev_mac, |
b3e01314 TG |
29 | const char *dev_path, |
30 | const char *dev_driver, | |
31 | const char *dev_type, | |
32bc8adc | 32 | const char *dev_name); |
be32eb9b | 33 | |
a2106925 LP |
34 | CONFIG_PARSER_PROTOTYPE(config_parse_net_condition); |
35 | CONFIG_PARSER_PROTOTYPE(config_parse_hwaddr); | |
36 | CONFIG_PARSER_PROTOTYPE(config_parse_hwaddrs); | |
37 | CONFIG_PARSER_PROTOTYPE(config_parse_ifnames); | |
38 | CONFIG_PARSER_PROTOTYPE(config_parse_ifalias); | |
a2106925 | 39 | CONFIG_PARSER_PROTOTYPE(config_parse_bridge_port_priority); |
d2df0d0e | 40 | |
51517f9e YW |
41 | int net_get_unique_predictable_data(sd_device *device, uint64_t *result); |
42 | const char *net_get_name(sd_device *device); | |
7951dea2 | 43 | |
072320ea TH |
44 | size_t serialize_in_addrs(FILE *f, |
45 | const struct in_addr *addresses, | |
46 | size_t size, | |
47 | bool with_leading_space, | |
48 | bool (*predicate)(const struct in_addr *addr)); | |
a2ba62c7 | 49 | int deserialize_in_addrs(struct in_addr **addresses, const char *string); |
b729fa14 PF |
50 | void serialize_in6_addrs(FILE *f, const struct in6_addr *addresses, |
51 | size_t size); | |
a2ba62c7 | 52 | int deserialize_in6_addrs(struct in6_addr **addresses, const char *string); |
e1ea665e EY |
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 | ||
f8693fc7 | 57 | void serialize_dhcp_routes(FILE *f, const char *key, sd_dhcp_route **routes, size_t size); |
e1ea665e | 58 | int deserialize_dhcp_routes(struct sd_dhcp_route **ret, size_t *ret_size, size_t *ret_allocated, const char *string); |
a073309f | 59 | |
ce088d6f | 60 | /* It is not necessary to add deserialize_dhcp_option(). Use unhexmem() instead. */ |
e4735228 | 61 | int serialize_dhcp_option(FILE *f, const char *key, const void *data, size_t size); |
dc0d4078 ZJS |
62 | |
63 | #define NETWORK_DIRS ((const char* const*) CONF_PATHS_STRV("systemd/network")) |