libnl 3.7.0
|
Related sections in the development guide: More...
Modules | |
Cache | |
Manager | |
Manager keeping caches up to date automatically. | |
Cache Operations Sets | |
void | nl_cache_ops_get (struct nl_cache_ops *ops) |
Increment reference counter. More... | |
void | nl_cache_ops_put (struct nl_cache_ops *ops) |
Decrement reference counter. More... | |
struct nl_cache_ops * | nl_cache_ops_lookup (const char *name) |
Lookup cache operations by name. More... | |
struct nl_cache_ops * | nl_cache_ops_lookup_safe (const char *name) |
Lookup cache operations by name. More... | |
struct nl_cache_ops * | nl_cache_ops_associate (int protocol, int msgtype) |
Associate protocol and message type to cache operations. More... | |
struct nl_cache_ops * | nl_cache_ops_associate_safe (int protocol, int msgtype) |
Associate protocol and message type to cache operations. More... | |
struct nl_msgtype * | nl_msgtype_lookup (struct nl_cache_ops *ops, int msgtype) |
Lookup message type cache association. More... | |
void | nl_cache_ops_foreach (void(*cb)(struct nl_cache_ops *, void *), void *arg) |
Call a function for each registered cache operation. More... | |
void | nl_cache_ops_set_flags (struct nl_cache_ops *ops, unsigned int flags) |
Set default flags for caches of this type. More... | |
int | nl_cache_mngt_register (struct nl_cache_ops *ops) |
Register a set of cache operations. More... | |
int | nl_cache_mngt_unregister (struct nl_cache_ops *ops) |
Unregister a set of cache operations. More... | |
Global Cache Provisioning/Requiring | |
void | nl_cache_mngt_provide (struct nl_cache *cache) |
Provide a cache for global use. More... | |
void | nl_cache_mngt_unprovide (struct nl_cache *cache) |
Unprovide a cache for global use. More... | |
struct nl_cache * | __nl_cache_mngt_require (const char *name) |
struct nl_cache * | nl_cache_mngt_require (const char *name) |
Return cache previously provided via nl_cache_mngt_provide() More... | |
struct nl_cache * | nl_cache_mngt_require_safe (const char *name) |
Return cache previously provided via nl_cache_mngt_provide() More... | |
Related sections in the development guide:
void nl_cache_ops_get | ( | struct nl_cache_ops * | ops | ) |
Increment reference counter.
ops | Cache operations |
Definition at line 50 of file cache_mngt.c.
Referenced by nl_cache_mngt_provide(), nl_cache_ops_associate_safe(), and nl_cache_ops_lookup_safe().
void nl_cache_ops_put | ( | struct nl_cache_ops * | ops | ) |
Decrement reference counter.
ops | Cache operations |
Definition at line 59 of file cache_mngt.c.
Referenced by nl_cache_alloc_name(), nl_cache_mngr_add(), nl_cache_mngt_unprovide(), and nl_object_alloc_name().
struct nl_cache_ops * nl_cache_ops_lookup | ( | const char * | name | ) |
Lookup cache operations by name.
name | name of the cache type |
Definition at line 73 of file cache_mngt.c.
struct nl_cache_ops * nl_cache_ops_lookup_safe | ( | const char * | name | ) |
Lookup cache operations by name.
name | name of the cache type |
Definition at line 93 of file cache_mngt.c.
References nl_cache_ops_get().
Referenced by nl_cache_alloc_name(), nl_cache_mngr_add(), and nl_object_alloc_name().
struct nl_cache_ops * nl_cache_ops_associate | ( | int | protocol, |
int | msgtype | ||
) |
Associate protocol and message type to cache operations.
protocol | netlink protocol |
msgtype | netlink message type |
Definition at line 134 of file cache_mngt.c.
struct nl_cache_ops * nl_cache_ops_associate_safe | ( | int | protocol, |
int | msgtype | ||
) |
Associate protocol and message type to cache operations.
protocol | netlink protocol |
msgtype | netlink message type |
Searches the registered cache operations for a matching protocol and message type.
Definition at line 158 of file cache_mngt.c.
References nl_cache_ops_get().
struct nl_msgtype * nl_msgtype_lookup | ( | struct nl_cache_ops * | ops, |
int | msgtype | ||
) |
Lookup message type cache association.
ops | cache operations |
msgtype | netlink message type |
Searches for a matching message type association ing the specified cache operations.
Definition at line 183 of file cache_mngt.c.
void nl_cache_ops_foreach | ( | void(*)(struct nl_cache_ops *, void *) | cb, |
void * | arg | ||
) |
Call a function for each registered cache operation.
cb | Callback function to be called |
arg | User specific argument. |
Definition at line 212 of file cache_mngt.c.
void nl_cache_ops_set_flags | ( | struct nl_cache_ops * | ops, |
unsigned int | flags | ||
) |
Set default flags for caches of this type.
ops | Cache ops |
flags | Flags to set |
The cache operation flags will be derived to all caches allocates based on this set of cache operations.
Definition at line 230 of file cache_mngt.c.
int nl_cache_mngt_register | ( | struct nl_cache_ops * | ops | ) |
Register a set of cache operations.
ops | cache operations |
Called by users of caches to announce the avaibility of a certain cache type.
Definition at line 246 of file cache_mngt.c.
Referenced by genl_register().
int nl_cache_mngt_unregister | ( | struct nl_cache_ops * | ops | ) |
Unregister a set of cache operations.
ops | cache operations |
Called by users of caches to announce a set of cache operations is no longer available. The specified cache operations must have been registered previously using nl_cache_mngt_register()
Definition at line 281 of file cache_mngt.c.
Referenced by genl_unregister().
void nl_cache_mngt_provide | ( | struct nl_cache * | cache | ) |
Provide a cache for global use.
cache | cache to provide |
Offers the specified cache to be used by other modules. Only one cache per type may be shared at a time, a previsouly provided caches will be overwritten.
Definition at line 326 of file cache_mngt.c.
References nl_cache_get(), and nl_cache_ops_get().
Referenced by nl_cache_mngr_add_cache().
void nl_cache_mngt_unprovide | ( | struct nl_cache * | cache | ) |
Unprovide a cache for global use.
cache | cache to unprovide |
Cancels the offer to use a cache globally. The cache will no longer be returned via lookups but may still be in use.
Definition at line 359 of file cache_mngt.c.
References nl_cache_free(), and nl_cache_ops_put().
Referenced by nl_cache_mngr_free().
struct nl_cache * __nl_cache_mngt_require | ( | const char * | name | ) |
Definition at line 377 of file cache_mngt.c.
struct nl_cache * nl_cache_mngt_require | ( | const char * | name | ) |
Return cache previously provided via nl_cache_mngt_provide()
name | Name of cache to lookup |
Definition at line 402 of file cache_mngt.c.
Referenced by nl_cache_mngt_require_safe().
struct nl_cache * nl_cache_mngt_require_safe | ( | const char * | name | ) |
Return cache previously provided via nl_cache_mngt_provide()
name | Name of cache to lookup |
Definition at line 424 of file cache_mngt.c.
References nl_cache_get(), and nl_cache_mngt_require().