X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=datapath%2Fdatapath.h;h=44a3b6952342cf941588c26b39a1d5fb9fd4b71b;hb=b057b10a7417dfa3fa3792ca2f7666bfab87d07b;hp=9c6a6a806b7678587d3b263ac81bde1d65f2b6ec;hpb=60a87c9b0032346568485ad40fd72ea1f72b8674;p=sliver-openvswitch.git diff --git a/datapath/datapath.h b/datapath/datapath.h index 9c6a6a806..44a3b6952 100644 --- a/datapath/datapath.h +++ b/datapath/datapath.h @@ -3,6 +3,7 @@ #ifndef DATAPATH_H #define DATAPATH_H 1 +#include #include #include #include @@ -19,7 +20,10 @@ #endif /* Capabilities supported by this implementation. */ -#define OFP_SUPPORTED_CAPABILITIES (OFPC_MULTI_PHY_TX) +#define OFP_SUPPORTED_CAPABILITIES ( OFPC_FLOW_STATS \ + | OFPC_TABLE_STATS \ + | OFPC_PORT_STATS \ + | OFPC_MULTI_PHY_TX ) /* Actions supported by this implementation. */ #define OFP_SUPPORTED_ACTIONS ( (1 << OFPAT_OUTPUT) \ @@ -45,25 +49,40 @@ struct datapath { struct task_struct *dp_task; /* Kernel thread for maintenance. */ /* Data related to the "of" device of this datapath */ - struct net_device dev; - struct net_device_stats stats; + struct net_device *netdev; - struct ofp_switch_config config; + /* Configuration set from controller */ + uint16_t flags; + uint16_t miss_send_len; /* Switch ports. */ struct net_bridge_port *ports[OFPP_MAX]; - struct list_head port_list; /* List of ports, for flooding. */ + struct net_bridge_port *local_port; /* OFPP_LOCAL port. */ + struct list_head port_list; /* All ports, including local_port. */ }; +/* Information necessary to reply to the sender of an OpenFlow message. */ +struct sender { + uint32_t xid; /* OpenFlow transaction ID of request. */ + uint32_t pid; /* Netlink process ID of sending socket. */ + uint32_t seq; /* Netlink sequence ID of request. */ +}; + +extern struct mutex dp_mutex; + int dp_output_port(struct datapath *, struct sk_buff *, int out_port); -int dp_output_control(struct datapath *, struct sk_buff *, - uint32_t buffer_id, size_t max_len, int reason); +int dp_output_control(struct datapath *, struct sk_buff *, uint32_t, + size_t, int); int dp_set_origin(struct datapath *, uint16_t, struct sk_buff *); -int dp_send_features_reply(struct datapath *, uint32_t xid); -int dp_send_config_reply(struct datapath *, uint32_t xid); -int dp_send_flow_expired(struct datapath *, struct sw_flow *); -int dp_send_port_stats(struct datapath *dp, uint32_t xid); -int dp_update_port_flags(struct datapath *dp, const struct ofp_phy_port *opp); +int dp_send_features_reply(struct datapath *, const struct sender *); +int dp_send_config_reply(struct datapath *, const struct sender *); +int dp_send_flow_expired(struct datapath *, struct sw_flow *, + enum ofp_flow_expired_reason); +int dp_send_error_msg(struct datapath *, const struct sender *, + uint16_t, uint16_t, const uint8_t *, size_t); +int dp_update_port_flags(struct datapath *dp, const struct ofp_port_mod *opm); +int dp_send_echo_reply(struct datapath *, const struct sender *, + const struct ofp_header *); /* Should hold at least RCU read lock when calling */ struct datapath *dp_get(int dp_idx);