Neighbour Tables
[Routing Netlink]


Neighbour Table Object Allocation/Freeage

rtnl_neightbl * rtnl_neightbl_alloc (void)
 Allocate a new neighbour table object.
void rtnl_neightbl_put (struct rtnl_neightbl *neightbl)
 Give back reference on neighbour table object.
void rtnl_neightbl_free (struct rtnl_neightbl *neightbl)
 Free neighbour table object.

Neighbour Table Cache Management

nl_cache * rtnl_neightbl_alloc_cache (struct nl_handle *handle)
 Build a neighbour table cache including all neighbour tables currently configured in the kernel.
rtnl_neightbl * rtnl_neightbl_get (struct nl_cache *cache, const char *name, int ifindex)
 Lookup neighbour table by name and optional interface index.

Neighbour Table Modifications

nl_msg * rtnl_neightbl_build_change_request (struct rtnl_neightbl *old, struct rtnl_neightbl *tmpl)
 Builds a netlink change request message to change neighbour table attributes.
int rtnl_neightbl_change (struct nl_handle *handle, struct rtnl_neightbl *old, struct rtnl_neightbl *tmpl)
 Change neighbour table attributes.

Attribute Modification

void rtnl_neightbl_set_family (struct rtnl_neightbl *ntbl, int family)
 Set the address family of a neighbour table to the specified value.
void rtnl_neightbl_set_gc_interval (struct rtnl_neightbl *ntbl, uint64_t ms)
 Set the gc interval of a neighbour table to the specified value.
void rtnl_neightbl_set_gc_tresh1 (struct rtnl_neightbl *ntbl, int thresh)
 Set the gc threshold 1 of a neighbour table to the specified value.
void rtnl_neightbl_set_gc_tresh2 (struct rtnl_neightbl *ntbl, int thresh)
 Set the gc threshold 2 of a neighbour table to the specified value.
void rtnl_neightbl_set_gc_tresh3 (struct rtnl_neightbl *ntbl, int thresh)
 Set the gc threshold 3 of a neighbour table to the specified value.
void rtnl_neightbl_set_name (struct rtnl_neightbl *ntbl, const char *name)
 Set the table name of a neighbour table to the specified value.
void rtnl_neightbl_set_dev (struct rtnl_neightbl *ntbl, int ifindex)
 Set the device of a neighbour table to the specified value.
void rtnl_neightbl_set_queue_len (struct rtnl_neightbl *ntbl, int len)
 Set the queue length for pending requests of a neighbour table to the specified value.
void rtnl_neightbl_set_proxy_queue_len (struct rtnl_neightbl *ntbl, int len)
 Set the queue length for delay proxy arp requests of a neighbour table to the specified value.
void rtnl_neightbl_set_app_probes (struct rtnl_neightbl *ntbl, int probes)
 Set the number of application probes of a neighbour table to the specified value.
void rtnl_neightbl_set_ucast_probes (struct rtnl_neightbl *ntbl, int probes)
 Set the number of unicast probes of a neighbour table to the specified value.
void rtnl_neightbl_set_mcast_probes (struct rtnl_neightbl *ntbl, int probes)
 Set the number of multicast probes of a neighbour table to the specified value.
void rtnl_neightbl_set_base_reachable_time (struct rtnl_neightbl *ntbl, uint64_t ms)
 Set the base reachable time of a neighbour table to the specified value.
void rtnl_neightbl_set_retrans_time (struct rtnl_neightbl *ntbl, uint64_t ms)
 Set the retransmit time of a neighbour table to the specified value.
void rtnl_neightbl_set_gc_stale_time (struct rtnl_neightbl *ntbl, uint64_t ms)
 Set the gc stale time of a neighbour table to the specified value.
void rtnl_neightbl_set_delay_probe_time (struct rtnl_neightbl *ntbl, uint64_t ms)
 Set the first probe delay time of a neighbour table to the specified value.
void rtnl_neightbl_set_anycast_delay (struct rtnl_neightbl *ntbl, uint64_t ms)
 Set the anycast delay of a neighbour table to the specified value.
void rtnl_neightbl_set_proxy_delay (struct rtnl_neightbl *ntbl, uint64_t ms)
 Set the proxy delay of a neighbour table to the specified value.
void rtnl_neightbl_set_locktime (struct rtnl_neightbl *ntbl, uint64_t ms)
 Set the locktime of a neighbour table to the specified value.


Function Documentation

struct rtnl_neightbl* rtnl_neightbl_alloc ( void   ) 

Allocate a new neighbour table object.

