2017-11-18 17:09:20 +01:00
|
|
|
/* SPDX-License-Identifier: LGPL-2.1+ */
|
2015-08-27 13:59:06 +02:00
|
|
|
#pragma once
|
|
|
|
|
2019-10-25 09:29:23 +02:00
|
|
|
#include <linux/nl80211.h>
|
|
|
|
|
2016-04-29 04:52:04 +02:00
|
|
|
#include "sd-bus.h"
|
2018-08-22 07:30:49 +02:00
|
|
|
#include "sd-device.h"
|
2019-12-20 14:13:18 +01:00
|
|
|
#include "sd-ipv4acd.h"
|
2016-04-29 04:52:04 +02:00
|
|
|
|
2019-10-30 09:02:15 +01:00
|
|
|
#include "bridge.h"
|
2015-08-27 13:59:06 +02:00
|
|
|
#include "condition.h"
|
2018-05-22 13:10:17 +02:00
|
|
|
#include "conf-parser.h"
|
2016-04-29 04:52:04 +02:00
|
|
|
#include "hashmap.h"
|
2019-10-30 09:02:15 +01:00
|
|
|
#include "netdev.h"
|
2017-04-25 12:36:50 +02:00
|
|
|
#include "networkd-address-label.h"
|
2018-05-22 13:10:17 +02:00
|
|
|
#include "networkd-address.h"
|
2016-06-01 15:18:21 +02:00
|
|
|
#include "networkd-brvlan.h"
|
2019-06-29 20:57:47 +02:00
|
|
|
#include "networkd-dhcp-common.h"
|
|
|
|
#include "networkd-dhcp4.h"
|
2019-09-20 04:22:17 +02:00
|
|
|
#include "networkd-dhcp-server.h"
|
2015-08-27 13:59:06 +02:00
|
|
|
#include "networkd-fdb.h"
|
2017-02-11 00:47:55 +01:00
|
|
|
#include "networkd-ipv6-proxy-ndp.h"
|
2019-05-09 07:21:55 +02:00
|
|
|
#include "networkd-lldp-rx.h"
|
2018-05-22 13:10:17 +02:00
|
|
|
#include "networkd-lldp-tx.h"
|
2020-01-09 13:19:53 +01:00
|
|
|
#include "networkd-ndisc.h"
|
2018-11-29 04:00:58 +01:00
|
|
|
#include "networkd-neighbor.h"
|
2019-10-04 21:40:51 +02:00
|
|
|
#include "networkd-nexthop.h"
|
2018-01-04 14:11:38 +01:00
|
|
|
#include "networkd-radv.h"
|
2015-11-18 22:46:33 +01:00
|
|
|
#include "networkd-route.h"
|
2017-09-14 21:51:39 +02:00
|
|
|
#include "networkd-routing-policy-rule.h"
|
2015-08-27 13:59:06 +02:00
|
|
|
#include "networkd-util.h"
|
2019-02-20 22:50:25 +01:00
|
|
|
#include "ordered-set.h"
|
2018-05-22 13:10:17 +02:00
|
|
|
#include "resolve-util.h"
|
2015-08-27 13:59:06 +02:00
|
|
|
|
|
|
|
typedef enum IPv6PrivacyExtensions {
|
|
|
|
/* The values map to the kernel's /proc/sys/net/ipv6/conf/xxx/use_tempaddr values */
|
|
|
|
IPV6_PRIVACY_EXTENSIONS_NO,
|
|
|
|
IPV6_PRIVACY_EXTENSIONS_PREFER_PUBLIC,
|
|
|
|
IPV6_PRIVACY_EXTENSIONS_YES, /* aka prefer-temporary */
|
|
|
|
_IPV6_PRIVACY_EXTENSIONS_MAX,
|
|
|
|
_IPV6_PRIVACY_EXTENSIONS_INVALID = -1,
|
|
|
|
} IPv6PrivacyExtensions;
|
|
|
|
|
2019-06-03 05:31:13 +02:00
|
|
|
typedef enum KeepConfiguration {
|
2019-06-03 19:05:26 +02:00
|
|
|
KEEP_CONFIGURATION_NO = 0,
|
|
|
|
KEEP_CONFIGURATION_DHCP_ON_START = 1 << 0,
|
|
|
|
KEEP_CONFIGURATION_DHCP_ON_STOP = 1 << 1,
|
|
|
|
KEEP_CONFIGURATION_DHCP = KEEP_CONFIGURATION_DHCP_ON_START | KEEP_CONFIGURATION_DHCP_ON_STOP,
|
|
|
|
KEEP_CONFIGURATION_STATIC = 1 << 2,
|
|
|
|
KEEP_CONFIGURATION_YES = KEEP_CONFIGURATION_DHCP | KEEP_CONFIGURATION_STATIC,
|
2019-06-03 05:31:13 +02:00
|
|
|
_KEEP_CONFIGURATION_MAX,
|
|
|
|
_KEEP_CONFIGURATION_INVALID = -1,
|
|
|
|
} KeepConfiguration;
|
|
|
|
|
2016-04-29 04:52:04 +02:00
|
|
|
typedef struct Manager Manager;
|
|
|
|
|
2015-08-27 13:59:06 +02:00
|
|
|
struct Network {
|
|
|
|
Manager *manager;
|
|
|
|
|
|
|
|
char *filename;
|
|
|
|
char *name;
|
2019-10-23 15:20:48 +02:00
|
|
|
usec_t timestamp;
|
2015-08-27 13:59:06 +02:00
|
|
|
|
2019-05-04 07:52:38 +02:00
|
|
|
unsigned n_ref;
|
|
|
|
|
2018-05-09 04:59:18 +02:00
|
|
|
Set *match_mac;
|
2019-01-07 12:16:19 +01:00
|
|
|
Set *match_permanent_mac;
|
2015-08-27 13:59:06 +02:00
|
|
|
char **match_path;
|
|
|
|
char **match_driver;
|
|
|
|
char **match_type;
|
|
|
|
char **match_name;
|
2019-06-22 18:44:13 +02:00
|
|
|
char **match_property;
|
2019-10-25 09:29:23 +02:00
|
|
|
char **match_wlan_iftype;
|
2019-07-24 07:46:55 +02:00
|
|
|
char **match_ssid;
|
2019-07-24 08:32:24 +02:00
|
|
|
Set *match_bssid;
|
2019-03-23 16:27:09 +01:00
|
|
|
LIST_HEAD(Condition, conditions);
|
2015-08-27 13:59:06 +02:00
|
|
|
|
|
|
|
char *description;
|
|
|
|
|
|
|
|
NetDev *bridge;
|
|
|
|
NetDev *bond;
|
2016-06-13 01:05:49 +02:00
|
|
|
NetDev *vrf;
|
2019-07-08 17:09:46 +02:00
|
|
|
NetDev *xfrm;
|
2015-08-27 13:59:06 +02:00
|
|
|
Hashmap *stacked_netdevs;
|
2019-02-21 08:40:34 +01:00
|
|
|
char *bridge_name;
|
|
|
|
char *bond_name;
|
|
|
|
char *vrf_name;
|
|
|
|
Hashmap *stacked_netdev_names;
|
2015-08-27 13:59:06 +02:00
|
|
|
|
|
|
|
/* DHCP Client Support */
|
2019-08-03 22:09:08 +02:00
|
|
|
AddressFamily dhcp;
|
2017-08-15 06:50:25 +02:00
|
|
|
DHCPClientIdentifier dhcp_client_identifier;
|
2015-08-27 13:59:06 +02:00
|
|
|
char *dhcp_vendor_class_identifier;
|
2020-03-30 16:43:28 +02:00
|
|
|
char *dhcp_mudurl;
|
2018-05-07 14:21:02 +02:00
|
|
|
char **dhcp_user_class;
|
2016-01-25 21:47:02 +01:00
|
|
|
char *dhcp_hostname;
|
2019-05-04 13:40:54 +02:00
|
|
|
uint64_t dhcp_max_attempts;
|
2016-11-18 17:01:32 +01:00
|
|
|
unsigned dhcp_route_metric;
|
|
|
|
uint32_t dhcp_route_table;
|
2019-12-19 11:05:16 +01:00
|
|
|
uint32_t dhcp_route_mtu;
|
2016-12-06 12:22:33 +01:00
|
|
|
uint16_t dhcp_client_port;
|
2019-09-26 20:06:02 +02:00
|
|
|
int dhcp_critical;
|
|
|
|
int ip_service_type;
|
2017-07-30 01:10:40 +02:00
|
|
|
bool dhcp_anonymize;
|
2016-01-25 21:47:02 +01:00
|
|
|
bool dhcp_send_hostname;
|
2015-08-27 13:59:06 +02:00
|
|
|
bool dhcp_broadcast;
|
2016-11-18 17:01:32 +01:00
|
|
|
bool dhcp_use_dns;
|
2019-07-16 19:47:20 +02:00
|
|
|
bool dhcp_routes_to_dns;
|
2016-11-18 17:01:32 +01:00
|
|
|
bool dhcp_use_ntp;
|
2019-09-18 15:22:47 +02:00
|
|
|
bool dhcp_use_sip;
|
2016-11-18 17:01:32 +01:00
|
|
|
bool dhcp_use_mtu;
|
2016-01-25 21:47:02 +01:00
|
|
|
bool dhcp_use_routes;
|
2020-03-16 10:55:10 +01:00
|
|
|
bool dhcp_use_gateway;
|
2016-01-25 21:47:02 +01:00
|
|
|
bool dhcp_use_timezone;
|
2018-01-22 09:09:18 +01:00
|
|
|
bool rapid_commit;
|
2016-11-18 17:01:32 +01:00
|
|
|
bool dhcp_use_hostname;
|
2017-09-07 11:08:39 +02:00
|
|
|
bool dhcp_route_table_set;
|
2019-05-13 16:30:28 +02:00
|
|
|
bool dhcp_send_release;
|
2019-12-20 14:13:18 +01:00
|
|
|
bool dhcp_send_decline;
|
2016-11-18 17:01:32 +01:00
|
|
|
DHCPUseDomains dhcp_use_domains;
|
2019-12-20 14:13:18 +01:00
|
|
|
sd_ipv4acd *dhcp_acd;
|
2019-05-01 00:47:41 +02:00
|
|
|
Set *dhcp_black_listed_ip;
|
2019-09-17 14:49:22 +02:00
|
|
|
Set *dhcp_request_options;
|
2019-11-18 10:29:29 +01:00
|
|
|
OrderedHashmap *dhcp_client_send_options;
|
2020-02-28 19:28:49 +01:00
|
|
|
OrderedHashmap *dhcp_client_send_vendor_options;
|
2019-11-18 10:29:29 +01:00
|
|
|
OrderedHashmap *dhcp_server_send_options;
|
2020-02-28 19:28:49 +01:00
|
|
|
OrderedHashmap *dhcp_server_send_vendor_options;
|
2015-08-27 13:59:06 +02:00
|
|
|
|
2019-07-09 16:23:28 +02:00
|
|
|
/* DHCPv6 Client support*/
|
|
|
|
bool dhcp6_use_dns;
|
|
|
|
bool dhcp6_use_ntp;
|
2020-02-15 13:51:34 +01:00
|
|
|
bool dhcp6_without_ra;
|
2019-09-25 05:14:12 +02:00
|
|
|
uint8_t dhcp6_pd_length;
|
2020-03-30 16:31:10 +02:00
|
|
|
char *dhcp6_mudurl;
|
2019-09-25 05:14:12 +02:00
|
|
|
struct in6_addr dhcp6_pd_address;
|
2019-07-09 16:23:28 +02:00
|
|
|
|
2015-08-27 13:59:06 +02:00
|
|
|
/* DHCP Server Support */
|
|
|
|
bool dhcp_server;
|
2019-09-18 15:22:47 +02:00
|
|
|
|
2015-08-27 14:48:37 +02:00
|
|
|
bool dhcp_server_emit_dns;
|
|
|
|
struct in_addr *dhcp_server_dns;
|
|
|
|
unsigned n_dhcp_server_dns;
|
2019-09-18 15:22:47 +02:00
|
|
|
|
2015-08-27 14:48:37 +02:00
|
|
|
bool dhcp_server_emit_ntp;
|
|
|
|
struct in_addr *dhcp_server_ntp;
|
|
|
|
unsigned n_dhcp_server_ntp;
|
2019-09-18 15:22:47 +02:00
|
|
|
|
|
|
|
bool dhcp_server_emit_sip;
|
|
|
|
struct in_addr *dhcp_server_sip;
|
|
|
|
unsigned n_dhcp_server_sip;
|
|
|
|
|
2020-03-27 21:12:07 +01:00
|
|
|
struct in_addr *dhcp_server_pop3;
|
|
|
|
unsigned n_dhcp_server_pop3;
|
|
|
|
|
2020-03-23 10:40:49 +01:00
|
|
|
struct in_addr *dhcp_server_smtp;
|
|
|
|
unsigned n_dhcp_server_smtp;
|
|
|
|
|
2016-05-18 01:34:25 +02:00
|
|
|
bool dhcp_server_emit_router;
|
2015-08-27 13:59:06 +02:00
|
|
|
bool dhcp_server_emit_timezone;
|
2015-08-27 14:48:37 +02:00
|
|
|
char *dhcp_server_timezone;
|
2015-08-27 13:59:06 +02:00
|
|
|
usec_t dhcp_server_default_lease_time_usec, dhcp_server_max_lease_time_usec;
|
2015-08-29 00:18:20 +02:00
|
|
|
uint32_t dhcp_server_pool_offset;
|
|
|
|
uint32_t dhcp_server_pool_size;
|
2015-08-27 13:59:06 +02:00
|
|
|
|
|
|
|
/* IPV4LL Support */
|
2019-08-03 22:09:08 +02:00
|
|
|
AddressFamily link_local;
|
2015-08-27 13:59:06 +02:00
|
|
|
bool ipv4ll_route;
|
|
|
|
|
2019-05-14 09:43:14 +02:00
|
|
|
bool default_route_on_device;
|
|
|
|
|
2017-05-12 15:48:30 +02:00
|
|
|
/* IPv6 prefix delegation support */
|
2018-01-04 14:11:39 +01:00
|
|
|
RADVPrefixDelegation router_prefix_delegation;
|
2017-05-12 15:48:30 +02:00
|
|
|
usec_t router_lifetime_usec;
|
|
|
|
uint8_t router_preference;
|
|
|
|
bool router_managed;
|
|
|
|
bool router_other_information;
|
2017-09-29 10:10:19 +02:00
|
|
|
bool router_emit_dns;
|
|
|
|
bool router_emit_domains;
|
2017-08-14 11:53:10 +02:00
|
|
|
usec_t router_dns_lifetime_usec;
|
|
|
|
struct in6_addr *router_dns;
|
|
|
|
unsigned n_router_dns;
|
2019-02-20 22:50:25 +01:00
|
|
|
OrderedSet *router_search_domains;
|
2018-09-07 22:15:55 +02:00
|
|
|
bool dhcp6_force_pd_other_information; /* Start DHCPv6 PD also when 'O'
|
|
|
|
RA flag is set, see RFC 7084,
|
|
|
|
WPD-4 */
|
2017-05-12 15:48:30 +02:00
|
|
|
|
2015-08-27 13:59:06 +02:00
|
|
|
/* Bridge Support */
|
2018-04-27 10:32:28 +02:00
|
|
|
int use_bpdu;
|
|
|
|
int hairpin;
|
|
|
|
int fast_leave;
|
|
|
|
int allow_port_to_be_root;
|
|
|
|
int unicast_flood;
|
2019-03-10 21:25:24 +01:00
|
|
|
int multicast_flood;
|
2018-12-03 11:47:36 +01:00
|
|
|
int multicast_to_unicast;
|
2019-03-10 21:25:24 +01:00
|
|
|
int neighbor_suppression;
|
|
|
|
int learning;
|
2019-05-04 16:51:13 +02:00
|
|
|
int bridge_proxy_arp;
|
|
|
|
int bridge_proxy_arp_wifi;
|
2017-04-11 23:17:31 +02:00
|
|
|
uint32_t cost;
|
|
|
|
uint16_t priority;
|
2019-05-09 02:32:12 +02:00
|
|
|
MulticastRouter multicast_router;
|
2015-08-27 13:59:06 +02:00
|
|
|
|
2016-08-04 17:11:13 +02:00
|
|
|
bool use_br_vlan;
|
2016-06-01 15:18:21 +02:00
|
|
|
uint16_t pvid;
|
|
|
|
uint32_t br_vid_bitmap[BRIDGE_VLAN_BITMAP_LEN];
|
|
|
|
uint32_t br_untagged_bitmap[BRIDGE_VLAN_BITMAP_LEN];
|
|
|
|
|
2018-04-10 17:26:20 +02:00
|
|
|
/* CAN support */
|
2020-03-30 23:05:56 +02:00
|
|
|
uint32_t can_bitrate;
|
2018-04-10 17:26:20 +02:00
|
|
|
unsigned can_sample_point;
|
2020-03-26 22:27:41 +01:00
|
|
|
uint32_t can_data_bitrate;
|
|
|
|
unsigned can_data_sample_point;
|
2018-04-10 17:26:20 +02:00
|
|
|
usec_t can_restart_us;
|
2019-03-11 15:25:20 +01:00
|
|
|
int can_triple_sampling;
|
2020-02-12 03:13:45 +01:00
|
|
|
int can_termination;
|
2020-03-16 05:40:30 +01:00
|
|
|
int can_listen_only;
|
2020-03-26 22:27:41 +01:00
|
|
|
int can_fd_mode;
|
|
|
|
int can_non_iso;
|
2018-04-10 17:26:20 +02:00
|
|
|
|
2019-08-03 22:09:08 +02:00
|
|
|
AddressFamily ip_forward;
|
2015-08-27 13:59:06 +02:00
|
|
|
bool ip_masquerade;
|
|
|
|
|
2015-09-12 04:48:06 +02:00
|
|
|
int ipv6_accept_ra;
|
2015-10-12 11:01:10 +02:00
|
|
|
int ipv6_dad_transmits;
|
2015-11-10 04:56:38 +01:00
|
|
|
int ipv6_hop_limit;
|
2017-05-09 20:04:55 +02:00
|
|
|
int ipv6_proxy_ndp;
|
2016-04-14 11:56:57 +02:00
|
|
|
int proxy_arp;
|
2018-04-20 16:33:00 +02:00
|
|
|
uint32_t ipv6_mtu;
|
2015-09-12 04:48:06 +02:00
|
|
|
|
network: beef up ipv6 RA support considerably
This reworks sd-ndisc and networkd substantially to support IPv6 RA much more
comprehensively. Since the API is extended quite a bit networkd has been ported
over too, and the patch is not as straight-forward as one could wish. The
rework includes:
- Support for DNSSL, RDNSS and RA routing options in sd-ndisc and networkd. Two
new configuration options have been added to networkd to make this
configurable.
- sd-ndisc now exposes an sd_ndisc_router object that encapsulates a full RA
message, and has direct, friendly acessor functions for the singleton RA
properties, as well as an iterative interface to iterate through known and
unsupported options. The router object may either be retrieved from the wire,
or generated from raw data. In many ways the sd-ndisc API now matches the
sd-lldp API, except that no implicit database of seen data is kept. (Note
that sd-ndisc actually had a half-written, but unused implementaiton of such
a store, which is removed now.)
- sd-ndisc will now collect the reception timestamps of RA, which is useful to
make sd_ndisc_router fully descriptive of what it covers.
Fixes: #1079
2016-06-02 20:38:12 +02:00
|
|
|
bool ipv6_accept_ra_use_dns;
|
2019-02-14 16:35:17 +01:00
|
|
|
bool ipv6_accept_ra_use_autonomous_prefix;
|
|
|
|
bool ipv6_accept_ra_use_onlink_prefix;
|
2016-12-21 19:10:36 +01:00
|
|
|
bool active_slave;
|
|
|
|
bool primary_slave;
|
2020-04-08 16:01:21 +02:00
|
|
|
bool ipv6_accept_ra_route_table_set;
|
network: beef up ipv6 RA support considerably
This reworks sd-ndisc and networkd substantially to support IPv6 RA much more
comprehensively. Since the API is extended quite a bit networkd has been ported
over too, and the patch is not as straight-forward as one could wish. The
rework includes:
- Support for DNSSL, RDNSS and RA routing options in sd-ndisc and networkd. Two
new configuration options have been added to networkd to make this
configurable.
- sd-ndisc now exposes an sd_ndisc_router object that encapsulates a full RA
message, and has direct, friendly acessor functions for the singleton RA
properties, as well as an iterative interface to iterate through known and
unsupported options. The router object may either be retrieved from the wire,
or generated from raw data. In many ways the sd-ndisc API now matches the
sd-lldp API, except that no implicit database of seen data is kept. (Note
that sd-ndisc actually had a half-written, but unused implementaiton of such
a store, which is removed now.)
- sd-ndisc will now collect the reception timestamps of RA, which is useful to
make sd_ndisc_router fully descriptive of what it covers.
Fixes: #1079
2016-06-02 20:38:12 +02:00
|
|
|
DHCPUseDomains ipv6_accept_ra_use_domains;
|
2020-04-08 16:01:21 +02:00
|
|
|
IPv6AcceptRAStartDHCP6Client ipv6_accept_ra_start_dhcp6_client;
|
2016-09-19 04:59:11 +02:00
|
|
|
uint32_t ipv6_accept_ra_route_table;
|
2019-05-17 18:21:20 +02:00
|
|
|
Set *ndisc_black_listed_prefix;
|
2020-01-09 13:19:53 +01:00
|
|
|
OrderedHashmap *ipv6_tokens;
|
network: beef up ipv6 RA support considerably
This reworks sd-ndisc and networkd substantially to support IPv6 RA much more
comprehensively. Since the API is extended quite a bit networkd has been ported
over too, and the patch is not as straight-forward as one could wish. The
rework includes:
- Support for DNSSL, RDNSS and RA routing options in sd-ndisc and networkd. Two
new configuration options have been added to networkd to make this
configurable.
- sd-ndisc now exposes an sd_ndisc_router object that encapsulates a full RA
message, and has direct, friendly acessor functions for the singleton RA
properties, as well as an iterative interface to iterate through known and
unsupported options. The router object may either be retrieved from the wire,
or generated from raw data. In many ways the sd-ndisc API now matches the
sd-lldp API, except that no implicit database of seen data is kept. (Note
that sd-ndisc actually had a half-written, but unused implementaiton of such
a store, which is removed now.)
- sd-ndisc will now collect the reception timestamps of RA, which is useful to
make sd_ndisc_router fully descriptive of what it covers.
Fixes: #1079
2016-06-02 20:38:12 +02:00
|
|
|
|
2015-08-27 13:59:06 +02:00
|
|
|
IPv6PrivacyExtensions ipv6_privacy_extensions;
|
|
|
|
|
|
|
|
struct ether_addr *mac;
|
2018-04-20 16:33:00 +02:00
|
|
|
uint32_t mtu;
|
2016-08-04 16:00:58 +02:00
|
|
|
int arp;
|
2018-05-29 16:58:11 +02:00
|
|
|
int multicast;
|
2018-06-01 16:22:12 +02:00
|
|
|
int allmulticast;
|
2016-09-28 00:18:14 +02:00
|
|
|
bool unmanaged;
|
2017-09-06 16:57:04 +02:00
|
|
|
bool configure_without_carrier;
|
2018-06-01 11:34:49 +02:00
|
|
|
bool ignore_carrier_loss;
|
2019-06-03 05:31:13 +02:00
|
|
|
KeepConfiguration keep_configuration;
|
2016-03-31 01:33:55 +02:00
|
|
|
uint32_t iaid;
|
networkd: rework duid_{type,duid_type,duid,duid_len} setting
Separate fields are replaced with a struct.
Second second duid type field is removed. The first field was used to carry
the result of DUIDType= configuration, and the second was either a copy of
this, or contained the type extracted from DuidRawData. The semantics are changed
so that the type specified in DUIDType is always used. DUIDRawData= no longer
overrides the type setting.
The networkd code is now more constrained than the sd-dhcp code:
DUIDRawData cannot have 0 length, length 0 is treated the same as unsetting.
Likewise, it is not possible to set a DUIDType=0. If it ever becomes necessary
to set type=0 or a zero-length duid, the code can be changed to support that.
Nevertheless, I think that's unlikely.
This addresses #3127 § 1 and 3.
v2:
- rename DUID.duid, DUID.duid_len to DUID.raw_data, DUID.raw_data_len
2016-04-29 05:23:45 +02:00
|
|
|
DUID duid;
|
2015-08-27 13:59:06 +02:00
|
|
|
|
2018-11-23 22:19:26 +01:00
|
|
|
bool iaid_set;
|
|
|
|
|
2017-11-30 18:03:50 +01:00
|
|
|
bool required_for_online; /* Is this network required to be considered online? */
|
2020-01-09 21:31:50 +01:00
|
|
|
LinkOperationalStateRange required_operstate_for_online;
|
2017-11-30 18:03:50 +01:00
|
|
|
|
2020-03-30 21:57:58 +02:00
|
|
|
/* LLDP support */
|
2016-02-21 14:14:08 +01:00
|
|
|
LLDPMode lldp_mode; /* LLDP reception */
|
2016-05-06 21:27:36 +02:00
|
|
|
LLDPEmit lldp_emit; /* LLDP transmission */
|
2020-03-30 21:57:58 +02:00
|
|
|
char *lldp_mud; /* LLDP MUD URL */
|
2015-08-27 13:59:06 +02:00
|
|
|
|
|
|
|
LIST_HEAD(Address, static_addresses);
|
|
|
|
LIST_HEAD(Route, static_routes);
|
2019-10-04 21:40:51 +02:00
|
|
|
LIST_HEAD(NextHop, static_nexthops);
|
2015-08-27 13:59:06 +02:00
|
|
|
LIST_HEAD(FdbEntry, static_fdb_entries);
|
2017-02-11 00:47:55 +01:00
|
|
|
LIST_HEAD(IPv6ProxyNDPAddress, ipv6_proxy_ndp_addresses);
|
2018-11-29 04:00:58 +01:00
|
|
|
LIST_HEAD(Neighbor, neighbors);
|
2017-04-25 12:36:50 +02:00
|
|
|
LIST_HEAD(AddressLabel, address_labels);
|
2017-05-12 15:48:28 +02:00
|
|
|
LIST_HEAD(Prefix, static_prefixes);
|
2019-11-05 14:31:20 +01:00
|
|
|
LIST_HEAD(RoutePrefix, static_route_prefixes);
|
2017-09-14 21:51:39 +02:00
|
|
|
LIST_HEAD(RoutingPolicyRule, rules);
|
2015-08-27 13:59:06 +02:00
|
|
|
|
2016-06-03 19:14:12 +02:00
|
|
|
unsigned n_static_addresses;
|
|
|
|
unsigned n_static_routes;
|
2019-10-04 21:40:51 +02:00
|
|
|
unsigned n_static_nexthops;
|
2016-06-03 19:14:12 +02:00
|
|
|
unsigned n_static_fdb_entries;
|
2017-02-11 00:47:55 +01:00
|
|
|
unsigned n_ipv6_proxy_ndp_addresses;
|
2018-11-29 04:00:58 +01:00
|
|
|
unsigned n_neighbors;
|
2017-04-25 12:36:50 +02:00
|
|
|
unsigned n_address_labels;
|
2017-05-12 15:48:28 +02:00
|
|
|
unsigned n_static_prefixes;
|
2019-09-14 13:14:22 +02:00
|
|
|
unsigned n_static_route_prefixes;
|
2017-09-14 21:51:39 +02:00
|
|
|
unsigned n_rules;
|
2016-06-03 19:14:12 +02:00
|
|
|
|
2015-08-27 13:59:06 +02:00
|
|
|
Hashmap *addresses_by_section;
|
|
|
|
Hashmap *routes_by_section;
|
2019-10-04 21:40:51 +02:00
|
|
|
Hashmap *nexthops_by_section;
|
2015-08-27 13:59:06 +02:00
|
|
|
Hashmap *fdb_entries_by_section;
|
2018-11-29 04:00:58 +01:00
|
|
|
Hashmap *neighbors_by_section;
|
2017-04-25 12:36:50 +02:00
|
|
|
Hashmap *address_labels_by_section;
|
2017-05-12 15:48:28 +02:00
|
|
|
Hashmap *prefixes_by_section;
|
2019-09-14 13:14:22 +02:00
|
|
|
Hashmap *route_prefixes_by_section;
|
2017-09-14 21:51:39 +02:00
|
|
|
Hashmap *rules_by_section;
|
2020-02-10 12:53:00 +01:00
|
|
|
OrderedHashmap *tc_by_section;
|
2015-08-27 13:59:06 +02:00
|
|
|
|
2018-12-04 15:34:04 +01:00
|
|
|
/* All kinds of DNS configuration */
|
2016-11-18 17:04:26 +01:00
|
|
|
struct in_addr_data *dns;
|
|
|
|
unsigned n_dns;
|
2019-02-20 22:50:25 +01:00
|
|
|
OrderedSet *search_domains, *route_domains;
|
|
|
|
|
2018-12-04 15:34:04 +01:00
|
|
|
int dns_default_route;
|
2015-08-27 13:59:06 +02:00
|
|
|
ResolveSupport llmnr;
|
2016-01-05 17:32:25 +01:00
|
|
|
ResolveSupport mdns;
|
2016-01-05 19:57:33 +01:00
|
|
|
DnssecMode dnssec_mode;
|
2018-06-13 20:26:24 +02:00
|
|
|
DnsOverTlsMode dns_over_tls_mode;
|
2016-01-06 18:36:32 +01:00
|
|
|
Set *dnssec_negative_trust_anchors;
|
2015-08-27 13:59:06 +02:00
|
|
|
|
2018-12-04 15:34:04 +01:00
|
|
|
char **ntp;
|
2019-09-18 15:22:47 +02:00
|
|
|
char **sip;
|
2020-03-27 21:12:07 +01:00
|
|
|
char **pop3;
|
2020-03-23 10:40:49 +01:00
|
|
|
char **smtp;
|
2018-12-04 15:34:04 +01:00
|
|
|
char **bind_carrier;
|
2015-08-27 13:59:06 +02:00
|
|
|
};
|
|
|
|
|
2019-05-04 07:52:38 +02:00
|
|
|
Network *network_ref(Network *network);
|
|
|
|
Network *network_unref(Network *network);
|
|
|
|
DEFINE_TRIVIAL_CLEANUP_FUNC(Network*, network_unref);
|
2015-08-27 13:59:06 +02:00
|
|
|
|
2019-10-23 15:20:48 +02:00
|
|
|
int network_load(Manager *manager, OrderedHashmap **networks);
|
|
|
|
int network_reload(Manager *manager);
|
|
|
|
int network_load_one(Manager *manager, OrderedHashmap **networks, const char *filename);
|
2019-03-01 09:39:45 +01:00
|
|
|
int network_verify(Network *network);
|
2015-08-27 13:59:06 +02:00
|
|
|
|
|
|
|
int network_get_by_name(Manager *manager, const char *name, Network **ret);
|
2020-02-27 13:56:36 +01:00
|
|
|
int network_get(Manager *manager, unsigned short iftype, sd_device *device, const char *ifname, char * const *alternative_names,
|
2019-01-07 12:16:19 +01:00
|
|
|
const struct ether_addr *mac, const struct ether_addr *permanent_mac,
|
|
|
|
enum nl80211_iftype wlan_iftype, const char *ssid,
|
2019-12-15 14:46:19 +01:00
|
|
|
const struct ether_addr *bssid, Network **ret);
|
2016-09-28 12:32:31 +02:00
|
|
|
int network_apply(Network *network, Link *link);
|
2017-08-03 01:10:51 +02:00
|
|
|
void network_apply_anonymize_if_set(Network *network);
|
2015-08-27 13:59:06 +02:00
|
|
|
|
2019-08-27 16:15:24 +02:00
|
|
|
bool network_has_static_ipv6_configurations(Network *network);
|
2016-04-21 02:34:13 +02:00
|
|
|
|
2019-02-21 08:40:34 +01:00
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_stacked_netdev);
|
2018-05-22 13:10:17 +02:00
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_tunnel);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_ipv6token);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_ipv6_privacy_extensions);
|
2019-06-29 20:57:47 +02:00
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_domains);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_dns);
|
2018-05-22 13:10:17 +02:00
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_hostname);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_timezone);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_dnssec_negative_trust_anchors);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_ntp);
|
2019-03-06 06:29:49 +01:00
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_required_for_online);
|
2019-06-03 05:31:13 +02:00
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_keep_configuration);
|
2015-08-27 13:59:06 +02:00
|
|
|
|
2017-01-10 08:39:05 +01:00
|
|
|
const struct ConfigPerfItem* network_network_gperf_lookup(const char *key, GPERF_LEN_TYPE length);
|
2015-08-27 13:59:06 +02:00
|
|
|
|
|
|
|
const char* ipv6_privacy_extensions_to_string(IPv6PrivacyExtensions i) _const_;
|
|
|
|
IPv6PrivacyExtensions ipv6_privacy_extensions_from_string(const char *s) _pure_;
|
2016-01-25 22:27:01 +01:00
|
|
|
|
2019-06-03 05:31:13 +02:00
|
|
|
const char* keep_configuration_to_string(KeepConfiguration i) _const_;
|
|
|
|
KeepConfiguration keep_configuration_from_string(const char *s) _pure_;
|