route.7p (2010 09)
r
route(7P) route(7P)
/* generic interface information */
uint8_t ifi_type; /* ethernet, tokenring, etc */
uint8_t ifi_physical; /* AUI, Thinnet, 10base-T, etc */
uint8_t ifi_addrlen; /* media address length */
uint8_t ifi_hdrlen; /* media header length */
uint8_t ifi_recvquota; /* polling quota for receive intrs */
uint8_t ifi_xmitquota; /* polling quota for xmit intrs */
uint32_t ifi_mtu; /* maximum transmission unit */
uint32_t ifi_metric; /* routing metric (external only) */
uint32_t ifi_baudrate; /* linespeed */
/* volatile statistics */
uint32_t ifi_ipackets; /* packets received on interface */
uint32_t ifi_ierrors; /* input errors on interface */
uint32_t ifi_opackets; /* packets sent on interface */
uint32_t ifi_oerrors; /* output errors on interface */
uint32_t ifi_collisions; /* collisions on csma interfaces */
uint32_t ifi_ibytes; /* total number of octets received */
uint32_t ifi_obytes; /* total number of octets sent */
uint32_t ifi_imcasts; /* packets received via multicast */
uint32_t ifi_omcasts; /* packets sent via multicast */
uint32_t ifi_iqdrops; /* dropped on input, this interface */
uint32_t ifi_noproto; /* destined for unsupported protocol */
uint32_t ifi_hwassist; /* HW offload capabilities */
uint32_t ifi_unused; /* XXX was ifi_xmittiming */
struct timeval ifi_lastchange; /* time of last administrative change */
(Note that the position of items in all previously mentioned data structures does not necessarily reflect
the order of the members in the structure.)
The members
rtm_addrs, ifm_addrs, and ifam_addrs of the message headers are bitmasks that
specify what socket address structure(s) follow the message. When multiple sockaddrs follow the mes-
sage, they are interpreted based on their order in the message and the value stored in the bitmask. The
sequence is least significant to the most significant bit within the vector.
The following constants are defined to indicate which socket addresses are present in the routing mes-
sage:
#define RTA_DST 0x01 /* destination sockaddr present */
#define RTA_GATEWAY 0x02 /* gateway sockaddr present */
#define RTA_NETMASK 0x04 /* netmask sockaddr present */
#define RTA_GENMASK 0x08 /* cloning mask sockaddr present */
#define RTA_IFP 0x10 /* interface name sockaddr present */
#define RTA_IFA 0x20 /* interface address sockaddr present */
#define RTA_AUTHOR 0x40 /* author of redirect sockaddr present */
#define RTA_BRD 0x80 /* for NEWADDR, broadcast or
* point-to-point destination
* address */
Any messages sent to the kernel are returned back to the process issuing the command, and message
copies are sent to all interested listeners. The sender may provide its process ID to be stored in the mes-
sage header. An additional sequence field can be used to distinguish between outstanding messages.
However, message replies may be lost when kernel buffers are exhausted.
Any messages generated by the kernel would have process ID and sequence field set to zero.
The kernel may spontaneously emit routing messages in response to external events, such as receipt of a
redirect command, or failure to locate an appropriate route for a request. A process may ignore all mes-
sages from the routing socket by doing a
shutdown() system call for further input.
Security Restrictions
Only users with appropriate privileges can make changes to the routing table.
Notes
Some fields in the message header structures are not used on HP-UX. This means when the kernel gen-
erates routing messages it sets these fields to 0. Also, when the kernel receives routing messages, it
HP-UX 11i Version 3: September 2010 − 3 − Hewlett-Packard Company 3