For SNAT, don't store the pre-fragment L2 header before actions are applied.
[sliver-openvswitch.git] / datapath / chain.h
1 #ifndef CHAIN_H
2 #define CHAIN_H 1
3
4 #include <linux/types.h>
5
6 struct sw_flow;
7 struct sw_flow_key;
8 struct ofp_action_header;
9 struct datapath;
10
11
12 #define TABLE_LINEAR_MAX_FLOWS  100
13 #define TABLE_HASH_MAX_FLOWS    65536
14
15 /* Set of tables chained together in sequence from cheap to expensive. */
16 #define CHAIN_MAX_TABLES 4
17 struct sw_chain {
18         int n_tables;
19         struct sw_table *tables[CHAIN_MAX_TABLES];
20
21         struct datapath *dp;
22         struct module *owner;
23 };
24
25 struct sw_chain *chain_create(struct datapath *);
26 struct sw_flow *chain_lookup(struct sw_chain *, const struct sw_flow_key *);
27 int chain_insert(struct sw_chain *, struct sw_flow *);
28 int chain_modify(struct sw_chain *, const struct sw_flow_key *, 
29                 uint16_t, int, const struct ofp_action_header *, size_t);
30 int chain_delete(struct sw_chain *, const struct sw_flow_key *, uint16_t, 
31                 uint16_t, int);
32 int chain_timeout(struct sw_chain *);
33 void chain_destroy(struct sw_chain *);
34
35 int chain_set_hw_hook(struct sw_table *(*create_hw_table)(void),
36                       struct module *owner);
37 void chain_clear_hw_hook(void);
38
39 #endif /* chain.h */