summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2020-08-05 17:11:50 +0200
committerrofl0r <rofl0r@users.noreply.github.com>2022-09-16 01:32:26 +0000
commitaae09e27c30ee63c4a555e4f7fdf06448b4eced4 (patch)
tree05e6c30b199729857edb4d54ade34616ce9a3435 /include
parentf74511ed4608f9dd2d1ced612b0d6a3e65db5da4 (diff)
downloadlibnl-tiny-aae09e27c30ee63c4a555e4f7fdf06448b4eced4.tar.gz
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 <nbd@nbd.name>
Diffstat (limited to 'include')
-rw-r--r--include/unl.h14
1 files changed, 11 insertions, 3 deletions
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);