Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
nf_conntrack_timeout.c
Go to the documentation of this file.
1 /*
2  * (C) 2012 by Pablo Neira Ayuso <[email protected]>
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 
26 
27 struct ctnl_timeout *
28 (*nf_ct_timeout_find_get_hook)(const char *name) __read_mostly;
30 
33 
34 static 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 
41 {
42  int ret = 0;
43 
44  if (net_eq(net, &init_net)) {
45  ret = nf_ct_extend_register(&timeout_extend);
46  if (ret < 0) {
47  printk(KERN_ERR "nf_ct_timeout: Unable to register "
48  "timeout extension.\n");
49  return ret;
50  }
51  }
52 
53  return 0;
54 }
55 
57 {
58  if (net_eq(net, &init_net))
59  nf_ct_extend_unregister(&timeout_extend);
60 }