Commit 462591b8868a18e52494e223d1a8f13311f50104
Committed by
Linus Torvalds
1 parent
4b998d4f6e
[PATCH] sysctl: move CTL_PM into sysctl.h where it belongs
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Showing 2 changed files with 1 additions and 1 deletions Inline Diff
arch/frv/kernel/pm.c
1 | /* | 1 | /* |
2 | * FR-V Power Management Routines | 2 | * FR-V Power Management Routines |
3 | * | 3 | * |
4 | * Copyright (c) 2004 Red Hat, Inc. | 4 | * Copyright (c) 2004 Red Hat, Inc. |
5 | * | 5 | * |
6 | * Based on SA1100 version: | 6 | * Based on SA1100 version: |
7 | * Copyright (c) 2001 Cliff Brake <cbrake@accelent.com> | 7 | * Copyright (c) 2001 Cliff Brake <cbrake@accelent.com> |
8 | * | 8 | * |
9 | * This program is free software; you can redistribute it and/or | 9 | * This program is free software; you can redistribute it and/or |
10 | * modify it under the terms of the GNU General Public License. | 10 | * modify it under the terms of the GNU General Public License. |
11 | * | 11 | * |
12 | */ | 12 | */ |
13 | 13 | ||
14 | #include <linux/init.h> | 14 | #include <linux/init.h> |
15 | #include <linux/module.h> | 15 | #include <linux/module.h> |
16 | #include <linux/pm.h> | 16 | #include <linux/pm.h> |
17 | #include <linux/pm_legacy.h> | 17 | #include <linux/pm_legacy.h> |
18 | #include <linux/sched.h> | 18 | #include <linux/sched.h> |
19 | #include <linux/interrupt.h> | 19 | #include <linux/interrupt.h> |
20 | #include <linux/sysctl.h> | 20 | #include <linux/sysctl.h> |
21 | #include <linux/errno.h> | 21 | #include <linux/errno.h> |
22 | #include <linux/delay.h> | 22 | #include <linux/delay.h> |
23 | #include <asm/uaccess.h> | 23 | #include <asm/uaccess.h> |
24 | 24 | ||
25 | #include <asm/mb86943a.h> | 25 | #include <asm/mb86943a.h> |
26 | 26 | ||
27 | #include "local.h" | 27 | #include "local.h" |
28 | 28 | ||
29 | /* | 29 | /* |
30 | * Debug macros | 30 | * Debug macros |
31 | */ | 31 | */ |
32 | #define DEBUG | 32 | #define DEBUG |
33 | 33 | ||
34 | int pm_do_suspend(void) | 34 | int pm_do_suspend(void) |
35 | { | 35 | { |
36 | local_irq_disable(); | 36 | local_irq_disable(); |
37 | 37 | ||
38 | __set_LEDS(0xb1); | 38 | __set_LEDS(0xb1); |
39 | 39 | ||
40 | /* go zzz */ | 40 | /* go zzz */ |
41 | frv_cpu_suspend(pdm_suspend_mode); | 41 | frv_cpu_suspend(pdm_suspend_mode); |
42 | 42 | ||
43 | __set_LEDS(0xb2); | 43 | __set_LEDS(0xb2); |
44 | 44 | ||
45 | local_irq_enable(); | 45 | local_irq_enable(); |
46 | 46 | ||
47 | return 0; | 47 | return 0; |
48 | } | 48 | } |
49 | 49 | ||
50 | static unsigned long __irq_mask; | 50 | static unsigned long __irq_mask; |
51 | 51 | ||
52 | /* | 52 | /* |
53 | * Setup interrupt masks, etc to enable wakeup by power switch | 53 | * Setup interrupt masks, etc to enable wakeup by power switch |
54 | */ | 54 | */ |
55 | static void __default_power_switch_setup(void) | 55 | static void __default_power_switch_setup(void) |
56 | { | 56 | { |
57 | /* default is to mask all interrupt sources. */ | 57 | /* default is to mask all interrupt sources. */ |
58 | __irq_mask = *(unsigned long *)0xfeff9820; | 58 | __irq_mask = *(unsigned long *)0xfeff9820; |
59 | *(unsigned long *)0xfeff9820 = 0xfffe0000; | 59 | *(unsigned long *)0xfeff9820 = 0xfffe0000; |
60 | } | 60 | } |
61 | 61 | ||
62 | /* | 62 | /* |
63 | * Cleanup interrupt masks, etc after wakeup by power switch | 63 | * Cleanup interrupt masks, etc after wakeup by power switch |
64 | */ | 64 | */ |
65 | static void __default_power_switch_cleanup(void) | 65 | static void __default_power_switch_cleanup(void) |
66 | { | 66 | { |
67 | *(unsigned long *)0xfeff9820 = __irq_mask; | 67 | *(unsigned long *)0xfeff9820 = __irq_mask; |
68 | } | 68 | } |
69 | 69 | ||
70 | /* | 70 | /* |
71 | * Return non-zero if wakeup irq was caused by power switch | 71 | * Return non-zero if wakeup irq was caused by power switch |
72 | */ | 72 | */ |
73 | static int __default_power_switch_check(void) | 73 | static int __default_power_switch_check(void) |
74 | { | 74 | { |
75 | return 1; | 75 | return 1; |
76 | } | 76 | } |
77 | 77 | ||
78 | void (*__power_switch_wake_setup)(void) = __default_power_switch_setup; | 78 | void (*__power_switch_wake_setup)(void) = __default_power_switch_setup; |
79 | int (*__power_switch_wake_check)(void) = __default_power_switch_check; | 79 | int (*__power_switch_wake_check)(void) = __default_power_switch_check; |
80 | void (*__power_switch_wake_cleanup)(void) = __default_power_switch_cleanup; | 80 | void (*__power_switch_wake_cleanup)(void) = __default_power_switch_cleanup; |
81 | 81 | ||
82 | int pm_do_bus_sleep(void) | 82 | int pm_do_bus_sleep(void) |
83 | { | 83 | { |
84 | local_irq_disable(); | 84 | local_irq_disable(); |
85 | 85 | ||
86 | /* | 86 | /* |
87 | * Here is where we need some platform-dependent setup | 87 | * Here is where we need some platform-dependent setup |
88 | * of the interrupt state so that appropriate wakeup | 88 | * of the interrupt state so that appropriate wakeup |
89 | * sources are allowed and all others are masked. | 89 | * sources are allowed and all others are masked. |
90 | */ | 90 | */ |
91 | __power_switch_wake_setup(); | 91 | __power_switch_wake_setup(); |
92 | 92 | ||
93 | __set_LEDS(0xa1); | 93 | __set_LEDS(0xa1); |
94 | 94 | ||
95 | /* go zzz | 95 | /* go zzz |
96 | * | 96 | * |
97 | * This is in a loop in case power switch shares an irq with other | 97 | * This is in a loop in case power switch shares an irq with other |
98 | * devices. The wake_check() tells us if we need to finish waking | 98 | * devices. The wake_check() tells us if we need to finish waking |
99 | * or go back to sleep. | 99 | * or go back to sleep. |
100 | */ | 100 | */ |
101 | do { | 101 | do { |
102 | frv_cpu_suspend(HSR0_PDM_BUS_SLEEP); | 102 | frv_cpu_suspend(HSR0_PDM_BUS_SLEEP); |
103 | } while (__power_switch_wake_check && !__power_switch_wake_check()); | 103 | } while (__power_switch_wake_check && !__power_switch_wake_check()); |
104 | 104 | ||
105 | __set_LEDS(0xa2); | 105 | __set_LEDS(0xa2); |
106 | 106 | ||
107 | /* | 107 | /* |
108 | * Here is where we need some platform-dependent restore | 108 | * Here is where we need some platform-dependent restore |
109 | * of the interrupt state prior to being called. | 109 | * of the interrupt state prior to being called. |
110 | */ | 110 | */ |
111 | __power_switch_wake_cleanup(); | 111 | __power_switch_wake_cleanup(); |
112 | 112 | ||
113 | local_irq_enable(); | 113 | local_irq_enable(); |
114 | 114 | ||
115 | return 0; | 115 | return 0; |
116 | } | 116 | } |
117 | 117 | ||
118 | unsigned long sleep_phys_sp(void *sp) | 118 | unsigned long sleep_phys_sp(void *sp) |
119 | { | 119 | { |
120 | return virt_to_phys(sp); | 120 | return virt_to_phys(sp); |
121 | } | 121 | } |
122 | 122 | ||
123 | #ifdef CONFIG_SYSCTL | 123 | #ifdef CONFIG_SYSCTL |
124 | /* | 124 | /* |
125 | * Use a temporary sysctl number. Horrid, but will be cleaned up in 2.6 | 125 | * Use a temporary sysctl number. Horrid, but will be cleaned up in 2.6 |
126 | * when all the PM interfaces exist nicely. | 126 | * when all the PM interfaces exist nicely. |
127 | */ | 127 | */ |
128 | #define CTL_PM 9899 | ||
129 | #define CTL_PM_SUSPEND 1 | 128 | #define CTL_PM_SUSPEND 1 |
130 | #define CTL_PM_CMODE 2 | 129 | #define CTL_PM_CMODE 2 |
131 | #define CTL_PM_P0 4 | 130 | #define CTL_PM_P0 4 |
132 | #define CTL_PM_CM 5 | 131 | #define CTL_PM_CM 5 |
133 | 132 | ||
134 | static int user_atoi(char __user *ubuf, size_t len) | 133 | static int user_atoi(char __user *ubuf, size_t len) |
135 | { | 134 | { |
136 | char buf[16]; | 135 | char buf[16]; |
137 | unsigned long ret; | 136 | unsigned long ret; |
138 | 137 | ||
139 | if (len > 15) | 138 | if (len > 15) |
140 | return -EINVAL; | 139 | return -EINVAL; |
141 | 140 | ||
142 | if (copy_from_user(buf, ubuf, len)) | 141 | if (copy_from_user(buf, ubuf, len)) |
143 | return -EFAULT; | 142 | return -EFAULT; |
144 | 143 | ||
145 | buf[len] = 0; | 144 | buf[len] = 0; |
146 | ret = simple_strtoul(buf, NULL, 0); | 145 | ret = simple_strtoul(buf, NULL, 0); |
147 | if (ret > INT_MAX) | 146 | if (ret > INT_MAX) |
148 | return -ERANGE; | 147 | return -ERANGE; |
149 | return ret; | 148 | return ret; |
150 | } | 149 | } |
151 | 150 | ||
152 | /* | 151 | /* |
153 | * Send us to sleep. | 152 | * Send us to sleep. |
154 | */ | 153 | */ |
155 | static int sysctl_pm_do_suspend(ctl_table *ctl, int write, struct file *filp, | 154 | static int sysctl_pm_do_suspend(ctl_table *ctl, int write, struct file *filp, |
156 | void __user *buffer, size_t *lenp, loff_t *fpos) | 155 | void __user *buffer, size_t *lenp, loff_t *fpos) |
157 | { | 156 | { |
158 | int retval, mode; | 157 | int retval, mode; |
159 | 158 | ||
160 | if (*lenp <= 0) | 159 | if (*lenp <= 0) |
161 | return -EIO; | 160 | return -EIO; |
162 | 161 | ||
163 | mode = user_atoi(buffer, *lenp); | 162 | mode = user_atoi(buffer, *lenp); |
164 | if ((mode != 1) && (mode != 5)) | 163 | if ((mode != 1) && (mode != 5)) |
165 | return -EINVAL; | 164 | return -EINVAL; |
166 | 165 | ||
167 | retval = pm_send_all(PM_SUSPEND, (void *)3); | 166 | retval = pm_send_all(PM_SUSPEND, (void *)3); |
168 | 167 | ||
169 | if (retval == 0) { | 168 | if (retval == 0) { |
170 | if (mode == 5) | 169 | if (mode == 5) |
171 | retval = pm_do_bus_sleep(); | 170 | retval = pm_do_bus_sleep(); |
172 | else | 171 | else |
173 | retval = pm_do_suspend(); | 172 | retval = pm_do_suspend(); |
174 | pm_send_all(PM_RESUME, (void *)0); | 173 | pm_send_all(PM_RESUME, (void *)0); |
175 | } | 174 | } |
176 | 175 | ||
177 | return retval; | 176 | return retval; |
178 | } | 177 | } |
179 | 178 | ||
180 | static int try_set_cmode(int new_cmode) | 179 | static int try_set_cmode(int new_cmode) |
181 | { | 180 | { |
182 | if (new_cmode > 15) | 181 | if (new_cmode > 15) |
183 | return -EINVAL; | 182 | return -EINVAL; |
184 | if (!(clock_cmodes_permitted & (1<<new_cmode))) | 183 | if (!(clock_cmodes_permitted & (1<<new_cmode))) |
185 | return -EINVAL; | 184 | return -EINVAL; |
186 | 185 | ||
187 | /* tell all the drivers we're suspending */ | 186 | /* tell all the drivers we're suspending */ |
188 | pm_send_all(PM_SUSPEND, (void *)3); | 187 | pm_send_all(PM_SUSPEND, (void *)3); |
189 | 188 | ||
190 | /* now change cmode */ | 189 | /* now change cmode */ |
191 | local_irq_disable(); | 190 | local_irq_disable(); |
192 | frv_dma_pause_all(); | 191 | frv_dma_pause_all(); |
193 | 192 | ||
194 | frv_change_cmode(new_cmode); | 193 | frv_change_cmode(new_cmode); |
195 | 194 | ||
196 | determine_clocks(0); | 195 | determine_clocks(0); |
197 | time_divisor_init(); | 196 | time_divisor_init(); |
198 | 197 | ||
199 | #ifdef DEBUG | 198 | #ifdef DEBUG |
200 | determine_clocks(1); | 199 | determine_clocks(1); |
201 | #endif | 200 | #endif |
202 | frv_dma_resume_all(); | 201 | frv_dma_resume_all(); |
203 | local_irq_enable(); | 202 | local_irq_enable(); |
204 | 203 | ||
205 | /* tell all the drivers we're resuming */ | 204 | /* tell all the drivers we're resuming */ |
206 | pm_send_all(PM_RESUME, (void *)0); | 205 | pm_send_all(PM_RESUME, (void *)0); |
207 | return 0; | 206 | return 0; |
208 | } | 207 | } |
209 | 208 | ||
210 | 209 | ||
211 | static int cmode_procctl(ctl_table *ctl, int write, struct file *filp, | 210 | static int cmode_procctl(ctl_table *ctl, int write, struct file *filp, |
212 | void __user *buffer, size_t *lenp, loff_t *fpos) | 211 | void __user *buffer, size_t *lenp, loff_t *fpos) |
213 | { | 212 | { |
214 | int new_cmode; | 213 | int new_cmode; |
215 | 214 | ||
216 | if (!write) | 215 | if (!write) |
217 | return proc_dointvec(ctl, write, filp, buffer, lenp, fpos); | 216 | return proc_dointvec(ctl, write, filp, buffer, lenp, fpos); |
218 | 217 | ||
219 | new_cmode = user_atoi(buffer, *lenp); | 218 | new_cmode = user_atoi(buffer, *lenp); |
220 | 219 | ||
221 | return try_set_cmode(new_cmode)?:*lenp; | 220 | return try_set_cmode(new_cmode)?:*lenp; |
222 | } | 221 | } |
223 | 222 | ||
224 | static int cmode_sysctl(ctl_table *table, int __user *name, int nlen, | 223 | static int cmode_sysctl(ctl_table *table, int __user *name, int nlen, |
225 | void __user *oldval, size_t __user *oldlenp, | 224 | void __user *oldval, size_t __user *oldlenp, |
226 | void __user *newval, size_t newlen) | 225 | void __user *newval, size_t newlen) |
227 | { | 226 | { |
228 | if (oldval && oldlenp) { | 227 | if (oldval && oldlenp) { |
229 | size_t oldlen; | 228 | size_t oldlen; |
230 | 229 | ||
231 | if (get_user(oldlen, oldlenp)) | 230 | if (get_user(oldlen, oldlenp)) |
232 | return -EFAULT; | 231 | return -EFAULT; |
233 | 232 | ||
234 | if (oldlen != sizeof(int)) | 233 | if (oldlen != sizeof(int)) |
235 | return -EINVAL; | 234 | return -EINVAL; |
236 | 235 | ||
237 | if (put_user(clock_cmode_current, (unsigned __user *)oldval) || | 236 | if (put_user(clock_cmode_current, (unsigned __user *)oldval) || |
238 | put_user(sizeof(int), oldlenp)) | 237 | put_user(sizeof(int), oldlenp)) |
239 | return -EFAULT; | 238 | return -EFAULT; |
240 | } | 239 | } |
241 | if (newval && newlen) { | 240 | if (newval && newlen) { |
242 | int new_cmode; | 241 | int new_cmode; |
243 | 242 | ||
244 | if (newlen != sizeof(int)) | 243 | if (newlen != sizeof(int)) |
245 | return -EINVAL; | 244 | return -EINVAL; |
246 | 245 | ||
247 | if (get_user(new_cmode, (int __user *)newval)) | 246 | if (get_user(new_cmode, (int __user *)newval)) |
248 | return -EFAULT; | 247 | return -EFAULT; |
249 | 248 | ||
250 | return try_set_cmode(new_cmode)?:1; | 249 | return try_set_cmode(new_cmode)?:1; |
251 | } | 250 | } |
252 | return 1; | 251 | return 1; |
253 | } | 252 | } |
254 | 253 | ||
255 | static int try_set_p0(int new_p0) | 254 | static int try_set_p0(int new_p0) |
256 | { | 255 | { |
257 | unsigned long flags, clkc; | 256 | unsigned long flags, clkc; |
258 | 257 | ||
259 | if (new_p0 < 0 || new_p0 > 1) | 258 | if (new_p0 < 0 || new_p0 > 1) |
260 | return -EINVAL; | 259 | return -EINVAL; |
261 | 260 | ||
262 | local_irq_save(flags); | 261 | local_irq_save(flags); |
263 | __set_PSR(flags & ~PSR_ET); | 262 | __set_PSR(flags & ~PSR_ET); |
264 | 263 | ||
265 | frv_dma_pause_all(); | 264 | frv_dma_pause_all(); |
266 | 265 | ||
267 | clkc = __get_CLKC(); | 266 | clkc = __get_CLKC(); |
268 | if (new_p0) | 267 | if (new_p0) |
269 | clkc |= CLKC_P0; | 268 | clkc |= CLKC_P0; |
270 | else | 269 | else |
271 | clkc &= ~CLKC_P0; | 270 | clkc &= ~CLKC_P0; |
272 | __set_CLKC(clkc); | 271 | __set_CLKC(clkc); |
273 | 272 | ||
274 | determine_clocks(0); | 273 | determine_clocks(0); |
275 | time_divisor_init(); | 274 | time_divisor_init(); |
276 | 275 | ||
277 | #ifdef DEBUG | 276 | #ifdef DEBUG |
278 | determine_clocks(1); | 277 | determine_clocks(1); |
279 | #endif | 278 | #endif |
280 | frv_dma_resume_all(); | 279 | frv_dma_resume_all(); |
281 | local_irq_restore(flags); | 280 | local_irq_restore(flags); |
282 | return 0; | 281 | return 0; |
283 | } | 282 | } |
284 | 283 | ||
285 | static int try_set_cm(int new_cm) | 284 | static int try_set_cm(int new_cm) |
286 | { | 285 | { |
287 | unsigned long flags, clkc; | 286 | unsigned long flags, clkc; |
288 | 287 | ||
289 | if (new_cm < 0 || new_cm > 1) | 288 | if (new_cm < 0 || new_cm > 1) |
290 | return -EINVAL; | 289 | return -EINVAL; |
291 | 290 | ||
292 | local_irq_save(flags); | 291 | local_irq_save(flags); |
293 | __set_PSR(flags & ~PSR_ET); | 292 | __set_PSR(flags & ~PSR_ET); |
294 | 293 | ||
295 | frv_dma_pause_all(); | 294 | frv_dma_pause_all(); |
296 | 295 | ||
297 | clkc = __get_CLKC(); | 296 | clkc = __get_CLKC(); |
298 | clkc &= ~CLKC_CM; | 297 | clkc &= ~CLKC_CM; |
299 | clkc |= new_cm; | 298 | clkc |= new_cm; |
300 | __set_CLKC(clkc); | 299 | __set_CLKC(clkc); |
301 | 300 | ||
302 | determine_clocks(0); | 301 | determine_clocks(0); |
303 | time_divisor_init(); | 302 | time_divisor_init(); |
304 | 303 | ||
305 | #if 1 //def DEBUG | 304 | #if 1 //def DEBUG |
306 | determine_clocks(1); | 305 | determine_clocks(1); |
307 | #endif | 306 | #endif |
308 | 307 | ||
309 | frv_dma_resume_all(); | 308 | frv_dma_resume_all(); |
310 | local_irq_restore(flags); | 309 | local_irq_restore(flags); |
311 | return 0; | 310 | return 0; |
312 | } | 311 | } |
313 | 312 | ||
314 | static int p0_procctl(ctl_table *ctl, int write, struct file *filp, | 313 | static int p0_procctl(ctl_table *ctl, int write, struct file *filp, |
315 | void __user *buffer, size_t *lenp, loff_t *fpos) | 314 | void __user *buffer, size_t *lenp, loff_t *fpos) |
316 | { | 315 | { |
317 | int new_p0; | 316 | int new_p0; |
318 | 317 | ||
319 | if (!write) | 318 | if (!write) |
320 | return proc_dointvec(ctl, write, filp, buffer, lenp, fpos); | 319 | return proc_dointvec(ctl, write, filp, buffer, lenp, fpos); |
321 | 320 | ||
322 | new_p0 = user_atoi(buffer, *lenp); | 321 | new_p0 = user_atoi(buffer, *lenp); |
323 | 322 | ||
324 | return try_set_p0(new_p0)?:*lenp; | 323 | return try_set_p0(new_p0)?:*lenp; |
325 | } | 324 | } |
326 | 325 | ||
327 | static int p0_sysctl(ctl_table *table, int __user *name, int nlen, | 326 | static int p0_sysctl(ctl_table *table, int __user *name, int nlen, |
328 | void __user *oldval, size_t __user *oldlenp, | 327 | void __user *oldval, size_t __user *oldlenp, |
329 | void __user *newval, size_t newlen) | 328 | void __user *newval, size_t newlen) |
330 | { | 329 | { |
331 | if (oldval && oldlenp) { | 330 | if (oldval && oldlenp) { |
332 | size_t oldlen; | 331 | size_t oldlen; |
333 | 332 | ||
334 | if (get_user(oldlen, oldlenp)) | 333 | if (get_user(oldlen, oldlenp)) |
335 | return -EFAULT; | 334 | return -EFAULT; |
336 | 335 | ||
337 | if (oldlen != sizeof(int)) | 336 | if (oldlen != sizeof(int)) |
338 | return -EINVAL; | 337 | return -EINVAL; |
339 | 338 | ||
340 | if (put_user(clock_p0_current, (unsigned __user *)oldval) || | 339 | if (put_user(clock_p0_current, (unsigned __user *)oldval) || |
341 | put_user(sizeof(int), oldlenp)) | 340 | put_user(sizeof(int), oldlenp)) |
342 | return -EFAULT; | 341 | return -EFAULT; |
343 | } | 342 | } |
344 | if (newval && newlen) { | 343 | if (newval && newlen) { |
345 | int new_p0; | 344 | int new_p0; |
346 | 345 | ||
347 | if (newlen != sizeof(int)) | 346 | if (newlen != sizeof(int)) |
348 | return -EINVAL; | 347 | return -EINVAL; |
349 | 348 | ||
350 | if (get_user(new_p0, (int __user *)newval)) | 349 | if (get_user(new_p0, (int __user *)newval)) |
351 | return -EFAULT; | 350 | return -EFAULT; |
352 | 351 | ||
353 | return try_set_p0(new_p0)?:1; | 352 | return try_set_p0(new_p0)?:1; |
354 | } | 353 | } |
355 | return 1; | 354 | return 1; |
356 | } | 355 | } |
357 | 356 | ||
358 | static int cm_procctl(ctl_table *ctl, int write, struct file *filp, | 357 | static int cm_procctl(ctl_table *ctl, int write, struct file *filp, |
359 | void __user *buffer, size_t *lenp, loff_t *fpos) | 358 | void __user *buffer, size_t *lenp, loff_t *fpos) |
360 | { | 359 | { |
361 | int new_cm; | 360 | int new_cm; |
362 | 361 | ||
363 | if (!write) | 362 | if (!write) |
364 | return proc_dointvec(ctl, write, filp, buffer, lenp, fpos); | 363 | return proc_dointvec(ctl, write, filp, buffer, lenp, fpos); |
365 | 364 | ||
366 | new_cm = user_atoi(buffer, *lenp); | 365 | new_cm = user_atoi(buffer, *lenp); |
367 | 366 | ||
368 | return try_set_cm(new_cm)?:*lenp; | 367 | return try_set_cm(new_cm)?:*lenp; |
369 | } | 368 | } |
370 | 369 | ||
371 | static int cm_sysctl(ctl_table *table, int __user *name, int nlen, | 370 | static int cm_sysctl(ctl_table *table, int __user *name, int nlen, |
372 | void __user *oldval, size_t __user *oldlenp, | 371 | void __user *oldval, size_t __user *oldlenp, |
373 | void __user *newval, size_t newlen) | 372 | void __user *newval, size_t newlen) |
374 | { | 373 | { |
375 | if (oldval && oldlenp) { | 374 | if (oldval && oldlenp) { |
376 | size_t oldlen; | 375 | size_t oldlen; |
377 | 376 | ||
378 | if (get_user(oldlen, oldlenp)) | 377 | if (get_user(oldlen, oldlenp)) |
379 | return -EFAULT; | 378 | return -EFAULT; |
380 | 379 | ||
381 | if (oldlen != sizeof(int)) | 380 | if (oldlen != sizeof(int)) |
382 | return -EINVAL; | 381 | return -EINVAL; |
383 | 382 | ||
384 | if (put_user(clock_cm_current, (unsigned __user *)oldval) || | 383 | if (put_user(clock_cm_current, (unsigned __user *)oldval) || |
385 | put_user(sizeof(int), oldlenp)) | 384 | put_user(sizeof(int), oldlenp)) |
386 | return -EFAULT; | 385 | return -EFAULT; |
387 | } | 386 | } |
388 | if (newval && newlen) { | 387 | if (newval && newlen) { |
389 | int new_cm; | 388 | int new_cm; |
390 | 389 | ||
391 | if (newlen != sizeof(int)) | 390 | if (newlen != sizeof(int)) |
392 | return -EINVAL; | 391 | return -EINVAL; |
393 | 392 | ||
394 | if (get_user(new_cm, (int __user *)newval)) | 393 | if (get_user(new_cm, (int __user *)newval)) |
395 | return -EFAULT; | 394 | return -EFAULT; |
396 | 395 | ||
397 | return try_set_cm(new_cm)?:1; | 396 | return try_set_cm(new_cm)?:1; |
398 | } | 397 | } |
399 | return 1; | 398 | return 1; |
400 | } | 399 | } |
401 | 400 | ||
402 | 401 | ||
403 | static struct ctl_table pm_table[] = | 402 | static struct ctl_table pm_table[] = |
404 | { | 403 | { |
405 | {CTL_PM_SUSPEND, "suspend", NULL, 0, 0200, NULL, &sysctl_pm_do_suspend}, | 404 | {CTL_PM_SUSPEND, "suspend", NULL, 0, 0200, NULL, &sysctl_pm_do_suspend}, |
406 | {CTL_PM_CMODE, "cmode", &clock_cmode_current, sizeof(int), 0644, NULL, &cmode_procctl, &cmode_sysctl, NULL}, | 405 | {CTL_PM_CMODE, "cmode", &clock_cmode_current, sizeof(int), 0644, NULL, &cmode_procctl, &cmode_sysctl, NULL}, |
407 | {CTL_PM_P0, "p0", &clock_p0_current, sizeof(int), 0644, NULL, &p0_procctl, &p0_sysctl, NULL}, | 406 | {CTL_PM_P0, "p0", &clock_p0_current, sizeof(int), 0644, NULL, &p0_procctl, &p0_sysctl, NULL}, |
408 | {CTL_PM_CM, "cm", &clock_cm_current, sizeof(int), 0644, NULL, &cm_procctl, &cm_sysctl, NULL}, | 407 | {CTL_PM_CM, "cm", &clock_cm_current, sizeof(int), 0644, NULL, &cm_procctl, &cm_sysctl, NULL}, |
409 | {0} | 408 | {0} |
410 | }; | 409 | }; |
411 | 410 | ||
412 | static struct ctl_table pm_dir_table[] = | 411 | static struct ctl_table pm_dir_table[] = |
413 | { | 412 | { |
414 | {CTL_PM, "pm", NULL, 0, 0555, pm_table}, | 413 | {CTL_PM, "pm", NULL, 0, 0555, pm_table}, |
415 | {0} | 414 | {0} |
416 | }; | 415 | }; |
417 | 416 | ||
418 | /* | 417 | /* |
419 | * Initialize power interface | 418 | * Initialize power interface |
420 | */ | 419 | */ |
421 | static int __init pm_init(void) | 420 | static int __init pm_init(void) |
422 | { | 421 | { |
423 | register_sysctl_table(pm_dir_table, 1); | 422 | register_sysctl_table(pm_dir_table, 1); |
424 | return 0; | 423 | return 0; |
425 | } | 424 | } |
426 | 425 | ||
427 | __initcall(pm_init); | 426 | __initcall(pm_init); |
428 | 427 | ||
429 | #endif | 428 | #endif |
430 | 429 |
include/linux/sysctl.h
1 | /* | 1 | /* |
2 | * sysctl.h: General linux system control interface | 2 | * sysctl.h: General linux system control interface |
3 | * | 3 | * |
4 | * Begun 24 March 1995, Stephen Tweedie | 4 | * Begun 24 March 1995, Stephen Tweedie |
5 | * | 5 | * |
6 | **************************************************************** | 6 | **************************************************************** |
7 | **************************************************************** | 7 | **************************************************************** |
8 | ** | 8 | ** |
9 | ** WARNING: | 9 | ** WARNING: |
10 | ** The values in this file are exported to user space via | 10 | ** The values in this file are exported to user space via |
11 | ** the sysctl() binary interface. Do *NOT* change the | 11 | ** the sysctl() binary interface. Do *NOT* change the |
12 | ** numbering of any existing values here, and do not change | 12 | ** numbering of any existing values here, and do not change |
13 | ** any numbers within any one set of values. If you have to | 13 | ** any numbers within any one set of values. If you have to |
14 | ** redefine an existing interface, use a new number for it. | 14 | ** redefine an existing interface, use a new number for it. |
15 | ** The kernel will then return -ENOTDIR to any application using | 15 | ** The kernel will then return -ENOTDIR to any application using |
16 | ** the old binary interface. | 16 | ** the old binary interface. |
17 | ** | 17 | ** |
18 | ** For new interfaces unless you really need a binary number | 18 | ** For new interfaces unless you really need a binary number |
19 | ** please use CTL_UNNUMBERED. | 19 | ** please use CTL_UNNUMBERED. |
20 | ** | 20 | ** |
21 | **************************************************************** | 21 | **************************************************************** |
22 | **************************************************************** | 22 | **************************************************************** |
23 | */ | 23 | */ |
24 | 24 | ||
25 | #ifndef _LINUX_SYSCTL_H | 25 | #ifndef _LINUX_SYSCTL_H |
26 | #define _LINUX_SYSCTL_H | 26 | #define _LINUX_SYSCTL_H |
27 | 27 | ||
28 | #include <linux/kernel.h> | 28 | #include <linux/kernel.h> |
29 | #include <linux/types.h> | 29 | #include <linux/types.h> |
30 | #include <linux/compiler.h> | 30 | #include <linux/compiler.h> |
31 | 31 | ||
32 | struct file; | 32 | struct file; |
33 | struct completion; | 33 | struct completion; |
34 | 34 | ||
35 | #define CTL_MAXNAME 10 /* how many path components do we allow in a | 35 | #define CTL_MAXNAME 10 /* how many path components do we allow in a |
36 | call to sysctl? In other words, what is | 36 | call to sysctl? In other words, what is |
37 | the largest acceptable value for the nlen | 37 | the largest acceptable value for the nlen |
38 | member of a struct __sysctl_args to have? */ | 38 | member of a struct __sysctl_args to have? */ |
39 | 39 | ||
40 | struct __sysctl_args { | 40 | struct __sysctl_args { |
41 | int __user *name; | 41 | int __user *name; |
42 | int nlen; | 42 | int nlen; |
43 | void __user *oldval; | 43 | void __user *oldval; |
44 | size_t __user *oldlenp; | 44 | size_t __user *oldlenp; |
45 | void __user *newval; | 45 | void __user *newval; |
46 | size_t newlen; | 46 | size_t newlen; |
47 | unsigned long __unused[4]; | 47 | unsigned long __unused[4]; |
48 | }; | 48 | }; |
49 | 49 | ||
50 | /* Define sysctl names first */ | 50 | /* Define sysctl names first */ |
51 | 51 | ||
52 | /* Top-level names: */ | 52 | /* Top-level names: */ |
53 | 53 | ||
54 | /* For internal pattern-matching use only: */ | 54 | /* For internal pattern-matching use only: */ |
55 | #ifdef __KERNEL__ | 55 | #ifdef __KERNEL__ |
56 | #define CTL_ANY -1 /* Matches any name */ | 56 | #define CTL_ANY -1 /* Matches any name */ |
57 | #define CTL_NONE 0 | 57 | #define CTL_NONE 0 |
58 | #define CTL_UNNUMBERED CTL_NONE /* sysctl without a binary number */ | 58 | #define CTL_UNNUMBERED CTL_NONE /* sysctl without a binary number */ |
59 | #endif | 59 | #endif |
60 | 60 | ||
61 | enum | 61 | enum |
62 | { | 62 | { |
63 | CTL_KERN=1, /* General kernel info and control */ | 63 | CTL_KERN=1, /* General kernel info and control */ |
64 | CTL_VM=2, /* VM management */ | 64 | CTL_VM=2, /* VM management */ |
65 | CTL_NET=3, /* Networking */ | 65 | CTL_NET=3, /* Networking */ |
66 | /* was CTL_PROC */ | 66 | /* was CTL_PROC */ |
67 | CTL_FS=5, /* Filesystems */ | 67 | CTL_FS=5, /* Filesystems */ |
68 | CTL_DEBUG=6, /* Debugging */ | 68 | CTL_DEBUG=6, /* Debugging */ |
69 | CTL_DEV=7, /* Devices */ | 69 | CTL_DEV=7, /* Devices */ |
70 | CTL_BUS=8, /* Busses */ | 70 | CTL_BUS=8, /* Busses */ |
71 | CTL_ABI=9, /* Binary emulation */ | 71 | CTL_ABI=9, /* Binary emulation */ |
72 | CTL_CPU=10, /* CPU stuff (speed scaling, etc) */ | 72 | CTL_CPU=10, /* CPU stuff (speed scaling, etc) */ |
73 | CTL_SUNRPC=7249, /* sunrpc debug */ | 73 | CTL_SUNRPC=7249, /* sunrpc debug */ |
74 | CTL_PM=9899, /* frv power management */ | ||
74 | }; | 75 | }; |
75 | 76 | ||
76 | /* CTL_BUS names: */ | 77 | /* CTL_BUS names: */ |
77 | enum | 78 | enum |
78 | { | 79 | { |
79 | CTL_BUS_ISA=1 /* ISA */ | 80 | CTL_BUS_ISA=1 /* ISA */ |
80 | }; | 81 | }; |
81 | 82 | ||
82 | /* /proc/sys/fs/inotify/ */ | 83 | /* /proc/sys/fs/inotify/ */ |
83 | enum | 84 | enum |
84 | { | 85 | { |
85 | INOTIFY_MAX_USER_INSTANCES=1, /* max instances per user */ | 86 | INOTIFY_MAX_USER_INSTANCES=1, /* max instances per user */ |
86 | INOTIFY_MAX_USER_WATCHES=2, /* max watches per user */ | 87 | INOTIFY_MAX_USER_WATCHES=2, /* max watches per user */ |
87 | INOTIFY_MAX_QUEUED_EVENTS=3 /* max queued events per instance */ | 88 | INOTIFY_MAX_QUEUED_EVENTS=3 /* max queued events per instance */ |
88 | }; | 89 | }; |
89 | 90 | ||
90 | /* CTL_KERN names: */ | 91 | /* CTL_KERN names: */ |
91 | enum | 92 | enum |
92 | { | 93 | { |
93 | KERN_OSTYPE=1, /* string: system version */ | 94 | KERN_OSTYPE=1, /* string: system version */ |
94 | KERN_OSRELEASE=2, /* string: system release */ | 95 | KERN_OSRELEASE=2, /* string: system release */ |
95 | KERN_OSREV=3, /* int: system revision */ | 96 | KERN_OSREV=3, /* int: system revision */ |
96 | KERN_VERSION=4, /* string: compile time info */ | 97 | KERN_VERSION=4, /* string: compile time info */ |
97 | KERN_SECUREMASK=5, /* struct: maximum rights mask */ | 98 | KERN_SECUREMASK=5, /* struct: maximum rights mask */ |
98 | KERN_PROF=6, /* table: profiling information */ | 99 | KERN_PROF=6, /* table: profiling information */ |
99 | KERN_NODENAME=7, | 100 | KERN_NODENAME=7, |
100 | KERN_DOMAINNAME=8, | 101 | KERN_DOMAINNAME=8, |
101 | 102 | ||
102 | KERN_CAP_BSET=14, /* int: capability bounding set */ | 103 | KERN_CAP_BSET=14, /* int: capability bounding set */ |
103 | KERN_PANIC=15, /* int: panic timeout */ | 104 | KERN_PANIC=15, /* int: panic timeout */ |
104 | KERN_REALROOTDEV=16, /* real root device to mount after initrd */ | 105 | KERN_REALROOTDEV=16, /* real root device to mount after initrd */ |
105 | 106 | ||
106 | KERN_SPARC_REBOOT=21, /* reboot command on Sparc */ | 107 | KERN_SPARC_REBOOT=21, /* reboot command on Sparc */ |
107 | KERN_CTLALTDEL=22, /* int: allow ctl-alt-del to reboot */ | 108 | KERN_CTLALTDEL=22, /* int: allow ctl-alt-del to reboot */ |
108 | KERN_PRINTK=23, /* struct: control printk logging parameters */ | 109 | KERN_PRINTK=23, /* struct: control printk logging parameters */ |
109 | KERN_NAMETRANS=24, /* Name translation */ | 110 | KERN_NAMETRANS=24, /* Name translation */ |
110 | KERN_PPC_HTABRECLAIM=25, /* turn htab reclaimation on/off on PPC */ | 111 | KERN_PPC_HTABRECLAIM=25, /* turn htab reclaimation on/off on PPC */ |
111 | KERN_PPC_ZEROPAGED=26, /* turn idle page zeroing on/off on PPC */ | 112 | KERN_PPC_ZEROPAGED=26, /* turn idle page zeroing on/off on PPC */ |
112 | KERN_PPC_POWERSAVE_NAP=27, /* use nap mode for power saving */ | 113 | KERN_PPC_POWERSAVE_NAP=27, /* use nap mode for power saving */ |
113 | KERN_MODPROBE=28, | 114 | KERN_MODPROBE=28, |
114 | KERN_SG_BIG_BUFF=29, | 115 | KERN_SG_BIG_BUFF=29, |
115 | KERN_ACCT=30, /* BSD process accounting parameters */ | 116 | KERN_ACCT=30, /* BSD process accounting parameters */ |
116 | KERN_PPC_L2CR=31, /* l2cr register on PPC */ | 117 | KERN_PPC_L2CR=31, /* l2cr register on PPC */ |
117 | 118 | ||
118 | KERN_RTSIGNR=32, /* Number of rt sigs queued */ | 119 | KERN_RTSIGNR=32, /* Number of rt sigs queued */ |
119 | KERN_RTSIGMAX=33, /* Max queuable */ | 120 | KERN_RTSIGMAX=33, /* Max queuable */ |
120 | 121 | ||
121 | KERN_SHMMAX=34, /* long: Maximum shared memory segment */ | 122 | KERN_SHMMAX=34, /* long: Maximum shared memory segment */ |
122 | KERN_MSGMAX=35, /* int: Maximum size of a messege */ | 123 | KERN_MSGMAX=35, /* int: Maximum size of a messege */ |
123 | KERN_MSGMNB=36, /* int: Maximum message queue size */ | 124 | KERN_MSGMNB=36, /* int: Maximum message queue size */ |
124 | KERN_MSGPOOL=37, /* int: Maximum system message pool size */ | 125 | KERN_MSGPOOL=37, /* int: Maximum system message pool size */ |
125 | KERN_SYSRQ=38, /* int: Sysreq enable */ | 126 | KERN_SYSRQ=38, /* int: Sysreq enable */ |
126 | KERN_MAX_THREADS=39, /* int: Maximum nr of threads in the system */ | 127 | KERN_MAX_THREADS=39, /* int: Maximum nr of threads in the system */ |
127 | KERN_RANDOM=40, /* Random driver */ | 128 | KERN_RANDOM=40, /* Random driver */ |
128 | KERN_SHMALL=41, /* int: Maximum size of shared memory */ | 129 | KERN_SHMALL=41, /* int: Maximum size of shared memory */ |
129 | KERN_MSGMNI=42, /* int: msg queue identifiers */ | 130 | KERN_MSGMNI=42, /* int: msg queue identifiers */ |
130 | KERN_SEM=43, /* struct: sysv semaphore limits */ | 131 | KERN_SEM=43, /* struct: sysv semaphore limits */ |
131 | KERN_SPARC_STOP_A=44, /* int: Sparc Stop-A enable */ | 132 | KERN_SPARC_STOP_A=44, /* int: Sparc Stop-A enable */ |
132 | KERN_SHMMNI=45, /* int: shm array identifiers */ | 133 | KERN_SHMMNI=45, /* int: shm array identifiers */ |
133 | KERN_OVERFLOWUID=46, /* int: overflow UID */ | 134 | KERN_OVERFLOWUID=46, /* int: overflow UID */ |
134 | KERN_OVERFLOWGID=47, /* int: overflow GID */ | 135 | KERN_OVERFLOWGID=47, /* int: overflow GID */ |
135 | KERN_SHMPATH=48, /* string: path to shm fs */ | 136 | KERN_SHMPATH=48, /* string: path to shm fs */ |
136 | KERN_HOTPLUG=49, /* string: path to uevent helper (deprecated) */ | 137 | KERN_HOTPLUG=49, /* string: path to uevent helper (deprecated) */ |
137 | KERN_IEEE_EMULATION_WARNINGS=50, /* int: unimplemented ieee instructions */ | 138 | KERN_IEEE_EMULATION_WARNINGS=50, /* int: unimplemented ieee instructions */ |
138 | KERN_S390_USER_DEBUG_LOGGING=51, /* int: dumps of user faults */ | 139 | KERN_S390_USER_DEBUG_LOGGING=51, /* int: dumps of user faults */ |
139 | KERN_CORE_USES_PID=52, /* int: use core or core.%pid */ | 140 | KERN_CORE_USES_PID=52, /* int: use core or core.%pid */ |
140 | KERN_TAINTED=53, /* int: various kernel tainted flags */ | 141 | KERN_TAINTED=53, /* int: various kernel tainted flags */ |
141 | KERN_CADPID=54, /* int: PID of the process to notify on CAD */ | 142 | KERN_CADPID=54, /* int: PID of the process to notify on CAD */ |
142 | KERN_PIDMAX=55, /* int: PID # limit */ | 143 | KERN_PIDMAX=55, /* int: PID # limit */ |
143 | KERN_CORE_PATTERN=56, /* string: pattern for core-file names */ | 144 | KERN_CORE_PATTERN=56, /* string: pattern for core-file names */ |
144 | KERN_PANIC_ON_OOPS=57, /* int: whether we will panic on an oops */ | 145 | KERN_PANIC_ON_OOPS=57, /* int: whether we will panic on an oops */ |
145 | KERN_HPPA_PWRSW=58, /* int: hppa soft-power enable */ | 146 | KERN_HPPA_PWRSW=58, /* int: hppa soft-power enable */ |
146 | KERN_HPPA_UNALIGNED=59, /* int: hppa unaligned-trap enable */ | 147 | KERN_HPPA_UNALIGNED=59, /* int: hppa unaligned-trap enable */ |
147 | KERN_PRINTK_RATELIMIT=60, /* int: tune printk ratelimiting */ | 148 | KERN_PRINTK_RATELIMIT=60, /* int: tune printk ratelimiting */ |
148 | KERN_PRINTK_RATELIMIT_BURST=61, /* int: tune printk ratelimiting */ | 149 | KERN_PRINTK_RATELIMIT_BURST=61, /* int: tune printk ratelimiting */ |
149 | KERN_PTY=62, /* dir: pty driver */ | 150 | KERN_PTY=62, /* dir: pty driver */ |
150 | KERN_NGROUPS_MAX=63, /* int: NGROUPS_MAX */ | 151 | KERN_NGROUPS_MAX=63, /* int: NGROUPS_MAX */ |
151 | KERN_SPARC_SCONS_PWROFF=64, /* int: serial console power-off halt */ | 152 | KERN_SPARC_SCONS_PWROFF=64, /* int: serial console power-off halt */ |
152 | KERN_HZ_TIMER=65, /* int: hz timer on or off */ | 153 | KERN_HZ_TIMER=65, /* int: hz timer on or off */ |
153 | KERN_UNKNOWN_NMI_PANIC=66, /* int: unknown nmi panic flag */ | 154 | KERN_UNKNOWN_NMI_PANIC=66, /* int: unknown nmi panic flag */ |
154 | KERN_BOOTLOADER_TYPE=67, /* int: boot loader type */ | 155 | KERN_BOOTLOADER_TYPE=67, /* int: boot loader type */ |
155 | KERN_RANDOMIZE=68, /* int: randomize virtual address space */ | 156 | KERN_RANDOMIZE=68, /* int: randomize virtual address space */ |
156 | KERN_SETUID_DUMPABLE=69, /* int: behaviour of dumps for setuid core */ | 157 | KERN_SETUID_DUMPABLE=69, /* int: behaviour of dumps for setuid core */ |
157 | KERN_SPIN_RETRY=70, /* int: number of spinlock retries */ | 158 | KERN_SPIN_RETRY=70, /* int: number of spinlock retries */ |
158 | KERN_ACPI_VIDEO_FLAGS=71, /* int: flags for setting up video after ACPI sleep */ | 159 | KERN_ACPI_VIDEO_FLAGS=71, /* int: flags for setting up video after ACPI sleep */ |
159 | KERN_IA64_UNALIGNED=72, /* int: ia64 unaligned userland trap enable */ | 160 | KERN_IA64_UNALIGNED=72, /* int: ia64 unaligned userland trap enable */ |
160 | KERN_COMPAT_LOG=73, /* int: print compat layer messages */ | 161 | KERN_COMPAT_LOG=73, /* int: print compat layer messages */ |
161 | KERN_MAX_LOCK_DEPTH=74, | 162 | KERN_MAX_LOCK_DEPTH=74, |
162 | KERN_NMI_WATCHDOG=75, /* int: enable/disable nmi watchdog */ | 163 | KERN_NMI_WATCHDOG=75, /* int: enable/disable nmi watchdog */ |
163 | KERN_PANIC_ON_NMI=76, /* int: whether we will panic on an unrecovered */ | 164 | KERN_PANIC_ON_NMI=76, /* int: whether we will panic on an unrecovered */ |
164 | }; | 165 | }; |
165 | 166 | ||
166 | 167 | ||
167 | 168 | ||
168 | /* CTL_VM names: */ | 169 | /* CTL_VM names: */ |
169 | enum | 170 | enum |
170 | { | 171 | { |
171 | VM_UNUSED1=1, /* was: struct: Set vm swapping control */ | 172 | VM_UNUSED1=1, /* was: struct: Set vm swapping control */ |
172 | VM_UNUSED2=2, /* was; int: Linear or sqrt() swapout for hogs */ | 173 | VM_UNUSED2=2, /* was; int: Linear or sqrt() swapout for hogs */ |
173 | VM_UNUSED3=3, /* was: struct: Set free page thresholds */ | 174 | VM_UNUSED3=3, /* was: struct: Set free page thresholds */ |
174 | VM_UNUSED4=4, /* Spare */ | 175 | VM_UNUSED4=4, /* Spare */ |
175 | VM_OVERCOMMIT_MEMORY=5, /* Turn off the virtual memory safety limit */ | 176 | VM_OVERCOMMIT_MEMORY=5, /* Turn off the virtual memory safety limit */ |
176 | VM_UNUSED5=6, /* was: struct: Set buffer memory thresholds */ | 177 | VM_UNUSED5=6, /* was: struct: Set buffer memory thresholds */ |
177 | VM_UNUSED7=7, /* was: struct: Set cache memory thresholds */ | 178 | VM_UNUSED7=7, /* was: struct: Set cache memory thresholds */ |
178 | VM_UNUSED8=8, /* was: struct: Control kswapd behaviour */ | 179 | VM_UNUSED8=8, /* was: struct: Control kswapd behaviour */ |
179 | VM_UNUSED9=9, /* was: struct: Set page table cache parameters */ | 180 | VM_UNUSED9=9, /* was: struct: Set page table cache parameters */ |
180 | VM_PAGE_CLUSTER=10, /* int: set number of pages to swap together */ | 181 | VM_PAGE_CLUSTER=10, /* int: set number of pages to swap together */ |
181 | VM_DIRTY_BACKGROUND=11, /* dirty_background_ratio */ | 182 | VM_DIRTY_BACKGROUND=11, /* dirty_background_ratio */ |
182 | VM_DIRTY_RATIO=12, /* dirty_ratio */ | 183 | VM_DIRTY_RATIO=12, /* dirty_ratio */ |
183 | VM_DIRTY_WB_CS=13, /* dirty_writeback_centisecs */ | 184 | VM_DIRTY_WB_CS=13, /* dirty_writeback_centisecs */ |
184 | VM_DIRTY_EXPIRE_CS=14, /* dirty_expire_centisecs */ | 185 | VM_DIRTY_EXPIRE_CS=14, /* dirty_expire_centisecs */ |
185 | VM_NR_PDFLUSH_THREADS=15, /* nr_pdflush_threads */ | 186 | VM_NR_PDFLUSH_THREADS=15, /* nr_pdflush_threads */ |
186 | VM_OVERCOMMIT_RATIO=16, /* percent of RAM to allow overcommit in */ | 187 | VM_OVERCOMMIT_RATIO=16, /* percent of RAM to allow overcommit in */ |
187 | VM_PAGEBUF=17, /* struct: Control pagebuf parameters */ | 188 | VM_PAGEBUF=17, /* struct: Control pagebuf parameters */ |
188 | VM_HUGETLB_PAGES=18, /* int: Number of available Huge Pages */ | 189 | VM_HUGETLB_PAGES=18, /* int: Number of available Huge Pages */ |
189 | VM_SWAPPINESS=19, /* Tendency to steal mapped memory */ | 190 | VM_SWAPPINESS=19, /* Tendency to steal mapped memory */ |
190 | VM_LOWMEM_RESERVE_RATIO=20,/* reservation ratio for lower memory zones */ | 191 | VM_LOWMEM_RESERVE_RATIO=20,/* reservation ratio for lower memory zones */ |
191 | VM_MIN_FREE_KBYTES=21, /* Minimum free kilobytes to maintain */ | 192 | VM_MIN_FREE_KBYTES=21, /* Minimum free kilobytes to maintain */ |
192 | VM_MAX_MAP_COUNT=22, /* int: Maximum number of mmaps/address-space */ | 193 | VM_MAX_MAP_COUNT=22, /* int: Maximum number of mmaps/address-space */ |
193 | VM_LAPTOP_MODE=23, /* vm laptop mode */ | 194 | VM_LAPTOP_MODE=23, /* vm laptop mode */ |
194 | VM_BLOCK_DUMP=24, /* block dump mode */ | 195 | VM_BLOCK_DUMP=24, /* block dump mode */ |
195 | VM_HUGETLB_GROUP=25, /* permitted hugetlb group */ | 196 | VM_HUGETLB_GROUP=25, /* permitted hugetlb group */ |
196 | VM_VFS_CACHE_PRESSURE=26, /* dcache/icache reclaim pressure */ | 197 | VM_VFS_CACHE_PRESSURE=26, /* dcache/icache reclaim pressure */ |
197 | VM_LEGACY_VA_LAYOUT=27, /* legacy/compatibility virtual address space layout */ | 198 | VM_LEGACY_VA_LAYOUT=27, /* legacy/compatibility virtual address space layout */ |
198 | VM_SWAP_TOKEN_TIMEOUT=28, /* default time for token time out */ | 199 | VM_SWAP_TOKEN_TIMEOUT=28, /* default time for token time out */ |
199 | VM_DROP_PAGECACHE=29, /* int: nuke lots of pagecache */ | 200 | VM_DROP_PAGECACHE=29, /* int: nuke lots of pagecache */ |
200 | VM_PERCPU_PAGELIST_FRACTION=30,/* int: fraction of pages in each percpu_pagelist */ | 201 | VM_PERCPU_PAGELIST_FRACTION=30,/* int: fraction of pages in each percpu_pagelist */ |
201 | VM_ZONE_RECLAIM_MODE=31, /* reclaim local zone memory before going off node */ | 202 | VM_ZONE_RECLAIM_MODE=31, /* reclaim local zone memory before going off node */ |
202 | VM_MIN_UNMAPPED=32, /* Set min percent of unmapped pages */ | 203 | VM_MIN_UNMAPPED=32, /* Set min percent of unmapped pages */ |
203 | VM_PANIC_ON_OOM=33, /* panic at out-of-memory */ | 204 | VM_PANIC_ON_OOM=33, /* panic at out-of-memory */ |
204 | VM_VDSO_ENABLED=34, /* map VDSO into new processes? */ | 205 | VM_VDSO_ENABLED=34, /* map VDSO into new processes? */ |
205 | VM_MIN_SLAB=35, /* Percent pages ignored by zone reclaim */ | 206 | VM_MIN_SLAB=35, /* Percent pages ignored by zone reclaim */ |
206 | }; | 207 | }; |
207 | 208 | ||
208 | 209 | ||
209 | /* CTL_NET names: */ | 210 | /* CTL_NET names: */ |
210 | enum | 211 | enum |
211 | { | 212 | { |
212 | NET_CORE=1, | 213 | NET_CORE=1, |
213 | NET_ETHER=2, | 214 | NET_ETHER=2, |
214 | NET_802=3, | 215 | NET_802=3, |
215 | NET_UNIX=4, | 216 | NET_UNIX=4, |
216 | NET_IPV4=5, | 217 | NET_IPV4=5, |
217 | NET_IPX=6, | 218 | NET_IPX=6, |
218 | NET_ATALK=7, | 219 | NET_ATALK=7, |
219 | NET_NETROM=8, | 220 | NET_NETROM=8, |
220 | NET_AX25=9, | 221 | NET_AX25=9, |
221 | NET_BRIDGE=10, | 222 | NET_BRIDGE=10, |
222 | NET_ROSE=11, | 223 | NET_ROSE=11, |
223 | NET_IPV6=12, | 224 | NET_IPV6=12, |
224 | NET_X25=13, | 225 | NET_X25=13, |
225 | NET_TR=14, | 226 | NET_TR=14, |
226 | NET_DECNET=15, | 227 | NET_DECNET=15, |
227 | NET_ECONET=16, | 228 | NET_ECONET=16, |
228 | NET_SCTP=17, | 229 | NET_SCTP=17, |
229 | NET_LLC=18, | 230 | NET_LLC=18, |
230 | NET_NETFILTER=19, | 231 | NET_NETFILTER=19, |
231 | NET_DCCP=20, | 232 | NET_DCCP=20, |
232 | }; | 233 | }; |
233 | 234 | ||
234 | /* /proc/sys/kernel/random */ | 235 | /* /proc/sys/kernel/random */ |
235 | enum | 236 | enum |
236 | { | 237 | { |
237 | RANDOM_POOLSIZE=1, | 238 | RANDOM_POOLSIZE=1, |
238 | RANDOM_ENTROPY_COUNT=2, | 239 | RANDOM_ENTROPY_COUNT=2, |
239 | RANDOM_READ_THRESH=3, | 240 | RANDOM_READ_THRESH=3, |
240 | RANDOM_WRITE_THRESH=4, | 241 | RANDOM_WRITE_THRESH=4, |
241 | RANDOM_BOOT_ID=5, | 242 | RANDOM_BOOT_ID=5, |
242 | RANDOM_UUID=6 | 243 | RANDOM_UUID=6 |
243 | }; | 244 | }; |
244 | 245 | ||
245 | /* /proc/sys/kernel/pty */ | 246 | /* /proc/sys/kernel/pty */ |
246 | enum | 247 | enum |
247 | { | 248 | { |
248 | PTY_MAX=1, | 249 | PTY_MAX=1, |
249 | PTY_NR=2 | 250 | PTY_NR=2 |
250 | }; | 251 | }; |
251 | 252 | ||
252 | /* /proc/sys/bus/isa */ | 253 | /* /proc/sys/bus/isa */ |
253 | enum | 254 | enum |
254 | { | 255 | { |
255 | BUS_ISA_MEM_BASE=1, | 256 | BUS_ISA_MEM_BASE=1, |
256 | BUS_ISA_PORT_BASE=2, | 257 | BUS_ISA_PORT_BASE=2, |
257 | BUS_ISA_PORT_SHIFT=3 | 258 | BUS_ISA_PORT_SHIFT=3 |
258 | }; | 259 | }; |
259 | 260 | ||
260 | /* /proc/sys/net/core */ | 261 | /* /proc/sys/net/core */ |
261 | enum | 262 | enum |
262 | { | 263 | { |
263 | NET_CORE_WMEM_MAX=1, | 264 | NET_CORE_WMEM_MAX=1, |
264 | NET_CORE_RMEM_MAX=2, | 265 | NET_CORE_RMEM_MAX=2, |
265 | NET_CORE_WMEM_DEFAULT=3, | 266 | NET_CORE_WMEM_DEFAULT=3, |
266 | NET_CORE_RMEM_DEFAULT=4, | 267 | NET_CORE_RMEM_DEFAULT=4, |
267 | /* was NET_CORE_DESTROY_DELAY */ | 268 | /* was NET_CORE_DESTROY_DELAY */ |
268 | NET_CORE_MAX_BACKLOG=6, | 269 | NET_CORE_MAX_BACKLOG=6, |
269 | NET_CORE_FASTROUTE=7, | 270 | NET_CORE_FASTROUTE=7, |
270 | NET_CORE_MSG_COST=8, | 271 | NET_CORE_MSG_COST=8, |
271 | NET_CORE_MSG_BURST=9, | 272 | NET_CORE_MSG_BURST=9, |
272 | NET_CORE_OPTMEM_MAX=10, | 273 | NET_CORE_OPTMEM_MAX=10, |
273 | NET_CORE_HOT_LIST_LENGTH=11, | 274 | NET_CORE_HOT_LIST_LENGTH=11, |
274 | NET_CORE_DIVERT_VERSION=12, | 275 | NET_CORE_DIVERT_VERSION=12, |
275 | NET_CORE_NO_CONG_THRESH=13, | 276 | NET_CORE_NO_CONG_THRESH=13, |
276 | NET_CORE_NO_CONG=14, | 277 | NET_CORE_NO_CONG=14, |
277 | NET_CORE_LO_CONG=15, | 278 | NET_CORE_LO_CONG=15, |
278 | NET_CORE_MOD_CONG=16, | 279 | NET_CORE_MOD_CONG=16, |
279 | NET_CORE_DEV_WEIGHT=17, | 280 | NET_CORE_DEV_WEIGHT=17, |
280 | NET_CORE_SOMAXCONN=18, | 281 | NET_CORE_SOMAXCONN=18, |
281 | NET_CORE_BUDGET=19, | 282 | NET_CORE_BUDGET=19, |
282 | NET_CORE_AEVENT_ETIME=20, | 283 | NET_CORE_AEVENT_ETIME=20, |
283 | NET_CORE_AEVENT_RSEQTH=21, | 284 | NET_CORE_AEVENT_RSEQTH=21, |
284 | }; | 285 | }; |
285 | 286 | ||
286 | /* /proc/sys/net/ethernet */ | 287 | /* /proc/sys/net/ethernet */ |
287 | 288 | ||
288 | /* /proc/sys/net/802 */ | 289 | /* /proc/sys/net/802 */ |
289 | 290 | ||
290 | /* /proc/sys/net/unix */ | 291 | /* /proc/sys/net/unix */ |
291 | 292 | ||
292 | enum | 293 | enum |
293 | { | 294 | { |
294 | NET_UNIX_DESTROY_DELAY=1, | 295 | NET_UNIX_DESTROY_DELAY=1, |
295 | NET_UNIX_DELETE_DELAY=2, | 296 | NET_UNIX_DELETE_DELAY=2, |
296 | NET_UNIX_MAX_DGRAM_QLEN=3, | 297 | NET_UNIX_MAX_DGRAM_QLEN=3, |
297 | }; | 298 | }; |
298 | 299 | ||
299 | /* /proc/sys/net/netfilter */ | 300 | /* /proc/sys/net/netfilter */ |
300 | enum | 301 | enum |
301 | { | 302 | { |
302 | NET_NF_CONNTRACK_MAX=1, | 303 | NET_NF_CONNTRACK_MAX=1, |
303 | NET_NF_CONNTRACK_TCP_TIMEOUT_SYN_SENT=2, | 304 | NET_NF_CONNTRACK_TCP_TIMEOUT_SYN_SENT=2, |
304 | NET_NF_CONNTRACK_TCP_TIMEOUT_SYN_RECV=3, | 305 | NET_NF_CONNTRACK_TCP_TIMEOUT_SYN_RECV=3, |
305 | NET_NF_CONNTRACK_TCP_TIMEOUT_ESTABLISHED=4, | 306 | NET_NF_CONNTRACK_TCP_TIMEOUT_ESTABLISHED=4, |
306 | NET_NF_CONNTRACK_TCP_TIMEOUT_FIN_WAIT=5, | 307 | NET_NF_CONNTRACK_TCP_TIMEOUT_FIN_WAIT=5, |
307 | NET_NF_CONNTRACK_TCP_TIMEOUT_CLOSE_WAIT=6, | 308 | NET_NF_CONNTRACK_TCP_TIMEOUT_CLOSE_WAIT=6, |
308 | NET_NF_CONNTRACK_TCP_TIMEOUT_LAST_ACK=7, | 309 | NET_NF_CONNTRACK_TCP_TIMEOUT_LAST_ACK=7, |
309 | NET_NF_CONNTRACK_TCP_TIMEOUT_TIME_WAIT=8, | 310 | NET_NF_CONNTRACK_TCP_TIMEOUT_TIME_WAIT=8, |
310 | NET_NF_CONNTRACK_TCP_TIMEOUT_CLOSE=9, | 311 | NET_NF_CONNTRACK_TCP_TIMEOUT_CLOSE=9, |
311 | NET_NF_CONNTRACK_UDP_TIMEOUT=10, | 312 | NET_NF_CONNTRACK_UDP_TIMEOUT=10, |
312 | NET_NF_CONNTRACK_UDP_TIMEOUT_STREAM=11, | 313 | NET_NF_CONNTRACK_UDP_TIMEOUT_STREAM=11, |
313 | NET_NF_CONNTRACK_ICMP_TIMEOUT=12, | 314 | NET_NF_CONNTRACK_ICMP_TIMEOUT=12, |
314 | NET_NF_CONNTRACK_GENERIC_TIMEOUT=13, | 315 | NET_NF_CONNTRACK_GENERIC_TIMEOUT=13, |
315 | NET_NF_CONNTRACK_BUCKETS=14, | 316 | NET_NF_CONNTRACK_BUCKETS=14, |
316 | NET_NF_CONNTRACK_LOG_INVALID=15, | 317 | NET_NF_CONNTRACK_LOG_INVALID=15, |
317 | NET_NF_CONNTRACK_TCP_TIMEOUT_MAX_RETRANS=16, | 318 | NET_NF_CONNTRACK_TCP_TIMEOUT_MAX_RETRANS=16, |
318 | NET_NF_CONNTRACK_TCP_LOOSE=17, | 319 | NET_NF_CONNTRACK_TCP_LOOSE=17, |
319 | NET_NF_CONNTRACK_TCP_BE_LIBERAL=18, | 320 | NET_NF_CONNTRACK_TCP_BE_LIBERAL=18, |
320 | NET_NF_CONNTRACK_TCP_MAX_RETRANS=19, | 321 | NET_NF_CONNTRACK_TCP_MAX_RETRANS=19, |
321 | NET_NF_CONNTRACK_SCTP_TIMEOUT_CLOSED=20, | 322 | NET_NF_CONNTRACK_SCTP_TIMEOUT_CLOSED=20, |
322 | NET_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_WAIT=21, | 323 | NET_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_WAIT=21, |
323 | NET_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_ECHOED=22, | 324 | NET_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_ECHOED=22, |
324 | NET_NF_CONNTRACK_SCTP_TIMEOUT_ESTABLISHED=23, | 325 | NET_NF_CONNTRACK_SCTP_TIMEOUT_ESTABLISHED=23, |
325 | NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_SENT=24, | 326 | NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_SENT=24, |
326 | NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_RECD=25, | 327 | NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_RECD=25, |
327 | NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_ACK_SENT=26, | 328 | NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_ACK_SENT=26, |
328 | NET_NF_CONNTRACK_COUNT=27, | 329 | NET_NF_CONNTRACK_COUNT=27, |
329 | NET_NF_CONNTRACK_ICMPV6_TIMEOUT=28, | 330 | NET_NF_CONNTRACK_ICMPV6_TIMEOUT=28, |
330 | NET_NF_CONNTRACK_FRAG6_TIMEOUT=29, | 331 | NET_NF_CONNTRACK_FRAG6_TIMEOUT=29, |
331 | NET_NF_CONNTRACK_FRAG6_LOW_THRESH=30, | 332 | NET_NF_CONNTRACK_FRAG6_LOW_THRESH=30, |
332 | NET_NF_CONNTRACK_FRAG6_HIGH_THRESH=31, | 333 | NET_NF_CONNTRACK_FRAG6_HIGH_THRESH=31, |
333 | NET_NF_CONNTRACK_CHECKSUM=32, | 334 | NET_NF_CONNTRACK_CHECKSUM=32, |
334 | }; | 335 | }; |
335 | 336 | ||
336 | /* /proc/sys/net/ipv4 */ | 337 | /* /proc/sys/net/ipv4 */ |
337 | enum | 338 | enum |
338 | { | 339 | { |
339 | /* v2.0 compatibile variables */ | 340 | /* v2.0 compatibile variables */ |
340 | NET_IPV4_FORWARD=8, | 341 | NET_IPV4_FORWARD=8, |
341 | NET_IPV4_DYNADDR=9, | 342 | NET_IPV4_DYNADDR=9, |
342 | 343 | ||
343 | NET_IPV4_CONF=16, | 344 | NET_IPV4_CONF=16, |
344 | NET_IPV4_NEIGH=17, | 345 | NET_IPV4_NEIGH=17, |
345 | NET_IPV4_ROUTE=18, | 346 | NET_IPV4_ROUTE=18, |
346 | NET_IPV4_FIB_HASH=19, | 347 | NET_IPV4_FIB_HASH=19, |
347 | NET_IPV4_NETFILTER=20, | 348 | NET_IPV4_NETFILTER=20, |
348 | 349 | ||
349 | NET_IPV4_TCP_TIMESTAMPS=33, | 350 | NET_IPV4_TCP_TIMESTAMPS=33, |
350 | NET_IPV4_TCP_WINDOW_SCALING=34, | 351 | NET_IPV4_TCP_WINDOW_SCALING=34, |
351 | NET_IPV4_TCP_SACK=35, | 352 | NET_IPV4_TCP_SACK=35, |
352 | NET_IPV4_TCP_RETRANS_COLLAPSE=36, | 353 | NET_IPV4_TCP_RETRANS_COLLAPSE=36, |
353 | NET_IPV4_DEFAULT_TTL=37, | 354 | NET_IPV4_DEFAULT_TTL=37, |
354 | NET_IPV4_AUTOCONFIG=38, | 355 | NET_IPV4_AUTOCONFIG=38, |
355 | NET_IPV4_NO_PMTU_DISC=39, | 356 | NET_IPV4_NO_PMTU_DISC=39, |
356 | NET_IPV4_TCP_SYN_RETRIES=40, | 357 | NET_IPV4_TCP_SYN_RETRIES=40, |
357 | NET_IPV4_IPFRAG_HIGH_THRESH=41, | 358 | NET_IPV4_IPFRAG_HIGH_THRESH=41, |
358 | NET_IPV4_IPFRAG_LOW_THRESH=42, | 359 | NET_IPV4_IPFRAG_LOW_THRESH=42, |
359 | NET_IPV4_IPFRAG_TIME=43, | 360 | NET_IPV4_IPFRAG_TIME=43, |
360 | NET_IPV4_TCP_MAX_KA_PROBES=44, | 361 | NET_IPV4_TCP_MAX_KA_PROBES=44, |
361 | NET_IPV4_TCP_KEEPALIVE_TIME=45, | 362 | NET_IPV4_TCP_KEEPALIVE_TIME=45, |
362 | NET_IPV4_TCP_KEEPALIVE_PROBES=46, | 363 | NET_IPV4_TCP_KEEPALIVE_PROBES=46, |
363 | NET_IPV4_TCP_RETRIES1=47, | 364 | NET_IPV4_TCP_RETRIES1=47, |
364 | NET_IPV4_TCP_RETRIES2=48, | 365 | NET_IPV4_TCP_RETRIES2=48, |
365 | NET_IPV4_TCP_FIN_TIMEOUT=49, | 366 | NET_IPV4_TCP_FIN_TIMEOUT=49, |
366 | NET_IPV4_IP_MASQ_DEBUG=50, | 367 | NET_IPV4_IP_MASQ_DEBUG=50, |
367 | NET_TCP_SYNCOOKIES=51, | 368 | NET_TCP_SYNCOOKIES=51, |
368 | NET_TCP_STDURG=52, | 369 | NET_TCP_STDURG=52, |
369 | NET_TCP_RFC1337=53, | 370 | NET_TCP_RFC1337=53, |
370 | NET_TCP_SYN_TAILDROP=54, | 371 | NET_TCP_SYN_TAILDROP=54, |
371 | NET_TCP_MAX_SYN_BACKLOG=55, | 372 | NET_TCP_MAX_SYN_BACKLOG=55, |
372 | NET_IPV4_LOCAL_PORT_RANGE=56, | 373 | NET_IPV4_LOCAL_PORT_RANGE=56, |
373 | NET_IPV4_ICMP_ECHO_IGNORE_ALL=57, | 374 | NET_IPV4_ICMP_ECHO_IGNORE_ALL=57, |
374 | NET_IPV4_ICMP_ECHO_IGNORE_BROADCASTS=58, | 375 | NET_IPV4_ICMP_ECHO_IGNORE_BROADCASTS=58, |
375 | NET_IPV4_ICMP_SOURCEQUENCH_RATE=59, | 376 | NET_IPV4_ICMP_SOURCEQUENCH_RATE=59, |
376 | NET_IPV4_ICMP_DESTUNREACH_RATE=60, | 377 | NET_IPV4_ICMP_DESTUNREACH_RATE=60, |
377 | NET_IPV4_ICMP_TIMEEXCEED_RATE=61, | 378 | NET_IPV4_ICMP_TIMEEXCEED_RATE=61, |
378 | NET_IPV4_ICMP_PARAMPROB_RATE=62, | 379 | NET_IPV4_ICMP_PARAMPROB_RATE=62, |
379 | NET_IPV4_ICMP_ECHOREPLY_RATE=63, | 380 | NET_IPV4_ICMP_ECHOREPLY_RATE=63, |
380 | NET_IPV4_ICMP_IGNORE_BOGUS_ERROR_RESPONSES=64, | 381 | NET_IPV4_ICMP_IGNORE_BOGUS_ERROR_RESPONSES=64, |
381 | NET_IPV4_IGMP_MAX_MEMBERSHIPS=65, | 382 | NET_IPV4_IGMP_MAX_MEMBERSHIPS=65, |
382 | NET_TCP_TW_RECYCLE=66, | 383 | NET_TCP_TW_RECYCLE=66, |
383 | NET_IPV4_ALWAYS_DEFRAG=67, | 384 | NET_IPV4_ALWAYS_DEFRAG=67, |
384 | NET_IPV4_TCP_KEEPALIVE_INTVL=68, | 385 | NET_IPV4_TCP_KEEPALIVE_INTVL=68, |
385 | NET_IPV4_INET_PEER_THRESHOLD=69, | 386 | NET_IPV4_INET_PEER_THRESHOLD=69, |
386 | NET_IPV4_INET_PEER_MINTTL=70, | 387 | NET_IPV4_INET_PEER_MINTTL=70, |
387 | NET_IPV4_INET_PEER_MAXTTL=71, | 388 | NET_IPV4_INET_PEER_MAXTTL=71, |
388 | NET_IPV4_INET_PEER_GC_MINTIME=72, | 389 | NET_IPV4_INET_PEER_GC_MINTIME=72, |
389 | NET_IPV4_INET_PEER_GC_MAXTIME=73, | 390 | NET_IPV4_INET_PEER_GC_MAXTIME=73, |
390 | NET_TCP_ORPHAN_RETRIES=74, | 391 | NET_TCP_ORPHAN_RETRIES=74, |
391 | NET_TCP_ABORT_ON_OVERFLOW=75, | 392 | NET_TCP_ABORT_ON_OVERFLOW=75, |
392 | NET_TCP_SYNACK_RETRIES=76, | 393 | NET_TCP_SYNACK_RETRIES=76, |
393 | NET_TCP_MAX_ORPHANS=77, | 394 | NET_TCP_MAX_ORPHANS=77, |
394 | NET_TCP_MAX_TW_BUCKETS=78, | 395 | NET_TCP_MAX_TW_BUCKETS=78, |
395 | NET_TCP_FACK=79, | 396 | NET_TCP_FACK=79, |
396 | NET_TCP_REORDERING=80, | 397 | NET_TCP_REORDERING=80, |
397 | NET_TCP_ECN=81, | 398 | NET_TCP_ECN=81, |
398 | NET_TCP_DSACK=82, | 399 | NET_TCP_DSACK=82, |
399 | NET_TCP_MEM=83, | 400 | NET_TCP_MEM=83, |
400 | NET_TCP_WMEM=84, | 401 | NET_TCP_WMEM=84, |
401 | NET_TCP_RMEM=85, | 402 | NET_TCP_RMEM=85, |
402 | NET_TCP_APP_WIN=86, | 403 | NET_TCP_APP_WIN=86, |
403 | NET_TCP_ADV_WIN_SCALE=87, | 404 | NET_TCP_ADV_WIN_SCALE=87, |
404 | NET_IPV4_NONLOCAL_BIND=88, | 405 | NET_IPV4_NONLOCAL_BIND=88, |
405 | NET_IPV4_ICMP_RATELIMIT=89, | 406 | NET_IPV4_ICMP_RATELIMIT=89, |
406 | NET_IPV4_ICMP_RATEMASK=90, | 407 | NET_IPV4_ICMP_RATEMASK=90, |
407 | NET_TCP_TW_REUSE=91, | 408 | NET_TCP_TW_REUSE=91, |
408 | NET_TCP_FRTO=92, | 409 | NET_TCP_FRTO=92, |
409 | NET_TCP_LOW_LATENCY=93, | 410 | NET_TCP_LOW_LATENCY=93, |
410 | NET_IPV4_IPFRAG_SECRET_INTERVAL=94, | 411 | NET_IPV4_IPFRAG_SECRET_INTERVAL=94, |
411 | NET_IPV4_IGMP_MAX_MSF=96, | 412 | NET_IPV4_IGMP_MAX_MSF=96, |
412 | NET_TCP_NO_METRICS_SAVE=97, | 413 | NET_TCP_NO_METRICS_SAVE=97, |
413 | NET_TCP_DEFAULT_WIN_SCALE=105, | 414 | NET_TCP_DEFAULT_WIN_SCALE=105, |
414 | NET_TCP_MODERATE_RCVBUF=106, | 415 | NET_TCP_MODERATE_RCVBUF=106, |
415 | NET_TCP_TSO_WIN_DIVISOR=107, | 416 | NET_TCP_TSO_WIN_DIVISOR=107, |
416 | NET_TCP_BIC_BETA=108, | 417 | NET_TCP_BIC_BETA=108, |
417 | NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR=109, | 418 | NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR=109, |
418 | NET_TCP_CONG_CONTROL=110, | 419 | NET_TCP_CONG_CONTROL=110, |
419 | NET_TCP_ABC=111, | 420 | NET_TCP_ABC=111, |
420 | NET_IPV4_IPFRAG_MAX_DIST=112, | 421 | NET_IPV4_IPFRAG_MAX_DIST=112, |
421 | NET_TCP_MTU_PROBING=113, | 422 | NET_TCP_MTU_PROBING=113, |
422 | NET_TCP_BASE_MSS=114, | 423 | NET_TCP_BASE_MSS=114, |
423 | NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS=115, | 424 | NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS=115, |
424 | NET_TCP_DMA_COPYBREAK=116, | 425 | NET_TCP_DMA_COPYBREAK=116, |
425 | NET_TCP_SLOW_START_AFTER_IDLE=117, | 426 | NET_TCP_SLOW_START_AFTER_IDLE=117, |
426 | NET_CIPSOV4_CACHE_ENABLE=118, | 427 | NET_CIPSOV4_CACHE_ENABLE=118, |
427 | NET_CIPSOV4_CACHE_BUCKET_SIZE=119, | 428 | NET_CIPSOV4_CACHE_BUCKET_SIZE=119, |
428 | NET_CIPSOV4_RBM_OPTFMT=120, | 429 | NET_CIPSOV4_RBM_OPTFMT=120, |
429 | NET_CIPSOV4_RBM_STRICTVALID=121, | 430 | NET_CIPSOV4_RBM_STRICTVALID=121, |
430 | NET_TCP_AVAIL_CONG_CONTROL=122, | 431 | NET_TCP_AVAIL_CONG_CONTROL=122, |
431 | NET_TCP_ALLOWED_CONG_CONTROL=123, | 432 | NET_TCP_ALLOWED_CONG_CONTROL=123, |
432 | }; | 433 | }; |
433 | 434 | ||
434 | enum { | 435 | enum { |
435 | NET_IPV4_ROUTE_FLUSH=1, | 436 | NET_IPV4_ROUTE_FLUSH=1, |
436 | NET_IPV4_ROUTE_MIN_DELAY=2, | 437 | NET_IPV4_ROUTE_MIN_DELAY=2, |
437 | NET_IPV4_ROUTE_MAX_DELAY=3, | 438 | NET_IPV4_ROUTE_MAX_DELAY=3, |
438 | NET_IPV4_ROUTE_GC_THRESH=4, | 439 | NET_IPV4_ROUTE_GC_THRESH=4, |
439 | NET_IPV4_ROUTE_MAX_SIZE=5, | 440 | NET_IPV4_ROUTE_MAX_SIZE=5, |
440 | NET_IPV4_ROUTE_GC_MIN_INTERVAL=6, | 441 | NET_IPV4_ROUTE_GC_MIN_INTERVAL=6, |
441 | NET_IPV4_ROUTE_GC_TIMEOUT=7, | 442 | NET_IPV4_ROUTE_GC_TIMEOUT=7, |
442 | NET_IPV4_ROUTE_GC_INTERVAL=8, | 443 | NET_IPV4_ROUTE_GC_INTERVAL=8, |
443 | NET_IPV4_ROUTE_REDIRECT_LOAD=9, | 444 | NET_IPV4_ROUTE_REDIRECT_LOAD=9, |
444 | NET_IPV4_ROUTE_REDIRECT_NUMBER=10, | 445 | NET_IPV4_ROUTE_REDIRECT_NUMBER=10, |
445 | NET_IPV4_ROUTE_REDIRECT_SILENCE=11, | 446 | NET_IPV4_ROUTE_REDIRECT_SILENCE=11, |
446 | NET_IPV4_ROUTE_ERROR_COST=12, | 447 | NET_IPV4_ROUTE_ERROR_COST=12, |
447 | NET_IPV4_ROUTE_ERROR_BURST=13, | 448 | NET_IPV4_ROUTE_ERROR_BURST=13, |
448 | NET_IPV4_ROUTE_GC_ELASTICITY=14, | 449 | NET_IPV4_ROUTE_GC_ELASTICITY=14, |
449 | NET_IPV4_ROUTE_MTU_EXPIRES=15, | 450 | NET_IPV4_ROUTE_MTU_EXPIRES=15, |
450 | NET_IPV4_ROUTE_MIN_PMTU=16, | 451 | NET_IPV4_ROUTE_MIN_PMTU=16, |
451 | NET_IPV4_ROUTE_MIN_ADVMSS=17, | 452 | NET_IPV4_ROUTE_MIN_ADVMSS=17, |
452 | NET_IPV4_ROUTE_SECRET_INTERVAL=18, | 453 | NET_IPV4_ROUTE_SECRET_INTERVAL=18, |
453 | NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS=19, | 454 | NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS=19, |
454 | }; | 455 | }; |
455 | 456 | ||
456 | enum | 457 | enum |
457 | { | 458 | { |
458 | NET_PROTO_CONF_ALL=-2, | 459 | NET_PROTO_CONF_ALL=-2, |
459 | NET_PROTO_CONF_DEFAULT=-3 | 460 | NET_PROTO_CONF_DEFAULT=-3 |
460 | 461 | ||
461 | /* And device ifindices ... */ | 462 | /* And device ifindices ... */ |
462 | }; | 463 | }; |
463 | 464 | ||
464 | enum | 465 | enum |
465 | { | 466 | { |
466 | NET_IPV4_CONF_FORWARDING=1, | 467 | NET_IPV4_CONF_FORWARDING=1, |
467 | NET_IPV4_CONF_MC_FORWARDING=2, | 468 | NET_IPV4_CONF_MC_FORWARDING=2, |
468 | NET_IPV4_CONF_PROXY_ARP=3, | 469 | NET_IPV4_CONF_PROXY_ARP=3, |
469 | NET_IPV4_CONF_ACCEPT_REDIRECTS=4, | 470 | NET_IPV4_CONF_ACCEPT_REDIRECTS=4, |
470 | NET_IPV4_CONF_SECURE_REDIRECTS=5, | 471 | NET_IPV4_CONF_SECURE_REDIRECTS=5, |
471 | NET_IPV4_CONF_SEND_REDIRECTS=6, | 472 | NET_IPV4_CONF_SEND_REDIRECTS=6, |
472 | NET_IPV4_CONF_SHARED_MEDIA=7, | 473 | NET_IPV4_CONF_SHARED_MEDIA=7, |
473 | NET_IPV4_CONF_RP_FILTER=8, | 474 | NET_IPV4_CONF_RP_FILTER=8, |
474 | NET_IPV4_CONF_ACCEPT_SOURCE_ROUTE=9, | 475 | NET_IPV4_CONF_ACCEPT_SOURCE_ROUTE=9, |
475 | NET_IPV4_CONF_BOOTP_RELAY=10, | 476 | NET_IPV4_CONF_BOOTP_RELAY=10, |
476 | NET_IPV4_CONF_LOG_MARTIANS=11, | 477 | NET_IPV4_CONF_LOG_MARTIANS=11, |
477 | NET_IPV4_CONF_TAG=12, | 478 | NET_IPV4_CONF_TAG=12, |
478 | NET_IPV4_CONF_ARPFILTER=13, | 479 | NET_IPV4_CONF_ARPFILTER=13, |
479 | NET_IPV4_CONF_MEDIUM_ID=14, | 480 | NET_IPV4_CONF_MEDIUM_ID=14, |
480 | NET_IPV4_CONF_NOXFRM=15, | 481 | NET_IPV4_CONF_NOXFRM=15, |
481 | NET_IPV4_CONF_NOPOLICY=16, | 482 | NET_IPV4_CONF_NOPOLICY=16, |
482 | NET_IPV4_CONF_FORCE_IGMP_VERSION=17, | 483 | NET_IPV4_CONF_FORCE_IGMP_VERSION=17, |
483 | NET_IPV4_CONF_ARP_ANNOUNCE=18, | 484 | NET_IPV4_CONF_ARP_ANNOUNCE=18, |
484 | NET_IPV4_CONF_ARP_IGNORE=19, | 485 | NET_IPV4_CONF_ARP_IGNORE=19, |
485 | NET_IPV4_CONF_PROMOTE_SECONDARIES=20, | 486 | NET_IPV4_CONF_PROMOTE_SECONDARIES=20, |
486 | NET_IPV4_CONF_ARP_ACCEPT=21, | 487 | NET_IPV4_CONF_ARP_ACCEPT=21, |
487 | __NET_IPV4_CONF_MAX | 488 | __NET_IPV4_CONF_MAX |
488 | }; | 489 | }; |
489 | 490 | ||
490 | /* /proc/sys/net/ipv4/netfilter */ | 491 | /* /proc/sys/net/ipv4/netfilter */ |
491 | enum | 492 | enum |
492 | { | 493 | { |
493 | NET_IPV4_NF_CONNTRACK_MAX=1, | 494 | NET_IPV4_NF_CONNTRACK_MAX=1, |
494 | NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_SYN_SENT=2, | 495 | NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_SYN_SENT=2, |
495 | NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_SYN_RECV=3, | 496 | NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_SYN_RECV=3, |
496 | NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_ESTABLISHED=4, | 497 | NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_ESTABLISHED=4, |
497 | NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_FIN_WAIT=5, | 498 | NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_FIN_WAIT=5, |
498 | NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_CLOSE_WAIT=6, | 499 | NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_CLOSE_WAIT=6, |
499 | NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_LAST_ACK=7, | 500 | NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_LAST_ACK=7, |
500 | NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_TIME_WAIT=8, | 501 | NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_TIME_WAIT=8, |
501 | NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_CLOSE=9, | 502 | NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_CLOSE=9, |
502 | NET_IPV4_NF_CONNTRACK_UDP_TIMEOUT=10, | 503 | NET_IPV4_NF_CONNTRACK_UDP_TIMEOUT=10, |
503 | NET_IPV4_NF_CONNTRACK_UDP_TIMEOUT_STREAM=11, | 504 | NET_IPV4_NF_CONNTRACK_UDP_TIMEOUT_STREAM=11, |
504 | NET_IPV4_NF_CONNTRACK_ICMP_TIMEOUT=12, | 505 | NET_IPV4_NF_CONNTRACK_ICMP_TIMEOUT=12, |
505 | NET_IPV4_NF_CONNTRACK_GENERIC_TIMEOUT=13, | 506 | NET_IPV4_NF_CONNTRACK_GENERIC_TIMEOUT=13, |
506 | NET_IPV4_NF_CONNTRACK_BUCKETS=14, | 507 | NET_IPV4_NF_CONNTRACK_BUCKETS=14, |
507 | NET_IPV4_NF_CONNTRACK_LOG_INVALID=15, | 508 | NET_IPV4_NF_CONNTRACK_LOG_INVALID=15, |
508 | NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_MAX_RETRANS=16, | 509 | NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_MAX_RETRANS=16, |
509 | NET_IPV4_NF_CONNTRACK_TCP_LOOSE=17, | 510 | NET_IPV4_NF_CONNTRACK_TCP_LOOSE=17, |
510 | NET_IPV4_NF_CONNTRACK_TCP_BE_LIBERAL=18, | 511 | NET_IPV4_NF_CONNTRACK_TCP_BE_LIBERAL=18, |
511 | NET_IPV4_NF_CONNTRACK_TCP_MAX_RETRANS=19, | 512 | NET_IPV4_NF_CONNTRACK_TCP_MAX_RETRANS=19, |
512 | NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_CLOSED=20, | 513 | NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_CLOSED=20, |
513 | NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_WAIT=21, | 514 | NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_WAIT=21, |
514 | NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_ECHOED=22, | 515 | NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_ECHOED=22, |
515 | NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_ESTABLISHED=23, | 516 | NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_ESTABLISHED=23, |
516 | NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_SENT=24, | 517 | NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_SENT=24, |
517 | NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_RECD=25, | 518 | NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_RECD=25, |
518 | NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_ACK_SENT=26, | 519 | NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_ACK_SENT=26, |
519 | NET_IPV4_NF_CONNTRACK_COUNT=27, | 520 | NET_IPV4_NF_CONNTRACK_COUNT=27, |
520 | NET_IPV4_NF_CONNTRACK_CHECKSUM=28, | 521 | NET_IPV4_NF_CONNTRACK_CHECKSUM=28, |
521 | }; | 522 | }; |
522 | 523 | ||
523 | /* /proc/sys/net/ipv6 */ | 524 | /* /proc/sys/net/ipv6 */ |
524 | enum { | 525 | enum { |
525 | NET_IPV6_CONF=16, | 526 | NET_IPV6_CONF=16, |
526 | NET_IPV6_NEIGH=17, | 527 | NET_IPV6_NEIGH=17, |
527 | NET_IPV6_ROUTE=18, | 528 | NET_IPV6_ROUTE=18, |
528 | NET_IPV6_ICMP=19, | 529 | NET_IPV6_ICMP=19, |
529 | NET_IPV6_BINDV6ONLY=20, | 530 | NET_IPV6_BINDV6ONLY=20, |
530 | NET_IPV6_IP6FRAG_HIGH_THRESH=21, | 531 | NET_IPV6_IP6FRAG_HIGH_THRESH=21, |
531 | NET_IPV6_IP6FRAG_LOW_THRESH=22, | 532 | NET_IPV6_IP6FRAG_LOW_THRESH=22, |
532 | NET_IPV6_IP6FRAG_TIME=23, | 533 | NET_IPV6_IP6FRAG_TIME=23, |
533 | NET_IPV6_IP6FRAG_SECRET_INTERVAL=24, | 534 | NET_IPV6_IP6FRAG_SECRET_INTERVAL=24, |
534 | NET_IPV6_MLD_MAX_MSF=25, | 535 | NET_IPV6_MLD_MAX_MSF=25, |
535 | }; | 536 | }; |
536 | 537 | ||
537 | enum { | 538 | enum { |
538 | NET_IPV6_ROUTE_FLUSH=1, | 539 | NET_IPV6_ROUTE_FLUSH=1, |
539 | NET_IPV6_ROUTE_GC_THRESH=2, | 540 | NET_IPV6_ROUTE_GC_THRESH=2, |
540 | NET_IPV6_ROUTE_MAX_SIZE=3, | 541 | NET_IPV6_ROUTE_MAX_SIZE=3, |
541 | NET_IPV6_ROUTE_GC_MIN_INTERVAL=4, | 542 | NET_IPV6_ROUTE_GC_MIN_INTERVAL=4, |
542 | NET_IPV6_ROUTE_GC_TIMEOUT=5, | 543 | NET_IPV6_ROUTE_GC_TIMEOUT=5, |
543 | NET_IPV6_ROUTE_GC_INTERVAL=6, | 544 | NET_IPV6_ROUTE_GC_INTERVAL=6, |
544 | NET_IPV6_ROUTE_GC_ELASTICITY=7, | 545 | NET_IPV6_ROUTE_GC_ELASTICITY=7, |
545 | NET_IPV6_ROUTE_MTU_EXPIRES=8, | 546 | NET_IPV6_ROUTE_MTU_EXPIRES=8, |
546 | NET_IPV6_ROUTE_MIN_ADVMSS=9, | 547 | NET_IPV6_ROUTE_MIN_ADVMSS=9, |
547 | NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS=10 | 548 | NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS=10 |
548 | }; | 549 | }; |
549 | 550 | ||
550 | enum { | 551 | enum { |
551 | NET_IPV6_FORWARDING=1, | 552 | NET_IPV6_FORWARDING=1, |
552 | NET_IPV6_HOP_LIMIT=2, | 553 | NET_IPV6_HOP_LIMIT=2, |
553 | NET_IPV6_MTU=3, | 554 | NET_IPV6_MTU=3, |
554 | NET_IPV6_ACCEPT_RA=4, | 555 | NET_IPV6_ACCEPT_RA=4, |
555 | NET_IPV6_ACCEPT_REDIRECTS=5, | 556 | NET_IPV6_ACCEPT_REDIRECTS=5, |
556 | NET_IPV6_AUTOCONF=6, | 557 | NET_IPV6_AUTOCONF=6, |
557 | NET_IPV6_DAD_TRANSMITS=7, | 558 | NET_IPV6_DAD_TRANSMITS=7, |
558 | NET_IPV6_RTR_SOLICITS=8, | 559 | NET_IPV6_RTR_SOLICITS=8, |
559 | NET_IPV6_RTR_SOLICIT_INTERVAL=9, | 560 | NET_IPV6_RTR_SOLICIT_INTERVAL=9, |
560 | NET_IPV6_RTR_SOLICIT_DELAY=10, | 561 | NET_IPV6_RTR_SOLICIT_DELAY=10, |
561 | NET_IPV6_USE_TEMPADDR=11, | 562 | NET_IPV6_USE_TEMPADDR=11, |
562 | NET_IPV6_TEMP_VALID_LFT=12, | 563 | NET_IPV6_TEMP_VALID_LFT=12, |
563 | NET_IPV6_TEMP_PREFERED_LFT=13, | 564 | NET_IPV6_TEMP_PREFERED_LFT=13, |
564 | NET_IPV6_REGEN_MAX_RETRY=14, | 565 | NET_IPV6_REGEN_MAX_RETRY=14, |
565 | NET_IPV6_MAX_DESYNC_FACTOR=15, | 566 | NET_IPV6_MAX_DESYNC_FACTOR=15, |
566 | NET_IPV6_MAX_ADDRESSES=16, | 567 | NET_IPV6_MAX_ADDRESSES=16, |
567 | NET_IPV6_FORCE_MLD_VERSION=17, | 568 | NET_IPV6_FORCE_MLD_VERSION=17, |
568 | NET_IPV6_ACCEPT_RA_DEFRTR=18, | 569 | NET_IPV6_ACCEPT_RA_DEFRTR=18, |
569 | NET_IPV6_ACCEPT_RA_PINFO=19, | 570 | NET_IPV6_ACCEPT_RA_PINFO=19, |
570 | NET_IPV6_ACCEPT_RA_RTR_PREF=20, | 571 | NET_IPV6_ACCEPT_RA_RTR_PREF=20, |
571 | NET_IPV6_RTR_PROBE_INTERVAL=21, | 572 | NET_IPV6_RTR_PROBE_INTERVAL=21, |
572 | NET_IPV6_ACCEPT_RA_RT_INFO_MAX_PLEN=22, | 573 | NET_IPV6_ACCEPT_RA_RT_INFO_MAX_PLEN=22, |
573 | NET_IPV6_PROXY_NDP=23, | 574 | NET_IPV6_PROXY_NDP=23, |
574 | __NET_IPV6_MAX | 575 | __NET_IPV6_MAX |
575 | }; | 576 | }; |
576 | 577 | ||
577 | /* /proc/sys/net/ipv6/icmp */ | 578 | /* /proc/sys/net/ipv6/icmp */ |
578 | enum { | 579 | enum { |
579 | NET_IPV6_ICMP_RATELIMIT=1 | 580 | NET_IPV6_ICMP_RATELIMIT=1 |
580 | }; | 581 | }; |
581 | 582 | ||
582 | /* /proc/sys/net/<protocol>/neigh/<dev> */ | 583 | /* /proc/sys/net/<protocol>/neigh/<dev> */ |
583 | enum { | 584 | enum { |
584 | NET_NEIGH_MCAST_SOLICIT=1, | 585 | NET_NEIGH_MCAST_SOLICIT=1, |
585 | NET_NEIGH_UCAST_SOLICIT=2, | 586 | NET_NEIGH_UCAST_SOLICIT=2, |
586 | NET_NEIGH_APP_SOLICIT=3, | 587 | NET_NEIGH_APP_SOLICIT=3, |
587 | NET_NEIGH_RETRANS_TIME=4, | 588 | NET_NEIGH_RETRANS_TIME=4, |
588 | NET_NEIGH_REACHABLE_TIME=5, | 589 | NET_NEIGH_REACHABLE_TIME=5, |
589 | NET_NEIGH_DELAY_PROBE_TIME=6, | 590 | NET_NEIGH_DELAY_PROBE_TIME=6, |
590 | NET_NEIGH_GC_STALE_TIME=7, | 591 | NET_NEIGH_GC_STALE_TIME=7, |
591 | NET_NEIGH_UNRES_QLEN=8, | 592 | NET_NEIGH_UNRES_QLEN=8, |
592 | NET_NEIGH_PROXY_QLEN=9, | 593 | NET_NEIGH_PROXY_QLEN=9, |
593 | NET_NEIGH_ANYCAST_DELAY=10, | 594 | NET_NEIGH_ANYCAST_DELAY=10, |
594 | NET_NEIGH_PROXY_DELAY=11, | 595 | NET_NEIGH_PROXY_DELAY=11, |
595 | NET_NEIGH_LOCKTIME=12, | 596 | NET_NEIGH_LOCKTIME=12, |
596 | NET_NEIGH_GC_INTERVAL=13, | 597 | NET_NEIGH_GC_INTERVAL=13, |
597 | NET_NEIGH_GC_THRESH1=14, | 598 | NET_NEIGH_GC_THRESH1=14, |
598 | NET_NEIGH_GC_THRESH2=15, | 599 | NET_NEIGH_GC_THRESH2=15, |
599 | NET_NEIGH_GC_THRESH3=16, | 600 | NET_NEIGH_GC_THRESH3=16, |
600 | NET_NEIGH_RETRANS_TIME_MS=17, | 601 | NET_NEIGH_RETRANS_TIME_MS=17, |
601 | NET_NEIGH_REACHABLE_TIME_MS=18, | 602 | NET_NEIGH_REACHABLE_TIME_MS=18, |
602 | __NET_NEIGH_MAX | 603 | __NET_NEIGH_MAX |
603 | }; | 604 | }; |
604 | 605 | ||
605 | /* /proc/sys/net/dccp */ | 606 | /* /proc/sys/net/dccp */ |
606 | enum { | 607 | enum { |
607 | NET_DCCP_DEFAULT=1, | 608 | NET_DCCP_DEFAULT=1, |
608 | }; | 609 | }; |
609 | 610 | ||
610 | /* /proc/sys/net/ipx */ | 611 | /* /proc/sys/net/ipx */ |
611 | enum { | 612 | enum { |
612 | NET_IPX_PPROP_BROADCASTING=1, | 613 | NET_IPX_PPROP_BROADCASTING=1, |
613 | NET_IPX_FORWARDING=2 | 614 | NET_IPX_FORWARDING=2 |
614 | }; | 615 | }; |
615 | 616 | ||
616 | /* /proc/sys/net/llc */ | 617 | /* /proc/sys/net/llc */ |
617 | enum { | 618 | enum { |
618 | NET_LLC2=1, | 619 | NET_LLC2=1, |
619 | NET_LLC_STATION=2, | 620 | NET_LLC_STATION=2, |
620 | }; | 621 | }; |
621 | 622 | ||
622 | /* /proc/sys/net/llc/llc2 */ | 623 | /* /proc/sys/net/llc/llc2 */ |
623 | enum { | 624 | enum { |
624 | NET_LLC2_TIMEOUT=1, | 625 | NET_LLC2_TIMEOUT=1, |
625 | }; | 626 | }; |
626 | 627 | ||
627 | /* /proc/sys/net/llc/station */ | 628 | /* /proc/sys/net/llc/station */ |
628 | enum { | 629 | enum { |
629 | NET_LLC_STATION_ACK_TIMEOUT=1, | 630 | NET_LLC_STATION_ACK_TIMEOUT=1, |
630 | }; | 631 | }; |
631 | 632 | ||
632 | /* /proc/sys/net/llc/llc2/timeout */ | 633 | /* /proc/sys/net/llc/llc2/timeout */ |
633 | enum { | 634 | enum { |
634 | NET_LLC2_ACK_TIMEOUT=1, | 635 | NET_LLC2_ACK_TIMEOUT=1, |
635 | NET_LLC2_P_TIMEOUT=2, | 636 | NET_LLC2_P_TIMEOUT=2, |
636 | NET_LLC2_REJ_TIMEOUT=3, | 637 | NET_LLC2_REJ_TIMEOUT=3, |
637 | NET_LLC2_BUSY_TIMEOUT=4, | 638 | NET_LLC2_BUSY_TIMEOUT=4, |
638 | }; | 639 | }; |
639 | 640 | ||
640 | /* /proc/sys/net/appletalk */ | 641 | /* /proc/sys/net/appletalk */ |
641 | enum { | 642 | enum { |
642 | NET_ATALK_AARP_EXPIRY_TIME=1, | 643 | NET_ATALK_AARP_EXPIRY_TIME=1, |
643 | NET_ATALK_AARP_TICK_TIME=2, | 644 | NET_ATALK_AARP_TICK_TIME=2, |
644 | NET_ATALK_AARP_RETRANSMIT_LIMIT=3, | 645 | NET_ATALK_AARP_RETRANSMIT_LIMIT=3, |
645 | NET_ATALK_AARP_RESOLVE_TIME=4 | 646 | NET_ATALK_AARP_RESOLVE_TIME=4 |
646 | }; | 647 | }; |
647 | 648 | ||
648 | 649 | ||
649 | /* /proc/sys/net/netrom */ | 650 | /* /proc/sys/net/netrom */ |
650 | enum { | 651 | enum { |
651 | NET_NETROM_DEFAULT_PATH_QUALITY=1, | 652 | NET_NETROM_DEFAULT_PATH_QUALITY=1, |
652 | NET_NETROM_OBSOLESCENCE_COUNT_INITIALISER=2, | 653 | NET_NETROM_OBSOLESCENCE_COUNT_INITIALISER=2, |
653 | NET_NETROM_NETWORK_TTL_INITIALISER=3, | 654 | NET_NETROM_NETWORK_TTL_INITIALISER=3, |
654 | NET_NETROM_TRANSPORT_TIMEOUT=4, | 655 | NET_NETROM_TRANSPORT_TIMEOUT=4, |
655 | NET_NETROM_TRANSPORT_MAXIMUM_TRIES=5, | 656 | NET_NETROM_TRANSPORT_MAXIMUM_TRIES=5, |
656 | NET_NETROM_TRANSPORT_ACKNOWLEDGE_DELAY=6, | 657 | NET_NETROM_TRANSPORT_ACKNOWLEDGE_DELAY=6, |
657 | NET_NETROM_TRANSPORT_BUSY_DELAY=7, | 658 | NET_NETROM_TRANSPORT_BUSY_DELAY=7, |
658 | NET_NETROM_TRANSPORT_REQUESTED_WINDOW_SIZE=8, | 659 | NET_NETROM_TRANSPORT_REQUESTED_WINDOW_SIZE=8, |
659 | NET_NETROM_TRANSPORT_NO_ACTIVITY_TIMEOUT=9, | 660 | NET_NETROM_TRANSPORT_NO_ACTIVITY_TIMEOUT=9, |
660 | NET_NETROM_ROUTING_CONTROL=10, | 661 | NET_NETROM_ROUTING_CONTROL=10, |
661 | NET_NETROM_LINK_FAILS_COUNT=11, | 662 | NET_NETROM_LINK_FAILS_COUNT=11, |
662 | NET_NETROM_RESET=12 | 663 | NET_NETROM_RESET=12 |
663 | }; | 664 | }; |
664 | 665 | ||
665 | /* /proc/sys/net/ax25 */ | 666 | /* /proc/sys/net/ax25 */ |
666 | enum { | 667 | enum { |
667 | NET_AX25_IP_DEFAULT_MODE=1, | 668 | NET_AX25_IP_DEFAULT_MODE=1, |
668 | NET_AX25_DEFAULT_MODE=2, | 669 | NET_AX25_DEFAULT_MODE=2, |
669 | NET_AX25_BACKOFF_TYPE=3, | 670 | NET_AX25_BACKOFF_TYPE=3, |
670 | NET_AX25_CONNECT_MODE=4, | 671 | NET_AX25_CONNECT_MODE=4, |
671 | NET_AX25_STANDARD_WINDOW=5, | 672 | NET_AX25_STANDARD_WINDOW=5, |
672 | NET_AX25_EXTENDED_WINDOW=6, | 673 | NET_AX25_EXTENDED_WINDOW=6, |
673 | NET_AX25_T1_TIMEOUT=7, | 674 | NET_AX25_T1_TIMEOUT=7, |
674 | NET_AX25_T2_TIMEOUT=8, | 675 | NET_AX25_T2_TIMEOUT=8, |
675 | NET_AX25_T3_TIMEOUT=9, | 676 | NET_AX25_T3_TIMEOUT=9, |
676 | NET_AX25_IDLE_TIMEOUT=10, | 677 | NET_AX25_IDLE_TIMEOUT=10, |
677 | NET_AX25_N2=11, | 678 | NET_AX25_N2=11, |
678 | NET_AX25_PACLEN=12, | 679 | NET_AX25_PACLEN=12, |
679 | NET_AX25_PROTOCOL=13, | 680 | NET_AX25_PROTOCOL=13, |
680 | NET_AX25_DAMA_SLAVE_TIMEOUT=14 | 681 | NET_AX25_DAMA_SLAVE_TIMEOUT=14 |
681 | }; | 682 | }; |
682 | 683 | ||
683 | /* /proc/sys/net/rose */ | 684 | /* /proc/sys/net/rose */ |
684 | enum { | 685 | enum { |
685 | NET_ROSE_RESTART_REQUEST_TIMEOUT=1, | 686 | NET_ROSE_RESTART_REQUEST_TIMEOUT=1, |
686 | NET_ROSE_CALL_REQUEST_TIMEOUT=2, | 687 | NET_ROSE_CALL_REQUEST_TIMEOUT=2, |
687 | NET_ROSE_RESET_REQUEST_TIMEOUT=3, | 688 | NET_ROSE_RESET_REQUEST_TIMEOUT=3, |
688 | NET_ROSE_CLEAR_REQUEST_TIMEOUT=4, | 689 | NET_ROSE_CLEAR_REQUEST_TIMEOUT=4, |
689 | NET_ROSE_ACK_HOLD_BACK_TIMEOUT=5, | 690 | NET_ROSE_ACK_HOLD_BACK_TIMEOUT=5, |
690 | NET_ROSE_ROUTING_CONTROL=6, | 691 | NET_ROSE_ROUTING_CONTROL=6, |
691 | NET_ROSE_LINK_FAIL_TIMEOUT=7, | 692 | NET_ROSE_LINK_FAIL_TIMEOUT=7, |
692 | NET_ROSE_MAX_VCS=8, | 693 | NET_ROSE_MAX_VCS=8, |
693 | NET_ROSE_WINDOW_SIZE=9, | 694 | NET_ROSE_WINDOW_SIZE=9, |
694 | NET_ROSE_NO_ACTIVITY_TIMEOUT=10 | 695 | NET_ROSE_NO_ACTIVITY_TIMEOUT=10 |
695 | }; | 696 | }; |
696 | 697 | ||
697 | /* /proc/sys/net/x25 */ | 698 | /* /proc/sys/net/x25 */ |
698 | enum { | 699 | enum { |
699 | NET_X25_RESTART_REQUEST_TIMEOUT=1, | 700 | NET_X25_RESTART_REQUEST_TIMEOUT=1, |
700 | NET_X25_CALL_REQUEST_TIMEOUT=2, | 701 | NET_X25_CALL_REQUEST_TIMEOUT=2, |
701 | NET_X25_RESET_REQUEST_TIMEOUT=3, | 702 | NET_X25_RESET_REQUEST_TIMEOUT=3, |
702 | NET_X25_CLEAR_REQUEST_TIMEOUT=4, | 703 | NET_X25_CLEAR_REQUEST_TIMEOUT=4, |
703 | NET_X25_ACK_HOLD_BACK_TIMEOUT=5, | 704 | NET_X25_ACK_HOLD_BACK_TIMEOUT=5, |
704 | NET_X25_FORWARD=6 | 705 | NET_X25_FORWARD=6 |
705 | }; | 706 | }; |
706 | 707 | ||
707 | /* /proc/sys/net/token-ring */ | 708 | /* /proc/sys/net/token-ring */ |
708 | enum | 709 | enum |
709 | { | 710 | { |
710 | NET_TR_RIF_TIMEOUT=1 | 711 | NET_TR_RIF_TIMEOUT=1 |
711 | }; | 712 | }; |
712 | 713 | ||
713 | /* /proc/sys/net/decnet/ */ | 714 | /* /proc/sys/net/decnet/ */ |
714 | enum { | 715 | enum { |
715 | NET_DECNET_NODE_TYPE = 1, | 716 | NET_DECNET_NODE_TYPE = 1, |
716 | NET_DECNET_NODE_ADDRESS = 2, | 717 | NET_DECNET_NODE_ADDRESS = 2, |
717 | NET_DECNET_NODE_NAME = 3, | 718 | NET_DECNET_NODE_NAME = 3, |
718 | NET_DECNET_DEFAULT_DEVICE = 4, | 719 | NET_DECNET_DEFAULT_DEVICE = 4, |
719 | NET_DECNET_TIME_WAIT = 5, | 720 | NET_DECNET_TIME_WAIT = 5, |
720 | NET_DECNET_DN_COUNT = 6, | 721 | NET_DECNET_DN_COUNT = 6, |
721 | NET_DECNET_DI_COUNT = 7, | 722 | NET_DECNET_DI_COUNT = 7, |
722 | NET_DECNET_DR_COUNT = 8, | 723 | NET_DECNET_DR_COUNT = 8, |
723 | NET_DECNET_DST_GC_INTERVAL = 9, | 724 | NET_DECNET_DST_GC_INTERVAL = 9, |
724 | NET_DECNET_CONF = 10, | 725 | NET_DECNET_CONF = 10, |
725 | NET_DECNET_NO_FC_MAX_CWND = 11, | 726 | NET_DECNET_NO_FC_MAX_CWND = 11, |
726 | NET_DECNET_MEM = 12, | 727 | NET_DECNET_MEM = 12, |
727 | NET_DECNET_RMEM = 13, | 728 | NET_DECNET_RMEM = 13, |
728 | NET_DECNET_WMEM = 14, | 729 | NET_DECNET_WMEM = 14, |
729 | NET_DECNET_DEBUG_LEVEL = 255 | 730 | NET_DECNET_DEBUG_LEVEL = 255 |
730 | }; | 731 | }; |
731 | 732 | ||
732 | /* /proc/sys/net/decnet/conf/<dev> */ | 733 | /* /proc/sys/net/decnet/conf/<dev> */ |
733 | enum { | 734 | enum { |
734 | NET_DECNET_CONF_LOOPBACK = -2, | 735 | NET_DECNET_CONF_LOOPBACK = -2, |
735 | NET_DECNET_CONF_DDCMP = -3, | 736 | NET_DECNET_CONF_DDCMP = -3, |
736 | NET_DECNET_CONF_PPP = -4, | 737 | NET_DECNET_CONF_PPP = -4, |
737 | NET_DECNET_CONF_X25 = -5, | 738 | NET_DECNET_CONF_X25 = -5, |
738 | NET_DECNET_CONF_GRE = -6, | 739 | NET_DECNET_CONF_GRE = -6, |
739 | NET_DECNET_CONF_ETHER = -7 | 740 | NET_DECNET_CONF_ETHER = -7 |
740 | 741 | ||
741 | /* ... and ifindex of devices */ | 742 | /* ... and ifindex of devices */ |
742 | }; | 743 | }; |
743 | 744 | ||
744 | /* /proc/sys/net/decnet/conf/<dev>/ */ | 745 | /* /proc/sys/net/decnet/conf/<dev>/ */ |
745 | enum { | 746 | enum { |
746 | NET_DECNET_CONF_DEV_PRIORITY = 1, | 747 | NET_DECNET_CONF_DEV_PRIORITY = 1, |
747 | NET_DECNET_CONF_DEV_T1 = 2, | 748 | NET_DECNET_CONF_DEV_T1 = 2, |
748 | NET_DECNET_CONF_DEV_T2 = 3, | 749 | NET_DECNET_CONF_DEV_T2 = 3, |
749 | NET_DECNET_CONF_DEV_T3 = 4, | 750 | NET_DECNET_CONF_DEV_T3 = 4, |
750 | NET_DECNET_CONF_DEV_FORWARDING = 5, | 751 | NET_DECNET_CONF_DEV_FORWARDING = 5, |
751 | NET_DECNET_CONF_DEV_BLKSIZE = 6, | 752 | NET_DECNET_CONF_DEV_BLKSIZE = 6, |
752 | NET_DECNET_CONF_DEV_STATE = 7 | 753 | NET_DECNET_CONF_DEV_STATE = 7 |
753 | }; | 754 | }; |
754 | 755 | ||
755 | /* /proc/sys/net/sctp */ | 756 | /* /proc/sys/net/sctp */ |
756 | enum { | 757 | enum { |
757 | NET_SCTP_RTO_INITIAL = 1, | 758 | NET_SCTP_RTO_INITIAL = 1, |
758 | NET_SCTP_RTO_MIN = 2, | 759 | NET_SCTP_RTO_MIN = 2, |
759 | NET_SCTP_RTO_MAX = 3, | 760 | NET_SCTP_RTO_MAX = 3, |
760 | NET_SCTP_RTO_ALPHA = 4, | 761 | NET_SCTP_RTO_ALPHA = 4, |
761 | NET_SCTP_RTO_BETA = 5, | 762 | NET_SCTP_RTO_BETA = 5, |
762 | NET_SCTP_VALID_COOKIE_LIFE = 6, | 763 | NET_SCTP_VALID_COOKIE_LIFE = 6, |
763 | NET_SCTP_ASSOCIATION_MAX_RETRANS = 7, | 764 | NET_SCTP_ASSOCIATION_MAX_RETRANS = 7, |
764 | NET_SCTP_PATH_MAX_RETRANS = 8, | 765 | NET_SCTP_PATH_MAX_RETRANS = 8, |
765 | NET_SCTP_MAX_INIT_RETRANSMITS = 9, | 766 | NET_SCTP_MAX_INIT_RETRANSMITS = 9, |
766 | NET_SCTP_HB_INTERVAL = 10, | 767 | NET_SCTP_HB_INTERVAL = 10, |
767 | NET_SCTP_PRESERVE_ENABLE = 11, | 768 | NET_SCTP_PRESERVE_ENABLE = 11, |
768 | NET_SCTP_MAX_BURST = 12, | 769 | NET_SCTP_MAX_BURST = 12, |
769 | NET_SCTP_ADDIP_ENABLE = 13, | 770 | NET_SCTP_ADDIP_ENABLE = 13, |
770 | NET_SCTP_PRSCTP_ENABLE = 14, | 771 | NET_SCTP_PRSCTP_ENABLE = 14, |
771 | NET_SCTP_SNDBUF_POLICY = 15, | 772 | NET_SCTP_SNDBUF_POLICY = 15, |
772 | NET_SCTP_SACK_TIMEOUT = 16, | 773 | NET_SCTP_SACK_TIMEOUT = 16, |
773 | NET_SCTP_RCVBUF_POLICY = 17, | 774 | NET_SCTP_RCVBUF_POLICY = 17, |
774 | }; | 775 | }; |
775 | 776 | ||
776 | /* /proc/sys/net/bridge */ | 777 | /* /proc/sys/net/bridge */ |
777 | enum { | 778 | enum { |
778 | NET_BRIDGE_NF_CALL_ARPTABLES = 1, | 779 | NET_BRIDGE_NF_CALL_ARPTABLES = 1, |
779 | NET_BRIDGE_NF_CALL_IPTABLES = 2, | 780 | NET_BRIDGE_NF_CALL_IPTABLES = 2, |
780 | NET_BRIDGE_NF_CALL_IP6TABLES = 3, | 781 | NET_BRIDGE_NF_CALL_IP6TABLES = 3, |
781 | NET_BRIDGE_NF_FILTER_VLAN_TAGGED = 4, | 782 | NET_BRIDGE_NF_FILTER_VLAN_TAGGED = 4, |
782 | }; | 783 | }; |
783 | 784 | ||
784 | /* CTL_FS names: */ | 785 | /* CTL_FS names: */ |
785 | enum | 786 | enum |
786 | { | 787 | { |
787 | FS_NRINODE=1, /* int:current number of allocated inodes */ | 788 | FS_NRINODE=1, /* int:current number of allocated inodes */ |
788 | FS_STATINODE=2, | 789 | FS_STATINODE=2, |
789 | FS_MAXINODE=3, /* int:maximum number of inodes that can be allocated */ | 790 | FS_MAXINODE=3, /* int:maximum number of inodes that can be allocated */ |
790 | FS_NRDQUOT=4, /* int:current number of allocated dquots */ | 791 | FS_NRDQUOT=4, /* int:current number of allocated dquots */ |
791 | FS_MAXDQUOT=5, /* int:maximum number of dquots that can be allocated */ | 792 | FS_MAXDQUOT=5, /* int:maximum number of dquots that can be allocated */ |
792 | FS_NRFILE=6, /* int:current number of allocated filedescriptors */ | 793 | FS_NRFILE=6, /* int:current number of allocated filedescriptors */ |
793 | FS_MAXFILE=7, /* int:maximum number of filedescriptors that can be allocated */ | 794 | FS_MAXFILE=7, /* int:maximum number of filedescriptors that can be allocated */ |
794 | FS_DENTRY=8, | 795 | FS_DENTRY=8, |
795 | FS_NRSUPER=9, /* int:current number of allocated super_blocks */ | 796 | FS_NRSUPER=9, /* int:current number of allocated super_blocks */ |
796 | FS_MAXSUPER=10, /* int:maximum number of super_blocks that can be allocated */ | 797 | FS_MAXSUPER=10, /* int:maximum number of super_blocks that can be allocated */ |
797 | FS_OVERFLOWUID=11, /* int: overflow UID */ | 798 | FS_OVERFLOWUID=11, /* int: overflow UID */ |
798 | FS_OVERFLOWGID=12, /* int: overflow GID */ | 799 | FS_OVERFLOWGID=12, /* int: overflow GID */ |
799 | FS_LEASES=13, /* int: leases enabled */ | 800 | FS_LEASES=13, /* int: leases enabled */ |
800 | FS_DIR_NOTIFY=14, /* int: directory notification enabled */ | 801 | FS_DIR_NOTIFY=14, /* int: directory notification enabled */ |
801 | FS_LEASE_TIME=15, /* int: maximum time to wait for a lease break */ | 802 | FS_LEASE_TIME=15, /* int: maximum time to wait for a lease break */ |
802 | FS_DQSTATS=16, /* disc quota usage statistics and control */ | 803 | FS_DQSTATS=16, /* disc quota usage statistics and control */ |
803 | FS_XFS=17, /* struct: control xfs parameters */ | 804 | FS_XFS=17, /* struct: control xfs parameters */ |
804 | FS_AIO_NR=18, /* current system-wide number of aio requests */ | 805 | FS_AIO_NR=18, /* current system-wide number of aio requests */ |
805 | FS_AIO_MAX_NR=19, /* system-wide maximum number of aio requests */ | 806 | FS_AIO_MAX_NR=19, /* system-wide maximum number of aio requests */ |
806 | FS_INOTIFY=20, /* inotify submenu */ | 807 | FS_INOTIFY=20, /* inotify submenu */ |
807 | }; | 808 | }; |
808 | 809 | ||
809 | /* /proc/sys/fs/quota/ */ | 810 | /* /proc/sys/fs/quota/ */ |
810 | enum { | 811 | enum { |
811 | FS_DQ_LOOKUPS = 1, | 812 | FS_DQ_LOOKUPS = 1, |
812 | FS_DQ_DROPS = 2, | 813 | FS_DQ_DROPS = 2, |
813 | FS_DQ_READS = 3, | 814 | FS_DQ_READS = 3, |
814 | FS_DQ_WRITES = 4, | 815 | FS_DQ_WRITES = 4, |
815 | FS_DQ_CACHE_HITS = 5, | 816 | FS_DQ_CACHE_HITS = 5, |
816 | FS_DQ_ALLOCATED = 6, | 817 | FS_DQ_ALLOCATED = 6, |
817 | FS_DQ_FREE = 7, | 818 | FS_DQ_FREE = 7, |
818 | FS_DQ_SYNCS = 8, | 819 | FS_DQ_SYNCS = 8, |
819 | FS_DQ_WARNINGS = 9, | 820 | FS_DQ_WARNINGS = 9, |
820 | }; | 821 | }; |
821 | 822 | ||
822 | /* CTL_DEBUG names: */ | 823 | /* CTL_DEBUG names: */ |
823 | 824 | ||
824 | /* CTL_DEV names: */ | 825 | /* CTL_DEV names: */ |
825 | enum { | 826 | enum { |
826 | DEV_CDROM=1, | 827 | DEV_CDROM=1, |
827 | DEV_HWMON=2, | 828 | DEV_HWMON=2, |
828 | DEV_PARPORT=3, | 829 | DEV_PARPORT=3, |
829 | DEV_RAID=4, | 830 | DEV_RAID=4, |
830 | DEV_MAC_HID=5, | 831 | DEV_MAC_HID=5, |
831 | DEV_SCSI=6, | 832 | DEV_SCSI=6, |
832 | DEV_IPMI=7, | 833 | DEV_IPMI=7, |
833 | }; | 834 | }; |
834 | 835 | ||
835 | /* /proc/sys/dev/cdrom */ | 836 | /* /proc/sys/dev/cdrom */ |
836 | enum { | 837 | enum { |
837 | DEV_CDROM_INFO=1, | 838 | DEV_CDROM_INFO=1, |
838 | DEV_CDROM_AUTOCLOSE=2, | 839 | DEV_CDROM_AUTOCLOSE=2, |
839 | DEV_CDROM_AUTOEJECT=3, | 840 | DEV_CDROM_AUTOEJECT=3, |
840 | DEV_CDROM_DEBUG=4, | 841 | DEV_CDROM_DEBUG=4, |
841 | DEV_CDROM_LOCK=5, | 842 | DEV_CDROM_LOCK=5, |
842 | DEV_CDROM_CHECK_MEDIA=6 | 843 | DEV_CDROM_CHECK_MEDIA=6 |
843 | }; | 844 | }; |
844 | 845 | ||
845 | /* /proc/sys/dev/parport */ | 846 | /* /proc/sys/dev/parport */ |
846 | enum { | 847 | enum { |
847 | DEV_PARPORT_DEFAULT=-3 | 848 | DEV_PARPORT_DEFAULT=-3 |
848 | }; | 849 | }; |
849 | 850 | ||
850 | /* /proc/sys/dev/raid */ | 851 | /* /proc/sys/dev/raid */ |
851 | enum { | 852 | enum { |
852 | DEV_RAID_SPEED_LIMIT_MIN=1, | 853 | DEV_RAID_SPEED_LIMIT_MIN=1, |
853 | DEV_RAID_SPEED_LIMIT_MAX=2 | 854 | DEV_RAID_SPEED_LIMIT_MAX=2 |
854 | }; | 855 | }; |
855 | 856 | ||
856 | /* /proc/sys/dev/parport/default */ | 857 | /* /proc/sys/dev/parport/default */ |
857 | enum { | 858 | enum { |
858 | DEV_PARPORT_DEFAULT_TIMESLICE=1, | 859 | DEV_PARPORT_DEFAULT_TIMESLICE=1, |
859 | DEV_PARPORT_DEFAULT_SPINTIME=2 | 860 | DEV_PARPORT_DEFAULT_SPINTIME=2 |
860 | }; | 861 | }; |
861 | 862 | ||
862 | /* /proc/sys/dev/parport/parport n */ | 863 | /* /proc/sys/dev/parport/parport n */ |
863 | enum { | 864 | enum { |
864 | DEV_PARPORT_SPINTIME=1, | 865 | DEV_PARPORT_SPINTIME=1, |
865 | DEV_PARPORT_BASE_ADDR=2, | 866 | DEV_PARPORT_BASE_ADDR=2, |
866 | DEV_PARPORT_IRQ=3, | 867 | DEV_PARPORT_IRQ=3, |
867 | DEV_PARPORT_DMA=4, | 868 | DEV_PARPORT_DMA=4, |
868 | DEV_PARPORT_MODES=5, | 869 | DEV_PARPORT_MODES=5, |
869 | DEV_PARPORT_DEVICES=6, | 870 | DEV_PARPORT_DEVICES=6, |
870 | DEV_PARPORT_AUTOPROBE=16 | 871 | DEV_PARPORT_AUTOPROBE=16 |
871 | }; | 872 | }; |
872 | 873 | ||
873 | /* /proc/sys/dev/parport/parport n/devices/ */ | 874 | /* /proc/sys/dev/parport/parport n/devices/ */ |
874 | enum { | 875 | enum { |
875 | DEV_PARPORT_DEVICES_ACTIVE=-3, | 876 | DEV_PARPORT_DEVICES_ACTIVE=-3, |
876 | }; | 877 | }; |
877 | 878 | ||
878 | /* /proc/sys/dev/parport/parport n/devices/device n */ | 879 | /* /proc/sys/dev/parport/parport n/devices/device n */ |
879 | enum { | 880 | enum { |
880 | DEV_PARPORT_DEVICE_TIMESLICE=1, | 881 | DEV_PARPORT_DEVICE_TIMESLICE=1, |
881 | }; | 882 | }; |
882 | 883 | ||
883 | /* /proc/sys/dev/mac_hid */ | 884 | /* /proc/sys/dev/mac_hid */ |
884 | enum { | 885 | enum { |
885 | DEV_MAC_HID_KEYBOARD_SENDS_LINUX_KEYCODES=1, | 886 | DEV_MAC_HID_KEYBOARD_SENDS_LINUX_KEYCODES=1, |
886 | DEV_MAC_HID_KEYBOARD_LOCK_KEYCODES=2, | 887 | DEV_MAC_HID_KEYBOARD_LOCK_KEYCODES=2, |
887 | DEV_MAC_HID_MOUSE_BUTTON_EMULATION=3, | 888 | DEV_MAC_HID_MOUSE_BUTTON_EMULATION=3, |
888 | DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE=4, | 889 | DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE=4, |
889 | DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE=5, | 890 | DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE=5, |
890 | DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES=6 | 891 | DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES=6 |
891 | }; | 892 | }; |
892 | 893 | ||
893 | /* /proc/sys/dev/scsi */ | 894 | /* /proc/sys/dev/scsi */ |
894 | enum { | 895 | enum { |
895 | DEV_SCSI_LOGGING_LEVEL=1, | 896 | DEV_SCSI_LOGGING_LEVEL=1, |
896 | }; | 897 | }; |
897 | 898 | ||
898 | /* /proc/sys/dev/ipmi */ | 899 | /* /proc/sys/dev/ipmi */ |
899 | enum { | 900 | enum { |
900 | DEV_IPMI_POWEROFF_POWERCYCLE=1, | 901 | DEV_IPMI_POWEROFF_POWERCYCLE=1, |
901 | }; | 902 | }; |
902 | 903 | ||
903 | /* /proc/sys/abi */ | 904 | /* /proc/sys/abi */ |
904 | enum | 905 | enum |
905 | { | 906 | { |
906 | ABI_DEFHANDLER_COFF=1, /* default handler for coff binaries */ | 907 | ABI_DEFHANDLER_COFF=1, /* default handler for coff binaries */ |
907 | ABI_DEFHANDLER_ELF=2, /* default handler for ELF binaries */ | 908 | ABI_DEFHANDLER_ELF=2, /* default handler for ELF binaries */ |
908 | ABI_DEFHANDLER_LCALL7=3,/* default handler for procs using lcall7 */ | 909 | ABI_DEFHANDLER_LCALL7=3,/* default handler for procs using lcall7 */ |
909 | ABI_DEFHANDLER_LIBCSO=4,/* default handler for an libc.so ELF interp */ | 910 | ABI_DEFHANDLER_LIBCSO=4,/* default handler for an libc.so ELF interp */ |
910 | ABI_TRACE=5, /* tracing flags */ | 911 | ABI_TRACE=5, /* tracing flags */ |
911 | ABI_FAKE_UTSNAME=6, /* fake target utsname information */ | 912 | ABI_FAKE_UTSNAME=6, /* fake target utsname information */ |
912 | }; | 913 | }; |
913 | 914 | ||
914 | #ifdef __KERNEL__ | 915 | #ifdef __KERNEL__ |
915 | #include <linux/list.h> | 916 | #include <linux/list.h> |
916 | 917 | ||
917 | extern void sysctl_init(void); | 918 | extern void sysctl_init(void); |
918 | 919 | ||
919 | typedef struct ctl_table ctl_table; | 920 | typedef struct ctl_table ctl_table; |
920 | 921 | ||
921 | typedef int ctl_handler (ctl_table *table, int __user *name, int nlen, | 922 | typedef int ctl_handler (ctl_table *table, int __user *name, int nlen, |
922 | void __user *oldval, size_t __user *oldlenp, | 923 | void __user *oldval, size_t __user *oldlenp, |
923 | void __user *newval, size_t newlen); | 924 | void __user *newval, size_t newlen); |
924 | 925 | ||
925 | typedef int proc_handler (ctl_table *ctl, int write, struct file * filp, | 926 | typedef int proc_handler (ctl_table *ctl, int write, struct file * filp, |
926 | void __user *buffer, size_t *lenp, loff_t *ppos); | 927 | void __user *buffer, size_t *lenp, loff_t *ppos); |
927 | 928 | ||
928 | extern int proc_dostring(ctl_table *, int, struct file *, | 929 | extern int proc_dostring(ctl_table *, int, struct file *, |
929 | void __user *, size_t *, loff_t *); | 930 | void __user *, size_t *, loff_t *); |
930 | extern int proc_dointvec(ctl_table *, int, struct file *, | 931 | extern int proc_dointvec(ctl_table *, int, struct file *, |
931 | void __user *, size_t *, loff_t *); | 932 | void __user *, size_t *, loff_t *); |
932 | extern int proc_dointvec_bset(ctl_table *, int, struct file *, | 933 | extern int proc_dointvec_bset(ctl_table *, int, struct file *, |
933 | void __user *, size_t *, loff_t *); | 934 | void __user *, size_t *, loff_t *); |
934 | extern int proc_dointvec_minmax(ctl_table *, int, struct file *, | 935 | extern int proc_dointvec_minmax(ctl_table *, int, struct file *, |
935 | void __user *, size_t *, loff_t *); | 936 | void __user *, size_t *, loff_t *); |
936 | extern int proc_dointvec_jiffies(ctl_table *, int, struct file *, | 937 | extern int proc_dointvec_jiffies(ctl_table *, int, struct file *, |
937 | void __user *, size_t *, loff_t *); | 938 | void __user *, size_t *, loff_t *); |
938 | extern int proc_dointvec_userhz_jiffies(ctl_table *, int, struct file *, | 939 | extern int proc_dointvec_userhz_jiffies(ctl_table *, int, struct file *, |
939 | void __user *, size_t *, loff_t *); | 940 | void __user *, size_t *, loff_t *); |
940 | extern int proc_dointvec_ms_jiffies(ctl_table *, int, struct file *, | 941 | extern int proc_dointvec_ms_jiffies(ctl_table *, int, struct file *, |
941 | void __user *, size_t *, loff_t *); | 942 | void __user *, size_t *, loff_t *); |
942 | extern int proc_doulongvec_minmax(ctl_table *, int, struct file *, | 943 | extern int proc_doulongvec_minmax(ctl_table *, int, struct file *, |
943 | void __user *, size_t *, loff_t *); | 944 | void __user *, size_t *, loff_t *); |
944 | extern int proc_doulongvec_ms_jiffies_minmax(ctl_table *table, int, | 945 | extern int proc_doulongvec_ms_jiffies_minmax(ctl_table *table, int, |
945 | struct file *, void __user *, size_t *, loff_t *); | 946 | struct file *, void __user *, size_t *, loff_t *); |
946 | 947 | ||
947 | extern int do_sysctl (int __user *name, int nlen, | 948 | extern int do_sysctl (int __user *name, int nlen, |
948 | void __user *oldval, size_t __user *oldlenp, | 949 | void __user *oldval, size_t __user *oldlenp, |
949 | void __user *newval, size_t newlen); | 950 | void __user *newval, size_t newlen); |
950 | 951 | ||
951 | extern int do_sysctl_strategy (ctl_table *table, | 952 | extern int do_sysctl_strategy (ctl_table *table, |
952 | int __user *name, int nlen, | 953 | int __user *name, int nlen, |
953 | void __user *oldval, size_t __user *oldlenp, | 954 | void __user *oldval, size_t __user *oldlenp, |
954 | void __user *newval, size_t newlen); | 955 | void __user *newval, size_t newlen); |
955 | 956 | ||
956 | extern ctl_handler sysctl_string; | 957 | extern ctl_handler sysctl_string; |
957 | extern ctl_handler sysctl_intvec; | 958 | extern ctl_handler sysctl_intvec; |
958 | extern ctl_handler sysctl_jiffies; | 959 | extern ctl_handler sysctl_jiffies; |
959 | extern ctl_handler sysctl_ms_jiffies; | 960 | extern ctl_handler sysctl_ms_jiffies; |
960 | 961 | ||
961 | 962 | ||
962 | /* | 963 | /* |
963 | * Register a set of sysctl names by calling register_sysctl_table | 964 | * Register a set of sysctl names by calling register_sysctl_table |
964 | * with an initialised array of ctl_table's. An entry with zero | 965 | * with an initialised array of ctl_table's. An entry with zero |
965 | * ctl_name and NULL procname terminates the table. table->de will be | 966 | * ctl_name and NULL procname terminates the table. table->de will be |
966 | * set up by the registration and need not be initialised in advance. | 967 | * set up by the registration and need not be initialised in advance. |
967 | * | 968 | * |
968 | * sysctl names can be mirrored automatically under /proc/sys. The | 969 | * sysctl names can be mirrored automatically under /proc/sys. The |
969 | * procname supplied controls /proc naming. | 970 | * procname supplied controls /proc naming. |
970 | * | 971 | * |
971 | * The table's mode will be honoured both for sys_sysctl(2) and | 972 | * The table's mode will be honoured both for sys_sysctl(2) and |
972 | * proc-fs access. | 973 | * proc-fs access. |
973 | * | 974 | * |
974 | * Leaf nodes in the sysctl tree will be represented by a single file | 975 | * Leaf nodes in the sysctl tree will be represented by a single file |
975 | * under /proc; non-leaf nodes will be represented by directories. A | 976 | * under /proc; non-leaf nodes will be represented by directories. A |
976 | * null procname disables /proc mirroring at this node. | 977 | * null procname disables /proc mirroring at this node. |
977 | * | 978 | * |
978 | * sysctl entries with a zero ctl_name will not be available through | 979 | * sysctl entries with a zero ctl_name will not be available through |
979 | * the binary sysctl interface. | 980 | * the binary sysctl interface. |
980 | * | 981 | * |
981 | * sysctl(2) can automatically manage read and write requests through | 982 | * sysctl(2) can automatically manage read and write requests through |
982 | * the sysctl table. The data and maxlen fields of the ctl_table | 983 | * the sysctl table. The data and maxlen fields of the ctl_table |
983 | * struct enable minimal validation of the values being written to be | 984 | * struct enable minimal validation of the values being written to be |
984 | * performed, and the mode field allows minimal authentication. | 985 | * performed, and the mode field allows minimal authentication. |
985 | * | 986 | * |
986 | * More sophisticated management can be enabled by the provision of a | 987 | * More sophisticated management can be enabled by the provision of a |
987 | * strategy routine with the table entry. This will be called before | 988 | * strategy routine with the table entry. This will be called before |
988 | * any automatic read or write of the data is performed. | 989 | * any automatic read or write of the data is performed. |
989 | * | 990 | * |
990 | * The strategy routine may return: | 991 | * The strategy routine may return: |
991 | * <0: Error occurred (error is passed to user process) | 992 | * <0: Error occurred (error is passed to user process) |
992 | * 0: OK - proceed with automatic read or write. | 993 | * 0: OK - proceed with automatic read or write. |
993 | * >0: OK - read or write has been done by the strategy routine, so | 994 | * >0: OK - read or write has been done by the strategy routine, so |
994 | * return immediately. | 995 | * return immediately. |
995 | * | 996 | * |
996 | * There must be a proc_handler routine for any terminal nodes | 997 | * There must be a proc_handler routine for any terminal nodes |
997 | * mirrored under /proc/sys (non-terminals are handled by a built-in | 998 | * mirrored under /proc/sys (non-terminals are handled by a built-in |
998 | * directory handler). Several default handlers are available to | 999 | * directory handler). Several default handlers are available to |
999 | * cover common cases. | 1000 | * cover common cases. |
1000 | */ | 1001 | */ |
1001 | 1002 | ||
1002 | /* A sysctl table is an array of struct ctl_table: */ | 1003 | /* A sysctl table is an array of struct ctl_table: */ |
1003 | struct ctl_table | 1004 | struct ctl_table |
1004 | { | 1005 | { |
1005 | int ctl_name; /* Binary ID */ | 1006 | int ctl_name; /* Binary ID */ |
1006 | const char *procname; /* Text ID for /proc/sys, or zero */ | 1007 | const char *procname; /* Text ID for /proc/sys, or zero */ |
1007 | void *data; | 1008 | void *data; |
1008 | int maxlen; | 1009 | int maxlen; |
1009 | mode_t mode; | 1010 | mode_t mode; |
1010 | ctl_table *child; | 1011 | ctl_table *child; |
1011 | proc_handler *proc_handler; /* Callback for text formatting */ | 1012 | proc_handler *proc_handler; /* Callback for text formatting */ |
1012 | ctl_handler *strategy; /* Callback function for all r/w */ | 1013 | ctl_handler *strategy; /* Callback function for all r/w */ |
1013 | struct proc_dir_entry *de; /* /proc control block */ | 1014 | struct proc_dir_entry *de; /* /proc control block */ |
1014 | void *extra1; | 1015 | void *extra1; |
1015 | void *extra2; | 1016 | void *extra2; |
1016 | }; | 1017 | }; |
1017 | 1018 | ||
1018 | /* struct ctl_table_header is used to maintain dynamic lists of | 1019 | /* struct ctl_table_header is used to maintain dynamic lists of |
1019 | ctl_table trees. */ | 1020 | ctl_table trees. */ |
1020 | struct ctl_table_header | 1021 | struct ctl_table_header |
1021 | { | 1022 | { |
1022 | ctl_table *ctl_table; | 1023 | ctl_table *ctl_table; |
1023 | struct list_head ctl_entry; | 1024 | struct list_head ctl_entry; |
1024 | int used; | 1025 | int used; |
1025 | struct completion *unregistering; | 1026 | struct completion *unregistering; |
1026 | }; | 1027 | }; |
1027 | 1028 | ||
1028 | struct ctl_table_header * register_sysctl_table(ctl_table * table, | 1029 | struct ctl_table_header * register_sysctl_table(ctl_table * table, |
1029 | int insert_at_head); | 1030 | int insert_at_head); |
1030 | void unregister_sysctl_table(struct ctl_table_header * table); | 1031 | void unregister_sysctl_table(struct ctl_table_header * table); |
1031 | 1032 | ||
1032 | #else /* __KERNEL__ */ | 1033 | #else /* __KERNEL__ */ |
1033 | 1034 | ||
1034 | #endif /* __KERNEL__ */ | 1035 | #endif /* __KERNEL__ */ |
1035 | 1036 | ||
1036 | #endif /* _LINUX_SYSCTL_H */ | 1037 | #endif /* _LINUX_SYSCTL_H */ |
1037 | 1038 |