datapath: Change listing flows to use an iterator concept.
[sliver-openvswitch.git] / datapath / odp-compat.h
1 /*
2  * Copyright (c) 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 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_VPORT_LIST32        _IOWR('O', 10, struct compat_odp_portvec)
19 #define ODP_FLOW_GET32          _IOWR('O', 13, struct compat_odp_flowvec)
20 #define ODP_FLOW_PUT32          _IOWR('O', 14, struct compat_odp_flow)
21 #define ODP_FLOW_DUMP32         _IOWR('O', 15, struct compat_odp_flow_dump)
22 #define ODP_FLOW_DEL32          _IOWR('O', 17, struct compat_odp_flow)
23 #define ODP_EXECUTE32           _IOR('O', 18, struct compat_odp_execute)
24 #define ODP_FLOW_DEL32          _IOWR('O', 17, struct compat_odp_flow)
25
26 struct compat_odp_portvec {
27         compat_uptr_t ports;
28         u32 n_ports;
29 };
30
31 struct compat_odp_flow {
32         struct odp_flow_stats stats;
33         struct odp_flow_key key;
34         compat_uptr_t actions;
35         u32 actions_len;
36         u32 flags;
37 };
38
39 struct compat_odp_flow_put {
40         struct compat_odp_flow flow;
41         u32 flags;
42 };
43
44 struct compat_odp_flow_dump {
45         compat_uptr_t flow;
46         uint32_t state[2];
47 };
48
49 struct compat_odp_flowvec {
50         compat_uptr_t flows;
51         u32 n_flows;
52 };
53
54 struct compat_odp_execute {
55         compat_uptr_t actions;
56         u32 actions_len;
57
58         compat_uptr_t data;
59         u32 length;
60 };
61 #endif  /* CONFIG_COMPAT */
62
63 #endif  /* odp-compat.h */