diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-09 13:14:35 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-09 13:14:35 +0000 |
commit | 9b8a97db9ec4b795e29e72289005fbc58484ebeb (patch) | |
tree | e24ca2d68215e57b4759fe5c032629821eabb250 /include/libgenl.h | |
parent | Initial commit. (diff) | |
download | iproute2-9b8a97db9ec4b795e29e72289005fbc58484ebeb.tar.xz iproute2-9b8a97db9ec4b795e29e72289005fbc58484ebeb.zip |
Adding upstream version 6.8.0.upstream/6.8.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'include/libgenl.h')
-rw-r--r-- | include/libgenl.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/include/libgenl.h b/include/libgenl.h new file mode 100644 index 0000000..97281cc --- /dev/null +++ b/include/libgenl.h @@ -0,0 +1,29 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef __LIBGENL_H__ +#define __LIBGENL_H__ + +#include "libnetlink.h" + +#define GENL_REQUEST(_req, _bufsiz, _family, _hdrsiz, _ver, _cmd, _flags) \ +struct { \ + struct nlmsghdr n; \ + struct genlmsghdr g; \ + char buf[NLMSG_ALIGN(_hdrsiz) + (_bufsiz)]; \ +} _req = { \ + .n = { \ + .nlmsg_type = (_family), \ + .nlmsg_flags = (_flags), \ + .nlmsg_len = NLMSG_LENGTH(GENL_HDRLEN + (_hdrsiz)), \ + }, \ + .g = { \ + .cmd = (_cmd), \ + .version = (_ver), \ + }, \ +} + +int genl_add_mcast_grp(struct rtnl_handle *grth, __u16 genl_family, const char *group); +int genl_resolve_family(struct rtnl_handle *grth, const char *family); +int genl_init_handle(struct rtnl_handle *grth, const char *family, + int *genl_family); + +#endif /* __LIBGENL_H__ */ |