libnl 3.7.0

Modules

 Nexthop
 

Functions

int rtnl_route_parse (struct nlmsghdr *nlh, struct rtnl_route **result)
 
int rtnl_route_build_msg (struct nl_msg *msg, struct rtnl_route *route)
 

Allocation/Freeing

struct rtnl_route * rtnl_route_alloc (void)
 
void rtnl_route_get (struct rtnl_route *route)
 
void rtnl_route_put (struct rtnl_route *route)
 

Attributes

void rtnl_route_set_table (struct rtnl_route *route, uint32_t table)
 
uint32_t rtnl_route_get_table (struct rtnl_route *route)
 
void rtnl_route_set_scope (struct rtnl_route *route, uint8_t scope)
 
uint8_t rtnl_route_get_scope (struct rtnl_route *route)
 
void rtnl_route_set_tos (struct rtnl_route *route, uint8_t tos)
 
uint8_t rtnl_route_get_tos (struct rtnl_route *route)
 
void rtnl_route_set_protocol (struct rtnl_route *route, uint8_t protocol)
 
uint8_t rtnl_route_get_protocol (struct rtnl_route *route)
 
void rtnl_route_set_priority (struct rtnl_route *route, uint32_t prio)
 
uint32_t rtnl_route_get_priority (struct rtnl_route *route)
 
int rtnl_route_set_family (struct rtnl_route *route, uint8_t family)
 
uint8_t rtnl_route_get_family (struct rtnl_route *route)
 
int rtnl_route_set_dst (struct rtnl_route *route, struct nl_addr *addr)
 
struct nl_addr * rtnl_route_get_dst (struct rtnl_route *route)
 
int rtnl_route_set_src (struct rtnl_route *route, struct nl_addr *addr)
 
struct nl_addr * rtnl_route_get_src (struct rtnl_route *route)
 
int rtnl_route_set_type (struct rtnl_route *route, uint8_t type)
 
uint8_t rtnl_route_get_type (struct rtnl_route *route)
 
void rtnl_route_set_flags (struct rtnl_route *route, uint32_t flags)
 
void rtnl_route_unset_flags (struct rtnl_route *route, uint32_t flags)
 
uint32_t rtnl_route_get_flags (struct rtnl_route *route)
 
int rtnl_route_set_metric (struct rtnl_route *route, int metric, uint32_t value)
 
int rtnl_route_unset_metric (struct rtnl_route *route, int metric)
 
int rtnl_route_get_metric (struct rtnl_route *route, int metric, uint32_t *value)
 
int rtnl_route_set_pref_src (struct rtnl_route *route, struct nl_addr *addr)
 
struct nl_addr * rtnl_route_get_pref_src (struct rtnl_route *route)
 
void rtnl_route_set_iif (struct rtnl_route *route, int ifindex)
 
int rtnl_route_get_iif (struct rtnl_route *route)
 
void rtnl_route_add_nexthop (struct rtnl_route *route, struct rtnl_nexthop *nh)
 
void rtnl_route_remove_nexthop (struct rtnl_route *route, struct rtnl_nexthop *nh)
 
struct nl_list_headrtnl_route_get_nexthops (struct rtnl_route *route)
 
int rtnl_route_get_nnexthops (struct rtnl_route *route)
 
void rtnl_route_foreach_nexthop (struct rtnl_route *r, void(*cb)(struct rtnl_nexthop *, void *), void *arg)
 
struct rtnl_nexthop * rtnl_route_nexthop_n (struct rtnl_route *r, int n)
 
void rtnl_route_set_ttl_propagate (struct rtnl_route *route, uint8_t ttl_prop)
 
int rtnl_route_get_ttl_propagate (struct rtnl_route *route)
 

Utilities

int rtnl_route_guess_scope (struct rtnl_route *route)
 Guess scope of a route object. More...
 

Detailed Description

Attributes
Name Default
-------------------------------------------------------------
routing table RT_TABLE_MAIN
scope RT_SCOPE_NOWHERE
tos 0
protocol RTPROT_STATIC
prio 0
family AF_UNSPEC
type RTN_UNICAST
iif NULL

