]>
Commit | Line | Data |
---|---|---|
a097c0b2 | 1 | /* |
e23775f2 | 2 | * Copyright (c) 2007-2015 Nicira, Inc. |
a097c0b2 PS |
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> | |
a097c0b2 PS |
33 | |
34 | #include <net/inet_ecn.h> | |
35 | #include <net/ip_tunnels.h> | |
36 | ||
37 | #include "flow.h" | |
38 | ||
8b7ea2d4 | 39 | size_t ovs_tun_key_attr_size(void); |
4e25b8c1 JS |
40 | size_t ovs_key_attr_size(void); |
41 | ||
a097c0b2 | 42 | void ovs_match_init(struct sw_flow_match *match, |
9b94fa6c | 43 | struct sw_flow_key *key, bool reset_key, |
44 | struct sw_flow_mask *mask); | |
a097c0b2 | 45 | |
db7f2238 JS |
46 | int ovs_nla_put_key(const struct sw_flow_key *, const struct sw_flow_key *, |
47 | int attr, bool is_mask, struct sk_buff *); | |
c30b4cea JR |
48 | int parse_flow_nlattrs(const struct nlattr *attr, const struct nlattr *a[], |
49 | u64 *attrsp, bool log); | |
50 | int ovs_nla_get_flow_metadata(struct net *net, | |
51 | const struct nlattr *a[OVS_KEY_ATTR_MAX + 1], | |
52 | u64 attrs, struct sw_flow_key *key, bool log); | |
c135bba1 | 53 | |
bc619e29 JS |
54 | int ovs_nla_put_identifier(const struct sw_flow *flow, struct sk_buff *skb); |
55 | int ovs_nla_put_masked_key(const struct sw_flow *flow, struct sk_buff *skb); | |
db7f2238 JS |
56 | int ovs_nla_put_mask(const struct sw_flow *flow, struct sk_buff *skb); |
57 | ||
038e34ab JS |
58 | int ovs_nla_get_match(struct net *, struct sw_flow_match *, |
59 | const struct nlattr *key, const struct nlattr *mask, | |
60 | bool log); | |
aad7cb91 PS |
61 | int ovs_nla_put_tunnel_info(struct sk_buff *skb, |
62 | struct ip_tunnel_info *tun_info); | |
a097c0b2 | 63 | |
bc619e29 JS |
64 | bool ovs_nla_get_ufid(struct sw_flow_id *, const struct nlattr *, bool log); |
65 | int ovs_nla_get_identifier(struct sw_flow_id *sfid, const struct nlattr *ufid, | |
66 | const struct sw_flow_key *key, bool log); | |
67 | u32 ovs_nla_get_ufid_flags(const struct nlattr *attr); | |
68 | ||
a94ebc39 | 69 | int ovs_nla_copy_actions(struct net *net, const struct nlattr *attr, |
ccf43786 | 70 | const struct sw_flow_key *key, |
9233cef7 | 71 | struct sw_flow_actions **sfa, bool log); |
a94ebc39 JS |
72 | int ovs_nla_add_action(struct sw_flow_actions **sfa, int attrtype, |
73 | void *data, int len, bool log); | |
a097c0b2 PS |
74 | int ovs_nla_put_actions(const struct nlattr *attr, |
75 | int len, struct sk_buff *skb); | |
76 | ||
a097c0b2 | 77 | void ovs_nla_free_flow_actions(struct sw_flow_actions *); |
e23775f2 | 78 | void ovs_nla_free_flow_actions_rcu(struct sw_flow_actions *); |
a097c0b2 | 79 | |
96b82f6d YY |
80 | int nsh_key_from_nlattr(const struct nlattr *attr, struct ovs_key_nsh *nsh, |
81 | struct ovs_key_nsh *nsh_mask); | |
82 | int nsh_hdr_from_nlattr(const struct nlattr *attr, struct nshhdr *nh, | |
83 | size_t size); | |
84 | ||
a097c0b2 | 85 | #endif /* flow_netlink.h */ |