ae997e6776fecdfc1844660ddc30411ee2d87450
[sliver-openvswitch.git] / datapath / odp-compat.h
1 /*
2  * Copyright (c) 2010, 2011 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 ODP_COMPAT_H
10 #define ODP_COMPAT_H 1
11
12 /* 32-bit ioctl compatibility definitions for datapath protocol. */
13
14 #ifdef CONFIG_COMPAT
15 #include "openvswitch/datapath-protocol.h"
16 #include <linux/compat.h>
17
18 #define ODP_FLOW_GET32          _IOWR('O', 13, struct compat_odp_flow)
19 #define ODP_FLOW_PUT32          _IOWR('O', 14, struct compat_odp_flow)
20 #define ODP_FLOW_DUMP32         _IOWR('O', 15, struct compat_odp_flow_dump)
21 #define ODP_FLOW_DEL32          _IOWR('O', 17, struct compat_odp_flow)
22 #define ODP_EXECUTE32           _IOR('O', 18, struct compat_odp_execute)
23 #define ODP_FLOW_DEL32          _IOWR('O', 17, struct compat_odp_flow)
24
25 struct compat_odp_flow {
26         uint32_t dp_idx;
27         struct odp_flow_stats stats;
28         compat_uptr_t key;
29         u32 key_len;
30         compat_uptr_t actions;
31         u32 actions_len;
32 };
33
34 struct compat_odp_flow_put {
35         struct compat_odp_flow flow;
36         u32 flags;
37 };
38
39 struct compat_odp_flow_dump {
40         uint32_t dp_idx;
41         compat_uptr_t flow;
42         uint32_t state[2];
43 };
44
45 struct compat_odp_execute {
46         uint32_t dp_idx;
47
48         compat_uptr_t actions;
49         u32 actions_len;
50
51         compat_uptr_t data;
52         u32 length;
53 };
54 #endif  /* CONFIG_COMPAT */
55
56 #endif  /* odp-compat.h */