]> git.proxmox.com Git - mirror_iproute2.git/blob - include/libgenl.h
Merge branch 'master' into net-next
[mirror_iproute2.git] / include / libgenl.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __LIBGENL_H__
3 #define __LIBGENL_H__
4
5 #include "libnetlink.h"
6
7 #define GENL_REQUEST(_req, _bufsiz, _family, _hdrsiz, _ver, _cmd, _flags) \
8 struct { \
9 struct nlmsghdr n; \
10 struct genlmsghdr g; \
11 char buf[NLMSG_ALIGN(_hdrsiz) + (_bufsiz)]; \
12 } _req = { \
13 .n = { \
14 .nlmsg_type = (_family), \
15 .nlmsg_flags = (_flags), \
16 .nlmsg_len = NLMSG_LENGTH(GENL_HDRLEN + (_hdrsiz)), \
17 }, \
18 .g = { \
19 .cmd = (_cmd), \
20 .version = (_ver), \
21 }, \
22 }
23
24 extern int genl_resolve_family(struct rtnl_handle *grth, const char *family);
25 extern int genl_init_handle(struct rtnl_handle *grth, const char *family,
26 int *genl_family);
27
28 #endif /* __LIBGENL_H__ */