blob: 26e742006c48c944ba16aea8d8a2ed541ad06ca1 [file] [log] [blame]
Pablo Neira Ayusodd705072012-02-28 23:36:48 +01001/*
2 * (C) 2012 by Pablo Neira Ayuso <pablo@netfilter.org>
3 * (C) 2012 by Vyatta Inc. <http://www.vyatta.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation (or any later at your option).
8 */
9
10#include <linux/types.h>
11#include <linux/netfilter.h>
12#include <linux/skbuff.h>
13#include <linux/vmalloc.h>
14#include <linux/stddef.h>
15#include <linux/err.h>
16#include <linux/percpu.h>
17#include <linux/kernel.h>
18#include <linux/netdevice.h>
19#include <linux/slab.h>
20#include <linux/export.h>
21
22#include <net/netfilter/nf_conntrack.h>
23#include <net/netfilter/nf_conntrack_core.h>
24#include <net/netfilter/nf_conntrack_extend.h>
25#include <net/netfilter/nf_conntrack_timeout.h>
26
27struct ctnl_timeout *
Pablo Neira19576c92015-12-09 14:07:40 +010028(*nf_ct_timeout_find_get_hook)(struct net *net, const char *name) __read_mostly;
Pablo Neira Ayusodd705072012-02-28 23:36:48 +010029EXPORT_SYMBOL_GPL(nf_ct_timeout_find_get_hook);
30
31void (*nf_ct_timeout_put_hook)(struct ctnl_timeout *timeout) __read_mostly;
32EXPORT_SYMBOL_GPL(nf_ct_timeout_put_hook);
33
34static struct nf_ct_ext_type timeout_extend __read_mostly = {
35 .len = sizeof(struct nf_conn_timeout),
36 .align = __alignof__(struct nf_conn_timeout),
37 .id = NF_CT_EXT_TIMEOUT,
38};
39
Gao feng86840942013-01-21 22:10:29 +000040int nf_conntrack_timeout_init(void)
Pablo Neira Ayusodd705072012-02-28 23:36:48 +010041{
Gao feng86840942013-01-21 22:10:29 +000042 int ret = nf_ct_extend_register(&timeout_extend);
43 if (ret < 0)
44 pr_err("nf_ct_timeout: Unable to register timeout extension.\n");
45 return ret;
Pablo Neira Ayusodd705072012-02-28 23:36:48 +010046}
47
Gao feng86840942013-01-21 22:10:29 +000048void nf_conntrack_timeout_fini(void)
Pablo Neira Ayusodd705072012-02-28 23:36:48 +010049{
Gao feng86840942013-01-21 22:10:29 +000050 nf_ct_extend_unregister(&timeout_extend);
Pablo Neira Ayusodd705072012-02-28 23:36:48 +010051}