For SNAT, don't store the pre-fragment L2 header before actions are applied.
[sliver-openvswitch.git] / datapath / forward.h
1 #ifndef FORWARD_H
2 #define FORWARD_H 1
3
4 #include <linux/types.h>
5 #include "datapath.h"
6 #include "flow.h"
7
8 struct sk_buff;
9 struct sw_chain;
10 struct sender;
11
12 /* Buffers are identified to userspace by a 31-bit opaque ID.  We divide the ID
13  * into a buffer number (low bits) and a cookie (high bits).  The buffer number
14  * is an index into an array of buffers.  The cookie distinguishes between
15  * different packets that have occupied a single buffer.  Thus, the more
16  * buffers we have, the lower-quality the cookie... */
17 #define PKT_BUFFER_BITS 8
18 #define N_PKT_BUFFERS (1 << PKT_BUFFER_BITS)
19 #define PKT_BUFFER_MASK (N_PKT_BUFFERS - 1)
20
21 #define PKT_COOKIE_BITS (32 - PKT_BUFFER_BITS)
22
23
24 void fwd_port_input(struct sw_chain *, struct sk_buff *,
25                     struct net_bridge_port *);
26 int run_flow_through_tables(struct sw_chain *, struct sk_buff *,
27                             struct net_bridge_port *);
28 int fwd_control_input(struct sw_chain *, const struct sender *,
29                       const void *, size_t);
30
31 uint32_t fwd_save_skb(struct sk_buff *skb);
32 void fwd_discard_all(void);
33 void fwd_exit(void);
34
35 #endif /* forward.h */