libnl 3.7.0
|
Resolves Generic Netlink family names to numeric identifiers. More...
Modules | |
Generic Netlink Family Object | |
Object representing a kernel side registered Generic Netlink family. | |
Controller Cache | |
The controller cache allows to keep a local copy of the list of all kernel side registered Generic Netlink families to quickly resolve multiple Generic Netlink family names without requiring to communicate with the kernel for each resolving iteration. | |
int | genl_ctrl_alloc_cache (struct nl_sock *sk, struct nl_cache **result) |
Allocate a new controller cache. More... | |
struct genl_family * | genl_ctrl_search (struct nl_cache *cache, int id) |
Search controller cache for a numeric address match. More... | |
struct genl_family * | genl_ctrl_search_by_name (struct nl_cache *cache, const char *name) |
Search controller cache for a family name match. More... | |
Direct Resolvers | |
These functions communicate directly with the kernel and do not require a cache to be kept up to date. | |
int | genl_ctrl_resolve (struct nl_sock *sk, const char *name) |
Resolve Generic Netlink family name to numeric identifier. More... | |
int | genl_ctrl_resolve_grp (struct nl_sock *sk, const char *family_name, const char *grp_name) |
Resolve Generic Netlink family group name. More... | |
Resolves Generic Netlink family names to numeric identifiers.
The controller is a component in the kernel that resolves Generic Netlink family names to their numeric identifiers. This module provides functions to query the controller to access the resolving functionality.
int genl_ctrl_alloc_cache | ( | struct nl_sock * | sk, |
struct nl_cache ** | result | ||
) |
Allocate a new controller cache.
sk | Generic Netlink socket |
result | Pointer to store resulting cache |
Allocates a new cache mirroring the state of the controller and stores it in *result
. The allocated cache will contain a list of all currently registered kernel side Generic Netlink families. The cache is meant to be used to resolve family names locally.
Definition at line 327 of file ctrl.c.
References nl_cache_alloc_and_fill().
Referenced by genl_mngt_resolve(), and genl_ops_resolve().
struct genl_family * genl_ctrl_search | ( | struct nl_cache * | cache, |
int | id | ||
) |
Search controller cache for a numeric address match.
cache | Controller cache |
id | Numeric family identifier. |
Searches a previously allocated controller cache and looks for an entry that matches the specified numeric family identifier id
. If a match is found successfully, the reference count of the matching object is increased by one before the objet is returned.
Definition at line 348 of file ctrl.c.
References nl_object_get().
struct genl_family * genl_ctrl_search_by_name | ( | struct nl_cache * | cache, |
const char * | name | ||
) |
Search controller cache for a family name match.
cache | Controller cache |
name | Name of Generic Netlink family |
Searches a previously allocated controller cache and looks for an entry that matches the specified family name
. If a match is found successfully, the reference count of the matching object is increased by one before the objet is returned.
Definition at line 381 of file ctrl.c.
References nl_object_get().
int genl_ctrl_resolve | ( | struct nl_sock * | sk, |
const char * | name | ||
) |
Resolve Generic Netlink family name to numeric identifier.
sk | Generic Netlink socket. |
name | Name of Generic Netlink family |
Resolves the Generic Netlink family name to the corresponding numeric family identifier. This function queries the kernel directly, use genl_ctrl_search_by_name() if you need to resolve multiple names.
Definition at line 423 of file ctrl.c.
References genl_family_get_id(), and genl_family_put().
int genl_ctrl_resolve_grp | ( | struct nl_sock * | sk, |
const char * | family_name, | ||
const char * | grp_name | ||
) |
Resolve Generic Netlink family group name.
sk | Generic Netlink socket |
family_name | Name of Generic Netlink family |
grp_name | Name of group to resolve |
Looks up the family object and resolves the group name to the numeric group identifier.
Definition at line 465 of file ctrl.c.
References genl_family_put().