From aae09e27c30ee63c4a555e4f7fdf06448b4eced4 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Wed, 5 Aug 2020 17:11:50 +0200 Subject: unl: add support for connecting to rtnl The API is almost the same and some unl_genl_* functions are renamed to unl_* with compat #define in place The only thing different between genl and rtnl is the init function and the function for allocating a message Signed-off-by: Felix Fietkau --- include/unl.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/unl.h b/include/unl.h index 4fe7dc7..0709818 100644 --- a/include/unl.h +++ b/include/unl.h @@ -16,14 +16,22 @@ struct unl { }; int unl_genl_init(struct unl *unl, const char *family); +int unl_rtnl_init(struct unl *unl); void unl_free(struct unl *unl); typedef int (*unl_cb)(struct nl_msg *, void *); struct nl_msg *unl_genl_msg(struct unl *unl, int cmd, bool dump); -int unl_genl_request(struct unl *unl, struct nl_msg *msg, unl_cb handler, void *arg); -int unl_genl_request_single(struct unl *unl, struct nl_msg *msg, struct nl_msg **dest); -void unl_genl_loop(struct unl *unl, unl_cb handler, void *arg); +struct nl_msg *unl_rtnl_msg(struct unl *unl, int cmd, bool dump); + +int unl_request(struct unl *unl, struct nl_msg *msg, unl_cb handler, void *arg); +int unl_request_single(struct unl *unl, struct nl_msg *msg, struct nl_msg **dest); +void unl_loop(struct unl *unl, unl_cb handler, void *arg); + +/* compat */ +#define unl_genl_request unl_request +#define unl_genl_request_single unl_request_single +#define unl_genl_loop unl_loop int unl_genl_multicast_id(struct unl *unl, const char *name); int unl_genl_subscribe(struct unl *unl, const char *name); -- cgit v1.2.1