summaryrefslogtreecommitdiffstats
path: root/src/network/networkd-manager.h
diff options
context:
space:
mode:
authorAlvin Šipraga <alsi@bang-olufsen.dk>2021-03-30 21:39:18 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2021-05-19 03:33:55 +0200
commitbcdcc59648dabefaed4267a2432a9e7928f93cb5 (patch)
tree97653a2cd0da13178b6c0dae7d7204e8ae7c4ff8 /src/network/networkd-manager.h
parentMerge pull request #19611 from yuwata/network-dhcp-server-introduce-server-ad... (diff)
downloadsystemd-bcdcc59648dabefaed4267a2432a9e7928f93cb5.tar.xz
systemd-bcdcc59648dabefaed4267a2432a9e7928f93cb5.zip
network: add an online state for links and manager
Add a new state of type LinkOnlineState which indicates whether a link is online or not. The state is also used by networkd's manager to expose the overall online state of the system. The possible states are: offline the link (or system) is offline partial at least one required link is online (see below) online all required links are online For links, a link is defined to be "online" if: - it is managed; and - its operational state is within the range defined by RequiredForOnline=; and - it has an IPv4 address if RequiredFamilyForOnline=ipv4 or =both; and - it has an IPv6 address if RequiredFamilyForOnline=ipv6 or =both. A link is defined to be "offline" if: - it is managed; and - it is not online, i.e. its operational state is not within the range defined by RequiredForOnline=, and/or it is missing an IP address in a required address family. Otherwise, the link online state is undefined (represented internally as _LINK_ONLINE_STATUS_INVALID or -EINVAL). Put another way, networkd will only offer a meaningful online state for managed links where RequiredForOnline=yes. For the manager, the online state is a function of the online state of all links which are requried for online, i.e. RequiredForOnline=yes. If all required links are online, then the manager online state is defined to be "online". If at least one of the required links is online, then the manager online state is defined to be "partial". If none of the required links are online, then the manager online state is defined to be "offline". If there are no managed links, or RequiredForOnline=no for all managed links, then the manager online state is undefined as above. The purpose of the "partial" state is analogous to the --any switch in systemd-networkd-wait-online.service(8). For example, a required link which lacks a carrier on boot will not force the overall (manager) online state to "offline" if there is an alternative link available.
Diffstat (limited to 'src/network/networkd-manager.h')
-rw-r--r--src/network/networkd-manager.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/network/networkd-manager.h b/src/network/networkd-manager.h
index 3f8f81b865..ef98c519d6 100644
--- a/src/network/networkd-manager.h
+++ b/src/network/networkd-manager.h
@@ -42,6 +42,7 @@ struct Manager {
LinkAddressState address_state;
LinkAddressState ipv4_address_state;
LinkAddressState ipv6_address_state;
+ LinkOnlineState online_state;
Hashmap *links;
Hashmap *netdevs;