Whamcloud - gitweb
LU-9680 net: Netlink improvements
[fs/lustre-release.git] / libcfs / include / libcfs / linux / linux-net.h
index 08d9cf9..a9502a3 100644 (file)
@@ -24,6 +24,7 @@
 #define __LIBCFS_LINUX_NET_H__
 
 #include <net/netlink.h>
+#include <net/genetlink.h>
 
 #ifndef HAVE_NLA_STRDUP
 char *nla_strdup(const struct nlattr *nla, gfp_t flags);
@@ -76,6 +77,28 @@ static inline int cfs_nla_parse_nested(struct nlattr *tb[], int maxtype,
 
 #endif
 
+#ifndef HAVE_GENL_DUMPIT_INFO
+struct cfs_genl_dumpit_info {
+       const struct genl_family *family;
+       const struct genl_ops *ops;
+       struct nlattr **attrs;
+};
+
+static inline const struct cfs_genl_dumpit_info *
+lnet_genl_dumpit_info(struct netlink_callback *cb)
+{
+       return (const struct cfs_genl_dumpit_info *)cb->args[1];
+}
+#else
+#define cfs_genl_dumpit_info   genl_dumpit_info
+
+static inline const struct cfs_genl_dumpit_info *
+lnet_genl_dumpit_info(struct netlink_callback *cb)
+{
+       return (const struct cfs_genl_dumpit_info *)genl_dumpit_info(cb);
+}
+#endif /* HAVE_GENL_DUMPIT_INFO */
+
 #ifdef HAVE_KERNEL_SETSOCKOPT
 
 #include <net/tcp.h>