1 /* Interface exported by OpenFlow module. */
6 #include <linux/netlink.h>
7 #include <linux/netdevice.h>
8 #include <linux/skbuff.h>
13 #define NL_FLOWS_PER_MESSAGE 100
18 #define dprintk(x...) printk(x)
21 /* Capabilities supported by this implementation. */
22 #define OFP_SUPPORTED_CAPABILITIES (OFPC_MULTI_PHY_TX)
24 /* Actions supported by this implementation. */
25 #define OFP_SUPPORTED_ACTIONS ( (1 << OFPAT_OUTPUT) \
26 | (1 << OFPAT_SET_DL_VLAN) \
27 | (1 << OFPAT_SET_DL_SRC) \
28 | (1 << OFPAT_SET_DL_DST) \
29 | (1 << OFPAT_SET_NW_SRC) \
30 | (1 << OFPAT_SET_NW_DST) \
31 | (1 << OFPAT_SET_TP_SRC) \
32 | (1 << OFPAT_SET_TP_DST) )
39 /* Unique identifier for this datapath, incorporates the dp_idx and
40 * a hardware address */
43 struct timer_list timer; /* Expiration timer. */
44 struct sw_chain *chain; /* Forwarding rules. */
46 /* Data related to the "of" device of this datapath */
47 struct net_device dev;
48 struct net_device_stats stats;
50 /* Flags from the control hello message */
53 /* Maximum number of bytes that should be sent for flow misses */
54 uint16_t miss_send_len;
57 struct net_bridge_port *ports[OFPP_MAX];
58 struct list_head port_list; /* List of ports, for flooding. */
61 int dp_output_port(struct datapath *, struct sk_buff *, int out_port);
62 int dp_output_control(struct datapath *, struct sk_buff *,
63 uint32_t buffer_id, size_t max_len, int reason);
64 int dp_set_origin(struct datapath *, uint16_t, struct sk_buff *);
65 int dp_send_hello(struct datapath *);
66 int dp_send_flow_expired(struct datapath *, struct sw_flow *);
67 int dp_update_port_flags(struct datapath *dp, const struct ofp_phy_port *opp);
69 /* Should hold at least RCU read lock when calling */
70 struct datapath *dp_get(int dp_idx);
72 #endif /* datapath.h */