Chapter 20. Routing Sockets
A process sends and receives the routing messages described in the previous chapter by using a socket in the routing domain. The
socket system call is issued specifying a family of
PF_ROUTE and a socket type of
The process can then send five routing messages to the kernel:
RTM_ADD:add a new route.
RTM_DELETE:delete an existing route.
RTM_GET:fetch all the information about a route.
RTM_CHANGE:change the gateway, interface, or metrics of an existing route.
RTM_LOCK:specify which metrics the kernel should not modify.
Additionally, the process can receive any of the other seven types of routing messages that are generated by the kernel when some event, such as interface down, redirect received, etc., ...