Sets up a routing table entry typically for a network interface.
Item | Description |
---|---|
ifa | Specifies the address of an ifaddr structure containing destination address, interface address, and netmask. |
cmd | Specifies a request to add or delete route entry. |
flags | Identifies routing flags, as defined in the /usr/include/net/route.h file. |
The rtinit kernel service creates a routing table entry for an interface. It builds an rtentry structure using the values in the ifa and flags parameters.
The rtinit service then calls the rtrequest kernel service and passes the cmd parameter and the rtentry structure to process the request. The cmd parameter contains either the value RTM_ADD (a request to add the route entry) or the value RTM_DELETE (delete the route entry). Valid routing flags to set are defined in the /usr/include/route.h file.
The rtinit kernel service can be called from either the process or interrupt environment.
The rtinit kernel service returns values from the rtrequest kernel service.
To set up a routing table entry, invoke the rtinit kernel service as follows:
rtinit(ifa, RMT_ADD, flags ( RTF_DYNAMIC);