2017-11-18 17:09:20 +01:00
|
|
|
/* SPDX-License-Identifier: LGPL-2.1+ */
|
2014-08-11 22:44:51 +02:00
|
|
|
#pragma once
|
|
|
|
|
2013-11-05 01:35:26 +01:00
|
|
|
#include <stdbool.h>
|
2013-11-02 02:13:48 +01:00
|
|
|
|
2016-01-20 14:44:14 +01:00
|
|
|
#include "sd-dhcp-lease.h"
|
|
|
|
|
2014-11-06 14:19:05 +01:00
|
|
|
#include "condition.h"
|
2018-05-22 13:10:17 +02:00
|
|
|
#include "conf-parser.h"
|
2018-05-06 06:47:15 +02:00
|
|
|
#include "set.h"
|
2015-11-18 22:46:33 +01:00
|
|
|
#include "udev.h"
|
2014-02-20 19:39:49 +01:00
|
|
|
|
2017-05-02 21:32:42 +02:00
|
|
|
#define LINK_BRIDGE_PORT_PRIORITY_INVALID 128
|
|
|
|
#define LINK_BRIDGE_PORT_PRIORITY_MAX 63
|
|
|
|
|
2018-05-09 04:59:18 +02:00
|
|
|
bool net_match_config(Set *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,
|
core,udev,networkd: add ConditionKernelVersion=
This adds a simple condition/assert/match to the service manager, to
udev's .link handling and to networkd, for matching the kernel version
string.
In this version we only do fnmatch() based globbing, but we might want
to extend that to version comparisons later on, if we like, by slightly
extending the syntax with ">=", "<=", ">", "<" and "==" expressions.
2017-12-13 20:34:13 +01:00
|
|
|
Condition *match_kernel_cmdline,
|
|
|
|
Condition *match_kernel_version,
|
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
|
|
|
|
2018-05-22 13:10:17 +02:00
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_net_condition);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_hwaddr);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_hwaddrs);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_ifnames);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_ifalias);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_iaid);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_bridge_port_priority);
|
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;
|
|
|
|
|
2016-01-20 14:44:14 +01:00
|
|
|
void serialize_dhcp_routes(FILE *f, const char *key, sd_dhcp_route **routes, size_t size);
|
2014-06-28 00:00:06 +02:00
|
|
|
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
|
|
|
|
2018-05-11 07:44:03 +02:00
|
|
|
/* It is not necessary to add deserialize_dhcp_option(). Use unhexmem() instead. */
|
2015-08-26 23:05:34 +02:00
|
|
|
int serialize_dhcp_option(FILE *f, const char *key, const void *data, size_t size);
|