Implement 802.1D Spanning Tree Protocol.
[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 ofp_action;
11 struct sender;
12
13 /* Buffers are identified to userspace by a 31-bit opaque ID.  We divide the ID
14  * into a buffer number (low bits) and a cookie (high bits).  The buffer number
15  * is an index into an array of buffers.  The cookie distinguishes between
16  * different packets that have occupied a single buffer.  Thus, the more
17  * buffers we have, the lower-quality the cookie... */
18 #define PKT_BUFFER_BITS 8
19 #define N_PKT_BUFFERS (1 << PKT_BUFFER_BITS)
20 #define PKT_BUFFER_MASK (N_PKT_BUFFERS - 1)
21
22 #define PKT_COOKIE_BITS (32 - PKT_BUFFER_BITS)
23
24
25 void fwd_port_input(struct sw_chain *, struct sk_buff *,
26                     struct net_bridge_port *);
27 int run_flow_through_tables(struct sw_chain *, struct sk_buff *,
28                             struct net_bridge_port *);
29 int fwd_control_input(struct sw_chain *, const struct sender *,
30                       const void *, size_t);
31
32 uint32_t fwd_save_skb(struct sk_buff *skb);
33 void fwd_discard_all(void);
34
35 void fwd_exit(void);
36
37 void execute_actions(struct datapath *, struct sk_buff *,
38                      const struct sw_flow_key *, 
39                      const struct ofp_action *, int n_actions,
40                      int ignore_no_fwd);
41 struct sk_buff *execute_setter(struct sk_buff *, uint16_t,
42                         const struct sw_flow_key *, const struct ofp_action *);
43
44 #endif /* forward.h */