2013-11-02 02:13:48 +01:00
|
|
|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
|
|
|
|
|
2014-08-11 22:44:51 +02:00
|
|
|
#pragma once
|
|
|
|
|
2013-11-02 02:13:48 +01:00
|
|
|
/***
|
|
|
|
This file is part of systemd.
|
|
|
|
|
|
|
|
Copyright (C) 2013 Tom Gundersen <teg@jklm.no>
|
|
|
|
|
|
|
|
systemd is free software; you can redistribute it and/or modify it
|
|
|
|
under the terms of the GNU Lesser General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2.1 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
systemd is distributed in the hope that it will be useful, but
|
|
|
|
WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
Lesser General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Lesser General Public License
|
|
|
|
along with systemd; If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
***/
|
|
|
|
|
2013-11-05 01:35:26 +01:00
|
|
|
#include <stdbool.h>
|
2013-11-02 02:13:48 +01:00
|
|
|
|
2014-11-06 14:19:05 +01:00
|
|
|
#include "condition.h"
|
2015-11-18 22:46:33 +01:00
|
|
|
#include "udev.h"
|
2014-02-20 19:39:49 +01:00
|
|
|
|
2013-11-02 02:13:48 +01:00
|
|
|
bool net_match_config(const struct ether_addr *match_mac,
|
2015-02-10 18:30:16 +01:00
|
|
|
char * const *match_path,
|
|
|
|
char * const *match_driver,
|
|
|
|
char * const *match_type,
|
|
|
|
char * const *match_name,
|
2014-02-20 19:39:49 +01:00
|
|
|
Condition *match_host,
|
|
|
|
Condition *match_virt,
|
|
|
|
Condition *match_kernel,
|
2014-02-21 14:51:19 +01:00
|
|
|
Condition *match_arch,
|
2014-04-15 14:21:44 +02:00
|
|
|
const struct ether_addr *dev_mac,
|
2013-11-05 01:35:26 +01:00
|
|
|
const char *dev_path,
|
2014-02-21 22:29:25 +01:00
|
|
|
const char *dev_parent_driver,
|
2013-11-05 01:35:26 +01:00
|
|
|
const char *dev_driver,
|
|
|
|
const char *dev_type,
|
2014-12-05 15:56:10 +01:00
|
|
|
const char *dev_name);
|
2013-11-02 02:13:48 +01:00
|
|
|
|
2014-02-20 19:39:49 +01:00
|
|
|
int config_parse_net_condition(const char *unit, const char *filename, unsigned line,
|
|
|
|
const char *section, unsigned section_line, const char *lvalue,
|
|
|
|
int ltype, const char *rvalue, void *data, void *userdata);
|
|
|
|
|
2013-11-02 02:13:48 +01:00
|
|
|
int config_parse_hwaddr(const char *unit, const char *filename, unsigned line,
|
2013-11-19 16:17:55 +01:00
|
|
|
const char *section, unsigned section_line, const char *lvalue,
|
|
|
|
int ltype, const char *rvalue, void *data, void *userdata);
|
2013-11-02 02:13:48 +01:00
|
|
|
|
|
|
|
int config_parse_ifname(const char *unit, const char *filename, unsigned line,
|
2013-11-19 16:17:55 +01:00
|
|
|
const char *section, unsigned section_line, const char *lvalue,
|
|
|
|
int ltype, const char *rvalue, void *data, void *userdata);
|
2015-02-10 18:30:16 +01:00
|
|
|
|
|
|
|
int config_parse_ifnames(const char *unit, const char *filename, unsigned line,
|
|
|
|
const char *section, unsigned section_line, const char *lvalue,
|
|
|
|
int ltype, const char *rvalue, void *data, void *userdata);
|
2013-11-09 22:19:42 +01:00
|
|
|
|
2013-11-25 01:33:04 +01:00
|
|
|
int config_parse_ifalias(const char *unit, const char *filename, unsigned line,
|
2013-11-19 16:17:55 +01:00
|
|
|
const char *section, unsigned section_line, const char *lvalue,
|
|
|
|
int ltype, const char *rvalue, void *data, void *userdata);
|
2013-11-25 01:33:04 +01:00
|
|
|
|
2015-11-16 09:21:20 +01:00
|
|
|
int net_get_unique_predictable_data(struct udev_device *device, uint64_t *result);
|
2014-06-19 14:39:05 +02:00
|
|
|
const char *net_get_name(struct udev_device *device);
|
2014-05-12 07:18:24 +02:00
|
|
|
|
2014-07-23 13:48:18 +02:00
|
|
|
void serialize_in_addrs(FILE *f, const struct in_addr *addresses, size_t size);
|
2014-07-17 01:39:46 +02:00
|
|
|
int deserialize_in_addrs(struct in_addr **addresses, const char *string);
|
2015-07-06 11:50:47 +02:00
|
|
|
void serialize_in6_addrs(FILE *f, const struct in6_addr *addresses,
|
|
|
|
size_t size);
|
2014-07-17 01:39:46 +02:00
|
|
|
int deserialize_in6_addrs(struct in6_addr **addresses, const char *string);
|
2014-06-28 00:00:06 +02:00
|
|
|
|
|
|
|
/* don't include "dhcp-lease-internal.h" as it causes conflicts between netinet/ip.h and linux/ip.h */
|
|
|
|
struct sd_dhcp_route;
|
|
|
|
|
|
|
|
void serialize_dhcp_routes(FILE *f, const char *key, struct sd_dhcp_route *routes, size_t size);
|
|
|
|
int deserialize_dhcp_routes(struct sd_dhcp_route **ret, size_t *ret_size, size_t *ret_allocated, const char *string);
|
2015-08-01 05:18:51 +02:00
|
|
|
|
2015-08-26 23:05:34 +02:00
|
|
|
int serialize_dhcp_option(FILE *f, const char *key, const void *data, size_t size);
|
|
|
|
int deserialize_dhcp_option(void **data, size_t *data_len, const char *string);
|