Routing
[Routing Netlink]

Modules

 Route Object
 Utilities
 

Routing Utility Functions.


Cache Management



struct nl_cache * rtnl_route_alloc_cache (struct nl_handle *handle)
 Build a route cache holding all routes currently configured in the kernel.

Route Addition



struct nl_msg * rtnl_route_build_add_request (struct rtnl_route *tmpl, int flags)
int rtnl_route_add (struct nl_handle *handle, struct rtnl_route *route, int flags)
struct nl_msg * rtnl_route_build_del_request (struct rtnl_route *tmpl, int flags)
int rtnl_route_del (struct nl_handle *handle, struct rtnl_route *route, int flags)

Function Documentation

struct nl_cache* rtnl_route_alloc_cache ( struct nl_handle *  handle  )  [read]
Parameters:
handle netlink handle

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 241 of file route.c.

References nl_cache_alloc(), and nl_cache_refill().

00242 {
00243         struct nl_cache *cache;
00244 
00245         cache = nl_cache_alloc(&rtnl_route_ops);
00246         if (!cache)
00247                 return NULL;
00248 
00249         if (handle && nl_cache_refill(handle, cache) < 0) {
00250                 free(cache);
00251                 return NULL;
00252         }
00253 
00254         return cache;
00255 }


Generated on 30 Oct 2009 for libnl by  doxygen 1.6.1