summaryrefslogtreecommitdiffstats
path: root/net/openvswitch/conntrack.h
diff options
context:
space:
mode:
authorJoe Stringer <joestringer@nicira.com>2015-08-26 14:31:52 -0400
committerDavid S. Miller <davem@davemloft.net>2015-08-27 14:40:43 -0400
commitc2ac667358708d7cce64c78f58af6adf4c1e848b (patch)
treef24ccd3b0e54fe0ba09ecadb837eef3ecaa014c8 /net/openvswitch/conntrack.h
parent86ca02e77408bb58ba596c1a411ec7f631733690 (diff)
openvswitch: Allow matching on conntrack label
Allow matching and setting the ct_label field. As with ct_mark, this is populated by executing the CT action. The label field may be modified by specifying a label and mask nested under the CT action. It is stored as metadata attached to the connection. Label modification occurs after lookup, and will only persist when the conntrack entry is committed by providing the COMMIT flag to the CT action. Labels are currently fixed to 128 bits in size. Signed-off-by: Joe Stringer <joestringer@nicira.com> Acked-by: Thomas Graf <tgraf@suug.ch> Acked-by: Pravin B Shelar <pshelar@nicira.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/openvswitch/conntrack.h')
-rw-r--r--net/openvswitch/conntrack.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/net/openvswitch/conntrack.h b/net/openvswitch/conntrack.h
index 87b289c58978..3cb30667a7dc 100644
--- a/net/openvswitch/conntrack.h
+++ b/net/openvswitch/conntrack.h
@@ -20,7 +20,9 @@ struct ovs_conntrack_info;
20enum ovs_key_attr; 20enum ovs_key_attr;
21 21
22#if defined(CONFIG_OPENVSWITCH_CONNTRACK) 22#if defined(CONFIG_OPENVSWITCH_CONNTRACK)
23bool ovs_ct_verify(enum ovs_key_attr attr); 23void ovs_ct_init(struct net *);
24void ovs_ct_exit(struct net *);
25bool ovs_ct_verify(struct net *, enum ovs_key_attr attr);
24int ovs_ct_copy_action(struct net *, const struct nlattr *, 26int ovs_ct_copy_action(struct net *, const struct nlattr *,
25 const struct sw_flow_key *, struct sw_flow_actions **, 27 const struct sw_flow_key *, struct sw_flow_actions **,
26 bool log); 28 bool log);
@@ -35,7 +37,11 @@ void ovs_ct_free_action(const struct nlattr *a);
35#else 37#else
36#include <linux/errno.h> 38#include <linux/errno.h>
37 39
38static inline bool ovs_ct_verify(int attr) 40static inline void ovs_ct_init(struct net *net) { }
41
42static inline void ovs_ct_exit(struct net *net) { }
43
44static inline bool ovs_ct_verify(struct net *net, int attr)
39{ 45{
40 return false; 46 return false;
41} 47}
@@ -66,6 +72,7 @@ static inline void ovs_ct_fill_key(const struct sk_buff *skb,
66 key->ct.state = 0; 72 key->ct.state = 0;
67 key->ct.zone = 0; 73 key->ct.zone = 0;
68 key->ct.mark = 0; 74 key->ct.mark = 0;
75 memset(&key->ct.label, 0, sizeof(key->ct.label));
69} 76}
70 77
71static inline int ovs_ct_put_key(const struct sw_flow_key *key, 78static inline int ovs_ct_put_key(const struct sw_flow_key *key,