#include <net/route.h>
net/route.h
structrt_metrics
These numbers are used by reliable protocols for determining
retransmission behavior and are included in the routing structure.
| u_int32_t | rmx_locks | Kernel leaves these values alone |
| u_int32_t | rmx_mtu | MTU for this path |
| u_int32_t | rmx_hopcount | max hops expected |
| int32_t | rmx_expire | lifetime for route, e.g. redirect |
| u_int32_t | rmx_recvpipe | inbound delay-bandwidth product |
| u_int32_t | rmx_sendpipe | outbound delay-bandwidth product |
| u_int32_t | rmx_ssthresh | outbound gateway buffer limit |
| u_int32_t | rmx_rtt | estimated round trip time |
| u_int32_t | rmx_rttvar | estimated rtt variance |
| u_int32_t | rmx_pksent | packets sent using this route |
| u_int32_t[4] | rmx_filler | will be used for TCP's peer-MSS cache |
macroRTM_RTTUNIT
rmx_rtt and rmx_rttvar are stored as microseconds;
#define RTM_RTTUNIT 1000000
units for rtt, rttvar, as units per sec
macroIS_DIRECT_HOSTROUTE
#define IS_DIRECT_HOSTROUTE(rt) (((rt)->rt_flags & (RTF_HOST | RTF_GATEWAY)) == RTF_HOST)
macroIS_DYNAMIC_DIRECT_HOSTROUTE
#define IS_DYNAMIC_DIRECT_HOSTROUTE(rt) (((rt)->rt_flags & (RTF_CLONING | RTF_PRCLONING | RTF_HOST | RTF_LLINFO | RTF_WASCLONED | RTF_GATEWAY)) == (RTF_HOST | RTF_LLINFO | RTF_WASCLONED))
macroIS_LOCALNET_ROUTE
#define IS_LOCALNET_ROUTE(rt) (!((rt)->rt_flags & RTF_LOCAL) && ((((rt)->rt_flags & (RTF_HOST | RTF_GATEWAY)) == RTF_HOST) || ((rt)->rt_flags & (RTF_MULTICAST | RTF_BROADCAST))))
structrtstat
Routing statistics.
| short | rts_badredirect | bogus redirect calls |
| short | rts_dynamic | routes created by redirects |
| short | rts_newgateway | routes modified by redirects |
| short | rts_unreach | lookups which failed |
| short | rts_wildcard | lookups satisfied by a wildcard |
| short | rts_badrtgwroute | route to gateway is not direct |
structrt_msghdr
Structures for routing messages.
| u_short | rtm_msglen | to skip over non-understood messages |
| u_char | rtm_version | future binary compatibility |
| u_char | rtm_type | message type |
| u_short | rtm_index | index for associated ifp |
| int | rtm_flags | flags, incl. kern & message, e.g. DONE |
| int | rtm_addrs | bitmask identifying sockaddrs in msg |
| pid_t | rtm_pid | identify sender |
| int | rtm_seq | for sender to identify action |
| int | rtm_errno | why failed |
| int | rtm_use | from rtentry |
| u_int32_t | rtm_inits | which metrics we are initializing |
| struct rt_metrics | rtm_rmx | metrics themselves |
structrt_msghdr2
| u_short | rtm_msglen | to skip over non-understood messages |
| u_char | rtm_version | future binary compatibility |
| u_char | rtm_type | message type |
| u_short | rtm_index | index for associated ifp |
| int | rtm_flags | flags, incl. kern & message, e.g. DONE |
| int | rtm_addrs | bitmask identifying sockaddrs in msg |
| int32_t | rtm_refcnt | reference count |
| int | rtm_parentflags | flags of the parent route |
| int | rtm_reserved | reserved field set to 0 |
| int | rtm_use | from rtentry |
| u_int32_t | rtm_inits | which metrics we are initializing |
| struct rt_metrics | rtm_rmx | metrics themselves |
structrt_msghdr_prelude
| u_short | rtm_msglen | to skip over non-understood messages |
macroRTM_IFINFO2
#define RTM_IFINFO2 0x12
macroRTM_NEWMADDR2
#define RTM_NEWMADDR2 0x13
macroRTM_GET2
#define RTM_GET2 0x14
macroRTAX_DST
Index offsets for sockaddr array for alternate internal encoding.
#define RTAX_DST 0
destination sockaddr present
structrt_addrinfo
| int | rti_addrs | |
| struct sockaddr *[8] | rti_info |