Make snat_skb() skb argument const.
[sliver-openvswitch.git] / datapath / datapath.h
index 621906b..89c9059 100644 (file)
@@ -3,12 +3,13 @@
 #ifndef DATAPATH_H
 #define DATAPATH_H 1
 
+#include <linux/kernel.h>
 #include <linux/mutex.h>
 #include <linux/netlink.h>
 #include <linux/netdevice.h>
 #include <linux/workqueue.h>
 #include <linux/skbuff.h>
-#include "openflow.h"
+#include "openflow/openflow.h"
 #include "flow.h"
 
 
@@ -28,7 +29,9 @@
 
 /* Actions supported by this implementation. */
 #define OFP_SUPPORTED_ACTIONS ( (1 << OFPAT_OUTPUT) \
-               | (1 << OFPAT_SET_DL_VLAN) \
+               | (1 << OFPAT_SET_VLAN_VID) \
+               | (1 << OFPAT_SET_VLAN_PCP) \
+               | (1 << OFPAT_STRIP_VLAN) \
                | (1 << OFPAT_SET_DL_SRC) \
                | (1 << OFPAT_SET_DL_DST) \
                | (1 << OFPAT_SET_NW_SRC) \
@@ -38,6 +41,8 @@
 
 struct sk_buff;
 
+#define DP_MAX_PORTS 255
+
 struct datapath {
        int dp_idx;
 
@@ -57,7 +62,7 @@ struct datapath {
        uint16_t miss_send_len;
 
        /* Switch ports. */
-       struct net_bridge_port *ports[OFPP_MAX];
+       struct net_bridge_port *ports[DP_MAX_PORTS];
        struct net_bridge_port *local_port; /* OFPP_LOCAL port. */
        struct list_head port_list; /* All ports, including local_port. */
 };
@@ -77,18 +82,20 @@ struct net_bridge_port {
        struct work_struct port_task;
        struct datapath *dp;
        struct net_device *dev;
-       struct list_head node; /* Element in datapath.ports. */
+       struct snat_conf *snat;  /* Only set if SNAT is configured for this port. */
+       struct list_head node;   /* Element in datapath.ports. */
 };
 
 extern struct mutex dp_mutex;
 extern struct notifier_block dp_device_notifier;
 
 int dp_del_switch_port(struct net_bridge_port *);
+int dp_xmit_skb(struct sk_buff *skb);
 int dp_output_port(struct datapath *, struct sk_buff *, int out_port,
                   int ignore_no_fwd);
 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 *);
+void dp_set_origin(struct datapath *, uint16_t, struct sk_buff *);
 int dp_send_features_reply(struct datapath *, const struct sender *);
 int dp_send_config_reply(struct datapath *, const struct sender *);
 int dp_send_port_status(struct net_bridge_port *p, uint8_t status);