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