Modules | |
Cache | |
Manager | |
Helps keeping caches up to date. | |
Cache Operations Sets | |
struct nl_cache_ops * | nl_cache_ops_lookup (const char *name) |
Lookup the set cache operations of a certain cache type. More... | |
struct nl_cache_ops * | nl_cache_ops_associate (int protocol, int msgtype) |
Associate a message type to a set of 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... | |
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) |
Demand the use of a global cache. More... | |
Provide a cache for global use.
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.
References BUG, nl_cache::c_ops, nl_cache_ops::co_major_cache, and nl_cache_ops::co_obj_ops.
Referenced by main(), nl_cache_mngr_add(), nl_cli_alloc_cache(), nl_cli_route_alloc_cache(), and nl_cli_rule_alloc_cache().
int nl_cache_mngt_register | ( | struct nl_cache_ops * | ops | ) |
Register a set of cache operations.
Called by users of caches to announce the avaibility of a certain cache type.
References nl_cache_ops::co_name, nl_cache_ops::co_next, nl_cache_ops::co_obj_ops, nl_cache_ops_lookup(), NL_DBG, NLE_EXIST, and NLE_INVAL.
Referenced by genl_register().
Demand the use of a global cache.
Trys to find a cache of the specified type for global use.
References nl_cache_ops::co_major_cache, nl_cache_ops_lookup(), and NULL.
Unprovide a cache for global use.
Cancels the offer to use a cache globally. The cache will no longer be returned via lookups but may still be in use.
References BUG, nl_cache::c_ops, nl_cache_ops::co_major_cache, nl_cache_ops::co_obj_ops, and NULL.
int nl_cache_mngt_unregister | ( | struct nl_cache_ops * | ops | ) |
Unregister a set of 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()
References nl_cache_ops::co_name, nl_cache_ops::co_next, NL_DBG, NLE_NOCACHE, and NULL.
Referenced by genl_unregister().
struct nl_cache_ops* nl_cache_ops_associate | ( | int | protocol, |
int | msgtype | ||
) |
Associate a message type to a set of cache operations.
Associates the specified netlink message type with a registered set of cache operations.
References nl_cache_ops::co_msgtypes, nl_cache_ops::co_next, nl_cache_ops::co_protocol, nl_msgtype::mt_id, and NULL.
Referenced by nl_msg_dump(), and nl_msg_parse().
void nl_cache_ops_foreach | ( | void(*)(struct nl_cache_ops *, void *) | cb, |
void * | arg | ||
) |
Call a function for each registered cache operation.
References nl_cache_ops::co_next.
Referenced by main().
struct nl_cache_ops* nl_cache_ops_lookup | ( | const char * | name | ) |
Lookup the set cache operations of a certain cache type.
References nl_cache_ops::co_name, nl_cache_ops::co_next, and NULL.
Referenced by nl_cache_alloc_name(), nl_cache_mngr_add(), nl_cache_mngt_register(), nl_cache_mngt_require(), and nl_object_alloc_name().
struct nl_msgtype* nl_msgtype_lookup | ( | struct nl_cache_ops * | ops, |
int | msgtype | ||
) |
Lookup message type cache association.
Searches for a matching message type association ing the specified cache operations.
References nl_cache_ops::co_msgtypes, nl_msgtype::mt_id, and NULL.