Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * Copyright (c) 2007-2013 Nicira, Inc.
0004  */
0005 
0006 
0007 #ifndef FLOW_NETLINK_H
0008 #define FLOW_NETLINK_H 1
0009 
0010 #include <linux/kernel.h>
0011 #include <linux/netlink.h>
0012 #include <linux/openvswitch.h>
0013 #include <linux/spinlock.h>
0014 #include <linux/types.h>
0015 #include <linux/rcupdate.h>
0016 #include <linux/if_ether.h>
0017 #include <linux/in6.h>
0018 #include <linux/jiffies.h>
0019 #include <linux/time.h>
0020 
0021 #include <net/inet_ecn.h>
0022 #include <net/ip_tunnels.h>
0023 
0024 #include "flow.h"
0025 
0026 size_t ovs_tun_key_attr_size(void);
0027 size_t ovs_key_attr_size(void);
0028 
0029 void ovs_match_init(struct sw_flow_match *match,
0030             struct sw_flow_key *key, bool reset_key,
0031             struct sw_flow_mask *mask);
0032 
0033 int ovs_nla_put_key(const struct sw_flow_key *, const struct sw_flow_key *,
0034             int attr, bool is_mask, struct sk_buff *);
0035 int parse_flow_nlattrs(const struct nlattr *attr, const struct nlattr *a[],
0036                u64 *attrsp, bool log);
0037 int ovs_nla_get_flow_metadata(struct net *net,
0038                   const struct nlattr *a[OVS_KEY_ATTR_MAX + 1],
0039                   u64 attrs, struct sw_flow_key *key, bool log);
0040 
0041 int ovs_nla_put_identifier(const struct sw_flow *flow, struct sk_buff *skb);
0042 int ovs_nla_put_masked_key(const struct sw_flow *flow, struct sk_buff *skb);
0043 int ovs_nla_put_mask(const struct sw_flow *flow, struct sk_buff *skb);
0044 
0045 int ovs_nla_get_match(struct net *, struct sw_flow_match *,
0046               const struct nlattr *key, const struct nlattr *mask,
0047               bool log);
0048 
0049 int ovs_nla_put_tunnel_info(struct sk_buff *skb,
0050                 struct ip_tunnel_info *tun_info);
0051 
0052 bool ovs_nla_get_ufid(struct sw_flow_id *, const struct nlattr *, bool log);
0053 int ovs_nla_get_identifier(struct sw_flow_id *sfid, const struct nlattr *ufid,
0054                const struct sw_flow_key *key, bool log);
0055 u32 ovs_nla_get_ufid_flags(const struct nlattr *attr);
0056 
0057 int ovs_nla_copy_actions(struct net *net, const struct nlattr *attr,
0058              const struct sw_flow_key *key,
0059              struct sw_flow_actions **sfa, bool log);
0060 int ovs_nla_add_action(struct sw_flow_actions **sfa, int attrtype,
0061                void *data, int len, bool log);
0062 int ovs_nla_put_actions(const struct nlattr *attr,
0063             int len, struct sk_buff *skb);
0064 
0065 void ovs_nla_free_flow_actions(struct sw_flow_actions *);
0066 void ovs_nla_free_flow_actions_rcu(struct sw_flow_actions *);
0067 
0068 int nsh_key_from_nlattr(const struct nlattr *attr, struct ovs_key_nsh *nsh,
0069             struct ovs_key_nsh *nsh_mask);
0070 int nsh_hdr_from_nlattr(const struct nlattr *attr, struct nshhdr *nh,
0071             size_t size);
0072 
0073 #endif /* flow_netlink.h */