Merge tag 'libnvdimm-for-4.9' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm...
[linux-2.6-block.git] / net / openvswitch / flow_netlink.h
CommitLineData
e6445719
PS
1/*
2 * Copyright (c) 2007-2013 Nicira, Inc.
3 *
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.
7 *
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.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
16 * 02110-1301, USA
17 */
18
19
20#ifndef FLOW_NETLINK_H
21#define FLOW_NETLINK_H 1
22
23#include <linux/kernel.h>
24#include <linux/netlink.h>
25#include <linux/openvswitch.h>
26#include <linux/spinlock.h>
27#include <linux/types.h>
28#include <linux/rcupdate.h>
29#include <linux/if_ether.h>
30#include <linux/in6.h>
31#include <linux/jiffies.h>
32#include <linux/time.h>
33#include <linux/flex_array.h>
34
35#include <net/inet_ecn.h>
36#include <net/ip_tunnels.h>
37
38#include "flow.h"
39
8f0aad6f 40size_t ovs_tun_key_attr_size(void);
41af73e9
JS
41size_t ovs_key_attr_size(void);
42
e6445719 43void ovs_match_init(struct sw_flow_match *match,
2279994d 44 struct sw_flow_key *key, bool reset_key,
45 struct sw_flow_mask *mask);
e6445719 46
5b4237bb
JS
47int ovs_nla_put_key(const struct sw_flow_key *, const struct sw_flow_key *,
48 int attr, bool is_mask, struct sk_buff *);
c2ac6673
JS
49int ovs_nla_get_flow_metadata(struct net *, const struct nlattr *,
50 struct sw_flow_key *, bool log);
83c8df26 51
74ed7ab9
JS
52int ovs_nla_put_identifier(const struct sw_flow *flow, struct sk_buff *skb);
53int ovs_nla_put_masked_key(const struct sw_flow *flow, struct sk_buff *skb);
5b4237bb
JS
54int ovs_nla_put_mask(const struct sw_flow *flow, struct sk_buff *skb);
55
c2ac6673
JS
56int ovs_nla_get_match(struct net *, struct sw_flow_match *,
57 const struct nlattr *key, const struct nlattr *mask,
58 bool log);
fc4099f1
PS
59
60int ovs_nla_put_tunnel_info(struct sk_buff *skb,
61 struct ip_tunnel_info *tun_info);
e6445719 62
74ed7ab9
JS
63bool ovs_nla_get_ufid(struct sw_flow_id *, const struct nlattr *, bool log);
64int ovs_nla_get_identifier(struct sw_flow_id *sfid, const struct nlattr *ufid,
65 const struct sw_flow_key *key, bool log);
66u32 ovs_nla_get_ufid_flags(const struct nlattr *attr);
67
7f8a436e 68int ovs_nla_copy_actions(struct net *net, const struct nlattr *attr,
25cd9ba0 69 const struct sw_flow_key *key,
05da5898 70 struct sw_flow_actions **sfa, bool log);
7f8a436e
JS
71int ovs_nla_add_action(struct sw_flow_actions **sfa, int attrtype,
72 void *data, int len, bool log);
e6445719
PS
73int ovs_nla_put_actions(const struct nlattr *attr,
74 int len, struct sk_buff *skb);
75
e6445719 76void ovs_nla_free_flow_actions(struct sw_flow_actions *);
34ae932a 77void ovs_nla_free_flow_actions_rcu(struct sw_flow_actions *);
e6445719
PS
78
79#endif /* flow_netlink.h */