2 * Mobile IPv6 Common Module
5 * Sami Kivisaari <skivisaa@cc.hut.fi>
6 * Antti Tuominen <ajtuomin@tml.hut.fi>
8 * $Id: s.module_cn.c 1.15 03/08/26 12:07:40+03:00 henkku@tcs-pc-5.tcs.hut.fi $
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version
13 * 2 of the License, or (at your option) any later version.
16 #include <linux/config.h>
17 #include <linux/module.h>
18 #include <linux/init.h>
21 #include <linux/sysctl.h>
22 #endif /* CONFIG_SYSCTL */
24 #include <net/mipglue.h>
27 #include "mipv6_icmp.h"
31 #include <net/ipv6_tunnel.h>
36 //&& LINUX_VERSION_CODE > 0
37 MODULE_AUTHOR("MIPL Team");
38 MODULE_DESCRIPTION("Mobile IPv6");
39 MODULE_LICENSE("GPL");
40 MODULE_PARM(mipv6_debug, "i");
45 struct mip6_func mip6_fn;
46 struct mip6_conf mip6node_cnf = {
49 max_rtr_reachable_time: 0,
50 eager_cell_switching: 0,
53 binding_refresh_advice: 0,
59 #define MIPV6_BCACHE_SIZE 128
61 /**********************************************************************
63 * MIPv6 CN Module Init / Cleanup
65 **********************************************************************/
69 ctl_table mipv6_mobility_table[] = {
70 {NET_IPV6_MOBILITY_DEBUG, "debuglevel",
71 &mipv6_debug, sizeof(int), 0644, NULL,
73 {NET_IPV6_MOBILITY_RETROUT, "accept_return_routability",
74 &mip6node_cnf.accept_ret_rout, sizeof(int), 0644, NULL,
78 ctl_table mipv6_table[] = {
79 {NET_IPV6_MOBILITY, "mobility", NULL, 0, 0555, mipv6_mobility_table},
83 static struct ctl_table_header *mipv6_sysctl_header;
84 static struct ctl_table mipv6_net_table[];
85 static struct ctl_table mipv6_root_table[];
87 ctl_table mipv6_net_table[] = {
88 {NET_IPV6, "ipv6", NULL, 0, 0555, mipv6_table},
92 ctl_table mipv6_root_table[] = {
93 {CTL_NET, "net", NULL, 0, 0555, mipv6_net_table},
96 #endif /* CONFIG_SYSCTL */
98 extern void mipv6_rr_init(void);
100 /* Initialize the module */
101 static int __init mip6_init(void)
105 printk(KERN_INFO "MIPL Mobile IPv6 for Linux Correspondent Node %s (%s)\n",
106 MIPLVERSION, MIPV6VERSION);
108 #ifdef CONFIG_IPV6_MOBILITY_DEBUG
109 printk(KERN_INFO "Debug-level: %d\n", mipv6_debug);
112 if ((err = mipv6_bcache_init(MIPV6_BCACHE_SIZE)) < 0)
115 if ((err = mipv6_icmpv6_init()) < 0)
118 if ((err = mipv6_stats_init()) < 0)
123 mipv6_sysctl_header = register_sysctl_table(mipv6_root_table, 0);
126 if ((err = mipv6_mh_common_init()) < 0)
129 MIPV6_SETCALL(mipv6_modify_txoptions, mipv6_modify_txoptions);
131 MIPV6_SETCALL(mipv6_handle_homeaddr, mipv6_handle_homeaddr);
132 MIPV6_SETCALL(mipv6_icmp_handle_homeaddr, mipv6_icmp_handle_homeaddr);
138 unregister_sysctl_table(mipv6_sysctl_header);
148 module_init(mip6_init);
152 static void __exit mip6_exit(void)
154 printk(KERN_INFO "mip6_base.o exiting.\n");
156 unregister_sysctl_table(mipv6_sysctl_header);
159 /* Invalidate all custom kernel hooks. No need to do this
160 separately for all hooks. */
161 mipv6_invalidate_calls();
163 mipv6_mh_common_exit();
168 module_exit(mip6_exit);
171 EXPORT_SYMBOL(mipv6_debug);
172 EXPORT_SYMBOL(mip6node_cnf);
173 EXPORT_SYMBOL(mip6_fn);