Import from old repository commit 61ef2b42a9c4ba8e1600f15bb0236765edc2ad45.
[cascardo/ovs.git] / datapath / linux-2.6 / compat-2.6 / include / linux / rtnetlink.h
1 #ifndef __RTNETLINK_WRAPPER_H
2 #define __RTNETLINK_WRAPPER_H 1
3
4 #include_next <linux/rtnetlink.h>
5
6 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
7 static inline int rtnl_notify(struct sk_buff *skb, struct net *net, u32 pid,
8                               u32 group, struct nlmsghdr *nlh, gfp_t flags)
9 {
10         BUG_ON(nlh);            /* not implemented */
11         if (group) {
12                 /* errors reported via destination sk->sk_err */
13                 nlmsg_multicast(rtnl, skb, 0, group);
14         }
15         return 0;
16 }
17
18 static inline void rtnl_set_sk_err(struct net *net, u32 group, int error)
19 {
20         netlink_set_err(rtnl, 0, group, error);
21 }
22 #elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
23 #define rtnl_notify(skb, net, pid, group, nlh, flags) \
24         ((void) (net), 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 #endif /* linux kernel < 2.6.25 */
28
29 #endif /* linux/rtnetlink.h wrapper */