HP-UX Reference (11i v3 07/02) - 4 File Formats (vol 8)

g
gated.conf(4) gated.conf(4)
There are compilation time and configuration time options that cause delete and add sequences
to be used in lieu of change messages.
Expandable
New levels of kernel/GateD communications may be added by adding new message types.
Reading the Forwarding Table
When GateD starts up it reads the kernel forwarding table and installs corresponding routes in the routing
table. These routes are called remnants and are timed out after a configured interval (which defaults to 3
minutes), or as soon as a more attractive route is learned. This allows forwarding to occur during the time
it takes the routing protocols to start learning routes.
There are three main methods for reading the forwarding table from the kernel.
Reading forwarding table via kmem
On many systems, especially those based on BSD 4.3, GateD must have knowledge of the kernel data struc-
tures and can go into the kernel to read the current state of forwarding table. This method is slow and sub-
ject to error if the kernel forwarding table is updated while GateD is in the middle of reading it. This can
happen if the system administrator uses the route command, or an ICMP redirect message is received
while GateD is starting up.
Due to an oversight some systems, such as OSF/1, which 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 know about kernel internal structures. On these systems it is necessary to read the kernel radix
tree from the kernel by poking around in kernel memory. This is even more error prone than reading the
hash based forwarding table.
Reading the forwarding table via getkerninfo/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 various 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, for example SunOS 5, define their own method of reading the kernel forwarding
table. The SunOS 5 version is similar in concept to the getkerninfo() method.
Reading the interface list
The kernel support subsystem of GateD is responsible for reading the status of the kernel physical and pro-
tocol 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 returned by the SIOCGIFCONF call. Other information must be learned by issuing other ioctls 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 re-reads this list every 15 second looking for changes. When the routing socket is in use, it
also re-reads it whenever a messages is received indicating a change in routing configuration. Receipt of a
SIGUSR2 signal also causes GateD to re-read the list. This interval may be explicitly configured in the inter-
face 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 which GateD parses for the required information.
BSD 4.4 also added routing socket messages to report interface status changes immediately. This allows
GateD to react quickly to changes in interface configuration.
164 Hewlett-Packard Company 37 HP-UX 11i Version 3: February 2007