-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnobd_main.c
52 lines (45 loc) · 1.04 KB
/
nobd_main.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
44
45
46
47
48
49
50
51
52
/*
* Network OBserving Daemon [NOBD]
*
* Monitoring of the network stack and notifies for any activities.
* Authors:
* Haim Daniel
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*/
#include <linux/module.h>
#include <linux/kernel.h>
#include "include/nobd_nl.h"
#include "include/nobd_nc.h"
#undef pr_fmt
#define pr_fmt(fmt) "nobd: " fmt
static int __init nobd_init(void)
{
int err = 0;
pr_info("init\n");
err = nobd_nl_open();
if (err) {
printk(KERN_ERR "nl failed\n");
return err;
}
err = nobd_nc_init();
if (err) {
printk(KERN_ERR "nc failed\n");
nobd_nl_close();
return err;
}
return err;
}
static void __exit nobd_exit(void)
{
pr_info("exit\n");
nobd_nl_close();
nobd_nc_exit();
}
module_init(nobd_init)
module_exit(nobd_exit)
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Haim Daniel <[email protected]>");