Returns:
New neighbour table object

Definition at line 381 of file neightbl.c.

References nl_object_alloc_from_ops().

void rtnl_neightbl_put ( struct rtnl_neightbl *  neightbl  ) 

Give back reference on neighbour table object.

Parameters:
neightbl Neighbour table object to be given back.
Decrements the reference counter and frees the object if the last reference has been released.

Definition at line 394 of file neightbl.c.

References nl_object_put().

void rtnl_neightbl_free ( struct rtnl_neightbl *  neightbl  ) 

Free neighbour table object.

Parameters:
neightbl Neighbour table object to be freed.
Note:
Always use rtnl_neightbl_put() unless you're absolutely sure that no other user may have a reference on this object.

Definition at line 405 of file neightbl.c.

References nl_object_free().

struct nl_cache* rtnl_neightbl_alloc_cache ( struct nl_handle *  handle  ) 

Build a neighbour table cache including all neighbour tables currently configured in the kernel.

Parameters:
handle netlink handle
Allocates a new neighbour table cache, initializes it properly and updates it to include all neighbour tables currently configured in the kernel.

Note:
The caller is responsible for destroying and freeing the cache after using it.
Returns:
The new cache or NULL if an error occured.

Definition at line 429 of file neightbl.c.

References nl_cache_alloc_from_ops(), nl_cache_free(), and nl_cache_update().

struct rtnl_neightbl* rtnl_neightbl_get ( struct nl_cache *  cache,
const char *  name,
int  ifindex 
)

Lookup neighbour table by name and optional interface index.

Parameters:
cache neighbour table cache
name name of table
ifindex optional interface index
Looks up the neighbour table matching the specified name and optionally the specified ifindex to retrieve device specific parameter sets.

Returns:
ptr to neighbour table inside the cache or NULL if no match was found.

Definition at line 458 of file neightbl.c.

References nl_object_get().

struct nl_msg* rtnl_neightbl_build_change_request ( struct rtnl_neightbl *  old,
struct rtnl_neightbl *  tmpl 
)

Builds a netlink change request message to change neighbour table attributes.

Parameters:
old neighbour table to change
tmpl template with requested changes
Builds a new netlink message requesting a change of neighbour table 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 neighbour table currently configured in the kernel and tmpl must contain the attributes to be changed set via rtnl_neightbl_set_* functions.

Returns:
New netlink message

Definition at line 500 of file neightbl.c.

References ndtmsg::ndtm_family, nla_put_nested(), nla_put_string(), nla_put_u32(), nla_put_u64(), nlmsg_append(), nlmsg_build(), nlmsg_build_simple(), and nlmsg_free().

Referenced by rtnl_neightbl_change().

int rtnl_neightbl_change ( struct nl_handle *  handle,
struct rtnl_neightbl *  old,
struct rtnl_neightbl *  tmpl 
)

Change neighbour table attributes.

Parameters:
handle netlink handle
old neighbour table to be changed
tmpl template with requested changes
Builds a new netlink message by calling rtnl_neightbl_build_change_request(), sends the request to the kernel and waits for the next ACK to be received, i.e. blocks until the request has been processed.

Returns:
0 on success or a negative error code

Definition at line 600 of file neightbl.c.

References nl_send_auto_complete(), nl_wait_for_ack(), nlmsg_free(), and rtnl_neightbl_build_change_request().

void rtnl_neightbl_set_family ( struct rtnl_neightbl *  ntbl,
int  family 
)

Set the address family of a neighbour table to the specified value.

Parameters:
ntbl neighbour table to change
family new address family

Definition at line 627 of file neightbl.c.

void rtnl_neightbl_set_gc_interval ( struct rtnl_neightbl *  ntbl,
uint64_t  ms 
)

Set the gc interval of a neighbour table to the specified value.

Parameters:
ntbl neighbour table to change
ms new interval in milliseconds

Definition at line 638 of file neightbl.c.

void rtnl_neightbl_set_gc_tresh1 ( struct rtnl_neightbl *  ntbl,
int  thresh 
)

Set the gc threshold 1 of a neighbour table to the specified value.

Parameters:
ntbl neighbour table to change
thresh new gc threshold

Definition at line 649 of file neightbl.c.

void rtnl_neightbl_set_gc_tresh2 ( struct rtnl_neightbl *  ntbl,
int  thresh 
)

Set the gc threshold 2 of a neighbour table to the specified value.

Parameters:
ntbl neighbour table to change
thresh new gc threshold

Definition at line 660 of file neightbl.c.

