libnl 3.7.0
|
Registering Generic Netlink Families and Commands. More...
Data Structures | |
struct | genl_info |
Informative structure passed on to message parser callbacks. More... | |
struct | genl_cmd |
Definition of a Generic Netlink command. More... | |
struct | genl_ops |
Definition of a Generic Netlink family. More... | |
Registration | |
int | genl_register_family (struct genl_ops *ops) |
Register Generic Netlink family and associated commands. More... | |
int | genl_unregister_family (struct genl_ops *ops) |
Unregister Generic Netlink family. More... | |
int | genl_handle_msg (struct nl_msg *msg, void *arg) |
Run a received message through the demultiplexer. More... | |
Registration of Cache Operations | |
int | genl_register (struct nl_cache_ops *ops) |
Register Generic Netlink family backed cache. More... | |
void | genl_unregister (struct nl_cache_ops *ops) |
Unregister cache based Generic Netlink family. More... | |
Resolving the name of registered families | |
int | genl_ops_resolve (struct nl_sock *sk, struct genl_ops *ops) |
Resolve a single Generic Netlink family. More... | |
int | genl_mngt_resolve (struct nl_sock *sk) |
Resolve all registered Generic Netlink families. More... | |
Registering Generic Netlink Families and Commands.
int genl_register_family | ( | struct genl_ops * | ops | ) |
Register Generic Netlink family and associated commands.
ops | Generic Netlink family definition |
Registers the specified Generic Netlink family definition together with all associated commands. After registration, received Generic Netlink messages can be passed to genl_handle_msg() which will validate the messages, look for a matching command and call the respective callback function automatically.
Definition at line 164 of file mngt.c.
References genl_ops::o_cmds, genl_ops::o_id, genl_ops::o_list, genl_ops::o_name, and genl_ops::o_ncmds.
Referenced by genl_register().
int genl_unregister_family | ( | struct genl_ops * | ops | ) |
Unregister Generic Netlink family.
ops | Generic Netlink family definition |
Unregisters a family and all associated commands that were previously registered using genl_register_family().
Definition at line 194 of file mngt.c.
References genl_ops::o_list.
Referenced by genl_unregister().
int genl_handle_msg | ( | struct nl_msg * | msg, |
void * | arg | ||
) |
Run a received message through the demultiplexer.
msg | Generic Netlink message |
arg | Argument passed on to the message handler callback |
Definition at line 208 of file mngt.c.
References genlmsg_valid_hdr(), and nlmsg_hdr().
int genl_register | ( | struct nl_cache_ops * | ops | ) |
Register Generic Netlink family backed cache.
ops | Cache operations definition |
Same as genl_register_family() but additionally registers the specified cache operations using nl_cache_mngt_register() and associates it with the Generic Netlink family.
Definition at line 241 of file mngt.c.
References genl_register_family(), and nl_cache_mngt_register().
void genl_unregister | ( | struct nl_cache_ops * | ops | ) |
Unregister cache based Generic Netlink family.
ops | Cache operations definition |
Definition at line 278 of file mngt.c.
References genl_unregister_family(), and nl_cache_mngt_unregister().
int genl_ops_resolve | ( | struct nl_sock * | sk, |
struct genl_ops * | ops | ||
) |
Resolve a single Generic Netlink family.
sk | Generic Netlink socket |
ops | Generic Netlink family definition |
Resolves the family name to its numeric identifier.
Definition at line 351 of file mngt.c.
References genl_ctrl_alloc_cache(), and nl_cache_free().
int genl_mngt_resolve | ( | struct nl_sock * | sk | ) |
Resolve all registered Generic Netlink families.
sk | Generic Netlink socket |
Walks through all local Generic Netlink families that have been registered using genl_register() and resolves the name of each family to the corresponding numeric identifier.
Definition at line 379 of file mngt.c.
References genl_ctrl_alloc_cache(), nl_cache_free(), and genl_ops::o_list.