Carries out a request to change the routing table.
Item | Description |
---|---|
req | Specifies a request to add or delete a route. |
dst | Specifies the destination part of the route. |
gateway | Specifies the gateway part of the route. |
netmask | Specifies the network mask to apply to the route. |
flags | Identifies routing flags, as defined in the /usr/include/net/route.h file. |
ret_nrt | Specifies to return the resultant route. |
The rtrequest kernel service carries out a request to change the routing table. Interfaces call the rtrequest service at boot time to make their local routes known for routing table ioctl operations. Interfaces also call the rtrequest service as the result of routing redirects. The request is either to add (if the req parameter has a value of RMT_ADD) or delete (the req parameter is a value of RMT_DELETE) the route.
The rtrequest kernel service can be called from either the process or interrupt environment.
Item | Description |
---|---|
0 | Indicates a successful operation. |
ESRCH | Indicates that the route was not there to delete. |
EEXIST | Indicates that the entry the rtrequest service tried to add already exists. |
ENETUNREACH | Indicates that the rtrequest service cannot find the interface for the route. |
ENOBUFS | Indicates that the rtrequest service cannot get an mbuf structure to add an entry. |
To carry out a request to change the routing table, invoke the rtrequest kernel service as follows:
rtrequest(RTM_ADD, dst, gateway, netmask, flags, &rtp);