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

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

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)
 

Detailed Description

Function Documentation

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

References nl_send_auto_complete(), nlmsg_free(), and rtnl_route_build_add_request().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

  • sk Netlink socket.
  • family Address family of routes to cover or AF_UNSPEC
  • flags Flags

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.

References nl_cache::c_iarg1, nl_cache::c_iarg2, flags, nl_cache_alloc(), nl_cache_refill(), and NLE_NOMEM.

Referenced by nl_cli_route_alloc_cache().

Here is the call graph for this function:

Here is the caller graph for this function:

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

References NLM_F_CREATE, and RTM_NEWROUTE.

Referenced by rtnl_route_add().

Here is the caller graph for this function:

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

References RTM_DELROUTE.

Referenced by rtnl_route_delete().

Here is the caller graph for this function:

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

References nl_send_auto_complete(), nlmsg_free(), and rtnl_route_build_del_request().

Here is the call graph for this function: