]> git.proxmox.com Git - systemd.git/blame - src/libsystemd-network/network-internal.h
Imported Upstream version 217
[systemd.git] / src / libsystemd-network / network-internal.h
CommitLineData
60f067b4
JS
1/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
2
5eef597e
MP
3#pragma once
4
60f067b4
JS
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
60f067b4
JS
24#include <netinet/ether.h>
25#include <netinet/in.h>
26#include <stdbool.h>
27
28#include "udev.h"
29#include "condition-util.h"
30
31bool 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
60f067b4
JS
47int 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
51int 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
55int 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
59int 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
60f067b4 63int net_get_unique_predictable_data(struct udev_device *device, uint8_t result[8]);
e842803a 64const char *net_get_name(struct udev_device *device);
60f067b4 65
5eef597e
MP
66void serialize_in_addrs(FILE *f, const struct in_addr *addresses, size_t size);
67int deserialize_in_addrs(struct in_addr **addresses, const char *string);
68int deserialize_in6_addrs(struct in6_addr **addresses, const char *string);
e842803a
MB
69
70/* don't include "dhcp-lease-internal.h" as it causes conflicts between netinet/ip.h and linux/ip.h */
71struct sd_dhcp_route;
72
73void serialize_dhcp_routes(FILE *f, const char *key, struct sd_dhcp_route *routes, size_t size);
74int deserialize_dhcp_routes(struct sd_dhcp_route **ret, size_t *ret_size, size_t *ret_allocated, const char *string);