Stopgap fix for bug #478, where kernel panics on SNAT to input port.
[sliver-openvswitch.git] / datapath / nx_act_snat.h
1 #ifdef SUPPORT_SNAT
2 #ifndef ACT_SNAT_H
3 #define ACT_SNAT_H
4
5 #include <linux/list.h>
6 #include <linux/skbuff.h>
7 #include <linux/rcupdate.h>
8
9 #include "openflow/nicira-ext.h"
10 #include "datapath.h"
11
12 /* Cache of IP->MAC mappings on the side hidden by the SNAT */
13 struct snat_mapping {
14         struct list_head node;
15         uint32_t ip_addr;        /* Stored in network-order */
16         uint8_t hw_addr[ETH_ALEN];
17         unsigned long used;      /* Last used time (in jiffies). */
18
19         struct rcu_head rcu;
20 };
21
22 struct snat_conf {
23         uint32_t ip_addr_start;      /* Stored in host-order */
24         uint32_t ip_addr_end;        /* Stored in host-order */
25         uint16_t mac_timeout;
26         struct list_head mappings;   /* List of snat_mapping entries */
27 };
28
29 #define MAC_TIMEOUT_DEFAULT 120
30
31 void snat_local_in(struct sk_buff *skb);
32 int snat_pre_route(struct sk_buff *skb);
33 void snat_skb(struct datapath *dp, struct sk_buff *skb, int out_port);
34 void snat_maint(struct net_bridge_port *p);
35 int snat_mod_config(struct datapath *, const struct nx_act_config *);
36 int snat_free_conf(struct net_bridge_port *p);
37
38 #endif
39 #endif