#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/netfilter.h>
#include <linux/rhashtable.h>
#include <linux/netdevice.h>
#include <net/ip.h>
#include <net/ip6_route.h>
#include <net/netfilter/nf_tables.h>
#include <net/netfilter/nf_flow_table.h>
#include <net/netfilter/nf_conntrack.h>
#include <net/netfilter/nf_conntrack_core.h>
#include <net/netfilter/nf_conntrack_l4proto.h>
#include <net/netfilter/nf_conntrack_tuple.h>
static DEFINE_MUTEX(flowtable_lock);
static LIST_HEAD(flowtables);
static void
flow_offload_fill_dir(struct flow_offload *flow,
enum flow_offload_tuple_dir dir)
{ … }
struct flow_offload *flow_offload_alloc(struct nf_conn *ct)
{ … }
EXPORT_SYMBOL_GPL(…);
static u32 flow_offload_dst_cookie(struct flow_offload_tuple *flow_tuple)
{ … }
static struct dst_entry *nft_route_dst_fetch(struct nf_flow_route *route,
enum flow_offload_tuple_dir dir)
{ … }
static int flow_offload_fill_route(struct flow_offload *flow,
struct nf_flow_route *route,
enum flow_offload_tuple_dir dir)
{ … }
static void nft_flow_dst_release(struct flow_offload *flow,
enum flow_offload_tuple_dir dir)
{ … }
void flow_offload_route_init(struct flow_offload *flow,
struct nf_flow_route *route)
{ … }
EXPORT_SYMBOL_GPL(…);
static void flow_offload_fixup_tcp(struct ip_ct_tcp *tcp)
{ … }
static void flow_offload_fixup_ct(struct nf_conn *ct)
{ … }
static void flow_offload_route_release(struct flow_offload *flow)
{ … }
void flow_offload_free(struct flow_offload *flow)
{ … }
EXPORT_SYMBOL_GPL(…);
static u32 flow_offload_hash(const void *data, u32 len, u32 seed)
{ … }
static u32 flow_offload_hash_obj(const void *data, u32 len, u32 seed)
{ … }
static int flow_offload_hash_cmp(struct rhashtable_compare_arg *arg,
const void *ptr)
{ … }
static const struct rhashtable_params nf_flow_offload_rhash_params = …;
unsigned long flow_offload_get_timeout(struct flow_offload *flow)
{ … }
int flow_offload_add(struct nf_flowtable *flow_table, struct flow_offload *flow)
{ … }
EXPORT_SYMBOL_GPL(…);
void flow_offload_refresh(struct nf_flowtable *flow_table,
struct flow_offload *flow, bool force)
{ … }
EXPORT_SYMBOL_GPL(…);
static inline bool nf_flow_has_expired(const struct flow_offload *flow)
{ … }
static void flow_offload_del(struct nf_flowtable *flow_table,
struct flow_offload *flow)
{ … }
void flow_offload_teardown(struct flow_offload *flow)
{ … }
EXPORT_SYMBOL_GPL(…);
struct flow_offload_tuple_rhash *
flow_offload_lookup(struct nf_flowtable *flow_table,
struct flow_offload_tuple *tuple)
{ … }
EXPORT_SYMBOL_GPL(…);
static int
nf_flow_table_iterate(struct nf_flowtable *flow_table,
void (*iter)(struct nf_flowtable *flowtable,
struct flow_offload *flow, void *data),
void *data)
{ … }
static bool nf_flow_custom_gc(struct nf_flowtable *flow_table,
const struct flow_offload *flow)
{ … }
static void nf_flow_offload_gc_step(struct nf_flowtable *flow_table,
struct flow_offload *flow, void *data)
{ … }
void nf_flow_table_gc_run(struct nf_flowtable *flow_table)
{ … }
static void nf_flow_offload_work_gc(struct work_struct *work)
{ … }
static void nf_flow_nat_port_tcp(struct sk_buff *skb, unsigned int thoff,
__be16 port, __be16 new_port)
{ … }
static void nf_flow_nat_port_udp(struct sk_buff *skb, unsigned int thoff,
__be16 port, __be16 new_port)
{ … }
static void nf_flow_nat_port(struct sk_buff *skb, unsigned int thoff,
u8 protocol, __be16 port, __be16 new_port)
{ … }
void nf_flow_snat_port(const struct flow_offload *flow,
struct sk_buff *skb, unsigned int thoff,
u8 protocol, enum flow_offload_tuple_dir dir)
{ … }
EXPORT_SYMBOL_GPL(…);
void nf_flow_dnat_port(const struct flow_offload *flow, struct sk_buff *skb,
unsigned int thoff, u8 protocol,
enum flow_offload_tuple_dir dir)
{ … }
EXPORT_SYMBOL_GPL(…);
int nf_flow_table_init(struct nf_flowtable *flowtable)
{ … }
EXPORT_SYMBOL_GPL(…);
static void nf_flow_table_do_cleanup(struct nf_flowtable *flow_table,
struct flow_offload *flow, void *data)
{ … }
void nf_flow_table_gc_cleanup(struct nf_flowtable *flowtable,
struct net_device *dev)
{ … }
void nf_flow_table_cleanup(struct net_device *dev)
{ … }
EXPORT_SYMBOL_GPL(…);
void nf_flow_table_free(struct nf_flowtable *flow_table)
{ … }
EXPORT_SYMBOL_GPL(…);
static int nf_flow_table_init_net(struct net *net)
{ … }
static void nf_flow_table_fini_net(struct net *net)
{ … }
static int nf_flow_table_pernet_init(struct net *net)
{ … }
static void nf_flow_table_pernet_exit(struct list_head *net_exit_list)
{ … }
static struct pernet_operations nf_flow_table_net_ops = …;
static int __init nf_flow_table_module_init(void)
{ … }
static void __exit nf_flow_table_module_exit(void)
{ … }
module_init(…) …;
module_exit(nf_flow_table_module_exit);
MODULE_LICENSE(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;