flow_netlink.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2007-2013 Nicira, Inc.
  4. */
  5. #ifndef FLOW_NETLINK_H
  6. #define FLOW_NETLINK_H 1
  7. #include <linux/kernel.h>
  8. #include <linux/netlink.h>
  9. #include <linux/openvswitch.h>
  10. #include <linux/spinlock.h>
  11. #include <linux/types.h>
  12. #include <linux/rcupdate.h>
  13. #include <linux/if_ether.h>
  14. #include <linux/in6.h>
  15. #include <linux/jiffies.h>
  16. #include <linux/time.h>
  17. #include <net/inet_ecn.h>
  18. #include <net/ip_tunnels.h>
  19. #include "flow.h"
  20. size_t ovs_tun_key_attr_size(void);
  21. size_t ovs_key_attr_size(void);
  22. void ovs_match_init(struct sw_flow_match *match,
  23. struct sw_flow_key *key, bool reset_key,
  24. struct sw_flow_mask *mask);
  25. int ovs_nla_put_key(const struct sw_flow_key *, const struct sw_flow_key *,
  26. int attr, bool is_mask, struct sk_buff *);
  27. int parse_flow_nlattrs(const struct nlattr *attr, const struct nlattr *a[],
  28. u64 *attrsp, bool log);
  29. int ovs_nla_get_flow_metadata(struct net *net,
  30. const struct nlattr *a[OVS_KEY_ATTR_MAX + 1],
  31. u64 attrs, struct sw_flow_key *key, bool log);
  32. int ovs_nla_put_identifier(const struct sw_flow *flow, struct sk_buff *skb);
  33. int ovs_nla_put_masked_key(const struct sw_flow *flow, struct sk_buff *skb);
  34. int ovs_nla_put_mask(const struct sw_flow *flow, struct sk_buff *skb);
  35. int ovs_nla_get_match(struct net *, struct sw_flow_match *,
  36. const struct nlattr *key, const struct nlattr *mask,
  37. bool log);
  38. int ovs_nla_put_tunnel_info(struct sk_buff *skb,
  39. struct ip_tunnel_info *tun_info);
  40. bool ovs_nla_get_ufid(struct sw_flow_id *, const struct nlattr *, bool log);
  41. int ovs_nla_get_identifier(struct sw_flow_id *sfid, const struct nlattr *ufid,
  42. const struct sw_flow_key *key, bool log);
  43. u32 ovs_nla_get_ufid_flags(const struct nlattr *attr);
  44. int ovs_nla_copy_actions(struct net *net, const struct nlattr *attr,
  45. const struct sw_flow_key *key,
  46. struct sw_flow_actions **sfa, bool log);
  47. int ovs_nla_add_action(struct sw_flow_actions **sfa, int attrtype,
  48. void *data, int len, bool log);
  49. int ovs_nla_put_actions(const struct nlattr *attr,
  50. int len, struct sk_buff *skb);
  51. void ovs_nla_free_flow_actions(struct sw_flow_actions *);
  52. void ovs_nla_free_flow_actions_rcu(struct sw_flow_actions *);
  53. int nsh_key_from_nlattr(const struct nlattr *attr, struct ovs_key_nsh *nsh,
  54. struct ovs_key_nsh *nsh_mask);
  55. int nsh_hdr_from_nlattr(const struct nlattr *attr, struct nshhdr *nh,
  56. size_t size);
  57. #endif /* flow_netlink.h */