libnl 3.10.0

Topics

 Request
 
 

Allocation/Freeing

struct flnl_result * flnl_result_alloc (void)
 
void flnl_result_put (struct flnl_result *res)
 

Cache Management

struct nl_cache * flnl_result_alloc_cache (void)
 Allocate lookup result cache.
 

Lookup

int flnl_lookup_build_request (struct flnl_request *req, int flags, struct nl_msg **result)
 Builds a netlink request message to do a lookup.
 
int flnl_lookup (struct nl_sock *sk, struct flnl_request *req, struct nl_cache *cache)
 Perform FIB Lookup.
 

Attribute Access

int flnl_result_get_table_id (struct flnl_result *res)
 
int flnl_result_get_prefixlen (struct flnl_result *res)
 
int flnl_result_get_nexthop_sel (struct flnl_result *res)
 
int flnl_result_get_type (struct flnl_result *res)
 
int flnl_result_get_scope (struct flnl_result *res)
 
int flnl_result_get_error (struct flnl_result *res)
 

Detailed Description

Function Documentation

◆ flnl_result_alloc()

struct flnl_result * flnl_result_alloc ( void )

Definition at line 169 of file lookup.c.

◆ flnl_result_put()

void flnl_result_put ( struct flnl_result * res)

Definition at line 174 of file lookup.c.

◆ flnl_result_alloc_cache()

struct nl_cache * flnl_result_alloc_cache ( void )

Allocate lookup result cache.

Allocates a new lookup result cache and initializes it properly.

Note
Free the memory after usage using nl_cache_destroy_and_free().
Returns
Newly allocated cache or NULL if an error occured.

Definition at line 194 of file lookup.c.

References nl_cache_alloc().

+ Here is the call graph for this function:

◆ flnl_lookup_build_request()

int flnl_lookup_build_request ( struct flnl_request * req,
int flags,
struct nl_msg ** result )

Builds a netlink request message to do a lookup.

Parameters
reqRequested match.
flagsadditional netlink message flags
resultResult pointer

Builds a new netlink message requesting a change of link attributes. The netlink message header isn't fully equipped with all relevant fields and must be sent out via nl_send_auto_complete() or supplemented as needed. old must point to a link currently configured in the kernel and tmpl must contain the attributes to be changed set via rtnl_link_set_* functions.

Returns
0 on success or a negative error code.

Definition at line 222 of file lookup.c.

References nl_addr_get_binary_addr(), nlmsg_alloc_simple(), nlmsg_append(), and nlmsg_free().

Referenced by flnl_lookup().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ flnl_lookup()

int flnl_lookup ( struct nl_sock * sk,
struct flnl_request * req,
struct nl_cache * cache )

Perform FIB Lookup.

Parameters
skNetlink socket.
reqLookup request object.
cacheCache for result.

Builds a netlink message to request a FIB lookup, waits for the reply and adds the result to the specified cache.

Returns
0 on success or a negative error code.

Definition at line 273 of file lookup.c.

References flnl_lookup_build_request(), nl_cache_pickup_checkdup(), nl_send_auto_complete(), and nlmsg_free().

+ Here is the call graph for this function:

◆ flnl_result_get_table_id()

int flnl_result_get_table_id ( struct flnl_result * res)

Definition at line 297 of file lookup.c.

◆ flnl_result_get_prefixlen()

int flnl_result_get_prefixlen ( struct flnl_result * res)

Definition at line 302 of file lookup.c.

◆ flnl_result_get_nexthop_sel()

int flnl_result_get_nexthop_sel ( struct flnl_result * res)

Definition at line 307 of file lookup.c.

◆ flnl_result_get_type()

int flnl_result_get_type ( struct flnl_result * res)

Definition at line 312 of file lookup.c.

◆ flnl_result_get_scope()

int flnl_result_get_scope ( struct flnl_result * res)

Definition at line 317 of file lookup.c.

◆ flnl_result_get_error()

int flnl_result_get_error ( struct flnl_result * res)

Definition at line 322 of file lookup.c.