]>
Commit | Line | Data |
---|---|---|
53e1b683 | 1 | /* SPDX-License-Identifier: LGPL-2.1+ */ |
44e7b949 LP |
2 | #pragma once |
3 | ||
78404d22 | 4 | #include <linux/nl80211.h> |
b3e01314 | 5 | #include <stdbool.h> |
be32eb9b | 6 | |
51517f9e | 7 | #include "sd-device.h" |
f8693fc7 BG |
8 | #include "sd-dhcp-lease.h" |
9 | ||
a2106925 | 10 | #include "conf-parser.h" |
206b63ee | 11 | #include "set.h" |
dc0d4078 | 12 | #include "strv.h" |
2cc412b5 | 13 | |
f00ff0de DJL |
14 | #define LINK_BRIDGE_PORT_PRIORITY_INVALID 128 |
15 | #define LINK_BRIDGE_PORT_PRIORITY_MAX 63 | |
16 | ||
ef62949a | 17 | char *link_get_type_string(unsigned short iftype, sd_device *device); |
e90d0374 | 18 | bool net_match_config(Set *match_mac, |
4bb7cc82 | 19 | Set *match_permanent_mac, |
c643bda5 YW |
20 | char * const *match_paths, |
21 | char * const *match_drivers, | |
22 | char * const *match_iftypes, | |
23 | char * const *match_names, | |
44005bfb | 24 | char * const *match_property, |
78404d22 | 25 | char * const *match_wifi_iftype, |
8d968fdd | 26 | char * const *match_ssid, |
277ba8d1 | 27 | Set *match_bssid, |
b38de0e9 | 28 | sd_device *device, |
505f8da7 | 29 | const struct ether_addr *dev_mac, |
4bb7cc82 | 30 | const struct ether_addr *dev_permanent_mac, |
c643bda5 YW |
31 | const char *dev_driver, |
32 | unsigned short dev_iftype, | |
8d968fdd | 33 | const char *dev_name, |
572b21d9 | 34 | char * const *alternative_names, |
c643bda5 YW |
35 | enum nl80211_iftype dev_wifi_iftype, |
36 | const char *dev_ssid, | |
37 | const struct ether_addr *dev_bssid); | |
be32eb9b | 38 | |
a2106925 LP |
39 | CONFIG_PARSER_PROTOTYPE(config_parse_net_condition); |
40 | CONFIG_PARSER_PROTOTYPE(config_parse_hwaddr); | |
41 | CONFIG_PARSER_PROTOTYPE(config_parse_hwaddrs); | |
54a84237 YW |
42 | CONFIG_PARSER_PROTOTYPE(config_parse_match_strv); |
43 | CONFIG_PARSER_PROTOTYPE(config_parse_match_ifnames); | |
44005bfb | 44 | CONFIG_PARSER_PROTOTYPE(config_parse_match_property); |
a2106925 | 45 | CONFIG_PARSER_PROTOTYPE(config_parse_ifalias); |
a2106925 | 46 | CONFIG_PARSER_PROTOTYPE(config_parse_bridge_port_priority); |
d2df0d0e | 47 | |
96848152 | 48 | int net_get_unique_predictable_data(sd_device *device, bool use_sysname, uint64_t *result); |
b889a0de | 49 | const char *net_get_name_persistent(sd_device *device); |
7951dea2 | 50 | |
072320ea TH |
51 | size_t serialize_in_addrs(FILE *f, |
52 | const struct in_addr *addresses, | |
53 | size_t size, | |
d8bff5cc | 54 | bool *with_leading_space, |
072320ea | 55 | bool (*predicate)(const struct in_addr *addr)); |
a2ba62c7 | 56 | int deserialize_in_addrs(struct in_addr **addresses, const char *string); |
b729fa14 | 57 | void serialize_in6_addrs(FILE *f, const struct in6_addr *addresses, |
d8bff5cc ZJS |
58 | size_t size, |
59 | bool *with_leading_space); | |
a2ba62c7 | 60 | int deserialize_in6_addrs(struct in6_addr **addresses, const char *string); |
e1ea665e EY |
61 | |
62 | /* don't include "dhcp-lease-internal.h" as it causes conflicts between netinet/ip.h and linux/ip.h */ | |
63 | struct sd_dhcp_route; | |
ef0daa11 | 64 | struct sd_dhcp_lease; |
e1ea665e | 65 | |
f8693fc7 | 66 | void serialize_dhcp_routes(FILE *f, const char *key, sd_dhcp_route **routes, size_t size); |
e1ea665e | 67 | int deserialize_dhcp_routes(struct sd_dhcp_route **ret, size_t *ret_size, size_t *ret_allocated, const char *string); |
a073309f | 68 | |
ce088d6f | 69 | /* It is not necessary to add deserialize_dhcp_option(). Use unhexmem() instead. */ |
e4735228 | 70 | int serialize_dhcp_option(FILE *f, const char *key, const void *data, size_t size); |
ef0daa11 YW |
71 | |
72 | int dhcp_lease_save(sd_dhcp_lease *lease, const char *lease_file); | |
73 | int dhcp_lease_load(sd_dhcp_lease **ret, const char *lease_file); |