Notification Chains for the Networking Subsystems
The kernel defines at least 10 different notification chains. Here we are interested in the ones that are used to signal events of particular importance to the networking code. The main ones are:
-
inetaddr_chain Sends notifications about the insertion, removal, and change of an Internet Protocol Version 4 (IPv4) address on a local interface. Chapter 23 describes when such notifications are generated. Internet Protocol Version 6 (IPv6) uses a similar chain (
inet6addr_chain).-
netdev_chain Sends notifications about the registration status of network devices. Chapter 8 describes when such notifications are generated.
For these chains, and others used by the networking subsystems, their purposes and uses are described in the chapter about the relevant notifier subsystem.
The networking code can register to notifications generated by other kernel
components, too. For example, some NIC device drivers register with the reboot_notifier_list chain, which is a chain that warns when
the system is about to reboot.
Wrappers
Most notification chains come with a set of wrappers used to register to them and
unregister from them. For example, this is the wrapper used to register to netdev_chain:
int register_netdevice_notifier(struct notifier_block *nb)
{
return notifier_chain_register(&netdev_chain, nb);
}Common names for wrappers include [un]register_
xxx
_notifier, xxx
_[un]register_notifier, and xxx
_[un]register.
Examples
Registrations to notification ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access