Function Documentation

◆ rtnl_route_alloc()

struct rtnl_route * rtnl_route_alloc ( void  )

Definition at line 609 of file route_obj.c.

◆ rtnl_route_get()

void rtnl_route_get ( struct rtnl_route *  route)

Definition at line 614 of file route_obj.c.

◆ rtnl_route_put()

void rtnl_route_put ( struct rtnl_route *  route)

Definition at line 619 of file route_obj.c.

◆ rtnl_route_set_table()

void rtnl_route_set_table ( struct rtnl_route *  route,
uint32_t  table 
)

Definition at line 631 of file route_obj.c.

◆ rtnl_route_get_table()

uint32_t rtnl_route_get_table ( struct rtnl_route *  route)

Definition at line 637 of file route_obj.c.

◆ rtnl_route_set_scope()

void rtnl_route_set_scope ( struct rtnl_route *  route,
uint8_t  scope 
)

Definition at line 642 of file route_obj.c.

◆ rtnl_route_get_scope()

uint8_t rtnl_route_get_scope ( struct rtnl_route *  route)

Definition at line 648 of file route_obj.c.

◆ rtnl_route_set_tos()

void rtnl_route_set_tos ( struct rtnl_route *  route,
uint8_t  tos 
)

Definition at line 653 of file route_obj.c.

◆ rtnl_route_get_tos()

uint8_t rtnl_route_get_tos ( struct rtnl_route *  route)

Definition at line 659 of file route_obj.c.

◆ rtnl_route_set_protocol()

void rtnl_route_set_protocol ( struct rtnl_route *  route,
uint8_t  protocol 
)

Definition at line 664 of file route_obj.c.

◆ rtnl_route_get_protocol()

uint8_t rtnl_route_get_protocol ( struct rtnl_route *  route)

Definition at line 670 of file route_obj.c.

◆ rtnl_route_set_priority()

void rtnl_route_set_priority ( struct rtnl_route *  route,
uint32_t  prio 
)

Definition at line 675 of file route_obj.c.

◆ rtnl_route_get_priority()

uint32_t rtnl_route_get_priority ( struct rtnl_route *  route)

Definition at line 681 of file route_obj.c.

◆ rtnl_route_set_family()

int rtnl_route_set_family ( struct rtnl_route *  route,
uint8_t  family 
)

Definition at line 686 of file route_obj.c.

◆ rtnl_route_get_family()

uint8_t rtnl_route_get_family ( struct rtnl_route *  route)

Definition at line 701 of file route_obj.c.

◆ rtnl_route_set_dst()

int rtnl_route_set_dst ( struct rtnl_route *  route,
struct nl_addr *  addr 
)

Definition at line 706 of file route_obj.c.

◆ rtnl_route_get_dst()

struct nl_addr * rtnl_route_get_dst ( struct rtnl_route *  route)

Definition at line 725 of file route_obj.c.

◆ rtnl_route_set_src()

int rtnl_route_set_src ( struct rtnl_route *  route,
struct nl_addr *  addr 
)

Definition at line 730 of file route_obj.c.

◆ rtnl_route_get_src()

struct nl_addr * rtnl_route_get_src ( struct rtnl_route *  route)

Definition at line 751 of file route_obj.c.

◆ rtnl_route_set_type()

int rtnl_route_set_type ( struct rtnl_route *  route,
uint8_t  type 
)

Definition at line 756 of file route_obj.c.

◆ rtnl_route_get_type()

uint8_t rtnl_route_get_type ( struct rtnl_route *  route)

Definition at line 767 of file route_obj.c.

◆ rtnl_route_set_flags()

void rtnl_route_set_flags ( struct rtnl_route *  route,
uint32_t  flags 
)

Definition at line 772 of file route_obj.c.

◆ rtnl_route_unset_flags()

void rtnl_route_unset_flags ( struct rtnl_route *  route,
uint32_t  flags 
)

