libnl 3.7.0

Modules

 Route Object
 
 Utilities
 Routing Utility Functions.
 

Macros

#define ROUTE_CACHE_CONTENT   1
 When passed to rtnl_route_alloc_cache() the cache will correspond to the contents of the routing cache instead of the actual routes. More...
 

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. More...
 

Route Addition

int rtnl_route_build_add_request (struct rtnl_route *tmpl, int flags, struct nl_msg **result)
 
int rtnl_route_lookup (struct nl_sock *sk, struct nl_addr *dst, struct rtnl_route **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)
 

Detailed Description

Macro Definition Documentation

◆ ROUTE_CACHE_CONTENT

#define ROUTE_CACHE_CONTENT   1

When passed to rtnl_route_alloc_cache() the cache will correspond to the contents of the routing cache instead of the actual routes.

Definition at line 27 of file route.h.

Function Documentation

◆ rtnl_route_alloc_cache()

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.

Parameters
skNetlink socket.
familyAddress family of routes to cover or AF_UNSPEC
flagsFlags
resultResult pointer

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

Valid flags:

  • ROUTE_CACHE_CONTENT - Cache will contain contents of routing cache instead of actual routes.
Note
The caller is responsible for destroying and freeing the cache after using it.
Returns
0 on success or a negative error code.

Definition at line 75 of file route.c.

References nl_cache_alloc(), and nl_cache_refill().

+ Here is the call graph for this function:

◆ rtnl_route_build_add_request()

int rtnl_route_build_add_request ( struct rtnl_route *  tmpl,
int  flags,
struct nl_msg **  result 
)

Definition at line 121 of file route.c.

◆ rtnl_route_lookup()

int rtnl_route_lookup ( struct nl_sock *  sk,
struct nl_addr *  dst,
struct rtnl_route **  result 
)

Definition at line 128 of file route.c.

◆ rtnl_route_add()

int rtnl_route_add ( struct nl_sock *  sk,
struct rtnl_route *  route,
int  flags 
)

Definition at line 154 of file route.c.

◆ rtnl_route_build_del_request()

int rtnl_route_build_del_request ( struct rtnl_route *  tmpl,
int  flags,
struct nl_msg **  result 
)

Definition at line 170 of file route.c.

◆ rtnl_route_delete()

int rtnl_route_delete ( struct nl_sock *  sk,
struct rtnl_route *  route,
int  flags 
)

Definition at line 176 of file route.c.