datapath: Rename linux-2.6 and compat-2.6 directories.
[sliver-openvswitch.git] / datapath / linux / compat / include / linux / netlink.h
1 #ifndef __LINUX_NETLINK_WRAPPER_H
2 #define __LINUX_NETLINK_WRAPPER_H 1
3
4 #include <linux/skbuff.h>
5 #include_next <linux/netlink.h>
6
7 #ifndef NLA_TYPE_MASK
8 #define NLA_F_NESTED            (1 << 15)
9 #define NLA_F_NET_BYTEORDER     (1 << 14)
10 #define NLA_TYPE_MASK           ~(NLA_F_NESTED | NLA_F_NET_BYTEORDER)
11 #endif
12
13 #include <net/netlink.h>
14 #include <linux/version.h>
15
16 #ifndef NLMSG_DEFAULT_SIZE
17 #define NLMSG_DEFAULT_SIZE (NLMSG_GOODSIZE - NLMSG_HDRLEN)
18 #endif
19
20 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
21 #define nlmsg_new(s, f)   nlmsg_new_proper((s), (f))
22 static inline struct sk_buff *nlmsg_new_proper(int size, gfp_t flags)
23 {
24         return alloc_skb(size, flags);
25 }
26 #endif /* linux kernel < 2.6.19 */
27
28 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
29 static inline struct nlmsghdr *nlmsg_hdr(const struct sk_buff *skb)
30 {
31         return (struct nlmsghdr *)skb->data;
32 }
33 #endif
34
35 #endif