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. | |
struct nl_cache_ops * | nl_cache_ops_associate (int protocol, int msgtype) |
Associate a message type to a set of cache operations. | |
struct nl_msgtype * | nl_msgtype_lookup (struct nl_cache_ops *ops, int msgtype) |
Lookup message type cache association. | |
void | nl_cache_ops_foreach (void(*cb)(struct nl_cache_ops *, void *), void *arg) |
Call a function for each registered cache operation. | |
int | nl_cache_mngt_register (struct nl_cache_ops *ops) |
Register a set of cache operations. | |
int | nl_cache_mngt_unregister (struct nl_cache_ops *ops) |
Unregister a set of cache operations. | |
Global Cache Provisioning/Requiring | |
| |
void | nl_cache_mngt_provide (struct nl_cache *cache) |
Provide a cache for global use. | |
void | nl_cache_mngt_unprovide (struct nl_cache *cache) |
Unprovide a cache for global use. | |
struct nl_cache * | nl_cache_mngt_require (const char *name) |
Demand the use of a global cache. |
struct nl_cache_ops* nl_cache_ops_lookup | ( | const char * | name | ) | [read] |
Lookup the set cache operations of a certain cache type.
name | name of the cache type |
Definition at line 37 of file cache_mngt.c.
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_cache_ops* nl_cache_ops_associate | ( | int | protocol, | |
int | msgtype | |||
) | [read] |
Associate a message type to a set of cache operations.
protocol | netlink protocol | |
msgtype | netlink message type |
Associates the specified netlink message type with a registered set of cache operations.
Definition at line 59 of file cache_mngt.c.
References nl_msgtype::mt_id.
Referenced by nl_msg_dump().
struct nl_msgtype* nl_msgtype_lookup | ( | struct nl_cache_ops * | ops, | |
int | msgtype | |||
) | [read] |
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 86 of file cache_mngt.c.
References nl_msgtype::mt_id.
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 114 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 131 of file cache_mngt.c.
References nl_cache_ops_lookup().
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 158 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 190 of file cache_mngt.c.
Referenced by nl_cache_mngr_add().
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 209 of file cache_mngt.c.
struct nl_cache* nl_cache_mngt_require | ( | const char * | name | ) | [read] |
Demand the use of a global cache.
name | name of the required object type |
Trys to find a cache of the specified type for global use.
Definition at line 230 of file cache_mngt.c.
References nl_cache_ops_lookup().