]> git.proxmox.com Git - mirror_ovs.git/blame - datapath/compat.h
compat: Wrap IPv4 fragmentation.
[mirror_ovs.git] / datapath / compat.h
CommitLineData
9cb8d24d 1/*
e23775f2 2 * Copyright (c) 2007-2015 Nicira, Inc.
9cb8d24d 3 *
a9a29d22
JG
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of version 2 of the GNU General Public
6 * License as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
16 * 02110-1301, USA
9cb8d24d
JG
17 */
18
19#ifndef COMPAT_H
20#define COMPAT_H 1
21
6c5d24af
PS
22#include <linux/in.h>
23#include <linux/in_route.h>
9cb8d24d 24#include <linux/netlink.h>
6c5d24af
PS
25#include <net/route.h>
26#include <net/xfrm.h>
27
13dd4a97 28#ifdef HAVE_GENL_MULTICAST_GROUP_WITH_ID
cb25142c 29#define GROUP_ID(grp) ((grp)->id)
13dd4a97
JS
30#else
31#define GROUP_ID(grp) 0
14002a59
PS
32#endif
33
5ebaf571
PS
34#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)
35#define rt_dst(rt) (rt->dst)
36#else
37#define rt_dst(rt) (rt->u.dst)
38#endif
39
1b7ee51f
PS
40#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
41#define inet_sport(sk) (inet_sk(sk)->sport)
42#else
43#define inet_sport(sk) (inet_sk(sk)->inet_sport)
44#endif
45
e23775f2 46#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)
2baf0e0c
PS
47static inline bool skb_encapsulation(struct sk_buff *skb)
48{
49 return skb->encapsulation;
50}
51#else
52#define skb_encapsulation(skb) false
53#endif
54
9cb8d24d 55#endif /* compat.h */