]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/libsystemd-network/network-internal.h
Merge pull request #2921 from keszybz/do-not-report-masked-units-as-changed
[thirdparty/systemd.git] / src / libsystemd-network / network-internal.h
1 #pragma once
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 #include <stdbool.h>
23
24 #include "sd-dhcp-lease.h"
25
26 #include "condition.h"
27 #include "udev.h"
28
29 bool net_match_config(const struct ether_addr *match_mac,
30 char * const *match_path,
31 char * const *match_driver,
32 char * const *match_type,
33 char * const *match_name,
34 Condition *match_host,
35 Condition *match_virt,
36 Condition *match_kernel,
37 Condition *match_arch,
38 const struct ether_addr *dev_mac,
39 const char *dev_path,
40 const char *dev_parent_driver,
41 const char *dev_driver,
42 const char *dev_type,
43 const char *dev_name);
44
45 int config_parse_net_condition(const char *unit, const char *filename, unsigned line,
46 const char *section, unsigned section_line, const char *lvalue,
47 int ltype, const char *rvalue, void *data, void *userdata);
48
49 int config_parse_hwaddr(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
53 int config_parse_ifname(const char *unit, const char *filename, unsigned line,
54 const char *section, unsigned section_line, const char *lvalue,
55 int ltype, const char *rvalue, void *data, void *userdata);
56
57 int config_parse_ifnames(const char *unit, const char *filename, unsigned line,
58 const char *section, unsigned section_line, const char *lvalue,
59 int ltype, const char *rvalue, void *data, void *userdata);
60
61 int config_parse_ifalias(const char *unit, const char *filename, unsigned line,
62 const char *section, unsigned section_line, const char *lvalue,
63 int ltype, const char *rvalue, void *data, void *userdata);
64
65 int config_parse_iaid(const char *unit, const char *filename, unsigned line,
66 const char *section, unsigned section_line, const char *lvalue,
67 int ltype, const char *rvalue, void *data, void *userdata);
68
69 int net_get_unique_predictable_data(struct udev_device *device, uint64_t *result);
70 const char *net_get_name(struct udev_device *device);
71
72 void serialize_in_addrs(FILE *f, const struct in_addr *addresses, size_t size);
73 int deserialize_in_addrs(struct in_addr **addresses, const char *string);
74 void serialize_in6_addrs(FILE *f, const struct in6_addr *addresses,
75 size_t size);
76 int deserialize_in6_addrs(struct in6_addr **addresses, const char *string);
77
78 /* don't include "dhcp-lease-internal.h" as it causes conflicts between netinet/ip.h and linux/ip.h */
79 struct sd_dhcp_route;
80
81 void serialize_dhcp_routes(FILE *f, const char *key, sd_dhcp_route **routes, size_t size);
82 int deserialize_dhcp_routes(struct sd_dhcp_route **ret, size_t *ret_size, size_t *ret_allocated, const char *string);
83
84 int serialize_dhcp_option(FILE *f, const char *key, const void *data, size_t size);
85 int deserialize_dhcp_option(void **data, size_t *data_len, const char *string);