netfilter
firewalling, NAT, and packet mangling for linux
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
cache.c File Reference
#include <netlink-local.h>
#include <netlink/netlink.h>
#include <netlink/cache.h>
#include <netlink/object.h>
#include <netlink/utils.h>
Include dependency graph for cache.c:

Functions

Access Functions
int nl_cache_nitems (struct nl_cache *cache)
 Return the number of items in the cache. More...
 
int nl_cache_nitems_filter (struct nl_cache *cache, struct nl_object *filter)
 Return the number of items matching a filter in the cache. More...
 
int nl_cache_is_empty (struct nl_cache *cache)
 Returns true if the cache is empty. More...
 
struct nl_cache_opsnl_cache_get_ops (struct nl_cache *cache)
 Return the operations set of the cache. More...
 
struct nl_objectnl_cache_get_first (struct nl_cache *cache)
 Return the first element in the cache. More...
 
struct nl_objectnl_cache_get_last (struct nl_cache *cache)
 Return the last element in the cache. More...
 
struct nl_objectnl_cache_get_next (struct nl_object *obj)
 Return the next element in the cache. More...
 
struct nl_objectnl_cache_get_prev (struct nl_object *obj)
 Return the previous element in the cache. More...
 
Cache Creation/Deletion
struct nl_cachenl_cache_alloc (struct nl_cache_ops *ops)
 Allocate an empty cache. More...
 
int nl_cache_alloc_and_fill (struct nl_cache_ops *ops, struct nl_sock *sock, struct nl_cache **result)
 
int nl_cache_alloc_name (const char *kind, struct nl_cache **result)
 Allocate an empty cache based on type name. More...
 
struct nl_cachenl_cache_subset (struct nl_cache *orig, struct nl_object *filter)
 Allocate a new cache containing a subset of a cache. More...
 
void nl_cache_clear (struct nl_cache *cache)
 Clear a cache. More...
 
void nl_cache_free (struct nl_cache *cache)
 Free a cache. More...
 
Cache Modifications
int nl_cache_add (struct nl_cache *cache, struct nl_object *obj)
 Add object to a cache. More...
 
int nl_cache_move (struct nl_cache *cache, struct nl_object *obj)
 Move object from one cache to another. More...
 
void nl_cache_remove (struct nl_object *obj)
 Removes an object from a cache. More...
 
struct nl_objectnl_cache_search (struct nl_cache *cache, struct nl_object *needle)
 Search for an object in a cache. More...
 
Synchronization
int nl_cache_request_full_dump (struct nl_sock *sk, struct nl_cache *cache)
 Request a full dump from the kernel to fill a cache. More...
 
int __cache_pickup (struct nl_sock *sk, struct nl_cache *cache, struct nl_parser_param *param)
 
int nl_cache_pickup (struct nl_sock *sk, struct nl_cache *cache)
 Pickup a netlink dump response and put it into a cache. More...
 
int nl_cache_include (struct nl_cache *cache, struct nl_object *obj, change_func_t change_cb)
 
int nl_cache_resync (struct nl_sock *sk, struct nl_cache *cache, change_func_t change_cb)
 
Parsing
int nl_cache_parse_and_add (struct nl_cache *cache, struct nl_msg *msg)
 Parse a netlink message and add it to the cache. More...
 
int nl_cache_refill (struct nl_sock *sk, struct nl_cache *cache)
 (Re)fill a cache with the contents in the kernel. More...
 
Utillities
void nl_cache_mark_all (struct nl_cache *cache)
 Mark all objects in a cache. More...
 
Dumping
void nl_cache_dump (struct nl_cache *cache, struct nl_dump_params *params)
 Dump all elements of a cache. More...
 
void nl_cache_dump_filter (struct nl_cache *cache, struct nl_dump_params *params, struct nl_object *filter)
 Dump all elements of a cache (filtered). More...
 
Iterators
void nl_cache_foreach (struct nl_cache *cache, void(*cb)(struct nl_object *, void *), void *arg)
 Call a callback on each element of the cache. More...
 
void nl_cache_foreach_filter (struct nl_cache *cache, struct nl_object *filter, void(*cb)(struct nl_object *, void *), void *arg)
 Call a callback on each element of the cache (filtered). More...