summaryrefslogtreecommitdiff
path: root/include/netlink/genl
AgeCommit message (Collapse)Author
2017-10-09nl: add "const" specifier for nla_policy argument of parse functionsThomas Haller
Adding const to a function argument is generally not an API break (at least, if the argument is a struct, like in this case). Usually we declare the policy as static variables. The user should be able to mark them as "const", so that the linker makes the policy array read-only. Adjust the API to allow for that. Signed-off-by: Thomas Haller <thaller@redhat.com>
2012-06-01genl: Export genl_ops_resolve() and genl_mngt_resolve() in headerThomas Graf
These have been public but have not been declared in a header yet.
2012-06-01genl: Support registration of families without depending on cachesThomas Graf
Introduces the functions genl_register_family() and genl_unregister_family() to register a Generic Netlink family which does not implement a cachable type. API users can direct received messages into genl_handle_msg() which will validate the messages and call the callback functions defined in the commands definition. See test/test-genl.c for an example on how to use it.
2012-05-31genl: Add genlmsg_user_hdr(), genlmsg_user_data(), and genlmsg_user_datalen()Thomas Graf
These functions deprecate the function genlmsg_data() which did not allow to specify the length of the user header. Use of the new API will make code much clearer. The old function is still kept around for backwards compatibility but marked deprecated in the API reference.
2012-05-31genl: updates to API reference documentationThomas Graf
2010-10-14Generic Netlink multicast groups supportdima
I have a patch against commit d378220c96c3c8b6f27dca33e7d8ba03318f9c2d extending libnl with a facility to receive generic netlink messages sent to multicast groups. Essentially it add one new function genl_ctrl_resolve_grp which prototype looks like this int genl_ctrl_resolve_grp(struct nl_sock *sk, const char *family_name, const char *grp_name) It resolves the family name and the group name to group id. Then the returned id can be used in nl_socket_add_membership to subscribe to multicast messages. Besides that it adds two more functions uint32_t nl_socket_get_peer_groups(struct nl_sock *sk) void nl_socket_set_peer_groups(struct nl_sock *sk, uint32_t groups) allowing to modify the socket peer groups field. So it's possible to multicast messages from the user space using the legacy interface. Looks like there is no way (or I was not able to find one?) to modify the netlink socket destination group from the user space, when the group id is greater then 32.
2008-06-17Fix compile errors when linking against libnl-genlThomas Graf
2008-05-15Rename struct nl_handle to struct nl_sockThomas Graf
The idea of a common handle is long revised and only misleading, nl_handle really represents a socket with some additional action handlers assigned to it. Alias for nl_handle is kept for backwards compatibility.
2008-05-14Thread-safe error handlingThomas Graf
In order for the interface to become more thread safe, the error handling was revised to no longer depend on a static errno and error string buffer. This patch converts all error paths to return a libnl specific error code which can be translated to a error message using nl_geterror(int error). The functions nl_error() and nl_get_errno() are therefore obsolete. This change required various sets of function prototypes to be changed in order to return an error code, the most prominent are: struct nl_cache *foo_alloc_cache(...); changed to: int foo_alloc_cache(..., struct nl_cache **); struct nl_msg *foo_build_request(...); changed to: int foo_build_request(..., struct nl_msg **); struct foo *foo_parse(...); changed to: int foo_parse(..., struct foo **); This pretty much only leaves trivial allocation functions to still return a pointer object which can still return NULL to signal out of memory. This change is a serious API and ABI breaker, sorry!
2008-01-10Added additional parsing and validation functions for generic netlinkThomas Graf
Also adds better example documentation for generic netlink
2007-09-15Add missing declarations for genlmsg_data() and genlmsg_len()Thomas Graf
2007-09-15Initial importnougat-mr1-arcThomas Graf