add_route

Top  Previous  Next

The add_route function configures the routing table.

 

Syntax

void add_route(

char *dest,

char *gateway,

char *netmask,

int flags

);

 

Parameters

dest

The IP address of the destination.

 

gateway

The gateway to be used.

 

netmask

The netmask if net is used as destination.

 

flags

Specifies the type of record in the routing table.  The following table shows the possible values.  The constants can be ored.

 

Type

Meaning

RTF_UP

route usable

RTF_GATEWAY

destination is a gateway

RTF_STATIC

manually added route (won't be removed automatically)