2 * Lightweight Autonomic Network Architecture
4 * Collector and loader for all core extensions (xt_*).
6 * Copyright 2011 Daniel Borkmann <dborkma@tik.ee.ethz.ch>,
7 * Swiss federal institute of technology (ETH Zurich)
11 #include <linux/module.h>
12 #include <linux/kernel.h>
13 #include <linux/proc_fs.h>
14 #include <net/net_namespace.h>
16 #include "xt_fblock.h"
18 #include "xt_engine.h"
19 #include "xt_builder.h"
23 struct proc_dir_entry
*lana_proc_dir
;
24 EXPORT_SYMBOL(lana_proc_dir
);
25 struct proc_dir_entry
*fblock_proc_dir
;
26 EXPORT_SYMBOL(fblock_proc_dir
);
27 struct proc_dir_entry
*sched_proc_dir
;
28 EXPORT_SYMBOL(sched_proc_dir
);
30 static int __init
init_lana_core_module(void)
34 printk(KERN_INFO
"[lana] bootstrapping core ...\n");
35 lana_proc_dir
= proc_mkdir("lana", init_net
.proc_net
);
38 fblock_proc_dir
= proc_mkdir("fblock", lana_proc_dir
);
41 sched_proc_dir
= proc_mkdir("sched", lana_proc_dir
);
44 ret
= init_vlink_system();
47 ret
= init_worker_engines();
50 ret
= init_fblock_tables();
53 ret
= init_fblock_builder();
56 ret
= init_ppesched_system();
59 ret
= init_userctl_system();
62 printk(KERN_INFO
"[lana] core up and running!\n");
65 cleanup_ppesched_system();
67 cleanup_fblock_builder();
69 cleanup_fblock_tables();
71 cleanup_worker_engines();
73 cleanup_vlink_system();
75 remove_proc_entry("sched", lana_proc_dir
);
77 remove_proc_entry("fblock", lana_proc_dir
);
79 remove_proc_entry("lana", init_net
.proc_net
);
83 static void __exit
cleanup_lana_core_module(void)
85 printk(KERN_INFO
"[lana] halting core ...\n");
86 cleanup_userctl_system();
87 cleanup_worker_engines();
88 cleanup_fblock_tables();
89 cleanup_ppesched_system();
90 cleanup_fblock_builder();
91 cleanup_vlink_system();
92 remove_proc_entry("fblock", lana_proc_dir
);
93 remove_proc_entry("sched", lana_proc_dir
);
94 remove_proc_entry("lana", init_net
.proc_net
);
95 printk(KERN_INFO
"[lana] core shut down!\n");
98 module_init(init_lana_core_module
);
99 module_exit(cleanup_lana_core_module
);
101 MODULE_LICENSE("GPL");
102 MODULE_AUTHOR("Daniel Borkmann <dborkma@tik.ee.ethz.ch>");
103 MODULE_DESCRIPTION("LANA core driver");