Technical data

Gateway Routing Daemon (GATED) Configuration Reference
A.16 The Kernel Statement
Due to an oversight, some systems (such as OSF/1) that are based on BSD
4.3 Reno or later, do not have the getkerninfo() system call described below,
which allows GATED to read routes from the kernel without knowing about
kernel internal structures. On these systems it is necessary to read the
kernel radix tree from kernel memory. This is even more error-prone than
reading the hash based forwding table.
Reading the forwarding table via
getkerninfo
or
sysctl
Besides the routing socket, BSD 4.3 Reno introduced the
getkerninfo( )
system call. This call allows a user process (of which GATED is one) to read
information from the kernel without knowledge of the kernel data structures.
In the case of the forwarding table, it is returned to GATED atomically as a
series of routing socket messages. This prevents the problem associated with
the forwarding table changing while GATED is in the process of reading it.
BSD 4.4 changed the
getkerninfo( )
interface into the
sysctl( )
interface,
which takes different parameters, but otherwise functions identically.
Reading the forwarding table via OS specific methods
Some operating systems define their own method of reading the kernel
forwarding table.
A.16.4 Reading the Interface List
The kernel support subsystem of GATED is resposible for reading the status of
the kernel’s physical and protocl interfaces periodically. GATED detects changes
in the interface list and notifies the protocols so they can start or stop instances
or peers. The interface list is read one of two ways:
Reading the interface list with SIOCGIFCONF
On systems based on BSD 4.3, 4.3 Reno and 4.3 Net/2 the SIOCGIFCONF
ioctl
interface is used to read the kernel interface list. Using this method,
a list of interfaces and some basic information about them is return by the
SIOCGIFCONF call. Other information must be learned by issuing other
ioctl
s to learn the interface network mask, flags, MTU, metric, destination
address (for point-to-point interfaces) and broadcast address (for broadcast
capable interfaces).
GATED reads rereads this list every 15 second looking for changes. When
the routing socket is in use, it also rereads it whenever a messages is
received indicating a change in routing configuration. Receipt of a SIGUSR2
signal also causes GATED to reread the list. This interval may be explicitly
configured in the interface configuration.
Reading the interface list with
sysctl
BSD 4.4 added the ability to read the kernel interface list via the
sysctl
system call. The interface status is returned atomically as a list of routing
socket messages that GATED parses for the required information.
BSD 4.4 also added routing socket messsages to report interface status
changes immediately. This allows GATED to react quickly to changes in
interface configuration.
When this method is in use, GATED rereads the interface list only once a
minute. It also rereads it on routing table changes indications and when
a SIGUSR2 is received. This interval may be explicitly configured in the
interface configuration.
A–26 Gateway Routing Daemon (GATED) Configuration Reference