iproute2/include/libgenl.h
<<
>>
Prefs
   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) \
   8struct {                                                                \
   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
  24int genl_add_mcast_grp(struct rtnl_handle *grth, __u16 genl_family, const char *group);
  25int genl_resolve_family(struct rtnl_handle *grth, const char *family);
  26int genl_init_handle(struct rtnl_handle *grth, const char *family,
  27                     int *genl_family);
  28
  29#endif /* __LIBGENL_H__ */
  30