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