Definition at line 779 of file route_obj.c.

◆ rtnl_route_get_flags()

uint32_t rtnl_route_get_flags ( struct rtnl_route *  route)

Definition at line 786 of file route_obj.c.

◆ rtnl_route_set_metric()

int rtnl_route_set_metric ( struct rtnl_route *  route,
int  metric,
uint32_t  value 
)

Definition at line 791 of file route_obj.c.

◆ rtnl_route_unset_metric()

int rtnl_route_unset_metric ( struct rtnl_route *  route,
int  metric 
)

Definition at line 808 of file route_obj.c.

◆ rtnl_route_get_metric()

int rtnl_route_get_metric ( struct rtnl_route *  route,
int  metric,
uint32_t *  value 
)

Definition at line 821 of file route_obj.c.

◆ rtnl_route_set_pref_src()

int rtnl_route_set_pref_src ( struct rtnl_route *  route,
struct nl_addr *  addr 
)

Definition at line 835 of file route_obj.c.

◆ rtnl_route_get_pref_src()

struct nl_addr * rtnl_route_get_pref_src ( struct rtnl_route *  route)

Definition at line 853 of file route_obj.c.

◆ rtnl_route_set_iif()

void rtnl_route_set_iif ( struct rtnl_route *  route,
int  ifindex 
)

Definition at line 858 of file route_obj.c.

◆ rtnl_route_get_iif()

int rtnl_route_get_iif ( struct rtnl_route *  route)

Definition at line 864 of file route_obj.c.

◆ rtnl_route_add_nexthop()

void rtnl_route_add_nexthop ( struct rtnl_route *  route,
struct rtnl_nexthop *  nh 
)

Definition at line 869 of file route_obj.c.

◆ rtnl_route_remove_nexthop()

void rtnl_route_remove_nexthop ( struct rtnl_route *  route,
struct rtnl_nexthop *  nh 
)

Definition at line 876 of file route_obj.c.

◆ rtnl_route_get_nexthops()

struct nl_list_head * rtnl_route_get_nexthops ( struct rtnl_route *  route)

Definition at line 884 of file route_obj.c.

◆ rtnl_route_get_nnexthops()

int rtnl_route_get_nnexthops ( struct rtnl_route *  route)

Definition at line 892 of file route_obj.c.

◆ rtnl_route_foreach_nexthop()

void rtnl_route_foreach_nexthop ( struct rtnl_route *  r,
void(*)(struct rtnl_nexthop *, void *)  cb,
void *  arg 
)

Definition at line 900 of file route_obj.c.

◆ rtnl_route_nexthop_n()

struct rtnl_nexthop * rtnl_route_nexthop_n ( struct rtnl_route *  r,
int  n 
)

Definition at line 913 of file route_obj.c.

◆ rtnl_route_set_ttl_propagate()

void rtnl_route_set_ttl_propagate ( struct rtnl_route *  route,
uint8_t  ttl_prop 
)

Definition at line 928 of file route_obj.c.

◆ rtnl_route_get_ttl_propagate()

int rtnl_route_get_ttl_propagate ( struct rtnl_route *  route)

Definition at line 934 of file route_obj.c.

◆ rtnl_route_guess_scope()

int rtnl_route_guess_scope ( struct rtnl_route *  route)

Guess scope of a route object.

Parameters
routeRoute object.

Guesses the scope of a route object, based on the following rules:

1) Local route -> local scope
2) At least one nexthop not directly connected -> universe scope
3) All others -> link scope
Returns
Scope value.

Definition at line 963 of file route_obj.c.

◆ rtnl_route_parse()

int rtnl_route_parse ( struct nlmsghdr *  nlh,
struct rtnl_route **  result 
)

Definition at line 1114 of file route_obj.c.

◆ rtnl_route_build_msg()

int rtnl_route_build_msg ( struct nl_msg *  msg,
struct rtnl_route *  route 
)

Definition at line 1345 of file route_obj.c.