]>
Commit | Line | Data |
---|---|---|
53e1b683 | 1 | /* SPDX-License-Identifier: LGPL-2.1+ */ |
44e7b949 LP |
2 | #pragma once |
3 | ||
be32eb9b TG |
4 | /*** |
5 | This file is part of systemd. | |
6 | ||
7 | Copyright (C) 2013 Tom Gundersen <teg@jklm.no> | |
8 | ||
9 | systemd is free software; you can redistribute it and/or modify it | |
10 | under the terms of the GNU Lesser General Public License as published by | |
11 | the Free Software Foundation; either version 2.1 of the License, or | |
12 | (at your option) any later version. | |
13 | ||
14 | systemd is distributed in the hope that it will be useful, but | |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
17 | Lesser General Public License for more details. | |
18 | ||
19 | You should have received a copy of the GNU Lesser General Public License | |
20 | along with systemd; If not, see <http://www.gnu.org/licenses/>. | |
21 | ***/ | |
22 | ||
b3e01314 | 23 | #include <stdbool.h> |
be32eb9b | 24 | |
f8693fc7 BG |
25 | #include "sd-dhcp-lease.h" |
26 | ||
134e56dc | 27 | #include "condition.h" |
71d35b6b | 28 | #include "udev.h" |
2cc412b5 | 29 | |
f00ff0de DJL |
30 | #define LINK_BRIDGE_PORT_PRIORITY_INVALID 128 |
31 | #define LINK_BRIDGE_PORT_PRIORITY_MAX 63 | |
32 | ||
be32eb9b | 33 | bool net_match_config(const struct ether_addr *match_mac, |
5256e00e TG |
34 | char * const *match_path, |
35 | char * const *match_driver, | |
36 | char * const *match_type, | |
37 | char * const *match_name, | |
2cc412b5 TG |
38 | Condition *match_host, |
39 | Condition *match_virt, | |
5022f08a LP |
40 | Condition *match_kernel_cmdline, |
41 | Condition *match_kernel_version, | |
edbb03e9 | 42 | Condition *match_arch, |
505f8da7 | 43 | const struct ether_addr *dev_mac, |
b3e01314 | 44 | const char *dev_path, |
bf175aaf | 45 | const char *dev_parent_driver, |
b3e01314 TG |
46 | const char *dev_driver, |
47 | const char *dev_type, | |
32bc8adc | 48 | const char *dev_name); |
be32eb9b | 49 | |
2cc412b5 TG |
50 | int config_parse_net_condition(const char *unit, const char *filename, unsigned line, |
51 | const char *section, unsigned section_line, const char *lvalue, | |
52 | int ltype, const char *rvalue, void *data, void *userdata); | |
53 | ||
be32eb9b | 54 | int config_parse_hwaddr(const char *unit, const char *filename, unsigned line, |
71a61510 TG |
55 | const char *section, unsigned section_line, const char *lvalue, |
56 | int ltype, const char *rvalue, void *data, void *userdata); | |
be32eb9b | 57 | |
5256e00e TG |
58 | int config_parse_ifnames(const char *unit, const char *filename, unsigned line, |
59 | const char *section, unsigned section_line, const char *lvalue, | |
60 | int ltype, const char *rvalue, void *data, void *userdata); | |
f5284182 | 61 | |
d2df0d0e | 62 | int config_parse_ifalias(const char *unit, const char *filename, unsigned line, |
71a61510 TG |
63 | const char *section, unsigned section_line, const char *lvalue, |
64 | int ltype, const char *rvalue, void *data, void *userdata); | |
413708d1 VK |
65 | |
66 | int config_parse_iaid(const char *unit, const char *filename, unsigned line, | |
67 | const char *section, unsigned section_line, const char *lvalue, | |
68 | int ltype, const char *rvalue, void *data, void *userdata); | |
f00ff0de DJL |
69 | |
70 | int config_parse_bridge_port_priority(const char *unit, const char *filename, unsigned line, | |
71 | const char *section, unsigned section_line, const char *lvalue, | |
72 | int ltype, const char *rvalue, void *data, void *userdata); | |
d2df0d0e | 73 | |
dbe81cbd | 74 | int net_get_unique_predictable_data(struct udev_device *device, uint64_t *result); |
fc541430 | 75 | const char *net_get_name(struct udev_device *device); |
7951dea2 | 76 | |
b0e39c82 | 77 | void serialize_in_addrs(FILE *f, const struct in_addr *addresses, size_t size); |
a2ba62c7 | 78 | int deserialize_in_addrs(struct in_addr **addresses, const char *string); |
b729fa14 PF |
79 | void serialize_in6_addrs(FILE *f, const struct in6_addr *addresses, |
80 | size_t size); | |
a2ba62c7 | 81 | int deserialize_in6_addrs(struct in6_addr **addresses, const char *string); |
e1ea665e EY |
82 | |
83 | /* don't include "dhcp-lease-internal.h" as it causes conflicts between netinet/ip.h and linux/ip.h */ | |
84 | struct sd_dhcp_route; | |
85 | ||
f8693fc7 | 86 | void serialize_dhcp_routes(FILE *f, const char *key, sd_dhcp_route **routes, size_t size); |
e1ea665e | 87 | int deserialize_dhcp_routes(struct sd_dhcp_route **ret, size_t *ret_size, size_t *ret_allocated, const char *string); |
a073309f | 88 | |
e4735228 LP |
89 | int serialize_dhcp_option(FILE *f, const char *key, const void *data, size_t size); |
90 | int deserialize_dhcp_option(void **data, size_t *data_len, const char *string); |