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
|
|
|
|
2018-08-22 07:30:49 +02:00
|
|
|
#include "sd-device.h"
|
2016-01-20 14:44:14 +01:00
|
|
|
#include "sd-dhcp-lease.h"
|
|
|
|
|
2018-05-22 13:10:17 +02:00
|
|
|
#include "conf-parser.h"
|
2019-01-02 14:30:24 +01:00
|
|
|
#include "def.h"
|
2018-05-06 06:47:15 +02:00
|
|
|
#include "set.h"
|
2019-01-02 14:30:24 +01:00
|
|
|
#include "strv.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-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,
|
|
|
|
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_bridge_port_priority);
|
2013-11-25 01:33:04 +01:00
|
|
|
|
2018-08-22 07:30:49 +02:00
|
|
|
int net_get_unique_predictable_data(sd_device *device, uint64_t *result);
|
|
|
|
const char *net_get_name(sd_device *device);
|
2014-05-12 07:18:24 +02:00
|
|
|
|
2018-12-14 16:25:01 +01:00
|
|
|
size_t serialize_in_addrs(FILE *f,
|
|
|
|
const struct in_addr *addresses,
|
|
|
|
size_t size,
|
|
|
|
bool with_leading_space,
|
|
|
|
bool (*predicate)(const struct in_addr *addr));
|
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);
|
2019-01-02 14:30:24 +01:00
|
|
|
|
|
|
|
#define NETWORK_DIRS ((const char* const*) CONF_PATHS_STRV("systemd/network"))
|