]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/libsystemd-network/network-internal.h
Merge pull request #9039 from yuwata/fix-device-allow
[thirdparty/systemd.git] / src / libsystemd-network / network-internal.h
1 /* SPDX-License-Identifier: LGPL-2.1+ */
2 #pragma once
3
4 /***
5 This file is part of systemd.
6
7 Copyright (C) 2013 Tom Gundersen <teg@jklm.no>
8 ***/
9
10 #include <stdbool.h>
11
12 #include "sd-dhcp-lease.h"
13
14 #include "condition.h"
15 #include "conf-parser.h"
16 #include "set.h"
17 #include "udev.h"
18
19 #define LINK_BRIDGE_PORT_PRIORITY_INVALID 128
20 #define LINK_BRIDGE_PORT_PRIORITY_MAX 63
21
22 bool net_match_config(Set *match_mac,
23 char * const *match_path,
24 char * const *match_driver,
25 char * const *match_type,
26 char * const *match_name,
27 Condition *match_host,
28 Condition *match_virt,
29 Condition *match_kernel_cmdline,
30 Condition *match_kernel_version,
31 Condition *match_arch,
32 const struct ether_addr *dev_mac,
33 const char *dev_path,
34 const char *dev_parent_driver,
35 const char *dev_driver,
36 const char *dev_type,
37 const char *dev_name);
38
39 CONFIG_PARSER_PROTOTYPE(config_parse_net_condition);
40 CONFIG_PARSER_PROTOTYPE(config_parse_hwaddr);
41 CONFIG_PARSER_PROTOTYPE(config_parse_hwaddrs);
42 CONFIG_PARSER_PROTOTYPE(config_parse_ifnames);
43 CONFIG_PARSER_PROTOTYPE(config_parse_ifalias);
44 CONFIG_PARSER_PROTOTYPE(config_parse_iaid);
45 CONFIG_PARSER_PROTOTYPE(config_parse_bridge_port_priority);
46
47 int net_get_unique_predictable_data(struct udev_device *device, uint64_t *result);
48 const char *net_get_name(struct udev_device *device);
49
50 void serialize_in_addrs(FILE *f, const struct in_addr *addresses, size_t size);
51 int deserialize_in_addrs(struct in_addr **addresses, const char *string);
52 void serialize_in6_addrs(FILE *f, const struct in6_addr *addresses,
53 size_t size);
54 int deserialize_in6_addrs(struct in6_addr **addresses, const char *string);
55
56 /* don't include "dhcp-lease-internal.h" as it causes conflicts between netinet/ip.h and linux/ip.h */
57 struct sd_dhcp_route;
58
59 void serialize_dhcp_routes(FILE *f, const char *key, sd_dhcp_route **routes, size_t size);
60 int deserialize_dhcp_routes(struct sd_dhcp_route **ret, size_t *ret_size, size_t *ret_allocated, const char *string);
61
62 /* It is not necessary to add deserialize_dhcp_option(). Use unhexmem() instead. */
63 int serialize_dhcp_option(FILE *f, const char *key, const void *data, size_t size);