libnl 2.0
Modules

Routing

Routing Family

Modules

 Route Object
 Utilities
 

Routing Utility Functions.


Cache Management

int rtnl_route_alloc_cache (struct nl_sock *sk, int family, int flags, struct nl_cache **result)
 Build a route cache holding all routes currently configured in the kernel.

Route Addition

int rtnl_route_build_add_request (struct rtnl_route *tmpl, int flags, struct nl_msg **result)
int rtnl_route_add (struct nl_sock *sk, struct rtnl_route *route, int flags)
int rtnl_route_build_del_request (struct rtnl_route *tmpl, int flags, struct nl_msg **result)
int rtnl_route_delete (struct nl_sock *sk, struct rtnl_route *route, int flags)

Function Documentation

int rtnl_route_alloc_cache ( struct nl_sock *  sk,
int  family,
int  flags,
struct nl_cache **  result 
)
Parameters:
skNetlink socket.
familyAddress family of routes to cover or AF_UNSPEC
flagsFlags

Allocates a new cache, initializes it properly and updates it to contain all routes currently configured in the kernel.

Note:
The caller is responsible for destroying and freeing the cache after using it.
Returns:
The cache or NULL if an error has occured.

Definition at line 75 of file route.c.

References nl_cache_alloc(), and nl_cache_refill().