1 #ifndef __RTNETLINK_WRAPPER_H
2 #define __RTNETLINK_WRAPPER_H 1
4 #include_next <linux/rtnetlink.h>
6 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
7 static inline void rtnl_notify(struct sk_buff *skb, struct net *net, u32 pid,
8 u32 group, struct nlmsghdr *nlh, gfp_t flags)
10 BUG_ON(nlh); /* not implemented */
12 /* errors reported via destination sk->sk_err */
13 nlmsg_multicast(rtnl, skb, 0, group);
17 static inline void rtnl_set_sk_err(struct net *net, u32 group, int error)
19 netlink_set_err(rtnl, 0, group, error);
21 #elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
22 /* No 'net' parameter in these versions. */
23 #define rtnl_notify(skb, net, pid, group, nlh, flags) \
24 ((void) (net), (void) rtnl_notify(skb, pid, group, nlh, flags))
25 #define rtnl_set_sk_err(net, group, error) \
26 ((void) (net), rtnl_set_sk_err(group, error))
27 #elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
28 /* Make the return type effectively 'void' to match Linux 2.6.30+. */
29 #define rtnl_notify(skb, net, pid, group, nlh, flags) \
30 ((void) rtnl_notify(skb, net, pid, group, nlh, flags))
33 #endif /* linux/rtnetlink.h wrapper */