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