-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.c
43 lines (34 loc) · 1.16 KB
/
init.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include <linux/init.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/proc_fs.h>
#include <net/mac80211.h>
#include "stats.h"
#include "relay.h"
struct kernel_symbol *mac80211_rx;
static int opp_mptcp_init(void)
{
printk(KERN_INFO "opp_mptcp: hello!\n");
init_stats();
mac80211_rx = find_symbol("ieee80211_rx", NULL, NULL, true, false);
if (mac80211_rx == NULL) {
printk(KERN_INFO "Recompile your kernel with mac80211 support\n");
return -EFAULT;
}
//mac80211_rx->value = (unsigned long)opp_mptcp_rx;
printk(KERN_INFO "opp_mptcp: mac80211_rx = 0x%p\n", (void *)mac80211_rx->value);
printk(KERN_INFO "opp_mptcp: opp_mptcp_rx = 0x%p\n", (void *)(unsigned long)opp_mptcp_rx);
printk(KERN_INFO "opp_mptcp: ieee80211_rx = 0x%p\n", (void *)(unsigned long)ieee80211_rx);
return 0;
}
//void cleanup_module(void)
static void opp_mptcp_exit(void)
{
//mac80211_rx->value = (unsigned long)ieee80211_rx;
remove_stats();
printk(KERN_INFO "opp_mptcp: bye!\n");
}
module_init(opp_mptcp_init);
module_exit(opp_mptcp_exit);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Mike Hsueh-Hung Cheng [email protected]");