09ee23bdd6ab3608e1c4acd344e8eadb1538ac71
[sliver-openvswitch.git] / datapath / linux / compat / include / net / genetlink.h
1 #ifndef __NET_GENERIC_NETLINK_WRAPPER_H
2 #define __NET_GENERIC_NETLINK_WRAPPER_H 1
3
4 #include <linux/version.h>
5 #include <linux/netlink.h>
6 #include <net/net_namespace.h>
7 #include_next <net/genetlink.h>
8
9 /*
10  * 15e473046cb6e5d18a4d0057e61d76315230382b renames pid to portid
11  * the affected structures are
12  * netlink_skb_parms::pid -> portid
13  * genl_info::snd_pid -> snd_portid
14  */
15 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)
16 #define snd_portid snd_pid
17 #define portid pid
18 #endif
19
20 extern void genl_notify(struct sk_buff *skb, struct net *net, u32 portid,
21                         u32 group, struct nlmsghdr *nlh, gfp_t flags);
22
23 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,14,0)
24 static inline struct sk_buff *genlmsg_new_unicast(size_t payload,
25                                                   struct genl_info *info,
26                                                   gfp_t flags)
27 {
28         return genlmsg_new(payload, flags);
29 }
30 #endif
31
32 #endif /* genetlink.h */