1 #include <net/genetlink.h>
2 #include <linux/version.h>
4 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,13,0)
8 void rpl_genl_notify(struct rpl_genl_family *family, struct sk_buff *skb,
9 struct net *net, u32 portid, u32 group,
10 struct nlmsghdr *nlh, gfp_t flags)
12 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)
13 struct sock *sk = net->genl_sock;
17 report = nlmsg_report(nlh);
19 nlmsg_notify(sk, skb, portid, group, report, flags);
21 genl_notify(skb, net, portid, group, nlh, flags);
25 int rpl___genl_register_family(struct rpl_genl_family *f)
29 f->compat_family.id = f->id;
30 f->compat_family.hdrsize = f->hdrsize;
31 strncpy(f->compat_family.name, f->name, GENL_NAMSIZ);
32 f->compat_family.version = f->version;
33 f->compat_family.maxattr = f->maxattr;
34 f->compat_family.netnsok = f->netnsok;
35 #ifdef HAVE_PARALLEL_OPS
36 f->compat_family.parallel_ops = f->parallel_ops;
38 err = genl_register_family_with_ops(&f->compat_family,
39 (struct genl_ops *) f->ops, f->n_ops);
44 /* Need to Fix GROUP_ID() for more than one group. */
45 BUG_ON(f->n_mcgrps > 1);
46 err = genl_register_mc_group(&f->compat_family,
47 (struct genl_multicast_group *) f->mcgrps);
55 #endif /* kernel version < 3.13.0 */