datapath: Include linux/version.h in action.h for LINUX_VERSION
[sliver-openvswitch.git] / datapath / actions.h
1 /*
2  * Copyright (c) 2009, 2010 Nicira Networks.
3  * Distributed under the terms of the GNU GPL version 2.
4  *
5  * Significant portions of this file may be copied from parts of the Linux
6  * kernel, by Linus Torvalds and others.
7  */
8
9 #ifndef ACTIONS_H
10 #define ACTIONS_H 1
11
12 #include <linux/gfp.h>
13 #include <linux/skbuff.h>
14 #include <linux/version.h>
15
16 struct datapath;
17 struct sk_buff;
18 struct odp_flow_key;
19 union odp_action;
20
21 int execute_actions(struct datapath *dp, struct sk_buff *skb,
22                     const struct odp_flow_key *key,
23                     const union odp_action *, int n_actions,
24                     gfp_t gfp);
25
26 static inline void set_skb_csum_bits(const struct sk_buff *old_skb,
27                                      struct sk_buff *new_skb)
28 {
29 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
30         /* Before 2.6.24 these fields were not copied when
31          * doing an skb_copy_expand. */
32         new_skb->ip_summed = old_skb->ip_summed;
33         new_skb->csum = old_skb->csum;
34 #endif
35 #if defined(CONFIG_XEN) && defined(HAVE_PROTO_DATA_VALID)
36         /* These fields are copied in skb_clone but not in
37          * skb_copy or related functions.  We need to manually
38          * copy them over here. */
39         new_skb->proto_data_valid = old_skb->proto_data_valid;
40         new_skb->proto_csum_blank = old_skb->proto_csum_blank;
41 #endif
42 }
43
44 #endif /* actions.h */