void rtnl_neightbl_set_gc_tresh3 ( struct rtnl_neightbl *  ntbl,
int  thresh 
)

Set the gc threshold 3 of a neighbour table to the specified value.

Parameters:
ntbl neighbour table to change
thresh new gc threshold

Definition at line 671 of file neightbl.c.

void rtnl_neightbl_set_name ( struct rtnl_neightbl *  ntbl,
const char *  name 
)

Set the table name of a neighbour table to the specified value.

Parameters:
ntbl neighbour table to change
name new table name

Definition at line 682 of file neightbl.c.

void rtnl_neightbl_set_dev ( struct rtnl_neightbl *  ntbl,
int  ifindex 
)

Set the device of a neighbour table to the specified value.

Parameters:
ntbl neighbour table to change
ifindex interface index of the device

Definition at line 693 of file neightbl.c.

void rtnl_neightbl_set_queue_len ( struct rtnl_neightbl *  ntbl,
int  len 
)

Set the queue length for pending requests of a neighbour table to the specified value.

Parameters:
ntbl neighbour table to change
len new queue len

Definition at line 705 of file neightbl.c.

void rtnl_neightbl_set_proxy_queue_len ( struct rtnl_neightbl *  ntbl,
int  len 
)

Set the queue length for delay proxy arp requests of a neighbour table to the specified value.

Parameters:
ntbl neighbour table to change
len new queue len

Definition at line 717 of file neightbl.c.

void rtnl_neightbl_set_app_probes ( struct rtnl_neightbl *  ntbl,
int  probes 
)

Set the number of application probes of a neighbour table to the specified value.

Parameters:
ntbl neighbour table to change
probes new probes value

Definition at line 729 of file neightbl.c.

void rtnl_neightbl_set_ucast_probes ( struct rtnl_neightbl *  ntbl,
int  probes 
)

Set the number of unicast probes of a neighbour table to the specified value.

Parameters:
ntbl neighbour table to change
probes new probes value

Definition at line 741 of file neightbl.c.

void rtnl_neightbl_set_mcast_probes ( struct rtnl_neightbl *  ntbl,
int  probes 
)

Set the number of multicast probes of a neighbour table to the specified value.

Parameters:
ntbl neighbour table to change
probes new probes value

Definition at line 753 of file neightbl.c.

void rtnl_neightbl_set_base_reachable_time ( struct rtnl_neightbl *  ntbl,
uint64_t  ms 
)

Set the base reachable time of a neighbour table to the specified value.

Parameters:
ntbl neighbour table to change
ms new base reachable time in milliseconds

Definition at line 765 of file neightbl.c.

void rtnl_neightbl_set_retrans_time ( struct rtnl_neightbl *  ntbl,
uint64_t  ms 
)

Set the retransmit time of a neighbour table to the specified value.

Parameters:
ntbl neighbour table to change
ms new retransmit time

Definition at line 778 of file neightbl.c.

void rtnl_neightbl_set_gc_stale_time ( struct rtnl_neightbl *  ntbl,
uint64_t  ms 
)

Set the gc stale time of a neighbour table to the specified value.

Parameters:
ntbl neighbour table to change
ms new gc stale time in milliseconds

Definition at line 790 of file neightbl.c.

void rtnl_neightbl_set_delay_probe_time ( struct rtnl_neightbl *  ntbl,
uint64_t  ms 
)

Set the first probe delay time of a neighbour table to the specified value.

Parameters:
ntbl neighbour table to change
ms new first probe delay time in milliseconds

Definition at line 802 of file neightbl.c.

void rtnl_neightbl_set_anycast_delay ( struct rtnl_neightbl *  ntbl,
uint64_t  ms 
)

Set the anycast delay of a neighbour table to the specified value.

Parameters:
ntbl neighbour table to change
ms new anycast delay in milliseconds

Definition at line 814 of file neightbl.c.

void rtnl_neightbl_set_proxy_delay ( struct rtnl_neightbl *  ntbl,
uint64_t  ms 
)

Set the proxy delay of a neighbour table to the specified value.

Parameters:
ntbl neighbour table to change
ms new proxy delay in milliseconds

Definition at line 826 of file neightbl.c.

void rtnl_neightbl_set_locktime ( struct rtnl_neightbl *  ntbl,
uint64_t  ms 
)

Set the locktime of a neighbour table to the specified value.

Parameters:
ntbl neighbour table to change
ms new locktime in milliseconds

Definition at line 838 of file neightbl.c.


Generated on Fri Apr 27 14:14:07 2007 for libnl by  doxygen 1.5.1