[ Previous | Next | Contents | Home | Search ]
AIX Version 4.3 Kernel and Subsystems Technical Reference, Volume 1

rtrequest_gr Kernel Service

Purpose

Carries out a request to change the routing table.

Syntax

#include <sys/types.h>
#include <sys/errno.h>
#include <sys/mbuf.h>
#include <net/if.h>
#include <net/af.h>
#include <net/route.h>
int rtrequest_gr (req, dst, gateway, gidlist, netmask, flags, ret_nrt)
int req;
struct sockaddr *dst, *gateway, *netmask;
int flags;
struct rtentry **ret_nrt;
struct gidstruct *gidlist;

Parameters

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.
gidlist Points to the group list.
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.

Description

The rtrequest_gr kernel service carries out a request to change the routing table. Interfaces call the rtrequest_gr service at boot time to make their local routes known for routing table ioctl operations. Interfaces also call the rtrequest_gr 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 gidlist parameter specifies a list of group id restrictions. A route can be allocated only if its group id restrictions specify that it can be used by the user on whose behalf the allocation is done. A route with a NULL gidlist can be used by any user.

Execution Environment

The rtrequest_gr kernel service can be called from either the process or interrupt environment.

Return Values

0 Indicates a successful operation.
ESRCH Indicates that the route was not there to delete.
EEXIST Indicates that the entry the rtrequest_gr service tried to add already exists.
ENETUNREACH Indicates that the rtrequest_gr service cannot find the interface for the route.
ENOBUFS Indicates that the rtrequest_gr service cannot get an mbuf structure to add an entry.

Example

To carry out a request to change the routing table, invoke the rtrequest_gr kernel service as follows:

rtrequest_gr(RTM_ADD, dst, gateway, netmask, flags, &rtp);

Implementation Specifics

The rtrequest_gr kernel service is part of Base Operating System (BOS) Runtime.

Related Information

The rtinit kernel service.

Network Kernel Services in AIX Kernel Extensions and Device Support Programming Concepts.

The rtrequest kernel service.


[ Previous | Next | Contents | Home | Search ]