]>
git.ipfire.org Git - thirdparty/systemd.git/blob - src/libsystemd-network/network-internal.h
1 /* SPDX-License-Identifier: LGPL-2.1+ */
5 This file is part of systemd.
7 Copyright (C) 2013 Tom Gundersen <teg@jklm.no>
12 #include "sd-dhcp-lease.h"
14 #include "condition.h"
18 #define LINK_BRIDGE_PORT_PRIORITY_INVALID 128
19 #define LINK_BRIDGE_PORT_PRIORITY_MAX 63
21 bool net_match_config(Set
*match_mac
,
22 char * const *match_path
,
23 char * const *match_driver
,
24 char * const *match_type
,
25 char * const *match_name
,
26 Condition
*match_host
,
27 Condition
*match_virt
,
28 Condition
*match_kernel_cmdline
,
29 Condition
*match_kernel_version
,
30 Condition
*match_arch
,
31 const struct ether_addr
*dev_mac
,
33 const char *dev_parent_driver
,
34 const char *dev_driver
,
36 const char *dev_name
);
38 int config_parse_net_condition(const char *unit
, const char *filename
, unsigned line
,
39 const char *section
, unsigned section_line
, const char *lvalue
,
40 int ltype
, const char *rvalue
, void *data
, void *userdata
);
42 int config_parse_hwaddr(const char *unit
, const char *filename
, unsigned line
,
43 const char *section
, unsigned section_line
, const char *lvalue
,
44 int ltype
, const char *rvalue
, void *data
, void *userdata
);
46 int config_parse_hwaddrs(const char *unit
, const char *filename
, unsigned line
,
47 const char *section
, unsigned section_line
, const char *lvalue
,
48 int ltype
, const char *rvalue
, void *data
, void *userdata
);
50 int config_parse_ifnames(const char *unit
, const char *filename
, unsigned line
,
51 const char *section
, unsigned section_line
, const char *lvalue
,
52 int ltype
, const char *rvalue
, void *data
, void *userdata
);
54 int config_parse_ifalias(const char *unit
, const char *filename
, unsigned line
,
55 const char *section
, unsigned section_line
, const char *lvalue
,
56 int ltype
, const char *rvalue
, void *data
, void *userdata
);
58 int config_parse_iaid(const char *unit
, const char *filename
, unsigned line
,
59 const char *section
, unsigned section_line
, const char *lvalue
,
60 int ltype
, const char *rvalue
, void *data
, void *userdata
);
62 int config_parse_bridge_port_priority(const char *unit
, const char *filename
, unsigned line
,
63 const char *section
, unsigned section_line
, const char *lvalue
,
64 int ltype
, const char *rvalue
, void *data
, void *userdata
);
66 int net_get_unique_predictable_data(struct udev_device
*device
, uint64_t *result
);
67 const char *net_get_name(struct udev_device
*device
);
69 void serialize_in_addrs(FILE *f
, const struct in_addr
*addresses
, size_t size
);
70 int deserialize_in_addrs(struct in_addr
**addresses
, const char *string
);
71 void serialize_in6_addrs(FILE *f
, const struct in6_addr
*addresses
,
73 int deserialize_in6_addrs(struct in6_addr
**addresses
, const char *string
);
75 /* don't include "dhcp-lease-internal.h" as it causes conflicts between netinet/ip.h and linux/ip.h */
78 void serialize_dhcp_routes(FILE *f
, const char *key
, sd_dhcp_route
**routes
, size_t size
);
79 int deserialize_dhcp_routes(struct sd_dhcp_route
**ret
, size_t *ret_size
, size_t *ret_allocated
, const char *string
);
81 int serialize_dhcp_option(FILE *f
, const char *key
, const void *data
, size_t size
);
82 int deserialize_dhcp_option(void **data
, size_t *data_len
, const char *string
);