-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhttp_mod.c
53 lines (39 loc) · 1.11 KB
/
http_mod.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
/*
* http_mod.c - RFC 2616 module documentation.
*/
#include <linux/module.h> /* Needed by all modules */
#include <linux/kernel.h> /* Needed for KERN_INFO */
#include <linux/init.h> /* Needed for the macros */
#include "http_engine.h"
#define DRIVER_AUTHOR "Loïc CANTAT <[email protected]>"
#define DRIVER_DESC "A RFC 2616 implementation"
#define http_debug printk
static int __init init_http(void)
{
http_debug(KERN_INFO "HTTP module init \n");
// TODO : use kernel argument for initialisation.
// TODO : add proc entry to handle management of the module from userland.
tcp_engine_start();
// http_engine_start();
return 0;
}
static void __exit cleanup_http(void)
{
http_debug(KERN_INFO "HTTP module cleanup \n");
// http_engine_stop();
tcp_engine_stop();
}
module_init(init_http);
module_exit(cleanup_http);
/*
* You can use strings, like this:
*/
/*
* Get rid of taint message by declaring code as GPL.
*/
MODULE_LICENSE("GPL");
/*
* Or with defines, like this:
*/
MODULE_AUTHOR(DRIVER_AUTHOR); /* Who wrote this module? */
MODULE_DESCRIPTION(DRIVER_DESC); /* What does this module do */