flow_netlink.h 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. #ifndef FLOW_NETLINK_H
  19. #define FLOW_NETLINK_H 1
  20. #include <linux/kernel.h>
  21. #include <linux/netlink.h>
  22. #include <linux/openvswitch.h>
  23. #include <linux/spinlock.h>
  24. #include <linux/types.h>
  25. #include <linux/rcupdate.h>
  26. #include <linux/if_ether.h>
  27. #include <linux/in6.h>
  28. #include <linux/jiffies.h>
  29. #include <linux/time.h>
  30. #include <linux/flex_array.h>
  31. #include <net/inet_ecn.h>
  32. #include <net/ip_tunnels.h>
  33. #include "flow.h"
  34. size_t ovs_tun_key_attr_size(void);
  35. size_t ovs_key_attr_size(void);
  36. void ovs_match_init(struct sw_flow_match *match,
  37. struct sw_flow_key *key, bool reset_key,
  38. struct sw_flow_mask *mask);
  39. int ovs_nla_put_key(const struct sw_flow_key *, const struct sw_flow_key *,
  40. int attr, bool is_mask, struct sk_buff *);
  41. int ovs_nla_get_flow_metadata(struct net *, const struct nlattr *,
  42. struct sw_flow_key *, bool log);
  43. int ovs_nla_put_identifier(const struct sw_flow *flow, struct sk_buff *skb);
  44. int ovs_nla_put_masked_key(const struct sw_flow *flow, struct sk_buff *skb);
  45. int ovs_nla_put_mask(const struct sw_flow *flow, struct sk_buff *skb);
  46. int ovs_nla_get_match(struct net *, struct sw_flow_match *,
  47. const struct nlattr *key, const struct nlattr *mask,
  48. bool log);
  49. int ovs_nla_put_tunnel_info(struct sk_buff *skb,
  50. struct ip_tunnel_info *tun_info);
  51. bool ovs_nla_get_ufid(struct sw_flow_id *, const struct nlattr *, bool log);
  52. int ovs_nla_get_identifier(struct sw_flow_id *sfid, const struct nlattr *ufid,
  53. const struct sw_flow_key *key, bool log);
  54. u32 ovs_nla_get_ufid_flags(const struct nlattr *attr);
  55. int ovs_nla_copy_actions(struct net *net, const struct nlattr *attr,
  56. const struct sw_flow_key *key,
  57. struct sw_flow_actions **sfa, bool log);
  58. int ovs_nla_add_action(struct sw_flow_actions **sfa, int attrtype,
  59. void *data, int len, bool log);
  60. int ovs_nla_put_actions(const struct nlattr *attr,
  61. int len, struct sk_buff *skb);
  62. void ovs_nla_free_flow_actions(struct sw_flow_actions *);
  63. void ovs_nla_free_flow_actions_rcu(struct sw_flow_actions *);
  64. #endif /* flow_netlink.h */