HP-UX Reference (11i v1 00/12) - 4 File Formats (vol 8)
__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man4/!!!intro.4
________________________________________________________________
___ ___
g
gated.conf(4) gated.conf(4)
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
return 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 broad-
cast 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.
When this method is in use, GateD re-reads the interface list only once a minute. It also re-reads it on rout-
ing table changes indications and when a SIGUSR2 is received. This interval may be explicitly configured in
the interface configuration.
Reading interface physical addresses
Later version of the getkerninfo() and sysctl() interfaces return the interface physical addresses as
part of the interface information. On most systems where this information is not returned, GateD scans the
kernel physical interface list for this information for interfaces with IFF_BROADCAST set, assuming that
their drivers are handled the same as Ethernet drivers. On some systems, such as SunOS 4 and SunOS 5,
system specific interfaces are used to learn this information
Section 4−−108 − 37 − HP-UX Release 11i: December 2000
___
___