]>
Commit | Line | Data |
---|---|---|
be32eb9b TG |
1 | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ |
2 | ||
3 | /*** | |
4 | This file is part of systemd. | |
5 | ||
6 | Copyright (C) 2013 Tom Gundersen <teg@jklm.no> | |
7 | ||
8 | systemd is free software; you can redistribute it and/or modify it | |
9 | under the terms of the GNU Lesser General Public License as published by | |
10 | the Free Software Foundation; either version 2.1 of the License, or | |
11 | (at your option) any later version. | |
12 | ||
13 | systemd is distributed in the hope that it will be useful, but | |
14 | WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
16 | Lesser General Public License for more details. | |
17 | ||
18 | You should have received a copy of the GNU Lesser General Public License | |
19 | along with systemd; If not, see <http://www.gnu.org/licenses/>. | |
20 | ***/ | |
21 | ||
22 | #pragma once | |
23 | ||
24 | #include <netinet/ether.h> | |
377a218f | 25 | #include <netinet/in.h> |
b3e01314 | 26 | #include <stdbool.h> |
be32eb9b | 27 | |
c6f7c917 | 28 | #include "udev.h" |
2cc412b5 TG |
29 | #include "condition-util.h" |
30 | ||
be32eb9b TG |
31 | bool net_match_config(const struct ether_addr *match_mac, |
32 | const char *match_path, | |
33 | const char *match_driver, | |
34 | const char *match_type, | |
35 | const char *match_name, | |
2cc412b5 TG |
36 | Condition *match_host, |
37 | Condition *match_virt, | |
38 | Condition *match_kernel, | |
edbb03e9 | 39 | Condition *match_arch, |
505f8da7 | 40 | const struct ether_addr *dev_mac, |
b3e01314 | 41 | const char *dev_path, |
bf175aaf | 42 | const char *dev_parent_driver, |
b3e01314 TG |
43 | const char *dev_driver, |
44 | const char *dev_type, | |
45 | const char *dev_name); | |
be32eb9b | 46 | |
377a218f TG |
47 | unsigned net_netmask_to_prefixlen(const struct in_addr *netmask); |
48 | ||
2cc412b5 TG |
49 | int config_parse_net_condition(const char *unit, const char *filename, unsigned line, |
50 | const char *section, unsigned section_line, const char *lvalue, | |
51 | int ltype, const char *rvalue, void *data, void *userdata); | |
52 | ||
be32eb9b | 53 | int config_parse_hwaddr(const char *unit, const char *filename, unsigned line, |
71a61510 TG |
54 | const char *section, unsigned section_line, const char *lvalue, |
55 | int ltype, const char *rvalue, void *data, void *userdata); | |
be32eb9b TG |
56 | |
57 | int config_parse_ifname(const char *unit, const char *filename, unsigned line, | |
71a61510 TG |
58 | const char *section, unsigned section_line, const char *lvalue, |
59 | int ltype, const char *rvalue, void *data, void *userdata); | |
f5284182 | 60 | |
d2df0d0e | 61 | int config_parse_ifalias(const char *unit, const char *filename, unsigned line, |
71a61510 TG |
62 | const char *section, unsigned section_line, const char *lvalue, |
63 | int ltype, const char *rvalue, void *data, void *userdata); | |
d2df0d0e | 64 | |
f5284182 | 65 | int net_parse_inaddr(const char *address, unsigned char *family, void *dst); |
b5db00e5 UTL |
66 | |
67 | int net_get_unique_predictable_data(struct udev_device *device, uint8_t result[8]); | |
fc541430 | 68 | const char *net_get_name(struct udev_device *device); |
7951dea2 | 69 | |
09bee74d TG |
70 | void serialize_in_addrs(FILE *f, const char *key, struct in_addr *addresses, size_t size); |
71 | int deserialize_in_addrs(struct in_addr **addresses, size_t *size, const char *string); | |
72 | int deserialize_in6_addrs(struct in6_addr **addresses, size_t *size, const char *string); | |
e1ea665e EY |
73 | |
74 | ||
75 | /* don't include "dhcp-lease-internal.h" as it causes conflicts between netinet/ip.h and linux/ip.h */ | |
76 | struct sd_dhcp_route; | |
77 | ||
78 | void serialize_dhcp_routes(FILE *f, const char *key, struct sd_dhcp_route *routes, size_t size); | |
79 | int deserialize_dhcp_routes(struct sd_dhcp_route **ret, size_t *ret_size, size_t *ret_allocated, const char *string); |