[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Technical Reference: Kernel and Subsystems, Volume 1

rtredirect Kernel Service

Purpose

Forces a routing table entry with the specified destination to go through a given gateway.

Syntax

#include <sys/types.h>
#include <sys/errno.h>
#include <sys/mbuf.h>
#include <net/route.h>


rtredirect ( dst, gateway, netmask, flags, src, rtp)
struct sockaddr *dst, *gateway, *netmask, *src;
int flags;
struct rtentry **rtp;

Parameters

dst Specifies the destination address.
gateway Specifies the gateway address.
netmask Specifies the network mask for the route.
flags Indicates routing flags as defined in the /usr/include/net/route.h file.
src Identifies the source of the redirect request.
rtp Indicates the address of a pointer to a rtentry structure. Used to return a constructed route.

Description

The rtredirect kernel service forces a routing table entry for a specified destination to go through the given gateway. Typically, the rtredirect service is called as a result of a routing redirect message from the network layer. The dst, gateway, and flags parameters are passed to the rtrequest kernel service to process the request.

Execution Environment

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

Return Values

0 Indicates a successful operation.

If a bad redirect request is received, the routing statistics counter for bad redirects is incremented.

Example

To force a routing table entry with the specified destination to go through the given gateway, invoke the rtredirect kernel service:

rtredirect(dst, gateway, netmask, flags, src, rtp);

Related Information

The rtinit kernel service.

Network Kernel Services in AIX 5L Version 5.2 Kernel Extensions and Device Support Programming Concepts.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]