Sets up a routing table entry typically for a network interface.
#include <sys/types.h> #include <sys/errno.h> #include <sys/socket.h> #include <net/route.h>
int rtinit (ifa, cmd, flags) struct ifaddr *ifa; int cmd, flags;
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);
The rtinit kernel service is part of Base Operating System (BOS) Runtime.
The rtrequest kernel service.
Network Kernel Services in AIX Kernel Extensions and Device Support Programming Concepts.