2 * Copyright (c) 2015 Nicira, Inc.
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of version 2 of the GNU General Public
6 * License as published by the Free Software Foundation.
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * General Public License for more details.
14 #ifndef OVS_CONNTRACK_H
15 #define OVS_CONNTRACK_H 1
19 struct ovs_conntrack_info;
22 #if defined(CONFIG_OPENVSWITCH_CONNTRACK)
23 bool ovs_ct_verify(enum ovs_key_attr attr);
24 int ovs_ct_copy_action(struct net *, const struct nlattr *,
25 const struct sw_flow_key *, struct sw_flow_actions **,
27 int ovs_ct_action_to_attr(const struct ovs_conntrack_info *, struct sk_buff *);
29 int ovs_ct_execute(struct net *, struct sk_buff *, struct sw_flow_key *,
30 const struct ovs_conntrack_info *);
32 void ovs_ct_fill_key(const struct sk_buff *skb, struct sw_flow_key *key);
33 int ovs_ct_put_key(const struct sw_flow_key *key, struct sk_buff *skb);
34 void ovs_ct_free_action(const struct nlattr *a);
36 #include <linux/errno.h>
38 static inline bool ovs_ct_verify(int attr)
43 static inline int ovs_ct_copy_action(struct net *net, const struct nlattr *nla,
44 const struct sw_flow_key *key,
45 struct sw_flow_actions **acts, bool log)
50 static inline int ovs_ct_action_to_attr(const struct ovs_conntrack_info *info,
56 static inline int ovs_ct_execute(struct net *net, struct sk_buff *skb,
57 struct sw_flow_key *key,
58 const struct ovs_conntrack_info *info)
63 static inline void ovs_ct_fill_key(const struct sk_buff *skb,
64 struct sw_flow_key *key)
71 static inline int ovs_ct_put_key(const struct sw_flow_key *key,
77 static inline void ovs_ct_free_action(const struct nlattr *a) { }
79 #endif /* ovs_conntrack.h */