This source file includes following definitions.
- request_module
- release_module
- delayed_release_module
- cancel_release_module
- ksystem
- kerneld_route
- kerneld_blanker
1 #ifndef _LINUX_KERNELD_H
2 #define _LINUX_KERNELD_H
3
4 #define KERNELD_SYSTEM 1
5 #define KERNELD_REQUEST_MODULE 2
6 #define KERNELD_RELEASE_MODULE 3
7 #define KERNELD_DELAYED_RELEASE_MODULE 4
8 #define KERNELD_CANCEL_RELEASE_MODULE 5
9 #define KERNELD_REQUEST_ROUTE 6
10 #define KERNELD_BLANKER 7
11
12 #define IPC_KERNELD 00040000
13 #define KERNELD_MAXCMD 0x7ffeffff
14 #define KERNELD_MINSEQ 0x7fff0000
15 #define KERNELD_WAIT 0x80000000
16 #define KERNELD_NOWAIT 0
17
18 struct kerneld_msg {
19 long mtype;
20 long id;
21 #ifdef __KERNEL__
22 char *text;
23 #else
24 char text[1];
25 #endif
26 };
27
28 #ifdef __KERNEL__
29 extern int kerneld_send(int msgtype, int ret_size, int msgsz,
30 const char *text, const char *ret_val);
31
32
33
34
35
36
37 static inline int request_module(const char *name)
38 {
39 return kerneld_send(KERNELD_REQUEST_MODULE,
40 0 | KERNELD_WAIT,
41 strlen(name), name, NULL);
42 }
43
44
45
46
47
48 static inline int release_module(const char *name, int waitflag)
49 {
50 return kerneld_send(KERNELD_RELEASE_MODULE,
51 0 | (waitflag?KERNELD_WAIT:KERNELD_NOWAIT),
52 strlen(name), name, NULL);
53 }
54
55
56
57
58
59 static inline int delayed_release_module(const char *name)
60 {
61 return kerneld_send(KERNELD_DELAYED_RELEASE_MODULE,
62 0 | KERNELD_NOWAIT,
63 strlen(name), name, NULL);
64 }
65
66
67
68
69
70
71
72 static inline int cancel_release_module(const char *name)
73 {
74 return kerneld_send(KERNELD_CANCEL_RELEASE_MODULE,
75 0 | KERNELD_NOWAIT,
76 strlen(name), name, NULL);
77 }
78
79
80
81
82 static inline int ksystem(const char *cmd, int waitflag)
83 {
84 return kerneld_send(KERNELD_SYSTEM,
85 0 | (waitflag?KERNELD_WAIT:KERNELD_NOWAIT),
86 strlen(cmd), cmd, NULL);
87 }
88
89
90
91
92 static inline int kerneld_route(const char *ip_route)
93 {
94 return kerneld_send(KERNELD_REQUEST_ROUTE,
95 0 | KERNELD_WAIT,
96 strlen(ip_route), ip_route, NULL);
97 }
98
99
100
101
102 static inline int kerneld_blanker(int on_off)
103 {
104 return kerneld_send(KERNELD_BLANKER,
105 0 | (on_off?KERNELD_NOWAIT:KERNELD_WAIT),
106 strlen(on_off?"on":"off"), on_off?"on":"off", NULL);
107 }
108
109 #endif
110 #endif