Logo Search packages:      
Sourcecode: libnl2 version File versions  Download package


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
 int table = rtnl_route_str2table("main");

 // ... and the other way around.
 char buf[32];
 printf("Name: %s\n",
        rtnl_route_table2str(table, buf, sizeof(buf)));

Routing Metrices Translations

static struct trans_tbl route_metrices []
char * rtnl_route_metric2str (int metric, char *buf, size_t size)
int rtnl_route_str2metric (const char *name)

Routing Protocol Translations

static int add_proto_name (long id, const char *name)
static void __init init_proto_names (void)
static NL_LIST_HEAD (proto_names)
static void __exit release_proto_names (void)
char * rtnl_route_proto2str (int proto, char *buf, size_t size)
int rtnl_route_read_protocol_names (const char *path)
int rtnl_route_str2proto (const char *name)

Routing Table Identifier Translations

static int add_routing_table_name (long id, const char *name)
static void __init init_routing_table_names (void)
static NL_LIST_HEAD (table_names)
static void __exit release_routing_table_names (void)
int rtnl_route_read_table_names (const char *path)
int rtnl_route_str2table (const char *name)
char * rtnl_route_table2str (int table, char *buf, size_t size)

Generated by  Doxygen 1.6.0   Back to index