libnl  1.1.4
Macros | Functions

Macros

#define NFNLMSG_CT_TYPE(type)   NFNLMSG_TYPE(NFNL_SUBSYS_CTNETLINK, (type))
 

Functions

int nfnlmsg_ct_group (struct nlmsghdr *nlh)
 
struct nfnl_ct * nfnlmsg_ct_parse (struct nlmsghdr *nlh)
 
int nfnl_ct_dump_request (struct nl_handle *h)
 

Cache Management

struct nl_cache * nfnl_ct_alloc_cache (struct nl_handle *handle)
 Build a conntrack cache holding all conntrack currently in the kernel. More...
 

Detailed Description

Function Documentation

struct nl_cache* nfnl_ct_alloc_cache ( struct nl_handle *  handle)
Parameters
handlenetlink handle

Allocates a new cache, initializes it properly and updates it to contain all conntracks currently 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.

Definition at line 407 of file ct.c.

References nl_cache_alloc(), and nl_cache_refill().

408 {
409  struct nl_cache *cache;
410 
411  cache = nl_cache_alloc(&nfnl_ct_ops);
412  if (!cache)
413  return NULL;
414 
415  if (handle && nl_cache_refill(handle, cache) < 0) {
416  free(cache);
417  return NULL;
418  }
419 
420  return cache;
421 }
int nl_cache_refill(struct nl_handle *handle, struct nl_cache *cache)
(Re)fill a cache with the contents in the kernel.
Definition: cache.c:680
struct nl_cache * nl_cache_alloc(struct nl_cache_ops *ops)
Allocate an empty cache.
Definition: cache.c:170