netfilter
firewalling, NAT, and packet mangling for linux
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages

Routing Utility Functions. More...

Collaboration diagram for Utilities:

Routing Table Identifier Translations

int rtnl_route_read_table_names (const char *path)
 
char * rtnl_route_table2str (int table, char *buf, size_t size)
 
int rtnl_route_str2table (const char *name)
 

Routing Protocol Translations

int rtnl_route_read_protocol_names (const char *path)
 
char * rtnl_route_proto2str (int proto, char *buf, size_t size)
 
int rtnl_route_str2proto (const char *name)
 

Routing Metrices Translations

char * rtnl_route_metric2str (int metric, char *buf, size_t size)
 
int rtnl_route_str2metric (const char *name)
 

Detailed Description

Routing Utility Functions.

1) Translating Routing Table Names
// libnl is only aware of the de facto standard routing table names.
// Additional name <-> identifier associations have to be read in via
// a configuration file, f.e. /etc/iproute2/rt_tables
err = rtnl_route_read_table_names("/etc/iproute2/rt_tables");
// Translating a table name to its idenfier
// ... and the other way around.
char buf[32];
printf("Name: %s\n",
rtnl_route_table2str(table, buf, sizeof(buf)));

Function Documentation

char* rtnl_route_metric2str ( int  metric,
char *  buf,
size_t  size 
)

References __type2str(), and ARRAY_SIZE.

Here is the call graph for this function:

char* rtnl_route_proto2str ( int  proto,
char *  buf,
size_t  size 
)

References __list_type2str().

Here is the call graph for this function:

int rtnl_route_read_protocol_names ( const char *  path)

References __nl_read_num_str_file(), and __trans_list_clear().

Here is the call graph for this function:

int rtnl_route_read_table_names ( const char *  path)

References __nl_read_num_str_file(), and __trans_list_clear().

Here is the call graph for this function:

int rtnl_route_str2metric ( const char *  name)

References __str2type(), and ARRAY_SIZE.

Here is the call graph for this function:

int rtnl_route_str2proto ( const char *  name)

References __list_str2type().

Referenced by nl_cli_route_parse_protocol().

Here is the call graph for this function:

Here is the caller graph for this function:

int rtnl_route_str2table ( const char *  name)

References __list_str2type().

Referenced by nl_cli_route_parse_table().

Here is the call graph for this function:

Here is the caller graph for this function:

char* rtnl_route_table2str ( int  table,
char *  buf,
size_t  size 
)

References __list_type2str().

Here is the call graph for this function: