]>
Commit | Line | Data |
---|---|---|
45516216 | 1 | # 1 "net/ipv4/ip_output.c" |
2 | # 1 "/usr/local/src/blackfin/svn/linux-kernel/trunk//" | |
3 | # 1 "<built-in>" | |
4 | # 1 "<command line>" | |
5 | # 1 "./include/linux/autoconf.h" 1 | |
6 | # 1 "<command line>" 2 | |
7 | # 1 "net/ipv4/ip_output.c" | |
8 | # 47 "net/ipv4/ip_output.c" | |
9 | # 1 "include/asm/uaccess.h" 1 | |
10 | # 12 "include/asm/uaccess.h" | |
11 | # 1 "include/linux/sched.h" 1 | |
12 | ||
13 | ||
14 | ||
15 | # 1 "include/linux/auxvec.h" 1 | |
16 | ||
17 | ||
18 | ||
19 | # 1 "include/asm/auxvec.h" 1 | |
20 | # 5 "include/linux/auxvec.h" 2 | |
21 | # 5 "include/linux/sched.h" 2 | |
22 | # 40 "include/linux/sched.h" | |
23 | struct sched_param { | |
24 | int sched_priority; | |
25 | }; | |
26 | ||
27 | # 1 "include/asm/param.h" 1 | |
28 | # 45 "include/linux/sched.h" 2 | |
29 | ||
30 | # 1 "include/linux/capability.h" 1 | |
31 | # 16 "include/linux/capability.h" | |
32 | # 1 "include/linux/types.h" 1 | |
33 | # 14 "include/linux/types.h" | |
34 | # 1 "include/linux/posix_types.h" 1 | |
35 | ||
36 | ||
37 | ||
38 | # 1 "include/linux/stddef.h" 1 | |
39 | ||
40 | ||
41 | ||
42 | # 1 "include/linux/compiler.h" 1 | |
43 | # 42 "include/linux/compiler.h" | |
44 | # 1 "include/linux/compiler-gcc4.h" 1 | |
45 | ||
46 | ||
47 | ||
48 | # 1 "include/linux/compiler-gcc.h" 1 | |
49 | # 5 "include/linux/compiler-gcc4.h" 2 | |
50 | # 43 "include/linux/compiler.h" 2 | |
51 | # 5 "include/linux/stddef.h" 2 | |
52 | # 15 "include/linux/stddef.h" | |
53 | enum { | |
54 | false = 0, | |
55 | true = 1 | |
56 | }; | |
57 | # 5 "include/linux/posix_types.h" 2 | |
58 | # 36 "include/linux/posix_types.h" | |
59 | typedef struct { | |
60 | unsigned long fds_bits [(1024/(8 * sizeof(unsigned long)))]; | |
61 | } __kernel_fd_set; | |
62 | ||
63 | ||
64 | typedef void (*__kernel_sighandler_t)(int); | |
65 | ||
66 | ||
67 | typedef int __kernel_key_t; | |
68 | typedef int __kernel_mqd_t; | |
69 | ||
70 | # 1 "include/asm/posix_types.h" 1 | |
71 | # 10 "include/asm/posix_types.h" | |
72 | typedef unsigned long __kernel_ino_t; | |
73 | typedef unsigned short __kernel_mode_t; | |
74 | typedef unsigned short __kernel_nlink_t; | |
75 | typedef long __kernel_off_t; | |
76 | typedef int __kernel_pid_t; | |
77 | typedef unsigned int __kernel_ipc_pid_t; | |
78 | typedef unsigned int __kernel_uid_t; | |
79 | typedef unsigned int __kernel_gid_t; | |
80 | typedef unsigned long __kernel_size_t; | |
81 | typedef long __kernel_ssize_t; | |
82 | typedef int __kernel_ptrdiff_t; | |
83 | typedef long __kernel_time_t; | |
84 | typedef long __kernel_suseconds_t; | |
85 | typedef long __kernel_clock_t; | |
86 | typedef int __kernel_timer_t; | |
87 | typedef int __kernel_clockid_t; | |
88 | typedef int __kernel_daddr_t; | |
89 | typedef char *__kernel_caddr_t; | |
90 | typedef unsigned short __kernel_uid16_t; | |
91 | typedef unsigned short __kernel_gid16_t; | |
92 | typedef unsigned int __kernel_uid32_t; | |
93 | typedef unsigned int __kernel_gid32_t; | |
94 | ||
95 | typedef unsigned short __kernel_old_uid_t; | |
96 | typedef unsigned short __kernel_old_gid_t; | |
97 | typedef unsigned short __kernel_old_dev_t; | |
98 | ||
99 | ||
100 | typedef long long __kernel_loff_t; | |
101 | ||
102 | ||
103 | typedef struct { | |
104 | ||
105 | int val[2]; | |
106 | ||
107 | ||
108 | ||
109 | } __kernel_fsid_t; | |
110 | # 48 "include/linux/posix_types.h" 2 | |
111 | # 15 "include/linux/types.h" 2 | |
112 | # 1 "include/asm/types.h" 1 | |
113 | # 13 "include/asm/types.h" | |
114 | typedef unsigned short umode_t; | |
115 | ||
116 | ||
117 | ||
118 | ||
119 | ||
120 | ||
121 | typedef __signed__ char __s8; | |
122 | typedef unsigned char __u8; | |
123 | ||
124 | typedef __signed__ short __s16; | |
125 | typedef unsigned short __u16; | |
126 | ||
127 | typedef __signed__ int __s32; | |
128 | typedef unsigned int __u32; | |
129 | ||
130 | ||
131 | ||
132 | typedef __signed__ long long __s64; | |
133 | typedef unsigned long long __u64; | |
134 | # 45 "include/asm/types.h" | |
135 | typedef signed char s8; | |
136 | typedef unsigned char u8; | |
137 | ||
138 | typedef signed short s16; | |
139 | typedef unsigned short u16; | |
140 | ||
141 | typedef signed int s32; | |
142 | typedef unsigned int u32; | |
143 | ||
144 | typedef signed long long s64; | |
145 | typedef unsigned long long u64; | |
146 | ||
147 | ||
148 | ||
149 | typedef u32 dma_addr_t; | |
150 | typedef u64 dma64_addr_t; | |
151 | # 16 "include/linux/types.h" 2 | |
152 | ||
153 | ||
154 | ||
155 | typedef __u32 __kernel_dev_t; | |
156 | ||
157 | typedef __kernel_fd_set fd_set; | |
158 | typedef __kernel_dev_t dev_t; | |
159 | typedef __kernel_ino_t ino_t; | |
160 | typedef __kernel_mode_t mode_t; | |
161 | typedef __kernel_nlink_t nlink_t; | |
162 | typedef __kernel_off_t off_t; | |
163 | typedef __kernel_pid_t pid_t; | |
164 | typedef __kernel_daddr_t daddr_t; | |
165 | typedef __kernel_key_t key_t; | |
166 | typedef __kernel_suseconds_t suseconds_t; | |
167 | typedef __kernel_timer_t timer_t; | |
168 | typedef __kernel_clockid_t clockid_t; | |
169 | typedef __kernel_mqd_t mqd_t; | |
170 | ||
171 | ||
172 | typedef _Bool bool; | |
173 | ||
174 | typedef __kernel_uid32_t uid_t; | |
175 | typedef __kernel_gid32_t gid_t; | |
176 | typedef __kernel_uid16_t uid16_t; | |
177 | typedef __kernel_gid16_t gid16_t; | |
178 | ||
179 | ||
180 | ||
181 | typedef __kernel_old_uid_t old_uid_t; | |
182 | typedef __kernel_old_gid_t old_gid_t; | |
183 | # 58 "include/linux/types.h" | |
184 | typedef __kernel_loff_t loff_t; | |
185 | # 67 "include/linux/types.h" | |
186 | typedef __kernel_size_t size_t; | |
187 | ||
188 | ||
189 | ||
190 | ||
191 | typedef __kernel_ssize_t ssize_t; | |
192 | ||
193 | ||
194 | ||
195 | ||
196 | typedef __kernel_ptrdiff_t ptrdiff_t; | |
197 | ||
198 | ||
199 | ||
200 | ||
201 | typedef __kernel_time_t time_t; | |
202 | ||
203 | ||
204 | ||
205 | ||
206 | typedef __kernel_clock_t clock_t; | |
207 | ||
208 | ||
209 | ||
210 | ||
211 | typedef __kernel_caddr_t caddr_t; | |
212 | ||
213 | ||
214 | ||
215 | typedef unsigned char u_char; | |
216 | typedef unsigned short u_short; | |
217 | typedef unsigned int u_int; | |
218 | typedef unsigned long u_long; | |
219 | ||
220 | ||
221 | typedef unsigned char unchar; | |
222 | typedef unsigned short ushort; | |
223 | typedef unsigned int uint; | |
224 | typedef unsigned long ulong; | |
225 | ||
226 | ||
227 | ||
228 | ||
229 | typedef __u8 u_int8_t; | |
230 | typedef __s8 int8_t; | |
231 | typedef __u16 u_int16_t; | |
232 | typedef __s16 int16_t; | |
233 | typedef __u32 u_int32_t; | |
234 | typedef __s32 int32_t; | |
235 | ||
236 | ||
237 | ||
238 | typedef __u8 uint8_t; | |
239 | typedef __u16 uint16_t; | |
240 | typedef __u32 uint32_t; | |
241 | ||
242 | ||
243 | typedef __u64 uint64_t; | |
244 | typedef __u64 u_int64_t; | |
245 | typedef __s64 int64_t; | |
246 | # 142 "include/linux/types.h" | |
247 | typedef unsigned long sector_t; | |
248 | ||
249 | ||
250 | ||
251 | typedef unsigned long blkcnt_t; | |
252 | # 175 "include/linux/types.h" | |
253 | typedef __u16 __le16; | |
254 | typedef __u16 __be16; | |
255 | typedef __u32 __le32; | |
256 | typedef __u32 __be32; | |
257 | ||
258 | typedef __u64 __le64; | |
259 | typedef __u64 __be64; | |
260 | ||
261 | ||
262 | ||
263 | typedef unsigned gfp_t; | |
264 | ||
265 | ||
266 | ||
267 | ||
268 | typedef u32 resource_size_t; | |
269 | ||
270 | ||
271 | ||
272 | ||
273 | struct ustat { | |
274 | __kernel_daddr_t f_tfree; | |
275 | __kernel_ino_t f_tinode; | |
276 | char f_fname[6]; | |
277 | char f_fpack[6]; | |
278 | }; | |
279 | # 17 "include/linux/capability.h" 2 | |
280 | # 32 "include/linux/capability.h" | |
281 | typedef struct __user_cap_header_struct { | |
282 | __u32 version; | |
283 | int pid; | |
284 | } *cap_user_header_t; | |
285 | ||
286 | typedef struct __user_cap_data_struct { | |
287 | __u32 effective; | |
288 | __u32 permitted; | |
289 | __u32 inheritable; | |
290 | } *cap_user_data_t; | |
291 | ||
292 | ||
293 | ||
294 | # 1 "include/linux/spinlock.h" 1 | |
295 | # 49 "include/linux/spinlock.h" | |
296 | # 1 "include/linux/preempt.h" 1 | |
297 | # 9 "include/linux/preempt.h" | |
298 | # 1 "include/linux/thread_info.h" 1 | |
299 | # 13 "include/linux/thread_info.h" | |
300 | struct restart_block { | |
301 | long (*fn)(struct restart_block *); | |
302 | unsigned long arg0, arg1, arg2, arg3; | |
303 | }; | |
304 | ||
305 | extern long do_no_restart_syscall(struct restart_block *parm); | |
306 | ||
307 | # 1 "include/linux/bitops.h" 1 | |
308 | # 9 "include/linux/bitops.h" | |
309 | # 1 "include/asm/bitops.h" 1 | |
310 | # 9 "include/asm/bitops.h" | |
311 | # 1 "include/asm/byteorder.h" 1 | |
312 | # 9 "include/asm/byteorder.h" | |
313 | static __inline__ __attribute__((always_inline)) __attribute__((__const__)) __u32 ___arch__swahb32(__u32 xx) | |
314 | { | |
315 | __u32 tmp; | |
316 | __asm__("%1 = %0 >> 8 (V);\n\t" | |
317 | "%0 = %0 << 8 (V);\n\t" | |
318 | "%0 = %0 | %1;\n\t" | |
319 | : "+d"(xx), "=&d"(tmp)); | |
320 | return xx; | |
321 | } | |
322 | ||
323 | static __inline__ __attribute__((always_inline)) __attribute__((__const__)) __u32 ___arch__swahw32(__u32 xx) | |
324 | { | |
325 | __u32 rv; | |
326 | __asm__("%0 = PACK(%1.L, %1.H);\n\t": "=d"(rv): "d"(xx)); | |
327 | return rv; | |
328 | } | |
329 | ||
330 | ||
331 | ||
332 | ||
333 | ||
334 | static __inline__ __attribute__((always_inline)) __attribute__((__const__)) __u16 ___arch__swab16(__u16 xx) | |
335 | { | |
336 | __u32 xw = xx; | |
337 | __asm__("%0 <<= 8;\n %0.L = %0.L + %0.H (NS);\n": "+d"(xw)); | |
338 | return (__u16)xw; | |
339 | } | |
340 | # 46 "include/asm/byteorder.h" | |
341 | # 1 "include/linux/byteorder/little_endian.h" 1 | |
342 | # 12 "include/linux/byteorder/little_endian.h" | |
343 | # 1 "include/linux/byteorder/swab.h" 1 | |
344 | # 133 "include/linux/byteorder/swab.h" | |
345 | static __inline__ __attribute__((always_inline)) __attribute__((__const__)) __u16 __fswab16(__u16 x) | |
346 | { | |
347 | return ___arch__swab16(x); | |
348 | } | |
349 | static __inline__ __attribute__((always_inline)) __u16 __swab16p(const __u16 *x) | |
350 | { | |
351 | return ___arch__swab16(*(x)); | |
352 | } | |
353 | static __inline__ __attribute__((always_inline)) void __swab16s(__u16 *addr) | |
354 | { | |
355 | do { *(addr) = ___arch__swab16(*((addr))); } while (0); | |
356 | } | |
357 | ||
358 | static __inline__ __attribute__((always_inline)) __attribute__((__const__)) __u32 __fswab32(__u32 x) | |
359 | { | |
360 | return ___arch__swahb32(___arch__swahw32(x)); | |
361 | } | |
362 | static __inline__ __attribute__((always_inline)) __u32 __swab32p(const __u32 *x) | |
363 | { | |
364 | return ___arch__swahb32(___arch__swahw32(*(x))); | |
365 | } | |
366 | static __inline__ __attribute__((always_inline)) void __swab32s(__u32 *addr) | |
367 | { | |
368 | do { *(addr) = ___arch__swahb32(___arch__swahw32(*((addr)))); } while (0); | |
369 | } | |
370 | ||
371 | ||
372 | static __inline__ __attribute__((always_inline)) __attribute__((__const__)) __u64 __fswab64(__u64 x) | |
373 | { | |
374 | ||
375 | __u32 h = x >> 32; | |
376 | __u32 l = x & ((1ULL<<32)-1); | |
377 | return (((__u64)__fswab32(l)) << 32) | ((__u64)(__fswab32(h))); | |
378 | ||
379 | ||
380 | ||
381 | } | |
382 | static __inline__ __attribute__((always_inline)) __u64 __swab64p(const __u64 *x) | |
383 | { | |
384 | return ({ __u64 __tmp = (*(x)) ; ({ __u64 __x = (__tmp); ((__u64)( (__u64)(((__u64)(__x) & (__u64)0x00000000000000ffULL) << 56) | (__u64)(((__u64)(__x) & (__u64)0x000000000000ff00ULL) << 40) | (__u64)(((__u64)(__x) & (__u64)0x0000000000ff0000ULL) << 24) | (__u64)(((__u64)(__x) & (__u64)0x00000000ff000000ULL) << 8) | (__u64)(((__u64)(__x) & (__u64)0x000000ff00000000ULL) >> 8) | (__u64)(((__u64)(__x) & (__u64)0x0000ff0000000000ULL) >> 24) | (__u64)(((__u64)(__x) & (__u64)0x00ff000000000000ULL) >> 40) | (__u64)(((__u64)(__x) & (__u64)0xff00000000000000ULL) >> 56) )); }); }); | |
385 | } | |
386 | static __inline__ __attribute__((always_inline)) void __swab64s(__u64 *addr) | |
387 | { | |
388 | do { *(addr) = ({ __u64 __tmp = (*((addr))) ; ({ __u64 __x = (__tmp); ((__u64)( (__u64)(((__u64)(__x) & (__u64)0x00000000000000ffULL) << 56) | (__u64)(((__u64)(__x) & (__u64)0x000000000000ff00ULL) << 40) | (__u64)(((__u64)(__x) & (__u64)0x0000000000ff0000ULL) << 24) | (__u64)(((__u64)(__x) & (__u64)0x00000000ff000000ULL) << 8) | (__u64)(((__u64)(__x) & (__u64)0x000000ff00000000ULL) >> 8) | (__u64)(((__u64)(__x) & (__u64)0x0000ff0000000000ULL) >> 24) | (__u64)(((__u64)(__x) & (__u64)0x00ff000000000000ULL) >> 40) | (__u64)(((__u64)(__x) & (__u64)0xff00000000000000ULL) >> 56) )); }); }); } while (0); | |
389 | } | |
390 | # 13 "include/linux/byteorder/little_endian.h" 2 | |
391 | # 43 "include/linux/byteorder/little_endian.h" | |
392 | static inline __attribute__((always_inline)) __le64 __cpu_to_le64p(const __u64 *p) | |
393 | { | |
394 | return ( __le64)*p; | |
395 | } | |
396 | static inline __attribute__((always_inline)) __u64 __le64_to_cpup(const __le64 *p) | |
397 | { | |
398 | return ( __u64)*p; | |
399 | } | |
400 | static inline __attribute__((always_inline)) __le32 __cpu_to_le32p(const __u32 *p) | |
401 | { | |
402 | return ( __le32)*p; | |
403 | } | |
404 | static inline __attribute__((always_inline)) __u32 __le32_to_cpup(const __le32 *p) | |
405 | { | |
406 | return ( __u32)*p; | |
407 | } | |
408 | static inline __attribute__((always_inline)) __le16 __cpu_to_le16p(const __u16 *p) | |
409 | { | |
410 | return ( __le16)*p; | |
411 | } | |
412 | static inline __attribute__((always_inline)) __u16 __le16_to_cpup(const __le16 *p) | |
413 | { | |
414 | return ( __u16)*p; | |
415 | } | |
416 | static inline __attribute__((always_inline)) __be64 __cpu_to_be64p(const __u64 *p) | |
417 | { | |
418 | return ( __be64)__swab64p(p); | |
419 | } | |
420 | static inline __attribute__((always_inline)) __u64 __be64_to_cpup(const __be64 *p) | |
421 | { | |
422 | return __swab64p((__u64 *)p); | |
423 | } | |
424 | static inline __attribute__((always_inline)) __be32 __cpu_to_be32p(const __u32 *p) | |
425 | { | |
426 | return ( __be32)__swab32p(p); | |
427 | } | |
428 | static inline __attribute__((always_inline)) __u32 __be32_to_cpup(const __be32 *p) | |
429 | { | |
430 | return __swab32p((__u32 *)p); | |
431 | } | |
432 | static inline __attribute__((always_inline)) __be16 __cpu_to_be16p(const __u16 *p) | |
433 | { | |
434 | return ( __be16)__swab16p(p); | |
435 | } | |
436 | static inline __attribute__((always_inline)) __u16 __be16_to_cpup(const __be16 *p) | |
437 | { | |
438 | return __swab16p((__u16 *)p); | |
439 | } | |
440 | # 104 "include/linux/byteorder/little_endian.h" | |
441 | # 1 "include/linux/byteorder/generic.h" 1 | |
442 | # 154 "include/linux/byteorder/generic.h" | |
443 | extern __u32 ntohl(__be32); | |
444 | extern __be32 htonl(__u32); | |
445 | extern __u16 ntohs(__be16); | |
446 | extern __be16 htons(__u16); | |
447 | # 105 "include/linux/byteorder/little_endian.h" 2 | |
448 | # 47 "include/asm/byteorder.h" 2 | |
449 | # 10 "include/asm/bitops.h" 2 | |
450 | # 1 "include/asm/system.h" 1 | |
451 | # 40 "include/asm/system.h" | |
452 | # 1 "include/linux/linkage.h" 1 | |
453 | ||
454 | ||
455 | ||
456 | # 1 "include/asm/linkage.h" 1 | |
457 | # 5 "include/linux/linkage.h" 2 | |
458 | # 41 "include/asm/system.h" 2 | |
459 | ||
460 | ||
461 | ||
462 | ||
463 | ||
464 | ||
465 | extern unsigned long irq_flags; | |
466 | # 146 "include/asm/system.h" | |
467 | struct __xchg_dummy { | |
468 | unsigned long a[100]; | |
469 | }; | |
470 | ||
471 | ||
472 | static inline __attribute__((always_inline)) unsigned long __xchg(unsigned long x, volatile void *ptr, | |
473 | int size) | |
474 | { | |
475 | unsigned long tmp = 0; | |
476 | unsigned long flags = 0; | |
477 | ||
478 | do { __asm__ __volatile__ ( "cli %0;" :"=&d"(flags):); } while (0); | |
479 | ||
480 | switch (size) { | |
481 | case 1: | |
482 | __asm__ __volatile__ | |
483 | ("%0 = b%2 (z);\n\t" | |
484 | "b%2 = %1;\n\t" | |
485 | : "=&d" (tmp) : "d" (x), "m" (*((volatile struct __xchg_dummy *)(ptr))) : "memory"); | |
486 | break; | |
487 | case 2: | |
488 | __asm__ __volatile__ | |
489 | ("%0 = w%2 (z);\n\t" | |
490 | "w%2 = %1;\n\t" | |
491 | : "=&d" (tmp) : "d" (x), "m" (*((volatile struct __xchg_dummy *)(ptr))) : "memory"); | |
492 | break; | |
493 | case 4: | |
494 | __asm__ __volatile__ | |
495 | ("%0 = %2;\n\t" | |
496 | "%2 = %1;\n\t" | |
497 | : "=&d" (tmp) : "d" (x), "m" (*((volatile struct __xchg_dummy *)(ptr))) : "memory"); | |
498 | break; | |
499 | } | |
500 | do { if (((flags) != 0x1f)) do { __asm__ __volatile__ ( "sti %0;" ::"d"(irq_flags)); } while (0); } while (0); | |
501 | return tmp; | |
502 | } | |
503 | ||
504 | ||
505 | ||
506 | ||
507 | ||
508 | ||
509 | static inline __attribute__((always_inline)) unsigned long __cmpxchg(volatile void *ptr, unsigned long old, | |
510 | unsigned long new, int size) | |
511 | { | |
512 | unsigned long tmp = 0; | |
513 | unsigned long flags = 0; | |
514 | ||
515 | do { __asm__ __volatile__ ( "cli %0;" :"=&d"(flags):); } while (0); | |
516 | ||
517 | switch (size) { | |
518 | case 1: | |
519 | __asm__ __volatile__ | |
520 | ("%0 = b%3 (z);\n\t" | |
521 | "CC = %1 == %0;\n\t" | |
522 | "IF !CC JUMP 1f;\n\t" | |
523 | "b%3 = %2;\n\t" | |
524 | "1:\n\t" | |
525 | : "=&d" (tmp) : "d" (old), "d" (new), "m" (*((volatile struct __xchg_dummy *)(ptr))) : "memory"); | |
526 | break; | |
527 | case 2: | |
528 | __asm__ __volatile__ | |
529 | ("%0 = w%3 (z);\n\t" | |
530 | "CC = %1 == %0;\n\t" | |
531 | "IF !CC JUMP 1f;\n\t" | |
532 | "w%3 = %2;\n\t" | |
533 | "1:\n\t" | |
534 | : "=&d" (tmp) : "d" (old), "d" (new), "m" (*((volatile struct __xchg_dummy *)(ptr))) : "memory"); | |
535 | break; | |
536 | case 4: | |
537 | __asm__ __volatile__ | |
538 | ("%0 = %3;\n\t" | |
539 | "CC = %1 == %0;\n\t" | |
540 | "IF !CC JUMP 1f;\n\t" | |
541 | "%3 = %2;\n\t" | |
542 | "1:\n\t" | |
543 | : "=&d" (tmp) : "d" (old), "d" (new), "m" (*((volatile struct __xchg_dummy *)(ptr))) : "memory"); | |
544 | break; | |
545 | } | |
546 | do { if (((flags) != 0x1f)) do { __asm__ __volatile__ ( "sti %0;" ::"d"(irq_flags)); } while (0); } while (0); | |
547 | return tmp; | |
548 | } | |
549 | # 240 "include/asm/system.h" | |
550 | # 1 "include/asm/blackfin.h" 1 | |
551 | # 9 "include/asm/blackfin.h" | |
552 | # 1 "include/asm/macros.h" 1 | |
553 | # 10 "include/asm/blackfin.h" 2 | |
554 | # 1 "include/asm/mach/blackfin.h" 1 | |
555 | # 37 "include/asm/mach/blackfin.h" | |
556 | # 1 "include/asm/mach/bf537.h" 1 | |
557 | # 35 "include/asm/mach/bf537.h" | |
558 | # 1 "include/linux/config.h" 1 | |
559 | ||
560 | ||
561 | ||
562 | ||
563 | ||
564 | # 1 "include/linux/autoconf.h" 1 | |
565 | # 7 "include/linux/config.h" 2 | |
566 | # 36 "include/asm/mach/bf537.h" 2 | |
567 | # 38 "include/asm/mach/blackfin.h" 2 | |
568 | # 1 "include/asm/mach/mem_map.h" 1 | |
569 | # 39 "include/asm/mach/blackfin.h" 2 | |
570 | # 1 "include/asm/mach/defBF534.h" 1 | |
571 | # 36 "include/asm/mach/defBF534.h" | |
572 | # 1 "include/asm/mach-common/def_LPBlackfin.h" 1 | |
573 | # 37 "include/asm/mach-common/def_LPBlackfin.h" | |
574 | # 1 "include/asm/mach/anomaly.h" 1 | |
575 | # 38 "include/asm/mach-common/def_LPBlackfin.h" 2 | |
576 | # 37 "include/asm/mach/defBF534.h" 2 | |
577 | # 40 "include/asm/mach/blackfin.h" 2 | |
578 | # 1 "include/asm/mach/anomaly.h" 1 | |
579 | # 41 "include/asm/mach/blackfin.h" 2 | |
580 | ||
581 | ||
582 | # 1 "include/asm/mach/defBF537.h" 1 | |
583 | # 36 "include/asm/mach/defBF537.h" | |
584 | # 1 "include/asm/mach/defBF537.h" 1 | |
585 | # 37 "include/asm/mach/defBF537.h" 2 | |
586 | ||
587 | ||
588 | # 1 "include/asm/mach-common/cdef_LPBlackfin.h" 1 | |
589 | # 40 "include/asm/mach/defBF537.h" 2 | |
590 | # 44 "include/asm/mach/blackfin.h" 2 | |
591 | ||
592 | ||
593 | ||
594 | # 1 "include/asm/mach/cdefBF534.h" 1 | |
595 | # 41 "include/asm/mach/cdefBF534.h" | |
596 | # 1 "include/asm/system.h" 1 | |
597 | # 42 "include/asm/mach/cdefBF534.h" 2 | |
598 | # 50 "include/asm/mach/cdefBF534.h" | |
599 | static __inline__ __attribute__((always_inline)) void bfin_write_VR_CTL(unsigned int val) | |
600 | { | |
601 | unsigned long flags, iwr; | |
602 | ||
603 | ({ __asm__ __volatile__ ( "w[%0] = %1;\n\t" : : "a"(0xFFC00008) , "d"(val) : "memory");}); | |
604 | __builtin_bfin_ssync(); | |
605 | ||
606 | iwr = ({ unsigned __v; __asm__ __volatile__ ( "%0 = [%1];\n\t" : "=d"(__v) : "a"(0xFFC00124)); __v; }); | |
607 | ||
608 | ({ __asm__ __volatile__ ( "[%0] = %1;\n\t" : : "a"(0xFFC00124) , "d"((1 << ((0)&0x1F))) : "memory");}); | |
609 | do { __asm__ __volatile__ ( "cli %0;" :"=&d"(flags):); } while (0); | |
610 | asm("IDLE;"); | |
611 | do { if (((flags) != 0x1f)) do { __asm__ __volatile__ ( "sti %0;" ::"d"(irq_flags)); } while (0); } while (0); | |
612 | ({ __asm__ __volatile__ ( "[%0] = %1;\n\t" : : "a"(0xFFC00124) , "d"(iwr) : "memory");}); | |
613 | } | |
614 | # 48 "include/asm/mach/blackfin.h" 2 | |
615 | # 74 "include/asm/mach/blackfin.h" | |
616 | # 1 "include/asm/mach/cdefBF537.h" 1 | |
617 | # 75 "include/asm/mach/blackfin.h" 2 | |
618 | # 11 "include/asm/blackfin.h" 2 | |
619 | # 1 "include/asm/bfin-global.h" 1 | |
620 | # 36 "include/asm/bfin-global.h" | |
621 | # 1 "include/asm-generic/sections.h" 1 | |
622 | ||
623 | ||
624 | ||
625 | ||
626 | ||
627 | extern char _text[], _stext[], _etext[]; | |
628 | extern char _data[], _sdata[], _edata[]; | |
629 | extern char __bss_start[], __bss_stop[]; | |
630 | extern char __init_begin[], __init_end[]; | |
631 | extern char _sinittext[], _einittext[]; | |
632 | extern char _sextratext[] __attribute__((weak)); | |
633 | extern char _eextratext[] __attribute__((weak)); | |
634 | extern char _end[]; | |
635 | extern char __per_cpu_start[], __per_cpu_end[]; | |
636 | extern char __kprobes_text_start[], __kprobes_text_end[]; | |
637 | extern char __initdata_begin[], __initdata_end[]; | |
638 | extern char __start_rodata[], __end_rodata[]; | |
639 | # 37 "include/asm/bfin-global.h" 2 | |
640 | # 1 "include/asm/ptrace.h" 1 | |
641 | # 24 "include/asm/ptrace.h" | |
642 | struct pt_regs { | |
643 | long orig_pc; | |
644 | long ipend; | |
645 | long seqstat; | |
646 | long rete; | |
647 | long retn; | |
648 | long retx; | |
649 | long pc; | |
650 | long rets; | |
651 | long reserved; | |
652 | long astat; | |
653 | long lb1; | |
654 | long lb0; | |
655 | long lt1; | |
656 | long lt0; | |
657 | long lc1; | |
658 | long lc0; | |
659 | long a1w; | |
660 | long a1x; | |
661 | long a0w; | |
662 | long a0x; | |
663 | long b3; | |
664 | long b2; | |
665 | long b1; | |
666 | long b0; | |
667 | long l3; | |
668 | long l2; | |
669 | long l1; | |
670 | long l0; | |
671 | long m3; | |
672 | long m2; | |
673 | long m1; | |
674 | long m0; | |
675 | long i3; | |
676 | long i2; | |
677 | long i1; | |
678 | long i0; | |
679 | long usp; | |
680 | long fp; | |
681 | long p5; | |
682 | long p4; | |
683 | long p3; | |
684 | long p2; | |
685 | long p1; | |
686 | long p0; | |
687 | long r7; | |
688 | long r6; | |
689 | long r5; | |
690 | long r4; | |
691 | long r3; | |
692 | long r2; | |
693 | long r1; | |
694 | long r0; | |
695 | long orig_r0; | |
696 | long orig_p0; | |
697 | long syscfg; | |
698 | }; | |
699 | # 99 "include/asm/ptrace.h" | |
700 | extern void show_regs(struct pt_regs *); | |
701 | # 38 "include/asm/bfin-global.h" 2 | |
702 | # 1 "include/asm/user.h" 1 | |
703 | # 10 "include/asm/user.h" | |
704 | # 1 "include/asm/page.h" 1 | |
705 | # 12 "include/asm/page.h" | |
706 | # 1 "include/asm/setup.h" 1 | |
707 | # 13 "include/asm/page.h" 2 | |
708 | # 28 "include/asm/page.h" | |
709 | typedef struct { | |
710 | unsigned long pte; | |
711 | } pte_t; | |
712 | typedef struct { | |
713 | unsigned long pmd[16]; | |
714 | } pmd_t; | |
715 | typedef struct { | |
716 | unsigned long pgd; | |
717 | } pgd_t; | |
718 | typedef struct { | |
719 | unsigned long pgprot; | |
720 | } pgprot_t; | |
721 | # 54 "include/asm/page.h" | |
722 | extern unsigned long memory_start; | |
723 | extern unsigned long memory_end; | |
724 | ||
725 | ||
726 | ||
727 | # 1 "include/asm/page_offset.h" 1 | |
728 | # 60 "include/asm/page.h" 2 | |
729 | # 1 "include/asm/io.h" 1 | |
730 | # 97 "include/asm/io.h" | |
731 | extern void outsb(void *port, const void *addr, unsigned long count); | |
732 | extern void outsw(void *port, const void *addr, unsigned long count); | |
733 | extern void outsl(void *port, const void *addr, unsigned long count); | |
734 | ||
735 | extern void insb(const void *port, void *addr, unsigned long count); | |
736 | extern void insw(const void *port, void *addr, unsigned long count); | |
737 | extern void insl(const void *port, void *addr, unsigned long count); | |
738 | ||
739 | extern void *__ioremap(unsigned long physaddr, unsigned long size, | |
740 | int cacheflag); | |
741 | extern void iounmap(void *addr); | |
742 | ||
743 | static inline __attribute__((always_inline)) void *ioremap(unsigned long physaddr, unsigned long size) | |
744 | { | |
745 | return __ioremap(physaddr, size, 1); | |
746 | } | |
747 | static inline __attribute__((always_inline)) void *ioremap_nocache(unsigned long physaddr, | |
748 | unsigned long size) | |
749 | { | |
750 | return __ioremap(physaddr, size, 1); | |
751 | } | |
752 | ||
753 | extern void blkfin_inv_cache_all(void); | |
754 | # 61 "include/asm/page.h" 2 | |
755 | # 84 "include/asm/page.h" | |
756 | # 1 "include/asm-generic/page.h" 1 | |
757 | # 10 "include/asm-generic/page.h" | |
758 | static __inline__ __attribute__((always_inline)) __attribute__((__const__)) int get_order(unsigned long size) | |
759 | { | |
760 | int order; | |
761 | ||
762 | size = (size - 1) >> (12 - 1); | |
763 | order = -1; | |
764 | do { | |
765 | size >>= 1; | |
766 | order++; | |
767 | } while (size); | |
768 | return order; | |
769 | } | |
770 | # 85 "include/asm/page.h" 2 | |
771 | # 11 "include/asm/user.h" 2 | |
772 | # 38 "include/asm/user.h" | |
773 | struct user_bfinfp_struct { | |
774 | }; | |
775 | ||
776 | ||
777 | ||
778 | ||
779 | struct user_regs_struct { | |
780 | long r0, r1, r2, r3, r4, r5, r6, r7; | |
781 | long p0, p1, p2, p3, p4, p5, usp, fp; | |
782 | long i0, i1, i2, i3; | |
783 | long l0, l1, l2, l3; | |
784 | long b0, b1, b2, b3; | |
785 | long m0, m1, m2, m3; | |
786 | long a0w, a1w; | |
787 | long a0x, a1x; | |
788 | unsigned long rets; | |
789 | unsigned long astat; | |
790 | unsigned long pc; | |
791 | unsigned long orig_p0; | |
792 | }; | |
793 | ||
794 | ||
795 | ||
796 | ||
797 | ||
798 | struct user { | |
799 | ||
800 | ||
801 | ||
802 | struct user_regs_struct regs; | |
803 | ||
804 | ||
805 | unsigned long int u_tsize; | |
806 | unsigned long int u_dsize; | |
807 | unsigned long int u_ssize; | |
808 | unsigned long start_code; | |
809 | unsigned long start_stack; | |
810 | ||
811 | ||
812 | ||
813 | long int signal; | |
814 | int reserved; | |
815 | struct user_regs_struct *u_ar0; | |
816 | ||
817 | ||
818 | unsigned long magic; | |
819 | char u_comm[32]; | |
820 | }; | |
821 | # 39 "include/asm/bfin-global.h" 2 | |
822 | # 49 "include/asm/bfin-global.h" | |
823 | extern unsigned long get_cclk(void); | |
824 | extern unsigned long get_sclk(void); | |
825 | ||
826 | extern void dump_thread(struct pt_regs *regs, struct user *dump); | |
827 | extern void dump_bfin_regs(struct pt_regs *fp, void *retaddr); | |
828 | extern void dump_bfin_trace_buffer(void); | |
829 | ||
830 | extern int init_arch_irq(void); | |
831 | extern void bfin_reset(void); | |
832 | extern void _cplb_hdr(void); | |
833 | ||
834 | extern void bfin_icache_init(void); | |
835 | extern void bfin_dcache_init(void); | |
836 | extern int read_iloc(void); | |
837 | extern int bfin_console_init(void); | |
838 | extern void lower_to_irq14(void); | |
839 | extern void init_dma(void); | |
840 | extern void program_IAR(void); | |
841 | extern void evt14_softirq(void); | |
842 | extern void asm_do_IRQ(unsigned int irq, struct pt_regs *regs); | |
843 | extern void bfin_gpio_interrupt_setup(int irq, int irq_pfx, int type); | |
844 | ||
845 | extern void *l1_data_A_sram_alloc(size_t); | |
846 | extern void *l1_data_B_sram_alloc(size_t); | |
847 | extern void *l1_inst_sram_alloc(size_t); | |
848 | extern void *l1_data_sram_zalloc(size_t); | |
849 | extern int l1_data_A_sram_free(const void*); | |
850 | extern int l1_data_B_sram_free(const void*); | |
851 | extern int l1_inst_sram_free(const void*); | |
852 | extern int l1_data_sram_free(const void*); | |
853 | extern int sram_free(const void*); | |
854 | ||
855 | ||
856 | ||
857 | ||
858 | ||
859 | extern void *sram_alloc_with_lsl(size_t, unsigned long); | |
860 | extern int sram_free_with_lsl(const void*); | |
861 | ||
862 | extern void led_on(int); | |
863 | extern void led_off(int); | |
864 | extern void led_toggle(int); | |
865 | extern void led_disp_num(int); | |
866 | extern void led_toggle_num(int); | |
867 | ||
868 | extern char *bfin_board_name __attribute__ ((weak)); | |
869 | extern unsigned long wall_jiffies; | |
870 | extern unsigned long memory_end; | |
871 | extern unsigned long memory_mtd_end; | |
872 | extern unsigned long memory_mtd_start; | |
873 | extern unsigned long mtd_size; | |
874 | extern unsigned long ipdt_table[]; | |
875 | extern unsigned long dpdt_table[]; | |
876 | extern unsigned long icplb_table[]; | |
877 | extern unsigned long dcplb_table[]; | |
878 | ||
879 | extern unsigned long ipdt_swapcount_table[]; | |
880 | extern unsigned long dpdt_swapcount_table[]; | |
881 | ||
882 | extern unsigned long table_start, table_end; | |
883 | ||
884 | extern struct file_operations dpmc_fops; | |
885 | extern char _start; | |
886 | extern unsigned long _ramstart, _ramend, _rambase; | |
887 | extern unsigned long memory_start, memory_end; | |
888 | extern unsigned long memory_mtd_end; | |
889 | extern char _stext_l1[], _etext_l1[], _sdata_l1[], _edata_l1[], _sbss_l1[], | |
890 | _ebss_l1[], _l1_lma_start[]; | |
891 | # 12 "include/asm/blackfin.h" 2 | |
892 | # 241 "include/asm/system.h" 2 | |
893 | ||
894 | struct task_struct *resume(struct task_struct *prev, struct task_struct *next); | |
895 | # 11 "include/asm/bitops.h" 2 | |
896 | ||
897 | ||
898 | ||
899 | # 1 "include/asm-generic/bitops/ffs.h" 1 | |
900 | # 12 "include/asm-generic/bitops/ffs.h" | |
901 | static inline __attribute__((always_inline)) int ffs(int x) | |
902 | { | |
903 | int r = 1; | |
904 | ||
905 | if (!x) | |
906 | return 0; | |
907 | if (!(x & 0xffff)) { | |
908 | x >>= 16; | |
909 | r += 16; | |
910 | } | |
911 | if (!(x & 0xff)) { | |
912 | x >>= 8; | |
913 | r += 8; | |
914 | } | |
915 | if (!(x & 0xf)) { | |
916 | x >>= 4; | |
917 | r += 4; | |
918 | } | |
919 | if (!(x & 3)) { | |
920 | x >>= 2; | |
921 | r += 2; | |
922 | } | |
923 | if (!(x & 1)) { | |
924 | x >>= 1; | |
925 | r += 1; | |
926 | } | |
927 | return r; | |
928 | } | |
929 | # 15 "include/asm/bitops.h" 2 | |
930 | # 1 "include/asm-generic/bitops/__ffs.h" 1 | |
931 | # 12 "include/asm-generic/bitops/__ffs.h" | |
932 | static inline __attribute__((always_inline)) unsigned long __ffs(unsigned long word) | |
933 | { | |
934 | int num = 0; | |
935 | ||
936 | ||
937 | ||
938 | ||
939 | ||
940 | ||
941 | ||
942 | if ((word & 0xffff) == 0) { | |
943 | num += 16; | |
944 | word >>= 16; | |
945 | } | |
946 | if ((word & 0xff) == 0) { | |
947 | num += 8; | |
948 | word >>= 8; | |
949 | } | |
950 | if ((word & 0xf) == 0) { | |
951 | num += 4; | |
952 | word >>= 4; | |
953 | } | |
954 | if ((word & 0x3) == 0) { | |
955 | num += 2; | |
956 | word >>= 2; | |
957 | } | |
958 | if ((word & 0x1) == 0) | |
959 | num += 1; | |
960 | return num; | |
961 | } | |
962 | # 16 "include/asm/bitops.h" 2 | |
963 | # 1 "include/asm-generic/bitops/sched.h" 1 | |
964 | # 13 "include/asm-generic/bitops/sched.h" | |
965 | static inline __attribute__((always_inline)) int sched_find_first_bit(const unsigned long *b) | |
966 | { | |
967 | ||
968 | ||
969 | ||
970 | ||
971 | ||
972 | ||
973 | ||
974 | if (__builtin_expect(!!(b[0]), 0)) | |
975 | return __ffs(b[0]); | |
976 | if (__builtin_expect(!!(b[1]), 0)) | |
977 | return __ffs(b[1]) + 32; | |
978 | if (__builtin_expect(!!(b[2]), 0)) | |
979 | return __ffs(b[2]) + 64; | |
980 | if (b[3]) | |
981 | return __ffs(b[3]) + 96; | |
982 | return __ffs(b[4]) + 128; | |
983 | ||
984 | ||
985 | ||
986 | } | |
987 | # 17 "include/asm/bitops.h" 2 | |
988 | # 1 "include/asm-generic/bitops/ffz.h" 1 | |
989 | # 18 "include/asm/bitops.h" 2 | |
990 | ||
991 | static __inline__ __attribute__((always_inline)) void set_bit(int nr, volatile unsigned long *addr) | |
992 | { | |
993 | int *a = (int *)addr; | |
994 | int mask; | |
995 | unsigned long flags; | |
996 | ||
997 | a += nr >> 5; | |
998 | mask = 1 << (nr & 0x1f); | |
999 | do { __asm__ __volatile__ ( "cli %0;" :"=&d"(flags):); } while (0); | |
1000 | *a |= mask; | |
1001 | do { if (((flags) != 0x1f)) do { __asm__ __volatile__ ( "sti %0;" ::"d"(irq_flags)); } while (0); } while (0); | |
1002 | } | |
1003 | ||
1004 | static __inline__ __attribute__((always_inline)) void __set_bit(int nr, volatile unsigned long *addr) | |
1005 | { | |
1006 | int *a = (int *)addr; | |
1007 | int mask; | |
1008 | ||
1009 | a += nr >> 5; | |
1010 | mask = 1 << (nr & 0x1f); | |
1011 | *a |= mask; | |
1012 | } | |
1013 | ||
1014 | ||
1015 | ||
1016 | ||
1017 | ||
1018 | ||
1019 | ||
1020 | static __inline__ __attribute__((always_inline)) void clear_bit(int nr, volatile unsigned long *addr) | |
1021 | { | |
1022 | int *a = (int *)addr; | |
1023 | int mask; | |
1024 | unsigned long flags; | |
1025 | a += nr >> 5; | |
1026 | mask = 1 << (nr & 0x1f); | |
1027 | do { __asm__ __volatile__ ( "cli %0;" :"=&d"(flags):); } while (0); | |
1028 | *a &= ~mask; | |
1029 | do { if (((flags) != 0x1f)) do { __asm__ __volatile__ ( "sti %0;" ::"d"(irq_flags)); } while (0); } while (0); | |
1030 | } | |
1031 | ||
1032 | static __inline__ __attribute__((always_inline)) void __clear_bit(int nr, volatile unsigned long *addr) | |
1033 | { | |
1034 | int *a = (int *)addr; | |
1035 | int mask; | |
1036 | ||
1037 | a += nr >> 5; | |
1038 | mask = 1 << (nr & 0x1f); | |
1039 | *a &= ~mask; | |
1040 | } | |
1041 | ||
1042 | static __inline__ __attribute__((always_inline)) void change_bit(int nr, volatile unsigned long *addr) | |
1043 | { | |
1044 | int mask, flags; | |
1045 | unsigned long *ADDR = (unsigned long *)addr; | |
1046 | ||
1047 | ADDR += nr >> 5; | |
1048 | mask = 1 << (nr & 31); | |
1049 | do { __asm__ __volatile__ ( "cli %0;" :"=&d"(flags):); } while (0); | |
1050 | *ADDR ^= mask; | |
1051 | do { if (((flags) != 0x1f)) do { __asm__ __volatile__ ( "sti %0;" ::"d"(irq_flags)); } while (0); } while (0); | |
1052 | } | |
1053 | ||
1054 | static __inline__ __attribute__((always_inline)) void __change_bit(int nr, volatile unsigned long *addr) | |
1055 | { | |
1056 | int mask; | |
1057 | unsigned long *ADDR = (unsigned long *)addr; | |
1058 | ||
1059 | ADDR += nr >> 5; | |
1060 | mask = 1 << (nr & 31); | |
1061 | *ADDR ^= mask; | |
1062 | } | |
1063 | ||
1064 | static __inline__ __attribute__((always_inline)) int test_and_set_bit(int nr, void *addr) | |
1065 | { | |
1066 | int mask, retval; | |
1067 | volatile unsigned int *a = (volatile unsigned int *)addr; | |
1068 | unsigned long flags; | |
1069 | ||
1070 | a += nr >> 5; | |
1071 | mask = 1 << (nr & 0x1f); | |
1072 | do { __asm__ __volatile__ ( "cli %0;" :"=&d"(flags):); } while (0); | |
1073 | retval = (mask & *a) != 0; | |
1074 | *a |= mask; | |
1075 | do { if (((flags) != 0x1f)) do { __asm__ __volatile__ ( "sti %0;" ::"d"(irq_flags)); } while (0); } while (0); | |
1076 | ||
1077 | return retval; | |
1078 | } | |
1079 | ||
1080 | static __inline__ __attribute__((always_inline)) int __test_and_set_bit(int nr, volatile unsigned long *addr) | |
1081 | { | |
1082 | int mask, retval; | |
1083 | volatile unsigned int *a = (volatile unsigned int *)addr; | |
1084 | ||
1085 | a += nr >> 5; | |
1086 | mask = 1 << (nr & 0x1f); | |
1087 | retval = (mask & *a) != 0; | |
1088 | *a |= mask; | |
1089 | return retval; | |
1090 | } | |
1091 | ||
1092 | static __inline__ __attribute__((always_inline)) int test_and_clear_bit(int nr, volatile unsigned long *addr) | |
1093 | { | |
1094 | int mask, retval; | |
1095 | volatile unsigned int *a = (volatile unsigned int *)addr; | |
1096 | unsigned long flags; | |
1097 | ||
1098 | a += nr >> 5; | |
1099 | mask = 1 << (nr & 0x1f); | |
1100 | do { __asm__ __volatile__ ( "cli %0;" :"=&d"(flags):); } while (0); | |
1101 | retval = (mask & *a) != 0; | |
1102 | *a &= ~mask; | |
1103 | do { if (((flags) != 0x1f)) do { __asm__ __volatile__ ( "sti %0;" ::"d"(irq_flags)); } while (0); } while (0); | |
1104 | ||
1105 | return retval; | |
1106 | } | |
1107 | ||
1108 | static __inline__ __attribute__((always_inline)) int __test_and_clear_bit(int nr, volatile unsigned long *addr) | |
1109 | { | |
1110 | int mask, retval; | |
1111 | volatile unsigned int *a = (volatile unsigned int *)addr; | |
1112 | ||
1113 | a += nr >> 5; | |
1114 | mask = 1 << (nr & 0x1f); | |
1115 | retval = (mask & *a) != 0; | |
1116 | *a &= ~mask; | |
1117 | return retval; | |
1118 | } | |
1119 | ||
1120 | static __inline__ __attribute__((always_inline)) int test_and_change_bit(int nr, volatile unsigned long *addr) | |
1121 | { | |
1122 | int mask, retval; | |
1123 | volatile unsigned int *a = (volatile unsigned int *)addr; | |
1124 | unsigned long flags; | |
1125 | ||
1126 | a += nr >> 5; | |
1127 | mask = 1 << (nr & 0x1f); | |
1128 | do { __asm__ __volatile__ ( "cli %0;" :"=&d"(flags):); } while (0); | |
1129 | retval = (mask & *a) != 0; | |
1130 | *a ^= mask; | |
1131 | do { if (((flags) != 0x1f)) do { __asm__ __volatile__ ( "sti %0;" ::"d"(irq_flags)); } while (0); } while (0); | |
1132 | return retval; | |
1133 | } | |
1134 | ||
1135 | static __inline__ __attribute__((always_inline)) int __test_and_change_bit(int nr, | |
1136 | volatile unsigned long *addr) | |
1137 | { | |
1138 | int mask, retval; | |
1139 | volatile unsigned int *a = (volatile unsigned int *)addr; | |
1140 | ||
1141 | a += nr >> 5; | |
1142 | mask = 1 << (nr & 0x1f); | |
1143 | retval = (mask & *a) != 0; | |
1144 | *a ^= mask; | |
1145 | return retval; | |
1146 | } | |
1147 | ||
1148 | ||
1149 | ||
1150 | ||
1151 | static __inline__ __attribute__((always_inline)) int __constant_test_bit(int nr, const void *addr) | |
1152 | { | |
1153 | return ((1UL << (nr & 31)) & | |
1154 | (((const volatile unsigned int *)addr)[nr >> 5])) != 0; | |
1155 | } | |
1156 | ||
1157 | static __inline__ __attribute__((always_inline)) int __test_bit(int nr, const void *addr) | |
1158 | { | |
1159 | int *a = (int *)addr; | |
1160 | int mask; | |
1161 | ||
1162 | a += nr >> 5; | |
1163 | mask = 1 << (nr & 0x1f); | |
1164 | return ((mask & *a) != 0); | |
1165 | } | |
1166 | ||
1167 | ||
1168 | ||
1169 | ||
1170 | ||
1171 | ||
1172 | # 1 "include/asm-generic/bitops/find.h" 1 | |
1173 | ||
1174 | ||
1175 | ||
1176 | extern unsigned long find_next_bit(const unsigned long *addr, unsigned long | |
1177 | size, unsigned long offset); | |
1178 | ||
1179 | extern unsigned long find_next_zero_bit(const unsigned long *addr, unsigned | |
1180 | long size, unsigned long offset); | |
1181 | # 201 "include/asm/bitops.h" 2 | |
1182 | # 1 "include/asm-generic/bitops/hweight.h" 1 | |
1183 | ||
1184 | ||
1185 | ||
1186 | ||
1187 | ||
1188 | extern unsigned int hweight32(unsigned int w); | |
1189 | extern unsigned int hweight16(unsigned int w); | |
1190 | extern unsigned int hweight8(unsigned int w); | |
1191 | extern unsigned long hweight64(__u64 w); | |
1192 | # 202 "include/asm/bitops.h" 2 | |
1193 | ||
1194 | # 1 "include/asm-generic/bitops/ext2-atomic.h" 1 | |
1195 | # 204 "include/asm/bitops.h" 2 | |
1196 | # 1 "include/asm-generic/bitops/ext2-non-atomic.h" 1 | |
1197 | ||
1198 | ||
1199 | ||
1200 | # 1 "include/asm-generic/bitops/le.h" 1 | |
1201 | # 5 "include/asm-generic/bitops/ext2-non-atomic.h" 2 | |
1202 | # 205 "include/asm/bitops.h" 2 | |
1203 | ||
1204 | # 1 "include/asm-generic/bitops/minix.h" 1 | |
1205 | # 207 "include/asm/bitops.h" 2 | |
1206 | ||
1207 | ||
1208 | ||
1209 | # 1 "include/asm-generic/bitops/fls.h" 1 | |
1210 | # 12 "include/asm-generic/bitops/fls.h" | |
1211 | static inline __attribute__((always_inline)) int fls(int x) | |
1212 | { | |
1213 | int r = 32; | |
1214 | ||
1215 | if (!x) | |
1216 | return 0; | |
1217 | if (!(x & 0xffff0000u)) { | |
1218 | x <<= 16; | |
1219 | r -= 16; | |
1220 | } | |
1221 | if (!(x & 0xff000000u)) { | |
1222 | x <<= 8; | |
1223 | r -= 8; | |
1224 | } | |
1225 | if (!(x & 0xf0000000u)) { | |
1226 | x <<= 4; | |
1227 | r -= 4; | |
1228 | } | |
1229 | if (!(x & 0xc0000000u)) { | |
1230 | x <<= 2; | |
1231 | r -= 2; | |
1232 | } | |
1233 | if (!(x & 0x80000000u)) { | |
1234 | x <<= 1; | |
1235 | r -= 1; | |
1236 | } | |
1237 | return r; | |
1238 | } | |
1239 | # 211 "include/asm/bitops.h" 2 | |
1240 | # 1 "include/asm-generic/bitops/fls64.h" 1 | |
1241 | ||
1242 | ||
1243 | ||
1244 | ||
1245 | ||
1246 | static inline __attribute__((always_inline)) int fls64(__u64 x) | |
1247 | { | |
1248 | __u32 h = x >> 32; | |
1249 | if (h) | |
1250 | return fls(h) + 32; | |
1251 | return fls(x); | |
1252 | } | |
1253 | # 212 "include/asm/bitops.h" 2 | |
1254 | # 10 "include/linux/bitops.h" 2 | |
1255 | ||
1256 | static __inline__ __attribute__((always_inline)) int get_bitmask_order(unsigned int count) | |
1257 | { | |
1258 | int order; | |
1259 | ||
1260 | order = fls(count); | |
1261 | return order; | |
1262 | } | |
1263 | ||
1264 | static __inline__ __attribute__((always_inline)) int get_count_order(unsigned int count) | |
1265 | { | |
1266 | int order; | |
1267 | ||
1268 | order = fls(count) - 1; | |
1269 | if (count & (count - 1)) | |
1270 | order++; | |
1271 | return order; | |
1272 | } | |
1273 | ||
1274 | static inline __attribute__((always_inline)) unsigned long hweight_long(unsigned long w) | |
1275 | { | |
1276 | return sizeof(w) == 4 ? hweight32(w) : hweight64(w); | |
1277 | } | |
1278 | ||
1279 | ||
1280 | ||
1281 | ||
1282 | ||
1283 | ||
1284 | ||
1285 | static inline __attribute__((always_inline)) __u32 rol32(__u32 word, unsigned int shift) | |
1286 | { | |
1287 | return (word << shift) | (word >> (32 - shift)); | |
1288 | } | |
1289 | ||
1290 | ||
1291 | ||
1292 | ||
1293 | ||
1294 | ||
1295 | ||
1296 | static inline __attribute__((always_inline)) __u32 ror32(__u32 word, unsigned int shift) | |
1297 | { | |
1298 | return (word >> shift) | (word << (32 - shift)); | |
1299 | } | |
1300 | ||
1301 | static inline __attribute__((always_inline)) unsigned fls_long(unsigned long l) | |
1302 | { | |
1303 | if (sizeof(l) == 4) | |
1304 | return fls(l); | |
1305 | return fls64(l); | |
1306 | } | |
1307 | # 21 "include/linux/thread_info.h" 2 | |
1308 | # 1 "include/asm/thread_info.h" 1 | |
1309 | # 32 "include/asm/thread_info.h" | |
1310 | # 1 "include/asm/entry.h" 1 | |
1311 | # 33 "include/asm/thread_info.h" 2 | |
1312 | # 1 "include/asm/l1layout.h" 1 | |
1313 | # 16 "include/asm/l1layout.h" | |
1314 | struct l1_scratch_task_info | |
1315 | { | |
1316 | ||
1317 | void *stack_start; | |
1318 | ||
1319 | ||
1320 | ||
1321 | void *lowest_sp; | |
1322 | }; | |
1323 | # 34 "include/asm/thread_info.h" 2 | |
1324 | # 45 "include/asm/thread_info.h" | |
1325 | typedef unsigned long mm_segment_t; | |
1326 | ||
1327 | ||
1328 | ||
1329 | ||
1330 | ||
1331 | ||
1332 | struct thread_info { | |
1333 | struct task_struct *task; | |
1334 | struct exec_domain *exec_domain; | |
1335 | unsigned long flags; | |
1336 | int cpu; | |
1337 | int preempt_count; | |
1338 | mm_segment_t addr_limit; | |
1339 | struct restart_block restart_block; | |
1340 | struct l1_scratch_task_info l1_task_info; | |
1341 | }; | |
1342 | # 87 "include/asm/thread_info.h" | |
1343 | static inline __attribute__((always_inline)) struct thread_info *current_thread_info(void) | |
1344 | __attribute__ ((__const__)); | |
1345 | ||
1346 | ||
1347 | ||
1348 | ||
1349 | static inline __attribute__((always_inline)) struct thread_info *current_thread_info(void) | |
1350 | { | |
1351 | struct thread_info *ti; | |
1352 | __asm__("%0 = sp;": "=&d"(ti): | |
1353 | ); | |
1354 | return (struct thread_info *)((long)ti & ~8191UL); | |
1355 | } | |
1356 | # 22 "include/linux/thread_info.h" 2 | |
1357 | # 30 "include/linux/thread_info.h" | |
1358 | static inline __attribute__((always_inline)) void set_ti_thread_flag(struct thread_info *ti, int flag) | |
1359 | { | |
1360 | set_bit(flag,&ti->flags); | |
1361 | } | |
1362 | ||
1363 | static inline __attribute__((always_inline)) void clear_ti_thread_flag(struct thread_info *ti, int flag) | |
1364 | { | |
1365 | clear_bit(flag,&ti->flags); | |
1366 | } | |
1367 | ||
1368 | static inline __attribute__((always_inline)) int test_and_set_ti_thread_flag(struct thread_info *ti, int flag) | |
1369 | { | |
1370 | return test_and_set_bit(flag,&ti->flags); | |
1371 | } | |
1372 | ||
1373 | static inline __attribute__((always_inline)) int test_and_clear_ti_thread_flag(struct thread_info *ti, int flag) | |
1374 | { | |
1375 | return test_and_clear_bit(flag,&ti->flags); | |
1376 | } | |
1377 | ||
1378 | static inline __attribute__((always_inline)) int test_ti_thread_flag(struct thread_info *ti, int flag) | |
1379 | { | |
1380 | return (__builtin_constant_p(flag) ? __constant_test_bit((flag),(&ti->flags)) : __test_bit((flag),(&ti->flags))); | |
1381 | } | |
1382 | # 10 "include/linux/preempt.h" 2 | |
1383 | # 50 "include/linux/spinlock.h" 2 | |
1384 | ||
1385 | ||
1386 | ||
1387 | # 1 "include/linux/kernel.h" 1 | |
1388 | # 10 "include/linux/kernel.h" | |
1389 | # 1 "/usr/local/src/blackfin/toolchains/20070115/out-uclinux/lib/gcc/bfin-uclinux/4.1.1/include/stdarg.h" 1 3 4 | |
1390 | # 43 "/usr/local/src/blackfin/toolchains/20070115/out-uclinux/lib/gcc/bfin-uclinux/4.1.1/include/stdarg.h" 3 4 | |
1391 | typedef __builtin_va_list __gnuc_va_list; | |
1392 | # 105 "/usr/local/src/blackfin/toolchains/20070115/out-uclinux/lib/gcc/bfin-uclinux/4.1.1/include/stdarg.h" 3 4 | |
1393 | typedef __gnuc_va_list va_list; | |
1394 | # 11 "include/linux/kernel.h" 2 | |
1395 | ||
1396 | ||
1397 | ||
1398 | ||
1399 | ||
1400 | ||
1401 | # 1 "include/asm/bug.h" 1 | |
1402 | # 14 "include/asm/bug.h" | |
1403 | # 1 "include/asm-generic/bug.h" 1 | |
1404 | # 15 "include/asm/bug.h" 2 | |
1405 | # 18 "include/linux/kernel.h" 2 | |
1406 | ||
1407 | extern const char linux_banner[]; | |
1408 | # 50 "include/linux/kernel.h" | |
1409 | extern int console_printk[]; | |
1410 | ||
1411 | ||
1412 | ||
1413 | ||
1414 | ||
1415 | ||
1416 | struct completion; | |
1417 | struct pt_regs; | |
1418 | struct user; | |
1419 | # 98 "include/linux/kernel.h" | |
1420 | extern struct atomic_notifier_head panic_notifier_list; | |
1421 | extern long (*panic_blink)(long time); | |
1422 | void panic(const char * fmt, ...) | |
1423 | __attribute__ ((noreturn, format (printf, 1, 2))); | |
1424 | extern void oops_enter(void); | |
1425 | extern void oops_exit(void); | |
1426 | extern int oops_may_print(void); | |
1427 | void do_exit(long error_code) | |
1428 | __attribute__((noreturn)); | |
1429 | void complete_and_exit(struct completion *, long) | |
1430 | __attribute__((noreturn)); | |
1431 | extern unsigned long simple_strtoul(const char *,char **,unsigned int); | |
1432 | extern long simple_strtol(const char *,char **,unsigned int); | |
1433 | extern unsigned long long simple_strtoull(const char *,char **,unsigned int); | |
1434 | extern long long simple_strtoll(const char *,char **,unsigned int); | |
1435 | extern int sprintf(char * buf, const char * fmt, ...) | |
1436 | __attribute__ ((format (printf, 2, 3))); | |
1437 | extern int vsprintf(char *buf, const char *, va_list) | |
1438 | __attribute__ ((format (printf, 2, 0))); | |
1439 | extern int snprintf(char * buf, size_t size, const char * fmt, ...) | |
1440 | __attribute__ ((format (printf, 3, 4))); | |
1441 | extern int vsnprintf(char *buf, size_t size, const char *fmt, va_list args) | |
1442 | __attribute__ ((format (printf, 3, 0))); | |
1443 | extern int scnprintf(char * buf, size_t size, const char * fmt, ...) | |
1444 | __attribute__ ((format (printf, 3, 4))); | |
1445 | extern int vscnprintf(char *buf, size_t size, const char *fmt, va_list args) | |
1446 | __attribute__ ((format (printf, 3, 0))); | |
1447 | extern char *kasprintf(gfp_t gfp, const char *fmt, ...) | |
1448 | __attribute__ ((format (printf, 2, 3))); | |
1449 | ||
1450 | extern int sscanf(const char *, const char *, ...) | |
1451 | __attribute__ ((format (scanf, 2, 3))); | |
1452 | extern int vsscanf(const char *, const char *, va_list) | |
1453 | __attribute__ ((format (scanf, 2, 0))); | |
1454 | ||
1455 | extern int get_option(char **str, int *pint); | |
1456 | extern char *get_options(const char *str, int nints, int *ints); | |
1457 | extern unsigned long long memparse(char *ptr, char **retptr); | |
1458 | ||
1459 | extern int core_kernel_text(unsigned long addr); | |
1460 | extern int __kernel_text_address(unsigned long addr); | |
1461 | extern int kernel_text_address(unsigned long addr); | |
1462 | extern int session_of_pgrp(int pgrp); | |
1463 | ||
1464 | extern void dump_thread(struct pt_regs *regs, struct user *dump); | |
1465 | ||
1466 | ||
1467 | int vprintk(const char *fmt, va_list args) | |
1468 | __attribute__ ((format (printf, 1, 0))); | |
1469 | int printk(const char * fmt, ...) | |
1470 | __attribute__ ((format (printf, 1, 2))); | |
1471 | # 158 "include/linux/kernel.h" | |
1472 | unsigned long int_sqrt(unsigned long); | |
1473 | ||
1474 | static inline __attribute__((always_inline)) int __attribute__((pure)) long_log2(unsigned long x) | |
1475 | { | |
1476 | int r = 0; | |
1477 | for (x >>= 1; x > 0; x >>= 1) | |
1478 | r++; | |
1479 | return r; | |
1480 | } | |
1481 | ||
1482 | static inline __attribute__((always_inline)) unsigned long | |
1483 | __attribute__((__const__)) roundup_pow_of_two(unsigned long x) | |
1484 | { | |
1485 | return 1UL << fls_long(x - 1); | |
1486 | } | |
1487 | ||
1488 | extern int printk_ratelimit(void); | |
1489 | extern int __printk_ratelimit(int ratelimit_jiffies, int ratelimit_burst); | |
1490 | extern bool printk_timed_ratelimit(unsigned long *caller_jiffies, | |
1491 | unsigned int interval_msec); | |
1492 | ||
1493 | static inline __attribute__((always_inline)) void console_silent(void) | |
1494 | { | |
1495 | (console_printk[0]) = 0; | |
1496 | } | |
1497 | ||
1498 | static inline __attribute__((always_inline)) void console_verbose(void) | |
1499 | { | |
1500 | if ((console_printk[0])) | |
1501 | (console_printk[0]) = 15; | |
1502 | } | |
1503 | ||
1504 | extern void bust_spinlocks(int yes); | |
1505 | extern int oops_in_progress; | |
1506 | extern int panic_timeout; | |
1507 | extern int panic_on_oops; | |
1508 | extern int panic_on_unrecovered_nmi; | |
1509 | extern int tainted; | |
1510 | extern const char *print_tainted(void); | |
1511 | extern void add_taint(unsigned); | |
1512 | ||
1513 | ||
1514 | extern enum system_states { | |
1515 | SYSTEM_BOOTING, | |
1516 | SYSTEM_RUNNING, | |
1517 | SYSTEM_HALT, | |
1518 | SYSTEM_POWER_OFF, | |
1519 | SYSTEM_RESTART, | |
1520 | SYSTEM_SUSPEND_DISK, | |
1521 | } system_state; | |
1522 | # 216 "include/linux/kernel.h" | |
1523 | extern void dump_stack(void); | |
1524 | ||
1525 | ||
1526 | ||
1527 | ||
1528 | ||
1529 | ||
1530 | static inline __attribute__((always_inline)) int __attribute__ ((format (printf, 1, 2))) pr_debug(const char * fmt, ...) | |
1531 | { | |
1532 | return 0; | |
1533 | } | |
1534 | # 330 "include/linux/kernel.h" | |
1535 | struct sysinfo { | |
1536 | long uptime; | |
1537 | unsigned long loads[3]; | |
1538 | unsigned long totalram; | |
1539 | unsigned long freeram; | |
1540 | unsigned long sharedram; | |
1541 | unsigned long bufferram; | |
1542 | unsigned long totalswap; | |
1543 | unsigned long freeswap; | |
1544 | unsigned short procs; | |
1545 | unsigned short pad; | |
1546 | unsigned long totalhigh; | |
1547 | unsigned long freehigh; | |
1548 | unsigned int mem_unit; | |
1549 | char _f[20-2*sizeof(long)-sizeof(int)]; | |
1550 | }; | |
1551 | # 54 "include/linux/spinlock.h" 2 | |
1552 | # 1 "include/linux/stringify.h" 1 | |
1553 | # 55 "include/linux/spinlock.h" 2 | |
1554 | # 1 "include/linux/bottom_half.h" 1 | |
1555 | extern void local_bh_disable(void); | |
1556 | extern void __local_bh_enable(void); | |
1557 | extern void _local_bh_enable(void); | |
1558 | extern void local_bh_enable(void); | |
1559 | extern void local_bh_enable_ip(unsigned long ip); | |
1560 | # 56 "include/linux/spinlock.h" 2 | |
1561 | # 79 "include/linux/spinlock.h" | |
1562 | # 1 "include/linux/spinlock_types.h" 1 | |
1563 | # 12 "include/linux/spinlock_types.h" | |
1564 | # 1 "include/linux/lockdep.h" 1 | |
1565 | # 248 "include/linux/lockdep.h" | |
1566 | static inline __attribute__((always_inline)) void lockdep_off(void) | |
1567 | { | |
1568 | } | |
1569 | ||
1570 | static inline __attribute__((always_inline)) void lockdep_on(void) | |
1571 | { | |
1572 | } | |
1573 | ||
1574 | static inline __attribute__((always_inline)) int lockdep_internal(void) | |
1575 | { | |
1576 | return 0; | |
1577 | } | |
1578 | # 279 "include/linux/lockdep.h" | |
1579 | struct lock_class_key { }; | |
1580 | # 13 "include/linux/spinlock_types.h" 2 | |
1581 | ||
1582 | ||
1583 | ||
1584 | ||
1585 | # 1 "include/linux/spinlock_types_up.h" 1 | |
1586 | # 29 "include/linux/spinlock_types_up.h" | |
1587 | typedef struct { } raw_spinlock_t; | |
1588 | ||
1589 | ||
1590 | ||
1591 | ||
1592 | ||
1593 | typedef struct { | |
1594 | ||
1595 | ||
1596 | ||
1597 | ||
1598 | } raw_rwlock_t; | |
1599 | # 18 "include/linux/spinlock_types.h" 2 | |
1600 | ||
1601 | ||
1602 | typedef struct { | |
1603 | raw_spinlock_t raw_lock; | |
1604 | # 32 "include/linux/spinlock_types.h" | |
1605 | } spinlock_t; | |
1606 | ||
1607 | ||
1608 | ||
1609 | typedef struct { | |
1610 | raw_rwlock_t raw_lock; | |
1611 | # 48 "include/linux/spinlock_types.h" | |
1612 | } rwlock_t; | |
1613 | # 80 "include/linux/spinlock.h" 2 | |
1614 | ||
1615 | extern int __attribute__((section(".spinlock.text"))) generic__raw_read_trylock(raw_rwlock_t *lock); | |
1616 | ||
1617 | ||
1618 | ||
1619 | ||
1620 | ||
1621 | ||
1622 | ||
1623 | # 1 "include/linux/spinlock_up.h" 1 | |
1624 | # 90 "include/linux/spinlock.h" 2 | |
1625 | # 135 "include/linux/spinlock.h" | |
1626 | # 1 "include/linux/spinlock_api_up.h" 1 | |
1627 | # 136 "include/linux/spinlock.h" 2 | |
1628 | # 274 "include/linux/spinlock.h" | |
1629 | # 1 "include/asm/atomic.h" 1 | |
1630 | # 16 "include/asm/atomic.h" | |
1631 | typedef struct { | |
1632 | int counter; | |
1633 | } atomic_t; | |
1634 | ||
1635 | ||
1636 | ||
1637 | ||
1638 | ||
1639 | static __inline__ __attribute__((always_inline)) void atomic_add(int i, atomic_t * v) | |
1640 | { | |
1641 | long flags; | |
1642 | ||
1643 | do { __asm__ __volatile__ ( "cli %0;" :"=&d"(flags):); } while (0); | |
1644 | v->counter += i; | |
1645 | do { if (((flags) != 0x1f)) do { __asm__ __volatile__ ( "sti %0;" ::"d"(irq_flags)); } while (0); } while (0); | |
1646 | } | |
1647 | ||
1648 | static __inline__ __attribute__((always_inline)) void atomic_sub(int i, atomic_t * v) | |
1649 | { | |
1650 | long flags; | |
1651 | ||
1652 | do { __asm__ __volatile__ ( "cli %0;" :"=&d"(flags):); } while (0); | |
1653 | v->counter -= i; | |
1654 | do { if (((flags) != 0x1f)) do { __asm__ __volatile__ ( "sti %0;" ::"d"(irq_flags)); } while (0); } while (0); | |
1655 | ||
1656 | } | |
1657 | ||
1658 | static inline __attribute__((always_inline)) int atomic_add_return(int i, atomic_t * v) | |
1659 | { | |
1660 | int __temp = 0; | |
1661 | long flags; | |
1662 | ||
1663 | do { __asm__ __volatile__ ( "cli %0;" :"=&d"(flags):); } while (0); | |
1664 | v->counter += i; | |
1665 | __temp = v->counter; | |
1666 | do { if (((flags) != 0x1f)) do { __asm__ __volatile__ ( "sti %0;" ::"d"(irq_flags)); } while (0); } while (0); | |
1667 | ||
1668 | ||
1669 | return __temp; | |
1670 | } | |
1671 | ||
1672 | ||
1673 | static inline __attribute__((always_inline)) int atomic_sub_return(int i, atomic_t * v) | |
1674 | { | |
1675 | int __temp = 0; | |
1676 | long flags; | |
1677 | ||
1678 | do { __asm__ __volatile__ ( "cli %0;" :"=&d"(flags):); } while (0); | |
1679 | v->counter -= i; | |
1680 | __temp = v->counter; | |
1681 | do { if (((flags) != 0x1f)) do { __asm__ __volatile__ ( "sti %0;" ::"d"(irq_flags)); } while (0); } while (0); | |
1682 | ||
1683 | return __temp; | |
1684 | } | |
1685 | ||
1686 | static __inline__ __attribute__((always_inline)) void atomic_inc(volatile atomic_t * v) | |
1687 | { | |
1688 | long flags; | |
1689 | ||
1690 | do { __asm__ __volatile__ ( "cli %0;" :"=&d"(flags):); } while (0); | |
1691 | v->counter++; | |
1692 | do { if (((flags) != 0x1f)) do { __asm__ __volatile__ ( "sti %0;" ::"d"(irq_flags)); } while (0); } while (0); | |
1693 | } | |
1694 | # 93 "include/asm/atomic.h" | |
1695 | static __inline__ __attribute__((always_inline)) void atomic_dec(volatile atomic_t * v) | |
1696 | { | |
1697 | long flags; | |
1698 | ||
1699 | do { __asm__ __volatile__ ( "cli %0;" :"=&d"(flags):); } while (0); | |
1700 | v->counter--; | |
1701 | do { if (((flags) != 0x1f)) do { __asm__ __volatile__ ( "sti %0;" ::"d"(irq_flags)); } while (0); } while (0); | |
1702 | } | |
1703 | ||
1704 | static __inline__ __attribute__((always_inline)) void atomic_clear_mask(unsigned int mask, atomic_t * v) | |
1705 | { | |
1706 | long flags; | |
1707 | ||
1708 | do { __asm__ __volatile__ ( "cli %0;" :"=&d"(flags):); } while (0); | |
1709 | v->counter &= ~mask; | |
1710 | do { if (((flags) != 0x1f)) do { __asm__ __volatile__ ( "sti %0;" ::"d"(irq_flags)); } while (0); } while (0); | |
1711 | } | |
1712 | ||
1713 | static __inline__ __attribute__((always_inline)) void atomic_set_mask(unsigned int mask, atomic_t * v) | |
1714 | { | |
1715 | long flags; | |
1716 | ||
1717 | do { __asm__ __volatile__ ( "cli %0;" :"=&d"(flags):); } while (0); | |
1718 | v->counter |= mask; | |
1719 | do { if (((flags) != 0x1f)) do { __asm__ __volatile__ ( "sti %0;" ::"d"(irq_flags)); } while (0); } while (0); | |
1720 | } | |
1721 | # 142 "include/asm/atomic.h" | |
1722 | # 1 "include/asm-generic/atomic.h" 1 | |
1723 | # 71 "include/asm-generic/atomic.h" | |
1724 | typedef atomic_t atomic_long_t; | |
1725 | ||
1726 | ||
1727 | static inline __attribute__((always_inline)) long atomic_long_read(atomic_long_t *l) | |
1728 | { | |
1729 | atomic_t *v = (atomic_t *)l; | |
1730 | ||
1731 | return (long)((v)->counter); | |
1732 | } | |
1733 | ||
1734 | static inline __attribute__((always_inline)) void atomic_long_set(atomic_long_t *l, long i) | |
1735 | { | |
1736 | atomic_t *v = (atomic_t *)l; | |
1737 | ||
1738 | (((v)->counter) = i); | |
1739 | } | |
1740 | ||
1741 | static inline __attribute__((always_inline)) void atomic_long_inc(atomic_long_t *l) | |
1742 | { | |
1743 | atomic_t *v = (atomic_t *)l; | |
1744 | ||
1745 | atomic_inc(v); | |
1746 | } | |
1747 | ||
1748 | static inline __attribute__((always_inline)) void atomic_long_dec(atomic_long_t *l) | |
1749 | { | |
1750 | atomic_t *v = (atomic_t *)l; | |
1751 | ||
1752 | atomic_dec(v); | |
1753 | } | |
1754 | ||
1755 | static inline __attribute__((always_inline)) void atomic_long_add(long i, atomic_long_t *l) | |
1756 | { | |
1757 | atomic_t *v = (atomic_t *)l; | |
1758 | ||
1759 | atomic_add(i, v); | |
1760 | } | |
1761 | ||
1762 | static inline __attribute__((always_inline)) void atomic_long_sub(long i, atomic_long_t *l) | |
1763 | { | |
1764 | atomic_t *v = (atomic_t *)l; | |
1765 | ||
1766 | atomic_sub(i, v); | |
1767 | } | |
1768 | # 143 "include/asm/atomic.h" 2 | |
1769 | # 275 "include/linux/spinlock.h" 2 | |
1770 | ||
1771 | ||
1772 | ||
1773 | ||
1774 | ||
1775 | extern int _atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock); | |
1776 | # 46 "include/linux/capability.h" 2 | |
1777 | # 1 "include/asm/current.h" 1 | |
1778 | # 13 "include/asm/current.h" | |
1779 | struct task_struct; | |
1780 | ||
1781 | static inline __attribute__((always_inline)) struct task_struct *get_current(void) __attribute__ ((__const__)); | |
1782 | static inline __attribute__((always_inline)) struct task_struct *get_current(void) | |
1783 | { | |
1784 | return (current_thread_info()->task); | |
1785 | } | |
1786 | # 47 "include/linux/capability.h" 2 | |
1787 | # 58 "include/linux/capability.h" | |
1788 | typedef __u32 kernel_cap_t; | |
1789 | # 295 "include/linux/capability.h" | |
1790 | extern kernel_cap_t cap_bset; | |
1791 | # 323 "include/linux/capability.h" | |
1792 | static inline __attribute__((always_inline)) kernel_cap_t cap_combine(kernel_cap_t a, kernel_cap_t b) | |
1793 | { | |
1794 | kernel_cap_t dest; | |
1795 | (dest) = (a) | (b); | |
1796 | return dest; | |
1797 | } | |
1798 | ||
1799 | static inline __attribute__((always_inline)) kernel_cap_t cap_intersect(kernel_cap_t a, kernel_cap_t b) | |
1800 | { | |
1801 | kernel_cap_t dest; | |
1802 | (dest) = (a) & (b); | |
1803 | return dest; | |
1804 | } | |
1805 | ||
1806 | static inline __attribute__((always_inline)) kernel_cap_t cap_drop(kernel_cap_t a, kernel_cap_t drop) | |
1807 | { | |
1808 | kernel_cap_t dest; | |
1809 | (dest) = (a) & ~(drop); | |
1810 | return dest; | |
1811 | } | |
1812 | ||
1813 | static inline __attribute__((always_inline)) kernel_cap_t cap_invert(kernel_cap_t c) | |
1814 | { | |
1815 | kernel_cap_t dest; | |
1816 | (dest) = ~(c); | |
1817 | return dest; | |
1818 | } | |
1819 | # 360 "include/linux/capability.h" | |
1820 | int capable(int cap); | |
1821 | int __capable(struct task_struct *t, int cap); | |
1822 | # 47 "include/linux/sched.h" 2 | |
1823 | # 1 "include/linux/threads.h" 1 | |
1824 | # 48 "include/linux/sched.h" 2 | |
1825 | ||
1826 | ||
1827 | # 1 "include/linux/timex.h" 1 | |
1828 | # 57 "include/linux/timex.h" | |
1829 | # 1 "include/linux/time.h" 1 | |
1830 | ||
1831 | ||
1832 | ||
1833 | ||
1834 | ||
1835 | ||
1836 | # 1 "include/linux/seqlock.h" 1 | |
1837 | # 32 "include/linux/seqlock.h" | |
1838 | typedef struct { | |
1839 | unsigned sequence; | |
1840 | spinlock_t lock; | |
1841 | } seqlock_t; | |
1842 | # 57 "include/linux/seqlock.h" | |
1843 | static inline __attribute__((always_inline)) void write_seqlock(seqlock_t *sl) | |
1844 | { | |
1845 | do { do { } while (0); (void)0; (void)(&sl->lock); } while (0); | |
1846 | ++sl->sequence; | |
1847 | __asm__ __volatile__("": : :"memory"); | |
1848 | } | |
1849 | ||
1850 | static inline __attribute__((always_inline)) void write_sequnlock(seqlock_t *sl) | |
1851 | { | |
1852 | __asm__ __volatile__("": : :"memory"); | |
1853 | sl->sequence++; | |
1854 | do { do { } while (0); (void)0; (void)(&sl->lock); } while (0); | |
1855 | } | |
1856 | ||
1857 | static inline __attribute__((always_inline)) int write_tryseqlock(seqlock_t *sl) | |
1858 | { | |
1859 | int ret = (({ do { do { } while (0); (void)0; (void)(&sl->lock); } while (0); 1; })); | |
1860 | ||
1861 | if (ret) { | |
1862 | ++sl->sequence; | |
1863 | __asm__ __volatile__("": : :"memory"); | |
1864 | } | |
1865 | return ret; | |
1866 | } | |
1867 | ||
1868 | ||
1869 | static inline __attribute__((always_inline)) __attribute__((always_inline)) unsigned read_seqbegin(const seqlock_t *sl) | |
1870 | { | |
1871 | unsigned ret = sl->sequence; | |
1872 | __asm__ __volatile__("": : :"memory"); | |
1873 | return ret; | |
1874 | } | |
1875 | # 98 "include/linux/seqlock.h" | |
1876 | static inline __attribute__((always_inline)) __attribute__((always_inline)) int read_seqretry(const seqlock_t *sl, unsigned iv) | |
1877 | { | |
1878 | __asm__ __volatile__("": : :"memory"); | |
1879 | return (iv & 1) | (sl->sequence ^ iv); | |
1880 | } | |
1881 | # 112 "include/linux/seqlock.h" | |
1882 | typedef struct seqcount { | |
1883 | unsigned sequence; | |
1884 | } seqcount_t; | |
1885 | ||
1886 | ||
1887 | ||
1888 | ||
1889 | ||
1890 | static inline __attribute__((always_inline)) unsigned read_seqcount_begin(const seqcount_t *s) | |
1891 | { | |
1892 | unsigned ret = s->sequence; | |
1893 | __asm__ __volatile__("": : :"memory"); | |
1894 | return ret; | |
1895 | } | |
1896 | ||
1897 | ||
1898 | ||
1899 | ||
1900 | ||
1901 | ||
1902 | static inline __attribute__((always_inline)) int read_seqcount_retry(const seqcount_t *s, unsigned iv) | |
1903 | { | |
1904 | __asm__ __volatile__("": : :"memory"); | |
1905 | return (iv & 1) | (s->sequence ^ iv); | |
1906 | } | |
1907 | ||
1908 | ||
1909 | ||
1910 | ||
1911 | ||
1912 | ||
1913 | static inline __attribute__((always_inline)) void write_seqcount_begin(seqcount_t *s) | |
1914 | { | |
1915 | s->sequence++; | |
1916 | __asm__ __volatile__("": : :"memory"); | |
1917 | } | |
1918 | ||
1919 | static inline __attribute__((always_inline)) void write_seqcount_end(seqcount_t *s) | |
1920 | { | |
1921 | __asm__ __volatile__("": : :"memory"); | |
1922 | s->sequence++; | |
1923 | } | |
1924 | # 8 "include/linux/time.h" 2 | |
1925 | ||
1926 | ||
1927 | ||
1928 | ||
1929 | struct timespec { | |
1930 | time_t tv_sec; | |
1931 | long tv_nsec; | |
1932 | }; | |
1933 | ||
1934 | ||
1935 | struct timeval { | |
1936 | time_t tv_sec; | |
1937 | suseconds_t tv_usec; | |
1938 | }; | |
1939 | ||
1940 | struct timezone { | |
1941 | int tz_minuteswest; | |
1942 | int tz_dsttime; | |
1943 | }; | |
1944 | # 39 "include/linux/time.h" | |
1945 | static inline __attribute__((always_inline)) int timespec_equal(struct timespec *a, struct timespec *b) | |
1946 | { | |
1947 | return (a->tv_sec == b->tv_sec) && (a->tv_nsec == b->tv_nsec); | |
1948 | } | |
1949 | ||
1950 | ||
1951 | ||
1952 | ||
1953 | ||
1954 | ||
1955 | static inline __attribute__((always_inline)) int timespec_compare(struct timespec *lhs, struct timespec *rhs) | |
1956 | { | |
1957 | if (lhs->tv_sec < rhs->tv_sec) | |
1958 | return -1; | |
1959 | if (lhs->tv_sec > rhs->tv_sec) | |
1960 | return 1; | |
1961 | return lhs->tv_nsec - rhs->tv_nsec; | |
1962 | } | |
1963 | ||
1964 | static inline __attribute__((always_inline)) int timeval_compare(struct timeval *lhs, struct timeval *rhs) | |
1965 | { | |
1966 | if (lhs->tv_sec < rhs->tv_sec) | |
1967 | return -1; | |
1968 | if (lhs->tv_sec > rhs->tv_sec) | |
1969 | return 1; | |
1970 | return lhs->tv_usec - rhs->tv_usec; | |
1971 | } | |
1972 | ||
1973 | extern unsigned long mktime(const unsigned int year, const unsigned int mon, | |
1974 | const unsigned int day, const unsigned int hour, | |
1975 | const unsigned int min, const unsigned int sec); | |
1976 | ||
1977 | extern void set_normalized_timespec(struct timespec *ts, time_t sec, long nsec); | |
1978 | ||
1979 | ||
1980 | ||
1981 | ||
1982 | static inline __attribute__((always_inline)) struct timespec timespec_sub(struct timespec lhs, | |
1983 | struct timespec rhs) | |
1984 | { | |
1985 | struct timespec ts_delta; | |
1986 | set_normalized_timespec(&ts_delta, lhs.tv_sec - rhs.tv_sec, | |
1987 | lhs.tv_nsec - rhs.tv_nsec); | |
1988 | return ts_delta; | |
1989 | } | |
1990 | ||
1991 | ||
1992 | ||
1993 | ||
1994 | ||
1995 | ||
1996 | ||
1997 | extern struct timespec xtime; | |
1998 | extern struct timespec wall_to_monotonic; | |
1999 | extern seqlock_t xtime_lock; | |
2000 | ||
2001 | void timekeeping_init(void); | |
2002 | ||
2003 | static inline __attribute__((always_inline)) unsigned long get_seconds(void) | |
2004 | { | |
2005 | return xtime.tv_sec; | |
2006 | } | |
2007 | ||
2008 | struct timespec current_kernel_time(void); | |
2009 | ||
2010 | ||
2011 | ||
2012 | ||
2013 | extern void do_gettimeofday(struct timeval *tv); | |
2014 | extern int do_settimeofday(struct timespec *tv); | |
2015 | extern int do_sys_settimeofday(struct timespec *tv, struct timezone *tz); | |
2016 | ||
2017 | extern long do_utimes(int dfd, char *filename, struct timeval *times); | |
2018 | struct itimerval; | |
2019 | extern int do_setitimer(int which, struct itimerval *value, | |
2020 | struct itimerval *ovalue); | |
2021 | extern unsigned int alarm_setitimer(unsigned int seconds); | |
2022 | extern int do_getitimer(int which, struct itimerval *value); | |
2023 | extern void getnstimeofday(struct timespec *tv); | |
2024 | ||
2025 | extern struct timespec timespec_trunc(struct timespec t, unsigned gran); | |
2026 | extern int timekeeping_is_continuous(void); | |
2027 | # 129 "include/linux/time.h" | |
2028 | static inline __attribute__((always_inline)) s64 timespec_to_ns(const struct timespec *ts) | |
2029 | { | |
2030 | return ((s64) ts->tv_sec * 1000000000L) + ts->tv_nsec; | |
2031 | } | |
2032 | # 141 "include/linux/time.h" | |
2033 | static inline __attribute__((always_inline)) s64 timeval_to_ns(const struct timeval *tv) | |
2034 | { | |
2035 | return ((s64) tv->tv_sec * 1000000000L) + | |
2036 | tv->tv_usec * 1000L; | |
2037 | } | |
2038 | ||
2039 | ||
2040 | ||
2041 | ||
2042 | ||
2043 | ||
2044 | ||
2045 | extern struct timespec ns_to_timespec(const s64 nsec); | |
2046 | ||
2047 | ||
2048 | ||
2049 | ||
2050 | ||
2051 | ||
2052 | ||
2053 | extern struct timeval ns_to_timeval(const s64 nsec); | |
2054 | ||
2055 | ||
2056 | ||
2057 | ||
2058 | ||
2059 | ||
2060 | static inline __attribute__((always_inline)) void timespec_add_ns(struct timespec *a, u64 ns) | |
2061 | { | |
2062 | ns += a->tv_nsec; | |
2063 | while(__builtin_expect(!!(ns >= 1000000000L), 0)) { | |
2064 | ns -= 1000000000L; | |
2065 | a->tv_sec++; | |
2066 | } | |
2067 | a->tv_nsec = ns; | |
2068 | } | |
2069 | # 195 "include/linux/time.h" | |
2070 | struct itimerspec { | |
2071 | struct timespec it_interval; | |
2072 | struct timespec it_value; | |
2073 | }; | |
2074 | ||
2075 | struct itimerval { | |
2076 | struct timeval it_interval; | |
2077 | struct timeval it_value; | |
2078 | }; | |
2079 | # 58 "include/linux/timex.h" 2 | |
2080 | # 100 "include/linux/timex.h" | |
2081 | struct timex { | |
2082 | unsigned int modes; | |
2083 | long offset; | |
2084 | long freq; | |
2085 | long maxerror; | |
2086 | long esterror; | |
2087 | int status; | |
2088 | long constant; | |
2089 | long precision; | |
2090 | long tolerance; | |
2091 | ||
2092 | ||
2093 | struct timeval time; | |
2094 | long tick; | |
2095 | ||
2096 | long ppsfreq; | |
2097 | long jitter; | |
2098 | int shift; | |
2099 | long stabil; | |
2100 | long jitcnt; | |
2101 | long calcnt; | |
2102 | long errcnt; | |
2103 | long stbcnt; | |
2104 | ||
2105 | int :32; int :32; int :32; int :32; | |
2106 | int :32; int :32; int :32; int :32; | |
2107 | int :32; int :32; int :32; int :32; | |
2108 | }; | |
2109 | # 187 "include/linux/timex.h" | |
2110 | # 1 "include/asm/timex.h" 1 | |
2111 | # 11 "include/asm/timex.h" | |
2112 | typedef unsigned long cycles_t; | |
2113 | ||
2114 | static inline __attribute__((always_inline)) cycles_t get_cycles(void) | |
2115 | { | |
2116 | return 0; | |
2117 | } | |
2118 | # 188 "include/linux/timex.h" 2 | |
2119 | ||
2120 | ||
2121 | ||
2122 | ||
2123 | ||
2124 | ||
2125 | extern unsigned long tick_usec; | |
2126 | extern unsigned long tick_nsec; | |
2127 | extern int tickadj; | |
2128 | ||
2129 | ||
2130 | ||
2131 | ||
2132 | extern int time_status; | |
2133 | extern long time_maxerror; | |
2134 | extern long time_esterror; | |
2135 | ||
2136 | extern long time_freq; | |
2137 | ||
2138 | extern long time_adjust; | |
2139 | ||
2140 | extern void ntp_clear(void); | |
2141 | ||
2142 | ||
2143 | ||
2144 | ||
2145 | ||
2146 | static inline __attribute__((always_inline)) int ntp_synced(void) | |
2147 | { | |
2148 | return !(time_status & 0x0040); | |
2149 | } | |
2150 | # 277 "include/linux/timex.h" | |
2151 | static inline __attribute__((always_inline)) void time_interpolator_reset(void) | |
2152 | { | |
2153 | } | |
2154 | ||
2155 | static inline __attribute__((always_inline)) void time_interpolator_update(long delta_nsec) | |
2156 | { | |
2157 | } | |
2158 | ||
2159 | ||
2160 | ||
2161 | ||
2162 | ||
2163 | ||
2164 | extern u64 current_tick_length(void); | |
2165 | ||
2166 | extern void second_overflow(void); | |
2167 | extern void update_ntp_one_tick(void); | |
2168 | extern int do_adjtimex(struct timex *); | |
2169 | # 51 "include/linux/sched.h" 2 | |
2170 | # 1 "include/linux/jiffies.h" 1 | |
2171 | ||
2172 | ||
2173 | ||
2174 | # 1 "include/linux/calc64.h" 1 | |
2175 | ||
2176 | ||
2177 | ||
2178 | ||
2179 | # 1 "include/asm/div64.h" 1 | |
2180 | # 1 "include/asm-generic/div64.h" 1 | |
2181 | # 35 "include/asm-generic/div64.h" | |
2182 | extern uint32_t __div64_32(uint64_t *dividend, uint32_t divisor); | |
2183 | # 1 "include/asm/div64.h" 2 | |
2184 | # 6 "include/linux/calc64.h" 2 | |
2185 | # 20 "include/linux/calc64.h" | |
2186 | static inline __attribute__((always_inline)) unsigned long do_div_llr(const long long dividend, | |
2187 | const long divisor, long *remainder) | |
2188 | { | |
2189 | u64 result = dividend; | |
2190 | ||
2191 | *(remainder) = ({ uint32_t __base = (divisor); uint32_t __rem; (void)(((typeof((result)) *)0) == ((uint64_t *)0)); if (__builtin_expect(!!(((result) >> 32) == 0), 1)) { __rem = (uint32_t)(result) % __base; (result) = (uint32_t)(result) / __base; } else __rem = __div64_32(&(result), __base); __rem; }); | |
2192 | return (unsigned long) result; | |
2193 | } | |
2194 | ||
2195 | ||
2196 | ||
2197 | ||
2198 | ||
2199 | ||
2200 | ||
2201 | static inline __attribute__((always_inline)) long div_long_long_rem_signed(const long long dividend, | |
2202 | const long divisor, long *remainder) | |
2203 | { | |
2204 | long res; | |
2205 | ||
2206 | if (__builtin_expect(!!(dividend < 0), 0)) { | |
2207 | res = -do_div_llr((-dividend), divisor, remainder); | |
2208 | *remainder = -(*remainder); | |
2209 | } else | |
2210 | res = do_div_llr((dividend), divisor, remainder); | |
2211 | ||
2212 | return res; | |
2213 | } | |
2214 | # 5 "include/linux/jiffies.h" 2 | |
2215 | # 81 "include/linux/jiffies.h" | |
2216 | extern u64 __attribute__((section(".data"))) jiffies_64; | |
2217 | extern unsigned long volatile __attribute__((section(".data"))) jiffies; | |
2218 | ||
2219 | ||
2220 | u64 get_jiffies_64(void); | |
2221 | # 267 "include/linux/jiffies.h" | |
2222 | static inline __attribute__((always_inline)) unsigned int jiffies_to_msecs(const unsigned long j) | |
2223 | { | |
2224 | ||
2225 | return (1000L / 250) * j; | |
2226 | ||
2227 | ||
2228 | ||
2229 | ||
2230 | ||
2231 | } | |
2232 | ||
2233 | static inline __attribute__((always_inline)) unsigned int jiffies_to_usecs(const unsigned long j) | |
2234 | { | |
2235 | ||
2236 | return (1000000L / 250) * j; | |
2237 | ||
2238 | ||
2239 | ||
2240 | ||
2241 | ||
2242 | } | |
2243 | ||
2244 | static inline __attribute__((always_inline)) unsigned long msecs_to_jiffies(const unsigned int m) | |
2245 | { | |
2246 | if (m > jiffies_to_msecs(((~0UL >> 1)-1))) | |
2247 | return ((~0UL >> 1)-1); | |
2248 | ||
2249 | return (m + (1000L / 250) - 1) / (1000L / 250); | |
2250 | ||
2251 | ||
2252 | ||
2253 | ||
2254 | ||
2255 | } | |
2256 | ||
2257 | static inline __attribute__((always_inline)) unsigned long usecs_to_jiffies(const unsigned int u) | |
2258 | { | |
2259 | if (u > jiffies_to_usecs(((~0UL >> 1)-1))) | |
2260 | return ((~0UL >> 1)-1); | |
2261 | ||
2262 | return (u + (1000000L / 250) - 1) / (1000000L / 250); | |
2263 | ||
2264 | ||
2265 | ||
2266 | ||
2267 | ||
2268 | } | |
2269 | # 326 "include/linux/jiffies.h" | |
2270 | static __inline__ __attribute__((always_inline)) unsigned long | |
2271 | timespec_to_jiffies(const struct timespec *value) | |
2272 | { | |
2273 | unsigned long sec = value->tv_sec; | |
2274 | long nsec = value->tv_nsec + (( (((1000000UL * 1000) / ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250)))))) << (8)) + ((((1000000UL * 1000) % ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250)))))) << (8)) + ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250))))) / 2) / ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250))))))) - 1; | |
2275 | ||
2276 | if (sec >= (long)((u64)((u64)((~0UL >> 1)-1) * (( (((1000000UL * 1000) / ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250)))))) << (8)) + ((((1000000UL * 1000) % ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250)))))) << (8)) + ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250))))) / 2) / ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250)))))))) / 1000000000L)){ | |
2277 | sec = (long)((u64)((u64)((~0UL >> 1)-1) * (( (((1000000UL * 1000) / ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250)))))) << (8)) + ((((1000000UL * 1000) % ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250)))))) << (8)) + ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250))))) / 2) / ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250)))))))) / 1000000000L); | |
2278 | nsec = 0; | |
2279 | } | |
2280 | return (((u64)sec * ((unsigned long)((((u64)1000000000L << (32 - 8)) + (( (((1000000UL * 1000) / ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250)))))) << (8)) + ((((1000000UL * 1000) % ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250)))))) << (8)) + ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250))))) / 2) / ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250))))))) -1) / (u64)(( (((1000000UL * 1000) / ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250)))))) << (8)) + ((((1000000UL * 1000) % ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250)))))) << (8)) + ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250))))) / 2) / ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250)))))))))) + | |
2281 | (((u64)nsec * ((unsigned long)((((u64)1 << ((32 - 8) + 29)) + (( (((1000000UL * 1000) / ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250)))))) << (8)) + ((((1000000UL * 1000) % ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250)))))) << (8)) + ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250))))) / 2) / ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250))))))) -1) / (u64)(( (((1000000UL * 1000) / ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250)))))) << (8)) + ((((1000000UL * 1000) % ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250)))))) << (8)) + ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250))))) / 2) / ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250)))))))))) >> | |
2282 | (((32 - 8) + 29) - (32 - 8)))) >> (32 - 8); | |
2283 | ||
2284 | } | |
2285 | ||
2286 | static __inline__ __attribute__((always_inline)) void | |
2287 | jiffies_to_timespec(const unsigned long jiffies, struct timespec *value) | |
2288 | { | |
2289 | ||
2290 | ||
2291 | ||
2292 | ||
2293 | u64 nsec = (u64)jiffies * (( (((1000000UL * 1000) / ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250)))))) << (8)) + ((((1000000UL * 1000) % ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250)))))) << (8)) + ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250))))) / 2) / ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250))))))); | |
2294 | value->tv_sec = do_div_llr((nsec), 1000000000L, &value->tv_nsec); | |
2295 | } | |
2296 | # 365 "include/linux/jiffies.h" | |
2297 | static __inline__ __attribute__((always_inline)) unsigned long | |
2298 | timeval_to_jiffies(const struct timeval *value) | |
2299 | { | |
2300 | unsigned long sec = value->tv_sec; | |
2301 | long usec = value->tv_usec; | |
2302 | ||
2303 | if (sec >= (long)((u64)((u64)((~0UL >> 1)-1) * (( (((1000000UL * 1000) / ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250)))))) << (8)) + ((((1000000UL * 1000) % ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250)))))) << (8)) + ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250))))) / 2) / ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250)))))))) / 1000000000L)){ | |
2304 | sec = (long)((u64)((u64)((~0UL >> 1)-1) * (( (((1000000UL * 1000) / ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250)))))) << (8)) + ((((1000000UL * 1000) % ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250)))))) << (8)) + ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250))))) / 2) / ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250)))))))) / 1000000000L); | |
2305 | usec = 0; | |
2306 | } | |
2307 | return (((u64)sec * ((unsigned long)((((u64)1000000000L << (32 - 8)) + (( (((1000000UL * 1000) / ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250)))))) << (8)) + ((((1000000UL * 1000) % ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250)))))) << (8)) + ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250))))) / 2) / ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250))))))) -1) / (u64)(( (((1000000UL * 1000) / ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250)))))) << (8)) + ((((1000000UL * 1000) % ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250)))))) << (8)) + ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250))))) / 2) / ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250)))))))))) + | |
2308 | (((u64)usec * ((unsigned long)((((u64)1000L << ((32 - 8) + 19)) + (( (((1000000UL * 1000) / ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250)))))) << (8)) + ((((1000000UL * 1000) % ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250)))))) << (8)) + ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250))))) / 2) / ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250))))))) -1) / (u64)(( (((1000000UL * 1000) / ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250)))))) << (8)) + ((((1000000UL * 1000) % ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250)))))) << (8)) + ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250))))) / 2) / ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250))))))))) + (u64)(((u64)1 << ((32 - 8) + 19)) - 1)) >> | |
2309 | (((32 - 8) + 19) - (32 - 8)))) >> (32 - 8); | |
2310 | } | |
2311 | ||
2312 | static __inline__ __attribute__((always_inline)) void | |
2313 | jiffies_to_timeval(const unsigned long jiffies, struct timeval *value) | |
2314 | { | |
2315 | ||
2316 | ||
2317 | ||
2318 | ||
2319 | u64 nsec = (u64)jiffies * (( (((1000000UL * 1000) / ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250)))))) << (8)) + ((((1000000UL * 1000) % ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250)))))) << (8)) + ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250))))) / 2) / ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250))))))); | |
2320 | long tv_usec; | |
2321 | ||
2322 | value->tv_sec = do_div_llr((nsec), 1000000000L, &tv_usec); | |
2323 | tv_usec /= 1000L; | |
2324 | value->tv_usec = tv_usec; | |
2325 | } | |
2326 | ||
2327 | ||
2328 | ||
2329 | ||
2330 | static inline __attribute__((always_inline)) clock_t jiffies_to_clock_t(long x) | |
2331 | { | |
2332 | ||
2333 | ||
2334 | ||
2335 | u64 tmp = (u64)x * (( (((1000000UL * 1000) / ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250)))))) << (8)) + ((((1000000UL * 1000) % ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250)))))) << (8)) + ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250))))) / 2) / ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250))))))); | |
2336 | ({ uint32_t __base = ((1000000000L / 100)); uint32_t __rem; (void)(((typeof((tmp)) *)0) == ((uint64_t *)0)); if (__builtin_expect(!!(((tmp) >> 32) == 0), 1)) { __rem = (uint32_t)(tmp) % __base; (tmp) = (uint32_t)(tmp) / __base; } else __rem = __div64_32(&(tmp), __base); __rem; }); | |
2337 | return (long)tmp; | |
2338 | ||
2339 | } | |
2340 | ||
2341 | static inline __attribute__((always_inline)) unsigned long clock_t_to_jiffies(unsigned long x) | |
2342 | { | |
2343 | ||
2344 | ||
2345 | ||
2346 | ||
2347 | ||
2348 | u64 jif; | |
2349 | ||
2350 | ||
2351 | if (x >= ~0UL / 250 * 100) | |
2352 | return ~0UL; | |
2353 | ||
2354 | ||
2355 | jif = x * (u64) 250; | |
2356 | ({ uint32_t __base = (100); uint32_t __rem; (void)(((typeof((jif)) *)0) == ((uint64_t *)0)); if (__builtin_expect(!!(((jif) >> 32) == 0), 1)) { __rem = (uint32_t)(jif) % __base; (jif) = (uint32_t)(jif) / __base; } else __rem = __div64_32(&(jif), __base); __rem; }); | |
2357 | return jif; | |
2358 | ||
2359 | } | |
2360 | ||
2361 | static inline __attribute__((always_inline)) u64 jiffies_64_to_clock_t(u64 x) | |
2362 | { | |
2363 | # 439 "include/linux/jiffies.h" | |
2364 | x *= (( (((1000000UL * 1000) / ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250)))))) << (8)) + ((((1000000UL * 1000) % ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250)))))) << (8)) + ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250))))) / 2) / ((( (((1000000) / (((1000000 + 250/2) / 250))) << (8)) + ((((1000000) % (((1000000 + 250/2) / 250))) << (8)) + (((1000000 + 250/2) / 250)) / 2) / (((1000000 + 250/2) / 250))))))); | |
2365 | ({ uint32_t __base = ((1000000000L / 100)); uint32_t __rem; (void)(((typeof((x)) *)0) == ((uint64_t *)0)); if (__builtin_expect(!!(((x) >> 32) == 0), 1)) { __rem = (uint32_t)(x) % __base; (x) = (uint32_t)(x) / __base; } else __rem = __div64_32(&(x), __base); __rem; }); | |
2366 | ||
2367 | return x; | |
2368 | } | |
2369 | ||
2370 | static inline __attribute__((always_inline)) u64 nsec_to_clock_t(u64 x) | |
2371 | { | |
2372 | ||
2373 | ({ uint32_t __base = ((1000000000L / 100)); uint32_t __rem; (void)(((typeof((x)) *)0) == ((uint64_t *)0)); if (__builtin_expect(!!(((x) >> 32) == 0), 1)) { __rem = (uint32_t)(x) % __base; (x) = (uint32_t)(x) / __base; } else __rem = __div64_32(&(x), __base); __rem; }); | |
2374 | # 462 "include/linux/jiffies.h" | |
2375 | return x; | |
2376 | } | |
2377 | # 52 "include/linux/sched.h" 2 | |
2378 | # 1 "include/linux/rbtree.h" 1 | |
2379 | # 100 "include/linux/rbtree.h" | |
2380 | struct rb_node | |
2381 | { | |
2382 | unsigned long rb_parent_color; | |
2383 | ||
2384 | ||
2385 | struct rb_node *rb_right; | |
2386 | struct rb_node *rb_left; | |
2387 | } __attribute__((aligned(sizeof(long)))); | |
2388 | ||
2389 | ||
2390 | struct rb_root | |
2391 | { | |
2392 | struct rb_node *rb_node; | |
2393 | }; | |
2394 | # 123 "include/linux/rbtree.h" | |
2395 | static inline __attribute__((always_inline)) void rb_set_parent(struct rb_node *rb, struct rb_node *p) | |
2396 | { | |
2397 | rb->rb_parent_color = (rb->rb_parent_color & 3) | (unsigned long)p; | |
2398 | } | |
2399 | static inline __attribute__((always_inline)) void rb_set_color(struct rb_node *rb, int color) | |
2400 | { | |
2401 | rb->rb_parent_color = (rb->rb_parent_color & ~1) | color; | |
2402 | } | |
2403 | # 139 "include/linux/rbtree.h" | |
2404 | extern void rb_insert_color(struct rb_node *, struct rb_root *); | |
2405 | extern void rb_erase(struct rb_node *, struct rb_root *); | |
2406 | ||
2407 | ||
2408 | extern struct rb_node *rb_next(struct rb_node *); | |
2409 | extern struct rb_node *rb_prev(struct rb_node *); | |
2410 | extern struct rb_node *rb_first(struct rb_root *); | |
2411 | extern struct rb_node *rb_last(struct rb_root *); | |
2412 | ||
2413 | ||
2414 | extern void rb_replace_node(struct rb_node *victim, struct rb_node *new, | |
2415 | struct rb_root *root); | |
2416 | ||
2417 | static inline __attribute__((always_inline)) void rb_link_node(struct rb_node * node, struct rb_node * parent, | |
2418 | struct rb_node ** rb_link) | |
2419 | { | |
2420 | node->rb_parent_color = (unsigned long )parent; | |
2421 | node->rb_left = node->rb_right = ((void *)0); | |
2422 | ||
2423 | *rb_link = node; | |
2424 | } | |
2425 | # 53 "include/linux/sched.h" 2 | |
2426 | ||
2427 | # 1 "include/linux/cpumask.h" 1 | |
2428 | # 86 "include/linux/cpumask.h" | |
2429 | # 1 "include/linux/bitmap.h" 1 | |
2430 | ||
2431 | ||
2432 | ||
2433 | ||
2434 | ||
2435 | ||
2436 | ||
2437 | # 1 "include/linux/string.h" 1 | |
2438 | # 16 "include/linux/string.h" | |
2439 | extern char *strndup_user(const char *, long); | |
2440 | ||
2441 | ||
2442 | ||
2443 | ||
2444 | # 1 "include/asm/string.h" 1 | |
2445 | ||
2446 | ||
2447 | ||
2448 | ||
2449 | ||
2450 | ||
2451 | extern inline __attribute__((always_inline)) char *strcpy(char *dest, const char *src) | |
2452 | { | |
2453 | char *xdest = dest; | |
2454 | char temp = 0; | |
2455 | ||
2456 | __asm__ __volatile__ | |
2457 | ("1:\t%2 = B [%1++] (Z);\n\t" | |
2458 | "B [%0++] = %2;\n\t" | |
2459 | "CC = %2;\n\t" | |
2460 | "if cc jump 1b (bp);\n" | |
2461 | : "+&a" (dest), "+&a" (src), "=&d" (temp) | |
2462 | ::"memory", "CC"); | |
2463 | return xdest; | |
2464 | } | |
2465 | ||
2466 | ||
2467 | extern inline __attribute__((always_inline)) char *strncpy(char *dest, const char *src, size_t n) | |
2468 | { | |
2469 | char *xdest = dest; | |
2470 | char temp = 0; | |
2471 | ||
2472 | if (n == 0) | |
2473 | return xdest; | |
2474 | ||
2475 | __asm__ __volatile__ | |
2476 | ("1:\t%3 = B [%1++] (Z);\n\t" | |
2477 | "B [%0++] = %3;\n\t" | |
2478 | "CC = %3;\n\t" | |
2479 | "if ! cc jump 2f;\n\t" | |
2480 | "%2 += -1;\n\t" | |
2481 | "CC = %2 == 0;\n\t" | |
2482 | "if ! cc jump 1b (bp);\n" | |
2483 | "2:\n" | |
2484 | : "+&a" (dest), "+&a" (src), "+&da" (n), "=&d" (temp) | |
2485 | ::"memory", "CC"); | |
2486 | return xdest; | |
2487 | } | |
2488 | ||
2489 | ||
2490 | extern inline __attribute__((always_inline)) int strcmp(const char *cs, const char *ct) | |
2491 | { | |
2492 | char __res1, __res2; | |
2493 | ||
2494 | __asm__ | |
2495 | ("1:\t%2 = B[%0++] (Z);\n\t" | |
2496 | "%3 = B[%1++] (Z);\n\t" | |
2497 | "CC = %2 == %3;\n\t" | |
2498 | "if ! cc jump 2f;\n\t" | |
2499 | "CC = %2;\n\t" | |
2500 | "if cc jump 1b (bp);\n\t" | |
2501 | "jump.s 3f;\n" | |
2502 | "2:\t%2 = %2 - %3;\n" | |
2503 | "3:\n" | |
2504 | : "+&a" (cs), "+&a" (ct), "=&d" (__res1), "=&d" (__res2) | |
2505 | : : "CC"); | |
2506 | ||
2507 | return __res1; | |
2508 | } | |
2509 | ||
2510 | ||
2511 | extern inline __attribute__((always_inline)) int strncmp(const char *cs, const char *ct, size_t count) | |
2512 | { | |
2513 | char __res1, __res2; | |
2514 | ||
2515 | if (!count) | |
2516 | return 0; | |
2517 | __asm__ | |
2518 | ("1:\t%3 = B[%0++] (Z);\n\t" | |
2519 | "%4 = B[%1++] (Z);\n\t" | |
2520 | "CC = %3 == %4;\n\t" | |
2521 | "if ! cc jump 3f;\n\t" | |
2522 | "CC = %3;\n\t" | |
2523 | "if ! cc jump 4f;\n\t" | |
2524 | "%2 += -1;\n\t" | |
2525 | "CC = %2 == 0;\n\t" | |
2526 | "if ! cc jump 1b;\n" | |
2527 | "2:\t%3 = 0;\n\t" | |
2528 | "jump.s 4f;\n" | |
2529 | "3:\t%3 = %3 - %4;\n" | |
2530 | "4:" | |
2531 | : "+&a" (cs), "+&a" (ct), "+&da" (count), "=&d" (__res1), "=&d" (__res2) | |
2532 | : : "CC"); | |
2533 | return __res1; | |
2534 | } | |
2535 | ||
2536 | ||
2537 | extern void *memset(void *s, int c, size_t count); | |
2538 | ||
2539 | extern void *memcpy(void *d, const void *s, size_t count); | |
2540 | ||
2541 | extern int memcmp(const void *, const void *, __kernel_size_t); | |
2542 | ||
2543 | extern void *memchr(const void *s, int c, size_t n); | |
2544 | ||
2545 | extern void *memmove(void *dest, const void *src, size_t count); | |
2546 | # 22 "include/linux/string.h" 2 | |
2547 | # 30 "include/linux/string.h" | |
2548 | size_t strlcpy(char *, const char *, size_t); | |
2549 | ||
2550 | ||
2551 | extern char * strcat(char *, const char *); | |
2552 | ||
2553 | ||
2554 | extern char * strncat(char *, const char *, __kernel_size_t); | |
2555 | ||
2556 | ||
2557 | extern size_t strlcat(char *, const char *, __kernel_size_t); | |
2558 | # 48 "include/linux/string.h" | |
2559 | extern int strnicmp(const char *, const char *, __kernel_size_t); | |
2560 | ||
2561 | ||
2562 | extern char * strchr(const char *,int); | |
2563 | ||
2564 | ||
2565 | extern char * strnchr(const char *, size_t, int); | |
2566 | ||
2567 | ||
2568 | extern char * strrchr(const char *,int); | |
2569 | ||
2570 | extern char * strstrip(char *); | |
2571 | ||
2572 | extern char * strstr(const char *,const char *); | |
2573 | ||
2574 | ||
2575 | extern __kernel_size_t strlen(const char *); | |
2576 | ||
2577 | ||
2578 | extern __kernel_size_t strnlen(const char *,__kernel_size_t); | |
2579 | ||
2580 | ||
2581 | extern char * strpbrk(const char *,const char *); | |
2582 | ||
2583 | ||
2584 | extern char * strsep(char **,const char *); | |
2585 | ||
2586 | ||
2587 | extern __kernel_size_t strspn(const char *,const char *); | |
2588 | ||
2589 | ||
2590 | extern __kernel_size_t strcspn(const char *,const char *); | |
2591 | # 92 "include/linux/string.h" | |
2592 | extern void * memscan(void *,int,__kernel_size_t); | |
2593 | # 101 "include/linux/string.h" | |
2594 | extern char *kstrdup(const char *s, gfp_t gfp); | |
2595 | extern void *kmemdup(const void *src, size_t len, gfp_t gfp); | |
2596 | # 9 "include/linux/bitmap.h" 2 | |
2597 | # 84 "include/linux/bitmap.h" | |
2598 | extern int __bitmap_empty(const unsigned long *bitmap, int bits); | |
2599 | extern int __bitmap_full(const unsigned long *bitmap, int bits); | |
2600 | extern int __bitmap_equal(const unsigned long *bitmap1, | |
2601 | const unsigned long *bitmap2, int bits); | |
2602 | extern void __bitmap_complement(unsigned long *dst, const unsigned long *src, | |
2603 | int bits); | |
2604 | extern void __bitmap_shift_right(unsigned long *dst, | |
2605 | const unsigned long *src, int shift, int bits); | |
2606 | extern void __bitmap_shift_left(unsigned long *dst, | |
2607 | const unsigned long *src, int shift, int bits); | |
2608 | extern void __bitmap_and(unsigned long *dst, const unsigned long *bitmap1, | |
2609 | const unsigned long *bitmap2, int bits); | |
2610 | extern void __bitmap_or(unsigned long *dst, const unsigned long *bitmap1, | |
2611 | const unsigned long *bitmap2, int bits); | |
2612 | extern void __bitmap_xor(unsigned long *dst, const unsigned long *bitmap1, | |
2613 | const unsigned long *bitmap2, int bits); | |
2614 | extern void __bitmap_andnot(unsigned long *dst, const unsigned long *bitmap1, | |
2615 | const unsigned long *bitmap2, int bits); | |
2616 | extern int __bitmap_intersects(const unsigned long *bitmap1, | |
2617 | const unsigned long *bitmap2, int bits); | |
2618 | extern int __bitmap_subset(const unsigned long *bitmap1, | |
2619 | const unsigned long *bitmap2, int bits); | |
2620 | extern int __bitmap_weight(const unsigned long *bitmap, int bits); | |
2621 | ||
2622 | extern int bitmap_scnprintf(char *buf, unsigned int len, | |
2623 | const unsigned long *src, int nbits); | |
2624 | extern int __bitmap_parse(const char *buf, unsigned int buflen, int is_user, | |
2625 | unsigned long *dst, int nbits); | |
2626 | extern int bitmap_parse_user(const char *ubuf, unsigned int ulen, | |
2627 | unsigned long *dst, int nbits); | |
2628 | extern int bitmap_scnlistprintf(char *buf, unsigned int len, | |
2629 | const unsigned long *src, int nbits); | |
2630 | extern int bitmap_parselist(const char *buf, unsigned long *maskp, | |
2631 | int nmaskbits); | |
2632 | extern void bitmap_remap(unsigned long *dst, const unsigned long *src, | |
2633 | const unsigned long *old, const unsigned long *new, int bits); | |
2634 | extern int bitmap_bitremap(int oldbit, | |
2635 | const unsigned long *old, const unsigned long *new, int bits); | |
2636 | extern int bitmap_find_free_region(unsigned long *bitmap, int bits, int order); | |
2637 | extern void bitmap_release_region(unsigned long *bitmap, int pos, int order); | |
2638 | extern int bitmap_allocate_region(unsigned long *bitmap, int pos, int order); | |
2639 | ||
2640 | ||
2641 | ||
2642 | ||
2643 | ||
2644 | ||
2645 | ||
2646 | static inline __attribute__((always_inline)) void bitmap_zero(unsigned long *dst, int nbits) | |
2647 | { | |
2648 | if (nbits <= 32) | |
2649 | *dst = 0UL; | |
2650 | else { | |
2651 | int len = (((nbits)+32 -1)/32) * sizeof(unsigned long); | |
2652 | memset(dst, 0, len); | |
2653 | } | |
2654 | } | |
2655 | ||
2656 | static inline __attribute__((always_inline)) void bitmap_fill(unsigned long *dst, int nbits) | |
2657 | { | |
2658 | size_t nlongs = (((nbits)+32 -1)/32); | |
2659 | if (nlongs > 1) { | |
2660 | int len = (nlongs - 1) * sizeof(unsigned long); | |
2661 | memset(dst, 0xff, len); | |
2662 | } | |
2663 | dst[nlongs - 1] = ( ((nbits) % 32) ? (1UL<<((nbits) % 32))-1 : ~0UL ); | |
2664 | } | |
2665 | ||
2666 | static inline __attribute__((always_inline)) void bitmap_copy(unsigned long *dst, const unsigned long *src, | |
2667 | int nbits) | |
2668 | { | |
2669 | if (nbits <= 32) | |
2670 | *dst = *src; | |
2671 | else { | |
2672 | int len = (((nbits)+32 -1)/32) * sizeof(unsigned long); | |
2673 | memcpy(dst, src, len); | |
2674 | } | |
2675 | } | |
2676 | ||
2677 | static inline __attribute__((always_inline)) void bitmap_and(unsigned long *dst, const unsigned long *src1, | |
2678 | const unsigned long *src2, int nbits) | |
2679 | { | |
2680 | if (nbits <= 32) | |
2681 | *dst = *src1 & *src2; | |
2682 | else | |
2683 | __bitmap_and(dst, src1, src2, nbits); | |
2684 | } | |
2685 | ||
2686 | static inline __attribute__((always_inline)) void bitmap_or(unsigned long *dst, const unsigned long *src1, | |
2687 | const unsigned long *src2, int nbits) | |
2688 | { | |
2689 | if (nbits <= 32) | |
2690 | *dst = *src1 | *src2; | |
2691 | else | |
2692 | __bitmap_or(dst, src1, src2, nbits); | |
2693 | } | |
2694 | ||
2695 | static inline __attribute__((always_inline)) void bitmap_xor(unsigned long *dst, const unsigned long *src1, | |
2696 | const unsigned long *src2, int nbits) | |
2697 | { | |
2698 | if (nbits <= 32) | |
2699 | *dst = *src1 ^ *src2; | |
2700 | else | |
2701 | __bitmap_xor(dst, src1, src2, nbits); | |
2702 | } | |
2703 | ||
2704 | static inline __attribute__((always_inline)) void bitmap_andnot(unsigned long *dst, const unsigned long *src1, | |
2705 | const unsigned long *src2, int nbits) | |
2706 | { | |
2707 | if (nbits <= 32) | |
2708 | *dst = *src1 & ~(*src2); | |
2709 | else | |
2710 | __bitmap_andnot(dst, src1, src2, nbits); | |
2711 | } | |
2712 | ||
2713 | static inline __attribute__((always_inline)) void bitmap_complement(unsigned long *dst, const unsigned long *src, | |
2714 | int nbits) | |
2715 | { | |
2716 | if (nbits <= 32) | |
2717 | *dst = ~(*src) & ( ((nbits) % 32) ? (1UL<<((nbits) % 32))-1 : ~0UL ); | |
2718 | else | |
2719 | __bitmap_complement(dst, src, nbits); | |
2720 | } | |
2721 | ||
2722 | static inline __attribute__((always_inline)) int bitmap_equal(const unsigned long *src1, | |
2723 | const unsigned long *src2, int nbits) | |
2724 | { | |
2725 | if (nbits <= 32) | |
2726 | return ! ((*src1 ^ *src2) & ( ((nbits) % 32) ? (1UL<<((nbits) % 32))-1 : ~0UL )); | |
2727 | else | |
2728 | return __bitmap_equal(src1, src2, nbits); | |
2729 | } | |
2730 | ||
2731 | static inline __attribute__((always_inline)) int bitmap_intersects(const unsigned long *src1, | |
2732 | const unsigned long *src2, int nbits) | |
2733 | { | |
2734 | if (nbits <= 32) | |
2735 | return ((*src1 & *src2) & ( ((nbits) % 32) ? (1UL<<((nbits) % 32))-1 : ~0UL )) != 0; | |
2736 | else | |
2737 | return __bitmap_intersects(src1, src2, nbits); | |
2738 | } | |
2739 | ||
2740 | static inline __attribute__((always_inline)) int bitmap_subset(const unsigned long *src1, | |
2741 | const unsigned long *src2, int nbits) | |
2742 | { | |
2743 | if (nbits <= 32) | |
2744 | return ! ((*src1 & ~(*src2)) & ( ((nbits) % 32) ? (1UL<<((nbits) % 32))-1 : ~0UL )); | |
2745 | else | |
2746 | return __bitmap_subset(src1, src2, nbits); | |
2747 | } | |
2748 | ||
2749 | static inline __attribute__((always_inline)) int bitmap_empty(const unsigned long *src, int nbits) | |
2750 | { | |
2751 | if (nbits <= 32) | |
2752 | return ! (*src & ( ((nbits) % 32) ? (1UL<<((nbits) % 32))-1 : ~0UL )); | |
2753 | else | |
2754 | return __bitmap_empty(src, nbits); | |
2755 | } | |
2756 | ||
2757 | static inline __attribute__((always_inline)) int bitmap_full(const unsigned long *src, int nbits) | |
2758 | { | |
2759 | if (nbits <= 32) | |
2760 | return ! (~(*src) & ( ((nbits) % 32) ? (1UL<<((nbits) % 32))-1 : ~0UL )); | |
2761 | else | |
2762 | return __bitmap_full(src, nbits); | |
2763 | } | |
2764 | ||
2765 | static inline __attribute__((always_inline)) int bitmap_weight(const unsigned long *src, int nbits) | |
2766 | { | |
2767 | if (nbits <= 32) | |
2768 | return hweight_long(*src & ( ((nbits) % 32) ? (1UL<<((nbits) % 32))-1 : ~0UL )); | |
2769 | return __bitmap_weight(src, nbits); | |
2770 | } | |
2771 | ||
2772 | static inline __attribute__((always_inline)) void bitmap_shift_right(unsigned long *dst, | |
2773 | const unsigned long *src, int n, int nbits) | |
2774 | { | |
2775 | if (nbits <= 32) | |
2776 | *dst = *src >> n; | |
2777 | else | |
2778 | __bitmap_shift_right(dst, src, n, nbits); | |
2779 | } | |
2780 | ||
2781 | static inline __attribute__((always_inline)) void bitmap_shift_left(unsigned long *dst, | |
2782 | const unsigned long *src, int n, int nbits) | |
2783 | { | |
2784 | if (nbits <= 32) | |
2785 | *dst = (*src << n) & ( ((nbits) % 32) ? (1UL<<((nbits) % 32))-1 : ~0UL ); | |
2786 | else | |
2787 | __bitmap_shift_left(dst, src, n, nbits); | |
2788 | } | |
2789 | ||
2790 | static inline __attribute__((always_inline)) int bitmap_parse(const char *buf, unsigned int buflen, | |
2791 | unsigned long *maskp, int nmaskbits) | |
2792 | { | |
2793 | return __bitmap_parse(buf, buflen, 0, maskp, nmaskbits); | |
2794 | } | |
2795 | # 87 "include/linux/cpumask.h" 2 | |
2796 | ||
2797 | typedef struct { unsigned long bits[(((1)+32 -1)/32)]; } cpumask_t; | |
2798 | extern cpumask_t _unused_cpumask_arg_; | |
2799 | ||
2800 | ||
2801 | static inline __attribute__((always_inline)) void __cpu_set(int cpu, volatile cpumask_t *dstp) | |
2802 | { | |
2803 | set_bit(cpu, dstp->bits); | |
2804 | } | |
2805 | ||
2806 | ||
2807 | static inline __attribute__((always_inline)) void __cpu_clear(int cpu, volatile cpumask_t *dstp) | |
2808 | { | |
2809 | clear_bit(cpu, dstp->bits); | |
2810 | } | |
2811 | ||
2812 | ||
2813 | static inline __attribute__((always_inline)) void __cpus_setall(cpumask_t *dstp, int nbits) | |
2814 | { | |
2815 | bitmap_fill(dstp->bits, nbits); | |
2816 | } | |
2817 | ||
2818 | ||
2819 | static inline __attribute__((always_inline)) void __cpus_clear(cpumask_t *dstp, int nbits) | |
2820 | { | |
2821 | bitmap_zero(dstp->bits, nbits); | |
2822 | } | |
2823 | ||
2824 | ||
2825 | ||
2826 | ||
2827 | ||
2828 | static inline __attribute__((always_inline)) int __cpu_test_and_set(int cpu, cpumask_t *addr) | |
2829 | { | |
2830 | return test_and_set_bit(cpu, addr->bits); | |
2831 | } | |
2832 | ||
2833 | ||
2834 | static inline __attribute__((always_inline)) void __cpus_and(cpumask_t *dstp, const cpumask_t *src1p, | |
2835 | const cpumask_t *src2p, int nbits) | |
2836 | { | |
2837 | bitmap_and(dstp->bits, src1p->bits, src2p->bits, nbits); | |
2838 | } | |
2839 | ||
2840 | ||
2841 | static inline __attribute__((always_inline)) void __cpus_or(cpumask_t *dstp, const cpumask_t *src1p, | |
2842 | const cpumask_t *src2p, int nbits) | |
2843 | { | |
2844 | bitmap_or(dstp->bits, src1p->bits, src2p->bits, nbits); | |
2845 | } | |
2846 | ||
2847 | ||
2848 | static inline __attribute__((always_inline)) void __cpus_xor(cpumask_t *dstp, const cpumask_t *src1p, | |
2849 | const cpumask_t *src2p, int nbits) | |
2850 | { | |
2851 | bitmap_xor(dstp->bits, src1p->bits, src2p->bits, nbits); | |
2852 | } | |
2853 | ||
2854 | ||
2855 | ||
2856 | static inline __attribute__((always_inline)) void __cpus_andnot(cpumask_t *dstp, const cpumask_t *src1p, | |
2857 | const cpumask_t *src2p, int nbits) | |
2858 | { | |
2859 | bitmap_andnot(dstp->bits, src1p->bits, src2p->bits, nbits); | |
2860 | } | |
2861 | ||
2862 | ||
2863 | static inline __attribute__((always_inline)) void __cpus_complement(cpumask_t *dstp, | |
2864 | const cpumask_t *srcp, int nbits) | |
2865 | { | |
2866 | bitmap_complement(dstp->bits, srcp->bits, nbits); | |
2867 | } | |
2868 | ||
2869 | ||
2870 | static inline __attribute__((always_inline)) int __cpus_equal(const cpumask_t *src1p, | |
2871 | const cpumask_t *src2p, int nbits) | |
2872 | { | |
2873 | return bitmap_equal(src1p->bits, src2p->bits, nbits); | |
2874 | } | |
2875 | ||
2876 | ||
2877 | static inline __attribute__((always_inline)) int __cpus_intersects(const cpumask_t *src1p, | |
2878 | const cpumask_t *src2p, int nbits) | |
2879 | { | |
2880 | return bitmap_intersects(src1p->bits, src2p->bits, nbits); | |
2881 | } | |
2882 | ||
2883 | ||
2884 | static inline __attribute__((always_inline)) int __cpus_subset(const cpumask_t *src1p, | |
2885 | const cpumask_t *src2p, int nbits) | |
2886 | { | |
2887 | return bitmap_subset(src1p->bits, src2p->bits, nbits); | |
2888 | } | |
2889 | ||
2890 | ||
2891 | static inline __attribute__((always_inline)) int __cpus_empty(const cpumask_t *srcp, int nbits) | |
2892 | { | |
2893 | return bitmap_empty(srcp->bits, nbits); | |
2894 | } | |
2895 | ||
2896 | ||
2897 | static inline __attribute__((always_inline)) int __cpus_full(const cpumask_t *srcp, int nbits) | |
2898 | { | |
2899 | return bitmap_full(srcp->bits, nbits); | |
2900 | } | |
2901 | ||
2902 | ||
2903 | static inline __attribute__((always_inline)) int __cpus_weight(const cpumask_t *srcp, int nbits) | |
2904 | { | |
2905 | return bitmap_weight(srcp->bits, nbits); | |
2906 | } | |
2907 | ||
2908 | ||
2909 | ||
2910 | static inline __attribute__((always_inline)) void __cpus_shift_right(cpumask_t *dstp, | |
2911 | const cpumask_t *srcp, int n, int nbits) | |
2912 | { | |
2913 | bitmap_shift_right(dstp->bits, srcp->bits, n, nbits); | |
2914 | } | |
2915 | ||
2916 | ||
2917 | ||
2918 | static inline __attribute__((always_inline)) void __cpus_shift_left(cpumask_t *dstp, | |
2919 | const cpumask_t *srcp, int n, int nbits) | |
2920 | { | |
2921 | bitmap_shift_left(dstp->bits, srcp->bits, n, nbits); | |
2922 | } | |
2923 | # 270 "include/linux/cpumask.h" | |
2924 | static inline __attribute__((always_inline)) int __cpumask_scnprintf(char *buf, int len, | |
2925 | const cpumask_t *srcp, int nbits) | |
2926 | { | |
2927 | return bitmap_scnprintf(buf, len, srcp->bits, nbits); | |
2928 | } | |
2929 | ||
2930 | ||
2931 | ||
2932 | static inline __attribute__((always_inline)) int __cpumask_parse_user(const char *buf, int len, | |
2933 | cpumask_t *dstp, int nbits) | |
2934 | { | |
2935 | return bitmap_parse_user(buf, len, dstp->bits, nbits); | |
2936 | } | |
2937 | ||
2938 | ||
2939 | ||
2940 | static inline __attribute__((always_inline)) int __cpulist_scnprintf(char *buf, int len, | |
2941 | const cpumask_t *srcp, int nbits) | |
2942 | { | |
2943 | return bitmap_scnlistprintf(buf, len, srcp->bits, nbits); | |
2944 | } | |
2945 | ||
2946 | ||
2947 | static inline __attribute__((always_inline)) int __cpulist_parse(const char *buf, cpumask_t *dstp, int nbits) | |
2948 | { | |
2949 | return bitmap_parselist(buf, dstp->bits, nbits); | |
2950 | } | |
2951 | ||
2952 | ||
2953 | ||
2954 | static inline __attribute__((always_inline)) int __cpu_remap(int oldbit, | |
2955 | const cpumask_t *oldp, const cpumask_t *newp, int nbits) | |
2956 | { | |
2957 | return bitmap_bitremap(oldbit, oldp->bits, newp->bits, nbits); | |
2958 | } | |
2959 | ||
2960 | ||
2961 | ||
2962 | static inline __attribute__((always_inline)) void __cpus_remap(cpumask_t *dstp, const cpumask_t *srcp, | |
2963 | const cpumask_t *oldp, const cpumask_t *newp, int nbits) | |
2964 | { | |
2965 | bitmap_remap(dstp->bits, srcp->bits, oldp->bits, newp->bits, nbits); | |
2966 | } | |
2967 | # 380 "include/linux/cpumask.h" | |
2968 | extern cpumask_t cpu_possible_map; | |
2969 | extern cpumask_t cpu_online_map; | |
2970 | extern cpumask_t cpu_present_map; | |
2971 | # 55 "include/linux/sched.h" 2 | |
2972 | # 1 "include/linux/errno.h" 1 | |
2973 | ||
2974 | ||
2975 | ||
2976 | # 1 "include/asm/errno.h" 1 | |
2977 | ||
2978 | ||
2979 | ||
2980 | # 1 "include/asm-generic/errno.h" 1 | |
2981 | ||
2982 | ||
2983 | ||
2984 | # 1 "include/asm-generic/errno-base.h" 1 | |
2985 | # 5 "include/asm-generic/errno.h" 2 | |
2986 | # 5 "include/asm/errno.h" 2 | |
2987 | # 5 "include/linux/errno.h" 2 | |
2988 | # 56 "include/linux/sched.h" 2 | |
2989 | # 1 "include/linux/nodemask.h" 1 | |
2990 | # 86 "include/linux/nodemask.h" | |
2991 | # 1 "include/linux/numa.h" 1 | |
2992 | # 87 "include/linux/nodemask.h" 2 | |
2993 | ||
2994 | typedef struct { unsigned long bits[((((1 << 0))+32 -1)/32)]; } nodemask_t; | |
2995 | extern nodemask_t _unused_nodemask_arg_; | |
2996 | ||
2997 | ||
2998 | static inline __attribute__((always_inline)) void __node_set(int node, volatile nodemask_t *dstp) | |
2999 | { | |
3000 | set_bit(node, dstp->bits); | |
3001 | } | |
3002 | ||
3003 | ||
3004 | static inline __attribute__((always_inline)) void __node_clear(int node, volatile nodemask_t *dstp) | |
3005 | { | |
3006 | clear_bit(node, dstp->bits); | |
3007 | } | |
3008 | ||
3009 | ||
3010 | static inline __attribute__((always_inline)) void __nodes_setall(nodemask_t *dstp, int nbits) | |
3011 | { | |
3012 | bitmap_fill(dstp->bits, nbits); | |
3013 | } | |
3014 | ||
3015 | ||
3016 | static inline __attribute__((always_inline)) void __nodes_clear(nodemask_t *dstp, int nbits) | |
3017 | { | |
3018 | bitmap_zero(dstp->bits, nbits); | |
3019 | } | |
3020 | ||
3021 | ||
3022 | ||
3023 | ||
3024 | ||
3025 | ||
3026 | static inline __attribute__((always_inline)) int __node_test_and_set(int node, nodemask_t *addr) | |
3027 | { | |
3028 | return test_and_set_bit(node, addr->bits); | |
3029 | } | |
3030 | ||
3031 | ||
3032 | ||
3033 | static inline __attribute__((always_inline)) void __nodes_and(nodemask_t *dstp, const nodemask_t *src1p, | |
3034 | const nodemask_t *src2p, int nbits) | |
3035 | { | |
3036 | bitmap_and(dstp->bits, src1p->bits, src2p->bits, nbits); | |
3037 | } | |
3038 | ||
3039 | ||
3040 | ||
3041 | static inline __attribute__((always_inline)) void __nodes_or(nodemask_t *dstp, const nodemask_t *src1p, | |
3042 | const nodemask_t *src2p, int nbits) | |
3043 | { | |
3044 | bitmap_or(dstp->bits, src1p->bits, src2p->bits, nbits); | |
3045 | } | |
3046 | ||
3047 | ||
3048 | ||
3049 | static inline __attribute__((always_inline)) void __nodes_xor(nodemask_t *dstp, const nodemask_t *src1p, | |
3050 | const nodemask_t *src2p, int nbits) | |
3051 | { | |
3052 | bitmap_xor(dstp->bits, src1p->bits, src2p->bits, nbits); | |
3053 | } | |
3054 | ||
3055 | ||
3056 | ||
3057 | static inline __attribute__((always_inline)) void __nodes_andnot(nodemask_t *dstp, const nodemask_t *src1p, | |
3058 | const nodemask_t *src2p, int nbits) | |
3059 | { | |
3060 | bitmap_andnot(dstp->bits, src1p->bits, src2p->bits, nbits); | |
3061 | } | |
3062 | ||
3063 | ||
3064 | ||
3065 | static inline __attribute__((always_inline)) void __nodes_complement(nodemask_t *dstp, | |
3066 | const nodemask_t *srcp, int nbits) | |
3067 | { | |
3068 | bitmap_complement(dstp->bits, srcp->bits, nbits); | |
3069 | } | |
3070 | ||
3071 | ||
3072 | ||
3073 | static inline __attribute__((always_inline)) int __nodes_equal(const nodemask_t *src1p, | |
3074 | const nodemask_t *src2p, int nbits) | |
3075 | { | |
3076 | return bitmap_equal(src1p->bits, src2p->bits, nbits); | |
3077 | } | |
3078 | ||
3079 | ||
3080 | ||
3081 | static inline __attribute__((always_inline)) int __nodes_intersects(const nodemask_t *src1p, | |
3082 | const nodemask_t *src2p, int nbits) | |
3083 | { | |
3084 | return bitmap_intersects(src1p->bits, src2p->bits, nbits); | |
3085 | } | |
3086 | ||
3087 | ||
3088 | ||
3089 | static inline __attribute__((always_inline)) int __nodes_subset(const nodemask_t *src1p, | |
3090 | const nodemask_t *src2p, int nbits) | |
3091 | { | |
3092 | return bitmap_subset(src1p->bits, src2p->bits, nbits); | |
3093 | } | |
3094 | ||
3095 | ||
3096 | static inline __attribute__((always_inline)) int __nodes_empty(const nodemask_t *srcp, int nbits) | |
3097 | { | |
3098 | return bitmap_empty(srcp->bits, nbits); | |
3099 | } | |
3100 | ||
3101 | ||
3102 | static inline __attribute__((always_inline)) int __nodes_full(const nodemask_t *srcp, int nbits) | |
3103 | { | |
3104 | return bitmap_full(srcp->bits, nbits); | |
3105 | } | |
3106 | ||
3107 | ||
3108 | static inline __attribute__((always_inline)) int __nodes_weight(const nodemask_t *srcp, int nbits) | |
3109 | { | |
3110 | return bitmap_weight(srcp->bits, nbits); | |
3111 | } | |
3112 | ||
3113 | ||
3114 | ||
3115 | static inline __attribute__((always_inline)) void __nodes_shift_right(nodemask_t *dstp, | |
3116 | const nodemask_t *srcp, int n, int nbits) | |
3117 | { | |
3118 | bitmap_shift_right(dstp->bits, srcp->bits, n, nbits); | |
3119 | } | |
3120 | ||
3121 | ||
3122 | ||
3123 | static inline __attribute__((always_inline)) void __nodes_shift_left(nodemask_t *dstp, | |
3124 | const nodemask_t *srcp, int n, int nbits) | |
3125 | { | |
3126 | bitmap_shift_left(dstp->bits, srcp->bits, n, nbits); | |
3127 | } | |
3128 | ||
3129 | ||
3130 | ||
3131 | ||
3132 | ||
3133 | static inline __attribute__((always_inline)) int __first_node(const nodemask_t *srcp) | |
3134 | { | |
3135 | return ({ int __x = ((1 << 0)); int __y = (find_next_bit((srcp->bits), ((1 << 0)), 0)); __x < __y ? __x: __y; }); | |
3136 | } | |
3137 | ||
3138 | ||
3139 | static inline __attribute__((always_inline)) int __next_node(int n, const nodemask_t *srcp) | |
3140 | { | |
3141 | return ({ int __x = ((1 << 0)); int __y = (find_next_bit(srcp->bits, (1 << 0), n+1)); __x < __y ? __x: __y; }); | |
3142 | } | |
3143 | # 251 "include/linux/nodemask.h" | |
3144 | static inline __attribute__((always_inline)) int __first_unset_node(const nodemask_t *maskp) | |
3145 | { | |
3146 | return ({ int __x = ((1 << 0)); int __y = (find_next_zero_bit((maskp->bits), ((1 << 0)), 0)); __x < __y ? __x: __y; }); | |
3147 | ||
3148 | } | |
3149 | # 285 "include/linux/nodemask.h" | |
3150 | static inline __attribute__((always_inline)) int __nodemask_scnprintf(char *buf, int len, | |
3151 | const nodemask_t *srcp, int nbits) | |
3152 | { | |
3153 | return bitmap_scnprintf(buf, len, srcp->bits, nbits); | |
3154 | } | |
3155 | ||
3156 | ||
3157 | ||
3158 | static inline __attribute__((always_inline)) int __nodemask_parse_user(const char *buf, int len, | |
3159 | nodemask_t *dstp, int nbits) | |
3160 | { | |
3161 | return bitmap_parse_user(buf, len, dstp->bits, nbits); | |
3162 | } | |
3163 | ||
3164 | ||
3165 | ||
3166 | static inline __attribute__((always_inline)) int __nodelist_scnprintf(char *buf, int len, | |
3167 | const nodemask_t *srcp, int nbits) | |
3168 | { | |
3169 | return bitmap_scnlistprintf(buf, len, srcp->bits, nbits); | |
3170 | } | |
3171 | ||
3172 | ||
3173 | static inline __attribute__((always_inline)) int __nodelist_parse(const char *buf, nodemask_t *dstp, int nbits) | |
3174 | { | |
3175 | return bitmap_parselist(buf, dstp->bits, nbits); | |
3176 | } | |
3177 | ||
3178 | ||
3179 | ||
3180 | static inline __attribute__((always_inline)) int __node_remap(int oldbit, | |
3181 | const nodemask_t *oldp, const nodemask_t *newp, int nbits) | |
3182 | { | |
3183 | return bitmap_bitremap(oldbit, oldp->bits, newp->bits, nbits); | |
3184 | } | |
3185 | ||
3186 | ||
3187 | ||
3188 | static inline __attribute__((always_inline)) void __nodes_remap(nodemask_t *dstp, const nodemask_t *srcp, | |
3189 | const nodemask_t *oldp, const nodemask_t *newp, int nbits) | |
3190 | { | |
3191 | bitmap_remap(dstp->bits, srcp->bits, oldp->bits, newp->bits, nbits); | |
3192 | } | |
3193 | # 345 "include/linux/nodemask.h" | |
3194 | extern nodemask_t node_online_map; | |
3195 | extern nodemask_t node_possible_map; | |
3196 | # 57 "include/linux/sched.h" 2 | |
3197 | ||
3198 | ||
3199 | # 1 "include/asm/semaphore.h" 1 | |
3200 | ||
3201 | ||
3202 | ||
3203 | ||
3204 | ||
3205 | ||
3206 | # 1 "include/linux/wait.h" 1 | |
3207 | # 22 "include/linux/wait.h" | |
3208 | # 1 "include/linux/list.h" 1 | |
3209 | ||
3210 | ||
3211 | ||
3212 | ||
3213 | ||
3214 | ||
3215 | # 1 "include/linux/poison.h" 1 | |
3216 | # 8 "include/linux/list.h" 2 | |
3217 | # 1 "include/linux/prefetch.h" 1 | |
3218 | # 14 "include/linux/prefetch.h" | |
3219 | # 1 "include/asm/processor.h" 1 | |
3220 | # 10 "include/asm/processor.h" | |
3221 | # 1 "include/asm/segment.h" 1 | |
3222 | # 11 "include/asm/processor.h" 2 | |
3223 | ||
3224 | ||
3225 | static inline __attribute__((always_inline)) unsigned long rdusp(void) | |
3226 | { | |
3227 | unsigned long usp; | |
3228 | ||
3229 | __asm__ __volatile__("%0 = usp;\n\t":"=da"(usp)); | |
3230 | return usp; | |
3231 | } | |
3232 | ||
3233 | static inline __attribute__((always_inline)) void wrusp(unsigned long usp) | |
3234 | { | |
3235 | __asm__ __volatile__("usp = %0;\n\t"::"da"(usp)); | |
3236 | } | |
3237 | ||
3238 | ||
3239 | ||
3240 | ||
3241 | extern unsigned long memory_end; | |
3242 | ||
3243 | ||
3244 | ||
3245 | ||
3246 | struct thread_struct { | |
3247 | unsigned long ksp; | |
3248 | unsigned long usp; | |
3249 | unsigned short seqstat; | |
3250 | unsigned long esp0; | |
3251 | unsigned long pc; | |
3252 | void * debuggerinfo; | |
3253 | }; | |
3254 | # 69 "include/asm/processor.h" | |
3255 | struct task_struct; | |
3256 | ||
3257 | ||
3258 | static inline __attribute__((always_inline)) void release_thread(struct task_struct *dead_task) | |
3259 | { | |
3260 | } | |
3261 | ||
3262 | ||
3263 | ||
3264 | extern int kernel_thread(int (*fn) (void *), void *arg, unsigned long flags); | |
3265 | ||
3266 | ||
3267 | ||
3268 | ||
3269 | static inline __attribute__((always_inline)) void exit_thread(void) | |
3270 | { | |
3271 | } | |
3272 | ||
3273 | ||
3274 | ||
3275 | ||
3276 | ||
3277 | ||
3278 | unsigned long get_wchan(struct task_struct *p); | |
3279 | # 15 "include/linux/prefetch.h" 2 | |
3280 | # 1 "include/asm/cache.h" 1 | |
3281 | # 16 "include/linux/prefetch.h" 2 | |
3282 | # 43 "include/linux/prefetch.h" | |
3283 | static inline __attribute__((always_inline)) void prefetch(const void *x) {;} | |
3284 | ||
3285 | ||
3286 | ||
3287 | static inline __attribute__((always_inline)) void prefetchw(const void *x) {;} | |
3288 | # 58 "include/linux/prefetch.h" | |
3289 | static inline __attribute__((always_inline)) void prefetch_range(void *addr, size_t len) | |
3290 | { | |
3291 | ||
3292 | ||
3293 | ||
3294 | ||
3295 | ||
3296 | ||
3297 | ||
3298 | } | |
3299 | # 9 "include/linux/list.h" 2 | |
3300 | # 21 "include/linux/list.h" | |
3301 | struct list_head { | |
3302 | struct list_head *next, *prev; | |
3303 | }; | |
3304 | ||
3305 | ||
3306 | ||
3307 | ||
3308 | ||
3309 | ||
3310 | static inline __attribute__((always_inline)) void INIT_LIST_HEAD(struct list_head *list) | |
3311 | { | |
3312 | list->next = list; | |
3313 | list->prev = list; | |
3314 | } | |
3315 | # 43 "include/linux/list.h" | |
3316 | static inline __attribute__((always_inline)) void __list_add(struct list_head *new, | |
3317 | struct list_head *prev, | |
3318 | struct list_head *next) | |
3319 | { | |
3320 | next->prev = new; | |
3321 | new->next = next; | |
3322 | new->prev = prev; | |
3323 | prev->next = new; | |
3324 | } | |
3325 | # 67 "include/linux/list.h" | |
3326 | static inline __attribute__((always_inline)) void list_add(struct list_head *new, struct list_head *head) | |
3327 | { | |
3328 | __list_add(new, head, head->next); | |
3329 | } | |
3330 | # 84 "include/linux/list.h" | |
3331 | static inline __attribute__((always_inline)) void list_add_tail(struct list_head *new, struct list_head *head) | |
3332 | { | |
3333 | __list_add(new, head->prev, head); | |
3334 | } | |
3335 | ||
3336 | ||
3337 | ||
3338 | ||
3339 | ||
3340 | ||
3341 | ||
3342 | static inline __attribute__((always_inline)) void __list_add_rcu(struct list_head * new, | |
3343 | struct list_head * prev, struct list_head * next) | |
3344 | { | |
3345 | new->next = next; | |
3346 | new->prev = prev; | |
3347 | __asm__ __volatile__("": : :"memory"); | |
3348 | next->prev = new; | |
3349 | prev->next = new; | |
3350 | } | |
3351 | # 121 "include/linux/list.h" | |
3352 | static inline __attribute__((always_inline)) void list_add_rcu(struct list_head *new, struct list_head *head) | |
3353 | { | |
3354 | __list_add_rcu(new, head, head->next); | |
3355 | } | |
3356 | # 142 "include/linux/list.h" | |
3357 | static inline __attribute__((always_inline)) void list_add_tail_rcu(struct list_head *new, | |
3358 | struct list_head *head) | |
3359 | { | |
3360 | __list_add_rcu(new, head->prev, head); | |
3361 | } | |
3362 | # 155 "include/linux/list.h" | |
3363 | static inline __attribute__((always_inline)) void __list_del(struct list_head * prev, struct list_head * next) | |
3364 | { | |
3365 | next->prev = prev; | |
3366 | prev->next = next; | |
3367 | } | |
3368 | # 168 "include/linux/list.h" | |
3369 | static inline __attribute__((always_inline)) void list_del(struct list_head *entry) | |
3370 | { | |
3371 | __list_del(entry->prev, entry->next); | |
3372 | entry->next = ((void *) 0x00100100); | |
3373 | entry->prev = ((void *) 0x00200200); | |
3374 | } | |
3375 | # 202 "include/linux/list.h" | |
3376 | static inline __attribute__((always_inline)) void list_del_rcu(struct list_head *entry) | |
3377 | { | |
3378 | __list_del(entry->prev, entry->next); | |
3379 | entry->prev = ((void *) 0x00200200); | |
3380 | } | |
3381 | ||
3382 | ||
3383 | ||
3384 | ||
3385 | ||
3386 | ||
3387 | ||
3388 | static inline __attribute__((always_inline)) void list_replace(struct list_head *old, | |
3389 | struct list_head *new) | |
3390 | { | |
3391 | new->next = old->next; | |
3392 | new->next->prev = new; | |
3393 | new->prev = old->prev; | |
3394 | new->prev->next = new; | |
3395 | } | |
3396 | ||
3397 | static inline __attribute__((always_inline)) void list_replace_init(struct list_head *old, | |
3398 | struct list_head *new) | |
3399 | { | |
3400 | list_replace(old, new); | |
3401 | INIT_LIST_HEAD(old); | |
3402 | } | |
3403 | # 238 "include/linux/list.h" | |
3404 | static inline __attribute__((always_inline)) void list_replace_rcu(struct list_head *old, | |
3405 | struct list_head *new) | |
3406 | { | |
3407 | new->next = old->next; | |
3408 | new->prev = old->prev; | |
3409 | __asm__ __volatile__("": : :"memory"); | |
3410 | new->next->prev = new; | |
3411 | new->prev->next = new; | |
3412 | old->prev = ((void *) 0x00200200); | |
3413 | } | |
3414 | ||
3415 | ||
3416 | ||
3417 | ||
3418 | ||
3419 | static inline __attribute__((always_inline)) void list_del_init(struct list_head *entry) | |
3420 | { | |
3421 | __list_del(entry->prev, entry->next); | |
3422 | INIT_LIST_HEAD(entry); | |
3423 | } | |
3424 | ||
3425 | ||
3426 | ||
3427 | ||
3428 | ||
3429 | ||
3430 | static inline __attribute__((always_inline)) void list_move(struct list_head *list, struct list_head *head) | |
3431 | { | |
3432 | __list_del(list->prev, list->next); | |
3433 | list_add(list, head); | |
3434 | } | |
3435 | ||
3436 | ||
3437 | ||
3438 | ||
3439 | ||
3440 | ||
3441 | static inline __attribute__((always_inline)) void list_move_tail(struct list_head *list, | |
3442 | struct list_head *head) | |
3443 | { | |
3444 | __list_del(list->prev, list->next); | |
3445 | list_add_tail(list, head); | |
3446 | } | |
3447 | ||
3448 | ||
3449 | ||
3450 | ||
3451 | ||
3452 | ||
3453 | static inline __attribute__((always_inline)) int list_is_last(const struct list_head *list, | |
3454 | const struct list_head *head) | |
3455 | { | |
3456 | return list->next == head; | |
3457 | } | |
3458 | ||
3459 | ||
3460 | ||
3461 | ||
3462 | ||
3463 | static inline __attribute__((always_inline)) int list_empty(const struct list_head *head) | |
3464 | { | |
3465 | return head->next == head; | |
3466 | } | |
3467 | # 315 "include/linux/list.h" | |
3468 | static inline __attribute__((always_inline)) int list_empty_careful(const struct list_head *head) | |
3469 | { | |
3470 | struct list_head *next = head->next; | |
3471 | return (next == head) && (next == head->prev); | |
3472 | } | |
3473 | ||
3474 | static inline __attribute__((always_inline)) void __list_splice(struct list_head *list, | |
3475 | struct list_head *head) | |
3476 | { | |
3477 | struct list_head *first = list->next; | |
3478 | struct list_head *last = list->prev; | |
3479 | struct list_head *at = head->next; | |
3480 | ||
3481 | first->prev = head; | |
3482 | head->next = first; | |
3483 | ||
3484 | last->next = at; | |
3485 | at->prev = last; | |
3486 | } | |
3487 | ||
3488 | ||
3489 | ||
3490 | ||
3491 | ||
3492 | ||
3493 | static inline __attribute__((always_inline)) void list_splice(struct list_head *list, struct list_head *head) | |
3494 | { | |
3495 | if (!list_empty(list)) | |
3496 | __list_splice(list, head); | |
3497 | } | |
3498 | # 353 "include/linux/list.h" | |
3499 | static inline __attribute__((always_inline)) void list_splice_init(struct list_head *list, | |
3500 | struct list_head *head) | |
3501 | { | |
3502 | if (!list_empty(list)) { | |
3503 | __list_splice(list, head); | |
3504 | INIT_LIST_HEAD(list); | |
3505 | } | |
3506 | } | |
3507 | # 607 "include/linux/list.h" | |
3508 | struct hlist_head { | |
3509 | struct hlist_node *first; | |
3510 | }; | |
3511 | ||
3512 | struct hlist_node { | |
3513 | struct hlist_node *next, **pprev; | |
3514 | }; | |
3515 | ||
3516 | ||
3517 | ||
3518 | ||
3519 | static inline __attribute__((always_inline)) void INIT_HLIST_NODE(struct hlist_node *h) | |
3520 | { | |
3521 | h->next = ((void *)0); | |
3522 | h->pprev = ((void *)0); | |
3523 | } | |
3524 | ||
3525 | static inline __attribute__((always_inline)) int hlist_unhashed(const struct hlist_node *h) | |
3526 | { | |
3527 | return !h->pprev; | |
3528 | } | |
3529 | ||
3530 | static inline __attribute__((always_inline)) int hlist_empty(const struct hlist_head *h) | |
3531 | { | |
3532 | return !h->first; | |
3533 | } | |
3534 | ||
3535 | static inline __attribute__((always_inline)) void __hlist_del(struct hlist_node *n) | |
3536 | { | |
3537 | struct hlist_node *next = n->next; | |
3538 | struct hlist_node **pprev = n->pprev; | |
3539 | *pprev = next; | |
3540 | if (next) | |
3541 | next->pprev = pprev; | |
3542 | } | |
3543 | ||
3544 | static inline __attribute__((always_inline)) void hlist_del(struct hlist_node *n) | |
3545 | { | |
3546 | __hlist_del(n); | |
3547 | n->next = ((void *) 0x00100100); | |
3548 | n->pprev = ((void *) 0x00200200); | |
3549 | } | |
3550 | # 669 "include/linux/list.h" | |
3551 | static inline __attribute__((always_inline)) void hlist_del_rcu(struct hlist_node *n) | |
3552 | { | |
3553 | __hlist_del(n); | |
3554 | n->pprev = ((void *) 0x00200200); | |
3555 | } | |
3556 | ||
3557 | static inline __attribute__((always_inline)) void hlist_del_init(struct hlist_node *n) | |
3558 | { | |
3559 | if (!hlist_unhashed(n)) { | |
3560 | __hlist_del(n); | |
3561 | INIT_HLIST_NODE(n); | |
3562 | } | |
3563 | } | |
3564 | # 690 "include/linux/list.h" | |
3565 | static inline __attribute__((always_inline)) void hlist_replace_rcu(struct hlist_node *old, | |
3566 | struct hlist_node *new) | |
3567 | { | |
3568 | struct hlist_node *next = old->next; | |
3569 | ||
3570 | new->next = next; | |
3571 | new->pprev = old->pprev; | |
3572 | __asm__ __volatile__("": : :"memory"); | |
3573 | if (next) | |
3574 | new->next->pprev = &new->next; | |
3575 | *new->pprev = new; | |
3576 | old->pprev = ((void *) 0x00200200); | |
3577 | } | |
3578 | ||
3579 | static inline __attribute__((always_inline)) void hlist_add_head(struct hlist_node *n, struct hlist_head *h) | |
3580 | { | |
3581 | struct hlist_node *first = h->first; | |
3582 | n->next = first; | |
3583 | if (first) | |
3584 | first->pprev = &n->next; | |
3585 | h->first = n; | |
3586 | n->pprev = &h->first; | |
3587 | } | |
3588 | # 734 "include/linux/list.h" | |
3589 | static inline __attribute__((always_inline)) void hlist_add_head_rcu(struct hlist_node *n, | |
3590 | struct hlist_head *h) | |
3591 | { | |
3592 | struct hlist_node *first = h->first; | |
3593 | n->next = first; | |
3594 | n->pprev = &h->first; | |
3595 | __asm__ __volatile__("": : :"memory"); | |
3596 | if (first) | |
3597 | first->pprev = &n->next; | |
3598 | h->first = n; | |
3599 | } | |
3600 | ||
3601 | ||
3602 | static inline __attribute__((always_inline)) void hlist_add_before(struct hlist_node *n, | |
3603 | struct hlist_node *next) | |
3604 | { | |
3605 | n->pprev = next->pprev; | |
3606 | n->next = next; | |
3607 | next->pprev = &n->next; | |
3608 | *(n->pprev) = n; | |
3609 | } | |
3610 | ||
3611 | static inline __attribute__((always_inline)) void hlist_add_after(struct hlist_node *n, | |
3612 | struct hlist_node *next) | |
3613 | { | |
3614 | next->next = n->next; | |
3615 | n->next = next; | |
3616 | next->pprev = &n->next; | |
3617 | ||
3618 | if(next->next) | |
3619 | next->next->pprev = &next->next; | |
3620 | } | |
3621 | # 785 "include/linux/list.h" | |
3622 | static inline __attribute__((always_inline)) void hlist_add_before_rcu(struct hlist_node *n, | |
3623 | struct hlist_node *next) | |
3624 | { | |
3625 | n->pprev = next->pprev; | |
3626 | n->next = next; | |
3627 | __asm__ __volatile__("": : :"memory"); | |
3628 | next->pprev = &n->next; | |
3629 | *(n->pprev) = n; | |
3630 | } | |
3631 | # 813 "include/linux/list.h" | |
3632 | static inline __attribute__((always_inline)) void hlist_add_after_rcu(struct hlist_node *prev, | |
3633 | struct hlist_node *n) | |
3634 | { | |
3635 | n->next = prev->next; | |
3636 | n->pprev = &prev->next; | |
3637 | __asm__ __volatile__("": : :"memory"); | |
3638 | prev->next = n; | |
3639 | if (n->next) | |
3640 | n->next->pprev = &n->next; | |
3641 | } | |
3642 | # 23 "include/linux/wait.h" 2 | |
3643 | ||
3644 | ||
3645 | ||
3646 | ||
3647 | ||
3648 | typedef struct __wait_queue wait_queue_t; | |
3649 | typedef int (*wait_queue_func_t)(wait_queue_t *wait, unsigned mode, int sync, void *key); | |
3650 | int default_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *key); | |
3651 | ||
3652 | struct __wait_queue { | |
3653 | unsigned int flags; | |
3654 | ||
3655 | void *private; | |
3656 | wait_queue_func_t func; | |
3657 | struct list_head task_list; | |
3658 | }; | |
3659 | ||
3660 | struct wait_bit_key { | |
3661 | void *flags; | |
3662 | int bit_nr; | |
3663 | }; | |
3664 | ||
3665 | struct wait_bit_queue { | |
3666 | struct wait_bit_key key; | |
3667 | wait_queue_t wait; | |
3668 | }; | |
3669 | ||
3670 | struct __wait_queue_head { | |
3671 | spinlock_t lock; | |
3672 | struct list_head task_list; | |
3673 | }; | |
3674 | typedef struct __wait_queue_head wait_queue_head_t; | |
3675 | ||
3676 | struct task_struct; | |
3677 | # 80 "include/linux/wait.h" | |
3678 | extern void init_waitqueue_head(wait_queue_head_t *q); | |
3679 | # 91 "include/linux/wait.h" | |
3680 | static inline __attribute__((always_inline)) void init_waitqueue_entry(wait_queue_t *q, struct task_struct *p) | |
3681 | { | |
3682 | q->flags = 0; | |
3683 | q->private = p; | |
3684 | q->func = default_wake_function; | |
3685 | } | |
3686 | ||
3687 | static inline __attribute__((always_inline)) void init_waitqueue_func_entry(wait_queue_t *q, | |
3688 | wait_queue_func_t func) | |
3689 | { | |
3690 | q->flags = 0; | |
3691 | q->private = ((void *)0); | |
3692 | q->func = func; | |
3693 | } | |
3694 | ||
3695 | static inline __attribute__((always_inline)) int waitqueue_active(wait_queue_head_t *q) | |
3696 | { | |
3697 | return !list_empty(&q->task_list); | |
3698 | } | |
3699 | # 120 "include/linux/wait.h" | |
3700 | extern void add_wait_queue(wait_queue_head_t *q, wait_queue_t * wait); | |
3701 | extern void add_wait_queue_exclusive(wait_queue_head_t *q, wait_queue_t * wait); | |
3702 | extern void remove_wait_queue(wait_queue_head_t *q, wait_queue_t * wait); | |
3703 | ||
3704 | static inline __attribute__((always_inline)) void __add_wait_queue(wait_queue_head_t *head, wait_queue_t *new) | |
3705 | { | |
3706 | list_add(&new->task_list, &head->task_list); | |
3707 | } | |
3708 | ||
3709 | ||
3710 | ||
3711 | ||
3712 | static inline __attribute__((always_inline)) void __add_wait_queue_tail(wait_queue_head_t *head, | |
3713 | wait_queue_t *new) | |
3714 | { | |
3715 | list_add_tail(&new->task_list, &head->task_list); | |
3716 | } | |
3717 | ||
3718 | static inline __attribute__((always_inline)) void __remove_wait_queue(wait_queue_head_t *head, | |
3719 | wait_queue_t *old) | |
3720 | { | |
3721 | list_del(&old->task_list); | |
3722 | } | |
3723 | ||
3724 | void __wake_up(wait_queue_head_t *q, unsigned int mode, int nr, void *key); | |
3725 | extern void __wake_up_locked(wait_queue_head_t *q, unsigned int mode); | |
3726 | extern void __wake_up_sync(wait_queue_head_t *q, unsigned int mode, int nr); | |
3727 | void __wake_up_bit(wait_queue_head_t *, void *, int); | |
3728 | int __wait_on_bit(wait_queue_head_t *, struct wait_bit_queue *, int (*)(void *), unsigned); | |
3729 | int __wait_on_bit_lock(wait_queue_head_t *, struct wait_bit_queue *, int (*)(void *), unsigned); | |
3730 | void wake_up_bit(void *, int); | |
3731 | int out_of_line_wait_on_bit(void *, int, int (*)(void *), unsigned); | |
3732 | int out_of_line_wait_on_bit_lock(void *, int, int (*)(void *), unsigned); | |
3733 | wait_queue_head_t *bit_waitqueue(void *, int); | |
3734 | # 351 "include/linux/wait.h" | |
3735 | static inline __attribute__((always_inline)) void add_wait_queue_exclusive_locked(wait_queue_head_t *q, | |
3736 | wait_queue_t * wait) | |
3737 | { | |
3738 | wait->flags |= 0x01; | |
3739 | __add_wait_queue_tail(q, wait); | |
3740 | } | |
3741 | ||
3742 | ||
3743 | ||
3744 | ||
3745 | static inline __attribute__((always_inline)) void remove_wait_queue_locked(wait_queue_head_t *q, | |
3746 | wait_queue_t * wait) | |
3747 | { | |
3748 | __remove_wait_queue(q, wait); | |
3749 | } | |
3750 | ||
3751 | ||
3752 | ||
3753 | ||
3754 | ||
3755 | ||
3756 | extern void sleep_on(wait_queue_head_t *q); | |
3757 | extern long sleep_on_timeout(wait_queue_head_t *q, signed long timeout); | |
3758 | ||
3759 | extern void interruptible_sleep_on(wait_queue_head_t *q); | |
3760 | extern long interruptible_sleep_on_timeout(wait_queue_head_t *q, signed long timeout); | |
3761 | ||
3762 | ||
3763 | ||
3764 | ||
3765 | ||
3766 | void prepare_to_wait(wait_queue_head_t *q, wait_queue_t *wait, int state); | |
3767 | ||
3768 | void prepare_to_wait_exclusive(wait_queue_head_t *q, wait_queue_t *wait, int state); | |
3769 | ||
3770 | void finish_wait(wait_queue_head_t *q, wait_queue_t *wait); | |
3771 | int autoremove_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *key); | |
3772 | int wake_bit_function(wait_queue_t *wait, unsigned mode, int sync, void *key); | |
3773 | # 429 "include/linux/wait.h" | |
3774 | static inline __attribute__((always_inline)) int wait_on_bit(void *word, int bit, | |
3775 | int (*action)(void *), unsigned mode) | |
3776 | { | |
3777 | if (!(__builtin_constant_p(bit) ? __constant_test_bit((bit),(word)) : __test_bit((bit),(word)))) | |
3778 | return 0; | |
3779 | return out_of_line_wait_on_bit(word, bit, action, mode); | |
3780 | } | |
3781 | # 453 "include/linux/wait.h" | |
3782 | static inline __attribute__((always_inline)) int wait_on_bit_lock(void *word, int bit, | |
3783 | int (*action)(void *), unsigned mode) | |
3784 | { | |
3785 | if (!test_and_set_bit(bit, word)) | |
3786 | return 0; | |
3787 | return out_of_line_wait_on_bit_lock(word, bit, action, mode); | |
3788 | } | |
3789 | # 8 "include/asm/semaphore.h" 2 | |
3790 | ||
3791 | # 1 "include/linux/rwsem.h" 1 | |
3792 | # 19 "include/linux/rwsem.h" | |
3793 | struct rw_semaphore; | |
3794 | ||
3795 | ||
3796 | # 1 "include/linux/rwsem-spinlock.h" 1 | |
3797 | # 22 "include/linux/rwsem-spinlock.h" | |
3798 | struct rwsem_waiter; | |
3799 | # 31 "include/linux/rwsem-spinlock.h" | |
3800 | struct rw_semaphore { | |
3801 | __s32 activity; | |
3802 | spinlock_t wait_lock; | |
3803 | struct list_head wait_list; | |
3804 | ||
3805 | ||
3806 | ||
3807 | }; | |
3808 | # 52 "include/linux/rwsem-spinlock.h" | |
3809 | extern void __init_rwsem(struct rw_semaphore *sem, const char *name, | |
3810 | struct lock_class_key *key); | |
3811 | # 62 "include/linux/rwsem-spinlock.h" | |
3812 | extern void __down_read(struct rw_semaphore *sem); | |
3813 | extern int __down_read_trylock(struct rw_semaphore *sem); | |
3814 | extern void __down_write(struct rw_semaphore *sem); | |
3815 | extern void __down_write_nested(struct rw_semaphore *sem, int subclass); | |
3816 | extern int __down_write_trylock(struct rw_semaphore *sem); | |
3817 | extern void __up_read(struct rw_semaphore *sem); | |
3818 | extern void __up_write(struct rw_semaphore *sem); | |
3819 | extern void __downgrade_write(struct rw_semaphore *sem); | |
3820 | ||
3821 | static inline __attribute__((always_inline)) int rwsem_is_locked(struct rw_semaphore *sem) | |
3822 | { | |
3823 | return (sem->activity != 0); | |
3824 | } | |
3825 | # 23 "include/linux/rwsem.h" 2 | |
3826 | ||
3827 | ||
3828 | ||
3829 | ||
3830 | ||
3831 | ||
3832 | ||
3833 | extern void down_read(struct rw_semaphore *sem); | |
3834 | ||
3835 | ||
3836 | ||
3837 | ||
3838 | extern int down_read_trylock(struct rw_semaphore *sem); | |
3839 | ||
3840 | ||
3841 | ||
3842 | ||
3843 | extern void down_write(struct rw_semaphore *sem); | |
3844 | ||
3845 | ||
3846 | ||
3847 | ||
3848 | extern int down_write_trylock(struct rw_semaphore *sem); | |
3849 | ||
3850 | ||
3851 | ||
3852 | ||
3853 | extern void up_read(struct rw_semaphore *sem); | |
3854 | ||
3855 | ||
3856 | ||
3857 | ||
3858 | extern void up_write(struct rw_semaphore *sem); | |
3859 | ||
3860 | ||
3861 | ||
3862 | ||
3863 | extern void downgrade_write(struct rw_semaphore *sem); | |
3864 | # 10 "include/asm/semaphore.h" 2 | |
3865 | # 21 "include/asm/semaphore.h" | |
3866 | struct semaphore { | |
3867 | atomic_t count; | |
3868 | int sleepers; | |
3869 | wait_queue_head_t wait; | |
3870 | }; | |
3871 | # 40 "include/asm/semaphore.h" | |
3872 | static inline __attribute__((always_inline)) void sema_init(struct semaphore *sem, int val) | |
3873 | { | |
3874 | *sem = (struct semaphore){ .count = { (val) }, .sleepers = 0, .wait = { .lock = (spinlock_t) { .raw_lock = { }, }, .task_list = { &((*sem).wait).task_list, &((*sem).wait).task_list } } }; | |
3875 | } | |
3876 | ||
3877 | static inline __attribute__((always_inline)) void init_MUTEX(struct semaphore *sem) | |
3878 | { | |
3879 | sema_init(sem, 1); | |
3880 | } | |
3881 | ||
3882 | static inline __attribute__((always_inline)) void init_MUTEX_LOCKED(struct semaphore *sem) | |
3883 | { | |
3884 | sema_init(sem, 0); | |
3885 | } | |
3886 | ||
3887 | void __down(struct semaphore *sem); | |
3888 | int __down_interruptible(struct semaphore *sem); | |
3889 | int __down_trylock(struct semaphore *sem); | |
3890 | void __up(struct semaphore *sem); | |
3891 | ||
3892 | extern spinlock_t semaphore_wake_lock; | |
3893 | ||
3894 | ||
3895 | ||
3896 | ||
3897 | ||
3898 | ||
3899 | static inline __attribute__((always_inline)) void down(struct semaphore *sem) | |
3900 | { | |
3901 | do { do { } while (0); } while (0); | |
3902 | if (atomic_sub_return(1,(&sem->count)) < 0) | |
3903 | __down(sem); | |
3904 | } | |
3905 | ||
3906 | static inline __attribute__((always_inline)) int down_interruptible(struct semaphore *sem) | |
3907 | { | |
3908 | int ret = 0; | |
3909 | ||
3910 | do { do { } while (0); } while (0); | |
3911 | if (atomic_sub_return(1,(&sem->count)) < 0) | |
3912 | ret = __down_interruptible(sem); | |
3913 | return (ret); | |
3914 | } | |
3915 | ||
3916 | static inline __attribute__((always_inline)) int down_trylock(struct semaphore *sem) | |
3917 | { | |
3918 | int ret = 0; | |
3919 | ||
3920 | if (atomic_sub_return(1,(&sem->count)) < 0) | |
3921 | ret = __down_trylock(sem); | |
3922 | return ret; | |
3923 | } | |
3924 | ||
3925 | ||
3926 | ||
3927 | ||
3928 | ||
3929 | ||
3930 | ||
3931 | static inline __attribute__((always_inline)) void up(struct semaphore *sem) | |
3932 | { | |
3933 | if (atomic_add_return(1,(&sem->count)) <= 0) | |
3934 | __up(sem); | |
3935 | } | |
3936 | # 60 "include/linux/sched.h" 2 | |
3937 | ||
3938 | ||
3939 | # 1 "include/asm/mmu.h" 1 | |
3940 | ||
3941 | ||
3942 | ||
3943 | ||
3944 | ||
3945 | struct sram_list_struct { | |
3946 | struct sram_list_struct *next; | |
3947 | void *addr; | |
3948 | size_t length; | |
3949 | }; | |
3950 | ||
3951 | typedef struct { | |
3952 | struct vm_list_struct *vmlist; | |
3953 | unsigned long end_brk; | |
3954 | unsigned long stack_start; | |
3955 | ||
3956 | ||
3957 | ||
3958 | void *l1_stack_save; | |
3959 | ||
3960 | struct sram_list_struct *sram_list; | |
3961 | ||
3962 | ||
3963 | unsigned long exec_fdpic_loadmap; | |
3964 | unsigned long interp_fdpic_loadmap; | |
3965 | ||
3966 | ||
3967 | } mm_context_t; | |
3968 | # 63 "include/linux/sched.h" 2 | |
3969 | # 1 "include/asm/cputime.h" 1 | |
3970 | ||
3971 | ||
3972 | ||
3973 | # 1 "include/asm-generic/cputime.h" 1 | |
3974 | ||
3975 | ||
3976 | ||
3977 | ||
3978 | ||
3979 | ||
3980 | typedef unsigned long cputime_t; | |
3981 | # 23 "include/asm-generic/cputime.h" | |
3982 | typedef u64 cputime64_t; | |
3983 | # 5 "include/asm/cputime.h" 2 | |
3984 | # 64 "include/linux/sched.h" 2 | |
3985 | ||
3986 | # 1 "include/linux/smp.h" 1 | |
3987 | # 10 "include/linux/smp.h" | |
3988 | extern void cpu_idle(void); | |
3989 | # 87 "include/linux/smp.h" | |
3990 | static inline __attribute__((always_inline)) int up_smp_call_function(void) | |
3991 | { | |
3992 | return 0; | |
3993 | } | |
3994 | # 99 "include/linux/smp.h" | |
3995 | static inline __attribute__((always_inline)) void smp_send_reschedule(int cpu) { } | |
3996 | # 131 "include/linux/smp.h" | |
3997 | void smp_setup_processor_id(void); | |
3998 | # 66 "include/linux/sched.h" 2 | |
3999 | # 1 "include/linux/sem.h" 1 | |
4000 | ||
4001 | ||
4002 | ||
4003 | # 1 "include/linux/ipc.h" 1 | |
4004 | # 9 "include/linux/ipc.h" | |
4005 | struct ipc_perm | |
4006 | { | |
4007 | __kernel_key_t key; | |
4008 | __kernel_uid_t uid; | |
4009 | __kernel_gid_t gid; | |
4010 | __kernel_uid_t cuid; | |
4011 | __kernel_gid_t cgid; | |
4012 | __kernel_mode_t mode; | |
4013 | unsigned short seq; | |
4014 | }; | |
4015 | ||
4016 | ||
4017 | # 1 "include/asm/ipcbuf.h" 1 | |
4018 | # 16 "include/asm/ipcbuf.h" | |
4019 | struct ipc64_perm { | |
4020 | __kernel_key_t key; | |
4021 | __kernel_uid32_t uid; | |
4022 | __kernel_gid32_t gid; | |
4023 | __kernel_uid32_t cuid; | |
4024 | __kernel_gid32_t cgid; | |
4025 | __kernel_mode_t mode; | |
4026 | unsigned short __pad1; | |
4027 | unsigned short seq; | |
4028 | unsigned short __pad2; | |
4029 | unsigned long __unused1; | |
4030 | unsigned long __unused2; | |
4031 | }; | |
4032 | # 22 "include/linux/ipc.h" 2 | |
4033 | # 54 "include/linux/ipc.h" | |
4034 | # 1 "include/linux/kref.h" 1 | |
4035 | # 23 "include/linux/kref.h" | |
4036 | struct kref { | |
4037 | atomic_t refcount; | |
4038 | }; | |
4039 | ||
4040 | void kref_init(struct kref *kref); | |
4041 | void kref_get(struct kref *kref); | |
4042 | int kref_put(struct kref *kref, void (*release) (struct kref *kref)); | |
4043 | # 55 "include/linux/ipc.h" 2 | |
4044 | ||
4045 | ||
4046 | ||
4047 | ||
4048 | struct kern_ipc_perm | |
4049 | { | |
4050 | spinlock_t lock; | |
4051 | int deleted; | |
4052 | key_t key; | |
4053 | uid_t uid; | |
4054 | gid_t gid; | |
4055 | uid_t cuid; | |
4056 | gid_t cgid; | |
4057 | mode_t mode; | |
4058 | unsigned long seq; | |
4059 | void *security; | |
4060 | }; | |
4061 | ||
4062 | struct ipc_ids; | |
4063 | struct ipc_namespace { | |
4064 | struct kref kref; | |
4065 | struct ipc_ids *ids[3]; | |
4066 | ||
4067 | int sem_ctls[4]; | |
4068 | int used_sems; | |
4069 | ||
4070 | int msg_ctlmax; | |
4071 | int msg_ctlmnb; | |
4072 | int msg_ctlmni; | |
4073 | ||
4074 | size_t shm_ctlmax; | |
4075 | size_t shm_ctlall; | |
4076 | int shm_ctlmni; | |
4077 | int shm_tot; | |
4078 | }; | |
4079 | ||
4080 | extern struct ipc_namespace init_ipc_ns; | |
4081 | # 104 "include/linux/ipc.h" | |
4082 | static inline __attribute__((always_inline)) int copy_ipcs(unsigned long flags, struct task_struct *tsk) | |
4083 | { | |
4084 | return 0; | |
4085 | } | |
4086 | ||
4087 | ||
4088 | static inline __attribute__((always_inline)) struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns) | |
4089 | { | |
4090 | ||
4091 | ||
4092 | ||
4093 | ||
4094 | return ns; | |
4095 | } | |
4096 | ||
4097 | static inline __attribute__((always_inline)) void put_ipc_ns(struct ipc_namespace *ns) | |
4098 | { | |
4099 | ||
4100 | ||
4101 | ||
4102 | } | |
4103 | # 5 "include/linux/sem.h" 2 | |
4104 | # 23 "include/linux/sem.h" | |
4105 | struct semid_ds { | |
4106 | struct ipc_perm sem_perm; | |
4107 | __kernel_time_t sem_otime; | |
4108 | __kernel_time_t sem_ctime; | |
4109 | struct sem *sem_base; | |
4110 | struct sem_queue *sem_pending; | |
4111 | struct sem_queue **sem_pending_last; | |
4112 | struct sem_undo *undo; | |
4113 | unsigned short sem_nsems; | |
4114 | }; | |
4115 | ||
4116 | ||
4117 | # 1 "include/asm/sembuf.h" 1 | |
4118 | # 14 "include/asm/sembuf.h" | |
4119 | struct semid64_ds { | |
4120 | struct ipc64_perm sem_perm; | |
4121 | __kernel_time_t sem_otime; | |
4122 | unsigned long __unused1; | |
4123 | __kernel_time_t sem_ctime; | |
4124 | unsigned long __unused2; | |
4125 | unsigned long sem_nsems; | |
4126 | unsigned long __unused3; | |
4127 | unsigned long __unused4; | |
4128 | }; | |
4129 | # 36 "include/linux/sem.h" 2 | |
4130 | ||
4131 | ||
4132 | struct sembuf { | |
4133 | unsigned short sem_num; | |
4134 | short sem_op; | |
4135 | short sem_flg; | |
4136 | }; | |
4137 | ||
4138 | ||
4139 | union semun { | |
4140 | int val; | |
4141 | struct semid_ds *buf; | |
4142 | unsigned short *array; | |
4143 | struct seminfo *__buf; | |
4144 | void *__pad; | |
4145 | }; | |
4146 | ||
4147 | struct seminfo { | |
4148 | int semmap; | |
4149 | int semmni; | |
4150 | int semmns; | |
4151 | int semmnu; | |
4152 | int semmsl; | |
4153 | int semopm; | |
4154 | int semume; | |
4155 | int semusz; | |
4156 | int semvmx; | |
4157 | int semaem; | |
4158 | }; | |
4159 | # 82 "include/linux/sem.h" | |
4160 | struct task_struct; | |
4161 | ||
4162 | ||
4163 | struct sem { | |
4164 | int semval; | |
4165 | int sempid; | |
4166 | }; | |
4167 | ||
4168 | ||
4169 | struct sem_array { | |
4170 | struct kern_ipc_perm sem_perm; | |
4171 | int sem_id; | |
4172 | time_t sem_otime; | |
4173 | time_t sem_ctime; | |
4174 | struct sem *sem_base; | |
4175 | struct sem_queue *sem_pending; | |
4176 | struct sem_queue **sem_pending_last; | |
4177 | struct sem_undo *undo; | |
4178 | unsigned long sem_nsems; | |
4179 | }; | |
4180 | ||
4181 | ||
4182 | struct sem_queue { | |
4183 | struct sem_queue * next; | |
4184 | struct sem_queue ** prev; | |
4185 | struct task_struct* sleeper; | |
4186 | struct sem_undo * undo; | |
4187 | int pid; | |
4188 | int status; | |
4189 | struct sem_array * sma; | |
4190 | int id; | |
4191 | struct sembuf * sops; | |
4192 | int nsops; | |
4193 | int alter; | |
4194 | }; | |
4195 | ||
4196 | ||
4197 | ||
4198 | ||
4199 | struct sem_undo { | |
4200 | struct sem_undo * proc_next; | |
4201 | struct sem_undo * id_next; | |
4202 | int semid; | |
4203 | short * semadj; | |
4204 | }; | |
4205 | ||
4206 | ||
4207 | ||
4208 | ||
4209 | struct sem_undo_list { | |
4210 | atomic_t refcnt; | |
4211 | spinlock_t lock; | |
4212 | struct sem_undo *proc_list; | |
4213 | }; | |
4214 | ||
4215 | struct sysv_sem { | |
4216 | struct sem_undo_list *undo_list; | |
4217 | }; | |
4218 | ||
4219 | ||
4220 | ||
4221 | ||
4222 | ||
4223 | ||
4224 | ||
4225 | static inline __attribute__((always_inline)) int copy_semundo(unsigned long clone_flags, struct task_struct *tsk) | |
4226 | { | |
4227 | return 0; | |
4228 | } | |
4229 | ||
4230 | static inline __attribute__((always_inline)) void exit_sem(struct task_struct *tsk) | |
4231 | { | |
4232 | return; | |
4233 | } | |
4234 | # 67 "include/linux/sched.h" 2 | |
4235 | # 1 "include/linux/signal.h" 1 | |
4236 | ||
4237 | ||
4238 | ||
4239 | # 1 "include/asm/signal.h" 1 | |
4240 | ||
4241 | ||
4242 | ||
4243 | ||
4244 | ||
4245 | ||
4246 | struct siginfo; | |
4247 | # 17 "include/asm/signal.h" | |
4248 | typedef unsigned long old_sigset_t; | |
4249 | ||
4250 | typedef struct { | |
4251 | unsigned long sig[(64 / 32)]; | |
4252 | } sigset_t; | |
4253 | # 107 "include/asm/signal.h" | |
4254 | # 1 "include/asm-generic/signal.h" 1 | |
4255 | # 17 "include/asm-generic/signal.h" | |
4256 | typedef void __signalfn_t(int); | |
4257 | typedef __signalfn_t *__sighandler_t; | |
4258 | ||
4259 | typedef void __restorefn_t(void); | |
4260 | typedef __restorefn_t *__sigrestore_t; | |
4261 | # 108 "include/asm/signal.h" 2 | |
4262 | ||
4263 | ||
4264 | struct old_sigaction { | |
4265 | __sighandler_t sa_handler; | |
4266 | old_sigset_t sa_mask; | |
4267 | unsigned long sa_flags; | |
4268 | void (*sa_restorer) (void); | |
4269 | }; | |
4270 | ||
4271 | struct sigaction { | |
4272 | __sighandler_t sa_handler; | |
4273 | unsigned long sa_flags; | |
4274 | void (*sa_restorer) (void); | |
4275 | sigset_t sa_mask; | |
4276 | }; | |
4277 | ||
4278 | struct k_sigaction { | |
4279 | struct sigaction sa; | |
4280 | }; | |
4281 | # 145 "include/asm/signal.h" | |
4282 | typedef struct sigaltstack { | |
4283 | void *ss_sp; | |
4284 | int ss_flags; | |
4285 | size_t ss_size; | |
4286 | } stack_t; | |
4287 | ||
4288 | ||
4289 | ||
4290 | # 1 "include/asm/sigcontext.h" 1 | |
4291 | ||
4292 | ||
4293 | ||
4294 | ||
4295 | struct sigcontext { | |
4296 | unsigned long sc_mask; | |
4297 | unsigned long sc_usp; | |
4298 | unsigned long sc_r0; | |
4299 | unsigned long sc_r1; | |
4300 | unsigned long sc_r2; | |
4301 | unsigned long sc_r3; | |
4302 | unsigned long sc_r4; | |
4303 | unsigned long sc_p0; | |
4304 | unsigned long sc_p1; | |
4305 | unsigned long sc_p2; | |
4306 | unsigned long sc_p3; | |
4307 | unsigned long sc_i0; | |
4308 | unsigned long sc_i1; | |
4309 | unsigned long sc_i2; | |
4310 | unsigned long sc_i3; | |
4311 | unsigned long sc_m0; | |
4312 | unsigned long sc_m1; | |
4313 | unsigned long sc_m2; | |
4314 | unsigned long sc_m3; | |
4315 | unsigned long sc_l0; | |
4316 | unsigned long sc_l1; | |
4317 | unsigned long sc_l2; | |
4318 | unsigned long sc_l3; | |
4319 | unsigned long sc_b0; | |
4320 | unsigned long sc_b1; | |
4321 | unsigned long sc_b2; | |
4322 | unsigned long sc_b3; | |
4323 | unsigned long sc_a0x; | |
4324 | unsigned long sc_a0w; | |
4325 | unsigned long sc_a1x; | |
4326 | unsigned long sc_a1w; | |
4327 | unsigned long sc_astat; | |
4328 | unsigned long sc_rets; | |
4329 | unsigned long sc_lc0; | |
4330 | unsigned long sc_lc1; | |
4331 | unsigned long sc_lt0; | |
4332 | unsigned long sc_lt1; | |
4333 | unsigned long sc_lb0; | |
4334 | unsigned long sc_lb1; | |
4335 | unsigned long sc_seqstat; | |
4336 | unsigned long sc_pc; | |
4337 | unsigned long sc_retx; | |
4338 | }; | |
4339 | # 154 "include/asm/signal.h" 2 | |
4340 | # 5 "include/linux/signal.h" 2 | |
4341 | # 1 "include/asm/siginfo.h" 1 | |
4342 | ||
4343 | ||
4344 | ||
4345 | ||
4346 | # 1 "include/asm-generic/siginfo.h" 1 | |
4347 | ||
4348 | ||
4349 | ||
4350 | ||
4351 | ||
4352 | ||
4353 | typedef union sigval { | |
4354 | int sival_int; | |
4355 | void *sival_ptr; | |
4356 | } sigval_t; | |
4357 | # 40 "include/asm-generic/siginfo.h" | |
4358 | typedef struct siginfo { | |
4359 | int si_signo; | |
4360 | int si_errno; | |
4361 | int si_code; | |
4362 | ||
4363 | union { | |
4364 | int _pad[((128 - (3 * sizeof(int))) / sizeof(int))]; | |
4365 | ||
4366 | ||
4367 | struct { | |
4368 | pid_t _pid; | |
4369 | uid_t _uid; | |
4370 | } _kill; | |
4371 | ||
4372 | ||
4373 | struct { | |
4374 | timer_t _tid; | |
4375 | int _overrun; | |
4376 | char _pad[sizeof( uid_t) - sizeof(int)]; | |
4377 | sigval_t _sigval; | |
4378 | int _sys_private; | |
4379 | } _timer; | |
4380 | ||
4381 | ||
4382 | struct { | |
4383 | pid_t _pid; | |
4384 | uid_t _uid; | |
4385 | sigval_t _sigval; | |
4386 | } _rt; | |
4387 | ||
4388 | ||
4389 | struct { | |
4390 | pid_t _pid; | |
4391 | uid_t _uid; | |
4392 | int _status; | |
4393 | clock_t _utime; | |
4394 | clock_t _stime; | |
4395 | } _sigchld; | |
4396 | ||
4397 | ||
4398 | struct { | |
4399 | void *_addr; | |
4400 | ||
4401 | ||
4402 | ||
4403 | } _sigfault; | |
4404 | ||
4405 | ||
4406 | struct { | |
4407 | long _band; | |
4408 | int _fd; | |
4409 | } _sigpoll; | |
4410 | } _sifields; | |
4411 | } siginfo_t; | |
4412 | # 251 "include/asm-generic/siginfo.h" | |
4413 | typedef struct sigevent { | |
4414 | sigval_t sigev_value; | |
4415 | int sigev_signo; | |
4416 | int sigev_notify; | |
4417 | union { | |
4418 | int _pad[((64 - (sizeof(int) * 2 + sizeof(sigval_t))) / sizeof(int))]; | |
4419 | int _tid; | |
4420 | ||
4421 | struct { | |
4422 | void (*_function)(sigval_t); | |
4423 | void *_attribute; | |
4424 | } _sigev_thread; | |
4425 | } _sigev_un; | |
4426 | } sigevent_t; | |
4427 | ||
4428 | ||
4429 | ||
4430 | ||
4431 | ||
4432 | ||
4433 | ||
4434 | struct siginfo; | |
4435 | void do_schedule_next_timer(struct siginfo *info); | |
4436 | ||
4437 | ||
4438 | ||
4439 | ||
4440 | ||
4441 | static inline __attribute__((always_inline)) void copy_siginfo(struct siginfo *to, struct siginfo *from) | |
4442 | { | |
4443 | if (from->si_code < 0) | |
4444 | memcpy(to, from, sizeof(*to)); | |
4445 | else | |
4446 | ||
4447 | memcpy(to, from, (3 * sizeof(int)) + sizeof(from->_sifields._sigchld)); | |
4448 | } | |
4449 | ||
4450 | ||
4451 | ||
4452 | extern int copy_siginfo_to_user(struct siginfo *to, struct siginfo *from); | |
4453 | # 6 "include/asm/siginfo.h" 2 | |
4454 | # 6 "include/linux/signal.h" 2 | |
4455 | # 15 "include/linux/signal.h" | |
4456 | struct sigqueue { | |
4457 | struct list_head list; | |
4458 | int flags; | |
4459 | siginfo_t info; | |
4460 | struct user_struct *user; | |
4461 | }; | |
4462 | ||
4463 | ||
4464 | ||
4465 | ||
4466 | struct sigpending { | |
4467 | struct list_head list; | |
4468 | sigset_t signal; | |
4469 | }; | |
4470 | # 39 "include/linux/signal.h" | |
4471 | static inline __attribute__((always_inline)) void sigaddset(sigset_t *set, int _sig) | |
4472 | { | |
4473 | unsigned long sig = _sig - 1; | |
4474 | if ((64 / 32) == 1) | |
4475 | set->sig[0] |= 1UL << sig; | |
4476 | else | |
4477 | set->sig[sig / 32] |= 1UL << (sig % 32); | |
4478 | } | |
4479 | ||
4480 | static inline __attribute__((always_inline)) void sigdelset(sigset_t *set, int _sig) | |
4481 | { | |
4482 | unsigned long sig = _sig - 1; | |
4483 | if ((64 / 32) == 1) | |
4484 | set->sig[0] &= ~(1UL << sig); | |
4485 | else | |
4486 | set->sig[sig / 32] &= ~(1UL << (sig % 32)); | |
4487 | } | |
4488 | ||
4489 | static inline __attribute__((always_inline)) int sigismember(sigset_t *set, int _sig) | |
4490 | { | |
4491 | unsigned long sig = _sig - 1; | |
4492 | if ((64 / 32) == 1) | |
4493 | return 1 & (set->sig[0] >> sig); | |
4494 | else | |
4495 | return 1 & (set->sig[sig / 32] >> (sig % 32)); | |
4496 | } | |
4497 | ||
4498 | static inline __attribute__((always_inline)) int sigfindinword(unsigned long word) | |
4499 | { | |
4500 | return __ffs(~(~word)); | |
4501 | } | |
4502 | ||
4503 | ||
4504 | ||
4505 | static inline __attribute__((always_inline)) int sigisemptyset(sigset_t *set) | |
4506 | { | |
4507 | extern void _NSIG_WORDS_is_unsupported_size(void); | |
4508 | switch ((64 / 32)) { | |
4509 | case 4: | |
4510 | return (set->sig[3] | set->sig[2] | | |
4511 | set->sig[1] | set->sig[0]) == 0; | |
4512 | case 2: | |
4513 | return (set->sig[1] | set->sig[0]) == 0; | |
4514 | case 1: | |
4515 | return set->sig[0] == 0; | |
4516 | default: | |
4517 | _NSIG_WORDS_is_unsupported_size(); | |
4518 | return 0; | |
4519 | } | |
4520 | } | |
4521 | # 120 "include/linux/signal.h" | |
4522 | static inline __attribute__((always_inline)) void sigorsets(sigset_t *r, const sigset_t *a, const sigset_t *b) { extern void _NSIG_WORDS_is_unsupported_size(void); unsigned long a0, a1, a2, a3, b0, b1, b2, b3; switch ((64 / 32)) { case 4: a3 = a->sig[3]; a2 = a->sig[2]; b3 = b->sig[3]; b2 = b->sig[2]; r->sig[3] = ((a3) | (b3)); r->sig[2] = ((a2) | (b2)); case 2: a1 = a->sig[1]; b1 = b->sig[1]; r->sig[1] = ((a1) | (b1)); case 1: a0 = a->sig[0]; b0 = b->sig[0]; r->sig[0] = ((a0) | (b0)); break; default: _NSIG_WORDS_is_unsupported_size(); } } | |
4523 | ||
4524 | ||
4525 | static inline __attribute__((always_inline)) void sigandsets(sigset_t *r, const sigset_t *a, const sigset_t *b) { extern void _NSIG_WORDS_is_unsupported_size(void); unsigned long a0, a1, a2, a3, b0, b1, b2, b3; switch ((64 / 32)) { case 4: a3 = a->sig[3]; a2 = a->sig[2]; b3 = b->sig[3]; b2 = b->sig[2]; r->sig[3] = ((a3) & (b3)); r->sig[2] = ((a2) & (b2)); case 2: a1 = a->sig[1]; b1 = b->sig[1]; r->sig[1] = ((a1) & (b1)); case 1: a0 = a->sig[0]; b0 = b->sig[0]; r->sig[0] = ((a0) & (b0)); break; default: _NSIG_WORDS_is_unsupported_size(); } } | |
4526 | ||
4527 | ||
4528 | static inline __attribute__((always_inline)) void signandsets(sigset_t *r, const sigset_t *a, const sigset_t *b) { extern void _NSIG_WORDS_is_unsupported_size(void); unsigned long a0, a1, a2, a3, b0, b1, b2, b3; switch ((64 / 32)) { case 4: a3 = a->sig[3]; a2 = a->sig[2]; b3 = b->sig[3]; b2 = b->sig[2]; r->sig[3] = ((a3) & ~(b3)); r->sig[2] = ((a2) & ~(b2)); case 2: a1 = a->sig[1]; b1 = b->sig[1]; r->sig[1] = ((a1) & ~(b1)); case 1: a0 = a->sig[0]; b0 = b->sig[0]; r->sig[0] = ((a0) & ~(b0)); break; default: _NSIG_WORDS_is_unsupported_size(); } } | |
4529 | # 150 "include/linux/signal.h" | |
4530 | static inline __attribute__((always_inline)) void signotset(sigset_t *set) { extern void _NSIG_WORDS_is_unsupported_size(void); switch ((64 / 32)) { case 4: set->sig[3] = (~(set->sig[3])); set->sig[2] = (~(set->sig[2])); case 2: set->sig[1] = (~(set->sig[1])); case 1: set->sig[0] = (~(set->sig[0])); break; default: _NSIG_WORDS_is_unsupported_size(); } } | |
4531 | ||
4532 | ||
4533 | ||
4534 | ||
4535 | static inline __attribute__((always_inline)) void sigemptyset(sigset_t *set) | |
4536 | { | |
4537 | switch ((64 / 32)) { | |
4538 | default: | |
4539 | memset(set, 0, sizeof(sigset_t)); | |
4540 | break; | |
4541 | case 2: set->sig[1] = 0; | |
4542 | case 1: set->sig[0] = 0; | |
4543 | break; | |
4544 | } | |
4545 | } | |
4546 | ||
4547 | static inline __attribute__((always_inline)) void sigfillset(sigset_t *set) | |
4548 | { | |
4549 | switch ((64 / 32)) { | |
4550 | default: | |
4551 | memset(set, -1, sizeof(sigset_t)); | |
4552 | break; | |
4553 | case 2: set->sig[1] = -1; | |
4554 | case 1: set->sig[0] = -1; | |
4555 | break; | |
4556 | } | |
4557 | } | |
4558 | ||
4559 | ||
4560 | ||
4561 | static inline __attribute__((always_inline)) void sigaddsetmask(sigset_t *set, unsigned long mask) | |
4562 | { | |
4563 | set->sig[0] |= mask; | |
4564 | } | |
4565 | ||
4566 | static inline __attribute__((always_inline)) void sigdelsetmask(sigset_t *set, unsigned long mask) | |
4567 | { | |
4568 | set->sig[0] &= ~mask; | |
4569 | } | |
4570 | ||
4571 | static inline __attribute__((always_inline)) int sigtestsetmask(sigset_t *set, unsigned long mask) | |
4572 | { | |
4573 | return (set->sig[0] & mask) != 0; | |
4574 | } | |
4575 | ||
4576 | static inline __attribute__((always_inline)) void siginitset(sigset_t *set, unsigned long mask) | |
4577 | { | |
4578 | set->sig[0] = mask; | |
4579 | switch ((64 / 32)) { | |
4580 | default: | |
4581 | memset(&set->sig[1], 0, sizeof(long)*((64 / 32)-1)); | |
4582 | break; | |
4583 | case 2: set->sig[1] = 0; | |
4584 | case 1: ; | |
4585 | } | |
4586 | } | |
4587 | ||
4588 | static inline __attribute__((always_inline)) void siginitsetinv(sigset_t *set, unsigned long mask) | |
4589 | { | |
4590 | set->sig[0] = ~mask; | |
4591 | switch ((64 / 32)) { | |
4592 | default: | |
4593 | memset(&set->sig[1], -1, sizeof(long)*((64 / 32)-1)); | |
4594 | break; | |
4595 | case 2: set->sig[1] = -1; | |
4596 | case 1: ; | |
4597 | } | |
4598 | } | |
4599 | ||
4600 | ||
4601 | ||
4602 | static inline __attribute__((always_inline)) void init_sigpending(struct sigpending *sig) | |
4603 | { | |
4604 | sigemptyset(&sig->signal); | |
4605 | INIT_LIST_HEAD(&sig->list); | |
4606 | } | |
4607 | ||
4608 | extern void flush_sigqueue(struct sigpending *queue); | |
4609 | ||
4610 | ||
4611 | static inline __attribute__((always_inline)) int valid_signal(unsigned long sig) | |
4612 | { | |
4613 | return sig <= 64 ? 1 : 0; | |
4614 | } | |
4615 | ||
4616 | extern int group_send_sig_info(int sig, struct siginfo *info, struct task_struct *p); | |
4617 | extern int __group_send_sig_info(int, struct siginfo *, struct task_struct *); | |
4618 | extern long do_sigpending(void *, unsigned long); | |
4619 | extern int sigprocmask(int, sigset_t *, sigset_t *); | |
4620 | ||
4621 | struct pt_regs; | |
4622 | extern int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka, struct pt_regs *regs, void *cookie); | |
4623 | # 68 "include/linux/sched.h" 2 | |
4624 | # 1 "include/linux/securebits.h" 1 | |
4625 | ||
4626 | ||
4627 | ||
4628 | ||
4629 | ||
4630 | extern unsigned securebits; | |
4631 | # 69 "include/linux/sched.h" 2 | |
4632 | # 1 "include/linux/fs_struct.h" 1 | |
4633 | ||
4634 | ||
4635 | ||
4636 | struct dentry; | |
4637 | struct vfsmount; | |
4638 | ||
4639 | struct fs_struct { | |
4640 | atomic_t count; | |
4641 | rwlock_t lock; | |
4642 | int umask; | |
4643 | struct dentry * root, * pwd, * altroot; | |
4644 | struct vfsmount * rootmnt, * pwdmnt, * altrootmnt; | |
4645 | }; | |
4646 | ||
4647 | ||
4648 | ||
4649 | ||
4650 | ||
4651 | ||
4652 | ||
4653 | extern void exit_fs(struct task_struct *); | |
4654 | extern void set_fs_altroot(void); | |
4655 | extern void set_fs_root(struct fs_struct *, struct vfsmount *, struct dentry *); | |
4656 | extern void set_fs_pwd(struct fs_struct *, struct vfsmount *, struct dentry *); | |
4657 | extern struct fs_struct *copy_fs_struct(struct fs_struct *); | |
4658 | extern void put_fs_struct(struct fs_struct *); | |
4659 | # 70 "include/linux/sched.h" 2 | |
4660 | ||
4661 | # 1 "include/linux/completion.h" 1 | |
4662 | # 13 "include/linux/completion.h" | |
4663 | struct completion { | |
4664 | unsigned int done; | |
4665 | wait_queue_head_t wait; | |
4666 | }; | |
4667 | # 39 "include/linux/completion.h" | |
4668 | static inline __attribute__((always_inline)) void init_completion(struct completion *x) | |
4669 | { | |
4670 | x->done = 0; | |
4671 | init_waitqueue_head(&x->wait); | |
4672 | } | |
4673 | ||
4674 | extern void wait_for_completion(struct completion *); | |
4675 | extern int wait_for_completion_interruptible(struct completion *x); | |
4676 | extern unsigned long wait_for_completion_timeout(struct completion *x, unsigned long timeout); | |
4677 | ||
4678 | extern unsigned long wait_for_completion_interruptible_timeout( struct completion *x, unsigned long timeout); | |
4679 | ||
4680 | ||
4681 | extern void complete(struct completion *); | |
4682 | extern void complete_all(struct completion *); | |
4683 | # 72 "include/linux/sched.h" 2 | |
4684 | # 1 "include/linux/pid.h" 1 | |
4685 | ||
4686 | ||
4687 | ||
4688 | # 1 "include/linux/rcupdate.h" 1 | |
4689 | # 38 "include/linux/rcupdate.h" | |
4690 | # 1 "include/linux/cache.h" 1 | |
4691 | # 39 "include/linux/rcupdate.h" 2 | |
4692 | ||
4693 | ||
4694 | # 1 "include/linux/percpu.h" 1 | |
4695 | ||
4696 | ||
4697 | ||
4698 | ||
4699 | # 1 "include/linux/slab.h" 1 | |
4700 | # 12 "include/linux/slab.h" | |
4701 | typedef struct kmem_cache kmem_cache_t; | |
4702 | ||
4703 | # 1 "include/linux/gfp.h" 1 | |
4704 | ||
4705 | ||
4706 | ||
4707 | # 1 "include/linux/mmzone.h" 1 | |
4708 | # 13 "include/linux/mmzone.h" | |
4709 | # 1 "include/linux/init.h" 1 | |
4710 | # 63 "include/linux/init.h" | |
4711 | typedef int (*initcall_t)(void); | |
4712 | typedef void (*exitcall_t)(void); | |
4713 | ||
4714 | extern initcall_t __con_initcall_start[], __con_initcall_end[]; | |
4715 | extern initcall_t __security_initcall_start[], __security_initcall_end[]; | |
4716 | ||
4717 | ||
4718 | extern char saved_command_line[]; | |
4719 | extern unsigned int reset_devices; | |
4720 | ||
4721 | ||
4722 | extern void setup_arch(char **); | |
4723 | # 132 "include/linux/init.h" | |
4724 | struct obs_kernel_param { | |
4725 | const char *str; | |
4726 | int (*setup_func)(char *); | |
4727 | int early; | |
4728 | }; | |
4729 | # 167 "include/linux/init.h" | |
4730 | void __attribute__ ((__section__ (".init.text"))) parse_early_param(void); | |
4731 | # 14 "include/linux/mmzone.h" 2 | |
4732 | # 27 "include/linux/mmzone.h" | |
4733 | struct free_area { | |
4734 | struct list_head free_list; | |
4735 | unsigned long nr_free; | |
4736 | }; | |
4737 | ||
4738 | struct pglist_data; | |
4739 | # 49 "include/linux/mmzone.h" | |
4740 | enum zone_stat_item { | |
4741 | NR_ANON_PAGES, | |
4742 | NR_FILE_MAPPED, | |
4743 | ||
4744 | NR_FILE_PAGES, | |
4745 | NR_SLAB_RECLAIMABLE, | |
4746 | NR_SLAB_UNRECLAIMABLE, | |
4747 | NR_PAGETABLE, | |
4748 | NR_FILE_DIRTY, | |
4749 | NR_WRITEBACK, | |
4750 | NR_UNSTABLE_NFS, | |
4751 | NR_BOUNCE, | |
4752 | NR_VMSCAN_WRITE, | |
4753 | # 70 "include/linux/mmzone.h" | |
4754 | NR_VM_ZONE_STAT_ITEMS }; | |
4755 | ||
4756 | struct per_cpu_pages { | |
4757 | int count; | |
4758 | int high; | |
4759 | int batch; | |
4760 | struct list_head list; | |
4761 | }; | |
4762 | ||
4763 | struct per_cpu_pageset { | |
4764 | struct per_cpu_pages pcp[2]; | |
4765 | ||
4766 | ||
4767 | ||
4768 | ||
4769 | } ; | |
4770 | ||
4771 | ||
4772 | ||
4773 | ||
4774 | ||
4775 | ||
4776 | ||
4777 | enum zone_type { | |
4778 | # 113 "include/linux/mmzone.h" | |
4779 | ZONE_DMA, | |
4780 | # 127 "include/linux/mmzone.h" | |
4781 | ZONE_NORMAL, | |
4782 | # 139 "include/linux/mmzone.h" | |
4783 | MAX_NR_ZONES | |
4784 | }; | |
4785 | # 156 "include/linux/mmzone.h" | |
4786 | struct zone { | |
4787 | ||
4788 | unsigned long free_pages; | |
4789 | unsigned long pages_min, pages_low, pages_high; | |
4790 | # 168 "include/linux/mmzone.h" | |
4791 | unsigned long lowmem_reserve[MAX_NR_ZONES]; | |
4792 | # 179 "include/linux/mmzone.h" | |
4793 | struct per_cpu_pageset pageset[1]; | |
4794 | ||
4795 | ||
4796 | ||
4797 | ||
4798 | spinlock_t lock; | |
4799 | ||
4800 | ||
4801 | ||
4802 | ||
4803 | struct free_area free_area[14]; | |
4804 | ||
4805 | ||
4806 | ||
4807 | ||
4808 | ||
4809 | ||
4810 | ||
4811 | spinlock_t lru_lock; | |
4812 | struct list_head active_list; | |
4813 | struct list_head inactive_list; | |
4814 | unsigned long nr_scan_active; | |
4815 | unsigned long nr_scan_inactive; | |
4816 | unsigned long nr_active; | |
4817 | unsigned long nr_inactive; | |
4818 | unsigned long pages_scanned; | |
4819 | int all_unreclaimable; | |
4820 | ||
4821 | ||
4822 | atomic_t reclaim_in_progress; | |
4823 | ||
4824 | ||
4825 | atomic_long_t vm_stat[NR_VM_ZONE_STAT_ITEMS]; | |
4826 | # 226 "include/linux/mmzone.h" | |
4827 | int prev_priority; | |
4828 | ||
4829 | ||
4830 | ||
4831 | # 256 "include/linux/mmzone.h" | |
4832 | wait_queue_head_t * wait_table; | |
4833 | unsigned long wait_table_hash_nr_entries; | |
4834 | unsigned long wait_table_bits; | |
4835 | ||
4836 | ||
4837 | ||
4838 | ||
4839 | struct pglist_data *zone_pgdat; | |
4840 | ||
4841 | unsigned long zone_start_pfn; | |
4842 | # 277 "include/linux/mmzone.h" | |
4843 | unsigned long spanned_pages; | |
4844 | unsigned long present_pages; | |
4845 | ||
4846 | ||
4847 | ||
4848 | ||
4849 | char *name; | |
4850 | } ; | |
4851 | # 304 "include/linux/mmzone.h" | |
4852 | struct zonelist { | |
4853 | struct zone *zones[(1 << 0) * MAX_NR_ZONES + 1]; | |
4854 | }; | |
4855 | # 318 "include/linux/mmzone.h" | |
4856 | extern struct page *mem_map; | |
4857 | # 332 "include/linux/mmzone.h" | |
4858 | struct bootmem_data; | |
4859 | typedef struct pglist_data { | |
4860 | struct zone node_zones[MAX_NR_ZONES]; | |
4861 | struct zonelist node_zonelists[MAX_NR_ZONES]; | |
4862 | int nr_zones; | |
4863 | ||
4864 | struct page *node_mem_map; | |
4865 | ||
4866 | struct bootmem_data *bdata; | |
4867 | # 351 "include/linux/mmzone.h" | |
4868 | unsigned long node_start_pfn; | |
4869 | unsigned long node_present_pages; | |
4870 | unsigned long node_spanned_pages; | |
4871 | ||
4872 | int node_id; | |
4873 | wait_queue_head_t kswapd_wait; | |
4874 | struct task_struct *kswapd; | |
4875 | int kswapd_max_order; | |
4876 | } pg_data_t; | |
4877 | # 370 "include/linux/mmzone.h" | |
4878 | # 1 "include/linux/memory_hotplug.h" 1 | |
4879 | ||
4880 | ||
4881 | ||
4882 | # 1 "include/linux/mmzone.h" 1 | |
4883 | # 5 "include/linux/memory_hotplug.h" 2 | |
4884 | ||
4885 | ||
4886 | # 1 "include/linux/notifier.h" 1 | |
4887 | # 13 "include/linux/notifier.h" | |
4888 | # 1 "include/linux/mutex.h" 1 | |
4889 | # 47 "include/linux/mutex.h" | |
4890 | struct mutex { | |
4891 | ||
4892 | atomic_t count; | |
4893 | spinlock_t wait_lock; | |
4894 | struct list_head wait_list; | |
4895 | # 60 "include/linux/mutex.h" | |
4896 | }; | |
4897 | ||
4898 | ||
4899 | ||
4900 | ||
4901 | ||
4902 | struct mutex_waiter { | |
4903 | struct list_head list; | |
4904 | struct task_struct *task; | |
4905 | ||
4906 | ||
4907 | ||
4908 | ||
4909 | }; | |
4910 | # 105 "include/linux/mutex.h" | |
4911 | extern void __mutex_init(struct mutex *lock, const char *name, | |
4912 | struct lock_class_key *key); | |
4913 | ||
4914 | ||
4915 | ||
4916 | ||
4917 | ||
4918 | ||
4919 | ||
4920 | static inline __attribute__((always_inline)) int mutex_is_locked(struct mutex *lock) | |
4921 | { | |
4922 | return ((&lock->count)->counter) != 1; | |
4923 | } | |
4924 | ||
4925 | ||
4926 | ||
4927 | ||
4928 | ||
4929 | extern void mutex_lock(struct mutex *lock); | |
4930 | extern int mutex_lock_interruptible(struct mutex *lock); | |
4931 | # 136 "include/linux/mutex.h" | |
4932 | extern int mutex_trylock(struct mutex *lock); | |
4933 | extern void mutex_unlock(struct mutex *lock); | |
4934 | # 14 "include/linux/notifier.h" 2 | |
4935 | ||
4936 | # 1 "include/linux/srcu.h" 1 | |
4937 | # 30 "include/linux/srcu.h" | |
4938 | struct srcu_struct_array { | |
4939 | int c[2]; | |
4940 | }; | |
4941 | ||
4942 | struct srcu_struct { | |
4943 | int completed; | |
4944 | struct srcu_struct_array *per_cpu_ref; | |
4945 | struct mutex mutex; | |
4946 | }; | |
4947 | ||
4948 | ||
4949 | ||
4950 | ||
4951 | ||
4952 | ||
4953 | ||
4954 | int init_srcu_struct(struct srcu_struct *sp); | |
4955 | void cleanup_srcu_struct(struct srcu_struct *sp); | |
4956 | int srcu_read_lock(struct srcu_struct *sp) ; | |
4957 | void srcu_read_unlock(struct srcu_struct *sp, int idx) ; | |
4958 | void synchronize_srcu(struct srcu_struct *sp); | |
4959 | long srcu_batches_completed(struct srcu_struct *sp); | |
4960 | # 16 "include/linux/notifier.h" 2 | |
4961 | # 50 "include/linux/notifier.h" | |
4962 | struct notifier_block { | |
4963 | int (*notifier_call)(struct notifier_block *, unsigned long, void *); | |
4964 | struct notifier_block *next; | |
4965 | int priority; | |
4966 | }; | |
4967 | ||
4968 | struct atomic_notifier_head { | |
4969 | spinlock_t lock; | |
4970 | struct notifier_block *head; | |
4971 | }; | |
4972 | ||
4973 | struct blocking_notifier_head { | |
4974 | struct rw_semaphore rwsem; | |
4975 | struct notifier_block *head; | |
4976 | }; | |
4977 | ||
4978 | struct raw_notifier_head { | |
4979 | struct notifier_block *head; | |
4980 | }; | |
4981 | ||
4982 | struct srcu_notifier_head { | |
4983 | struct mutex mutex; | |
4984 | struct srcu_struct srcu; | |
4985 | struct notifier_block *head; | |
4986 | }; | |
4987 | # 89 "include/linux/notifier.h" | |
4988 | extern void srcu_init_notifier_head(struct srcu_notifier_head *nh); | |
4989 | # 115 "include/linux/notifier.h" | |
4990 | extern int atomic_notifier_chain_register(struct atomic_notifier_head *, | |
4991 | struct notifier_block *); | |
4992 | extern int blocking_notifier_chain_register(struct blocking_notifier_head *, | |
4993 | struct notifier_block *); | |
4994 | extern int raw_notifier_chain_register(struct raw_notifier_head *, | |
4995 | struct notifier_block *); | |
4996 | extern int srcu_notifier_chain_register(struct srcu_notifier_head *, | |
4997 | struct notifier_block *); | |
4998 | ||
4999 | extern int atomic_notifier_chain_unregister(struct atomic_notifier_head *, | |
5000 | struct notifier_block *); | |
5001 | extern int blocking_notifier_chain_unregister(struct blocking_notifier_head *, | |
5002 | struct notifier_block *); | |
5003 | extern int raw_notifier_chain_unregister(struct raw_notifier_head *, | |
5004 | struct notifier_block *); | |
5005 | extern int srcu_notifier_chain_unregister(struct srcu_notifier_head *, | |
5006 | struct notifier_block *); | |
5007 | ||
5008 | extern int atomic_notifier_call_chain(struct atomic_notifier_head *, | |
5009 | unsigned long val, void *v); | |
5010 | extern int blocking_notifier_call_chain(struct blocking_notifier_head *, | |
5011 | unsigned long val, void *v); | |
5012 | extern int raw_notifier_call_chain(struct raw_notifier_head *, | |
5013 | unsigned long val, void *v); | |
5014 | extern int srcu_notifier_call_chain(struct srcu_notifier_head *, | |
5015 | unsigned long val, void *v); | |
5016 | # 8 "include/linux/memory_hotplug.h" 2 | |
5017 | ||
5018 | struct page; | |
5019 | struct zone; | |
5020 | struct pglist_data; | |
5021 | # 140 "include/linux/memory_hotplug.h" | |
5022 | static inline __attribute__((always_inline)) void pgdat_resize_lock(struct pglist_data *p, unsigned long *f) {} | |
5023 | static inline __attribute__((always_inline)) void pgdat_resize_unlock(struct pglist_data *p, unsigned long *f) {} | |
5024 | static inline __attribute__((always_inline)) void pgdat_resize_init(struct pglist_data *pgdat) {} | |
5025 | ||
5026 | static inline __attribute__((always_inline)) unsigned zone_span_seqbegin(struct zone *zone) | |
5027 | { | |
5028 | return 0; | |
5029 | } | |
5030 | static inline __attribute__((always_inline)) int zone_span_seqretry(struct zone *zone, unsigned iv) | |
5031 | { | |
5032 | return 0; | |
5033 | } | |
5034 | static inline __attribute__((always_inline)) void zone_span_writelock(struct zone *zone) {} | |
5035 | static inline __attribute__((always_inline)) void zone_span_writeunlock(struct zone *zone) {} | |
5036 | static inline __attribute__((always_inline)) void zone_seqlock_init(struct zone *zone) {} | |
5037 | ||
5038 | static inline __attribute__((always_inline)) int mhp_notimplemented(const char *func) | |
5039 | { | |
5040 | printk("<4>" "%s() called, with CONFIG_MEMORY_HOTPLUG disabled\n", func); | |
5041 | dump_stack(); | |
5042 | return -38; | |
5043 | } | |
5044 | ||
5045 | ||
5046 | static inline __attribute__((always_inline)) int __remove_pages(struct zone *zone, unsigned long start_pfn, | |
5047 | unsigned long nr_pages) | |
5048 | { | |
5049 | printk("<4>" "%s() called, not yet supported\n", (__func__)); | |
5050 | dump_stack(); | |
5051 | return -38; | |
5052 | } | |
5053 | ||
5054 | extern int add_memory(int nid, u64 start, u64 size); | |
5055 | extern int arch_add_memory(int nid, u64 start, u64 size); | |
5056 | extern int remove_memory(u64 start, u64 size); | |
5057 | extern int sparse_add_one_section(struct zone *zone, unsigned long start_pfn, | |
5058 | int nr_pages); | |
5059 | # 371 "include/linux/mmzone.h" 2 | |
5060 | ||
5061 | void __get_zone_counts(unsigned long *active, unsigned long *inactive, | |
5062 | unsigned long *free, struct pglist_data *pgdat); | |
5063 | void get_zone_counts(unsigned long *active, unsigned long *inactive, | |
5064 | unsigned long *free); | |
5065 | void build_all_zonelists(void); | |
5066 | void wakeup_kswapd(struct zone *zone, int order); | |
5067 | int zone_watermark_ok(struct zone *z, int order, unsigned long mark, | |
5068 | int classzone_idx, int alloc_flags); | |
5069 | ||
5070 | extern int init_currently_empty_zone(struct zone *zone, unsigned long start_pfn, | |
5071 | unsigned long size); | |
5072 | ||
5073 | ||
5074 | ||
5075 | ||
5076 | static inline __attribute__((always_inline)) void memory_present(int nid, unsigned long start, unsigned long end) {} | |
5077 | # 399 "include/linux/mmzone.h" | |
5078 | static inline __attribute__((always_inline)) int populated_zone(struct zone *zone) | |
5079 | { | |
5080 | return (!!zone->present_pages); | |
5081 | } | |
5082 | ||
5083 | static inline __attribute__((always_inline)) int is_highmem_idx(enum zone_type idx) | |
5084 | { | |
5085 | ||
5086 | ||
5087 | ||
5088 | return 0; | |
5089 | ||
5090 | } | |
5091 | ||
5092 | static inline __attribute__((always_inline)) int is_normal_idx(enum zone_type idx) | |
5093 | { | |
5094 | return (idx == ZONE_NORMAL); | |
5095 | } | |
5096 | ||
5097 | ||
5098 | ||
5099 | ||
5100 | ||
5101 | ||
5102 | ||
5103 | static inline __attribute__((always_inline)) int is_highmem(struct zone *zone) | |
5104 | { | |
5105 | ||
5106 | ||
5107 | ||
5108 | return 0; | |
5109 | ||
5110 | } | |
5111 | ||
5112 | static inline __attribute__((always_inline)) int is_normal(struct zone *zone) | |
5113 | { | |
5114 | return zone == zone->zone_pgdat->node_zones + ZONE_NORMAL; | |
5115 | } | |
5116 | ||
5117 | static inline __attribute__((always_inline)) int is_dma32(struct zone *zone) | |
5118 | { | |
5119 | ||
5120 | ||
5121 | ||
5122 | return 0; | |
5123 | ||
5124 | } | |
5125 | ||
5126 | static inline __attribute__((always_inline)) int is_dma(struct zone *zone) | |
5127 | { | |
5128 | return zone == zone->zone_pgdat->node_zones + ZONE_DMA; | |
5129 | } | |
5130 | ||
5131 | ||
5132 | struct ctl_table; | |
5133 | struct file; | |
5134 | int min_free_kbytes_sysctl_handler(struct ctl_table *, int, struct file *, | |
5135 | void *, size_t *, loff_t *); | |
5136 | extern int sysctl_lowmem_reserve_ratio[MAX_NR_ZONES-1]; | |
5137 | int lowmem_reserve_ratio_sysctl_handler(struct ctl_table *, int, struct file *, | |
5138 | void *, size_t *, loff_t *); | |
5139 | int percpu_pagelist_fraction_sysctl_handler(struct ctl_table *, int, struct file *, | |
5140 | void *, size_t *, loff_t *); | |
5141 | int sysctl_min_unmapped_ratio_sysctl_handler(struct ctl_table *, int, | |
5142 | struct file *, void *, size_t *, loff_t *); | |
5143 | int sysctl_min_slab_ratio_sysctl_handler(struct ctl_table *, int, | |
5144 | struct file *, void *, size_t *, loff_t *); | |
5145 | ||
5146 | # 1 "include/linux/topology.h" 1 | |
5147 | # 34 "include/linux/topology.h" | |
5148 | # 1 "include/asm/topology.h" 1 | |
5149 | ||
5150 | ||
5151 | ||
5152 | # 1 "include/asm-generic/topology.h" 1 | |
5153 | # 5 "include/asm/topology.h" 2 | |
5154 | # 35 "include/linux/topology.h" 2 | |
5155 | # 468 "include/linux/mmzone.h" 2 | |
5156 | ||
5157 | ||
5158 | ||
5159 | ||
5160 | ||
5161 | ||
5162 | ||
5163 | extern struct pglist_data contig_page_data; | |
5164 | # 486 "include/linux/mmzone.h" | |
5165 | extern struct pglist_data *first_online_pgdat(void); | |
5166 | extern struct pglist_data *next_online_pgdat(struct pglist_data *pgdat); | |
5167 | extern struct zone *next_zone(struct zone *zone); | |
5168 | # 685 "include/linux/mmzone.h" | |
5169 | void memory_present(int nid, unsigned long start, unsigned long end); | |
5170 | unsigned long __attribute__ ((__section__ (".init.text"))) node_memmap_size_bytes(int, unsigned long, unsigned long); | |
5171 | # 5 "include/linux/gfp.h" 2 | |
5172 | ||
5173 | ||
5174 | ||
5175 | struct vm_area_struct; | |
5176 | # 86 "include/linux/gfp.h" | |
5177 | static inline __attribute__((always_inline)) enum zone_type gfp_zone(gfp_t flags) | |
5178 | { | |
5179 | if (flags & (( gfp_t)0x01u)) | |
5180 | return ZONE_DMA; | |
5181 | # 98 "include/linux/gfp.h" | |
5182 | return ZONE_NORMAL; | |
5183 | } | |
5184 | # 117 "include/linux/gfp.h" | |
5185 | static inline __attribute__((always_inline)) void arch_free_page(struct page *page, int order) { } | |
5186 | ||
5187 | ||
5188 | extern struct page * | |
5189 | __alloc_pages(gfp_t, unsigned int, struct zonelist *); | |
5190 | ||
5191 | static inline __attribute__((always_inline)) struct page *alloc_pages_node(int nid, gfp_t gfp_mask, | |
5192 | unsigned int order) | |
5193 | { | |
5194 | if (__builtin_expect(!!(order >= 14), 0)) | |
5195 | return ((void *)0); | |
5196 | ||
5197 | ||
5198 | if (nid < 0) | |
5199 | nid = ((0)); | |
5200 | ||
5201 | return __alloc_pages(gfp_mask, order, | |
5202 | (&contig_page_data)->node_zonelists + gfp_zone(gfp_mask)); | |
5203 | } | |
5204 | # 157 "include/linux/gfp.h" | |
5205 | extern unsigned long __get_free_pages(gfp_t gfp_mask, unsigned int order); | |
5206 | extern unsigned long get_zeroed_page(gfp_t gfp_mask); | |
5207 | ||
5208 | ||
5209 | ||
5210 | ||
5211 | ||
5212 | ||
5213 | ||
5214 | extern void __free_pages(struct page *page, unsigned int order); | |
5215 | extern void free_pages(unsigned long addr, unsigned int order); | |
5216 | extern void free_hot_page(struct page *page); | |
5217 | extern void free_cold_page(struct page *page); | |
5218 | ||
5219 | ||
5220 | ||
5221 | ||
5222 | void page_alloc_init(void); | |
5223 | ||
5224 | ||
5225 | ||
5226 | static inline __attribute__((always_inline)) void drain_node_pages(int node) { }; | |
5227 | # 15 "include/linux/slab.h" 2 | |
5228 | # 58 "include/linux/slab.h" | |
5229 | extern void __attribute__ ((__section__ (".init.text"))) kmem_cache_init(void); | |
5230 | ||
5231 | extern kmem_cache_t *kmem_cache_create(const char *, size_t, size_t, unsigned long, | |
5232 | void (*)(void *, kmem_cache_t *, unsigned long), | |
5233 | void (*)(void *, kmem_cache_t *, unsigned long)); | |
5234 | extern void kmem_cache_destroy(kmem_cache_t *); | |
5235 | extern int kmem_cache_shrink(kmem_cache_t *); | |
5236 | extern void *kmem_cache_alloc(kmem_cache_t *, gfp_t); | |
5237 | extern void *kmem_cache_zalloc(struct kmem_cache *, gfp_t); | |
5238 | extern void kmem_cache_free(kmem_cache_t *, void *); | |
5239 | extern unsigned int kmem_cache_size(kmem_cache_t *); | |
5240 | extern const char *kmem_cache_name(kmem_cache_t *); | |
5241 | ||
5242 | ||
5243 | struct cache_sizes { | |
5244 | size_t cs_size; | |
5245 | kmem_cache_t *cs_cachep; | |
5246 | kmem_cache_t *cs_dmacachep; | |
5247 | }; | |
5248 | extern struct cache_sizes malloc_sizes[]; | |
5249 | ||
5250 | extern void *__kmalloc(size_t, gfp_t); | |
5251 | # 126 "include/linux/slab.h" | |
5252 | static inline __attribute__((always_inline)) void *kmalloc(size_t size, gfp_t flags) | |
5253 | { | |
5254 | if (__builtin_constant_p(size)) { | |
5255 | int i = 0; | |
5256 | ||
5257 | ||
5258 | ||
5259 | ||
5260 | ||
5261 | # 1 "include/linux/kmalloc_sizes.h" 1 | |
5262 | ||
5263 | if (size <= 32) goto found; else i++; | |
5264 | ||
5265 | if (size <= 64) goto found; else i++; | |
5266 | ||
5267 | if (size <= 96) goto found; else i++; | |
5268 | ||
5269 | if (size <= 128) goto found; else i++; | |
5270 | ||
5271 | if (size <= 192) goto found; else i++; | |
5272 | ||
5273 | if (size <= 256) goto found; else i++; | |
5274 | if (size <= 512) goto found; else i++; | |
5275 | if (size <= 1024) goto found; else i++; | |
5276 | if (size <= 2048) goto found; else i++; | |
5277 | if (size <= 4096) goto found; else i++; | |
5278 | if (size <= 8192) goto found; else i++; | |
5279 | if (size <= 16384) goto found; else i++; | |
5280 | if (size <= 32768) goto found; else i++; | |
5281 | if (size <= 65536) goto found; else i++; | |
5282 | if (size <= 131072) goto found; else i++; | |
5283 | ||
5284 | if (size <= 262144) goto found; else i++; | |
5285 | ||
5286 | ||
5287 | if (size <= 524288) goto found; else i++; | |
5288 | if (size <= 1048576) goto found; else i++; | |
5289 | ||
5290 | if (size <= 2097152) goto found; else i++; | |
5291 | if (size <= 4194304) goto found; else i++; | |
5292 | if (size <= 8388608) goto found; else i++; | |
5293 | if (size <= 16777216) goto found; else i++; | |
5294 | if (size <= 33554432) goto found; else i++; | |
5295 | # 136 "include/linux/slab.h" 2 | |
5296 | ||
5297 | { | |
5298 | extern void __you_cannot_kmalloc_that_much(void); | |
5299 | __you_cannot_kmalloc_that_much(); | |
5300 | } | |
5301 | found: | |
5302 | return kmem_cache_alloc((flags & (( gfp_t)0x01u)) ? | |
5303 | malloc_sizes[i].cs_dmacachep : | |
5304 | malloc_sizes[i].cs_cachep, flags); | |
5305 | } | |
5306 | return __kmalloc(size, flags); | |
5307 | } | |
5308 | # 166 "include/linux/slab.h" | |
5309 | extern void *__kzalloc(size_t, gfp_t); | |
5310 | ||
5311 | ||
5312 | ||
5313 | ||
5314 | ||
5315 | ||
5316 | static inline __attribute__((always_inline)) void *kzalloc(size_t size, gfp_t flags) | |
5317 | { | |
5318 | if (__builtin_constant_p(size)) { | |
5319 | int i = 0; | |
5320 | ||
5321 | ||
5322 | ||
5323 | ||
5324 | ||
5325 | # 1 "include/linux/kmalloc_sizes.h" 1 | |
5326 | ||
5327 | if (size <= 32) goto found; else i++; | |
5328 | ||
5329 | if (size <= 64) goto found; else i++; | |
5330 | ||
5331 | if (size <= 96) goto found; else i++; | |
5332 | ||
5333 | if (size <= 128) goto found; else i++; | |
5334 | ||
5335 | if (size <= 192) goto found; else i++; | |
5336 | ||
5337 | if (size <= 256) goto found; else i++; | |
5338 | if (size <= 512) goto found; else i++; | |
5339 | if (size <= 1024) goto found; else i++; | |
5340 | if (size <= 2048) goto found; else i++; | |
5341 | if (size <= 4096) goto found; else i++; | |
5342 | if (size <= 8192) goto found; else i++; | |
5343 | if (size <= 16384) goto found; else i++; | |
5344 | if (size <= 32768) goto found; else i++; | |
5345 | if (size <= 65536) goto found; else i++; | |
5346 | if (size <= 131072) goto found; else i++; | |
5347 | ||
5348 | if (size <= 262144) goto found; else i++; | |
5349 | ||
5350 | ||
5351 | if (size <= 524288) goto found; else i++; | |
5352 | if (size <= 1048576) goto found; else i++; | |
5353 | ||
5354 | if (size <= 2097152) goto found; else i++; | |
5355 | if (size <= 4194304) goto found; else i++; | |
5356 | if (size <= 8388608) goto found; else i++; | |
5357 | if (size <= 16777216) goto found; else i++; | |
5358 | if (size <= 33554432) goto found; else i++; | |
5359 | # 183 "include/linux/slab.h" 2 | |
5360 | ||
5361 | { | |
5362 | extern void __you_cannot_kzalloc_that_much(void); | |
5363 | __you_cannot_kzalloc_that_much(); | |
5364 | } | |
5365 | found: | |
5366 | return kmem_cache_zalloc((flags & (( gfp_t)0x01u)) ? | |
5367 | malloc_sizes[i].cs_dmacachep : | |
5368 | malloc_sizes[i].cs_cachep, flags); | |
5369 | } | |
5370 | return __kzalloc(size, flags); | |
5371 | } | |
5372 | ||
5373 | ||
5374 | ||
5375 | ||
5376 | ||
5377 | ||
5378 | ||
5379 | static inline __attribute__((always_inline)) void *kcalloc(size_t n, size_t size, gfp_t flags) | |
5380 | { | |
5381 | if (n != 0 && size > (~0UL) / n) | |
5382 | return ((void *)0); | |
5383 | return kzalloc(n * size, flags); | |
5384 | } | |
5385 | ||
5386 | extern void kfree(const void *); | |
5387 | extern unsigned int ksize(const void *); | |
5388 | extern int slab_is_available(void); | |
5389 | # 240 "include/linux/slab.h" | |
5390 | static inline __attribute__((always_inline)) void *kmem_cache_alloc_node(kmem_cache_t *cachep, gfp_t flags, int node) | |
5391 | { | |
5392 | return kmem_cache_alloc(cachep, flags); | |
5393 | } | |
5394 | static inline __attribute__((always_inline)) void *kmalloc_node(size_t size, gfp_t flags, int node) | |
5395 | { | |
5396 | return kmalloc(size, flags); | |
5397 | } | |
5398 | ||
5399 | ||
5400 | extern int kmem_cache_reap(int); | |
5401 | extern int kmem_ptr_validate(kmem_cache_t *cachep, void *ptr); | |
5402 | # 289 "include/linux/slab.h" | |
5403 | extern kmem_cache_t *vm_area_cachep; | |
5404 | extern kmem_cache_t *names_cachep; | |
5405 | extern kmem_cache_t *files_cachep; | |
5406 | extern kmem_cache_t *filp_cachep; | |
5407 | extern kmem_cache_t *fs_cachep; | |
5408 | extern kmem_cache_t *sighand_cachep; | |
5409 | extern kmem_cache_t *bio_cachep; | |
5410 | # 6 "include/linux/percpu.h" 2 | |
5411 | ||
5412 | ||
5413 | ||
5414 | ||
5415 | # 1 "include/asm/percpu.h" 1 | |
5416 | ||
5417 | ||
5418 | ||
5419 | # 1 "include/asm-generic/percpu.h" 1 | |
5420 | # 5 "include/asm/percpu.h" 2 | |
5421 | # 11 "include/linux/percpu.h" 2 | |
5422 | # 57 "include/linux/percpu.h" | |
5423 | static inline __attribute__((always_inline)) void percpu_depopulate(void *__pdata, int cpu) | |
5424 | { | |
5425 | } | |
5426 | ||
5427 | static inline __attribute__((always_inline)) void __percpu_depopulate_mask(void *__pdata, cpumask_t *mask) | |
5428 | { | |
5429 | } | |
5430 | ||
5431 | static inline __attribute__((always_inline)) void *percpu_populate(void *__pdata, size_t size, gfp_t gfp, | |
5432 | int cpu) | |
5433 | { | |
5434 | return ({ (void)(cpu); (__pdata); }); | |
5435 | } | |
5436 | ||
5437 | static inline __attribute__((always_inline)) int __percpu_populate_mask(void *__pdata, size_t size, gfp_t gfp, | |
5438 | cpumask_t *mask) | |
5439 | { | |
5440 | return 0; | |
5441 | } | |
5442 | ||
5443 | static inline __attribute__((always_inline)) __attribute__((always_inline)) void *__percpu_alloc_mask(size_t size, gfp_t gfp, cpumask_t *mask) | |
5444 | { | |
5445 | return kzalloc(size, gfp); | |
5446 | } | |
5447 | ||
5448 | static inline __attribute__((always_inline)) void percpu_free(void *__pdata) | |
5449 | { | |
5450 | kfree(__pdata); | |
5451 | } | |
5452 | # 42 "include/linux/rcupdate.h" 2 | |
5453 | # 50 "include/linux/rcupdate.h" | |
5454 | struct rcu_head { | |
5455 | struct rcu_head *next; | |
5456 | void (*func)(struct rcu_head *head); | |
5457 | }; | |
5458 | # 64 "include/linux/rcupdate.h" | |
5459 | struct rcu_ctrlblk { | |
5460 | long cur; | |
5461 | long completed; | |
5462 | int next_pending; | |
5463 | ||
5464 | int signaled; | |
5465 | ||
5466 | spinlock_t lock ; | |
5467 | cpumask_t cpumask; | |
5468 | ||
5469 | } ; | |
5470 | ||
5471 | ||
5472 | static inline __attribute__((always_inline)) int rcu_batch_before(long a, long b) | |
5473 | { | |
5474 | return (a - b) < 0; | |
5475 | } | |
5476 | ||
5477 | ||
5478 | static inline __attribute__((always_inline)) int rcu_batch_after(long a, long b) | |
5479 | { | |
5480 | return (a - b) > 0; | |
5481 | } | |
5482 | ||
5483 | ||
5484 | ||
5485 | ||
5486 | ||
5487 | ||
5488 | struct rcu_data { | |
5489 | ||
5490 | long quiescbatch; | |
5491 | int passed_quiesc; | |
5492 | int qs_pending; | |
5493 | ||
5494 | ||
5495 | long batch; | |
5496 | struct rcu_head *nxtlist; | |
5497 | struct rcu_head **nxttail; | |
5498 | long qlen; | |
5499 | struct rcu_head *curlist; | |
5500 | struct rcu_head **curtail; | |
5501 | struct rcu_head *donelist; | |
5502 | struct rcu_head **donetail; | |
5503 | long blimit; | |
5504 | int cpu; | |
5505 | struct rcu_head barrier; | |
5506 | }; | |
5507 | ||
5508 | extern __typeof__(struct rcu_data) per_cpu__rcu_data; | |
5509 | extern __typeof__(struct rcu_data) per_cpu__rcu_bh_data; | |
5510 | ||
5511 | ||
5512 | ||
5513 | ||
5514 | ||
5515 | ||
5516 | ||
5517 | static inline __attribute__((always_inline)) void rcu_qsctr_inc(int cpu) | |
5518 | { | |
5519 | struct rcu_data *rdp = &(*((void)(cpu), &per_cpu__rcu_data)); | |
5520 | rdp->passed_quiesc = 1; | |
5521 | } | |
5522 | static inline __attribute__((always_inline)) void rcu_bh_qsctr_inc(int cpu) | |
5523 | { | |
5524 | struct rcu_data *rdp = &(*((void)(cpu), &per_cpu__rcu_bh_data)); | |
5525 | rdp->passed_quiesc = 1; | |
5526 | } | |
5527 | ||
5528 | extern int rcu_pending(int cpu); | |
5529 | extern int rcu_needs_cpu(int cpu); | |
5530 | # 272 "include/linux/rcupdate.h" | |
5531 | extern void rcu_init(void); | |
5532 | extern void rcu_check_callbacks(int cpu, int user); | |
5533 | extern void rcu_restart_cpu(int cpu); | |
5534 | extern long rcu_batches_completed(void); | |
5535 | extern long rcu_batches_completed_bh(void); | |
5536 | ||
5537 | ||
5538 | extern void call_rcu(struct rcu_head *head, void (*func)(struct rcu_head *head)); | |
5539 | ||
5540 | extern void call_rcu_bh(struct rcu_head *head, void (*func)(struct rcu_head *head)); | |
5541 | ||
5542 | extern void synchronize_rcu(void); | |
5543 | void synchronize_idle(void); | |
5544 | extern void rcu_barrier(void); | |
5545 | # 5 "include/linux/pid.h" 2 | |
5546 | ||
5547 | enum pid_type | |
5548 | { | |
5549 | PIDTYPE_PID, | |
5550 | PIDTYPE_PGID, | |
5551 | PIDTYPE_SID, | |
5552 | PIDTYPE_MAX | |
5553 | }; | |
5554 | # 42 "include/linux/pid.h" | |
5555 | struct pid | |
5556 | { | |
5557 | atomic_t count; | |
5558 | ||
5559 | int nr; | |
5560 | struct hlist_node pid_chain; | |
5561 | ||
5562 | struct hlist_head tasks[PIDTYPE_MAX]; | |
5563 | struct rcu_head rcu; | |
5564 | }; | |
5565 | ||
5566 | struct pid_link | |
5567 | { | |
5568 | struct hlist_node node; | |
5569 | struct pid *pid; | |
5570 | }; | |
5571 | ||
5572 | static inline __attribute__((always_inline)) struct pid *get_pid(struct pid *pid) | |
5573 | { | |
5574 | if (pid) | |
5575 | atomic_inc(&pid->count); | |
5576 | return pid; | |
5577 | } | |
5578 | ||
5579 | extern void put_pid(struct pid *pid); | |
5580 | extern struct task_struct *pid_task(struct pid *pid, enum pid_type); | |
5581 | extern struct task_struct *get_pid_task(struct pid *pid, enum pid_type); | |
5582 | ||
5583 | ||
5584 | extern struct pid *get_task_pid(struct task_struct *task, enum pid_type type); | |
5585 | ||
5586 | ||
5587 | ||
5588 | ||
5589 | ||
5590 | extern int attach_pid(struct task_struct *task, enum pid_type type, int nr); | |
5591 | ||
5592 | ||
5593 | extern void detach_pid(struct task_struct *task, enum pid_type); | |
5594 | extern void transfer_pid(struct task_struct *old, struct task_struct *new, enum pid_type); | |
5595 | ||
5596 | ||
5597 | ||
5598 | ||
5599 | ||
5600 | ||
5601 | extern struct pid *find_pid(int nr); | |
5602 | ||
5603 | ||
5604 | ||
5605 | ||
5606 | extern struct pid *find_get_pid(int nr); | |
5607 | extern struct pid *find_ge_pid(int nr); | |
5608 | ||
5609 | extern struct pid *alloc_pid(void); | |
5610 | extern void free_pid(struct pid *pid); | |
5611 | ||
5612 | static inline __attribute__((always_inline)) pid_t pid_nr(struct pid *pid) | |
5613 | { | |
5614 | pid_t nr = 0; | |
5615 | if (pid) | |
5616 | nr = pid->nr; | |
5617 | return nr; | |
5618 | } | |
5619 | # 73 "include/linux/sched.h" 2 | |
5620 | ||
5621 | ||
5622 | # 1 "include/linux/seccomp.h" 1 | |
5623 | # 28 "include/linux/seccomp.h" | |
5624 | typedef struct { } seccomp_t; | |
5625 | ||
5626 | ||
5627 | ||
5628 | static inline __attribute__((always_inline)) int has_secure_computing(struct thread_info *ti) | |
5629 | { | |
5630 | return 0; | |
5631 | } | |
5632 | # 76 "include/linux/sched.h" 2 | |
5633 | ||
5634 | # 1 "include/linux/futex.h" 1 | |
5635 | ||
5636 | ||
5637 | ||
5638 | # 1 "include/linux/sched.h" 1 | |
5639 | # 5 "include/linux/futex.h" 2 | |
5640 | # 33 "include/linux/futex.h" | |
5641 | struct robust_list { | |
5642 | struct robust_list *next; | |
5643 | }; | |
5644 | # 45 "include/linux/futex.h" | |
5645 | struct robust_list_head { | |
5646 | ||
5647 | ||
5648 | ||
5649 | struct robust_list list; | |
5650 | ||
5651 | ||
5652 | ||
5653 | ||
5654 | ||
5655 | ||
5656 | ||
5657 | long futex_offset; | |
5658 | # 69 "include/linux/futex.h" | |
5659 | struct robust_list *list_op_pending; | |
5660 | }; | |
5661 | # 96 "include/linux/futex.h" | |
5662 | long do_futex(u32 *uaddr, int op, u32 val, unsigned long timeout, | |
5663 | u32 *uaddr2, u32 val2, u32 val3); | |
5664 | ||
5665 | extern int | |
5666 | handle_futex_death(u32 *uaddr, struct task_struct *curr, int pi); | |
5667 | ||
5668 | ||
5669 | extern void exit_robust_list(struct task_struct *curr); | |
5670 | extern void exit_pi_state_list(struct task_struct *curr); | |
5671 | # 78 "include/linux/sched.h" 2 | |
5672 | # 1 "include/linux/rtmutex.h" 1 | |
5673 | # 16 "include/linux/rtmutex.h" | |
5674 | # 1 "include/linux/plist.h" 1 | |
5675 | # 80 "include/linux/plist.h" | |
5676 | struct plist_head { | |
5677 | struct list_head prio_list; | |
5678 | struct list_head node_list; | |
5679 | ||
5680 | ||
5681 | ||
5682 | }; | |
5683 | ||
5684 | struct plist_node { | |
5685 | int prio; | |
5686 | struct plist_head plist; | |
5687 | }; | |
5688 | # 128 "include/linux/plist.h" | |
5689 | static inline __attribute__((always_inline)) void | |
5690 | plist_head_init(struct plist_head *head, spinlock_t *lock) | |
5691 | { | |
5692 | INIT_LIST_HEAD(&head->prio_list); | |
5693 | INIT_LIST_HEAD(&head->node_list); | |
5694 | ||
5695 | ||
5696 | ||
5697 | } | |
5698 | ||
5699 | ||
5700 | ||
5701 | ||
5702 | ||
5703 | ||
5704 | ||
5705 | static inline __attribute__((always_inline)) void plist_node_init(struct plist_node *node, int prio) | |
5706 | { | |
5707 | node->prio = prio; | |
5708 | plist_head_init(&node->plist, ((void *)0)); | |
5709 | } | |
5710 | ||
5711 | extern void plist_add(struct plist_node *node, struct plist_head *head); | |
5712 | extern void plist_del(struct plist_node *node, struct plist_head *head); | |
5713 | # 200 "include/linux/plist.h" | |
5714 | static inline __attribute__((always_inline)) int plist_head_empty(const struct plist_head *head) | |
5715 | { | |
5716 | return list_empty(&head->node_list); | |
5717 | } | |
5718 | ||
5719 | ||
5720 | ||
5721 | ||
5722 | ||
5723 | ||
5724 | static inline __attribute__((always_inline)) int plist_node_empty(const struct plist_node *node) | |
5725 | { | |
5726 | return plist_head_empty(&node->plist); | |
5727 | } | |
5728 | # 242 "include/linux/plist.h" | |
5729 | static inline __attribute__((always_inline)) struct plist_node* plist_first(const struct plist_head *head) | |
5730 | { | |
5731 | return ({ const typeof( ((struct plist_node *)0)->plist.node_list ) *__mptr = (head->node_list.next); (struct plist_node *)( (char *)__mptr - __builtin_offsetof(struct plist_node,plist.node_list) );}); | |
5732 | ||
5733 | } | |
5734 | # 17 "include/linux/rtmutex.h" 2 | |
5735 | # 26 "include/linux/rtmutex.h" | |
5736 | struct rt_mutex { | |
5737 | spinlock_t wait_lock; | |
5738 | struct plist_head wait_list; | |
5739 | struct task_struct *owner; | |
5740 | ||
5741 | ||
5742 | ||
5743 | ||
5744 | ||
5745 | ||
5746 | }; | |
5747 | ||
5748 | struct rt_mutex_waiter; | |
5749 | struct hrtimer_sleeper; | |
5750 | ||
5751 | ||
5752 | ||
5753 | ||
5754 | ||
5755 | ||
5756 | static inline __attribute__((always_inline)) int rt_mutex_debug_check_no_locks_freed(const void *from, | |
5757 | unsigned long len) | |
5758 | { | |
5759 | return 0; | |
5760 | } | |
5761 | # 80 "include/linux/rtmutex.h" | |
5762 | static inline __attribute__((always_inline)) int rt_mutex_is_locked(struct rt_mutex *lock) | |
5763 | { | |
5764 | return lock->owner != ((void *)0); | |
5765 | } | |
5766 | ||
5767 | extern void __rt_mutex_init(struct rt_mutex *lock, const char *name); | |
5768 | extern void rt_mutex_destroy(struct rt_mutex *lock); | |
5769 | ||
5770 | extern void rt_mutex_lock(struct rt_mutex *lock); | |
5771 | extern int rt_mutex_lock_interruptible(struct rt_mutex *lock, | |
5772 | int detect_deadlock); | |
5773 | extern int rt_mutex_timed_lock(struct rt_mutex *lock, | |
5774 | struct hrtimer_sleeper *timeout, | |
5775 | int detect_deadlock); | |
5776 | ||
5777 | extern int rt_mutex_trylock(struct rt_mutex *lock); | |
5778 | ||
5779 | extern void rt_mutex_unlock(struct rt_mutex *lock); | |
5780 | # 79 "include/linux/sched.h" 2 | |
5781 | ||
5782 | ||
5783 | # 1 "include/linux/param.h" 1 | |
5784 | # 82 "include/linux/sched.h" 2 | |
5785 | # 1 "include/linux/resource.h" 1 | |
5786 | ||
5787 | ||
5788 | ||
5789 | ||
5790 | ||
5791 | struct task_struct; | |
5792 | # 23 "include/linux/resource.h" | |
5793 | struct rusage { | |
5794 | struct timeval ru_utime; | |
5795 | struct timeval ru_stime; | |
5796 | long ru_maxrss; | |
5797 | long ru_ixrss; | |
5798 | long ru_idrss; | |
5799 | long ru_isrss; | |
5800 | long ru_minflt; | |
5801 | long ru_majflt; | |
5802 | long ru_nswap; | |
5803 | long ru_inblock; | |
5804 | long ru_oublock; | |
5805 | long ru_msgsnd; | |
5806 | long ru_msgrcv; | |
5807 | long ru_nsignals; | |
5808 | long ru_nvcsw; | |
5809 | long ru_nivcsw; | |
5810 | }; | |
5811 | ||
5812 | struct rlimit { | |
5813 | unsigned long rlim_cur; | |
5814 | unsigned long rlim_max; | |
5815 | }; | |
5816 | # 70 "include/linux/resource.h" | |
5817 | # 1 "include/asm/resource.h" 1 | |
5818 | ||
5819 | ||
5820 | ||
5821 | # 1 "include/asm-generic/resource.h" 1 | |
5822 | # 5 "include/asm/resource.h" 2 | |
5823 | # 71 "include/linux/resource.h" 2 | |
5824 | ||
5825 | int getrusage(struct task_struct *p, int who, struct rusage *ru); | |
5826 | # 83 "include/linux/sched.h" 2 | |
5827 | # 1 "include/linux/timer.h" 1 | |
5828 | ||
5829 | ||
5830 | ||
5831 | ||
5832 | ||
5833 | ||
5834 | ||
5835 | struct tvec_t_base_s; | |
5836 | ||
5837 | struct timer_list { | |
5838 | struct list_head entry; | |
5839 | unsigned long expires; | |
5840 | ||
5841 | void (*function)(unsigned long); | |
5842 | unsigned long data; | |
5843 | ||
5844 | struct tvec_t_base_s *base; | |
5845 | }; | |
5846 | ||
5847 | extern struct tvec_t_base_s boot_tvec_bases; | |
5848 | # 33 "include/linux/timer.h" | |
5849 | void init_timer(struct timer_list * timer); | |
5850 | ||
5851 | static inline __attribute__((always_inline)) void setup_timer(struct timer_list * timer, | |
5852 | void (*function)(unsigned long), | |
5853 | unsigned long data) | |
5854 | { | |
5855 | timer->function = function; | |
5856 | timer->data = data; | |
5857 | init_timer(timer); | |
5858 | } | |
5859 | # 54 "include/linux/timer.h" | |
5860 | static inline __attribute__((always_inline)) int timer_pending(const struct timer_list * timer) | |
5861 | { | |
5862 | return timer->entry.next != ((void *)0); | |
5863 | } | |
5864 | ||
5865 | extern void add_timer_on(struct timer_list *timer, int cpu); | |
5866 | extern int del_timer(struct timer_list * timer); | |
5867 | extern int __mod_timer(struct timer_list *timer, unsigned long expires); | |
5868 | extern int mod_timer(struct timer_list *timer, unsigned long expires); | |
5869 | ||
5870 | extern unsigned long next_timer_interrupt(void); | |
5871 | # 80 "include/linux/timer.h" | |
5872 | static inline __attribute__((always_inline)) void add_timer(struct timer_list *timer) | |
5873 | { | |
5874 | do { if (__builtin_expect(!!((timer_pending(timer))!=0), 0)) do { dump_stack(); printk("<4>" "\nkernel BUG at %s:%d!\n", "include/linux/timer.h", 82); panic("BUG!"); } while (0); } while(0); | |
5875 | __mod_timer(timer, timer->expires); | |
5876 | } | |
5877 | # 96 "include/linux/timer.h" | |
5878 | extern void init_timers(void); | |
5879 | extern void run_local_timers(void); | |
5880 | struct hrtimer; | |
5881 | extern int it_real_fn(struct hrtimer *); | |
5882 | # 84 "include/linux/sched.h" 2 | |
5883 | # 1 "include/linux/hrtimer.h" 1 | |
5884 | # 19 "include/linux/hrtimer.h" | |
5885 | # 1 "include/linux/ktime.h" 1 | |
5886 | # 46 "include/linux/ktime.h" | |
5887 | typedef union { | |
5888 | s64 tv64; | |
5889 | ||
5890 | struct { | |
5891 | ||
5892 | ||
5893 | ||
5894 | s32 nsec, sec; | |
5895 | ||
5896 | } tv; | |
5897 | ||
5898 | } ktime_t; | |
5899 | # 138 "include/linux/ktime.h" | |
5900 | static inline __attribute__((always_inline)) ktime_t ktime_set(const long secs, const unsigned long nsecs) | |
5901 | { | |
5902 | return (ktime_t) { .tv = { .sec = secs, .nsec = nsecs } }; | |
5903 | } | |
5904 | # 150 "include/linux/ktime.h" | |
5905 | static inline __attribute__((always_inline)) ktime_t ktime_sub(const ktime_t lhs, const ktime_t rhs) | |
5906 | { | |
5907 | ktime_t res; | |
5908 | ||
5909 | res.tv64 = lhs.tv64 - rhs.tv64; | |
5910 | if (res.tv.nsec < 0) | |
5911 | res.tv.nsec += 1000000000L; | |
5912 | ||
5913 | return res; | |
5914 | } | |
5915 | # 168 "include/linux/ktime.h" | |
5916 | static inline __attribute__((always_inline)) ktime_t ktime_add(const ktime_t add1, const ktime_t add2) | |
5917 | { | |
5918 | ktime_t res; | |
5919 | ||
5920 | res.tv64 = add1.tv64 + add2.tv64; | |
5921 | # 181 "include/linux/ktime.h" | |
5922 | if (res.tv.nsec >= 1000000000L) | |
5923 | res.tv64 += (u32)-1000000000L; | |
5924 | ||
5925 | return res; | |
5926 | } | |
5927 | # 194 "include/linux/ktime.h" | |
5928 | extern ktime_t ktime_add_ns(const ktime_t kt, u64 nsec); | |
5929 | ||
5930 | ||
5931 | ||
5932 | ||
5933 | ||
5934 | ||
5935 | ||
5936 | static inline __attribute__((always_inline)) ktime_t timespec_to_ktime(const struct timespec ts) | |
5937 | { | |
5938 | return (ktime_t) { .tv = { .sec = (s32)ts.tv_sec, | |
5939 | .nsec = (s32)ts.tv_nsec } }; | |
5940 | } | |
5941 | ||
5942 | ||
5943 | ||
5944 | ||
5945 | ||
5946 | ||
5947 | ||
5948 | static inline __attribute__((always_inline)) ktime_t timeval_to_ktime(const struct timeval tv) | |
5949 | { | |
5950 | return (ktime_t) { .tv = { .sec = (s32)tv.tv_sec, | |
5951 | .nsec = (s32)tv.tv_usec * 1000 } }; | |
5952 | } | |
5953 | ||
5954 | ||
5955 | ||
5956 | ||
5957 | ||
5958 | ||
5959 | ||
5960 | static inline __attribute__((always_inline)) struct timespec ktime_to_timespec(const ktime_t kt) | |
5961 | { | |
5962 | return (struct timespec) { .tv_sec = (time_t) kt.tv.sec, | |
5963 | .tv_nsec = (long) kt.tv.nsec }; | |
5964 | } | |
5965 | ||
5966 | ||
5967 | ||
5968 | ||
5969 | ||
5970 | ||
5971 | ||
5972 | static inline __attribute__((always_inline)) struct timeval ktime_to_timeval(const ktime_t kt) | |
5973 | { | |
5974 | return (struct timeval) { | |
5975 | .tv_sec = (time_t) kt.tv.sec, | |
5976 | .tv_usec = (suseconds_t) (kt.tv.nsec / 1000L) }; | |
5977 | } | |
5978 | ||
5979 | ||
5980 | ||
5981 | ||
5982 | ||
5983 | ||
5984 | ||
5985 | static inline __attribute__((always_inline)) u64 ktime_to_ns(const ktime_t kt) | |
5986 | { | |
5987 | return (u64) kt.tv.sec * 1000000000L + kt.tv.nsec; | |
5988 | } | |
5989 | # 268 "include/linux/ktime.h" | |
5990 | extern void ktime_get_ts(struct timespec *ts); | |
5991 | # 20 "include/linux/hrtimer.h" 2 | |
5992 | ||
5993 | ||
5994 | ||
5995 | ||
5996 | ||
5997 | ||
5998 | ||
5999 | enum hrtimer_mode { | |
6000 | HRTIMER_ABS, | |
6001 | HRTIMER_REL, | |
6002 | }; | |
6003 | ||
6004 | enum hrtimer_restart { | |
6005 | HRTIMER_NORESTART, | |
6006 | HRTIMER_RESTART, | |
6007 | }; | |
6008 | ||
6009 | ||
6010 | ||
6011 | struct hrtimer_base; | |
6012 | # 52 "include/linux/hrtimer.h" | |
6013 | struct hrtimer { | |
6014 | struct rb_node node; | |
6015 | ktime_t expires; | |
6016 | int (*function)(struct hrtimer *); | |
6017 | struct hrtimer_base *base; | |
6018 | }; | |
6019 | # 66 "include/linux/hrtimer.h" | |
6020 | struct hrtimer_sleeper { | |
6021 | struct hrtimer timer; | |
6022 | struct task_struct *task; | |
6023 | }; | |
6024 | # 85 "include/linux/hrtimer.h" | |
6025 | struct hrtimer_base { | |
6026 | clockid_t index; | |
6027 | spinlock_t lock; | |
6028 | struct rb_root active; | |
6029 | struct rb_node *first; | |
6030 | ktime_t resolution; | |
6031 | ktime_t (*get_time)(void); | |
6032 | ktime_t (*get_softirq_time)(void); | |
6033 | struct hrtimer *curr_timer; | |
6034 | ktime_t softirq_time; | |
6035 | struct lock_class_key lock_key; | |
6036 | }; | |
6037 | # 108 "include/linux/hrtimer.h" | |
6038 | extern void hrtimer_init(struct hrtimer *timer, clockid_t which_clock, | |
6039 | enum hrtimer_mode mode); | |
6040 | ||
6041 | ||
6042 | extern int hrtimer_start(struct hrtimer *timer, ktime_t tim, | |
6043 | const enum hrtimer_mode mode); | |
6044 | extern int hrtimer_cancel(struct hrtimer *timer); | |
6045 | extern int hrtimer_try_to_cancel(struct hrtimer *timer); | |
6046 | ||
6047 | ||
6048 | ||
6049 | ||
6050 | extern ktime_t hrtimer_get_remaining(const struct hrtimer *timer); | |
6051 | extern int hrtimer_get_res(const clockid_t which_clock, struct timespec *tp); | |
6052 | ||
6053 | ||
6054 | ||
6055 | ||
6056 | ||
6057 | static inline __attribute__((always_inline)) int hrtimer_active(const struct hrtimer *timer) | |
6058 | { | |
6059 | return ((struct rb_node *)((&timer->node)->rb_parent_color & ~3)) != &timer->node; | |
6060 | } | |
6061 | ||
6062 | ||
6063 | extern unsigned long | |
6064 | hrtimer_forward(struct hrtimer *timer, ktime_t now, ktime_t interval); | |
6065 | ||
6066 | ||
6067 | extern long hrtimer_nanosleep(struct timespec *rqtp, | |
6068 | struct timespec *rmtp, | |
6069 | const enum hrtimer_mode mode, | |
6070 | const clockid_t clockid); | |
6071 | extern long hrtimer_nanosleep_restart(struct restart_block *restart_block); | |
6072 | ||
6073 | extern void hrtimer_init_sleeper(struct hrtimer_sleeper *sl, | |
6074 | struct task_struct *tsk); | |
6075 | ||
6076 | ||
6077 | extern void hrtimer_run_queues(void); | |
6078 | ||
6079 | ||
6080 | extern void __attribute__ ((__section__ (".init.text"))) hrtimers_init(void); | |
6081 | # 85 "include/linux/sched.h" 2 | |
6082 | ||
6083 | ||
6084 | ||
6085 | struct exec_domain; | |
6086 | struct futex_pi_state; | |
6087 | # 107 "include/linux/sched.h" | |
6088 | extern unsigned long avenrun[]; | |
6089 | # 121 "include/linux/sched.h" | |
6090 | extern unsigned long total_forks; | |
6091 | extern int nr_threads; | |
6092 | extern __typeof__(unsigned long) per_cpu__process_counts; | |
6093 | extern int nr_processes(void); | |
6094 | extern unsigned long nr_running(void); | |
6095 | extern unsigned long nr_uninterruptible(void); | |
6096 | extern unsigned long nr_active(void); | |
6097 | extern unsigned long nr_iowait(void); | |
6098 | extern unsigned long weighted_cpuload(const int cpu); | |
6099 | # 186 "include/linux/sched.h" | |
6100 | extern rwlock_t tasklist_lock; | |
6101 | extern spinlock_t mmlist_lock; | |
6102 | ||
6103 | struct task_struct; | |
6104 | ||
6105 | extern void sched_init(void); | |
6106 | extern void sched_init_smp(void); | |
6107 | extern void init_idle(struct task_struct *idle, int cpu); | |
6108 | ||
6109 | extern cpumask_t nohz_cpu_mask; | |
6110 | ||
6111 | extern void show_state(void); | |
6112 | extern void show_regs(struct pt_regs *); | |
6113 | ||
6114 | ||
6115 | ||
6116 | ||
6117 | ||
6118 | ||
6119 | extern void show_stack(struct task_struct *task, unsigned long *sp); | |
6120 | ||
6121 | void io_schedule(void); | |
6122 | long io_schedule_timeout(long timeout); | |
6123 | ||
6124 | extern void cpu_init (void); | |
6125 | extern void trap_init(void); | |
6126 | extern void update_process_times(int user); | |
6127 | extern void scheduler_tick(void); | |
6128 | ||
6129 | ||
6130 | extern void softlockup_tick(void); | |
6131 | extern void spawn_softlockup_task(void); | |
6132 | extern void touch_softlockup_watchdog(void); | |
6133 | # 235 "include/linux/sched.h" | |
6134 | extern int in_sched_functions(unsigned long addr); | |
6135 | ||
6136 | ||
6137 | extern signed long schedule_timeout(signed long timeout); | |
6138 | extern signed long schedule_timeout_interruptible(signed long timeout); | |
6139 | extern signed long schedule_timeout_uninterruptible(signed long timeout); | |
6140 | void schedule(void); | |
6141 | ||
6142 | struct nsproxy; | |
6143 | ||
6144 | ||
6145 | ||
6146 | ||
6147 | extern int sysctl_max_map_count; | |
6148 | ||
6149 | # 1 "include/linux/aio.h" 1 | |
6150 | ||
6151 | ||
6152 | ||
6153 | ||
6154 | # 1 "include/linux/workqueue.h" 1 | |
6155 | # 12 "include/linux/workqueue.h" | |
6156 | struct workqueue_struct; | |
6157 | ||
6158 | struct work_struct { | |
6159 | unsigned long pending; | |
6160 | struct list_head entry; | |
6161 | void (*func)(void *); | |
6162 | void *data; | |
6163 | void *wq_data; | |
6164 | struct timer_list timer; | |
6165 | }; | |
6166 | ||
6167 | struct execute_work { | |
6168 | struct work_struct work; | |
6169 | }; | |
6170 | # 57 "include/linux/workqueue.h" | |
6171 | extern struct workqueue_struct *__create_workqueue(const char *name, | |
6172 | int singlethread); | |
6173 | ||
6174 | ||
6175 | ||
6176 | extern void destroy_workqueue(struct workqueue_struct *wq); | |
6177 | ||
6178 | extern int queue_work(struct workqueue_struct *wq, struct work_struct *work); | |
6179 | extern int queue_delayed_work(struct workqueue_struct *wq, struct work_struct *work, unsigned long delay); | |
6180 | extern int queue_delayed_work_on(int cpu, struct workqueue_struct *wq, | |
6181 | struct work_struct *work, unsigned long delay); | |
6182 | extern void flush_workqueue(struct workqueue_struct *wq); | |
6183 | ||
6184 | extern int schedule_work(struct work_struct *work); | |
6185 | extern int schedule_delayed_work(struct work_struct *work, unsigned long delay); | |
6186 | ||
6187 | extern int schedule_delayed_work_on(int cpu, struct work_struct *work, unsigned long delay); | |
6188 | extern int schedule_on_each_cpu(void (*func)(void *info), void *info); | |
6189 | extern void flush_scheduled_work(void); | |
6190 | extern int current_is_keventd(void); | |
6191 | extern int keventd_up(void); | |
6192 | ||
6193 | extern void init_workqueues(void); | |
6194 | void cancel_rearming_delayed_work(struct work_struct *work); | |
6195 | void cancel_rearming_delayed_workqueue(struct workqueue_struct *, | |
6196 | struct work_struct *); | |
6197 | int execute_in_process_context(void (*fn)(void *), void *, | |
6198 | struct execute_work *); | |
6199 | ||
6200 | ||
6201 | ||
6202 | ||
6203 | ||
6204 | ||
6205 | static inline __attribute__((always_inline)) int cancel_delayed_work(struct work_struct *work) | |
6206 | { | |
6207 | int ret; | |
6208 | ||
6209 | ret = del_timer(&work->timer); | |
6210 | if (ret) | |
6211 | clear_bit(0, &work->pending); | |
6212 | return ret; | |
6213 | } | |
6214 | # 6 "include/linux/aio.h" 2 | |
6215 | # 1 "include/linux/aio_abi.h" 1 | |
6216 | # 32 "include/linux/aio_abi.h" | |
6217 | typedef unsigned long aio_context_t; | |
6218 | ||
6219 | enum { | |
6220 | IOCB_CMD_PREAD = 0, | |
6221 | IOCB_CMD_PWRITE = 1, | |
6222 | IOCB_CMD_FSYNC = 2, | |
6223 | IOCB_CMD_FDSYNC = 3, | |
6224 | ||
6225 | ||
6226 | ||
6227 | ||
6228 | IOCB_CMD_NOOP = 6, | |
6229 | IOCB_CMD_PREADV = 7, | |
6230 | IOCB_CMD_PWRITEV = 8, | |
6231 | }; | |
6232 | ||
6233 | ||
6234 | struct io_event { | |
6235 | __u64 data; | |
6236 | __u64 obj; | |
6237 | __s64 res; | |
6238 | __s64 res2; | |
6239 | }; | |
6240 | # 70 "include/linux/aio_abi.h" | |
6241 | struct iocb { | |
6242 | ||
6243 | __u64 aio_data; | |
6244 | __u32 aio_key, aio_reserved1; | |
6245 | ||
6246 | ||
6247 | ||
6248 | __u16 aio_lio_opcode; | |
6249 | __s16 aio_reqprio; | |
6250 | __u32 aio_fildes; | |
6251 | ||
6252 | __u64 aio_buf; | |
6253 | __u64 aio_nbytes; | |
6254 | __s64 aio_offset; | |
6255 | ||
6256 | ||
6257 | __u64 aio_reserved2; | |
6258 | __u64 aio_reserved3; | |
6259 | }; | |
6260 | # 7 "include/linux/aio.h" 2 | |
6261 | # 1 "include/linux/uio.h" 1 | |
6262 | # 20 "include/linux/uio.h" | |
6263 | struct iovec | |
6264 | { | |
6265 | void *iov_base; | |
6266 | __kernel_size_t iov_len; | |
6267 | }; | |
6268 | ||
6269 | ||
6270 | ||
6271 | struct kvec { | |
6272 | void *iov_base; | |
6273 | size_t iov_len; | |
6274 | }; | |
6275 | # 54 "include/linux/uio.h" | |
6276 | static inline __attribute__((always_inline)) size_t iov_length(const struct iovec *iov, unsigned long nr_segs) | |
6277 | { | |
6278 | unsigned long seg; | |
6279 | size_t ret = 0; | |
6280 | ||
6281 | for (seg = 0; seg < nr_segs; seg++) | |
6282 | ret += iov[seg].iov_len; | |
6283 | return ret; | |
6284 | } | |
6285 | ||
6286 | unsigned long iov_shorten(struct iovec *iov, unsigned long nr_segs, size_t to); | |
6287 | # 8 "include/linux/aio.h" 2 | |
6288 | ||
6289 | ||
6290 | ||
6291 | ||
6292 | ||
6293 | ||
6294 | ||
6295 | struct kioctx; | |
6296 | # 87 "include/linux/aio.h" | |
6297 | struct kiocb { | |
6298 | struct list_head ki_run_list; | |
6299 | long ki_flags; | |
6300 | int ki_users; | |
6301 | unsigned ki_key; | |
6302 | ||
6303 | struct file *ki_filp; | |
6304 | struct kioctx *ki_ctx; | |
6305 | int (*ki_cancel)(struct kiocb *, struct io_event *); | |
6306 | ssize_t (*ki_retry)(struct kiocb *); | |
6307 | void (*ki_dtor)(struct kiocb *); | |
6308 | ||
6309 | union { | |
6310 | void *user; | |
6311 | struct task_struct *tsk; | |
6312 | } ki_obj; | |
6313 | ||
6314 | __u64 ki_user_data; | |
6315 | wait_queue_t ki_wait; | |
6316 | loff_t ki_pos; | |
6317 | ||
6318 | void *private; | |
6319 | ||
6320 | unsigned short ki_opcode; | |
6321 | size_t ki_nbytes; | |
6322 | char *ki_buf; | |
6323 | size_t ki_left; | |
6324 | long ki_retried; | |
6325 | struct iovec ki_inline_vec; | |
6326 | struct iovec *ki_iovec; | |
6327 | unsigned long ki_nr_segs; | |
6328 | unsigned long ki_cur_seg; | |
6329 | ||
6330 | struct list_head ki_list; | |
6331 | ||
6332 | }; | |
6333 | # 144 "include/linux/aio.h" | |
6334 | struct aio_ring { | |
6335 | unsigned id; | |
6336 | unsigned nr; | |
6337 | unsigned head; | |
6338 | unsigned tail; | |
6339 | ||
6340 | unsigned magic; | |
6341 | unsigned compat_features; | |
6342 | unsigned incompat_features; | |
6343 | unsigned header_length; | |
6344 | ||
6345 | ||
6346 | struct io_event io_events[0]; | |
6347 | }; | |
6348 | ||
6349 | ||
6350 | ||
6351 | ||
6352 | struct aio_ring_info { | |
6353 | unsigned long mmap_base; | |
6354 | unsigned long mmap_size; | |
6355 | ||
6356 | struct page **ring_pages; | |
6357 | spinlock_t ring_lock; | |
6358 | long nr_pages; | |
6359 | ||
6360 | unsigned nr, tail; | |
6361 | ||
6362 | struct page *internal_pages[8]; | |
6363 | }; | |
6364 | ||
6365 | struct kioctx { | |
6366 | atomic_t users; | |
6367 | int dead; | |
6368 | struct mm_struct *mm; | |
6369 | ||
6370 | ||
6371 | unsigned long user_id; | |
6372 | struct kioctx *next; | |
6373 | ||
6374 | wait_queue_head_t wait; | |
6375 | ||
6376 | spinlock_t ctx_lock; | |
6377 | ||
6378 | int reqs_active; | |
6379 | struct list_head active_reqs; | |
6380 | struct list_head run_list; | |
6381 | ||
6382 | ||
6383 | unsigned max_reqs; | |
6384 | ||
6385 | struct aio_ring_info ring_info; | |
6386 | ||
6387 | struct work_struct wq; | |
6388 | }; | |
6389 | ||
6390 | ||
6391 | extern unsigned aio_max_size; | |
6392 | ||
6393 | extern ssize_t wait_on_sync_kiocb(struct kiocb *iocb); | |
6394 | extern int aio_put_req(struct kiocb *iocb); | |
6395 | extern void kick_iocb(struct kiocb *iocb); | |
6396 | extern int aio_complete(struct kiocb *iocb, long res, long res2); | |
6397 | extern void __put_ioctx(struct kioctx *ctx); | |
6398 | struct mm_struct; | |
6399 | extern void exit_aio(struct mm_struct *mm); | |
6400 | extern struct kioctx *lookup_ioctx(unsigned long ctx_id); | |
6401 | extern int io_submit_one(struct kioctx *ctx, struct iocb *user_iocb, struct iocb *iocb); | |
6402 | ||
6403 | ||
6404 | ||
6405 | struct kioctx *lookup_ioctx(unsigned long ctx_id); | |
6406 | int io_submit_one(struct kioctx *ctx, struct iocb *user_iocb, struct iocb *iocb); | |
6407 | # 245 "include/linux/aio.h" | |
6408 | static inline __attribute__((always_inline)) struct kiocb *list_kiocb(struct list_head *h) | |
6409 | { | |
6410 | return ({ const typeof( ((struct kiocb *)0)->ki_list ) *__mptr = (h); (struct kiocb *)( (char *)__mptr - __builtin_offsetof(struct kiocb,ki_list) );}); | |
6411 | } | |
6412 | ||
6413 | ||
6414 | extern unsigned long aio_nr; | |
6415 | extern unsigned long aio_max_nr; | |
6416 | # 251 "include/linux/sched.h" 2 | |
6417 | ||
6418 | extern unsigned long | |
6419 | arch_get_unmapped_area(struct file *, unsigned long, unsigned long, | |
6420 | unsigned long, unsigned long); | |
6421 | extern unsigned long | |
6422 | arch_get_unmapped_area_topdown(struct file *filp, unsigned long addr, | |
6423 | unsigned long len, unsigned long pgoff, | |
6424 | unsigned long flags); | |
6425 | extern void arch_unmap_area(struct mm_struct *, unsigned long); | |
6426 | extern void arch_unmap_area_topdown(struct mm_struct *, unsigned long); | |
6427 | # 284 "include/linux/sched.h" | |
6428 | typedef unsigned long mm_counter_t; | |
6429 | # 300 "include/linux/sched.h" | |
6430 | struct mm_struct { | |
6431 | struct vm_area_struct * mmap; | |
6432 | struct rb_root mm_rb; | |
6433 | struct vm_area_struct * mmap_cache; | |
6434 | unsigned long (*get_unmapped_area) (struct file *filp, | |
6435 | unsigned long addr, unsigned long len, | |
6436 | unsigned long pgoff, unsigned long flags); | |
6437 | void (*unmap_area) (struct mm_struct *mm, unsigned long addr); | |
6438 | unsigned long mmap_base; | |
6439 | unsigned long task_size; | |
6440 | unsigned long cached_hole_size; | |
6441 | unsigned long free_area_cache; | |
6442 | pgd_t * pgd; | |
6443 | atomic_t mm_users; | |
6444 | atomic_t mm_count; | |
6445 | int map_count; | |
6446 | struct rw_semaphore mmap_sem; | |
6447 | spinlock_t page_table_lock; | |
6448 | ||
6449 | struct list_head mmlist; | |
6450 | ||
6451 | ||
6452 | ||
6453 | ||
6454 | ||
6455 | ||
6456 | ||
6457 | mm_counter_t _file_rss; | |
6458 | mm_counter_t _anon_rss; | |
6459 | ||
6460 | unsigned long hiwater_rss; | |
6461 | unsigned long hiwater_vm; | |
6462 | ||
6463 | unsigned long total_vm, locked_vm, shared_vm, exec_vm; | |
6464 | unsigned long stack_vm, reserved_vm, def_flags, nr_ptes; | |
6465 | unsigned long start_code, end_code, start_data, end_data; | |
6466 | unsigned long start_brk, brk, start_stack; | |
6467 | unsigned long arg_start, arg_end, env_start, env_end; | |
6468 | ||
6469 | unsigned long saved_auxv[44]; | |
6470 | ||
6471 | unsigned dumpable:2; | |
6472 | cpumask_t cpu_vm_mask; | |
6473 | ||
6474 | ||
6475 | mm_context_t context; | |
6476 | ||
6477 | ||
6478 | unsigned long swap_token_time; | |
6479 | char recent_pagein; | |
6480 | ||
6481 | ||
6482 | int core_waiters; | |
6483 | struct completion *core_startup_done, core_done; | |
6484 | ||
6485 | ||
6486 | rwlock_t ioctx_list_lock; | |
6487 | struct kioctx *ioctx_list; | |
6488 | }; | |
6489 | ||
6490 | struct sighand_struct { | |
6491 | atomic_t count; | |
6492 | struct k_sigaction action[64]; | |
6493 | spinlock_t siglock; | |
6494 | }; | |
6495 | ||
6496 | struct pacct_struct { | |
6497 | int ac_flag; | |
6498 | long ac_exitcode; | |
6499 | unsigned long ac_mem; | |
6500 | cputime_t ac_utime, ac_stime; | |
6501 | unsigned long ac_minflt, ac_majflt; | |
6502 | }; | |
6503 | # 381 "include/linux/sched.h" | |
6504 | struct signal_struct { | |
6505 | atomic_t count; | |
6506 | atomic_t live; | |
6507 | ||
6508 | wait_queue_head_t wait_chldexit; | |
6509 | ||
6510 | ||
6511 | struct task_struct *curr_target; | |
6512 | ||
6513 | ||
6514 | struct sigpending shared_pending; | |
6515 | ||
6516 | ||
6517 | int group_exit_code; | |
6518 | ||
6519 | ||
6520 | ||
6521 | ||
6522 | ||
6523 | struct task_struct *group_exit_task; | |
6524 | int notify_count; | |
6525 | ||
6526 | ||
6527 | int group_stop_count; | |
6528 | unsigned int flags; | |
6529 | ||
6530 | ||
6531 | struct list_head posix_timers; | |
6532 | ||
6533 | ||
6534 | struct hrtimer real_timer; | |
6535 | struct task_struct *tsk; | |
6536 | ktime_t it_real_incr; | |
6537 | ||
6538 | ||
6539 | cputime_t it_prof_expires, it_virt_expires; | |
6540 | cputime_t it_prof_incr, it_virt_incr; | |
6541 | ||
6542 | ||
6543 | pid_t pgrp; | |
6544 | pid_t tty_old_pgrp; | |
6545 | pid_t session; | |
6546 | ||
6547 | int leader; | |
6548 | ||
6549 | struct tty_struct *tty; | |
6550 | ||
6551 | ||
6552 | ||
6553 | ||
6554 | ||
6555 | ||
6556 | ||
6557 | cputime_t utime, stime, cutime, cstime; | |
6558 | unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw; | |
6559 | unsigned long min_flt, maj_flt, cmin_flt, cmaj_flt; | |
6560 | ||
6561 | ||
6562 | ||
6563 | ||
6564 | ||
6565 | ||
6566 | ||
6567 | unsigned long long sched_time; | |
6568 | # 455 "include/linux/sched.h" | |
6569 | struct rlimit rlim[15]; | |
6570 | ||
6571 | struct list_head cpu_timers[3]; | |
6572 | # 471 "include/linux/sched.h" | |
6573 | }; | |
6574 | # 514 "include/linux/sched.h" | |
6575 | struct user_struct { | |
6576 | atomic_t __count; | |
6577 | atomic_t processes; | |
6578 | atomic_t files; | |
6579 | atomic_t sigpending; | |
6580 | ||
6581 | ||
6582 | ||
6583 | ||
6584 | ||
6585 | unsigned long mq_bytes; | |
6586 | unsigned long locked_shm; | |
6587 | ||
6588 | ||
6589 | ||
6590 | ||
6591 | ||
6592 | ||
6593 | ||
6594 | struct list_head uidhash_list; | |
6595 | uid_t uid; | |
6596 | }; | |
6597 | ||
6598 | extern struct user_struct *find_user(uid_t); | |
6599 | ||
6600 | extern struct user_struct root_user; | |
6601 | ||
6602 | ||
6603 | struct backing_dev_info; | |
6604 | struct reclaim_state; | |
6605 | # 592 "include/linux/sched.h" | |
6606 | static inline __attribute__((always_inline)) int sched_info_on(void) | |
6607 | { | |
6608 | ||
6609 | ||
6610 | ||
6611 | ||
6612 | ||
6613 | ||
6614 | return 0; | |
6615 | ||
6616 | } | |
6617 | ||
6618 | enum idle_type | |
6619 | { | |
6620 | SCHED_IDLE, | |
6621 | NOT_IDLE, | |
6622 | NEWLY_IDLE, | |
6623 | MAX_IDLE_TYPES | |
6624 | }; | |
6625 | # 721 "include/linux/sched.h" | |
6626 | struct io_context; | |
6627 | struct cpuset; | |
6628 | ||
6629 | ||
6630 | ||
6631 | struct group_info { | |
6632 | int ngroups; | |
6633 | atomic_t usage; | |
6634 | gid_t small_block[32]; | |
6635 | int nblocks; | |
6636 | gid_t *blocks[0]; | |
6637 | }; | |
6638 | # 749 "include/linux/sched.h" | |
6639 | extern struct group_info *groups_alloc(int gidsetsize); | |
6640 | extern void groups_free(struct group_info *group_info); | |
6641 | extern int set_current_groups(struct group_info *group_info); | |
6642 | extern int groups_search(struct group_info *group_info, gid_t grp); | |
6643 | ||
6644 | ||
6645 | ||
6646 | ||
6647 | ||
6648 | ||
6649 | ||
6650 | static inline __attribute__((always_inline)) void prefetch_stack(struct task_struct *t) { } | |
6651 | ||
6652 | ||
6653 | struct audit_context; | |
6654 | struct mempolicy; | |
6655 | struct pipe_inode_info; | |
6656 | struct uts_namespace; | |
6657 | ||
6658 | enum sleep_type { | |
6659 | SLEEP_NORMAL, | |
6660 | SLEEP_NONINTERACTIVE, | |
6661 | SLEEP_INTERACTIVE, | |
6662 | SLEEP_INTERRUPTED, | |
6663 | }; | |
6664 | ||
6665 | struct prio_array; | |
6666 | ||
6667 | struct task_struct { | |
6668 | volatile long state; | |
6669 | struct thread_info *thread_info; | |
6670 | atomic_t usage; | |
6671 | unsigned long flags; | |
6672 | unsigned long ptrace; | |
6673 | ||
6674 | int lock_depth; | |
6675 | ||
6676 | ||
6677 | ||
6678 | ||
6679 | ||
6680 | ||
6681 | int load_weight; | |
6682 | int prio, static_prio, normal_prio; | |
6683 | struct list_head run_list; | |
6684 | struct prio_array *array; | |
6685 | ||
6686 | unsigned short ioprio; | |
6687 | ||
6688 | ||
6689 | ||
6690 | unsigned long sleep_avg; | |
6691 | unsigned long long timestamp, last_ran; | |
6692 | unsigned long long sched_time; | |
6693 | enum sleep_type sleep_type; | |
6694 | ||
6695 | unsigned long policy; | |
6696 | cpumask_t cpus_allowed; | |
6697 | unsigned int time_slice, first_time_slice; | |
6698 | ||
6699 | ||
6700 | ||
6701 | ||
6702 | ||
6703 | struct list_head tasks; | |
6704 | ||
6705 | ||
6706 | ||
6707 | ||
6708 | struct list_head ptrace_children; | |
6709 | struct list_head ptrace_list; | |
6710 | ||
6711 | struct mm_struct *mm, *active_mm; | |
6712 | ||
6713 | ||
6714 | struct linux_binfmt *binfmt; | |
6715 | long exit_state; | |
6716 | int exit_code, exit_signal; | |
6717 | int pdeath_signal; | |
6718 | ||
6719 | unsigned long personality; | |
6720 | unsigned did_exec:1; | |
6721 | pid_t pid; | |
6722 | pid_t tgid; | |
6723 | # 843 "include/linux/sched.h" | |
6724 | struct task_struct *real_parent; | |
6725 | struct task_struct *parent; | |
6726 | ||
6727 | ||
6728 | ||
6729 | ||
6730 | struct list_head children; | |
6731 | struct list_head sibling; | |
6732 | struct task_struct *group_leader; | |
6733 | ||
6734 | ||
6735 | struct pid_link pids[PIDTYPE_MAX]; | |
6736 | struct list_head thread_group; | |
6737 | ||
6738 | struct completion *vfork_done; | |
6739 | int *set_child_tid; | |
6740 | int *clear_child_tid; | |
6741 | ||
6742 | unsigned long rt_priority; | |
6743 | cputime_t utime, stime; | |
6744 | unsigned long nvcsw, nivcsw; | |
6745 | struct timespec start_time; | |
6746 | ||
6747 | unsigned long min_flt, maj_flt; | |
6748 | ||
6749 | cputime_t it_prof_expires, it_virt_expires; | |
6750 | unsigned long long it_sched_expires; | |
6751 | struct list_head cpu_timers[3]; | |
6752 | ||
6753 | ||
6754 | uid_t uid,euid,suid,fsuid; | |
6755 | gid_t gid,egid,sgid,fsgid; | |
6756 | struct group_info *group_info; | |
6757 | kernel_cap_t cap_effective, cap_inheritable, cap_permitted; | |
6758 | unsigned keep_capabilities:1; | |
6759 | struct user_struct *user; | |
6760 | # 892 "include/linux/sched.h" | |
6761 | unsigned char fpu_counter; | |
6762 | int oomkilladj; | |
6763 | char comm[16]; | |
6764 | ||
6765 | ||
6766 | ||
6767 | ||
6768 | int link_count, total_link_count; | |
6769 | ||
6770 | ||
6771 | ||
6772 | ||
6773 | ||
6774 | struct thread_struct thread; | |
6775 | ||
6776 | struct fs_struct *fs; | |
6777 | ||
6778 | struct files_struct *files; | |
6779 | ||
6780 | struct nsproxy *nsproxy; | |
6781 | ||
6782 | struct signal_struct *signal; | |
6783 | struct sighand_struct *sighand; | |
6784 | ||
6785 | sigset_t blocked, real_blocked; | |
6786 | sigset_t saved_sigmask; | |
6787 | struct sigpending pending; | |
6788 | ||
6789 | unsigned long sas_ss_sp; | |
6790 | size_t sas_ss_size; | |
6791 | int (*notifier)(void *priv); | |
6792 | void *notifier_data; | |
6793 | sigset_t *notifier_mask; | |
6794 | ||
6795 | void *security; | |
6796 | struct audit_context *audit_context; | |
6797 | seccomp_t seccomp; | |
6798 | ||
6799 | ||
6800 | u32 parent_exec_id; | |
6801 | u32 self_exec_id; | |
6802 | ||
6803 | spinlock_t alloc_lock; | |
6804 | ||
6805 | ||
6806 | spinlock_t pi_lock; | |
6807 | ||
6808 | ||
6809 | ||
6810 | struct plist_head pi_waiters; | |
6811 | ||
6812 | struct rt_mutex_waiter *pi_blocked_on; | |
6813 | # 974 "include/linux/sched.h" | |
6814 | void *journal_info; | |
6815 | ||
6816 | ||
6817 | struct reclaim_state *reclaim_state; | |
6818 | ||
6819 | struct backing_dev_info *backing_dev_info; | |
6820 | ||
6821 | struct io_context *io_context; | |
6822 | ||
6823 | unsigned long ptrace_message; | |
6824 | siginfo_t *last_siginfo; | |
6825 | ||
6826 | ||
6827 | ||
6828 | ||
6829 | ||
6830 | ||
6831 | wait_queue_t *io_wait; | |
6832 | ||
6833 | u64 rchar, wchar, syscr, syscw; | |
6834 | # 1009 "include/linux/sched.h" | |
6835 | struct robust_list_head *robust_list; | |
6836 | ||
6837 | ||
6838 | ||
6839 | struct list_head pi_state_list; | |
6840 | struct futex_pi_state *pi_state_cache; | |
6841 | ||
6842 | atomic_t fs_excl; | |
6843 | struct rcu_head rcu; | |
6844 | ||
6845 | ||
6846 | ||
6847 | ||
6848 | struct pipe_inode_info *splice_pipe; | |
6849 | ||
6850 | ||
6851 | ||
6852 | }; | |
6853 | ||
6854 | static inline __attribute__((always_inline)) pid_t process_group(struct task_struct *tsk) | |
6855 | { | |
6856 | return tsk->signal->pgrp; | |
6857 | } | |
6858 | ||
6859 | static inline __attribute__((always_inline)) struct pid *task_pid(struct task_struct *task) | |
6860 | { | |
6861 | return task->pids[PIDTYPE_PID].pid; | |
6862 | } | |
6863 | ||
6864 | static inline __attribute__((always_inline)) struct pid *task_tgid(struct task_struct *task) | |
6865 | { | |
6866 | return task->group_leader->pids[PIDTYPE_PID].pid; | |
6867 | } | |
6868 | ||
6869 | static inline __attribute__((always_inline)) struct pid *task_pgrp(struct task_struct *task) | |
6870 | { | |
6871 | return task->group_leader->pids[PIDTYPE_PGID].pid; | |
6872 | } | |
6873 | ||
6874 | static inline __attribute__((always_inline)) struct pid *task_session(struct task_struct *task) | |
6875 | { | |
6876 | return task->group_leader->pids[PIDTYPE_SID].pid; | |
6877 | } | |
6878 | # 1061 "include/linux/sched.h" | |
6879 | static inline __attribute__((always_inline)) int pid_alive(struct task_struct *p) | |
6880 | { | |
6881 | return p->pids[PIDTYPE_PID].pid != ((void *)0); | |
6882 | } | |
6883 | ||
6884 | ||
6885 | ||
6886 | ||
6887 | ||
6888 | ||
6889 | ||
6890 | static inline __attribute__((always_inline)) int is_init(struct task_struct *tsk) | |
6891 | { | |
6892 | return tsk->pid == 1; | |
6893 | } | |
6894 | ||
6895 | extern struct pid *cad_pid; | |
6896 | ||
6897 | extern void free_task(struct task_struct *tsk); | |
6898 | ||
6899 | ||
6900 | extern void __put_task_struct(struct task_struct *t); | |
6901 | ||
6902 | static inline __attribute__((always_inline)) void put_task_struct(struct task_struct *t) | |
6903 | { | |
6904 | if ((atomic_sub_return(1, (&t->usage)) == 0)) | |
6905 | __put_task_struct(t); | |
6906 | } | |
6907 | # 1147 "include/linux/sched.h" | |
6908 | static inline __attribute__((always_inline)) int set_cpus_allowed(struct task_struct *p, cpumask_t new_mask) | |
6909 | { | |
6910 | if (!(__builtin_constant_p((0)) ? __constant_test_bit(((0)),((new_mask).bits)) : __test_bit(((0)),((new_mask).bits)))) | |
6911 | return -22; | |
6912 | return 0; | |
6913 | } | |
6914 | ||
6915 | ||
6916 | extern unsigned long long sched_clock(void); | |
6917 | extern unsigned long long | |
6918 | current_sched_time(const struct task_struct *current_task); | |
6919 | # 1169 "include/linux/sched.h" | |
6920 | static inline __attribute__((always_inline)) void idle_task_exit(void) {} | |
6921 | ||
6922 | ||
6923 | extern void sched_idle_next(void); | |
6924 | ||
6925 | ||
6926 | extern int rt_mutex_getprio(struct task_struct *p); | |
6927 | extern void rt_mutex_setprio(struct task_struct *p, int prio); | |
6928 | extern void rt_mutex_adjust_pi(struct task_struct *p); | |
6929 | # 1186 "include/linux/sched.h" | |
6930 | extern void set_user_nice(struct task_struct *p, long nice); | |
6931 | extern int task_prio(const struct task_struct *p); | |
6932 | extern int task_nice(const struct task_struct *p); | |
6933 | extern int can_nice(const struct task_struct *p, const int nice); | |
6934 | extern int task_curr(const struct task_struct *p); | |
6935 | extern int idle_cpu(int cpu); | |
6936 | extern int sched_setscheduler(struct task_struct *, int, struct sched_param *); | |
6937 | extern struct task_struct *idle_task(int cpu); | |
6938 | extern struct task_struct *curr_task(int cpu); | |
6939 | extern void set_curr_task(int cpu, struct task_struct *p); | |
6940 | ||
6941 | void yield(void); | |
6942 | ||
6943 | ||
6944 | ||
6945 | ||
6946 | extern struct exec_domain default_exec_domain; | |
6947 | ||
6948 | union thread_union { | |
6949 | struct thread_info thread_info; | |
6950 | unsigned long stack[8192/sizeof(long)]; | |
6951 | }; | |
6952 | ||
6953 | ||
6954 | static inline __attribute__((always_inline)) int kstack_end(void *addr) | |
6955 | { | |
6956 | ||
6957 | ||
6958 | ||
6959 | return !(((unsigned long)addr+sizeof(void*)-1) & (8192 -sizeof(void*))); | |
6960 | } | |
6961 | ||
6962 | ||
6963 | extern union thread_union init_thread_union; | |
6964 | extern struct task_struct init_task; | |
6965 | ||
6966 | extern struct mm_struct init_mm; | |
6967 | ||
6968 | ||
6969 | extern struct task_struct *find_task_by_pid_type(int type, int pid); | |
6970 | extern void set_special_pids(pid_t session, pid_t pgrp); | |
6971 | extern void __set_special_pids(pid_t session, pid_t pgrp); | |
6972 | ||
6973 | ||
6974 | extern struct user_struct * alloc_uid(uid_t); | |
6975 | static inline __attribute__((always_inline)) struct user_struct *get_uid(struct user_struct *u) | |
6976 | { | |
6977 | atomic_inc(&u->__count); | |
6978 | return u; | |
6979 | } | |
6980 | extern void free_uid(struct user_struct *); | |
6981 | extern void switch_uid(struct user_struct *); | |
6982 | ||
6983 | ||
6984 | ||
6985 | extern void do_timer(unsigned long ticks); | |
6986 | ||
6987 | extern int wake_up_state(struct task_struct * tsk, unsigned int state); | |
6988 | extern int wake_up_process(struct task_struct * tsk); | |
6989 | extern void wake_up_new_task(struct task_struct * tsk, unsigned long clone_flags); | |
6990 | ||
6991 | ||
6992 | ||
6993 | ||
6994 | static inline __attribute__((always_inline)) void kick_process(struct task_struct *tsk) { } | |
6995 | ||
6996 | extern void sched_fork(struct task_struct * p, int clone_flags); | |
6997 | extern void sched_exit(struct task_struct * p); | |
6998 | ||
6999 | extern int in_group_p(gid_t); | |
7000 | extern int in_egroup_p(gid_t); | |
7001 | ||
7002 | extern void proc_caches_init(void); | |
7003 | extern void flush_signals(struct task_struct *); | |
7004 | extern void flush_signal_handlers(struct task_struct *, int force_default); | |
7005 | extern int dequeue_signal(struct task_struct *tsk, sigset_t *mask, siginfo_t *info); | |
7006 | ||
7007 | static inline __attribute__((always_inline)) int dequeue_signal_lock(struct task_struct *tsk, sigset_t *mask, siginfo_t *info) | |
7008 | { | |
7009 | unsigned long flags; | |
7010 | int ret; | |
7011 | ||
7012 | do { do { __asm__ __volatile__ ( "cli %0;" :"=&d"(flags):); } while (0); do { do { } while (0); (void)0; (void)(&tsk->sighand->siglock); } while (0); } while (0); | |
7013 | ret = dequeue_signal(tsk, mask, info); | |
7014 | do { do { if (((flags) != 0x1f)) do { __asm__ __volatile__ ( "sti %0;" ::"d"(irq_flags)); } while (0); } while (0); do { do { } while (0); (void)0; (void)(&tsk->sighand->siglock); } while (0); } while (0); | |
7015 | ||
7016 | return ret; | |
7017 | } | |
7018 | ||
7019 | extern void block_all_signals(int (*notifier)(void *priv), void *priv, | |
7020 | sigset_t *mask); | |
7021 | extern void unblock_all_signals(void); | |
7022 | extern void release_task(struct task_struct * p); | |
7023 | extern int send_sig_info(int, struct siginfo *, struct task_struct *); | |
7024 | extern int send_group_sig_info(int, struct siginfo *, struct task_struct *); | |
7025 | extern int force_sigsegv(int, struct task_struct *); | |
7026 | extern int force_sig_info(int, struct siginfo *, struct task_struct *); | |
7027 | extern int __kill_pgrp_info(int sig, struct siginfo *info, struct pid *pgrp); | |
7028 | extern int kill_pgrp_info(int sig, struct siginfo *info, struct pid *pgrp); | |
7029 | extern int kill_pid_info(int sig, struct siginfo *info, struct pid *pid); | |
7030 | extern int kill_pid_info_as_uid(int, struct siginfo *, struct pid *, uid_t, uid_t, u32); | |
7031 | extern int kill_pgrp(struct pid *pid, int sig, int priv); | |
7032 | extern int kill_pid(struct pid *pid, int sig, int priv); | |
7033 | extern int __kill_pg_info(int sig, struct siginfo *info, pid_t pgrp); | |
7034 | extern int kill_pg_info(int, struct siginfo *, pid_t); | |
7035 | extern int kill_proc_info(int, struct siginfo *, pid_t); | |
7036 | extern void do_notify_parent(struct task_struct *, int); | |
7037 | extern void force_sig(int, struct task_struct *); | |
7038 | extern void force_sig_specific(int, struct task_struct *); | |
7039 | extern int send_sig(int, struct task_struct *, int); | |
7040 | extern void zap_other_threads(struct task_struct *p); | |
7041 | extern int kill_pg(pid_t, int, int); | |
7042 | extern int kill_proc(pid_t, int, int); | |
7043 | extern struct sigqueue *sigqueue_alloc(void); | |
7044 | extern void sigqueue_free(struct sigqueue *); | |
7045 | extern int send_sigqueue(int, struct sigqueue *, struct task_struct *); | |
7046 | extern int send_group_sigqueue(int, struct sigqueue *, struct task_struct *); | |
7047 | extern int do_sigaction(int, struct k_sigaction *, struct k_sigaction *); | |
7048 | extern int do_sigaltstack(const stack_t *, stack_t *, unsigned long); | |
7049 | ||
7050 | static inline __attribute__((always_inline)) int kill_cad_pid(int sig, int priv) | |
7051 | { | |
7052 | return kill_pid(cad_pid, sig, priv); | |
7053 | } | |
7054 | ||
7055 | ||
7056 | ||
7057 | ||
7058 | ||
7059 | ||
7060 | static inline __attribute__((always_inline)) int is_si_special(const struct siginfo *info) | |
7061 | { | |
7062 | return info <= ((struct siginfo *) 2); | |
7063 | } | |
7064 | ||
7065 | ||
7066 | ||
7067 | static inline __attribute__((always_inline)) int on_sig_stack(unsigned long sp) | |
7068 | { | |
7069 | return (sp - (get_current())->sas_ss_sp < (get_current())->sas_ss_size); | |
7070 | } | |
7071 | ||
7072 | static inline __attribute__((always_inline)) int sas_ss_flags(unsigned long sp) | |
7073 | { | |
7074 | return ((get_current())->sas_ss_size == 0 ? 2 | |
7075 | : on_sig_stack(sp) ? 1 : 0); | |
7076 | } | |
7077 | ||
7078 | ||
7079 | ||
7080 | ||
7081 | extern struct mm_struct * mm_alloc(void); | |
7082 | ||
7083 | ||
7084 | extern void __mmdrop(struct mm_struct *); | |
7085 | static inline __attribute__((always_inline)) void mmdrop(struct mm_struct * mm) | |
7086 | { | |
7087 | if ((atomic_sub_return(1, (&mm->mm_count)) == 0)) | |
7088 | __mmdrop(mm); | |
7089 | } | |
7090 | ||
7091 | ||
7092 | extern void mmput(struct mm_struct *); | |
7093 | ||
7094 | extern struct mm_struct *get_task_mm(struct task_struct *task); | |
7095 | ||
7096 | extern void mm_release(struct task_struct *, struct mm_struct *); | |
7097 | ||
7098 | extern int copy_thread(int, unsigned long, unsigned long, unsigned long, struct task_struct *, struct pt_regs *); | |
7099 | extern void flush_thread(void); | |
7100 | extern void exit_thread(void); | |
7101 | ||
7102 | extern void exit_files(struct task_struct *); | |
7103 | extern void __cleanup_signal(struct signal_struct *); | |
7104 | extern void __cleanup_sighand(struct sighand_struct *); | |
7105 | extern void exit_itimers(struct signal_struct *); | |
7106 | ||
7107 | extern void do_group_exit(int); | |
7108 | ||
7109 | extern void daemonize(const char *, ...); | |
7110 | extern int allow_signal(int); | |
7111 | extern int disallow_signal(int); | |
7112 | extern struct task_struct *child_reaper; | |
7113 | ||
7114 | extern int do_execve(char *, char * *, char * *, struct pt_regs *); | |
7115 | extern long do_fork(unsigned long, unsigned long, struct pt_regs *, unsigned long, int *, int *); | |
7116 | struct task_struct *fork_idle(int); | |
7117 | ||
7118 | extern void set_task_comm(struct task_struct *tsk, char *from); | |
7119 | extern void get_task_comm(char *to, struct task_struct *tsk); | |
7120 | # 1410 "include/linux/sched.h" | |
7121 | static inline __attribute__((always_inline)) int has_group_leader_pid(struct task_struct *p) | |
7122 | { | |
7123 | return p->pid == p->tgid; | |
7124 | } | |
7125 | ||
7126 | static inline __attribute__((always_inline)) struct task_struct *next_thread(const struct task_struct *p) | |
7127 | { | |
7128 | return ({ const typeof( ((struct task_struct *)0)->thread_group ) *__mptr = (({ typeof(p->thread_group.next) _________p1 = p->thread_group.next; do { } while(0); (_________p1); })); (struct task_struct *)( (char *)__mptr - __builtin_offsetof(struct task_struct,thread_group) );}); | |
7129 | ||
7130 | } | |
7131 | ||
7132 | static inline __attribute__((always_inline)) int thread_group_empty(struct task_struct *p) | |
7133 | { | |
7134 | return list_empty(&p->thread_group); | |
7135 | } | |
7136 | # 1438 "include/linux/sched.h" | |
7137 | static inline __attribute__((always_inline)) void task_lock(struct task_struct *p) | |
7138 | { | |
7139 | do { do { } while (0); (void)0; (void)(&p->alloc_lock); } while (0); | |
7140 | } | |
7141 | ||
7142 | static inline __attribute__((always_inline)) void task_unlock(struct task_struct *p) | |
7143 | { | |
7144 | do { do { } while (0); (void)0; (void)(&p->alloc_lock); } while (0); | |
7145 | } | |
7146 | ||
7147 | extern struct sighand_struct *lock_task_sighand(struct task_struct *tsk, | |
7148 | unsigned long *flags); | |
7149 | ||
7150 | static inline __attribute__((always_inline)) void unlock_task_sighand(struct task_struct *tsk, | |
7151 | unsigned long *flags) | |
7152 | { | |
7153 | do { do { if (((*flags) != 0x1f)) do { __asm__ __volatile__ ( "sti %0;" ::"d"(irq_flags)); } while (0); } while (0); do { do { } while (0); (void)0; (void)(&tsk->sighand->siglock); } while (0); } while (0); | |
7154 | } | |
7155 | ||
7156 | ||
7157 | ||
7158 | ||
7159 | ||
7160 | ||
7161 | static inline __attribute__((always_inline)) void setup_thread_stack(struct task_struct *p, struct task_struct *org) | |
7162 | { | |
7163 | *(p)->thread_info = *(org)->thread_info; | |
7164 | (p)->thread_info->task = p; | |
7165 | } | |
7166 | ||
7167 | static inline __attribute__((always_inline)) unsigned long *end_of_stack(struct task_struct *p) | |
7168 | { | |
7169 | return (unsigned long *)(p->thread_info + 1); | |
7170 | } | |
7171 | ||
7172 | ||
7173 | ||
7174 | ||
7175 | ||
7176 | ||
7177 | static inline __attribute__((always_inline)) void set_tsk_thread_flag(struct task_struct *tsk, int flag) | |
7178 | { | |
7179 | set_ti_thread_flag((tsk)->thread_info, flag); | |
7180 | } | |
7181 | ||
7182 | static inline __attribute__((always_inline)) void clear_tsk_thread_flag(struct task_struct *tsk, int flag) | |
7183 | { | |
7184 | clear_ti_thread_flag((tsk)->thread_info, flag); | |
7185 | } | |
7186 | ||
7187 | static inline __attribute__((always_inline)) int test_and_set_tsk_thread_flag(struct task_struct *tsk, int flag) | |
7188 | { | |
7189 | return test_and_set_ti_thread_flag((tsk)->thread_info, flag); | |
7190 | } | |
7191 | ||
7192 | static inline __attribute__((always_inline)) int test_and_clear_tsk_thread_flag(struct task_struct *tsk, int flag) | |
7193 | { | |
7194 | return test_and_clear_ti_thread_flag((tsk)->thread_info, flag); | |
7195 | } | |
7196 | ||
7197 | static inline __attribute__((always_inline)) int test_tsk_thread_flag(struct task_struct *tsk, int flag) | |
7198 | { | |
7199 | return test_ti_thread_flag((tsk)->thread_info, flag); | |
7200 | } | |
7201 | ||
7202 | static inline __attribute__((always_inline)) void set_tsk_need_resched(struct task_struct *tsk) | |
7203 | { | |
7204 | set_tsk_thread_flag(tsk,3); | |
7205 | } | |
7206 | ||
7207 | static inline __attribute__((always_inline)) void clear_tsk_need_resched(struct task_struct *tsk) | |
7208 | { | |
7209 | clear_tsk_thread_flag(tsk,3); | |
7210 | } | |
7211 | ||
7212 | static inline __attribute__((always_inline)) int signal_pending(struct task_struct *p) | |
7213 | { | |
7214 | return __builtin_expect(!!(test_tsk_thread_flag(p,2)), 0); | |
7215 | } | |
7216 | ||
7217 | static inline __attribute__((always_inline)) int need_resched(void) | |
7218 | { | |
7219 | return __builtin_expect(!!(test_ti_thread_flag(current_thread_info(), 3)), 0); | |
7220 | } | |
7221 | # 1530 "include/linux/sched.h" | |
7222 | extern int cond_resched(void); | |
7223 | extern int cond_resched_lock(spinlock_t * lock); | |
7224 | extern int cond_resched_softirq(void); | |
7225 | # 1548 "include/linux/sched.h" | |
7226 | static inline __attribute__((always_inline)) int lock_need_resched(spinlock_t *lock) | |
7227 | { | |
7228 | if (0 || need_resched()) | |
7229 | return 1; | |
7230 | return 0; | |
7231 | } | |
7232 | ||
7233 | ||
7234 | ||
7235 | ||
7236 | ||
7237 | extern void recalc_sigpending_tsk(struct task_struct *t); | |
7238 | extern void recalc_sigpending(void); | |
7239 | ||
7240 | extern void signal_wake_up(struct task_struct *t, int resume_stopped); | |
7241 | # 1581 "include/linux/sched.h" | |
7242 | static inline __attribute__((always_inline)) unsigned int task_cpu(const struct task_struct *p) | |
7243 | { | |
7244 | return 0; | |
7245 | } | |
7246 | ||
7247 | static inline __attribute__((always_inline)) void set_task_cpu(struct task_struct *p, unsigned int cpu) | |
7248 | { | |
7249 | } | |
7250 | ||
7251 | ||
7252 | ||
7253 | ||
7254 | ||
7255 | ||
7256 | static inline __attribute__((always_inline)) void arch_pick_mmap_layout(struct mm_struct *mm) | |
7257 | { | |
7258 | mm->mmap_base = 0; | |
7259 | mm->get_unmapped_area = arch_get_unmapped_area; | |
7260 | mm->unmap_area = arch_unmap_area; | |
7261 | } | |
7262 | ||
7263 | ||
7264 | extern long sched_setaffinity(pid_t pid, cpumask_t new_mask); | |
7265 | extern long sched_getaffinity(pid_t pid, cpumask_t *mask); | |
7266 | ||
7267 | # 1 "include/linux/sysdev.h" 1 | |
7268 | # 24 "include/linux/sysdev.h" | |
7269 | # 1 "include/linux/kobject.h" 1 | |
7270 | # 22 "include/linux/kobject.h" | |
7271 | # 1 "include/linux/sysfs.h" 1 | |
7272 | # 16 "include/linux/sysfs.h" | |
7273 | struct kobject; | |
7274 | struct module; | |
7275 | ||
7276 | struct attribute { | |
7277 | const char * name; | |
7278 | struct module * owner; | |
7279 | mode_t mode; | |
7280 | }; | |
7281 | ||
7282 | struct attribute_group { | |
7283 | const char * name; | |
7284 | struct attribute ** attrs; | |
7285 | }; | |
7286 | # 52 "include/linux/sysfs.h" | |
7287 | struct vm_area_struct; | |
7288 | ||
7289 | struct bin_attribute { | |
7290 | struct attribute attr; | |
7291 | size_t size; | |
7292 | void *private; | |
7293 | ssize_t (*read)(struct kobject *, char *, loff_t, size_t); | |
7294 | ssize_t (*write)(struct kobject *, char *, loff_t, size_t); | |
7295 | int (*mmap)(struct kobject *, struct bin_attribute *attr, | |
7296 | struct vm_area_struct *vma); | |
7297 | }; | |
7298 | ||
7299 | struct sysfs_ops { | |
7300 | ssize_t (*show)(struct kobject *, struct attribute *,char *); | |
7301 | ssize_t (*store)(struct kobject *,struct attribute *,const char *, size_t); | |
7302 | }; | |
7303 | ||
7304 | struct sysfs_dirent { | |
7305 | atomic_t s_count; | |
7306 | struct list_head s_sibling; | |
7307 | struct list_head s_children; | |
7308 | void * s_element; | |
7309 | int s_type; | |
7310 | umode_t s_mode; | |
7311 | struct dentry * s_dentry; | |
7312 | struct iattr * s_iattr; | |
7313 | atomic_t s_event; | |
7314 | }; | |
7315 | # 90 "include/linux/sysfs.h" | |
7316 | extern int __attribute__((warn_unused_result)) | |
7317 | sysfs_create_dir(struct kobject *); | |
7318 | ||
7319 | extern void | |
7320 | sysfs_remove_dir(struct kobject *); | |
7321 | ||
7322 | extern int __attribute__((warn_unused_result)) | |
7323 | sysfs_rename_dir(struct kobject *, const char *new_name); | |
7324 | ||
7325 | extern int __attribute__((warn_unused_result)) | |
7326 | sysfs_create_file(struct kobject *, const struct attribute *); | |
7327 | ||
7328 | extern int __attribute__((warn_unused_result)) | |
7329 | sysfs_update_file(struct kobject *, const struct attribute *); | |
7330 | ||
7331 | extern int __attribute__((warn_unused_result)) | |
7332 | sysfs_chmod_file(struct kobject *kobj, struct attribute *attr, mode_t mode); | |
7333 | ||
7334 | extern void | |
7335 | sysfs_remove_file(struct kobject *, const struct attribute *); | |
7336 | ||
7337 | extern int __attribute__((warn_unused_result)) | |
7338 | sysfs_create_link(struct kobject * kobj, struct kobject * target, const char * name); | |
7339 | ||
7340 | extern void | |
7341 | sysfs_remove_link(struct kobject *, const char * name); | |
7342 | ||
7343 | int __attribute__((warn_unused_result)) sysfs_create_bin_file(struct kobject *kobj, | |
7344 | struct bin_attribute *attr); | |
7345 | void sysfs_remove_bin_file(struct kobject *kobj, struct bin_attribute *attr); | |
7346 | ||
7347 | int __attribute__((warn_unused_result)) sysfs_create_group(struct kobject *, | |
7348 | const struct attribute_group *); | |
7349 | void sysfs_remove_group(struct kobject *, const struct attribute_group *); | |
7350 | void sysfs_notify(struct kobject * k, char *dir, char *attr); | |
7351 | ||
7352 | extern int __attribute__((warn_unused_result)) sysfs_init(void); | |
7353 | # 23 "include/linux/kobject.h" 2 | |
7354 | # 35 "include/linux/kobject.h" | |
7355 | extern char uevent_helper[]; | |
7356 | ||
7357 | ||
7358 | extern u64 uevent_seqnum; | |
7359 | ||
7360 | ||
7361 | typedef int kobject_action_t; | |
7362 | enum kobject_action { | |
7363 | KOBJ_ADD = ( kobject_action_t) 0x01, | |
7364 | KOBJ_REMOVE = ( kobject_action_t) 0x02, | |
7365 | KOBJ_CHANGE = ( kobject_action_t) 0x03, | |
7366 | KOBJ_MOUNT = ( kobject_action_t) 0x04, | |
7367 | KOBJ_UMOUNT = ( kobject_action_t) 0x05, | |
7368 | KOBJ_OFFLINE = ( kobject_action_t) 0x06, | |
7369 | KOBJ_ONLINE = ( kobject_action_t) 0x07, | |
7370 | }; | |
7371 | ||
7372 | struct kobject { | |
7373 | const char * k_name; | |
7374 | char name[20]; | |
7375 | struct kref kref; | |
7376 | struct list_head entry; | |
7377 | struct kobject * parent; | |
7378 | struct kset * kset; | |
7379 | struct kobj_type * ktype; | |
7380 | struct dentry * dentry; | |
7381 | wait_queue_head_t poll; | |
7382 | }; | |
7383 | ||
7384 | extern int kobject_set_name(struct kobject *, const char *, ...) | |
7385 | __attribute__((format(printf,2,3))); | |
7386 | ||
7387 | static inline __attribute__((always_inline)) const char * kobject_name(const struct kobject * kobj) | |
7388 | { | |
7389 | return kobj->k_name; | |
7390 | } | |
7391 | ||
7392 | extern void kobject_init(struct kobject *); | |
7393 | extern void kobject_cleanup(struct kobject *); | |
7394 | ||
7395 | extern int __attribute__((warn_unused_result)) kobject_add(struct kobject *); | |
7396 | extern void kobject_del(struct kobject *); | |
7397 | ||
7398 | extern int __attribute__((warn_unused_result)) kobject_rename(struct kobject *, const char *new_name); | |
7399 | ||
7400 | extern int __attribute__((warn_unused_result)) kobject_register(struct kobject *); | |
7401 | extern void kobject_unregister(struct kobject *); | |
7402 | ||
7403 | extern struct kobject * kobject_get(struct kobject *); | |
7404 | extern void kobject_put(struct kobject *); | |
7405 | ||
7406 | extern struct kobject *kobject_add_dir(struct kobject *, const char *); | |
7407 | ||
7408 | extern char * kobject_get_path(struct kobject *, gfp_t); | |
7409 | ||
7410 | struct kobj_type { | |
7411 | void (*release)(struct kobject *); | |
7412 | struct sysfs_ops * sysfs_ops; | |
7413 | struct attribute ** default_attrs; | |
7414 | }; | |
7415 | # 114 "include/linux/kobject.h" | |
7416 | struct kset_uevent_ops { | |
7417 | int (*filter)(struct kset *kset, struct kobject *kobj); | |
7418 | const char *(*name)(struct kset *kset, struct kobject *kobj); | |
7419 | int (*uevent)(struct kset *kset, struct kobject *kobj, char **envp, | |
7420 | int num_envp, char *buffer, int buffer_size); | |
7421 | }; | |
7422 | ||
7423 | struct kset { | |
7424 | struct subsystem * subsys; | |
7425 | struct kobj_type * ktype; | |
7426 | struct list_head list; | |
7427 | spinlock_t list_lock; | |
7428 | struct kobject kobj; | |
7429 | struct kset_uevent_ops * uevent_ops; | |
7430 | }; | |
7431 | ||
7432 | ||
7433 | extern void kset_init(struct kset * k); | |
7434 | extern int __attribute__((warn_unused_result)) kset_add(struct kset * k); | |
7435 | extern int __attribute__((warn_unused_result)) kset_register(struct kset * k); | |
7436 | extern void kset_unregister(struct kset * k); | |
7437 | ||
7438 | static inline __attribute__((always_inline)) struct kset * to_kset(struct kobject * kobj) | |
7439 | { | |
7440 | return kobj ? ({ const typeof( ((struct kset *)0)->kobj ) *__mptr = (kobj); (struct kset *)( (char *)__mptr - __builtin_offsetof(struct kset,kobj) );}) : ((void *)0); | |
7441 | } | |
7442 | ||
7443 | static inline __attribute__((always_inline)) struct kset * kset_get(struct kset * k) | |
7444 | { | |
7445 | return k ? to_kset(kobject_get(&k->kobj)) : ((void *)0); | |
7446 | } | |
7447 | ||
7448 | static inline __attribute__((always_inline)) void kset_put(struct kset * k) | |
7449 | { | |
7450 | kobject_put(&k->kobj); | |
7451 | } | |
7452 | ||
7453 | static inline __attribute__((always_inline)) struct kobj_type * get_ktype(struct kobject * k) | |
7454 | { | |
7455 | if (k->kset && k->kset->ktype) | |
7456 | return k->kset->ktype; | |
7457 | else | |
7458 | return k->ktype; | |
7459 | } | |
7460 | ||
7461 | extern struct kobject * kset_find_obj(struct kset *, const char *); | |
7462 | # 170 "include/linux/kobject.h" | |
7463 | struct subsystem { | |
7464 | struct kset kset; | |
7465 | struct rw_semaphore rwsem; | |
7466 | }; | |
7467 | # 193 "include/linux/kobject.h" | |
7468 | extern struct subsystem kernel_subsys; | |
7469 | ||
7470 | extern struct subsystem hypervisor_subsys; | |
7471 | # 242 "include/linux/kobject.h" | |
7472 | extern void subsystem_init(struct subsystem *); | |
7473 | extern int __attribute__((warn_unused_result)) subsystem_register(struct subsystem *); | |
7474 | extern void subsystem_unregister(struct subsystem *); | |
7475 | ||
7476 | static inline __attribute__((always_inline)) struct subsystem * subsys_get(struct subsystem * s) | |
7477 | { | |
7478 | return s ? ({ const typeof( ((struct subsystem *)0)->kset ) *__mptr = (kset_get(&s->kset)); (struct subsystem *)( (char *)__mptr - __builtin_offsetof(struct subsystem,kset) );}) : ((void *)0); | |
7479 | } | |
7480 | ||
7481 | static inline __attribute__((always_inline)) void subsys_put(struct subsystem * s) | |
7482 | { | |
7483 | kset_put(&s->kset); | |
7484 | } | |
7485 | ||
7486 | struct subsys_attribute { | |
7487 | struct attribute attr; | |
7488 | ssize_t (*show)(struct subsystem *, char *); | |
7489 | ssize_t (*store)(struct subsystem *, const char *, size_t); | |
7490 | }; | |
7491 | ||
7492 | extern int __attribute__((warn_unused_result)) subsys_create_file(struct subsystem * , | |
7493 | struct subsys_attribute *); | |
7494 | # 273 "include/linux/kobject.h" | |
7495 | static inline __attribute__((always_inline)) void kobject_uevent(struct kobject *kobj, enum kobject_action action) { } | |
7496 | ||
7497 | static inline __attribute__((always_inline)) int add_uevent_var(char **envp, int num_envp, int *cur_index, | |
7498 | char *buffer, int buffer_size, int *cur_len, | |
7499 | const char *format, ...) | |
7500 | { return 0; } | |
7501 | # 25 "include/linux/sysdev.h" 2 | |
7502 | # 1 "include/linux/pm.h" 1 | |
7503 | # 34 "include/linux/pm.h" | |
7504 | typedef int pm_request_t; | |
7505 | # 43 "include/linux/pm.h" | |
7506 | typedef int pm_dev_t; | |
7507 | # 56 "include/linux/pm.h" | |
7508 | enum | |
7509 | { | |
7510 | PM_SYS_UNKNOWN = 0x00000000, | |
7511 | PM_SYS_KBC = 0x41d00303, | |
7512 | PM_SYS_COM = 0x41d00500, | |
7513 | PM_SYS_IRDA = 0x41d00510, | |
7514 | PM_SYS_FDC = 0x41d00700, | |
7515 | PM_SYS_VGA = 0x41d00900, | |
7516 | PM_SYS_PCMCIA = 0x41d00e00, | |
7517 | }; | |
7518 | # 75 "include/linux/pm.h" | |
7519 | struct pm_dev; | |
7520 | ||
7521 | typedef int (*pm_callback)(struct pm_dev *dev, pm_request_t rqst, void *data); | |
7522 | ||
7523 | ||
7524 | ||
7525 | ||
7526 | struct pm_dev | |
7527 | { | |
7528 | pm_dev_t type; | |
7529 | unsigned long id; | |
7530 | pm_callback callback; | |
7531 | void *data; | |
7532 | ||
7533 | unsigned long flags; | |
7534 | unsigned long state; | |
7535 | unsigned long prev_state; | |
7536 | ||
7537 | struct list_head entry; | |
7538 | }; | |
7539 | ||
7540 | ||
7541 | ||
7542 | ||
7543 | ||
7544 | ||
7545 | ||
7546 | extern void (*pm_idle)(void); | |
7547 | extern void (*pm_power_off)(void); | |
7548 | ||
7549 | typedef int suspend_state_t; | |
7550 | ||
7551 | ||
7552 | ||
7553 | ||
7554 | ||
7555 | ||
7556 | ||
7557 | typedef int suspend_disk_method_t; | |
7558 | # 123 "include/linux/pm.h" | |
7559 | struct pm_ops { | |
7560 | suspend_disk_method_t pm_disk_mode; | |
7561 | int (*valid)(suspend_state_t state); | |
7562 | int (*prepare)(suspend_state_t state); | |
7563 | int (*enter)(suspend_state_t state); | |
7564 | int (*finish)(suspend_state_t state); | |
7565 | }; | |
7566 | ||
7567 | extern void pm_set_ops(struct pm_ops *); | |
7568 | extern struct pm_ops *pm_ops; | |
7569 | extern int pm_suspend(suspend_state_t state); | |
7570 | ||
7571 | ||
7572 | ||
7573 | ||
7574 | ||
7575 | ||
7576 | struct device; | |
7577 | ||
7578 | typedef struct pm_message { | |
7579 | int event; | |
7580 | } pm_message_t; | |
7581 | # 205 "include/linux/pm.h" | |
7582 | struct dev_pm_info { | |
7583 | pm_message_t power_state; | |
7584 | unsigned can_wakeup:1; | |
7585 | ||
7586 | ||
7587 | ||
7588 | ||
7589 | ||
7590 | ||
7591 | ||
7592 | }; | |
7593 | ||
7594 | extern void device_pm_set_parent(struct device * dev, struct device * parent); | |
7595 | ||
7596 | extern int device_power_down(pm_message_t state); | |
7597 | extern void device_power_up(void); | |
7598 | extern void device_resume(void); | |
7599 | # 245 "include/linux/pm.h" | |
7600 | static inline __attribute__((always_inline)) int device_suspend(pm_message_t state) | |
7601 | { | |
7602 | return 0; | |
7603 | } | |
7604 | ||
7605 | ||
7606 | ||
7607 | ||
7608 | static inline __attribute__((always_inline)) int dpm_runtime_suspend(struct device * dev, pm_message_t state) | |
7609 | { | |
7610 | return 0; | |
7611 | } | |
7612 | ||
7613 | static inline __attribute__((always_inline)) void dpm_runtime_resume(struct device * dev) | |
7614 | { | |
7615 | } | |
7616 | # 26 "include/linux/sysdev.h" 2 | |
7617 | ||
7618 | ||
7619 | struct sys_device; | |
7620 | ||
7621 | struct sysdev_class { | |
7622 | struct list_head drivers; | |
7623 | ||
7624 | ||
7625 | int (*shutdown)(struct sys_device *); | |
7626 | int (*suspend)(struct sys_device *, pm_message_t state); | |
7627 | int (*resume)(struct sys_device *); | |
7628 | struct kset kset; | |
7629 | }; | |
7630 | ||
7631 | struct sysdev_class_attribute { | |
7632 | struct attribute attr; | |
7633 | ssize_t (*show)(struct sysdev_class *, char *); | |
7634 | ssize_t (*store)(struct sysdev_class *, const char *, size_t); | |
7635 | }; | |
7636 | # 54 "include/linux/sysdev.h" | |
7637 | extern int sysdev_class_register(struct sysdev_class *); | |
7638 | extern void sysdev_class_unregister(struct sysdev_class *); | |
7639 | ||
7640 | extern int sysdev_class_create_file(struct sysdev_class *, | |
7641 | struct sysdev_class_attribute *); | |
7642 | extern void sysdev_class_remove_file(struct sysdev_class *, | |
7643 | struct sysdev_class_attribute *); | |
7644 | ||
7645 | ||
7646 | ||
7647 | ||
7648 | struct sysdev_driver { | |
7649 | struct list_head entry; | |
7650 | int (*add)(struct sys_device *); | |
7651 | int (*remove)(struct sys_device *); | |
7652 | int (*shutdown)(struct sys_device *); | |
7653 | int (*suspend)(struct sys_device *, pm_message_t state); | |
7654 | int (*resume)(struct sys_device *); | |
7655 | }; | |
7656 | ||
7657 | ||
7658 | extern int sysdev_driver_register(struct sysdev_class *, struct sysdev_driver *); | |
7659 | extern void sysdev_driver_unregister(struct sysdev_class *, struct sysdev_driver *); | |
7660 | ||
7661 | ||
7662 | ||
7663 | ||
7664 | ||
7665 | ||
7666 | ||
7667 | struct sys_device { | |
7668 | u32 id; | |
7669 | struct sysdev_class * cls; | |
7670 | struct kobject kobj; | |
7671 | }; | |
7672 | ||
7673 | extern int sysdev_register(struct sys_device *); | |
7674 | extern void sysdev_unregister(struct sys_device *); | |
7675 | ||
7676 | ||
7677 | struct sysdev_attribute { | |
7678 | struct attribute attr; | |
7679 | ssize_t (*show)(struct sys_device *, char *); | |
7680 | ssize_t (*store)(struct sys_device *, const char *, size_t); | |
7681 | }; | |
7682 | # 108 "include/linux/sysdev.h" | |
7683 | extern int sysdev_create_file(struct sys_device *, struct sysdev_attribute *); | |
7684 | extern void sysdev_remove_file(struct sys_device *, struct sysdev_attribute *); | |
7685 | # 1607 "include/linux/sched.h" 2 | |
7686 | extern int sched_mc_power_savings, sched_smt_power_savings; | |
7687 | extern struct sysdev_attribute attr_sched_mc_power_savings, attr_sched_smt_power_savings; | |
7688 | extern int sched_create_sysfs_power_savings_entries(struct sysdev_class *cls); | |
7689 | ||
7690 | extern void normalize_rt_tasks(void); | |
7691 | # 1681 "include/linux/sched.h" | |
7692 | static inline __attribute__((always_inline)) int frozen(struct task_struct *p) { return 0; } | |
7693 | static inline __attribute__((always_inline)) int freezing(struct task_struct *p) { return 0; } | |
7694 | static inline __attribute__((always_inline)) void freeze(struct task_struct *p) { do { dump_stack(); printk("<4>" "\nkernel BUG at %s:%d!\n", "include/linux/sched.h", 1683); panic("BUG!"); } while (0); } | |
7695 | static inline __attribute__((always_inline)) int thaw_process(struct task_struct *p) { return 1; } | |
7696 | static inline __attribute__((always_inline)) void frozen_process(struct task_struct *p) { do { dump_stack(); printk("<4>" "\nkernel BUG at %s:%d!\n", "include/linux/sched.h", 1685); panic("BUG!"); } while (0); } | |
7697 | ||
7698 | static inline __attribute__((always_inline)) void refrigerator(void) {} | |
7699 | static inline __attribute__((always_inline)) int freeze_processes(void) { do { dump_stack(); printk("<4>" "\nkernel BUG at %s:%d!\n", "include/linux/sched.h", 1688); panic("BUG!"); } while (0); return 0; } | |
7700 | static inline __attribute__((always_inline)) void thaw_processes(void) {} | |
7701 | ||
7702 | static inline __attribute__((always_inline)) int try_to_freeze(void) { return 0; } | |
7703 | # 13 "include/asm/uaccess.h" 2 | |
7704 | # 1 "include/linux/mm.h" 1 | |
7705 | # 14 "include/linux/mm.h" | |
7706 | # 1 "include/linux/prio_tree.h" 1 | |
7707 | # 14 "include/linux/prio_tree.h" | |
7708 | struct raw_prio_tree_node { | |
7709 | struct prio_tree_node *left; | |
7710 | struct prio_tree_node *right; | |
7711 | struct prio_tree_node *parent; | |
7712 | }; | |
7713 | ||
7714 | struct prio_tree_node { | |
7715 | struct prio_tree_node *left; | |
7716 | struct prio_tree_node *right; | |
7717 | struct prio_tree_node *parent; | |
7718 | unsigned long start; | |
7719 | unsigned long last; | |
7720 | }; | |
7721 | ||
7722 | struct prio_tree_root { | |
7723 | struct prio_tree_node *prio_tree_node; | |
7724 | unsigned short index_bits; | |
7725 | unsigned short raw; | |
7726 | ||
7727 | ||
7728 | ||
7729 | ||
7730 | }; | |
7731 | ||
7732 | struct prio_tree_iter { | |
7733 | struct prio_tree_node *cur; | |
7734 | unsigned long mask; | |
7735 | unsigned long value; | |
7736 | int size_level; | |
7737 | ||
7738 | struct prio_tree_root *root; | |
7739 | unsigned long r_index; | |
7740 | unsigned long h_index; | |
7741 | }; | |
7742 | ||
7743 | static inline __attribute__((always_inline)) void prio_tree_iter_init(struct prio_tree_iter *iter, | |
7744 | struct prio_tree_root *root, unsigned long r_index, unsigned long h_index) | |
7745 | { | |
7746 | iter->root = root; | |
7747 | iter->r_index = r_index; | |
7748 | iter->h_index = h_index; | |
7749 | iter->cur = ((void *)0); | |
7750 | } | |
7751 | # 84 "include/linux/prio_tree.h" | |
7752 | static inline __attribute__((always_inline)) int prio_tree_empty(const struct prio_tree_root *root) | |
7753 | { | |
7754 | return root->prio_tree_node == ((void *)0); | |
7755 | } | |
7756 | ||
7757 | static inline __attribute__((always_inline)) int prio_tree_root(const struct prio_tree_node *node) | |
7758 | { | |
7759 | return node->parent == node; | |
7760 | } | |
7761 | ||
7762 | static inline __attribute__((always_inline)) int prio_tree_left_empty(const struct prio_tree_node *node) | |
7763 | { | |
7764 | return node->left == node; | |
7765 | } | |
7766 | ||
7767 | static inline __attribute__((always_inline)) int prio_tree_right_empty(const struct prio_tree_node *node) | |
7768 | { | |
7769 | return node->right == node; | |
7770 | } | |
7771 | ||
7772 | ||
7773 | struct prio_tree_node *prio_tree_replace(struct prio_tree_root *root, | |
7774 | struct prio_tree_node *old, struct prio_tree_node *node); | |
7775 | struct prio_tree_node *prio_tree_insert(struct prio_tree_root *root, | |
7776 | struct prio_tree_node *node); | |
7777 | void prio_tree_remove(struct prio_tree_root *root, struct prio_tree_node *node); | |
7778 | struct prio_tree_node *prio_tree_next(struct prio_tree_iter *iter); | |
7779 | # 15 "include/linux/mm.h" 2 | |
7780 | # 1 "include/linux/fs.h" 1 | |
7781 | # 9 "include/linux/fs.h" | |
7782 | # 1 "include/linux/limits.h" 1 | |
7783 | # 10 "include/linux/fs.h" 2 | |
7784 | # 1 "include/linux/ioctl.h" 1 | |
7785 | ||
7786 | ||
7787 | ||
7788 | # 1 "include/asm/ioctl.h" 1 | |
7789 | # 1 "include/asm-generic/ioctl.h" 1 | |
7790 | # 51 "include/asm-generic/ioctl.h" | |
7791 | extern unsigned int __invalid_size_argument_for_IOC; | |
7792 | # 1 "include/asm/ioctl.h" 2 | |
7793 | # 5 "include/linux/ioctl.h" 2 | |
7794 | # 11 "include/linux/fs.h" 2 | |
7795 | # 35 "include/linux/fs.h" | |
7796 | struct files_stat_struct { | |
7797 | int nr_files; | |
7798 | int nr_free_files; | |
7799 | int max_files; | |
7800 | }; | |
7801 | extern struct files_stat_struct files_stat; | |
7802 | extern int get_max_files(void); | |
7803 | ||
7804 | struct inodes_stat_t { | |
7805 | int nr_inodes; | |
7806 | int nr_unused; | |
7807 | int dummy[5]; | |
7808 | }; | |
7809 | extern struct inodes_stat_t inodes_stat; | |
7810 | ||
7811 | extern int leases_enable, lease_break_time; | |
7812 | # 270 "include/linux/fs.h" | |
7813 | # 1 "include/linux/kdev_t.h" 1 | |
7814 | # 21 "include/linux/kdev_t.h" | |
7815 | static inline __attribute__((always_inline)) int old_valid_dev(dev_t dev) | |
7816 | { | |
7817 | return ((unsigned int) ((dev) >> 20)) < 256 && ((unsigned int) ((dev) & ((1U << 20) - 1))) < 256; | |
7818 | } | |
7819 | ||
7820 | static inline __attribute__((always_inline)) u16 old_encode_dev(dev_t dev) | |
7821 | { | |
7822 | return (((unsigned int) ((dev) >> 20)) << 8) | ((unsigned int) ((dev) & ((1U << 20) - 1))); | |
7823 | } | |
7824 | ||
7825 | static inline __attribute__((always_inline)) dev_t old_decode_dev(u16 val) | |
7826 | { | |
7827 | return ((((val >> 8) & 255) << 20) | (val & 255)); | |
7828 | } | |
7829 | ||
7830 | static inline __attribute__((always_inline)) int new_valid_dev(dev_t dev) | |
7831 | { | |
7832 | return 1; | |
7833 | } | |
7834 | ||
7835 | static inline __attribute__((always_inline)) u32 new_encode_dev(dev_t dev) | |
7836 | { | |
7837 | unsigned major = ((unsigned int) ((dev) >> 20)); | |
7838 | unsigned minor = ((unsigned int) ((dev) & ((1U << 20) - 1))); | |
7839 | return (minor & 0xff) | (major << 8) | ((minor & ~0xff) << 12); | |
7840 | } | |
7841 | ||
7842 | static inline __attribute__((always_inline)) dev_t new_decode_dev(u32 dev) | |
7843 | { | |
7844 | unsigned major = (dev & 0xfff00) >> 8; | |
7845 | unsigned minor = (dev & 0xff) | ((dev >> 12) & 0xfff00); | |
7846 | return (((major) << 20) | (minor)); | |
7847 | } | |
7848 | ||
7849 | static inline __attribute__((always_inline)) int huge_valid_dev(dev_t dev) | |
7850 | { | |
7851 | return 1; | |
7852 | } | |
7853 | ||
7854 | static inline __attribute__((always_inline)) u64 huge_encode_dev(dev_t dev) | |
7855 | { | |
7856 | return new_encode_dev(dev); | |
7857 | } | |
7858 | ||
7859 | static inline __attribute__((always_inline)) dev_t huge_decode_dev(u64 dev) | |
7860 | { | |
7861 | return new_decode_dev(dev); | |
7862 | } | |
7863 | ||
7864 | static inline __attribute__((always_inline)) int sysv_valid_dev(dev_t dev) | |
7865 | { | |
7866 | return ((unsigned int) ((dev) >> 20)) < (1<<14) && ((unsigned int) ((dev) & ((1U << 20) - 1))) < (1<<18); | |
7867 | } | |
7868 | ||
7869 | static inline __attribute__((always_inline)) u32 sysv_encode_dev(dev_t dev) | |
7870 | { | |
7871 | return ((unsigned int) ((dev) & ((1U << 20) - 1))) | (((unsigned int) ((dev) >> 20)) << 18); | |
7872 | } | |
7873 | ||
7874 | static inline __attribute__((always_inline)) unsigned sysv_major(u32 dev) | |
7875 | { | |
7876 | return (dev >> 18) & 0x3fff; | |
7877 | } | |
7878 | ||
7879 | static inline __attribute__((always_inline)) unsigned sysv_minor(u32 dev) | |
7880 | { | |
7881 | return dev & 0x3ffff; | |
7882 | } | |
7883 | # 271 "include/linux/fs.h" 2 | |
7884 | # 1 "include/linux/dcache.h" 1 | |
7885 | # 12 "include/linux/dcache.h" | |
7886 | struct nameidata; | |
7887 | struct vfsmount; | |
7888 | # 33 "include/linux/dcache.h" | |
7889 | struct qstr { | |
7890 | unsigned int hash; | |
7891 | unsigned int len; | |
7892 | const unsigned char *name; | |
7893 | }; | |
7894 | ||
7895 | struct dentry_stat_t { | |
7896 | int nr_dentry; | |
7897 | int nr_unused; | |
7898 | int age_limit; | |
7899 | int want_pages; | |
7900 | int dummy[2]; | |
7901 | }; | |
7902 | extern struct dentry_stat_t dentry_stat; | |
7903 | ||
7904 | ||
7905 | ||
7906 | ||
7907 | ||
7908 | ||
7909 | static inline __attribute__((always_inline)) unsigned long | |
7910 | partial_name_hash(unsigned long c, unsigned long prevhash) | |
7911 | { | |
7912 | return (prevhash + (c << 4) + (c >> 4)) * 11; | |
7913 | } | |
7914 | ||
7915 | ||
7916 | ||
7917 | ||
7918 | ||
7919 | static inline __attribute__((always_inline)) unsigned long end_name_hash(unsigned long hash) | |
7920 | { | |
7921 | return (unsigned int) hash; | |
7922 | } | |
7923 | ||
7924 | ||
7925 | static inline __attribute__((always_inline)) unsigned int | |
7926 | full_name_hash(const unsigned char *name, unsigned int len) | |
7927 | { | |
7928 | unsigned long hash = 0; | |
7929 | while (len--) | |
7930 | hash = partial_name_hash(*name++, hash); | |
7931 | return end_name_hash(hash); | |
7932 | } | |
7933 | ||
7934 | struct dcookie_struct; | |
7935 | ||
7936 | ||
7937 | ||
7938 | struct dentry { | |
7939 | atomic_t d_count; | |
7940 | unsigned int d_flags; | |
7941 | spinlock_t d_lock; | |
7942 | struct inode *d_inode; | |
7943 | ||
7944 | ||
7945 | ||
7946 | ||
7947 | ||
7948 | struct hlist_node d_hash; | |
7949 | struct dentry *d_parent; | |
7950 | struct qstr d_name; | |
7951 | ||
7952 | struct list_head d_lru; | |
7953 | ||
7954 | ||
7955 | ||
7956 | union { | |
7957 | struct list_head d_child; | |
7958 | struct rcu_head d_rcu; | |
7959 | } d_u; | |
7960 | struct list_head d_subdirs; | |
7961 | struct list_head d_alias; | |
7962 | unsigned long d_time; | |
7963 | struct dentry_operations *d_op; | |
7964 | struct super_block *d_sb; | |
7965 | void *d_fsdata; | |
7966 | ||
7967 | ||
7968 | ||
7969 | int d_mounted; | |
7970 | unsigned char d_iname[36]; | |
7971 | }; | |
7972 | ||
7973 | ||
7974 | ||
7975 | ||
7976 | ||
7977 | ||
7978 | ||
7979 | enum dentry_d_lock_class | |
7980 | { | |
7981 | DENTRY_D_LOCK_NORMAL, | |
7982 | DENTRY_D_LOCK_NESTED | |
7983 | }; | |
7984 | ||
7985 | struct dentry_operations { | |
7986 | int (*d_revalidate)(struct dentry *, struct nameidata *); | |
7987 | int (*d_hash) (struct dentry *, struct qstr *); | |
7988 | int (*d_compare) (struct dentry *, struct qstr *, struct qstr *); | |
7989 | int (*d_delete)(struct dentry *); | |
7990 | void (*d_release)(struct dentry *); | |
7991 | void (*d_iput)(struct dentry *, struct inode *); | |
7992 | }; | |
7993 | # 179 "include/linux/dcache.h" | |
7994 | extern spinlock_t dcache_lock; | |
7995 | # 197 "include/linux/dcache.h" | |
7996 | static inline __attribute__((always_inline)) void __d_drop(struct dentry *dentry) | |
7997 | { | |
7998 | if (!(dentry->d_flags & 0x0010)) { | |
7999 | dentry->d_flags |= 0x0010; | |
8000 | hlist_del_rcu(&dentry->d_hash); | |
8001 | } | |
8002 | } | |
8003 | ||
8004 | static inline __attribute__((always_inline)) void d_drop(struct dentry *dentry) | |
8005 | { | |
8006 | do { do { } while (0); (void)0; (void)(&dcache_lock); } while (0); | |
8007 | do { do { } while (0); (void)0; (void)(&dentry->d_lock); } while (0); | |
8008 | __d_drop(dentry); | |
8009 | do { do { } while (0); (void)0; (void)(&dentry->d_lock); } while (0); | |
8010 | do { do { } while (0); (void)0; (void)(&dcache_lock); } while (0); | |
8011 | } | |
8012 | ||
8013 | static inline __attribute__((always_inline)) int dname_external(struct dentry *dentry) | |
8014 | { | |
8015 | return dentry->d_name.name != dentry->d_iname; | |
8016 | } | |
8017 | ||
8018 | ||
8019 | ||
8020 | ||
8021 | extern void d_instantiate(struct dentry *, struct inode *); | |
8022 | extern struct dentry * d_instantiate_unique(struct dentry *, struct inode *); | |
8023 | extern struct dentry * d_materialise_unique(struct dentry *, struct inode *); | |
8024 | extern void d_delete(struct dentry *); | |
8025 | ||
8026 | ||
8027 | extern struct dentry * d_alloc(struct dentry *, const struct qstr *); | |
8028 | extern struct dentry * d_alloc_anon(struct inode *); | |
8029 | extern struct dentry * d_splice_alias(struct inode *, struct dentry *); | |
8030 | extern void shrink_dcache_sb(struct super_block *); | |
8031 | extern void shrink_dcache_parent(struct dentry *); | |
8032 | extern void shrink_dcache_for_umount(struct super_block *); | |
8033 | extern int d_invalidate(struct dentry *); | |
8034 | ||
8035 | ||
8036 | extern struct dentry * d_alloc_root(struct inode *); | |
8037 | ||
8038 | ||
8039 | extern void d_genocide(struct dentry *); | |
8040 | ||
8041 | extern struct dentry *d_find_alias(struct inode *); | |
8042 | extern void d_prune_aliases(struct inode *); | |
8043 | ||
8044 | ||
8045 | extern int have_submounts(struct dentry *); | |
8046 | ||
8047 | ||
8048 | ||
8049 | ||
8050 | extern void d_rehash(struct dentry *); | |
8051 | # 262 "include/linux/dcache.h" | |
8052 | static inline __attribute__((always_inline)) void d_add(struct dentry *entry, struct inode *inode) | |
8053 | { | |
8054 | d_instantiate(entry, inode); | |
8055 | d_rehash(entry); | |
8056 | } | |
8057 | # 276 "include/linux/dcache.h" | |
8058 | static inline __attribute__((always_inline)) struct dentry *d_add_unique(struct dentry *entry, struct inode *inode) | |
8059 | { | |
8060 | struct dentry *res; | |
8061 | ||
8062 | res = d_instantiate_unique(entry, inode); | |
8063 | d_rehash(res != ((void *)0) ? res : entry); | |
8064 | return res; | |
8065 | } | |
8066 | ||
8067 | ||
8068 | extern void d_move(struct dentry *, struct dentry *); | |
8069 | ||
8070 | ||
8071 | extern struct dentry * d_lookup(struct dentry *, struct qstr *); | |
8072 | extern struct dentry * __d_lookup(struct dentry *, struct qstr *); | |
8073 | extern struct dentry * d_hash_and_lookup(struct dentry *, struct qstr *); | |
8074 | ||
8075 | ||
8076 | extern int d_validate(struct dentry *, struct dentry *); | |
8077 | ||
8078 | extern char * d_path(struct dentry *, struct vfsmount *, char *, int); | |
8079 | # 313 "include/linux/dcache.h" | |
8080 | static inline __attribute__((always_inline)) struct dentry *dget(struct dentry *dentry) | |
8081 | { | |
8082 | if (dentry) { | |
8083 | do { if (__builtin_expect(!!((!((&dentry->d_count)->counter))!=0), 0)) do { dump_stack(); printk("<4>" "\nkernel BUG at %s:%d!\n", "include/linux/dcache.h", 316); panic("BUG!"); } while (0); } while(0); | |
8084 | atomic_inc(&dentry->d_count); | |
8085 | } | |
8086 | return dentry; | |
8087 | } | |
8088 | ||
8089 | extern struct dentry * dget_locked(struct dentry *); | |
8090 | # 331 "include/linux/dcache.h" | |
8091 | static inline __attribute__((always_inline)) int d_unhashed(struct dentry *dentry) | |
8092 | { | |
8093 | return (dentry->d_flags & 0x0010); | |
8094 | } | |
8095 | ||
8096 | static inline __attribute__((always_inline)) struct dentry *dget_parent(struct dentry *dentry) | |
8097 | { | |
8098 | struct dentry *ret; | |
8099 | ||
8100 | do { do { } while (0); (void)0; (void)(&dentry->d_lock); } while (0); | |
8101 | ret = dget(dentry->d_parent); | |
8102 | do { do { } while (0); (void)0; (void)(&dentry->d_lock); } while (0); | |
8103 | return ret; | |
8104 | } | |
8105 | ||
8106 | extern void dput(struct dentry *); | |
8107 | ||
8108 | static inline __attribute__((always_inline)) int d_mountpoint(struct dentry *dentry) | |
8109 | { | |
8110 | return dentry->d_mounted; | |
8111 | } | |
8112 | ||
8113 | extern struct vfsmount *lookup_mnt(struct vfsmount *, struct dentry *); | |
8114 | extern struct vfsmount *__lookup_mnt(struct vfsmount *, struct dentry *, int); | |
8115 | extern struct dentry *lookup_create(struct nameidata *nd, int is_dir); | |
8116 | ||
8117 | extern int sysctl_vfs_cache_pressure; | |
8118 | # 272 "include/linux/fs.h" 2 | |
8119 | # 1 "include/linux/stat.h" 1 | |
8120 | ||
8121 | ||
8122 | ||
8123 | ||
8124 | ||
8125 | # 1 "include/asm/stat.h" 1 | |
8126 | ||
8127 | ||
8128 | ||
8129 | struct stat { | |
8130 | unsigned short st_dev; | |
8131 | unsigned short __pad1; | |
8132 | unsigned long st_ino; | |
8133 | unsigned short st_mode; | |
8134 | unsigned short st_nlink; | |
8135 | unsigned short st_uid; | |
8136 | unsigned short st_gid; | |
8137 | unsigned short st_rdev; | |
8138 | unsigned short __pad2; | |
8139 | unsigned long st_size; | |
8140 | unsigned long st_blksize; | |
8141 | unsigned long st_blocks; | |
8142 | unsigned long st_atime; | |
8143 | unsigned long __unused1; | |
8144 | unsigned long st_mtime; | |
8145 | unsigned long __unused2; | |
8146 | unsigned long st_ctime; | |
8147 | unsigned long __unused3; | |
8148 | unsigned long __unused4; | |
8149 | unsigned long __unused5; | |
8150 | }; | |
8151 | ||
8152 | ||
8153 | ||
8154 | ||
8155 | struct stat64 { | |
8156 | unsigned long long st_dev; | |
8157 | unsigned char __pad1[4]; | |
8158 | ||
8159 | ||
8160 | unsigned long __st_ino; | |
8161 | ||
8162 | unsigned int st_mode; | |
8163 | unsigned int st_nlink; | |
8164 | ||
8165 | unsigned long st_uid; | |
8166 | unsigned long st_gid; | |
8167 | ||
8168 | unsigned long long st_rdev; | |
8169 | unsigned char __pad2[4]; | |
8170 | ||
8171 | long long st_size; | |
8172 | unsigned long st_blksize; | |
8173 | ||
8174 | long long st_blocks; | |
8175 | ||
8176 | unsigned long st_atime; | |
8177 | unsigned long st_atime_nsec; | |
8178 | ||
8179 | unsigned long st_mtime; | |
8180 | unsigned long st_mtime_nsec; | |
8181 | ||
8182 | unsigned long st_ctime; | |
8183 | unsigned long st_ctime_nsec; | |
8184 | ||
8185 | unsigned long long st_ino; | |
8186 | }; | |
8187 | # 7 "include/linux/stat.h" 2 | |
8188 | # 59 "include/linux/stat.h" | |
8189 | struct kstat { | |
8190 | u64 ino; | |
8191 | dev_t dev; | |
8192 | umode_t mode; | |
8193 | unsigned int nlink; | |
8194 | uid_t uid; | |
8195 | gid_t gid; | |
8196 | dev_t rdev; | |
8197 | loff_t size; | |
8198 | struct timespec atime; | |
8199 | struct timespec mtime; | |
8200 | struct timespec ctime; | |
8201 | unsigned long blksize; | |
8202 | unsigned long long blocks; | |
8203 | }; | |
8204 | # 273 "include/linux/fs.h" 2 | |
8205 | ||
8206 | ||
8207 | ||
8208 | # 1 "include/linux/radix-tree.h" 1 | |
8209 | # 29 "include/linux/radix-tree.h" | |
8210 | struct radix_tree_root { | |
8211 | unsigned int height; | |
8212 | gfp_t gfp_mask; | |
8213 | struct radix_tree_node *rnode; | |
8214 | }; | |
8215 | # 51 "include/linux/radix-tree.h" | |
8216 | int radix_tree_insert(struct radix_tree_root *, unsigned long, void *); | |
8217 | void *radix_tree_lookup(struct radix_tree_root *, unsigned long); | |
8218 | void **radix_tree_lookup_slot(struct radix_tree_root *, unsigned long); | |
8219 | void *radix_tree_delete(struct radix_tree_root *, unsigned long); | |
8220 | unsigned int | |
8221 | radix_tree_gang_lookup(struct radix_tree_root *root, void **results, | |
8222 | unsigned long first_index, unsigned int max_items); | |
8223 | int radix_tree_preload(gfp_t gfp_mask); | |
8224 | void radix_tree_init(void); | |
8225 | void *radix_tree_tag_set(struct radix_tree_root *root, | |
8226 | unsigned long index, unsigned int tag); | |
8227 | void *radix_tree_tag_clear(struct radix_tree_root *root, | |
8228 | unsigned long index, unsigned int tag); | |
8229 | int radix_tree_tag_get(struct radix_tree_root *root, | |
8230 | unsigned long index, unsigned int tag); | |
8231 | unsigned int | |
8232 | radix_tree_gang_lookup_tag(struct radix_tree_root *root, void **results, | |
8233 | unsigned long first_index, unsigned int max_items, | |
8234 | unsigned int tag); | |
8235 | int radix_tree_tagged(struct radix_tree_root *root, unsigned int tag); | |
8236 | ||
8237 | static inline __attribute__((always_inline)) void radix_tree_preload_end(void) | |
8238 | { | |
8239 | do { } while (0); | |
8240 | } | |
8241 | # 277 "include/linux/fs.h" 2 | |
8242 | # 286 "include/linux/fs.h" | |
8243 | struct hd_geometry; | |
8244 | struct iovec; | |
8245 | struct nameidata; | |
8246 | struct kiocb; | |
8247 | struct pipe_inode_info; | |
8248 | struct poll_table_struct; | |
8249 | struct kstatfs; | |
8250 | struct vm_area_struct; | |
8251 | struct vfsmount; | |
8252 | ||
8253 | extern void __attribute__ ((__section__ (".init.text"))) inode_init(unsigned long); | |
8254 | extern void __attribute__ ((__section__ (".init.text"))) inode_init_early(void); | |
8255 | extern void __attribute__ ((__section__ (".init.text"))) mnt_init(unsigned long); | |
8256 | extern void __attribute__ ((__section__ (".init.text"))) files_init(unsigned long); | |
8257 | ||
8258 | struct buffer_head; | |
8259 | typedef int (get_block_t)(struct inode *inode, sector_t iblock, | |
8260 | struct buffer_head *bh_result, int create); | |
8261 | typedef void (dio_iodone_t)(struct kiocb *iocb, loff_t offset, | |
8262 | ssize_t bytes, void *private); | |
8263 | # 335 "include/linux/fs.h" | |
8264 | struct iattr { | |
8265 | unsigned int ia_valid; | |
8266 | umode_t ia_mode; | |
8267 | uid_t ia_uid; | |
8268 | gid_t ia_gid; | |
8269 | loff_t ia_size; | |
8270 | struct timespec ia_atime; | |
8271 | struct timespec ia_mtime; | |
8272 | struct timespec ia_ctime; | |
8273 | ||
8274 | ||
8275 | ||
8276 | ||
8277 | ||
8278 | ||
8279 | struct file *ia_file; | |
8280 | }; | |
8281 | ||
8282 | ||
8283 | ||
8284 | ||
8285 | # 1 "include/linux/quota.h" 1 | |
8286 | # 44 "include/linux/quota.h" | |
8287 | typedef __kernel_uid32_t qid_t; | |
8288 | typedef __u64 qsize_t; | |
8289 | ||
8290 | extern spinlock_t dq_data_lock; | |
8291 | # 105 "include/linux/quota.h" | |
8292 | struct if_dqblk { | |
8293 | __u64 dqb_bhardlimit; | |
8294 | __u64 dqb_bsoftlimit; | |
8295 | __u64 dqb_curspace; | |
8296 | __u64 dqb_ihardlimit; | |
8297 | __u64 dqb_isoftlimit; | |
8298 | __u64 dqb_curinodes; | |
8299 | __u64 dqb_btime; | |
8300 | __u64 dqb_itime; | |
8301 | __u32 dqb_valid; | |
8302 | }; | |
8303 | # 126 "include/linux/quota.h" | |
8304 | struct if_dqinfo { | |
8305 | __u64 dqi_bgrace; | |
8306 | __u64 dqi_igrace; | |
8307 | __u32 dqi_flags; | |
8308 | __u32 dqi_valid; | |
8309 | }; | |
8310 | ||
8311 | ||
8312 | ||
8313 | ||
8314 | ||
8315 | # 1 "include/linux/dqblk_xfs.h" 1 | |
8316 | # 50 "include/linux/dqblk_xfs.h" | |
8317 | typedef struct fs_disk_quota { | |
8318 | __s8 d_version; | |
8319 | __s8 d_flags; | |
8320 | __u16 d_fieldmask; | |
8321 | __u32 d_id; | |
8322 | __u64 d_blk_hardlimit; | |
8323 | __u64 d_blk_softlimit; | |
8324 | __u64 d_ino_hardlimit; | |
8325 | __u64 d_ino_softlimit; | |
8326 | __u64 d_bcount; | |
8327 | __u64 d_icount; | |
8328 | __s32 d_itimer; | |
8329 | ||
8330 | __s32 d_btimer; | |
8331 | __u16 d_iwarns; | |
8332 | __u16 d_bwarns; | |
8333 | __s32 d_padding2; | |
8334 | __u64 d_rtb_hardlimit; | |
8335 | __u64 d_rtb_softlimit; | |
8336 | __u64 d_rtbcount; | |
8337 | __s32 d_rtbtimer; | |
8338 | __u16 d_rtbwarns; | |
8339 | __s16 d_padding3; | |
8340 | char d_padding4[8]; | |
8341 | } fs_disk_quota_t; | |
8342 | # 137 "include/linux/dqblk_xfs.h" | |
8343 | typedef struct fs_qfilestat { | |
8344 | __u64 qfs_ino; | |
8345 | __u64 qfs_nblks; | |
8346 | __u32 qfs_nextents; | |
8347 | } fs_qfilestat_t; | |
8348 | ||
8349 | typedef struct fs_quota_stat { | |
8350 | __s8 qs_version; | |
8351 | __u16 qs_flags; | |
8352 | __s8 qs_pad; | |
8353 | fs_qfilestat_t qs_uquota; | |
8354 | fs_qfilestat_t qs_gquota; | |
8355 | __u32 qs_incoredqs; | |
8356 | __s32 qs_btimelimit; | |
8357 | __s32 qs_itimelimit; | |
8358 | __s32 qs_rtbtimelimit; | |
8359 | __u16 qs_bwarnlimit; | |
8360 | __u16 qs_iwarnlimit; | |
8361 | } fs_quota_stat_t; | |
8362 | # 138 "include/linux/quota.h" 2 | |
8363 | # 1 "include/linux/dqblk_v1.h" 1 | |
8364 | # 21 "include/linux/dqblk_v1.h" | |
8365 | struct v1_mem_dqinfo { | |
8366 | }; | |
8367 | # 139 "include/linux/quota.h" 2 | |
8368 | # 1 "include/linux/dqblk_v2.h" 1 | |
8369 | # 20 "include/linux/dqblk_v2.h" | |
8370 | struct v2_mem_dqinfo { | |
8371 | unsigned int dqi_blocks; | |
8372 | unsigned int dqi_free_blk; | |
8373 | unsigned int dqi_free_entry; | |
8374 | }; | |
8375 | # 140 "include/linux/quota.h" 2 | |
8376 | # 151 "include/linux/quota.h" | |
8377 | struct mem_dqblk { | |
8378 | __u32 dqb_bhardlimit; | |
8379 | __u32 dqb_bsoftlimit; | |
8380 | qsize_t dqb_curspace; | |
8381 | __u32 dqb_ihardlimit; | |
8382 | __u32 dqb_isoftlimit; | |
8383 | __u32 dqb_curinodes; | |
8384 | time_t dqb_btime; | |
8385 | time_t dqb_itime; | |
8386 | }; | |
8387 | ||
8388 | ||
8389 | ||
8390 | ||
8391 | struct quota_format_type; | |
8392 | ||
8393 | struct mem_dqinfo { | |
8394 | struct quota_format_type *dqi_format; | |
8395 | struct list_head dqi_dirty_list; | |
8396 | unsigned long dqi_flags; | |
8397 | unsigned int dqi_bgrace; | |
8398 | unsigned int dqi_igrace; | |
8399 | union { | |
8400 | struct v1_mem_dqinfo v1_i; | |
8401 | struct v2_mem_dqinfo v2_i; | |
8402 | } u; | |
8403 | }; | |
8404 | ||
8405 | struct super_block; | |
8406 | ||
8407 | ||
8408 | ||
8409 | ||
8410 | ||
8411 | extern void mark_info_dirty(struct super_block *sb, int type); | |
8412 | ||
8413 | ||
8414 | ||
8415 | ||
8416 | ||
8417 | ||
8418 | ||
8419 | struct dqstats { | |
8420 | int lookups; | |
8421 | int drops; | |
8422 | int reads; | |
8423 | int writes; | |
8424 | int cache_hits; | |
8425 | int allocated_dquots; | |
8426 | int free_dquots; | |
8427 | int syncs; | |
8428 | }; | |
8429 | ||
8430 | extern struct dqstats dqstats; | |
8431 | # 213 "include/linux/quota.h" | |
8432 | struct dquot { | |
8433 | struct hlist_node dq_hash; | |
8434 | struct list_head dq_inuse; | |
8435 | struct list_head dq_free; | |
8436 | struct list_head dq_dirty; | |
8437 | struct mutex dq_lock; | |
8438 | atomic_t dq_count; | |
8439 | wait_queue_head_t dq_wait_unused; | |
8440 | struct super_block *dq_sb; | |
8441 | unsigned int dq_id; | |
8442 | loff_t dq_off; | |
8443 | unsigned long dq_flags; | |
8444 | short dq_type; | |
8445 | struct mem_dqblk dq_dqb; | |
8446 | }; | |
8447 | ||
8448 | ||
8449 | ||
8450 | ||
8451 | ||
8452 | ||
8453 | ||
8454 | struct quota_format_ops { | |
8455 | int (*check_quota_file)(struct super_block *sb, int type); | |
8456 | int (*read_file_info)(struct super_block *sb, int type); | |
8457 | int (*write_file_info)(struct super_block *sb, int type); | |
8458 | int (*free_file_info)(struct super_block *sb, int type); | |
8459 | int (*read_dqblk)(struct dquot *dquot); | |
8460 | int (*commit_dqblk)(struct dquot *dquot); | |
8461 | int (*release_dqblk)(struct dquot *dquot); | |
8462 | }; | |
8463 | ||
8464 | ||
8465 | struct dquot_operations { | |
8466 | int (*initialize) (struct inode *, int); | |
8467 | int (*drop) (struct inode *); | |
8468 | int (*alloc_space) (struct inode *, qsize_t, int); | |
8469 | int (*alloc_inode) (const struct inode *, unsigned long); | |
8470 | int (*free_space) (struct inode *, qsize_t); | |
8471 | int (*free_inode) (const struct inode *, unsigned long); | |
8472 | int (*transfer) (struct inode *, struct iattr *); | |
8473 | int (*write_dquot) (struct dquot *); | |
8474 | int (*acquire_dquot) (struct dquot *); | |
8475 | int (*release_dquot) (struct dquot *); | |
8476 | int (*mark_dirty) (struct dquot *); | |
8477 | int (*write_info) (struct super_block *, int); | |
8478 | }; | |
8479 | ||
8480 | ||
8481 | struct quotactl_ops { | |
8482 | int (*quota_on)(struct super_block *, int, int, char *); | |
8483 | int (*quota_off)(struct super_block *, int); | |
8484 | int (*quota_sync)(struct super_block *, int); | |
8485 | int (*get_info)(struct super_block *, int, struct if_dqinfo *); | |
8486 | int (*set_info)(struct super_block *, int, struct if_dqinfo *); | |
8487 | int (*get_dqblk)(struct super_block *, int, qid_t, struct if_dqblk *); | |
8488 | int (*set_dqblk)(struct super_block *, int, qid_t, struct if_dqblk *); | |
8489 | int (*get_xstate)(struct super_block *, struct fs_quota_stat *); | |
8490 | int (*set_xstate)(struct super_block *, unsigned int, int); | |
8491 | int (*get_xquota)(struct super_block *, int, qid_t, struct fs_disk_quota *); | |
8492 | int (*set_xquota)(struct super_block *, int, qid_t, struct fs_disk_quota *); | |
8493 | }; | |
8494 | ||
8495 | struct quota_format_type { | |
8496 | int qf_fmt_id; | |
8497 | struct quota_format_ops *qf_ops; | |
8498 | struct module *qf_owner; | |
8499 | struct quota_format_type *qf_next; | |
8500 | }; | |
8501 | ||
8502 | ||
8503 | ||
8504 | ||
8505 | struct quota_info { | |
8506 | unsigned int flags; | |
8507 | struct mutex dqio_mutex; | |
8508 | struct mutex dqonoff_mutex; | |
8509 | struct rw_semaphore dqptr_sem; | |
8510 | struct inode *files[2]; | |
8511 | struct mem_dqinfo info[2]; | |
8512 | struct quota_format_ops *ops[2]; | |
8513 | }; | |
8514 | ||
8515 | ||
8516 | int mark_dquot_dirty(struct dquot *dquot); | |
8517 | # 307 "include/linux/quota.h" | |
8518 | int register_quota_format(struct quota_format_type *fmt); | |
8519 | void unregister_quota_format(struct quota_format_type *fmt); | |
8520 | ||
8521 | struct quota_module_name { | |
8522 | int qm_fmt_id; | |
8523 | char *qm_mod_name; | |
8524 | }; | |
8525 | # 357 "include/linux/fs.h" 2 | |
8526 | # 384 "include/linux/fs.h" | |
8527 | enum positive_aop_returns { | |
8528 | AOP_WRITEPAGE_ACTIVATE = 0x80000, | |
8529 | AOP_TRUNCATED_PAGE = 0x80001, | |
8530 | }; | |
8531 | ||
8532 | ||
8533 | ||
8534 | ||
8535 | struct page; | |
8536 | struct address_space; | |
8537 | struct writeback_control; | |
8538 | ||
8539 | struct address_space_operations { | |
8540 | int (*writepage)(struct page *page, struct writeback_control *wbc); | |
8541 | int (*readpage)(struct file *, struct page *); | |
8542 | void (*sync_page)(struct page *); | |
8543 | ||
8544 | ||
8545 | int (*writepages)(struct address_space *, struct writeback_control *); | |
8546 | ||
8547 | ||
8548 | int (*set_page_dirty)(struct page *page); | |
8549 | ||
8550 | int (*readpages)(struct file *filp, struct address_space *mapping, | |
8551 | struct list_head *pages, unsigned nr_pages); | |
8552 | ||
8553 | ||
8554 | ||
8555 | ||
8556 | ||
8557 | int (*prepare_write)(struct file *, struct page *, unsigned, unsigned); | |
8558 | int (*commit_write)(struct file *, struct page *, unsigned, unsigned); | |
8559 | ||
8560 | sector_t (*bmap)(struct address_space *, sector_t); | |
8561 | void (*invalidatepage) (struct page *, unsigned long); | |
8562 | int (*releasepage) (struct page *, gfp_t); | |
8563 | ssize_t (*direct_IO)(int, struct kiocb *, const struct iovec *iov, | |
8564 | loff_t offset, unsigned long nr_segs); | |
8565 | struct page* (*get_xip_page)(struct address_space *, sector_t, | |
8566 | int); | |
8567 | ||
8568 | int (*migratepage) (struct address_space *, | |
8569 | struct page *, struct page *); | |
8570 | }; | |
8571 | ||
8572 | struct backing_dev_info; | |
8573 | struct address_space { | |
8574 | struct inode *host; | |
8575 | struct radix_tree_root page_tree; | |
8576 | rwlock_t tree_lock; | |
8577 | unsigned int i_mmap_writable; | |
8578 | struct prio_tree_root i_mmap; | |
8579 | struct list_head i_mmap_nonlinear; | |
8580 | spinlock_t i_mmap_lock; | |
8581 | unsigned int truncate_count; | |
8582 | unsigned long nrpages; | |
8583 | unsigned long writeback_index; | |
8584 | const struct address_space_operations *a_ops; | |
8585 | unsigned long flags; | |
8586 | struct backing_dev_info *backing_dev_info; | |
8587 | spinlock_t private_lock; | |
8588 | struct list_head private_list; | |
8589 | struct address_space *assoc_mapping; | |
8590 | ||
8591 | ||
8592 | ||
8593 | ||
8594 | } __attribute__((aligned(sizeof(long)))); | |
8595 | ||
8596 | ||
8597 | ||
8598 | ||
8599 | ||
8600 | ||
8601 | struct block_device { | |
8602 | dev_t bd_dev; | |
8603 | struct inode * bd_inode; | |
8604 | int bd_openers; | |
8605 | struct mutex bd_mutex; | |
8606 | struct mutex bd_mount_mutex; | |
8607 | struct list_head bd_inodes; | |
8608 | void * bd_holder; | |
8609 | int bd_holders; | |
8610 | ||
8611 | struct list_head bd_holder_list; | |
8612 | ||
8613 | struct block_device * bd_contains; | |
8614 | unsigned bd_block_size; | |
8615 | struct hd_struct * bd_part; | |
8616 | ||
8617 | unsigned bd_part_count; | |
8618 | int bd_invalidated; | |
8619 | struct gendisk * bd_disk; | |
8620 | struct list_head bd_list; | |
8621 | struct backing_dev_info *bd_inode_backing_dev_info; | |
8622 | ||
8623 | ||
8624 | ||
8625 | ||
8626 | ||
8627 | ||
8628 | unsigned long bd_private; | |
8629 | }; | |
8630 | # 495 "include/linux/fs.h" | |
8631 | enum bdev_bd_mutex_lock_class | |
8632 | { | |
8633 | BD_MUTEX_NORMAL, | |
8634 | BD_MUTEX_WHOLE, | |
8635 | BD_MUTEX_PARTITION | |
8636 | }; | |
8637 | # 510 "include/linux/fs.h" | |
8638 | int mapping_tagged(struct address_space *mapping, int tag); | |
8639 | ||
8640 | ||
8641 | ||
8642 | ||
8643 | static inline __attribute__((always_inline)) int mapping_mapped(struct address_space *mapping) | |
8644 | { | |
8645 | return !prio_tree_empty(&mapping->i_mmap) || | |
8646 | !list_empty(&mapping->i_mmap_nonlinear); | |
8647 | } | |
8648 | ||
8649 | ||
8650 | ||
8651 | ||
8652 | ||
8653 | ||
8654 | ||
8655 | static inline __attribute__((always_inline)) int mapping_writably_mapped(struct address_space *mapping) | |
8656 | { | |
8657 | return mapping->i_mmap_writable != 0; | |
8658 | } | |
8659 | # 543 "include/linux/fs.h" | |
8660 | struct inode { | |
8661 | struct hlist_node i_hash; | |
8662 | struct list_head i_list; | |
8663 | struct list_head i_sb_list; | |
8664 | struct list_head i_dentry; | |
8665 | unsigned long i_ino; | |
8666 | atomic_t i_count; | |
8667 | umode_t i_mode; | |
8668 | unsigned int i_nlink; | |
8669 | uid_t i_uid; | |
8670 | gid_t i_gid; | |
8671 | dev_t i_rdev; | |
8672 | loff_t i_size; | |
8673 | struct timespec i_atime; | |
8674 | struct timespec i_mtime; | |
8675 | struct timespec i_ctime; | |
8676 | unsigned int i_blkbits; | |
8677 | unsigned long i_version; | |
8678 | blkcnt_t i_blocks; | |
8679 | unsigned short i_bytes; | |
8680 | spinlock_t i_lock; | |
8681 | struct mutex i_mutex; | |
8682 | struct rw_semaphore i_alloc_sem; | |
8683 | struct inode_operations *i_op; | |
8684 | const struct file_operations *i_fop; | |
8685 | struct super_block *i_sb; | |
8686 | struct file_lock *i_flock; | |
8687 | struct address_space *i_mapping; | |
8688 | struct address_space i_data; | |
8689 | ||
8690 | ||
8691 | ||
8692 | struct list_head i_devices; | |
8693 | union { | |
8694 | struct pipe_inode_info *i_pipe; | |
8695 | struct block_device *i_bdev; | |
8696 | struct cdev *i_cdev; | |
8697 | }; | |
8698 | int i_cindex; | |
8699 | ||
8700 | __u32 i_generation; | |
8701 | # 595 "include/linux/fs.h" | |
8702 | unsigned long i_state; | |
8703 | unsigned long dirtied_when; | |
8704 | ||
8705 | unsigned int i_flags; | |
8706 | ||
8707 | atomic_t i_writecount; | |
8708 | ||
8709 | ||
8710 | ||
8711 | void *i_private; | |
8712 | ||
8713 | ||
8714 | ||
8715 | }; | |
8716 | # 621 "include/linux/fs.h" | |
8717 | enum inode_i_mutex_lock_class | |
8718 | { | |
8719 | I_MUTEX_NORMAL, | |
8720 | I_MUTEX_PARENT, | |
8721 | I_MUTEX_CHILD, | |
8722 | I_MUTEX_XATTR, | |
8723 | I_MUTEX_QUOTA | |
8724 | }; | |
8725 | ||
8726 | extern void inode_double_lock(struct inode *inode1, struct inode *inode2); | |
8727 | extern void inode_double_unlock(struct inode *inode1, struct inode *inode2); | |
8728 | # 643 "include/linux/fs.h" | |
8729 | static inline __attribute__((always_inline)) loff_t i_size_read(struct inode *inode) | |
8730 | { | |
8731 | # 662 "include/linux/fs.h" | |
8732 | return inode->i_size; | |
8733 | ||
8734 | } | |
8735 | ||
8736 | ||
8737 | ||
8738 | ||
8739 | ||
8740 | ||
8741 | static inline __attribute__((always_inline)) void i_size_write(struct inode *inode, loff_t i_size) | |
8742 | { | |
8743 | # 682 "include/linux/fs.h" | |
8744 | inode->i_size = i_size; | |
8745 | ||
8746 | } | |
8747 | ||
8748 | static inline __attribute__((always_inline)) unsigned iminor(struct inode *inode) | |
8749 | { | |
8750 | return ((unsigned int) ((inode->i_rdev) & ((1U << 20) - 1))); | |
8751 | } | |
8752 | ||
8753 | static inline __attribute__((always_inline)) unsigned imajor(struct inode *inode) | |
8754 | { | |
8755 | return ((unsigned int) ((inode->i_rdev) >> 20)); | |
8756 | } | |
8757 | ||
8758 | extern struct block_device *I_BDEV(struct inode *inode); | |
8759 | ||
8760 | struct fown_struct { | |
8761 | rwlock_t lock; | |
8762 | struct pid *pid; | |
8763 | enum pid_type pid_type; | |
8764 | uid_t uid, euid; | |
8765 | int signum; | |
8766 | }; | |
8767 | ||
8768 | ||
8769 | ||
8770 | ||
8771 | struct file_ra_state { | |
8772 | unsigned long start; | |
8773 | unsigned long size; | |
8774 | unsigned long flags; | |
8775 | unsigned long cache_hit; | |
8776 | unsigned long prev_page; | |
8777 | unsigned long ahead_start; | |
8778 | unsigned long ahead_size; | |
8779 | unsigned long ra_pages; | |
8780 | unsigned long mmap_hit; | |
8781 | unsigned long mmap_miss; | |
8782 | }; | |
8783 | ||
8784 | ||
8785 | ||
8786 | struct file { | |
8787 | ||
8788 | ||
8789 | ||
8790 | ||
8791 | union { | |
8792 | struct list_head fu_list; | |
8793 | struct rcu_head fu_rcuhead; | |
8794 | } f_u; | |
8795 | struct dentry *f_dentry; | |
8796 | struct vfsmount *f_vfsmnt; | |
8797 | const struct file_operations *f_op; | |
8798 | atomic_t f_count; | |
8799 | unsigned int f_flags; | |
8800 | mode_t f_mode; | |
8801 | loff_t f_pos; | |
8802 | struct fown_struct f_owner; | |
8803 | unsigned int f_uid, f_gid; | |
8804 | struct file_ra_state f_ra; | |
8805 | ||
8806 | unsigned long f_version; | |
8807 | ||
8808 | ||
8809 | ||
8810 | ||
8811 | void *private_data; | |
8812 | ||
8813 | ||
8814 | ||
8815 | struct list_head f_ep_links; | |
8816 | spinlock_t f_ep_lock; | |
8817 | ||
8818 | struct address_space *f_mapping; | |
8819 | }; | |
8820 | extern spinlock_t files_lock; | |
8821 | # 790 "include/linux/fs.h" | |
8822 | typedef struct files_struct *fl_owner_t; | |
8823 | ||
8824 | struct file_lock_operations { | |
8825 | void (*fl_insert)(struct file_lock *); | |
8826 | void (*fl_remove)(struct file_lock *); | |
8827 | void (*fl_copy_lock)(struct file_lock *, struct file_lock *); | |
8828 | void (*fl_release_private)(struct file_lock *); | |
8829 | }; | |
8830 | ||
8831 | struct lock_manager_operations { | |
8832 | int (*fl_compare_owner)(struct file_lock *, struct file_lock *); | |
8833 | void (*fl_notify)(struct file_lock *); | |
8834 | void (*fl_copy_lock)(struct file_lock *, struct file_lock *); | |
8835 | void (*fl_release_private)(struct file_lock *); | |
8836 | void (*fl_break)(struct file_lock *); | |
8837 | int (*fl_mylease)(struct file_lock *, struct file_lock *); | |
8838 | int (*fl_change)(struct file_lock **, int); | |
8839 | }; | |
8840 | ||
8841 | ||
8842 | # 1 "include/linux/nfs_fs_i.h" 1 | |
8843 | ||
8844 | ||
8845 | ||
8846 | ||
8847 | ||
8848 | # 1 "include/linux/nfs.h" 1 | |
8849 | # 39 "include/linux/nfs.h" | |
8850 | enum nfs_stat { | |
8851 | NFS_OK = 0, | |
8852 | NFSERR_PERM = 1, | |
8853 | NFSERR_NOENT = 2, | |
8854 | NFSERR_IO = 5, | |
8855 | NFSERR_NXIO = 6, | |
8856 | NFSERR_EAGAIN = 11, | |
8857 | NFSERR_ACCES = 13, | |
8858 | NFSERR_EXIST = 17, | |
8859 | NFSERR_XDEV = 18, | |
8860 | NFSERR_NODEV = 19, | |
8861 | NFSERR_NOTDIR = 20, | |
8862 | NFSERR_ISDIR = 21, | |
8863 | NFSERR_INVAL = 22, | |
8864 | NFSERR_FBIG = 27, | |
8865 | NFSERR_NOSPC = 28, | |
8866 | NFSERR_ROFS = 30, | |
8867 | NFSERR_MLINK = 31, | |
8868 | NFSERR_OPNOTSUPP = 45, | |
8869 | NFSERR_NAMETOOLONG = 63, | |
8870 | NFSERR_NOTEMPTY = 66, | |
8871 | NFSERR_DQUOT = 69, | |
8872 | NFSERR_STALE = 70, | |
8873 | NFSERR_REMOTE = 71, | |
8874 | NFSERR_WFLUSH = 99, | |
8875 | NFSERR_BADHANDLE = 10001, | |
8876 | NFSERR_NOT_SYNC = 10002, | |
8877 | NFSERR_BAD_COOKIE = 10003, | |
8878 | NFSERR_NOTSUPP = 10004, | |
8879 | NFSERR_TOOSMALL = 10005, | |
8880 | NFSERR_SERVERFAULT = 10006, | |
8881 | NFSERR_BADTYPE = 10007, | |
8882 | NFSERR_JUKEBOX = 10008, | |
8883 | NFSERR_SAME = 10009, | |
8884 | NFSERR_DENIED = 10010, | |
8885 | NFSERR_EXPIRED = 10011, | |
8886 | NFSERR_LOCKED = 10012, | |
8887 | NFSERR_GRACE = 10013, | |
8888 | NFSERR_FHEXPIRED = 10014, | |
8889 | NFSERR_SHARE_DENIED = 10015, | |
8890 | NFSERR_WRONGSEC = 10016, | |
8891 | NFSERR_CLID_INUSE = 10017, | |
8892 | NFSERR_RESOURCE = 10018, | |
8893 | NFSERR_MOVED = 10019, | |
8894 | NFSERR_NOFILEHANDLE = 10020, | |
8895 | NFSERR_MINOR_VERS_MISMATCH = 10021, | |
8896 | NFSERR_STALE_CLIENTID = 10022, | |
8897 | NFSERR_STALE_STATEID = 10023, | |
8898 | NFSERR_OLD_STATEID = 10024, | |
8899 | NFSERR_BAD_STATEID = 10025, | |
8900 | NFSERR_BAD_SEQID = 10026, | |
8901 | NFSERR_NOT_SAME = 10027, | |
8902 | NFSERR_LOCK_RANGE = 10028, | |
8903 | NFSERR_SYMLINK = 10029, | |
8904 | NFSERR_RESTOREFH = 10030, | |
8905 | NFSERR_LEASE_MOVED = 10031, | |
8906 | NFSERR_ATTRNOTSUPP = 10032, | |
8907 | NFSERR_NO_GRACE = 10033, | |
8908 | NFSERR_RECLAIM_BAD = 10034, | |
8909 | NFSERR_RECLAIM_CONFLICT = 10035, | |
8910 | NFSERR_BAD_XDR = 10036, | |
8911 | NFSERR_LOCKS_HELD = 10037, | |
8912 | NFSERR_OPENMODE = 10038, | |
8913 | NFSERR_BADOWNER = 10039, | |
8914 | NFSERR_BADCHAR = 10040, | |
8915 | NFSERR_BADNAME = 10041, | |
8916 | NFSERR_BAD_RANGE = 10042, | |
8917 | NFSERR_LOCK_NOTSUPP = 10043, | |
8918 | NFSERR_OP_ILLEGAL = 10044, | |
8919 | NFSERR_DEADLOCK = 10045, | |
8920 | NFSERR_FILE_OPEN = 10046, | |
8921 | NFSERR_ADMIN_REVOKED = 10047, | |
8922 | NFSERR_CB_PATH_DOWN = 10048, | |
8923 | NFSERR_REPLAY_ME = 10049 | |
8924 | }; | |
8925 | ||
8926 | ||
8927 | ||
8928 | enum nfs_ftype { | |
8929 | NFNON = 0, | |
8930 | NFREG = 1, | |
8931 | NFDIR = 2, | |
8932 | NFBLK = 3, | |
8933 | NFCHR = 4, | |
8934 | NFLNK = 5, | |
8935 | NFSOCK = 6, | |
8936 | NFBAD = 7, | |
8937 | NFFIFO = 8 | |
8938 | }; | |
8939 | ||
8940 | ||
8941 | # 1 "include/linux/sunrpc/msg_prot.h" 1 | |
8942 | # 18 "include/linux/sunrpc/msg_prot.h" | |
8943 | typedef u32 rpc_authflavor_t; | |
8944 | ||
8945 | enum rpc_auth_flavors { | |
8946 | RPC_AUTH_NULL = 0, | |
8947 | RPC_AUTH_UNIX = 1, | |
8948 | RPC_AUTH_SHORT = 2, | |
8949 | RPC_AUTH_DES = 3, | |
8950 | RPC_AUTH_KRB = 4, | |
8951 | RPC_AUTH_GSS = 6, | |
8952 | RPC_AUTH_MAXFLAVOR = 8, | |
8953 | ||
8954 | RPC_AUTH_GSS_KRB5 = 390003, | |
8955 | RPC_AUTH_GSS_KRB5I = 390004, | |
8956 | RPC_AUTH_GSS_KRB5P = 390005, | |
8957 | RPC_AUTH_GSS_LKEY = 390006, | |
8958 | RPC_AUTH_GSS_LKEYI = 390007, | |
8959 | RPC_AUTH_GSS_LKEYP = 390008, | |
8960 | RPC_AUTH_GSS_SPKM = 390009, | |
8961 | RPC_AUTH_GSS_SPKMI = 390010, | |
8962 | RPC_AUTH_GSS_SPKMP = 390011, | |
8963 | }; | |
8964 | ||
8965 | ||
8966 | ||
8967 | ||
8968 | enum rpc_msg_type { | |
8969 | RPC_CALL = 0, | |
8970 | RPC_REPLY = 1 | |
8971 | }; | |
8972 | ||
8973 | enum rpc_reply_stat { | |
8974 | RPC_MSG_ACCEPTED = 0, | |
8975 | RPC_MSG_DENIED = 1 | |
8976 | }; | |
8977 | ||
8978 | enum rpc_accept_stat { | |
8979 | RPC_SUCCESS = 0, | |
8980 | RPC_PROG_UNAVAIL = 1, | |
8981 | RPC_PROG_MISMATCH = 2, | |
8982 | RPC_PROC_UNAVAIL = 3, | |
8983 | RPC_GARBAGE_ARGS = 4, | |
8984 | RPC_SYSTEM_ERR = 5, | |
8985 | ||
8986 | RPC_DROP_REPLY = 60000, | |
8987 | }; | |
8988 | ||
8989 | enum rpc_reject_stat { | |
8990 | RPC_MISMATCH = 0, | |
8991 | RPC_AUTH_ERROR = 1 | |
8992 | }; | |
8993 | ||
8994 | enum rpc_auth_stat { | |
8995 | RPC_AUTH_OK = 0, | |
8996 | RPC_AUTH_BADCRED = 1, | |
8997 | RPC_AUTH_REJECTEDCRED = 2, | |
8998 | RPC_AUTH_BADVERF = 3, | |
8999 | RPC_AUTH_REJECTEDVERF = 4, | |
9000 | RPC_AUTH_TOOWEAK = 5, | |
9001 | ||
9002 | RPCSEC_GSS_CREDPROBLEM = 13, | |
9003 | RPCSEC_GSS_CTXPROBLEM = 14 | |
9004 | }; | |
9005 | # 106 "include/linux/sunrpc/msg_prot.h" | |
9006 | typedef __be32 rpc_fraghdr; | |
9007 | # 131 "include/linux/nfs.h" 2 | |
9008 | ||
9009 | ||
9010 | ||
9011 | ||
9012 | ||
9013 | ||
9014 | struct nfs_fh { | |
9015 | unsigned short size; | |
9016 | unsigned char data[128]; | |
9017 | }; | |
9018 | ||
9019 | ||
9020 | ||
9021 | ||
9022 | ||
9023 | static inline __attribute__((always_inline)) int nfs_compare_fh(const struct nfs_fh *a, const struct nfs_fh *b) | |
9024 | { | |
9025 | return a->size != b->size || memcmp(a->data, b->data, a->size) != 0; | |
9026 | } | |
9027 | ||
9028 | static inline __attribute__((always_inline)) void nfs_copy_fh(struct nfs_fh *target, const struct nfs_fh *source) | |
9029 | { | |
9030 | target->size = source->size; | |
9031 | memcpy(target->data, source->data, source->size); | |
9032 | } | |
9033 | # 165 "include/linux/nfs.h" | |
9034 | enum nfs3_stable_how { | |
9035 | NFS_UNSTABLE = 0, | |
9036 | NFS_DATA_SYNC = 1, | |
9037 | NFS_FILE_SYNC = 2 | |
9038 | }; | |
9039 | # 7 "include/linux/nfs_fs_i.h" 2 | |
9040 | ||
9041 | struct nlm_lockowner; | |
9042 | ||
9043 | ||
9044 | ||
9045 | ||
9046 | struct nfs_lock_info { | |
9047 | u32 state; | |
9048 | struct nlm_lockowner *owner; | |
9049 | struct list_head list; | |
9050 | }; | |
9051 | ||
9052 | struct nfs4_lock_state; | |
9053 | struct nfs4_lock_info { | |
9054 | struct nfs4_lock_state *owner; | |
9055 | }; | |
9056 | # 811 "include/linux/fs.h" 2 | |
9057 | ||
9058 | struct file_lock { | |
9059 | struct file_lock *fl_next; | |
9060 | struct list_head fl_link; | |
9061 | struct list_head fl_block; | |
9062 | fl_owner_t fl_owner; | |
9063 | unsigned int fl_pid; | |
9064 | wait_queue_head_t fl_wait; | |
9065 | struct file *fl_file; | |
9066 | unsigned char fl_flags; | |
9067 | unsigned char fl_type; | |
9068 | loff_t fl_start; | |
9069 | loff_t fl_end; | |
9070 | ||
9071 | struct fasync_struct * fl_fasync; | |
9072 | unsigned long fl_break_time; | |
9073 | ||
9074 | struct file_lock_operations *fl_ops; | |
9075 | struct lock_manager_operations *fl_lmops; | |
9076 | union { | |
9077 | struct nfs_lock_info nfs_fl; | |
9078 | struct nfs4_lock_info nfs4_fl; | |
9079 | } fl_u; | |
9080 | }; | |
9081 | # 843 "include/linux/fs.h" | |
9082 | # 1 "include/linux/fcntl.h" 1 | |
9083 | ||
9084 | ||
9085 | ||
9086 | # 1 "include/asm/fcntl.h" 1 | |
9087 | # 11 "include/asm/fcntl.h" | |
9088 | # 1 "include/asm-generic/fcntl.h" 1 | |
9089 | # 114 "include/asm-generic/fcntl.h" | |
9090 | struct flock { | |
9091 | short l_type; | |
9092 | short l_whence; | |
9093 | off_t l_start; | |
9094 | off_t l_len; | |
9095 | pid_t l_pid; | |
9096 | ||
9097 | }; | |
9098 | # 137 "include/asm-generic/fcntl.h" | |
9099 | struct flock64 { | |
9100 | short l_type; | |
9101 | short l_whence; | |
9102 | loff_t l_start; | |
9103 | loff_t l_len; | |
9104 | pid_t l_pid; | |
9105 | ||
9106 | }; | |
9107 | # 12 "include/asm/fcntl.h" 2 | |
9108 | # 5 "include/linux/fcntl.h" 2 | |
9109 | # 844 "include/linux/fs.h" 2 | |
9110 | ||
9111 | extern int fcntl_getlk(struct file *, struct flock *); | |
9112 | extern int fcntl_setlk(unsigned int, struct file *, unsigned int, | |
9113 | struct flock *); | |
9114 | ||
9115 | ||
9116 | extern int fcntl_getlk64(struct file *, struct flock64 *); | |
9117 | extern int fcntl_setlk64(unsigned int, struct file *, unsigned int, | |
9118 | struct flock64 *); | |
9119 | ||
9120 | ||
9121 | extern void send_sigio(struct fown_struct *fown, int fd, int band); | |
9122 | extern int fcntl_setlease(unsigned int fd, struct file *filp, long arg); | |
9123 | extern int fcntl_getlease(struct file *filp); | |
9124 | ||
9125 | ||
9126 | extern int do_sync_file_range(struct file *file, loff_t offset, loff_t endbyte, | |
9127 | unsigned int flags); | |
9128 | ||
9129 | ||
9130 | extern void locks_init_lock(struct file_lock *); | |
9131 | extern void locks_copy_lock(struct file_lock *, struct file_lock *); | |
9132 | extern void locks_remove_posix(struct file *, fl_owner_t); | |
9133 | extern void locks_remove_flock(struct file *); | |
9134 | extern int posix_test_lock(struct file *, struct file_lock *, struct file_lock *); | |
9135 | extern int posix_lock_file_conf(struct file *, struct file_lock *, struct file_lock *); | |
9136 | extern int posix_lock_file(struct file *, struct file_lock *); | |
9137 | extern int posix_lock_file_wait(struct file *, struct file_lock *); | |
9138 | extern int posix_unblock_lock(struct file *, struct file_lock *); | |
9139 | extern int flock_lock_file_wait(struct file *filp, struct file_lock *fl); | |
9140 | extern int __break_lease(struct inode *inode, unsigned int flags); | |
9141 | extern void lease_get_mtime(struct inode *, struct timespec *time); | |
9142 | extern int setlease(struct file *, long, struct file_lock **); | |
9143 | extern int lease_modify(struct file_lock **, int); | |
9144 | extern int lock_may_read(struct inode *, loff_t start, unsigned long count); | |
9145 | extern int lock_may_write(struct inode *, loff_t start, unsigned long count); | |
9146 | ||
9147 | struct fasync_struct { | |
9148 | int magic; | |
9149 | int fa_fd; | |
9150 | struct fasync_struct *fa_next; | |
9151 | struct file *fa_file; | |
9152 | }; | |
9153 | ||
9154 | ||
9155 | ||
9156 | ||
9157 | extern int fasync_helper(int, struct file *, int, struct fasync_struct **); | |
9158 | ||
9159 | extern void kill_fasync(struct fasync_struct **, int, int); | |
9160 | ||
9161 | extern void __kill_fasync(struct fasync_struct *, int, int); | |
9162 | ||
9163 | extern int __f_setown(struct file *filp, struct pid *, enum pid_type, int force); | |
9164 | extern int f_setown(struct file *filp, unsigned long arg, int force); | |
9165 | extern void f_delown(struct file *filp); | |
9166 | extern pid_t f_getown(struct file *filp); | |
9167 | extern int send_sigurg(struct fown_struct *fown); | |
9168 | # 911 "include/linux/fs.h" | |
9169 | extern struct list_head super_blocks; | |
9170 | extern spinlock_t sb_lock; | |
9171 | ||
9172 | ||
9173 | ||
9174 | struct super_block { | |
9175 | struct list_head s_list; | |
9176 | dev_t s_dev; | |
9177 | unsigned long s_blocksize; | |
9178 | unsigned char s_blocksize_bits; | |
9179 | unsigned char s_dirt; | |
9180 | unsigned long long s_maxbytes; | |
9181 | struct file_system_type *s_type; | |
9182 | struct super_operations *s_op; | |
9183 | struct dquot_operations *dq_op; | |
9184 | struct quotactl_ops *s_qcop; | |
9185 | struct export_operations *s_export_op; | |
9186 | unsigned long s_flags; | |
9187 | unsigned long s_magic; | |
9188 | struct dentry *s_root; | |
9189 | struct rw_semaphore s_umount; | |
9190 | struct mutex s_lock; | |
9191 | int s_count; | |
9192 | int s_syncing; | |
9193 | int s_need_sync_fs; | |
9194 | atomic_t s_active; | |
9195 | ||
9196 | ||
9197 | ||
9198 | struct xattr_handler **s_xattr; | |
9199 | ||
9200 | struct list_head s_inodes; | |
9201 | struct list_head s_dirty; | |
9202 | struct list_head s_io; | |
9203 | struct hlist_head s_anon; | |
9204 | struct list_head s_files; | |
9205 | ||
9206 | struct block_device *s_bdev; | |
9207 | struct list_head s_instances; | |
9208 | struct quota_info s_dquot; | |
9209 | ||
9210 | int s_frozen; | |
9211 | wait_queue_head_t s_wait_unfrozen; | |
9212 | ||
9213 | char s_id[32]; | |
9214 | ||
9215 | void *s_fs_info; | |
9216 | ||
9217 | ||
9218 | ||
9219 | ||
9220 | ||
9221 | struct mutex s_vfs_rename_mutex; | |
9222 | ||
9223 | ||
9224 | ||
9225 | u32 s_time_gran; | |
9226 | }; | |
9227 | ||
9228 | extern struct timespec current_fs_time(struct super_block *sb); | |
9229 | ||
9230 | ||
9231 | ||
9232 | ||
9233 | enum { | |
9234 | SB_UNFROZEN = 0, | |
9235 | SB_FREEZE_WRITE = 1, | |
9236 | SB_FREEZE_TRANS = 2, | |
9237 | }; | |
9238 | ||
9239 | ||
9240 | ||
9241 | ||
9242 | static inline __attribute__((always_inline)) void get_fs_excl(void) | |
9243 | { | |
9244 | atomic_inc(&(get_current())->fs_excl); | |
9245 | } | |
9246 | ||
9247 | static inline __attribute__((always_inline)) void put_fs_excl(void) | |
9248 | { | |
9249 | atomic_dec(&(get_current())->fs_excl); | |
9250 | } | |
9251 | ||
9252 | static inline __attribute__((always_inline)) int has_fs_excl(void) | |
9253 | { | |
9254 | return ((&(get_current())->fs_excl)->counter); | |
9255 | } | |
9256 | ||
9257 | ||
9258 | ||
9259 | ||
9260 | ||
9261 | static inline __attribute__((always_inline)) void lock_super(struct super_block * sb) | |
9262 | { | |
9263 | get_fs_excl(); | |
9264 | mutex_lock(&sb->s_lock); | |
9265 | } | |
9266 | ||
9267 | static inline __attribute__((always_inline)) void unlock_super(struct super_block * sb) | |
9268 | { | |
9269 | put_fs_excl(); | |
9270 | mutex_unlock(&sb->s_lock); | |
9271 | } | |
9272 | ||
9273 | ||
9274 | ||
9275 | ||
9276 | extern int vfs_permission(struct nameidata *, int); | |
9277 | extern int vfs_create(struct inode *, struct dentry *, int, struct nameidata *); | |
9278 | extern int vfs_mkdir(struct inode *, struct dentry *, int); | |
9279 | extern int vfs_mknod(struct inode *, struct dentry *, int, dev_t); | |
9280 | extern int vfs_symlink(struct inode *, struct dentry *, const char *, int); | |
9281 | extern int vfs_link(struct dentry *, struct inode *, struct dentry *); | |
9282 | extern int vfs_rmdir(struct inode *, struct dentry *); | |
9283 | extern int vfs_unlink(struct inode *, struct dentry *); | |
9284 | extern int vfs_rename(struct inode *, struct dentry *, struct inode *, struct dentry *); | |
9285 | ||
9286 | ||
9287 | ||
9288 | ||
9289 | extern void dentry_unhash(struct dentry *dentry); | |
9290 | ||
9291 | ||
9292 | ||
9293 | ||
9294 | extern int file_permission(struct file *, int); | |
9295 | # 1057 "include/linux/fs.h" | |
9296 | int generic_osync_inode(struct inode *, struct address_space *, int); | |
9297 | ||
9298 | ||
9299 | ||
9300 | ||
9301 | ||
9302 | ||
9303 | ||
9304 | typedef int (*filldir_t)(void *, const char *, int, loff_t, u64, unsigned); | |
9305 | ||
9306 | struct block_device_operations { | |
9307 | int (*open) (struct inode *, struct file *); | |
9308 | int (*release) (struct inode *, struct file *); | |
9309 | int (*ioctl) (struct inode *, struct file *, unsigned, unsigned long); | |
9310 | long (*unlocked_ioctl) (struct file *, unsigned, unsigned long); | |
9311 | long (*compat_ioctl) (struct file *, unsigned, unsigned long); | |
9312 | int (*direct_access) (struct block_device *, sector_t, unsigned long *); | |
9313 | int (*media_changed) (struct gendisk *); | |
9314 | int (*revalidate_disk) (struct gendisk *); | |
9315 | int (*getgeo)(struct block_device *, struct hd_geometry *); | |
9316 | struct module *owner; | |
9317 | }; | |
9318 | # 1089 "include/linux/fs.h" | |
9319 | typedef struct { | |
9320 | size_t written; | |
9321 | size_t count; | |
9322 | union { | |
9323 | char * buf; | |
9324 | void *data; | |
9325 | } arg; | |
9326 | int error; | |
9327 | } read_descriptor_t; | |
9328 | ||
9329 | typedef int (*read_actor_t)(read_descriptor_t *, struct page *, unsigned long, unsigned long); | |
9330 | # 1112 "include/linux/fs.h" | |
9331 | struct file_operations { | |
9332 | struct module *owner; | |
9333 | loff_t (*llseek) (struct file *, loff_t, int); | |
9334 | ssize_t (*read) (struct file *, char *, size_t, loff_t *); | |
9335 | ssize_t (*write) (struct file *, const char *, size_t, loff_t *); | |
9336 | ssize_t (*aio_read) (struct kiocb *, const struct iovec *, unsigned long, loff_t); | |
9337 | ssize_t (*aio_write) (struct kiocb *, const struct iovec *, unsigned long, loff_t); | |
9338 | int (*readdir) (struct file *, void *, filldir_t); | |
9339 | unsigned int (*poll) (struct file *, struct poll_table_struct *); | |
9340 | int (*ioctl) (struct inode *, struct file *, unsigned int, unsigned long); | |
9341 | long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long); | |
9342 | long (*compat_ioctl) (struct file *, unsigned int, unsigned long); | |
9343 | int (*mmap) (struct file *, struct vm_area_struct *); | |
9344 | int (*open) (struct inode *, struct file *); | |
9345 | int (*flush) (struct file *, fl_owner_t id); | |
9346 | int (*release) (struct inode *, struct file *); | |
9347 | int (*fsync) (struct file *, struct dentry *, int datasync); | |
9348 | int (*aio_fsync) (struct kiocb *, int datasync); | |
9349 | int (*fasync) (int, struct file *, int); | |
9350 | int (*lock) (struct file *, int, struct file_lock *); | |
9351 | ssize_t (*sendfile) (struct file *, loff_t *, size_t, read_actor_t, void *); | |
9352 | ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int); | |
9353 | unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long); | |
9354 | int (*check_flags)(int); | |
9355 | int (*dir_notify)(struct file *filp, unsigned long arg); | |
9356 | int (*flock) (struct file *, int, struct file_lock *); | |
9357 | ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int); | |
9358 | ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int); | |
9359 | }; | |
9360 | ||
9361 | struct inode_operations { | |
9362 | int (*create) (struct inode *,struct dentry *,int, struct nameidata *); | |
9363 | struct dentry * (*lookup) (struct inode *,struct dentry *, struct nameidata *); | |
9364 | int (*link) (struct dentry *,struct inode *,struct dentry *); | |
9365 | int (*unlink) (struct inode *,struct dentry *); | |
9366 | int (*symlink) (struct inode *,struct dentry *,const char *); | |
9367 | int (*mkdir) (struct inode *,struct dentry *,int); | |
9368 | int (*rmdir) (struct inode *,struct dentry *); | |
9369 | int (*mknod) (struct inode *,struct dentry *,int,dev_t); | |
9370 | int (*rename) (struct inode *, struct dentry *, | |
9371 | struct inode *, struct dentry *); | |
9372 | int (*readlink) (struct dentry *, char *,int); | |
9373 | void * (*follow_link) (struct dentry *, struct nameidata *); | |
9374 | void (*put_link) (struct dentry *, struct nameidata *, void *); | |
9375 | void (*truncate) (struct inode *); | |
9376 | int (*permission) (struct inode *, int, struct nameidata *); | |
9377 | int (*setattr) (struct dentry *, struct iattr *); | |
9378 | int (*getattr) (struct vfsmount *mnt, struct dentry *, struct kstat *); | |
9379 | int (*setxattr) (struct dentry *, const char *,const void *,size_t,int); | |
9380 | ssize_t (*getxattr) (struct dentry *, const char *, void *, size_t); | |
9381 | ssize_t (*listxattr) (struct dentry *, char *, size_t); | |
9382 | int (*removexattr) (struct dentry *, const char *); | |
9383 | void (*truncate_range)(struct inode *, loff_t, loff_t); | |
9384 | }; | |
9385 | ||
9386 | struct seq_file; | |
9387 | ||
9388 | ssize_t rw_copy_check_uvector(int type, const struct iovec * uvector, | |
9389 | unsigned long nr_segs, unsigned long fast_segs, | |
9390 | struct iovec *fast_pointer, | |
9391 | struct iovec **ret_pointer); | |
9392 | ||
9393 | extern ssize_t vfs_read(struct file *, char *, size_t, loff_t *); | |
9394 | extern ssize_t vfs_write(struct file *, const char *, size_t, loff_t *); | |
9395 | extern ssize_t vfs_readv(struct file *, const struct iovec *, | |
9396 | unsigned long, loff_t *); | |
9397 | extern ssize_t vfs_writev(struct file *, const struct iovec *, | |
9398 | unsigned long, loff_t *); | |
9399 | ||
9400 | ||
9401 | ||
9402 | ||
9403 | ||
9404 | struct super_operations { | |
9405 | struct inode *(*alloc_inode)(struct super_block *sb); | |
9406 | void (*destroy_inode)(struct inode *); | |
9407 | ||
9408 | void (*read_inode) (struct inode *); | |
9409 | ||
9410 | void (*dirty_inode) (struct inode *); | |
9411 | int (*write_inode) (struct inode *, int); | |
9412 | void (*put_inode) (struct inode *); | |
9413 | void (*drop_inode) (struct inode *); | |
9414 | void (*delete_inode) (struct inode *); | |
9415 | void (*put_super) (struct super_block *); | |
9416 | void (*write_super) (struct super_block *); | |
9417 | int (*sync_fs)(struct super_block *sb, int wait); | |
9418 | void (*write_super_lockfs) (struct super_block *); | |
9419 | void (*unlockfs) (struct super_block *); | |
9420 | int (*statfs) (struct dentry *, struct kstatfs *); | |
9421 | int (*remount_fs) (struct super_block *, int *, char *); | |
9422 | void (*clear_inode) (struct inode *); | |
9423 | void (*umount_begin) (struct vfsmount *, int); | |
9424 | ||
9425 | int (*show_options)(struct seq_file *, struct vfsmount *); | |
9426 | int (*show_stats)(struct seq_file *, struct vfsmount *); | |
9427 | ||
9428 | ||
9429 | ||
9430 | ||
9431 | }; | |
9432 | # 1227 "include/linux/fs.h" | |
9433 | extern void __mark_inode_dirty(struct inode *, int); | |
9434 | static inline __attribute__((always_inline)) void mark_inode_dirty(struct inode *inode) | |
9435 | { | |
9436 | __mark_inode_dirty(inode, (1 | 2 | 4)); | |
9437 | } | |
9438 | ||
9439 | static inline __attribute__((always_inline)) void mark_inode_dirty_sync(struct inode *inode) | |
9440 | { | |
9441 | __mark_inode_dirty(inode, 1); | |
9442 | } | |
9443 | ||
9444 | static inline __attribute__((always_inline)) void inc_nlink(struct inode *inode) | |
9445 | { | |
9446 | inode->i_nlink++; | |
9447 | } | |
9448 | ||
9449 | static inline __attribute__((always_inline)) void inode_inc_link_count(struct inode *inode) | |
9450 | { | |
9451 | inc_nlink(inode); | |
9452 | mark_inode_dirty(inode); | |
9453 | } | |
9454 | ||
9455 | static inline __attribute__((always_inline)) void drop_nlink(struct inode *inode) | |
9456 | { | |
9457 | inode->i_nlink--; | |
9458 | } | |
9459 | ||
9460 | static inline __attribute__((always_inline)) void clear_nlink(struct inode *inode) | |
9461 | { | |
9462 | inode->i_nlink = 0; | |
9463 | } | |
9464 | ||
9465 | static inline __attribute__((always_inline)) void inode_dec_link_count(struct inode *inode) | |
9466 | { | |
9467 | drop_nlink(inode); | |
9468 | mark_inode_dirty(inode); | |
9469 | } | |
9470 | ||
9471 | extern void touch_atime(struct vfsmount *mnt, struct dentry *dentry); | |
9472 | static inline __attribute__((always_inline)) void file_accessed(struct file *file) | |
9473 | { | |
9474 | if (!(file->f_flags & 01000000)) | |
9475 | touch_atime(file->f_vfsmnt, file->f_dentry); | |
9476 | } | |
9477 | ||
9478 | int sync_inode(struct inode *inode, struct writeback_control *wbc); | |
9479 | # 1360 "include/linux/fs.h" | |
9480 | struct export_operations { | |
9481 | struct dentry *(*decode_fh)(struct super_block *sb, __u32 *fh, int fh_len, int fh_type, | |
9482 | int (*acceptable)(void *context, struct dentry *de), | |
9483 | void *context); | |
9484 | int (*encode_fh)(struct dentry *de, __u32 *fh, int *max_len, | |
9485 | int connectable); | |
9486 | ||
9487 | ||
9488 | int (*get_name)(struct dentry *parent, char *name, | |
9489 | struct dentry *child); | |
9490 | struct dentry * (*get_parent)(struct dentry *child); | |
9491 | struct dentry * (*get_dentry)(struct super_block *sb, void *inump); | |
9492 | ||
9493 | ||
9494 | struct dentry * (*find_exported_dentry)( | |
9495 | struct super_block *sb, void *obj, void *parent, | |
9496 | int (*acceptable)(void *context, struct dentry *de), | |
9497 | void *context); | |
9498 | ||
9499 | ||
9500 | }; | |
9501 | ||
9502 | extern struct dentry * | |
9503 | find_exported_dentry(struct super_block *sb, void *obj, void *parent, | |
9504 | int (*acceptable)(void *context, struct dentry *de), | |
9505 | void *context); | |
9506 | ||
9507 | struct file_system_type { | |
9508 | const char *name; | |
9509 | int fs_flags; | |
9510 | int (*get_sb) (struct file_system_type *, int, | |
9511 | const char *, void *, struct vfsmount *); | |
9512 | void (*kill_sb) (struct super_block *); | |
9513 | struct module *owner; | |
9514 | struct file_system_type * next; | |
9515 | struct list_head fs_supers; | |
9516 | struct lock_class_key s_lock_key; | |
9517 | struct lock_class_key s_umount_key; | |
9518 | }; | |
9519 | ||
9520 | extern int get_sb_bdev(struct file_system_type *fs_type, | |
9521 | int flags, const char *dev_name, void *data, | |
9522 | int (*fill_super)(struct super_block *, void *, int), | |
9523 | struct vfsmount *mnt); | |
9524 | extern int get_sb_single(struct file_system_type *fs_type, | |
9525 | int flags, void *data, | |
9526 | int (*fill_super)(struct super_block *, void *, int), | |
9527 | struct vfsmount *mnt); | |
9528 | extern int get_sb_nodev(struct file_system_type *fs_type, | |
9529 | int flags, void *data, | |
9530 | int (*fill_super)(struct super_block *, void *, int), | |
9531 | struct vfsmount *mnt); | |
9532 | void generic_shutdown_super(struct super_block *sb); | |
9533 | void kill_block_super(struct super_block *sb); | |
9534 | void kill_anon_super(struct super_block *sb); | |
9535 | void kill_litter_super(struct super_block *sb); | |
9536 | void deactivate_super(struct super_block *sb); | |
9537 | int set_anon_super(struct super_block *s, void *data); | |
9538 | struct super_block *sget(struct file_system_type *type, | |
9539 | int (*test)(struct super_block *,void *), | |
9540 | int (*set)(struct super_block *,void *), | |
9541 | void *data); | |
9542 | extern int get_sb_pseudo(struct file_system_type *, char *, | |
9543 | struct super_operations *ops, unsigned long, | |
9544 | struct vfsmount *mnt); | |
9545 | extern int simple_set_mnt(struct vfsmount *mnt, struct super_block *sb); | |
9546 | int __put_super(struct super_block *sb); | |
9547 | int __put_super_and_need_restart(struct super_block *sb); | |
9548 | void unnamed_dev_init(void); | |
9549 | ||
9550 | ||
9551 | ||
9552 | ||
9553 | ||
9554 | ||
9555 | ||
9556 | extern int register_filesystem(struct file_system_type *); | |
9557 | extern int unregister_filesystem(struct file_system_type *); | |
9558 | extern struct vfsmount *kern_mount(struct file_system_type *); | |
9559 | extern int may_umount_tree(struct vfsmount *); | |
9560 | extern int may_umount(struct vfsmount *); | |
9561 | extern void umount_tree(struct vfsmount *, int, struct list_head *); | |
9562 | extern void release_mounts(struct list_head *); | |
9563 | extern long do_mount(char *, char *, char *, unsigned long, void *); | |
9564 | extern struct vfsmount *copy_tree(struct vfsmount *, struct dentry *, int); | |
9565 | extern void mnt_set_mountpoint(struct vfsmount *, struct dentry *, | |
9566 | struct vfsmount *); | |
9567 | ||
9568 | extern int vfs_statfs(struct dentry *, struct kstatfs *); | |
9569 | ||
9570 | ||
9571 | extern struct subsystem fs_subsys; | |
9572 | ||
9573 | ||
9574 | ||
9575 | ||
9576 | extern int locks_mandatory_locked(struct inode *); | |
9577 | extern int locks_mandatory_area(int, struct inode *, struct file *, loff_t, size_t); | |
9578 | # 1466 "include/linux/fs.h" | |
9579 | static inline __attribute__((always_inline)) int locks_verify_locked(struct inode *inode) | |
9580 | { | |
9581 | if ((((inode)->i_sb->s_flags & (64)) && ((inode)->i_mode & (0002000 | 00010)) == 0002000)) | |
9582 | return locks_mandatory_locked(inode); | |
9583 | return 0; | |
9584 | } | |
9585 | ||
9586 | extern int rw_verify_area(int, struct file *, loff_t *, size_t); | |
9587 | ||
9588 | static inline __attribute__((always_inline)) int locks_verify_truncate(struct inode *inode, | |
9589 | struct file *filp, | |
9590 | loff_t size) | |
9591 | { | |
9592 | if (inode->i_flock && (((inode)->i_sb->s_flags & (64)) && ((inode)->i_mode & (0002000 | 00010)) == 0002000)) | |
9593 | return locks_mandatory_area( | |
9594 | 2, inode, filp, | |
9595 | size < inode->i_size ? size : inode->i_size, | |
9596 | (size < inode->i_size ? inode->i_size - size | |
9597 | : size - inode->i_size) | |
9598 | ); | |
9599 | return 0; | |
9600 | } | |
9601 | ||
9602 | static inline __attribute__((always_inline)) int break_lease(struct inode *inode, unsigned int mode) | |
9603 | { | |
9604 | if (inode->i_flock) | |
9605 | return __break_lease(inode, mode); | |
9606 | return 0; | |
9607 | } | |
9608 | ||
9609 | ||
9610 | ||
9611 | extern int do_truncate(struct dentry *, loff_t start, unsigned int time_attrs, | |
9612 | struct file *filp); | |
9613 | extern long do_sys_open(int fdf, const char *filename, int flags, | |
9614 | int mode); | |
9615 | extern struct file *filp_open(const char *, int, int); | |
9616 | extern struct file * dentry_open(struct dentry *, struct vfsmount *, int); | |
9617 | extern int filp_close(struct file *, fl_owner_t id); | |
9618 | extern char * getname(const char *); | |
9619 | ||
9620 | ||
9621 | extern void __attribute__ ((__section__ (".init.text"))) vfs_caches_init_early(void); | |
9622 | extern void __attribute__ ((__section__ (".init.text"))) vfs_caches_init(unsigned long); | |
9623 | # 1520 "include/linux/fs.h" | |
9624 | extern int register_blkdev(unsigned int, const char *); | |
9625 | extern int unregister_blkdev(unsigned int, const char *); | |
9626 | extern struct block_device *bdget(dev_t); | |
9627 | extern void bd_set_size(struct block_device *, loff_t size); | |
9628 | extern void bd_forget(struct inode *inode); | |
9629 | extern void bdput(struct block_device *); | |
9630 | extern struct block_device *open_by_devnum(dev_t, unsigned); | |
9631 | extern struct block_device *open_partition_by_devnum(dev_t, unsigned); | |
9632 | extern const struct address_space_operations def_blk_aops; | |
9633 | ||
9634 | ||
9635 | ||
9636 | extern const struct file_operations def_blk_fops; | |
9637 | extern const struct file_operations def_chr_fops; | |
9638 | extern const struct file_operations bad_sock_fops; | |
9639 | extern const struct file_operations def_fifo_fops; | |
9640 | ||
9641 | extern int ioctl_by_bdev(struct block_device *, unsigned, unsigned long); | |
9642 | extern int blkdev_ioctl(struct inode *, struct file *, unsigned, unsigned long); | |
9643 | extern int blkdev_driver_ioctl(struct inode *inode, struct file *file, | |
9644 | struct gendisk *disk, unsigned cmd, | |
9645 | unsigned long arg); | |
9646 | extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long); | |
9647 | extern int blkdev_get(struct block_device *, mode_t, unsigned); | |
9648 | extern int blkdev_put(struct block_device *); | |
9649 | extern int blkdev_put_partition(struct block_device *); | |
9650 | extern int bd_claim(struct block_device *, void *); | |
9651 | extern void bd_release(struct block_device *); | |
9652 | ||
9653 | extern int bd_claim_by_disk(struct block_device *, void *, struct gendisk *); | |
9654 | extern void bd_release_from_disk(struct block_device *, struct gendisk *); | |
9655 | # 1559 "include/linux/fs.h" | |
9656 | extern int alloc_chrdev_region(dev_t *, unsigned, unsigned, const char *); | |
9657 | extern int register_chrdev_region(dev_t, unsigned, const char *); | |
9658 | extern int register_chrdev(unsigned int, const char *, | |
9659 | const struct file_operations *); | |
9660 | extern int unregister_chrdev(unsigned int, const char *); | |
9661 | extern void unregister_chrdev_region(dev_t, unsigned); | |
9662 | extern int chrdev_open(struct inode *, struct file *); | |
9663 | extern void chrdev_show(struct seq_file *,off_t); | |
9664 | ||
9665 | ||
9666 | ||
9667 | ||
9668 | ||
9669 | ||
9670 | extern const char *__bdevname(dev_t, char *buffer); | |
9671 | extern const char *bdevname(struct block_device *bdev, char *buffer); | |
9672 | extern struct block_device *lookup_bdev(const char *); | |
9673 | extern struct block_device *open_bdev_excl(const char *, int, void *); | |
9674 | extern void close_bdev_excl(struct block_device *); | |
9675 | extern void blkdev_show(struct seq_file *,off_t); | |
9676 | ||
9677 | ||
9678 | ||
9679 | ||
9680 | extern void init_special_inode(struct inode *, umode_t, dev_t); | |
9681 | ||
9682 | ||
9683 | extern void make_bad_inode(struct inode *); | |
9684 | extern int is_bad_inode(struct inode *); | |
9685 | ||
9686 | extern const struct file_operations read_fifo_fops; | |
9687 | extern const struct file_operations write_fifo_fops; | |
9688 | extern const struct file_operations rdwr_fifo_fops; | |
9689 | ||
9690 | extern int fs_may_remount_ro(struct super_block *); | |
9691 | # 1606 "include/linux/fs.h" | |
9692 | extern int check_disk_change(struct block_device *); | |
9693 | extern int __invalidate_device(struct block_device *); | |
9694 | extern int invalidate_partition(struct gendisk *, int); | |
9695 | ||
9696 | extern int invalidate_inodes(struct super_block *); | |
9697 | unsigned long invalidate_mapping_pages(struct address_space *mapping, | |
9698 | unsigned long start, unsigned long end); | |
9699 | unsigned long invalidate_inode_pages(struct address_space *mapping); | |
9700 | static inline __attribute__((always_inline)) void invalidate_remote_inode(struct inode *inode) | |
9701 | { | |
9702 | if ((((inode->i_mode) & 00170000) == 0100000) || (((inode->i_mode) & 00170000) == 0040000) || | |
9703 | (((inode->i_mode) & 00170000) == 0120000)) | |
9704 | invalidate_inode_pages(inode->i_mapping); | |
9705 | } | |
9706 | extern int invalidate_inode_pages2(struct address_space *mapping); | |
9707 | extern int invalidate_inode_pages2_range(struct address_space *mapping, | |
9708 | unsigned long start, unsigned long end); | |
9709 | extern int write_inode_now(struct inode *, int); | |
9710 | extern int filemap_fdatawrite(struct address_space *); | |
9711 | extern int filemap_flush(struct address_space *); | |
9712 | extern int filemap_fdatawait(struct address_space *); | |
9713 | extern int filemap_write_and_wait(struct address_space *mapping); | |
9714 | extern int filemap_write_and_wait_range(struct address_space *mapping, | |
9715 | loff_t lstart, loff_t lend); | |
9716 | extern int wait_on_page_writeback_range(struct address_space *mapping, | |
9717 | unsigned long start, unsigned long end); | |
9718 | extern int __filemap_fdatawrite_range(struct address_space *mapping, | |
9719 | loff_t start, loff_t end, int sync_mode); | |
9720 | ||
9721 | extern long do_fsync(struct file *file, int datasync); | |
9722 | extern void sync_supers(void); | |
9723 | extern void sync_filesystems(int wait); | |
9724 | extern void __fsync_super(struct super_block *sb); | |
9725 | extern void emergency_sync(void); | |
9726 | extern void emergency_remount(void); | |
9727 | extern int do_remount_sb(struct super_block *sb, int flags, | |
9728 | void *data, int force); | |
9729 | ||
9730 | extern sector_t bmap(struct inode *, sector_t); | |
9731 | ||
9732 | extern int notify_change(struct dentry *, struct iattr *); | |
9733 | extern int permission(struct inode *, int, struct nameidata *); | |
9734 | extern int generic_permission(struct inode *, int, | |
9735 | int (*check_acl)(struct inode *, int)); | |
9736 | ||
9737 | extern int get_write_access(struct inode *); | |
9738 | extern int deny_write_access(struct file *); | |
9739 | static inline __attribute__((always_inline)) void put_write_access(struct inode * inode) | |
9740 | { | |
9741 | atomic_dec(&inode->i_writecount); | |
9742 | } | |
9743 | static inline __attribute__((always_inline)) void allow_write_access(struct file *file) | |
9744 | { | |
9745 | if (file) | |
9746 | atomic_inc(&file->f_dentry->d_inode->i_writecount); | |
9747 | } | |
9748 | extern int do_pipe(int *); | |
9749 | extern struct file *create_read_pipe(struct file *f); | |
9750 | extern struct file *create_write_pipe(void); | |
9751 | extern void free_write_pipe(struct file *); | |
9752 | ||
9753 | extern int open_namei(int dfd, const char *, int, int, struct nameidata *); | |
9754 | extern int may_open(struct nameidata *, int, int); | |
9755 | ||
9756 | extern int kernel_read(struct file *, unsigned long, char *, unsigned long); | |
9757 | extern struct file * open_exec(const char *); | |
9758 | ||
9759 | ||
9760 | extern int is_subdir(struct dentry *, struct dentry *); | |
9761 | extern ino_t find_inode_number(struct dentry *, struct qstr *); | |
9762 | ||
9763 | # 1 "include/linux/err.h" 1 | |
9764 | # 22 "include/linux/err.h" | |
9765 | static inline __attribute__((always_inline)) void *ERR_PTR(long error) | |
9766 | { | |
9767 | return (void *) error; | |
9768 | } | |
9769 | ||
9770 | static inline __attribute__((always_inline)) long PTR_ERR(const void *ptr) | |
9771 | { | |
9772 | return (long) ptr; | |
9773 | } | |
9774 | ||
9775 | static inline __attribute__((always_inline)) long IS_ERR(const void *ptr) | |
9776 | { | |
9777 | return __builtin_expect(!!(((unsigned long)ptr) >= (unsigned long)-4095), 0); | |
9778 | } | |
9779 | # 1678 "include/linux/fs.h" 2 | |
9780 | ||
9781 | ||
9782 | extern loff_t default_llseek(struct file *file, loff_t offset, int origin); | |
9783 | ||
9784 | extern loff_t vfs_llseek(struct file *file, loff_t offset, int origin); | |
9785 | ||
9786 | extern void inode_init_once(struct inode *); | |
9787 | extern void iput(struct inode *); | |
9788 | extern struct inode * igrab(struct inode *); | |
9789 | extern ino_t iunique(struct super_block *, ino_t); | |
9790 | extern int inode_needs_sync(struct inode *inode); | |
9791 | extern void generic_delete_inode(struct inode *inode); | |
9792 | extern void generic_drop_inode(struct inode *inode); | |
9793 | ||
9794 | extern struct inode *ilookup5_nowait(struct super_block *sb, | |
9795 | unsigned long hashval, int (*test)(struct inode *, void *), | |
9796 | void *data); | |
9797 | extern struct inode *ilookup5(struct super_block *sb, unsigned long hashval, | |
9798 | int (*test)(struct inode *, void *), void *data); | |
9799 | extern struct inode *ilookup(struct super_block *sb, unsigned long ino); | |
9800 | ||
9801 | extern struct inode * iget5_locked(struct super_block *, unsigned long, int (*test)(struct inode *, void *), int (*set)(struct inode *, void *), void *); | |
9802 | extern struct inode * iget_locked(struct super_block *, unsigned long); | |
9803 | extern void unlock_new_inode(struct inode *); | |
9804 | ||
9805 | static inline __attribute__((always_inline)) struct inode *iget(struct super_block *sb, unsigned long ino) | |
9806 | { | |
9807 | struct inode *inode = iget_locked(sb, ino); | |
9808 | ||
9809 | if (inode && (inode->i_state & 64)) { | |
9810 | sb->s_op->read_inode(inode); | |
9811 | unlock_new_inode(inode); | |
9812 | } | |
9813 | ||
9814 | return inode; | |
9815 | } | |
9816 | ||
9817 | extern void __iget(struct inode * inode); | |
9818 | extern void clear_inode(struct inode *); | |
9819 | extern void destroy_inode(struct inode *); | |
9820 | extern struct inode *new_inode(struct super_block *); | |
9821 | extern int __remove_suid(struct dentry *, int); | |
9822 | extern int should_remove_suid(struct dentry *); | |
9823 | extern int remove_suid(struct dentry *); | |
9824 | extern void remove_dquot_ref(struct super_block *, int, struct list_head *); | |
9825 | ||
9826 | extern void __insert_inode_hash(struct inode *, unsigned long hashval); | |
9827 | extern void remove_inode_hash(struct inode *); | |
9828 | static inline __attribute__((always_inline)) void insert_inode_hash(struct inode *inode) { | |
9829 | __insert_inode_hash(inode, inode->i_ino); | |
9830 | } | |
9831 | ||
9832 | extern struct file * get_empty_filp(void); | |
9833 | extern void file_move(struct file *f, struct list_head *list); | |
9834 | extern void file_kill(struct file *f); | |
9835 | ||
9836 | struct bio; | |
9837 | extern void submit_bio(int, struct bio *); | |
9838 | extern int bdev_read_only(struct block_device *); | |
9839 | ||
9840 | extern int set_blocksize(struct block_device *, int); | |
9841 | extern int sb_set_blocksize(struct super_block *, int); | |
9842 | extern int sb_min_blocksize(struct super_block *, int); | |
9843 | ||
9844 | extern int generic_file_mmap(struct file *, struct vm_area_struct *); | |
9845 | extern int generic_file_readonly_mmap(struct file *, struct vm_area_struct *); | |
9846 | extern int file_read_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size); | |
9847 | extern int file_send_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size); | |
9848 | int generic_write_checks(struct file *file, loff_t *pos, size_t *count, int isblk); | |
9849 | extern ssize_t generic_file_aio_read(struct kiocb *, const struct iovec *, unsigned long, loff_t); | |
9850 | extern ssize_t generic_file_aio_write(struct kiocb *, const struct iovec *, unsigned long, loff_t); | |
9851 | extern ssize_t generic_file_aio_write_nolock(struct kiocb *, const struct iovec *, | |
9852 | unsigned long, loff_t); | |
9853 | extern ssize_t generic_file_direct_write(struct kiocb *, const struct iovec *, | |
9854 | unsigned long *, loff_t, loff_t *, size_t, size_t); | |
9855 | extern ssize_t generic_file_buffered_write(struct kiocb *, const struct iovec *, | |
9856 | unsigned long, loff_t, loff_t *, size_t, ssize_t); | |
9857 | extern ssize_t do_sync_read(struct file *filp, char *buf, size_t len, loff_t *ppos); | |
9858 | extern ssize_t do_sync_write(struct file *filp, const char *buf, size_t len, loff_t *ppos); | |
9859 | extern ssize_t generic_file_sendfile(struct file *, loff_t *, size_t, read_actor_t, void *); | |
9860 | extern void do_generic_mapping_read(struct address_space *mapping, | |
9861 | struct file_ra_state *, struct file *, | |
9862 | loff_t *, read_descriptor_t *, read_actor_t); | |
9863 | ||
9864 | ||
9865 | extern ssize_t generic_file_splice_read(struct file *, loff_t *, | |
9866 | struct pipe_inode_info *, size_t, unsigned int); | |
9867 | extern ssize_t generic_file_splice_write(struct pipe_inode_info *, | |
9868 | struct file *, loff_t *, size_t, unsigned int); | |
9869 | extern ssize_t generic_file_splice_write_nolock(struct pipe_inode_info *, | |
9870 | struct file *, loff_t *, size_t, unsigned int); | |
9871 | extern ssize_t generic_splice_sendpage(struct pipe_inode_info *pipe, | |
9872 | struct file *out, loff_t *, size_t len, unsigned int flags); | |
9873 | extern long do_splice_direct(struct file *in, loff_t *ppos, struct file *out, | |
9874 | size_t len, unsigned int flags); | |
9875 | ||
9876 | extern void | |
9877 | file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping); | |
9878 | extern loff_t no_llseek(struct file *file, loff_t offset, int origin); | |
9879 | extern loff_t generic_file_llseek(struct file *file, loff_t offset, int origin); | |
9880 | extern loff_t remote_llseek(struct file *file, loff_t offset, int origin); | |
9881 | extern int generic_file_open(struct inode * inode, struct file * filp); | |
9882 | extern int nonseekable_open(struct inode * inode, struct file * filp); | |
9883 | # 1793 "include/linux/fs.h" | |
9884 | static inline __attribute__((always_inline)) int xip_truncate_page(struct address_space *mapping, loff_t from) | |
9885 | { | |
9886 | return 0; | |
9887 | } | |
9888 | ||
9889 | ||
9890 | static inline __attribute__((always_inline)) void do_generic_file_read(struct file * filp, loff_t *ppos, | |
9891 | read_descriptor_t * desc, | |
9892 | read_actor_t actor) | |
9893 | { | |
9894 | do_generic_mapping_read(filp->f_mapping, | |
9895 | &filp->f_ra, | |
9896 | filp, | |
9897 | ppos, | |
9898 | desc, | |
9899 | actor); | |
9900 | } | |
9901 | ||
9902 | ||
9903 | ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode, | |
9904 | struct block_device *bdev, const struct iovec *iov, loff_t offset, | |
9905 | unsigned long nr_segs, get_block_t get_block, dio_iodone_t end_io, | |
9906 | int lock_type); | |
9907 | ||
9908 | enum { | |
9909 | DIO_LOCKING = 1, | |
9910 | DIO_NO_LOCKING, | |
9911 | DIO_OWN_LOCKING, | |
9912 | }; | |
9913 | ||
9914 | static inline __attribute__((always_inline)) ssize_t blockdev_direct_IO(int rw, struct kiocb *iocb, | |
9915 | struct inode *inode, struct block_device *bdev, const struct iovec *iov, | |
9916 | loff_t offset, unsigned long nr_segs, get_block_t get_block, | |
9917 | dio_iodone_t end_io) | |
9918 | { | |
9919 | return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset, | |
9920 | nr_segs, get_block, end_io, DIO_LOCKING); | |
9921 | } | |
9922 | ||
9923 | static inline __attribute__((always_inline)) ssize_t blockdev_direct_IO_no_locking(int rw, struct kiocb *iocb, | |
9924 | struct inode *inode, struct block_device *bdev, const struct iovec *iov, | |
9925 | loff_t offset, unsigned long nr_segs, get_block_t get_block, | |
9926 | dio_iodone_t end_io) | |
9927 | { | |
9928 | return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset, | |
9929 | nr_segs, get_block, end_io, DIO_NO_LOCKING); | |
9930 | } | |
9931 | ||
9932 | static inline __attribute__((always_inline)) ssize_t blockdev_direct_IO_own_locking(int rw, struct kiocb *iocb, | |
9933 | struct inode *inode, struct block_device *bdev, const struct iovec *iov, | |
9934 | loff_t offset, unsigned long nr_segs, get_block_t get_block, | |
9935 | dio_iodone_t end_io) | |
9936 | { | |
9937 | return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset, | |
9938 | nr_segs, get_block, end_io, DIO_OWN_LOCKING); | |
9939 | } | |
9940 | ||
9941 | ||
9942 | extern const struct file_operations generic_ro_fops; | |
9943 | ||
9944 | ||
9945 | ||
9946 | extern int vfs_readlink(struct dentry *, char *, int, const char *); | |
9947 | extern int vfs_follow_link(struct nameidata *, const char *); | |
9948 | extern int page_readlink(struct dentry *, char *, int); | |
9949 | extern void *page_follow_link_light(struct dentry *, struct nameidata *); | |
9950 | extern void page_put_link(struct dentry *, struct nameidata *, void *); | |
9951 | extern int __page_symlink(struct inode *inode, const char *symname, int len, | |
9952 | gfp_t gfp_mask); | |
9953 | extern int page_symlink(struct inode *inode, const char *symname, int len); | |
9954 | extern struct inode_operations page_symlink_inode_operations; | |
9955 | extern int generic_readlink(struct dentry *, char *, int); | |
9956 | extern void generic_fillattr(struct inode *, struct kstat *); | |
9957 | extern int vfs_getattr(struct vfsmount *, struct dentry *, struct kstat *); | |
9958 | void inode_add_bytes(struct inode *inode, loff_t bytes); | |
9959 | void inode_sub_bytes(struct inode *inode, loff_t bytes); | |
9960 | loff_t inode_get_bytes(struct inode *inode); | |
9961 | void inode_set_bytes(struct inode *inode, loff_t bytes); | |
9962 | ||
9963 | extern int vfs_readdir(struct file *, filldir_t, void *); | |
9964 | ||
9965 | extern int vfs_stat(char *, struct kstat *); | |
9966 | extern int vfs_lstat(char *, struct kstat *); | |
9967 | extern int vfs_stat_fd(int dfd, char *, struct kstat *); | |
9968 | extern int vfs_lstat_fd(int dfd, char *, struct kstat *); | |
9969 | extern int vfs_fstat(unsigned int, struct kstat *); | |
9970 | ||
9971 | extern int vfs_ioctl(struct file *, unsigned int, unsigned int, unsigned long); | |
9972 | ||
9973 | extern struct file_system_type *get_fs_type(const char *name); | |
9974 | extern struct super_block *get_super(struct block_device *); | |
9975 | extern struct super_block *user_get_super(dev_t); | |
9976 | extern void drop_super(struct super_block *sb); | |
9977 | ||
9978 | extern int dcache_dir_open(struct inode *, struct file *); | |
9979 | extern int dcache_dir_close(struct inode *, struct file *); | |
9980 | extern loff_t dcache_dir_lseek(struct file *, loff_t, int); | |
9981 | extern int dcache_readdir(struct file *, void *, filldir_t); | |
9982 | extern int simple_getattr(struct vfsmount *, struct dentry *, struct kstat *); | |
9983 | extern int simple_statfs(struct dentry *, struct kstatfs *); | |
9984 | extern int simple_link(struct dentry *, struct inode *, struct dentry *); | |
9985 | extern int simple_unlink(struct inode *, struct dentry *); | |
9986 | extern int simple_rmdir(struct inode *, struct dentry *); | |
9987 | extern int simple_rename(struct inode *, struct dentry *, struct inode *, struct dentry *); | |
9988 | extern int simple_sync_file(struct file *, struct dentry *, int); | |
9989 | extern int simple_empty(struct dentry *); | |
9990 | extern int simple_readpage(struct file *file, struct page *page); | |
9991 | extern int simple_prepare_write(struct file *file, struct page *page, | |
9992 | unsigned offset, unsigned to); | |
9993 | extern int simple_commit_write(struct file *file, struct page *page, | |
9994 | unsigned offset, unsigned to); | |
9995 | ||
9996 | extern struct dentry *simple_lookup(struct inode *, struct dentry *, struct nameidata *); | |
9997 | extern ssize_t generic_read_dir(struct file *, char *, size_t, loff_t *); | |
9998 | extern const struct file_operations simple_dir_operations; | |
9999 | extern struct inode_operations simple_dir_inode_operations; | |
10000 | struct tree_descr { char *name; const struct file_operations *ops; int mode; }; | |
10001 | struct dentry *d_alloc_name(struct dentry *, const char *); | |
10002 | extern int simple_fill_super(struct super_block *, int, struct tree_descr *); | |
10003 | extern int simple_pin_fs(struct file_system_type *, struct vfsmount **mount, int *count); | |
10004 | extern void simple_release_fs(struct vfsmount **mount, int *count); | |
10005 | ||
10006 | extern ssize_t simple_read_from_buffer(void *, size_t, loff_t *, const void *, size_t); | |
10007 | # 1924 "include/linux/fs.h" | |
10008 | extern int inode_change_ok(struct inode *, struct iattr *); | |
10009 | extern int __attribute__((warn_unused_result)) inode_setattr(struct inode *, struct iattr *); | |
10010 | ||
10011 | extern void file_update_time(struct file *file); | |
10012 | ||
10013 | static inline __attribute__((always_inline)) ino_t parent_ino(struct dentry *dentry) | |
10014 | { | |
10015 | ino_t res; | |
10016 | ||
10017 | do { do { } while (0); (void)0; (void)(&dentry->d_lock); } while (0); | |
10018 | res = dentry->d_parent->d_inode->i_ino; | |
10019 | do { do { } while (0); (void)0; (void)(&dentry->d_lock); } while (0); | |
10020 | return res; | |
10021 | } | |
10022 | ||
10023 | ||
10024 | extern int unshare_files(void); | |
10025 | ||
10026 | ||
10027 | ||
10028 | ||
10029 | ||
10030 | ||
10031 | ||
10032 | struct simple_transaction_argresp { | |
10033 | ssize_t size; | |
10034 | char data[0]; | |
10035 | }; | |
10036 | ||
10037 | ||
10038 | ||
10039 | char *simple_transaction_get(struct file *file, const char *buf, | |
10040 | size_t size); | |
10041 | ssize_t simple_transaction_read(struct file *file, char *buf, | |
10042 | size_t size, loff_t *pos); | |
10043 | int simple_transaction_release(struct inode *inode, struct file *file); | |
10044 | ||
10045 | static inline __attribute__((always_inline)) void simple_transaction_set(struct file *file, size_t n) | |
10046 | { | |
10047 | struct simple_transaction_argresp *ar = file->private_data; | |
10048 | ||
10049 | do { if (__builtin_expect(!!((n > ((1UL << 12) - sizeof(struct simple_transaction_argresp)))!=0), 0)) do { dump_stack(); printk("<4>" "\nkernel BUG at %s:%d!\n", "include/linux/fs.h", 1965); panic("BUG!"); } while (0); } while(0); | |
10050 | ||
10051 | ||
10052 | ||
10053 | ||
10054 | ||
10055 | __asm__ __volatile__("": : :"memory"); | |
10056 | ar->size = n; | |
10057 | } | |
10058 | # 2005 "include/linux/fs.h" | |
10059 | static inline __attribute__((always_inline)) void __attribute__((format(printf, 1, 2))) | |
10060 | __simple_attr_check_format(const char *fmt, ...) | |
10061 | { | |
10062 | ||
10063 | } | |
10064 | ||
10065 | int simple_attr_open(struct inode *inode, struct file *file, | |
10066 | u64 (*get)(void *), void (*set)(void *, u64), | |
10067 | const char *fmt); | |
10068 | int simple_attr_close(struct inode *inode, struct file *file); | |
10069 | ssize_t simple_attr_read(struct file *file, char *buf, | |
10070 | size_t len, loff_t *ppos); | |
10071 | ssize_t simple_attr_write(struct file *file, const char *buf, | |
10072 | size_t len, loff_t *ppos); | |
10073 | # 2032 "include/linux/fs.h" | |
10074 | static inline __attribute__((always_inline)) char *alloc_secdata(void) | |
10075 | { | |
10076 | return (char *)1; | |
10077 | } | |
10078 | ||
10079 | static inline __attribute__((always_inline)) void free_secdata(void *secdata) | |
10080 | { } | |
10081 | # 16 "include/linux/mm.h" 2 | |
10082 | ||
10083 | # 1 "include/linux/debug_locks.h" 1 | |
10084 | ||
10085 | ||
10086 | ||
10087 | struct task_struct; | |
10088 | ||
10089 | extern int debug_locks; | |
10090 | extern int debug_locks_silent; | |
10091 | ||
10092 | ||
10093 | ||
10094 | ||
10095 | extern int debug_locks_off(void); | |
10096 | # 46 "include/linux/debug_locks.h" | |
10097 | struct task_struct; | |
10098 | ||
10099 | ||
10100 | ||
10101 | ||
10102 | ||
10103 | ||
10104 | ||
10105 | static inline __attribute__((always_inline)) void debug_show_all_locks(void) | |
10106 | { | |
10107 | } | |
10108 | ||
10109 | static inline __attribute__((always_inline)) void debug_show_held_locks(struct task_struct *task) | |
10110 | { | |
10111 | } | |
10112 | ||
10113 | static inline __attribute__((always_inline)) void | |
10114 | debug_check_no_locks_freed(const void *from, unsigned long len) | |
10115 | { | |
10116 | } | |
10117 | ||
10118 | static inline __attribute__((always_inline)) void | |
10119 | debug_check_no_locks_held(struct task_struct *task) | |
10120 | { | |
10121 | } | |
10122 | # 18 "include/linux/mm.h" 2 | |
10123 | # 1 "include/linux/backing-dev.h" 1 | |
10124 | # 13 "include/linux/backing-dev.h" | |
10125 | struct page; | |
10126 | ||
10127 | ||
10128 | ||
10129 | ||
10130 | enum bdi_state { | |
10131 | BDI_pdflush, | |
10132 | BDI_write_congested, | |
10133 | BDI_read_congested, | |
10134 | BDI_unused, | |
10135 | }; | |
10136 | ||
10137 | typedef int (congested_fn)(void *, int); | |
10138 | ||
10139 | struct backing_dev_info { | |
10140 | unsigned long ra_pages; | |
10141 | unsigned long state; | |
10142 | unsigned int capabilities; | |
10143 | congested_fn *congested_fn; | |
10144 | void *congested_data; | |
10145 | void (*unplug_io_fn)(struct backing_dev_info *, struct page *); | |
10146 | void *unplug_io_data; | |
10147 | }; | |
10148 | # 63 "include/linux/backing-dev.h" | |
10149 | extern struct backing_dev_info default_backing_dev_info; | |
10150 | void default_unplug_io_fn(struct backing_dev_info *bdi, struct page *page); | |
10151 | ||
10152 | int writeback_acquire(struct backing_dev_info *bdi); | |
10153 | int writeback_in_progress(struct backing_dev_info *bdi); | |
10154 | void writeback_release(struct backing_dev_info *bdi); | |
10155 | ||
10156 | static inline __attribute__((always_inline)) int bdi_congested(struct backing_dev_info *bdi, int bdi_bits) | |
10157 | { | |
10158 | if (bdi->congested_fn) | |
10159 | return bdi->congested_fn(bdi->congested_data, bdi_bits); | |
10160 | return (bdi->state & bdi_bits); | |
10161 | } | |
10162 | ||
10163 | static inline __attribute__((always_inline)) int bdi_read_congested(struct backing_dev_info *bdi) | |
10164 | { | |
10165 | return bdi_congested(bdi, 1 << BDI_read_congested); | |
10166 | } | |
10167 | ||
10168 | static inline __attribute__((always_inline)) int bdi_write_congested(struct backing_dev_info *bdi) | |
10169 | { | |
10170 | return bdi_congested(bdi, 1 << BDI_write_congested); | |
10171 | } | |
10172 | ||
10173 | static inline __attribute__((always_inline)) int bdi_rw_congested(struct backing_dev_info *bdi) | |
10174 | { | |
10175 | return bdi_congested(bdi, (1 << BDI_read_congested)| | |
10176 | (1 << BDI_write_congested)); | |
10177 | } | |
10178 | ||
10179 | void clear_bdi_congested(struct backing_dev_info *bdi, int rw); | |
10180 | void set_bdi_congested(struct backing_dev_info *bdi, int rw); | |
10181 | long congestion_wait(int rw, long timeout); | |
10182 | void congestion_end(int rw); | |
10183 | # 19 "include/linux/mm.h" 2 | |
10184 | # 1 "include/linux/mm_types.h" 1 | |
10185 | # 9 "include/linux/mm_types.h" | |
10186 | struct address_space; | |
10187 | # 18 "include/linux/mm_types.h" | |
10188 | struct page { | |
10189 | unsigned long flags; | |
10190 | ||
10191 | atomic_t _count; | |
10192 | atomic_t _mapcount; | |
10193 | ||
10194 | ||
10195 | ||
10196 | union { | |
10197 | struct { | |
10198 | unsigned long private; | |
10199 | ||
10200 | ||
10201 | ||
10202 | ||
10203 | ||
10204 | ||
10205 | struct address_space *mapping; | |
10206 | ||
10207 | ||
10208 | ||
10209 | ||
10210 | ||
10211 | ||
10212 | }; | |
10213 | ||
10214 | ||
10215 | ||
10216 | }; | |
10217 | unsigned long index; | |
10218 | struct list_head lru; | |
10219 | # 73 "include/linux/mm_types.h" | |
10220 | }; | |
10221 | # 20 "include/linux/mm.h" 2 | |
10222 | ||
10223 | struct mempolicy; | |
10224 | struct anon_vma; | |
10225 | ||
10226 | ||
10227 | extern unsigned long max_mapnr; | |
10228 | ||
10229 | ||
10230 | extern unsigned long num_physpages; | |
10231 | extern void * high_memory; | |
10232 | extern unsigned long vmalloc_earlyreserve; | |
10233 | extern int page_cluster; | |
10234 | ||
10235 | ||
10236 | extern int sysctl_legacy_va_layout; | |
10237 | ||
10238 | ||
10239 | ||
10240 | ||
10241 | ||
10242 | # 1 "include/asm/pgtable.h" 1 | |
10243 | ||
10244 | ||
10245 | ||
10246 | # 1 "include/asm-generic/4level-fixup.h" 1 | |
10247 | # 5 "include/asm/pgtable.h" 2 | |
10248 | ||
10249 | ||
10250 | ||
10251 | typedef pte_t *pte_addr_t; | |
10252 | # 27 "include/asm/pgtable.h" | |
10253 | extern void paging_init(void); | |
10254 | ||
10255 | ||
10256 | ||
10257 | ||
10258 | ||
10259 | ||
10260 | ||
10261 | static inline __attribute__((always_inline)) int pte_file(pte_t pte) | |
10262 | { | |
10263 | return 0; | |
10264 | } | |
10265 | ||
10266 | ||
10267 | ||
10268 | ||
10269 | ||
10270 | ||
10271 | ||
10272 | extern unsigned int kobjsize(const void *objp); | |
10273 | # 41 "include/linux/mm.h" 2 | |
10274 | # 60 "include/linux/mm.h" | |
10275 | struct vm_area_struct { | |
10276 | struct mm_struct * vm_mm; | |
10277 | unsigned long vm_start; | |
10278 | unsigned long vm_end; | |
10279 | ||
10280 | ||
10281 | ||
10282 | struct vm_area_struct *vm_next; | |
10283 | ||
10284 | pgprot_t vm_page_prot; | |
10285 | unsigned long vm_flags; | |
10286 | ||
10287 | struct rb_node vm_rb; | |
10288 | ||
10289 | ||
10290 | ||
10291 | ||
10292 | ||
10293 | ||
10294 | ||
10295 | union { | |
10296 | struct { | |
10297 | struct list_head list; | |
10298 | void *parent; | |
10299 | struct vm_area_struct *head; | |
10300 | } vm_set; | |
10301 | ||
10302 | struct raw_prio_tree_node prio_tree_node; | |
10303 | } shared; | |
10304 | ||
10305 | ||
10306 | ||
10307 | ||
10308 | ||
10309 | ||
10310 | ||
10311 | struct list_head anon_vma_node; | |
10312 | struct anon_vma *anon_vma; | |
10313 | ||
10314 | ||
10315 | struct vm_operations_struct * vm_ops; | |
10316 | ||
10317 | ||
10318 | unsigned long vm_pgoff; | |
10319 | ||
10320 | struct file * vm_file; | |
10321 | void * vm_private_data; | |
10322 | unsigned long vm_truncate_count; | |
10323 | ||
10324 | ||
10325 | atomic_t vm_usage; | |
10326 | ||
10327 | ||
10328 | ||
10329 | ||
10330 | }; | |
10331 | ||
10332 | ||
10333 | ||
10334 | ||
10335 | ||
10336 | ||
10337 | struct vm_list_struct { | |
10338 | struct vm_list_struct *next; | |
10339 | struct vm_area_struct *vma; | |
10340 | }; | |
10341 | ||
10342 | ||
10343 | extern struct rb_root nommu_vma_tree; | |
10344 | extern struct rw_semaphore nommu_vma_sem; | |
10345 | ||
10346 | extern unsigned int kobjsize(const void *objp); | |
10347 | # 190 "include/linux/mm.h" | |
10348 | extern pgprot_t protection_map[16]; | |
10349 | ||
10350 | ||
10351 | ||
10352 | ||
10353 | ||
10354 | ||
10355 | ||
10356 | struct vm_operations_struct { | |
10357 | void (*open)(struct vm_area_struct * area); | |
10358 | void (*close)(struct vm_area_struct * area); | |
10359 | struct page * (*nopage)(struct vm_area_struct * area, unsigned long address, int *type); | |
10360 | unsigned long (*nopfn)(struct vm_area_struct * area, unsigned long address); | |
10361 | int (*populate)(struct vm_area_struct * area, unsigned long address, unsigned long len, pgprot_t prot, unsigned long pgoff, int nonblock); | |
10362 | ||
10363 | ||
10364 | ||
10365 | int (*page_mkwrite)(struct vm_area_struct *vma, struct page *page); | |
10366 | ||
10367 | ||
10368 | ||
10369 | ||
10370 | ||
10371 | ||
10372 | ||
10373 | }; | |
10374 | ||
10375 | struct mmu_gather; | |
10376 | struct inode; | |
10377 | # 227 "include/linux/mm.h" | |
10378 | # 1 "include/linux/page-flags.h" 1 | |
10379 | # 254 "include/linux/page-flags.h" | |
10380 | struct page; | |
10381 | ||
10382 | int test_clear_page_dirty(struct page *page); | |
10383 | int test_clear_page_writeback(struct page *page); | |
10384 | int test_set_page_writeback(struct page *page); | |
10385 | ||
10386 | static inline __attribute__((always_inline)) void clear_page_dirty(struct page *page) | |
10387 | { | |
10388 | test_clear_page_dirty(page); | |
10389 | } | |
10390 | ||
10391 | static inline __attribute__((always_inline)) void set_page_writeback(struct page *page) | |
10392 | { | |
10393 | test_set_page_writeback(page); | |
10394 | } | |
10395 | # 228 "include/linux/mm.h" 2 | |
10396 | # 251 "include/linux/mm.h" | |
10397 | static inline __attribute__((always_inline)) int put_page_testzero(struct page *page) | |
10398 | { | |
10399 | do { } while(0); | |
10400 | return (atomic_sub_return(1, (&page->_count)) == 0); | |
10401 | } | |
10402 | ||
10403 | ||
10404 | ||
10405 | ||
10406 | ||
10407 | static inline __attribute__((always_inline)) int get_page_unless_zero(struct page *page) | |
10408 | { | |
10409 | do { } while(0); | |
10410 | return ({ int c, old; c = (((&page->_count))->counter); while (c != (0) && (old = ((int)((__typeof__(*(&((((&page->_count)))->counter))))__cmpxchg((&((((&page->_count)))->counter)),(unsigned long)((c)), (unsigned long)((c + (1))),sizeof(*(&((((&page->_count)))->counter))))))) != c) c = old; c != (0); }); | |
10411 | } | |
10412 | ||
10413 | static inline __attribute__((always_inline)) int page_count(struct page *page) | |
10414 | { | |
10415 | if (__builtin_expect(!!((__builtin_constant_p(14) ? __constant_test_bit((14),(&(page)->flags)) : __test_bit((14),(&(page)->flags)))), 0)) | |
10416 | page = (struct page *)((page)->private); | |
10417 | return ((&page->_count)->counter); | |
10418 | } | |
10419 | ||
10420 | static inline __attribute__((always_inline)) void get_page(struct page *page) | |
10421 | { | |
10422 | if (__builtin_expect(!!((__builtin_constant_p(14) ? __constant_test_bit((14),(&(page)->flags)) : __test_bit((14),(&(page)->flags)))), 0)) | |
10423 | page = (struct page *)((page)->private); | |
10424 | do { } while(0); | |
10425 | atomic_inc(&page->_count); | |
10426 | } | |
10427 | ||
10428 | ||
10429 | ||
10430 | ||
10431 | ||
10432 | static inline __attribute__((always_inline)) void init_page_count(struct page *page) | |
10433 | { | |
10434 | (((&page->_count)->counter) = 1); | |
10435 | } | |
10436 | ||
10437 | void put_page(struct page *page); | |
10438 | void put_pages_list(struct list_head *pages); | |
10439 | ||
10440 | void split_page(struct page *page, unsigned int order); | |
10441 | # 431 "include/linux/mm.h" | |
10442 | static inline __attribute__((always_inline)) enum zone_type page_zonenum(struct page *page) | |
10443 | { | |
10444 | return (page->flags >> (((((sizeof(unsigned long)*8) - 0) - 0) - 1) * (1 != 0))) & ((1UL << 1) - 1); | |
10445 | } | |
10446 | ||
10447 | struct zone; | |
10448 | extern struct zone *zone_table[]; | |
10449 | ||
10450 | static inline __attribute__((always_inline)) int page_zone_id(struct page *page) | |
10451 | { | |
10452 | return (page->flags >> (((((sizeof(unsigned long)*8) - 0) - 0) - 1) * (1 != 0))) & ((1UL << (0 + 1)) - 1); | |
10453 | } | |
10454 | static inline __attribute__((always_inline)) struct zone *page_zone(struct page *page) | |
10455 | { | |
10456 | return zone_table[page_zone_id(page)]; | |
10457 | } | |
10458 | ||
10459 | static inline __attribute__((always_inline)) unsigned long zone_to_nid(struct zone *zone) | |
10460 | { | |
10461 | ||
10462 | ||
10463 | ||
10464 | return 0; | |
10465 | ||
10466 | } | |
10467 | ||
10468 | static inline __attribute__((always_inline)) unsigned long page_to_nid(struct page *page) | |
10469 | { | |
10470 | if ((0 > 0 || 0 == 0)) | |
10471 | return (page->flags >> ((((sizeof(unsigned long)*8) - 0) - 0) * (0 != 0))) & ((1UL << 0) - 1); | |
10472 | else | |
10473 | return zone_to_nid(page_zone(page)); | |
10474 | } | |
10475 | static inline __attribute__((always_inline)) unsigned long page_to_section(struct page *page) | |
10476 | { | |
10477 | return (page->flags >> (((sizeof(unsigned long)*8) - 0) * (0 != 0))) & ((1UL << 0) - 1); | |
10478 | } | |
10479 | ||
10480 | static inline __attribute__((always_inline)) void set_page_zone(struct page *page, enum zone_type zone) | |
10481 | { | |
10482 | page->flags &= ~(((1UL << 1) - 1) << (((((sizeof(unsigned long)*8) - 0) - 0) - 1) * (1 != 0))); | |
10483 | page->flags |= (zone & ((1UL << 1) - 1)) << (((((sizeof(unsigned long)*8) - 0) - 0) - 1) * (1 != 0)); | |
10484 | } | |
10485 | ||
10486 | static inline __attribute__((always_inline)) void set_page_node(struct page *page, unsigned long node) | |
10487 | { | |
10488 | page->flags &= ~(((1UL << 0) - 1) << ((((sizeof(unsigned long)*8) - 0) - 0) * (0 != 0))); | |
10489 | page->flags |= (node & ((1UL << 0) - 1)) << ((((sizeof(unsigned long)*8) - 0) - 0) * (0 != 0)); | |
10490 | } | |
10491 | static inline __attribute__((always_inline)) void set_page_section(struct page *page, unsigned long section) | |
10492 | { | |
10493 | page->flags &= ~(((1UL << 0) - 1) << (((sizeof(unsigned long)*8) - 0) * (0 != 0))); | |
10494 | page->flags |= (section & ((1UL << 0) - 1)) << (((sizeof(unsigned long)*8) - 0) * (0 != 0)); | |
10495 | } | |
10496 | ||
10497 | static inline __attribute__((always_inline)) void set_page_links(struct page *page, enum zone_type zone, | |
10498 | unsigned long node, unsigned long pfn) | |
10499 | { | |
10500 | set_page_zone(page, zone); | |
10501 | set_page_node(page, node); | |
10502 | set_page_section(page, ((pfn) >> 0)); | |
10503 | } | |
10504 | ||
10505 | ||
10506 | ||
10507 | ||
10508 | # 1 "include/linux/vmstat.h" 1 | |
10509 | # 34 "include/linux/vmstat.h" | |
10510 | enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT, | |
10511 | PGALLOC_DMA, PGALLOC_NORMAL , | |
10512 | PGFREE, PGACTIVATE, PGDEACTIVATE, | |
10513 | PGFAULT, PGMAJFAULT, | |
10514 | PGREFILL_DMA, PGREFILL_NORMAL , | |
10515 | PGSTEAL_DMA, PGSTEAL_NORMAL , | |
10516 | PGSCAN_KSWAPD_DMA, PGSCAN_KSWAPD_NORMAL , | |
10517 | PGSCAN_DIRECT_DMA, PGSCAN_DIRECT_NORMAL , | |
10518 | PGINODESTEAL, SLABS_SCANNED, KSWAPD_STEAL, KSWAPD_INODESTEAL, | |
10519 | PAGEOUTRUN, ALLOCSTALL, PGROTATED, | |
10520 | NR_VM_EVENT_ITEMS | |
10521 | }; | |
10522 | ||
10523 | struct vm_event_state { | |
10524 | unsigned long event[NR_VM_EVENT_ITEMS]; | |
10525 | }; | |
10526 | ||
10527 | extern __typeof__(struct vm_event_state) per_cpu__vm_event_states; | |
10528 | ||
10529 | static inline __attribute__((always_inline)) void __count_vm_event(enum vm_event_item item) | |
10530 | { | |
10531 | per_cpu__vm_event_states.event[item]++; | |
10532 | } | |
10533 | ||
10534 | static inline __attribute__((always_inline)) void count_vm_event(enum vm_event_item item) | |
10535 | { | |
10536 | (*({ extern int simple_identifier_vm_event_states(void); do { } while (0); &per_cpu__vm_event_states; })).event[item]++; | |
10537 | do { } while (0); | |
10538 | } | |
10539 | ||
10540 | static inline __attribute__((always_inline)) void __count_vm_events(enum vm_event_item item, long delta) | |
10541 | { | |
10542 | per_cpu__vm_event_states.event[item] += delta; | |
10543 | } | |
10544 | ||
10545 | static inline __attribute__((always_inline)) void count_vm_events(enum vm_event_item item, long delta) | |
10546 | { | |
10547 | (*({ extern int simple_identifier_vm_event_states(void); do { } while (0); &per_cpu__vm_event_states; })).event[item] += delta; | |
10548 | do { } while (0); | |
10549 | } | |
10550 | ||
10551 | extern void all_vm_events(unsigned long *); | |
10552 | extern void vm_events_fold_cpu(int cpu); | |
10553 | # 96 "include/linux/vmstat.h" | |
10554 | extern atomic_long_t vm_stat[NR_VM_ZONE_STAT_ITEMS]; | |
10555 | ||
10556 | static inline __attribute__((always_inline)) void zone_page_state_add(long x, struct zone *zone, | |
10557 | enum zone_stat_item item) | |
10558 | { | |
10559 | atomic_long_add(x, &zone->vm_stat[item]); | |
10560 | atomic_long_add(x, &vm_stat[item]); | |
10561 | } | |
10562 | ||
10563 | static inline __attribute__((always_inline)) unsigned long global_page_state(enum zone_stat_item item) | |
10564 | { | |
10565 | long x = atomic_long_read(&vm_stat[item]); | |
10566 | ||
10567 | ||
10568 | ||
10569 | ||
10570 | return x; | |
10571 | } | |
10572 | ||
10573 | static inline __attribute__((always_inline)) unsigned long zone_page_state(struct zone *zone, | |
10574 | enum zone_stat_item item) | |
10575 | { | |
10576 | long x = atomic_long_read(&zone->vm_stat[item]); | |
10577 | ||
10578 | ||
10579 | ||
10580 | ||
10581 | return x; | |
10582 | } | |
10583 | # 165 "include/linux/vmstat.h" | |
10584 | static inline __attribute__((always_inline)) void zap_zone_vm_stats(struct zone *zone) | |
10585 | { | |
10586 | memset(zone->vm_stat, 0, sizeof(zone->vm_stat)); | |
10587 | } | |
10588 | ||
10589 | extern void inc_zone_state(struct zone *, enum zone_stat_item); | |
10590 | # 192 "include/linux/vmstat.h" | |
10591 | static inline __attribute__((always_inline)) void __mod_zone_page_state(struct zone *zone, | |
10592 | enum zone_stat_item item, int delta) | |
10593 | { | |
10594 | zone_page_state_add(delta, zone, item); | |
10595 | } | |
10596 | ||
10597 | static inline __attribute__((always_inline)) void __inc_zone_state(struct zone *zone, enum zone_stat_item item) | |
10598 | { | |
10599 | atomic_long_inc(&zone->vm_stat[item]); | |
10600 | atomic_long_inc(&vm_stat[item]); | |
10601 | } | |
10602 | ||
10603 | static inline __attribute__((always_inline)) void __inc_zone_page_state(struct page *page, | |
10604 | enum zone_stat_item item) | |
10605 | { | |
10606 | __inc_zone_state(page_zone(page), item); | |
10607 | } | |
10608 | ||
10609 | static inline __attribute__((always_inline)) void __dec_zone_page_state(struct page *page, | |
10610 | enum zone_stat_item item) | |
10611 | { | |
10612 | atomic_long_dec(&page_zone(page)->vm_stat[item]); | |
10613 | atomic_long_dec(&vm_stat[item]); | |
10614 | } | |
10615 | # 225 "include/linux/vmstat.h" | |
10616 | static inline __attribute__((always_inline)) void refresh_cpu_vm_stats(int cpu) { } | |
10617 | static inline __attribute__((always_inline)) void refresh_vm_stats(void) { } | |
10618 | # 498 "include/linux/mm.h" 2 | |
10619 | ||
10620 | static inline __attribute__((always_inline)) __attribute__((always_inline)) void *lowmem_page_address(struct page *page) | |
10621 | { | |
10622 | return ((void *) ((unsigned long)((((unsigned long) ((void *)(((((page) - mem_map) << 12) + (0x00000000))))) >> 12) << 12))); | |
10623 | } | |
10624 | # 540 "include/linux/mm.h" | |
10625 | extern struct address_space swapper_space; | |
10626 | static inline __attribute__((always_inline)) struct address_space *page_mapping(struct page *page) | |
10627 | { | |
10628 | struct address_space *mapping = page->mapping; | |
10629 | ||
10630 | if (__builtin_expect(!!(0), 0)) | |
10631 | mapping = &swapper_space; | |
10632 | else if (__builtin_expect(!!((unsigned long)mapping & 1), 0)) | |
10633 | mapping = ((void *)0); | |
10634 | return mapping; | |
10635 | } | |
10636 | ||
10637 | static inline __attribute__((always_inline)) int PageAnon(struct page *page) | |
10638 | { | |
10639 | return ((unsigned long)page->mapping & 1) != 0; | |
10640 | } | |
10641 | ||
10642 | ||
10643 | ||
10644 | ||
10645 | ||
10646 | static inline __attribute__((always_inline)) unsigned long page_index(struct page *page) | |
10647 | { | |
10648 | if (__builtin_expect(!!(0), 0)) | |
10649 | return ((page)->private); | |
10650 | return page->index; | |
10651 | } | |
10652 | ||
10653 | ||
10654 | ||
10655 | ||
10656 | ||
10657 | ||
10658 | static inline __attribute__((always_inline)) void reset_page_mapcount(struct page *page) | |
10659 | { | |
10660 | (((&(page)->_mapcount)->counter) = -1); | |
10661 | } | |
10662 | ||
10663 | static inline __attribute__((always_inline)) int page_mapcount(struct page *page) | |
10664 | { | |
10665 | return ((&(page)->_mapcount)->counter) + 1; | |
10666 | } | |
10667 | ||
10668 | ||
10669 | ||
10670 | ||
10671 | static inline __attribute__((always_inline)) int page_mapped(struct page *page) | |
10672 | { | |
10673 | return ((&(page)->_mapcount)->counter) >= 0; | |
10674 | } | |
10675 | # 622 "include/linux/mm.h" | |
10676 | extern void show_free_areas(void); | |
10677 | # 634 "include/linux/mm.h" | |
10678 | static inline __attribute__((always_inline)) int shmem_lock(struct file *file, int lock, | |
10679 | struct user_struct *user) | |
10680 | { | |
10681 | return 0; | |
10682 | } | |
10683 | ||
10684 | static inline __attribute__((always_inline)) int shmem_set_policy(struct vm_area_struct *vma, | |
10685 | struct mempolicy *new) | |
10686 | { | |
10687 | return 0; | |
10688 | } | |
10689 | ||
10690 | static inline __attribute__((always_inline)) struct mempolicy *shmem_get_policy(struct vm_area_struct *vma, | |
10691 | unsigned long addr) | |
10692 | { | |
10693 | return ((void *)0); | |
10694 | } | |
10695 | ||
10696 | struct file *shmem_file_setup(char *name, loff_t size, unsigned long flags); | |
10697 | extern int shmem_mmap(struct file *file, struct vm_area_struct *vma); | |
10698 | ||
10699 | int shmem_zero_setup(struct vm_area_struct *); | |
10700 | ||
10701 | ||
10702 | extern unsigned long shmem_get_unmapped_area(struct file *file, | |
10703 | unsigned long addr, | |
10704 | unsigned long len, | |
10705 | unsigned long pgoff, | |
10706 | unsigned long flags); | |
10707 | ||
10708 | ||
10709 | static inline __attribute__((always_inline)) int can_do_mlock(void) | |
10710 | { | |
10711 | if (capable(14)) | |
10712 | return 1; | |
10713 | if ((get_current())->signal->rlim[8].rlim_cur != 0) | |
10714 | return 1; | |
10715 | return 0; | |
10716 | } | |
10717 | extern int user_shm_lock(size_t, struct user_struct *); | |
10718 | extern void user_shm_unlock(size_t, struct user_struct *); | |
10719 | ||
10720 | ||
10721 | ||
10722 | ||
10723 | struct zap_details { | |
10724 | struct vm_area_struct *nonlinear_vma; | |
10725 | struct address_space *check_mapping; | |
10726 | unsigned long first_index; | |
10727 | unsigned long last_index; | |
10728 | spinlock_t *i_mmap_lock; | |
10729 | unsigned long truncate_count; | |
10730 | }; | |
10731 | ||
10732 | struct page *vm_normal_page(struct vm_area_struct *, unsigned long, pte_t); | |
10733 | unsigned long zap_page_range(struct vm_area_struct *vma, unsigned long address, | |
10734 | unsigned long size, struct zap_details *); | |
10735 | unsigned long unmap_vmas(struct mmu_gather **tlb, | |
10736 | struct vm_area_struct *start_vma, unsigned long start_addr, | |
10737 | unsigned long end_addr, unsigned long *nr_accounted, | |
10738 | struct zap_details *); | |
10739 | void free_pgd_range(struct mmu_gather **tlb, unsigned long addr, | |
10740 | unsigned long end, unsigned long floor, unsigned long ceiling); | |
10741 | void free_pgtables(struct mmu_gather **tlb, struct vm_area_struct *start_vma, | |
10742 | unsigned long floor, unsigned long ceiling); | |
10743 | int copy_page_range(struct mm_struct *dst, struct mm_struct *src, | |
10744 | struct vm_area_struct *vma); | |
10745 | int zeromap_page_range(struct vm_area_struct *vma, unsigned long from, | |
10746 | unsigned long size, pgprot_t prot); | |
10747 | void unmap_mapping_range(struct address_space *mapping, | |
10748 | loff_t const holebegin, loff_t const holelen, int even_cows); | |
10749 | ||
10750 | static inline __attribute__((always_inline)) void unmap_shared_mapping_range(struct address_space *mapping, | |
10751 | loff_t const holebegin, loff_t const holelen) | |
10752 | { | |
10753 | unmap_mapping_range(mapping, holebegin, holelen, 0); | |
10754 | } | |
10755 | ||
10756 | extern int vmtruncate(struct inode * inode, loff_t offset); | |
10757 | extern int vmtruncate_range(struct inode * inode, loff_t offset, loff_t end); | |
10758 | extern int install_page(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long addr, struct page *page, pgprot_t prot); | |
10759 | extern int install_file_pte(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long addr, unsigned long pgoff, pgprot_t prot); | |
10760 | # 729 "include/linux/mm.h" | |
10761 | static inline __attribute__((always_inline)) int handle_mm_fault(struct mm_struct *mm, | |
10762 | struct vm_area_struct *vma, unsigned long address, | |
10763 | int write_access) | |
10764 | { | |
10765 | ||
10766 | do { dump_stack(); printk("<4>" "\nkernel BUG at %s:%d!\n", "include/linux/mm.h", 734); panic("BUG!"); } while (0); | |
10767 | return 0x01; | |
10768 | } | |
10769 | ||
10770 | ||
10771 | extern int make_pages_present(unsigned long addr, unsigned long end); | |
10772 | extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write); | |
10773 | void install_arg_page(struct vm_area_struct *, struct page *, unsigned long); | |
10774 | ||
10775 | int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, unsigned long start, | |
10776 | int len, int write, int force, struct page **pages, struct vm_area_struct **vmas); | |
10777 | void print_bad_pte(struct vm_area_struct *, pte_t, unsigned long); | |
10778 | ||
10779 | extern int try_to_release_page(struct page * page, gfp_t gfp_mask); | |
10780 | extern void do_invalidatepage(struct page *page, unsigned long offset); | |
10781 | ||
10782 | int __set_page_dirty_nobuffers(struct page *page); | |
10783 | int redirty_page_for_writepage(struct writeback_control *wbc, | |
10784 | struct page *page); | |
10785 | int set_page_dirty(struct page *page); | |
10786 | int set_page_dirty_lock(struct page *page); | |
10787 | int clear_page_dirty_for_io(struct page *page); | |
10788 | ||
10789 | extern unsigned long do_mremap(unsigned long addr, | |
10790 | unsigned long old_len, unsigned long new_len, | |
10791 | unsigned long flags, unsigned long new_addr); | |
10792 | # 772 "include/linux/mm.h" | |
10793 | typedef int (*shrinker_t)(int nr_to_scan, gfp_t gfp_mask); | |
10794 | ||
10795 | ||
10796 | ||
10797 | ||
10798 | ||
10799 | ||
10800 | ||
10801 | struct shrinker; | |
10802 | extern struct shrinker *set_shrinker(int, shrinker_t); | |
10803 | extern void remove_shrinker(struct shrinker *shrinker); | |
10804 | ||
10805 | ||
10806 | ||
10807 | ||
10808 | ||
10809 | ||
10810 | ||
10811 | static inline __attribute__((always_inline)) int vma_wants_writenotify(struct vm_area_struct *vma) | |
10812 | { | |
10813 | unsigned int vm_flags = vma->vm_flags; | |
10814 | ||
10815 | ||
10816 | if ((vm_flags & (0x00000002|0x00000008)) != ((0x00000002|0x00000008))) | |
10817 | return 0; | |
10818 | ||
10819 | ||
10820 | if (vma->vm_ops && vma->vm_ops->page_mkwrite) | |
10821 | return 1; | |
10822 | ||
10823 | ||
10824 | if (((vma->vm_page_prot).pgprot) != | |
10825 | ((protection_map[vm_flags & (0x00000001|0x00000002|0x00000004|0x00000008)]).pgprot)) | |
10826 | ||
10827 | return 0; | |
10828 | ||
10829 | ||
10830 | if (vm_flags & (0x00000400|0x02000000)) | |
10831 | return 0; | |
10832 | ||
10833 | ||
10834 | return vma->vm_file && vma->vm_file->f_mapping && | |
10835 | (!(((vma->vm_file->f_mapping)->backing_dev_info)->capabilities & 0x00000001)); | |
10836 | } | |
10837 | ||
10838 | extern pte_t *get_locked_pte(struct mm_struct *mm, unsigned long addr, spinlock_t **ptl); | |
10839 | ||
10840 | int __pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address); | |
10841 | int __pmd_alloc(struct mm_struct *mm, pgd_t *pud, unsigned long address); | |
10842 | int __pte_alloc(struct mm_struct *mm, pmd_t *pmd, unsigned long address); | |
10843 | int __pte_alloc_kernel(pmd_t *pmd, unsigned long address); | |
10844 | # 890 "include/linux/mm.h" | |
10845 | extern void free_area_init(unsigned long * zones_size); | |
10846 | extern void free_area_init_node(int nid, pg_data_t *pgdat, | |
10847 | unsigned long * zones_size, unsigned long zone_start_pfn, | |
10848 | unsigned long *zholes_size); | |
10849 | # 943 "include/linux/mm.h" | |
10850 | extern void set_dma_reserve(unsigned long new_dma_reserve); | |
10851 | extern void memmap_init_zone(unsigned long, int, unsigned long, unsigned long); | |
10852 | extern void setup_per_zone_pages_min(void); | |
10853 | extern void mem_init(void); | |
10854 | extern void show_mem(void); | |
10855 | extern void si_meminfo(struct sysinfo * val); | |
10856 | extern void si_meminfo_node(struct sysinfo *val, int nid); | |
10857 | extern void zonetable_add(struct zone *zone, int nid, enum zone_type zid, | |
10858 | unsigned long pfn, unsigned long size); | |
10859 | ||
10860 | ||
10861 | ||
10862 | ||
10863 | static inline __attribute__((always_inline)) void setup_per_cpu_pageset(void) {} | |
10864 | ||
10865 | ||
10866 | ||
10867 | void vma_prio_tree_add(struct vm_area_struct *, struct vm_area_struct *old); | |
10868 | void vma_prio_tree_insert(struct vm_area_struct *, struct prio_tree_root *); | |
10869 | void vma_prio_tree_remove(struct vm_area_struct *, struct prio_tree_root *); | |
10870 | struct vm_area_struct *vma_prio_tree_next(struct vm_area_struct *vma, | |
10871 | struct prio_tree_iter *iter); | |
10872 | ||
10873 | ||
10874 | ||
10875 | ||
10876 | ||
10877 | static inline __attribute__((always_inline)) void vma_nonlinear_insert(struct vm_area_struct *vma, | |
10878 | struct list_head *list) | |
10879 | { | |
10880 | vma->shared.vm_set.parent = ((void *)0); | |
10881 | list_add_tail(&vma->shared.vm_set.list, list); | |
10882 | } | |
10883 | ||
10884 | ||
10885 | extern int __vm_enough_memory(long pages, int cap_sys_admin); | |
10886 | extern void vma_adjust(struct vm_area_struct *vma, unsigned long start, | |
10887 | unsigned long end, unsigned long pgoff, struct vm_area_struct *insert); | |
10888 | extern struct vm_area_struct *vma_merge(struct mm_struct *, | |
10889 | struct vm_area_struct *prev, unsigned long addr, unsigned long end, | |
10890 | unsigned long vm_flags, struct anon_vma *, struct file *, unsigned long, | |
10891 | struct mempolicy *); | |
10892 | extern struct anon_vma *find_mergeable_anon_vma(struct vm_area_struct *); | |
10893 | extern int split_vma(struct mm_struct *, | |
10894 | struct vm_area_struct *, unsigned long addr, int new_below); | |
10895 | extern int insert_vm_struct(struct mm_struct *, struct vm_area_struct *); | |
10896 | extern void __vma_link_rb(struct mm_struct *, struct vm_area_struct *, | |
10897 | struct rb_node **, struct rb_node *); | |
10898 | extern void unlink_file_vma(struct vm_area_struct *); | |
10899 | extern struct vm_area_struct *copy_vma(struct vm_area_struct **, | |
10900 | unsigned long addr, unsigned long len, unsigned long pgoff); | |
10901 | extern void exit_mmap(struct mm_struct *); | |
10902 | extern int may_expand_vm(struct mm_struct *mm, unsigned long npages); | |
10903 | ||
10904 | extern unsigned long get_unmapped_area(struct file *, unsigned long, unsigned long, unsigned long, unsigned long); | |
10905 | ||
10906 | extern unsigned long do_mmap_pgoff(struct file *file, unsigned long addr, | |
10907 | unsigned long len, unsigned long prot, | |
10908 | unsigned long flag, unsigned long pgoff); | |
10909 | ||
10910 | static inline __attribute__((always_inline)) unsigned long do_mmap(struct file *file, unsigned long addr, | |
10911 | unsigned long len, unsigned long prot, | |
10912 | unsigned long flag, unsigned long offset) | |
10913 | { | |
10914 | unsigned long ret = -22; | |
10915 | if ((offset + (((len)+(1UL << 12)-1)&(~((1UL << 12)-1)))) < offset) | |
10916 | goto out; | |
10917 | if (!(offset & ~(~((1UL << 12)-1)))) | |
10918 | ret = do_mmap_pgoff(file, addr, len, prot, flag, offset >> 12); | |
10919 | out: | |
10920 | return ret; | |
10921 | } | |
10922 | ||
10923 | extern int do_munmap(struct mm_struct *, unsigned long, size_t); | |
10924 | ||
10925 | extern unsigned long do_brk(unsigned long, unsigned long); | |
10926 | ||
10927 | ||
10928 | extern unsigned long page_unuse(struct page *); | |
10929 | extern void truncate_inode_pages(struct address_space *, loff_t); | |
10930 | extern void truncate_inode_pages_range(struct address_space *, | |
10931 | loff_t lstart, loff_t lend); | |
10932 | ||
10933 | ||
10934 | extern struct page *filemap_nopage(struct vm_area_struct *, unsigned long, int *); | |
10935 | extern int filemap_populate(struct vm_area_struct *, unsigned long, | |
10936 | unsigned long, pgprot_t, unsigned long, int); | |
10937 | ||
10938 | ||
10939 | int write_one_page(struct page *page, int wait); | |
10940 | ||
10941 | ||
10942 | typedef enum { | |
10943 | ||
10944 | PAGE_KEEP, | |
10945 | ||
10946 | PAGE_ACTIVATE, | |
10947 | ||
10948 | PAGE_SUCCESS, | |
10949 | ||
10950 | PAGE_CLEAN, | |
10951 | } pageout_t; | |
10952 | ||
10953 | pageout_t pageout(struct page *page, struct address_space *mapping); | |
10954 | ||
10955 | ||
10956 | ||
10957 | ||
10958 | ||
10959 | ||
10960 | ||
10961 | int do_page_cache_readahead(struct address_space *mapping, struct file *filp, | |
10962 | unsigned long offset, unsigned long nr_to_read); | |
10963 | int force_page_cache_readahead(struct address_space *mapping, struct file *filp, | |
10964 | unsigned long offset, unsigned long nr_to_read); | |
10965 | unsigned long page_cache_readahead(struct address_space *mapping, | |
10966 | struct file_ra_state *ra, | |
10967 | struct file *filp, | |
10968 | unsigned long offset, | |
10969 | unsigned long size); | |
10970 | void handle_ra_miss(struct address_space *mapping, | |
10971 | struct file_ra_state *ra, unsigned long offset); | |
10972 | unsigned long max_sane_readahead(unsigned long nr); | |
10973 | ||
10974 | ||
10975 | extern int expand_stack(struct vm_area_struct *vma, unsigned long address); | |
10976 | ||
10977 | ||
10978 | ||
10979 | ||
10980 | ||
10981 | extern struct vm_area_struct * find_vma(struct mm_struct * mm, unsigned long addr); | |
10982 | extern struct vm_area_struct * find_vma_prev(struct mm_struct * mm, unsigned long addr, | |
10983 | struct vm_area_struct **pprev); | |
10984 | ||
10985 | ||
10986 | ||
10987 | static inline __attribute__((always_inline)) struct vm_area_struct * find_vma_intersection(struct mm_struct * mm, unsigned long start_addr, unsigned long end_addr) | |
10988 | { | |
10989 | struct vm_area_struct * vma = find_vma(mm,start_addr); | |
10990 | ||
10991 | if (vma && end_addr <= vma->vm_start) | |
10992 | vma = ((void *)0); | |
10993 | return vma; | |
10994 | } | |
10995 | ||
10996 | static inline __attribute__((always_inline)) unsigned long vma_pages(struct vm_area_struct *vma) | |
10997 | { | |
10998 | return (vma->vm_end - vma->vm_start) >> 12; | |
10999 | } | |
11000 | ||
11001 | pgprot_t vm_get_page_prot(unsigned long vm_flags); | |
11002 | struct vm_area_struct *find_extend_vma(struct mm_struct *, unsigned long addr); | |
11003 | struct page *vmalloc_to_page(void *addr); | |
11004 | unsigned long vmalloc_to_pfn(void *addr); | |
11005 | int remap_pfn_range(struct vm_area_struct *, unsigned long addr, | |
11006 | unsigned long pfn, unsigned long size, pgprot_t); | |
11007 | int vm_insert_page(struct vm_area_struct *, unsigned long addr, struct page *); | |
11008 | ||
11009 | struct page *follow_page(struct vm_area_struct *, unsigned long address, | |
11010 | unsigned int foll_flags); | |
11011 | ||
11012 | ||
11013 | ||
11014 | ||
11015 | ||
11016 | ||
11017 | void vm_stat_account(struct mm_struct *, unsigned long, struct file *, long); | |
11018 | # 1119 "include/linux/mm.h" | |
11019 | static inline __attribute__((always_inline)) void | |
11020 | kernel_map_pages(struct page *page, int numpages, int enable) {} | |
11021 | ||
11022 | ||
11023 | extern struct vm_area_struct *get_gate_vma(struct task_struct *tsk); | |
11024 | ||
11025 | ||
11026 | ||
11027 | ||
11028 | int in_gate_area_no_task(unsigned long addr); | |
11029 | ||
11030 | ||
11031 | ||
11032 | int drop_caches_sysctl_handler(struct ctl_table *, int, struct file *, | |
11033 | void *, size_t *, loff_t *); | |
11034 | unsigned long shrink_slab(unsigned long scanned, gfp_t gfp_mask, | |
11035 | unsigned long lru_pages); | |
11036 | void drop_pagecache(void); | |
11037 | void drop_slab(void); | |
11038 | ||
11039 | ||
11040 | ||
11041 | ||
11042 | ||
11043 | ||
11044 | ||
11045 | __attribute__((weak)) const char *arch_vma_name(struct vm_area_struct *vma); | |
11046 | # 14 "include/asm/uaccess.h" 2 | |
11047 | ||
11048 | ||
11049 | ||
11050 | ||
11051 | ||
11052 | ||
11053 | ||
11054 | static inline __attribute__((always_inline)) void set_fs(mm_segment_t fs) | |
11055 | { | |
11056 | current_thread_info()->addr_limit = fs; | |
11057 | } | |
11058 | # 33 "include/asm/uaccess.h" | |
11059 | extern int is_in_rom(unsigned long); | |
11060 | ||
11061 | ||
11062 | ||
11063 | ||
11064 | ||
11065 | ||
11066 | ||
11067 | static inline __attribute__((always_inline)) int _access_ok(unsigned long addr, unsigned long size) | |
11068 | { | |
11069 | ||
11070 | ||
11071 | ||
11072 | extern unsigned long memory_end, physical_mem_end; | |
11073 | if (addr > (addr + size)) | |
11074 | return 0; | |
11075 | if ((((current_thread_info()->addr_limit)) == ((0x5)))) | |
11076 | return 1; | |
11077 | if (addr >= memory_start && (addr + size) <= memory_end) | |
11078 | return 1; | |
11079 | if (addr >= memory_mtd_end && (addr + size) <= physical_mem_end) | |
11080 | return 1; | |
11081 | if (addr >= (unsigned long)__init_begin && | |
11082 | addr + size <= (unsigned long)__init_end) | |
11083 | return 1; | |
11084 | if (addr >= 0xFFB00000 | |
11085 | && addr + size <= 0xFFB00000 + 0x1000) | |
11086 | return 1; | |
11087 | ||
11088 | if (addr >= 0xFFA00000 + (_etext_l1 - _stext_l1) | |
11089 | && addr + size <= 0xFFA00000 + 0xC000) | |
11090 | return 1; | |
11091 | ||
11092 | ||
11093 | if (addr >= 0xFF800000 + (_ebss_l1 - _sdata_l1) | |
11094 | && addr + size <= 0xFF800000 + (0x8000 - 0x4000)) | |
11095 | return 1; | |
11096 | ||
11097 | ||
11098 | if (addr >= 0xFF900000 | |
11099 | && addr + size <= 0xFF900000 + (0x8000 - 0x4000)) | |
11100 | return 1; | |
11101 | ||
11102 | return 0; | |
11103 | ||
11104 | } | |
11105 | # 93 "include/asm/uaccess.h" | |
11106 | struct exception_table_entry { | |
11107 | unsigned long insn, fixup; | |
11108 | }; | |
11109 | ||
11110 | ||
11111 | extern unsigned long search_exception_table(unsigned long); | |
11112 | # 140 "include/asm/uaccess.h" | |
11113 | static inline __attribute__((always_inline)) int bad_user_access_length(void) | |
11114 | { | |
11115 | panic("bad_user_access_length"); | |
11116 | return -1; | |
11117 | } | |
11118 | # 223 "include/asm/uaccess.h" | |
11119 | static inline __attribute__((always_inline)) long copy_from_user(void *to, | |
11120 | const void * from, unsigned long n) | |
11121 | { | |
11122 | if (_access_ok((unsigned long)(from),(n))) | |
11123 | memcpy(to, from, n); | |
11124 | else | |
11125 | return n; | |
11126 | return 0; | |
11127 | } | |
11128 | ||
11129 | static inline __attribute__((always_inline)) long copy_to_user(void *to, | |
11130 | const void * from, unsigned long n) | |
11131 | { | |
11132 | if (_access_ok((unsigned long)(to),(n))) | |
11133 | memcpy(to, from, n); | |
11134 | else | |
11135 | return n; | |
11136 | return 0; | |
11137 | } | |
11138 | ||
11139 | ||
11140 | ||
11141 | ||
11142 | ||
11143 | static inline __attribute__((always_inline)) long strncpy_from_user(char *dst, | |
11144 | const char *src, long count) | |
11145 | { | |
11146 | char *tmp; | |
11147 | if (!_access_ok((unsigned long)(src),(1))) | |
11148 | return -14; | |
11149 | strncpy(dst, src, count); | |
11150 | for (tmp = dst; *tmp && count > 0; tmp++, count--) ; | |
11151 | return (tmp - dst); | |
11152 | } | |
11153 | ||
11154 | ||
11155 | ||
11156 | ||
11157 | ||
11158 | ||
11159 | static inline __attribute__((always_inline)) long strnlen_user(const char *src, long n) | |
11160 | { | |
11161 | return (strlen(src) + 1); | |
11162 | } | |
11163 | ||
11164 | ||
11165 | ||
11166 | ||
11167 | ||
11168 | ||
11169 | ||
11170 | static inline __attribute__((always_inline)) unsigned long clear_user(void *to, unsigned long n) | |
11171 | { | |
11172 | memset(to, 0, n); | |
11173 | return 0; | |
11174 | } | |
11175 | # 48 "net/ipv4/ip_output.c" 2 | |
11176 | ||
11177 | # 1 "include/linux/module.h" 1 | |
11178 | # 15 "include/linux/module.h" | |
11179 | # 1 "include/linux/kmod.h" 1 | |
11180 | # 31 "include/linux/kmod.h" | |
11181 | extern int request_module(const char * name, ...) __attribute__ ((format (printf, 1, 2))); | |
11182 | ||
11183 | ||
11184 | ||
11185 | ||
11186 | ||
11187 | ||
11188 | struct key; | |
11189 | extern int call_usermodehelper_keys(char *path, char *argv[], char *envp[], | |
11190 | struct key *session_keyring, int wait); | |
11191 | ||
11192 | static inline __attribute__((always_inline)) int | |
11193 | call_usermodehelper(char *path, char **argv, char **envp, int wait) | |
11194 | { | |
11195 | return call_usermodehelper_keys(path, argv, envp, ((void *)0), wait); | |
11196 | } | |
11197 | ||
11198 | extern void usermodehelper_init(void); | |
11199 | ||
11200 | struct file; | |
11201 | extern int call_usermodehelper_pipe(char *path, char *argv[], char *envp[], | |
11202 | struct file **filp); | |
11203 | # 16 "include/linux/module.h" 2 | |
11204 | # 1 "include/linux/elf.h" 1 | |
11205 | ||
11206 | ||
11207 | ||
11208 | ||
11209 | ||
11210 | # 1 "include/linux/elf-em.h" 1 | |
11211 | # 7 "include/linux/elf.h" 2 | |
11212 | # 1 "include/asm/elf.h" 1 | |
11213 | # 19 "include/asm/elf.h" | |
11214 | typedef unsigned long elf_greg_t; | |
11215 | ||
11216 | ||
11217 | typedef elf_greg_t elf_gregset_t[(sizeof(struct user_regs_struct) / sizeof(elf_greg_t))]; | |
11218 | ||
11219 | typedef struct user_bfinfp_struct elf_fpregset_t; | |
11220 | # 8 "include/linux/elf.h" 2 | |
11221 | # 17 "include/linux/elf.h" | |
11222 | typedef __u32 Elf32_Addr; | |
11223 | typedef __u16 Elf32_Half; | |
11224 | typedef __u32 Elf32_Off; | |
11225 | typedef __s32 Elf32_Sword; | |
11226 | typedef __u32 Elf32_Word; | |
11227 | ||
11228 | ||
11229 | typedef __u64 Elf64_Addr; | |
11230 | typedef __u16 Elf64_Half; | |
11231 | typedef __s16 Elf64_SHalf; | |
11232 | typedef __u64 Elf64_Off; | |
11233 | typedef __s32 Elf64_Sword; | |
11234 | typedef __u32 Elf64_Word; | |
11235 | typedef __u64 Elf64_Xword; | |
11236 | typedef __s64 Elf64_Sxword; | |
11237 | # 107 "include/linux/elf.h" | |
11238 | typedef struct dynamic{ | |
11239 | Elf32_Sword d_tag; | |
11240 | union{ | |
11241 | Elf32_Sword d_val; | |
11242 | Elf32_Addr d_ptr; | |
11243 | } d_un; | |
11244 | } Elf32_Dyn; | |
11245 | ||
11246 | typedef struct { | |
11247 | Elf64_Sxword d_tag; | |
11248 | union { | |
11249 | Elf64_Xword d_val; | |
11250 | Elf64_Addr d_ptr; | |
11251 | } d_un; | |
11252 | } Elf64_Dyn; | |
11253 | # 130 "include/linux/elf.h" | |
11254 | typedef struct elf32_rel { | |
11255 | Elf32_Addr r_offset; | |
11256 | Elf32_Word r_info; | |
11257 | } Elf32_Rel; | |
11258 | ||
11259 | typedef struct elf64_rel { | |
11260 | Elf64_Addr r_offset; | |
11261 | Elf64_Xword r_info; | |
11262 | } Elf64_Rel; | |
11263 | ||
11264 | typedef struct elf32_rela{ | |
11265 | Elf32_Addr r_offset; | |
11266 | Elf32_Word r_info; | |
11267 | Elf32_Sword r_addend; | |
11268 | } Elf32_Rela; | |
11269 | ||
11270 | typedef struct elf64_rela { | |
11271 | Elf64_Addr r_offset; | |
11272 | Elf64_Xword r_info; | |
11273 | Elf64_Sxword r_addend; | |
11274 | } Elf64_Rela; | |
11275 | ||
11276 | typedef struct elf32_sym{ | |
11277 | Elf32_Word st_name; | |
11278 | Elf32_Addr st_value; | |
11279 | Elf32_Word st_size; | |
11280 | unsigned char st_info; | |
11281 | unsigned char st_other; | |
11282 | Elf32_Half st_shndx; | |
11283 | } Elf32_Sym; | |
11284 | ||
11285 | typedef struct elf64_sym { | |
11286 | Elf64_Word st_name; | |
11287 | unsigned char st_info; | |
11288 | unsigned char st_other; | |
11289 | Elf64_Half st_shndx; | |
11290 | Elf64_Addr st_value; | |
11291 | Elf64_Xword st_size; | |
11292 | } Elf64_Sym; | |
11293 | ||
11294 | ||
11295 | ||
11296 | ||
11297 | typedef struct elf32_hdr{ | |
11298 | unsigned char e_ident[16]; | |
11299 | Elf32_Half e_type; | |
11300 | Elf32_Half e_machine; | |
11301 | Elf32_Word e_version; | |
11302 | Elf32_Addr e_entry; | |
11303 | Elf32_Off e_phoff; | |
11304 | Elf32_Off e_shoff; | |
11305 | Elf32_Word e_flags; | |
11306 | Elf32_Half e_ehsize; | |
11307 | Elf32_Half e_phentsize; | |
11308 | Elf32_Half e_phnum; | |
11309 | Elf32_Half e_shentsize; | |
11310 | Elf32_Half e_shnum; | |
11311 | Elf32_Half e_shstrndx; | |
11312 | } Elf32_Ehdr; | |
11313 | ||
11314 | typedef struct elf64_hdr { | |
11315 | unsigned char e_ident[16]; | |
11316 | Elf64_Half e_type; | |
11317 | Elf64_Half e_machine; | |
11318 | Elf64_Word e_version; | |
11319 | Elf64_Addr e_entry; | |
11320 | Elf64_Off e_phoff; | |
11321 | Elf64_Off e_shoff; | |
11322 | Elf64_Word e_flags; | |
11323 | Elf64_Half e_ehsize; | |
11324 | Elf64_Half e_phentsize; | |
11325 | Elf64_Half e_phnum; | |
11326 | Elf64_Half e_shentsize; | |
11327 | Elf64_Half e_shnum; | |
11328 | Elf64_Half e_shstrndx; | |
11329 | } Elf64_Ehdr; | |
11330 | ||
11331 | ||
11332 | ||
11333 | ||
11334 | ||
11335 | ||
11336 | ||
11337 | typedef struct elf32_phdr{ | |
11338 | Elf32_Word p_type; | |
11339 | Elf32_Off p_offset; | |
11340 | Elf32_Addr p_vaddr; | |
11341 | Elf32_Addr p_paddr; | |
11342 | Elf32_Word p_filesz; | |
11343 | Elf32_Word p_memsz; | |
11344 | Elf32_Word p_flags; | |
11345 | Elf32_Word p_align; | |
11346 | } Elf32_Phdr; | |
11347 | ||
11348 | typedef struct elf64_phdr { | |
11349 | Elf64_Word p_type; | |
11350 | Elf64_Word p_flags; | |
11351 | Elf64_Off p_offset; | |
11352 | Elf64_Addr p_vaddr; | |
11353 | Elf64_Addr p_paddr; | |
11354 | Elf64_Xword p_filesz; | |
11355 | Elf64_Xword p_memsz; | |
11356 | Elf64_Xword p_align; | |
11357 | } Elf64_Phdr; | |
11358 | # 269 "include/linux/elf.h" | |
11359 | typedef struct { | |
11360 | Elf32_Word sh_name; | |
11361 | Elf32_Word sh_type; | |
11362 | Elf32_Word sh_flags; | |
11363 | Elf32_Addr sh_addr; | |
11364 | Elf32_Off sh_offset; | |
11365 | Elf32_Word sh_size; | |
11366 | Elf32_Word sh_link; | |
11367 | Elf32_Word sh_info; | |
11368 | Elf32_Word sh_addralign; | |
11369 | Elf32_Word sh_entsize; | |
11370 | } Elf32_Shdr; | |
11371 | ||
11372 | typedef struct elf64_shdr { | |
11373 | Elf64_Word sh_name; | |
11374 | Elf64_Word sh_type; | |
11375 | Elf64_Xword sh_flags; | |
11376 | Elf64_Addr sh_addr; | |
11377 | Elf64_Off sh_offset; | |
11378 | Elf64_Xword sh_size; | |
11379 | Elf64_Word sh_link; | |
11380 | Elf64_Word sh_info; | |
11381 | Elf64_Xword sh_addralign; | |
11382 | Elf64_Xword sh_entsize; | |
11383 | } Elf64_Shdr; | |
11384 | # 342 "include/linux/elf.h" | |
11385 | typedef struct elf32_note { | |
11386 | Elf32_Word n_namesz; | |
11387 | Elf32_Word n_descsz; | |
11388 | Elf32_Word n_type; | |
11389 | } Elf32_Nhdr; | |
11390 | ||
11391 | ||
11392 | typedef struct elf64_note { | |
11393 | Elf64_Word n_namesz; | |
11394 | Elf64_Word n_descsz; | |
11395 | Elf64_Word n_type; | |
11396 | } Elf64_Nhdr; | |
11397 | ||
11398 | ||
11399 | ||
11400 | extern Elf32_Dyn _DYNAMIC []; | |
11401 | # 17 "include/linux/module.h" 2 | |
11402 | ||
11403 | ||
11404 | # 1 "include/linux/moduleparam.h" 1 | |
11405 | # 29 "include/linux/moduleparam.h" | |
11406 | struct kernel_param; | |
11407 | ||
11408 | ||
11409 | typedef int (*param_set_fn)(const char *val, struct kernel_param *kp); | |
11410 | ||
11411 | typedef int (*param_get_fn)(char *buffer, struct kernel_param *kp); | |
11412 | ||
11413 | struct kernel_param { | |
11414 | const char *name; | |
11415 | unsigned int perm; | |
11416 | param_set_fn set; | |
11417 | param_get_fn get; | |
11418 | void *arg; | |
11419 | }; | |
11420 | ||
11421 | ||
11422 | struct kparam_string { | |
11423 | unsigned int maxlen; | |
11424 | char *string; | |
11425 | }; | |
11426 | ||
11427 | ||
11428 | struct kparam_array | |
11429 | { | |
11430 | unsigned int max; | |
11431 | unsigned int *num; | |
11432 | param_set_fn set; | |
11433 | param_get_fn get; | |
11434 | unsigned int elemsize; | |
11435 | void *elem; | |
11436 | }; | |
11437 | # 95 "include/linux/moduleparam.h" | |
11438 | extern int parse_args(const char *name, | |
11439 | char *args, | |
11440 | struct kernel_param *params, | |
11441 | unsigned num, | |
11442 | int (*unknown)(char *param, char *val)); | |
11443 | ||
11444 | ||
11445 | ||
11446 | ||
11447 | ||
11448 | ||
11449 | ||
11450 | extern int param_set_byte(const char *val, struct kernel_param *kp); | |
11451 | extern int param_get_byte(char *buffer, struct kernel_param *kp); | |
11452 | ||
11453 | ||
11454 | extern int param_set_short(const char *val, struct kernel_param *kp); | |
11455 | extern int param_get_short(char *buffer, struct kernel_param *kp); | |
11456 | ||
11457 | ||
11458 | extern int param_set_ushort(const char *val, struct kernel_param *kp); | |
11459 | extern int param_get_ushort(char *buffer, struct kernel_param *kp); | |
11460 | ||
11461 | ||
11462 | extern int param_set_int(const char *val, struct kernel_param *kp); | |
11463 | extern int param_get_int(char *buffer, struct kernel_param *kp); | |
11464 | ||
11465 | ||
11466 | extern int param_set_uint(const char *val, struct kernel_param *kp); | |
11467 | extern int param_get_uint(char *buffer, struct kernel_param *kp); | |
11468 | ||
11469 | ||
11470 | extern int param_set_long(const char *val, struct kernel_param *kp); | |
11471 | extern int param_get_long(char *buffer, struct kernel_param *kp); | |
11472 | ||
11473 | ||
11474 | extern int param_set_ulong(const char *val, struct kernel_param *kp); | |
11475 | extern int param_get_ulong(char *buffer, struct kernel_param *kp); | |
11476 | ||
11477 | ||
11478 | extern int param_set_charp(const char *val, struct kernel_param *kp); | |
11479 | extern int param_get_charp(char *buffer, struct kernel_param *kp); | |
11480 | ||
11481 | ||
11482 | extern int param_set_bool(const char *val, struct kernel_param *kp); | |
11483 | extern int param_get_bool(char *buffer, struct kernel_param *kp); | |
11484 | ||
11485 | ||
11486 | extern int param_set_invbool(const char *val, struct kernel_param *kp); | |
11487 | extern int param_get_invbool(char *buffer, struct kernel_param *kp); | |
11488 | # 159 "include/linux/moduleparam.h" | |
11489 | extern int param_array_set(const char *val, struct kernel_param *kp); | |
11490 | extern int param_array_get(char *buffer, struct kernel_param *kp); | |
11491 | ||
11492 | extern int param_set_copystring(const char *val, struct kernel_param *kp); | |
11493 | extern int param_get_string(char *buffer, struct kernel_param *kp); | |
11494 | ||
11495 | ||
11496 | ||
11497 | struct module; | |
11498 | ||
11499 | extern int module_param_sysfs_setup(struct module *mod, | |
11500 | struct kernel_param *kparam, | |
11501 | unsigned int num_params); | |
11502 | ||
11503 | extern void module_param_sysfs_remove(struct module *mod); | |
11504 | # 20 "include/linux/module.h" 2 | |
11505 | # 1 "include/asm/local.h" 1 | |
11506 | ||
11507 | ||
11508 | ||
11509 | # 1 "include/asm-generic/local.h" 1 | |
11510 | ||
11511 | ||
11512 | ||
11513 | ||
11514 | # 1 "include/linux/hardirq.h" 1 | |
11515 | ||
11516 | ||
11517 | ||
11518 | ||
11519 | # 1 "include/linux/smp_lock.h" 1 | |
11520 | # 6 "include/linux/hardirq.h" 2 | |
11521 | ||
11522 | # 1 "include/asm/hardirq.h" 1 | |
11523 | ||
11524 | ||
11525 | ||
11526 | ||
11527 | ||
11528 | # 1 "include/asm/irq.h" 1 | |
11529 | # 20 "include/asm/irq.h" | |
11530 | # 1 "include/asm/mach/irq.h" 1 | |
11531 | # 21 "include/asm/irq.h" 2 | |
11532 | # 56 "include/asm/irq.h" | |
11533 | extern void sys_free_irq(unsigned int irq, void *dev_id); | |
11534 | ||
11535 | extern void ack_bad_irq(unsigned int irq); | |
11536 | ||
11537 | static __inline__ __attribute__((always_inline)) int irq_canonicalize(int irq) | |
11538 | { | |
11539 | return irq; | |
11540 | } | |
11541 | # 7 "include/asm/hardirq.h" 2 | |
11542 | ||
11543 | typedef struct { | |
11544 | unsigned int __softirq_pending; | |
11545 | unsigned int __syscall_count; | |
11546 | struct task_struct *__ksoftirqd_task; | |
11547 | } irq_cpustat_t; | |
11548 | ||
11549 | # 1 "include/linux/irq_cpustat.h" 1 | |
11550 | # 20 "include/linux/irq_cpustat.h" | |
11551 | extern irq_cpustat_t irq_stat[]; | |
11552 | # 15 "include/asm/hardirq.h" 2 | |
11553 | # 8 "include/linux/hardirq.h" 2 | |
11554 | # 95 "include/linux/hardirq.h" | |
11555 | struct task_struct; | |
11556 | ||
11557 | ||
11558 | static inline __attribute__((always_inline)) void account_system_vtime(struct task_struct *tsk) | |
11559 | { | |
11560 | } | |
11561 | # 129 "include/linux/hardirq.h" | |
11562 | extern void irq_exit(void); | |
11563 | # 6 "include/asm-generic/local.h" 2 | |
11564 | # 22 "include/asm-generic/local.h" | |
11565 | typedef struct | |
11566 | { | |
11567 | atomic_long_t a; | |
11568 | } local_t; | |
11569 | # 5 "include/asm/local.h" 2 | |
11570 | # 21 "include/linux/module.h" 2 | |
11571 | ||
11572 | # 1 "include/asm/module.h" 1 | |
11573 | # 12 "include/asm/module.h" | |
11574 | struct mod_arch_specific { | |
11575 | Elf32_Shdr *text_l1; | |
11576 | Elf32_Shdr *data_a_l1; | |
11577 | Elf32_Shdr *bss_a_l1; | |
11578 | Elf32_Shdr *data_b_l1; | |
11579 | Elf32_Shdr *bss_b_l1; | |
11580 | }; | |
11581 | # 23 "include/linux/module.h" 2 | |
11582 | # 34 "include/linux/module.h" | |
11583 | struct kernel_symbol | |
11584 | { | |
11585 | unsigned long value; | |
11586 | const char *name; | |
11587 | }; | |
11588 | ||
11589 | struct modversion_info | |
11590 | { | |
11591 | unsigned long crc; | |
11592 | char name[(64 - sizeof(unsigned long))]; | |
11593 | }; | |
11594 | ||
11595 | struct module; | |
11596 | ||
11597 | struct module_attribute { | |
11598 | struct attribute attr; | |
11599 | ssize_t (*show)(struct module_attribute *, struct module *, char *); | |
11600 | ssize_t (*store)(struct module_attribute *, struct module *, | |
11601 | const char *, size_t count); | |
11602 | void (*setup)(struct module *, const char *); | |
11603 | int (*test)(struct module *); | |
11604 | void (*free)(struct module *); | |
11605 | }; | |
11606 | ||
11607 | struct module_kobject | |
11608 | { | |
11609 | struct kobject kobj; | |
11610 | struct module *mod; | |
11611 | }; | |
11612 | ||
11613 | ||
11614 | extern int init_module(void); | |
11615 | extern void cleanup_module(void); | |
11616 | ||
11617 | ||
11618 | struct exception_table_entry; | |
11619 | ||
11620 | const struct exception_table_entry * | |
11621 | search_extable(const struct exception_table_entry *first, | |
11622 | const struct exception_table_entry *last, | |
11623 | unsigned long value); | |
11624 | void sort_extable(struct exception_table_entry *start, | |
11625 | struct exception_table_entry *finish); | |
11626 | void sort_main_extable(void); | |
11627 | ||
11628 | extern struct subsystem module_subsys; | |
11629 | # 165 "include/linux/module.h" | |
11630 | const struct exception_table_entry *search_exception_tables(unsigned long add); | |
11631 | ||
11632 | struct notifier_block; | |
11633 | ||
11634 | ||
11635 | ||
11636 | ||
11637 | void *__symbol_get(const char *symbol); | |
11638 | void *__symbol_get_gpl(const char *symbol); | |
11639 | # 222 "include/linux/module.h" | |
11640 | struct module_ref | |
11641 | { | |
11642 | local_t count; | |
11643 | } ; | |
11644 | ||
11645 | enum module_state | |
11646 | { | |
11647 | MODULE_STATE_LIVE, | |
11648 | MODULE_STATE_COMING, | |
11649 | MODULE_STATE_GOING, | |
11650 | }; | |
11651 | ||
11652 | ||
11653 | struct module_sect_attr | |
11654 | { | |
11655 | struct module_attribute mattr; | |
11656 | char *name; | |
11657 | unsigned long address; | |
11658 | }; | |
11659 | ||
11660 | struct module_sect_attrs | |
11661 | { | |
11662 | struct attribute_group grp; | |
11663 | int nsections; | |
11664 | struct module_sect_attr attrs[0]; | |
11665 | }; | |
11666 | ||
11667 | struct module_param_attrs; | |
11668 | ||
11669 | struct module | |
11670 | { | |
11671 | enum module_state state; | |
11672 | ||
11673 | ||
11674 | struct list_head list; | |
11675 | ||
11676 | ||
11677 | char name[(64 - sizeof(unsigned long))]; | |
11678 | ||
11679 | ||
11680 | struct module_kobject mkobj; | |
11681 | struct module_param_attrs *param_attrs; | |
11682 | struct module_attribute *modinfo_attrs; | |
11683 | const char *version; | |
11684 | const char *srcversion; | |
11685 | ||
11686 | ||
11687 | const struct kernel_symbol *syms; | |
11688 | unsigned int num_syms; | |
11689 | const unsigned long *crcs; | |
11690 | ||
11691 | ||
11692 | const struct kernel_symbol *gpl_syms; | |
11693 | unsigned int num_gpl_syms; | |
11694 | const unsigned long *gpl_crcs; | |
11695 | ||
11696 | ||
11697 | const struct kernel_symbol *unused_syms; | |
11698 | unsigned int num_unused_syms; | |
11699 | const unsigned long *unused_crcs; | |
11700 | ||
11701 | const struct kernel_symbol *unused_gpl_syms; | |
11702 | unsigned int num_unused_gpl_syms; | |
11703 | const unsigned long *unused_gpl_crcs; | |
11704 | ||
11705 | ||
11706 | const struct kernel_symbol *gpl_future_syms; | |
11707 | unsigned int num_gpl_future_syms; | |
11708 | const unsigned long *gpl_future_crcs; | |
11709 | ||
11710 | ||
11711 | unsigned int num_exentries; | |
11712 | const struct exception_table_entry *extable; | |
11713 | ||
11714 | ||
11715 | int (*init)(void); | |
11716 | ||
11717 | ||
11718 | void *module_init; | |
11719 | ||
11720 | ||
11721 | void *module_core; | |
11722 | ||
11723 | ||
11724 | unsigned long init_size, core_size; | |
11725 | ||
11726 | ||
11727 | unsigned long init_text_size, core_text_size; | |
11728 | ||
11729 | ||
11730 | void *unwind_info; | |
11731 | ||
11732 | ||
11733 | struct mod_arch_specific arch; | |
11734 | ||
11735 | ||
11736 | int unsafe; | |
11737 | ||
11738 | unsigned int taints; | |
11739 | ||
11740 | ||
11741 | ||
11742 | struct module_ref ref[1]; | |
11743 | ||
11744 | ||
11745 | struct list_head modules_which_use_me; | |
11746 | ||
11747 | ||
11748 | struct task_struct *waiter; | |
11749 | ||
11750 | ||
11751 | void (*exit)(void); | |
11752 | ||
11753 | ||
11754 | ||
11755 | ||
11756 | Elf32_Sym *symtab; | |
11757 | unsigned long num_symtab; | |
11758 | char *strtab; | |
11759 | ||
11760 | ||
11761 | struct module_sect_attrs *sect_attrs; | |
11762 | ||
11763 | ||
11764 | ||
11765 | void *percpu; | |
11766 | ||
11767 | ||
11768 | ||
11769 | char *args; | |
11770 | }; | |
11771 | ||
11772 | ||
11773 | ||
11774 | ||
11775 | static inline __attribute__((always_inline)) int module_is_live(struct module *mod) | |
11776 | { | |
11777 | return mod->state != MODULE_STATE_GOING; | |
11778 | } | |
11779 | ||
11780 | ||
11781 | struct module *module_text_address(unsigned long addr); | |
11782 | struct module *__module_text_address(unsigned long addr); | |
11783 | int is_module_address(unsigned long addr); | |
11784 | ||
11785 | ||
11786 | ||
11787 | struct module *module_get_kallsym(unsigned int symnum, unsigned long *value, | |
11788 | char *type, char *name, size_t namelen); | |
11789 | ||
11790 | ||
11791 | unsigned long module_kallsyms_lookup_name(const char *name); | |
11792 | ||
11793 | int is_exported(const char *name, const struct module *mod); | |
11794 | ||
11795 | extern void __module_put_and_exit(struct module *mod, long code) | |
11796 | __attribute__((noreturn)); | |
11797 | ||
11798 | ||
11799 | ||
11800 | unsigned int module_refcount(struct module *mod); | |
11801 | void __symbol_put(const char *symbol); | |
11802 | ||
11803 | void symbol_put_addr(void *addr); | |
11804 | ||
11805 | ||
11806 | ||
11807 | static inline __attribute__((always_inline)) void __module_get(struct module *module) | |
11808 | { | |
11809 | if (module) { | |
11810 | do { if (__builtin_expect(!!((module_refcount(module) == 0)!=0), 0)) do { dump_stack(); printk("<4>" "\nkernel BUG at %s:%d!\n", "include/linux/module.h", 392); panic("BUG!"); } while (0); } while(0); | |
11811 | atomic_long_inc(&(&module->ref[({ do { } while (0); 0; })].count)->a); | |
11812 | do { } while (0); | |
11813 | } | |
11814 | } | |
11815 | ||
11816 | static inline __attribute__((always_inline)) int try_module_get(struct module *module) | |
11817 | { | |
11818 | int ret = 1; | |
11819 | ||
11820 | if (module) { | |
11821 | unsigned int cpu = ({ do { } while (0); 0; }); | |
11822 | if (__builtin_expect(!!(module_is_live(module)), 1)) | |
11823 | atomic_long_inc(&(&module->ref[cpu].count)->a); | |
11824 | else | |
11825 | ret = 0; | |
11826 | do { } while (0); | |
11827 | } | |
11828 | return ret; | |
11829 | } | |
11830 | ||
11831 | static inline __attribute__((always_inline)) void module_put(struct module *module) | |
11832 | { | |
11833 | if (module) { | |
11834 | unsigned int cpu = ({ do { } while (0); 0; }); | |
11835 | atomic_long_dec(&(&module->ref[cpu].count)->a); | |
11836 | ||
11837 | if (__builtin_expect(!!(!module_is_live(module)), 0)) | |
11838 | wake_up_process(module->waiter); | |
11839 | do { } while (0); | |
11840 | } | |
11841 | } | |
11842 | # 459 "include/linux/module.h" | |
11843 | const char *module_address_lookup(unsigned long addr, | |
11844 | unsigned long *symbolsize, | |
11845 | unsigned long *offset, | |
11846 | char **modname); | |
11847 | ||
11848 | ||
11849 | const struct exception_table_entry *search_module_extables(unsigned long addr); | |
11850 | ||
11851 | int register_module_notifier(struct notifier_block * nb); | |
11852 | int unregister_module_notifier(struct notifier_block * nb); | |
11853 | ||
11854 | extern void print_modules(void); | |
11855 | ||
11856 | struct device_driver; | |
11857 | void module_add_driver(struct module *, struct device_driver *); | |
11858 | void module_remove_driver(struct device_driver *); | |
11859 | # 50 "net/ipv4/ip_output.c" 2 | |
11860 | ||
11861 | ||
11862 | ||
11863 | ||
11864 | ||
11865 | ||
11866 | ||
11867 | # 1 "include/linux/socket.h" 1 | |
11868 | # 11 "include/linux/socket.h" | |
11869 | struct __kernel_sockaddr_storage { | |
11870 | unsigned short ss_family; | |
11871 | ||
11872 | char __data[128 - sizeof(unsigned short)]; | |
11873 | ||
11874 | ||
11875 | } __attribute__ ((aligned((__alignof__ (struct sockaddr *))))); | |
11876 | ||
11877 | ||
11878 | ||
11879 | # 1 "include/asm/socket.h" 1 | |
11880 | ||
11881 | ||
11882 | ||
11883 | # 1 "include/asm/sockios.h" 1 | |
11884 | # 5 "include/asm/socket.h" 2 | |
11885 | # 22 "include/linux/socket.h" 2 | |
11886 | # 1 "include/linux/sockios.h" 1 | |
11887 | # 23 "include/linux/socket.h" 2 | |
11888 | ||
11889 | ||
11890 | ||
11891 | ||
11892 | extern int sysctl_somaxconn; | |
11893 | ||
11894 | struct seq_file; | |
11895 | extern void socket_seq_show(struct seq_file *seq); | |
11896 | ||
11897 | ||
11898 | typedef unsigned short sa_family_t; | |
11899 | ||
11900 | ||
11901 | ||
11902 | ||
11903 | ||
11904 | struct sockaddr { | |
11905 | sa_family_t sa_family; | |
11906 | char sa_data[14]; | |
11907 | }; | |
11908 | ||
11909 | struct linger { | |
11910 | int l_onoff; | |
11911 | int l_linger; | |
11912 | }; | |
11913 | # 57 "include/linux/socket.h" | |
11914 | struct msghdr { | |
11915 | void * msg_name; | |
11916 | int msg_namelen; | |
11917 | struct iovec * msg_iov; | |
11918 | __kernel_size_t msg_iovlen; | |
11919 | void * msg_control; | |
11920 | __kernel_size_t msg_controllen; | |
11921 | unsigned msg_flags; | |
11922 | }; | |
11923 | ||
11924 | ||
11925 | ||
11926 | ||
11927 | ||
11928 | ||
11929 | ||
11930 | struct cmsghdr { | |
11931 | __kernel_size_t cmsg_len; | |
11932 | int cmsg_level; | |
11933 | int cmsg_type; | |
11934 | }; | |
11935 | # 130 "include/linux/socket.h" | |
11936 | static inline __attribute__((always_inline)) struct cmsghdr * __cmsg_nxthdr(void *__ctl, __kernel_size_t __size, | |
11937 | struct cmsghdr *__cmsg) | |
11938 | { | |
11939 | struct cmsghdr * __ptr; | |
11940 | ||
11941 | __ptr = (struct cmsghdr*)(((unsigned char *) __cmsg) + ( ((__cmsg->cmsg_len)+sizeof(long)-1) & ~(sizeof(long)-1) )); | |
11942 | if ((unsigned long)((char*)(__ptr+1) - (char *) __ctl) > __size) | |
11943 | return (struct cmsghdr *)0; | |
11944 | ||
11945 | return __ptr; | |
11946 | } | |
11947 | ||
11948 | static inline __attribute__((always_inline)) struct cmsghdr * cmsg_nxthdr (struct msghdr *__msg, struct cmsghdr *__cmsg) | |
11949 | { | |
11950 | return __cmsg_nxthdr(__msg->msg_control, __msg->msg_controllen, __cmsg); | |
11951 | } | |
11952 | ||
11953 | ||
11954 | ||
11955 | ||
11956 | ||
11957 | ||
11958 | ||
11959 | struct ucred { | |
11960 | __u32 pid; | |
11961 | __u32 uid; | |
11962 | __u32 gid; | |
11963 | }; | |
11964 | # 289 "include/linux/socket.h" | |
11965 | extern int memcpy_fromiovec(unsigned char *kdata, struct iovec *iov, int len); | |
11966 | extern int memcpy_fromiovecend(unsigned char *kdata, struct iovec *iov, | |
11967 | int offset, int len); | |
11968 | extern int csum_partial_copy_fromiovecend(unsigned char *kdata, | |
11969 | struct iovec *iov, | |
11970 | int offset, | |
11971 | unsigned int len, int *csump); | |
11972 | ||
11973 | extern int verify_iovec(struct msghdr *m, struct iovec *iov, char *address, int mode); | |
11974 | extern int memcpy_toiovec(struct iovec *v, unsigned char *kdata, int len); | |
11975 | extern int move_addr_to_user(void *kaddr, int klen, void *uaddr, int *ulen); | |
11976 | extern int move_addr_to_kernel(void *uaddr, int ulen, void *kaddr); | |
11977 | extern int put_cmsg(struct msghdr*, int level, int type, int len, void *data); | |
11978 | # 58 "net/ipv4/ip_output.c" 2 | |
11979 | ||
11980 | # 1 "include/linux/in.h" 1 | |
11981 | # 25 "include/linux/in.h" | |
11982 | enum { | |
11983 | IPPROTO_IP = 0, | |
11984 | IPPROTO_ICMP = 1, | |
11985 | IPPROTO_IGMP = 2, | |
11986 | IPPROTO_IPIP = 4, | |
11987 | IPPROTO_TCP = 6, | |
11988 | IPPROTO_EGP = 8, | |
11989 | IPPROTO_PUP = 12, | |
11990 | IPPROTO_UDP = 17, | |
11991 | IPPROTO_IDP = 22, | |
11992 | IPPROTO_DCCP = 33, | |
11993 | IPPROTO_RSVP = 46, | |
11994 | IPPROTO_GRE = 47, | |
11995 | ||
11996 | IPPROTO_IPV6 = 41, | |
11997 | ||
11998 | IPPROTO_ESP = 50, | |
11999 | IPPROTO_AH = 51, | |
12000 | IPPROTO_BEETPH = 94, | |
12001 | IPPROTO_PIM = 103, | |
12002 | ||
12003 | IPPROTO_COMP = 108, | |
12004 | IPPROTO_SCTP = 132, | |
12005 | ||
12006 | IPPROTO_RAW = 255, | |
12007 | IPPROTO_MAX | |
12008 | }; | |
12009 | ||
12010 | ||
12011 | ||
12012 | struct in_addr { | |
12013 | __be32 s_addr; | |
12014 | }; | |
12015 | # 113 "include/linux/in.h" | |
12016 | struct ip_mreq | |
12017 | { | |
12018 | struct in_addr imr_multiaddr; | |
12019 | struct in_addr imr_interface; | |
12020 | }; | |
12021 | ||
12022 | struct ip_mreqn | |
12023 | { | |
12024 | struct in_addr imr_multiaddr; | |
12025 | struct in_addr imr_address; | |
12026 | int imr_ifindex; | |
12027 | }; | |
12028 | ||
12029 | struct ip_mreq_source { | |
12030 | __be32 imr_multiaddr; | |
12031 | __be32 imr_interface; | |
12032 | __be32 imr_sourceaddr; | |
12033 | }; | |
12034 | ||
12035 | struct ip_msfilter { | |
12036 | __be32 imsf_multiaddr; | |
12037 | __be32 imsf_interface; | |
12038 | __u32 imsf_fmode; | |
12039 | __u32 imsf_numsrc; | |
12040 | __be32 imsf_slist[1]; | |
12041 | }; | |
12042 | ||
12043 | ||
12044 | ||
12045 | ||
12046 | ||
12047 | struct group_req | |
12048 | { | |
12049 | __u32 gr_interface; | |
12050 | struct __kernel_sockaddr_storage gr_group; | |
12051 | }; | |
12052 | ||
12053 | struct group_source_req | |
12054 | { | |
12055 | __u32 gsr_interface; | |
12056 | struct __kernel_sockaddr_storage gsr_group; | |
12057 | struct __kernel_sockaddr_storage gsr_source; | |
12058 | }; | |
12059 | ||
12060 | struct group_filter | |
12061 | { | |
12062 | __u32 gf_interface; | |
12063 | struct __kernel_sockaddr_storage gf_group; | |
12064 | __u32 gf_fmode; | |
12065 | __u32 gf_numsrc; | |
12066 | struct __kernel_sockaddr_storage gf_slist[1]; | |
12067 | }; | |
12068 | ||
12069 | ||
12070 | ||
12071 | ||
12072 | ||
12073 | struct in_pktinfo | |
12074 | { | |
12075 | int ipi_ifindex; | |
12076 | struct in_addr ipi_spec_dst; | |
12077 | struct in_addr ipi_addr; | |
12078 | }; | |
12079 | ||
12080 | ||
12081 | ||
12082 | struct sockaddr_in { | |
12083 | sa_family_t sin_family; | |
12084 | __be16 sin_port; | |
12085 | struct in_addr sin_addr; | |
12086 | ||
12087 | ||
12088 | unsigned char __pad[16 - sizeof(short int) - | |
12089 | sizeof(unsigned short int) - sizeof(struct in_addr)]; | |
12090 | }; | |
12091 | # 60 "net/ipv4/ip_output.c" 2 | |
12092 | # 1 "include/linux/inet.h" 1 | |
12093 | # 48 "include/linux/inet.h" | |
12094 | extern __be32 in_aton(const char *str); | |
12095 | extern int in4_pton(const char *src, int srclen, u8 *dst, char delim, const char **end); | |
12096 | extern int in6_pton(const char *src, int srclen, u8 *dst, char delim, const char **end); | |
12097 | # 61 "net/ipv4/ip_output.c" 2 | |
12098 | # 1 "include/linux/netdevice.h" 1 | |
12099 | # 28 "include/linux/netdevice.h" | |
12100 | # 1 "include/linux/if.h" 1 | |
12101 | # 27 "include/linux/if.h" | |
12102 | # 1 "include/linux/hdlc/ioctl.h" 1 | |
12103 | # 37 "include/linux/hdlc/ioctl.h" | |
12104 | typedef struct { | |
12105 | unsigned int clock_rate; | |
12106 | unsigned int clock_type; | |
12107 | unsigned short loopback; | |
12108 | } sync_serial_settings; | |
12109 | ||
12110 | typedef struct { | |
12111 | unsigned int clock_rate; | |
12112 | unsigned int clock_type; | |
12113 | unsigned short loopback; | |
12114 | unsigned int slot_map; | |
12115 | } te1_settings; | |
12116 | ||
12117 | typedef struct { | |
12118 | unsigned short encoding; | |
12119 | unsigned short parity; | |
12120 | } raw_hdlc_proto; | |
12121 | ||
12122 | typedef struct { | |
12123 | unsigned int t391; | |
12124 | unsigned int t392; | |
12125 | unsigned int n391; | |
12126 | unsigned int n392; | |
12127 | unsigned int n393; | |
12128 | unsigned short lmi; | |
12129 | unsigned short dce; | |
12130 | } fr_proto; | |
12131 | ||
12132 | typedef struct { | |
12133 | unsigned int dlci; | |
12134 | } fr_proto_pvc; | |
12135 | ||
12136 | typedef struct { | |
12137 | unsigned int dlci; | |
12138 | char master[16]; | |
12139 | }fr_proto_pvc_info; | |
12140 | ||
12141 | typedef struct { | |
12142 | unsigned int interval; | |
12143 | unsigned int timeout; | |
12144 | } cisco_proto; | |
12145 | # 28 "include/linux/if.h" 2 | |
12146 | # 93 "include/linux/if.h" | |
12147 | enum { | |
12148 | IF_OPER_UNKNOWN, | |
12149 | IF_OPER_NOTPRESENT, | |
12150 | IF_OPER_DOWN, | |
12151 | IF_OPER_LOWERLAYERDOWN, | |
12152 | IF_OPER_TESTING, | |
12153 | IF_OPER_DORMANT, | |
12154 | IF_OPER_UP, | |
12155 | }; | |
12156 | ||
12157 | ||
12158 | enum { | |
12159 | IF_LINK_MODE_DEFAULT, | |
12160 | IF_LINK_MODE_DORMANT, | |
12161 | }; | |
12162 | # 119 "include/linux/if.h" | |
12163 | struct ifmap | |
12164 | { | |
12165 | unsigned long mem_start; | |
12166 | unsigned long mem_end; | |
12167 | unsigned short base_addr; | |
12168 | unsigned char irq; | |
12169 | unsigned char dma; | |
12170 | unsigned char port; | |
12171 | ||
12172 | }; | |
12173 | ||
12174 | struct if_settings | |
12175 | { | |
12176 | unsigned int type; | |
12177 | unsigned int size; | |
12178 | union { | |
12179 | ||
12180 | raw_hdlc_proto *raw_hdlc; | |
12181 | cisco_proto *cisco; | |
12182 | fr_proto *fr; | |
12183 | fr_proto_pvc *fr_pvc; | |
12184 | fr_proto_pvc_info *fr_pvc_info; | |
12185 | ||
12186 | ||
12187 | sync_serial_settings *sync; | |
12188 | te1_settings *te1; | |
12189 | } ifs_ifsu; | |
12190 | }; | |
12191 | # 155 "include/linux/if.h" | |
12192 | struct ifreq | |
12193 | { | |
12194 | ||
12195 | union | |
12196 | { | |
12197 | char ifrn_name[16]; | |
12198 | } ifr_ifrn; | |
12199 | ||
12200 | union { | |
12201 | struct sockaddr ifru_addr; | |
12202 | struct sockaddr ifru_dstaddr; | |
12203 | struct sockaddr ifru_broadaddr; | |
12204 | struct sockaddr ifru_netmask; | |
12205 | struct sockaddr ifru_hwaddr; | |
12206 | short ifru_flags; | |
12207 | int ifru_ivalue; | |
12208 | int ifru_mtu; | |
12209 | struct ifmap ifru_map; | |
12210 | char ifru_slave[16]; | |
12211 | char ifru_newname[16]; | |
12212 | void * ifru_data; | |
12213 | struct if_settings ifru_settings; | |
12214 | } ifr_ifru; | |
12215 | }; | |
12216 | # 205 "include/linux/if.h" | |
12217 | struct ifconf | |
12218 | { | |
12219 | int ifc_len; | |
12220 | union | |
12221 | { | |
12222 | char *ifcu_buf; | |
12223 | struct ifreq *ifcu_req; | |
12224 | } ifc_ifcu; | |
12225 | }; | |
12226 | # 29 "include/linux/netdevice.h" 2 | |
12227 | # 1 "include/linux/if_ether.h" 1 | |
12228 | # 104 "include/linux/if_ether.h" | |
12229 | struct ethhdr { | |
12230 | unsigned char h_dest[6]; | |
12231 | unsigned char h_source[6]; | |
12232 | __be16 h_proto; | |
12233 | } __attribute__((packed)); | |
12234 | ||
12235 | ||
12236 | # 1 "include/linux/skbuff.h" 1 | |
12237 | # 26 "include/linux/skbuff.h" | |
12238 | # 1 "include/linux/highmem.h" 1 | |
12239 | ||
12240 | ||
12241 | ||
12242 | ||
12243 | ||
12244 | ||
12245 | # 1 "include/asm/cacheflush.h" 1 | |
12246 | # 34 "include/asm/cacheflush.h" | |
12247 | # 1 "include/asm/cplb.h" 1 | |
12248 | # 35 "include/asm/cacheflush.h" 2 | |
12249 | ||
12250 | extern void blackfin_icache_dcache_flush_range(unsigned int, unsigned int); | |
12251 | extern void blackfin_icache_flush_range(unsigned int, unsigned int); | |
12252 | extern void blackfin_dcache_flush_range(unsigned int, unsigned int); | |
12253 | extern void blackfin_dcache_invalidate_range(unsigned int, unsigned int); | |
12254 | extern void blackfin_dflush_page(void *); | |
12255 | # 50 "include/asm/cacheflush.h" | |
12256 | static inline __attribute__((always_inline)) void flush_icache_range(unsigned start, unsigned end) | |
12257 | { | |
12258 | ||
12259 | ||
12260 | ||
12261 | blackfin_icache_flush_range((start), (end)); | |
12262 | # 70 "include/asm/cacheflush.h" | |
12263 | } | |
12264 | # 8 "include/linux/highmem.h" 2 | |
12265 | ||
12266 | ||
12267 | static inline __attribute__((always_inline)) void flush_anon_page(struct page *page, unsigned long vmaddr) | |
12268 | { | |
12269 | } | |
12270 | ||
12271 | ||
12272 | ||
12273 | static inline __attribute__((always_inline)) void flush_kernel_dcache_page(struct page *page) | |
12274 | { | |
12275 | } | |
12276 | # 31 "include/linux/highmem.h" | |
12277 | static inline __attribute__((always_inline)) unsigned int nr_free_highpages(void) { return 0; } | |
12278 | ||
12279 | ||
12280 | ||
12281 | ||
12282 | static inline __attribute__((always_inline)) void *kmap(struct page *page) | |
12283 | { | |
12284 | do { do { } while (0); } while (0); | |
12285 | return lowmem_page_address(page); | |
12286 | } | |
12287 | # 53 "include/linux/highmem.h" | |
12288 | static inline __attribute__((always_inline)) void clear_user_highpage(struct page *page, unsigned long vaddr) | |
12289 | { | |
12290 | void *addr = lowmem_page_address(page); | |
12291 | memset((addr), 0, (1UL << 12)); | |
12292 | do { } while (0); | |
12293 | ||
12294 | __asm__ __volatile__("": : :"memory"); | |
12295 | } | |
12296 | ||
12297 | ||
12298 | static inline __attribute__((always_inline)) struct page * | |
12299 | alloc_zeroed_user_highpage(struct vm_area_struct *vma, unsigned long vaddr) | |
12300 | { | |
12301 | struct page *page = alloc_pages_node(((0)), ((( gfp_t)0x10u) | (( gfp_t)0x40u) | (( gfp_t)0x80u) | (( gfp_t)0x20000u) | (( gfp_t)0x02u)), 0); | |
12302 | ||
12303 | if (page) | |
12304 | clear_user_highpage(page, vaddr); | |
12305 | ||
12306 | return page; | |
12307 | } | |
12308 | ||
12309 | ||
12310 | static inline __attribute__((always_inline)) void clear_highpage(struct page *page) | |
12311 | { | |
12312 | void *kaddr = lowmem_page_address(page); | |
12313 | memset((kaddr), 0, (1UL << 12)); | |
12314 | do { } while (0); | |
12315 | } | |
12316 | ||
12317 | ||
12318 | ||
12319 | ||
12320 | static inline __attribute__((always_inline)) void memclear_highpage_flush(struct page *page, unsigned int offset, unsigned int size) | |
12321 | { | |
12322 | void *kaddr; | |
12323 | ||
12324 | do { if (__builtin_expect(!!((offset + size > (1UL << 12))!=0), 0)) do { dump_stack(); printk("<4>" "\nkernel BUG at %s:%d!\n", "include/linux/highmem.h", 89); panic("BUG!"); } while (0); } while(0); | |
12325 | ||
12326 | kaddr = lowmem_page_address(page); | |
12327 | memset((char *)kaddr + offset, 0, size); | |
12328 | do { } while (0); | |
12329 | do { } while (0); | |
12330 | } | |
12331 | ||
12332 | static inline __attribute__((always_inline)) void copy_user_highpage(struct page *to, struct page *from, unsigned long vaddr) | |
12333 | { | |
12334 | char *vfrom, *vto; | |
12335 | ||
12336 | vfrom = lowmem_page_address(from); | |
12337 | vto = lowmem_page_address(to); | |
12338 | memcpy((vto), (vfrom), (1UL << 12)); | |
12339 | do { } while (0); | |
12340 | do { } while (0); | |
12341 | ||
12342 | __asm__ __volatile__("": : :"memory"); | |
12343 | } | |
12344 | ||
12345 | static inline __attribute__((always_inline)) void copy_highpage(struct page *to, struct page *from) | |
12346 | { | |
12347 | char *vfrom, *vto; | |
12348 | ||
12349 | vfrom = lowmem_page_address(from); | |
12350 | vto = lowmem_page_address(to); | |
12351 | memcpy((vto), (vfrom), (1UL << 12)); | |
12352 | do { } while (0); | |
12353 | do { } while (0); | |
12354 | } | |
12355 | # 27 "include/linux/skbuff.h" 2 | |
12356 | # 1 "include/linux/poll.h" 1 | |
12357 | ||
12358 | ||
12359 | ||
12360 | # 1 "include/asm/poll.h" 1 | |
12361 | # 18 "include/asm/poll.h" | |
12362 | struct pollfd { | |
12363 | int fd; | |
12364 | short events; | |
12365 | short revents; | |
12366 | }; | |
12367 | # 5 "include/linux/poll.h" 2 | |
12368 | # 23 "include/linux/poll.h" | |
12369 | struct poll_table_struct; | |
12370 | ||
12371 | ||
12372 | ||
12373 | ||
12374 | typedef void (*poll_queue_proc)(struct file *, wait_queue_head_t *, struct poll_table_struct *); | |
12375 | ||
12376 | typedef struct poll_table_struct { | |
12377 | poll_queue_proc qproc; | |
12378 | } poll_table; | |
12379 | ||
12380 | static inline __attribute__((always_inline)) void poll_wait(struct file * filp, wait_queue_head_t * wait_address, poll_table *p) | |
12381 | { | |
12382 | if (p && wait_address) | |
12383 | p->qproc(filp, wait_address, p); | |
12384 | } | |
12385 | ||
12386 | static inline __attribute__((always_inline)) void init_poll_funcptr(poll_table *pt, poll_queue_proc qproc) | |
12387 | { | |
12388 | pt->qproc = qproc; | |
12389 | } | |
12390 | ||
12391 | struct poll_table_entry { | |
12392 | struct file * filp; | |
12393 | wait_queue_t wait; | |
12394 | wait_queue_head_t * wait_address; | |
12395 | }; | |
12396 | ||
12397 | ||
12398 | ||
12399 | ||
12400 | struct poll_wqueues { | |
12401 | poll_table pt; | |
12402 | struct poll_table_page * table; | |
12403 | int error; | |
12404 | int inline_index; | |
12405 | struct poll_table_entry inline_entries[((832 - 256) / sizeof(struct poll_table_entry))]; | |
12406 | }; | |
12407 | ||
12408 | extern void poll_initwait(struct poll_wqueues *pwq); | |
12409 | extern void poll_freewait(struct poll_wqueues *pwq); | |
12410 | ||
12411 | ||
12412 | ||
12413 | ||
12414 | ||
12415 | typedef struct { | |
12416 | unsigned long *in, *out, *ex; | |
12417 | unsigned long *res_in, *res_out, *res_ex; | |
12418 | } fd_set_bits; | |
12419 | # 87 "include/linux/poll.h" | |
12420 | static inline __attribute__((always_inline)) | |
12421 | int get_fd_set(unsigned long nr, void *ufdset, unsigned long *fdset) | |
12422 | { | |
12423 | nr = ((((nr)+(8*sizeof(long))-1)/(8*sizeof(long)))*sizeof(long)); | |
12424 | if (ufdset) | |
12425 | return copy_from_user(fdset, ufdset, nr) ? -14 : 0; | |
12426 | ||
12427 | memset(fdset, 0, nr); | |
12428 | return 0; | |
12429 | } | |
12430 | ||
12431 | static inline __attribute__((always_inline)) unsigned long __attribute__((warn_unused_result)) | |
12432 | set_fd_set(unsigned long nr, void *ufdset, unsigned long *fdset) | |
12433 | { | |
12434 | if (ufdset) | |
12435 | return copy_to_user(ufdset, fdset, ((((nr)+(8*sizeof(long))-1)/(8*sizeof(long)))*sizeof(long))); | |
12436 | return 0; | |
12437 | } | |
12438 | ||
12439 | static inline __attribute__((always_inline)) | |
12440 | void zero_fd_set(unsigned long nr, unsigned long *fdset) | |
12441 | { | |
12442 | memset(fdset, 0, ((((nr)+(8*sizeof(long))-1)/(8*sizeof(long)))*sizeof(long))); | |
12443 | } | |
12444 | ||
12445 | ||
12446 | ||
12447 | extern int do_select(int n, fd_set_bits *fds, s64 *timeout); | |
12448 | extern int do_sys_poll(struct pollfd * ufds, unsigned int nfds, | |
12449 | s64 *timeout); | |
12450 | # 28 "include/linux/skbuff.h" 2 | |
12451 | # 1 "include/linux/net.h" 1 | |
12452 | # 24 "include/linux/net.h" | |
12453 | struct poll_table_struct; | |
12454 | struct inode; | |
12455 | # 47 "include/linux/net.h" | |
12456 | typedef enum { | |
12457 | SS_FREE = 0, | |
12458 | SS_UNCONNECTED, | |
12459 | SS_CONNECTING, | |
12460 | SS_CONNECTED, | |
12461 | SS_DISCONNECTING | |
12462 | } socket_state; | |
12463 | ||
12464 | ||
12465 | ||
12466 | ||
12467 | ||
12468 | # 1 "include/linux/random.h" 1 | |
12469 | # 35 "include/linux/random.h" | |
12470 | struct rand_pool_info { | |
12471 | int entropy_count; | |
12472 | int buf_size; | |
12473 | __u32 buf[0]; | |
12474 | }; | |
12475 | ||
12476 | ||
12477 | ||
12478 | ||
12479 | ||
12480 | extern void rand_initialize_irq(int irq); | |
12481 | ||
12482 | extern void add_input_randomness(unsigned int type, unsigned int code, | |
12483 | unsigned int value); | |
12484 | extern void add_interrupt_randomness(int irq); | |
12485 | ||
12486 | extern void get_random_bytes(void *buf, int nbytes); | |
12487 | void generate_random_uuid(unsigned char uuid_out[16]); | |
12488 | ||
12489 | extern __u32 secure_ip_id(__u32 daddr); | |
12490 | extern u32 secure_ipv4_port_ephemeral(__u32 saddr, __u32 daddr, __u16 dport); | |
12491 | extern u32 secure_ipv6_port_ephemeral(const __u32 *saddr, const __u32 *daddr, | |
12492 | __u16 dport); | |
12493 | extern __u32 secure_tcp_sequence_number(__u32 saddr, __u32 daddr, | |
12494 | __u16 sport, __u16 dport); | |
12495 | extern __u32 secure_tcpv6_sequence_number(__u32 *saddr, __u32 *daddr, | |
12496 | __u16 sport, __u16 dport); | |
12497 | extern u64 secure_dccp_sequence_number(__u32 saddr, __u32 daddr, | |
12498 | __u16 sport, __u16 dport); | |
12499 | ||
12500 | ||
12501 | extern struct file_operations random_fops, urandom_fops; | |
12502 | ||
12503 | ||
12504 | unsigned int get_random_int(void); | |
12505 | unsigned long randomize_range(unsigned long start, unsigned long end, unsigned long len); | |
12506 | ||
12507 | u32 random32(void); | |
12508 | void srandom32(u32 seed); | |
12509 | # 60 "include/linux/net.h" 2 | |
12510 | # 83 "include/linux/net.h" | |
12511 | enum sock_type { | |
12512 | SOCK_STREAM = 1, | |
12513 | SOCK_DGRAM = 2, | |
12514 | SOCK_RAW = 3, | |
12515 | SOCK_RDM = 4, | |
12516 | SOCK_SEQPACKET = 5, | |
12517 | SOCK_DCCP = 6, | |
12518 | SOCK_PACKET = 10, | |
12519 | }; | |
12520 | # 108 "include/linux/net.h" | |
12521 | struct socket { | |
12522 | socket_state state; | |
12523 | unsigned long flags; | |
12524 | const struct proto_ops *ops; | |
12525 | struct fasync_struct *fasync_list; | |
12526 | struct file *file; | |
12527 | struct sock *sk; | |
12528 | wait_queue_head_t wait; | |
12529 | short type; | |
12530 | }; | |
12531 | ||
12532 | struct vm_area_struct; | |
12533 | struct page; | |
12534 | struct kiocb; | |
12535 | struct sockaddr; | |
12536 | struct msghdr; | |
12537 | struct module; | |
12538 | ||
12539 | struct proto_ops { | |
12540 | int family; | |
12541 | struct module *owner; | |
12542 | int (*release) (struct socket *sock); | |
12543 | int (*bind) (struct socket *sock, | |
12544 | struct sockaddr *myaddr, | |
12545 | int sockaddr_len); | |
12546 | int (*connect) (struct socket *sock, | |
12547 | struct sockaddr *vaddr, | |
12548 | int sockaddr_len, int flags); | |
12549 | int (*socketpair)(struct socket *sock1, | |
12550 | struct socket *sock2); | |
12551 | int (*accept) (struct socket *sock, | |
12552 | struct socket *newsock, int flags); | |
12553 | int (*getname) (struct socket *sock, | |
12554 | struct sockaddr *addr, | |
12555 | int *sockaddr_len, int peer); | |
12556 | unsigned int (*poll) (struct file *file, struct socket *sock, | |
12557 | struct poll_table_struct *wait); | |
12558 | int (*ioctl) (struct socket *sock, unsigned int cmd, | |
12559 | unsigned long arg); | |
12560 | int (*compat_ioctl) (struct socket *sock, unsigned int cmd, | |
12561 | unsigned long arg); | |
12562 | int (*listen) (struct socket *sock, int len); | |
12563 | int (*shutdown) (struct socket *sock, int flags); | |
12564 | int (*setsockopt)(struct socket *sock, int level, | |
12565 | int optname, char *optval, int optlen); | |
12566 | int (*getsockopt)(struct socket *sock, int level, | |
12567 | int optname, char *optval, int *optlen); | |
12568 | int (*compat_setsockopt)(struct socket *sock, int level, | |
12569 | int optname, char *optval, int optlen); | |
12570 | int (*compat_getsockopt)(struct socket *sock, int level, | |
12571 | int optname, char *optval, int *optlen); | |
12572 | int (*sendmsg) (struct kiocb *iocb, struct socket *sock, | |
12573 | struct msghdr *m, size_t total_len); | |
12574 | int (*recvmsg) (struct kiocb *iocb, struct socket *sock, | |
12575 | struct msghdr *m, size_t total_len, | |
12576 | int flags); | |
12577 | int (*mmap) (struct file *file, struct socket *sock, | |
12578 | struct vm_area_struct * vma); | |
12579 | ssize_t (*sendpage) (struct socket *sock, struct page *page, | |
12580 | int offset, size_t size, int flags); | |
12581 | }; | |
12582 | ||
12583 | struct net_proto_family { | |
12584 | int family; | |
12585 | int (*create)(struct socket *sock, int protocol); | |
12586 | struct module *owner; | |
12587 | }; | |
12588 | ||
12589 | struct iovec; | |
12590 | struct kvec; | |
12591 | ||
12592 | extern int sock_wake_async(struct socket *sk, int how, int band); | |
12593 | extern int sock_register(const struct net_proto_family *fam); | |
12594 | extern void sock_unregister(int family); | |
12595 | extern int sock_create(int family, int type, int proto, | |
12596 | struct socket **res); | |
12597 | extern int sock_create_kern(int family, int type, int proto, | |
12598 | struct socket **res); | |
12599 | extern int sock_create_lite(int family, int type, int proto, | |
12600 | struct socket **res); | |
12601 | extern void sock_release(struct socket *sock); | |
12602 | extern int sock_sendmsg(struct socket *sock, struct msghdr *msg, | |
12603 | size_t len); | |
12604 | extern int sock_recvmsg(struct socket *sock, struct msghdr *msg, | |
12605 | size_t size, int flags); | |
12606 | extern int sock_map_fd(struct socket *sock); | |
12607 | extern struct socket *sockfd_lookup(int fd, int *err); | |
12608 | ||
12609 | extern int net_ratelimit(void); | |
12610 | ||
12611 | ||
12612 | ||
12613 | ||
12614 | extern int kernel_sendmsg(struct socket *sock, struct msghdr *msg, | |
12615 | struct kvec *vec, size_t num, size_t len); | |
12616 | extern int kernel_recvmsg(struct socket *sock, struct msghdr *msg, | |
12617 | struct kvec *vec, size_t num, | |
12618 | size_t len, int flags); | |
12619 | ||
12620 | extern int kernel_bind(struct socket *sock, struct sockaddr *addr, | |
12621 | int addrlen); | |
12622 | extern int kernel_listen(struct socket *sock, int backlog); | |
12623 | extern int kernel_accept(struct socket *sock, struct socket **newsock, | |
12624 | int flags); | |
12625 | extern int kernel_connect(struct socket *sock, struct sockaddr *addr, | |
12626 | int addrlen, int flags); | |
12627 | extern int kernel_getsockname(struct socket *sock, struct sockaddr *addr, | |
12628 | int *addrlen); | |
12629 | extern int kernel_getpeername(struct socket *sock, struct sockaddr *addr, | |
12630 | int *addrlen); | |
12631 | extern int kernel_getsockopt(struct socket *sock, int level, int optname, | |
12632 | char *optval, int *optlen); | |
12633 | extern int kernel_setsockopt(struct socket *sock, int level, int optname, | |
12634 | char *optval, int optlen); | |
12635 | extern int kernel_sendpage(struct socket *sock, struct page *page, int offset, | |
12636 | size_t size, int flags); | |
12637 | extern int kernel_sock_ioctl(struct socket *sock, int cmd, unsigned long arg); | |
12638 | # 316 "include/linux/net.h" | |
12639 | # 1 "include/linux/sysctl.h" 1 | |
12640 | # 32 "include/linux/sysctl.h" | |
12641 | struct file; | |
12642 | struct completion; | |
12643 | ||
12644 | ||
12645 | ||
12646 | ||
12647 | ||
12648 | ||
12649 | struct __sysctl_args { | |
12650 | int *name; | |
12651 | int nlen; | |
12652 | void *oldval; | |
12653 | size_t *oldlenp; | |
12654 | void *newval; | |
12655 | size_t newlen; | |
12656 | unsigned long __unused[4]; | |
12657 | }; | |
12658 | # 61 "include/linux/sysctl.h" | |
12659 | enum | |
12660 | { | |
12661 | CTL_KERN=1, | |
12662 | CTL_VM=2, | |
12663 | CTL_NET=3, | |
12664 | ||
12665 | CTL_FS=5, | |
12666 | CTL_DEBUG=6, | |
12667 | CTL_DEV=7, | |
12668 | CTL_BUS=8, | |
12669 | CTL_ABI=9, | |
12670 | CTL_CPU=10 | |
12671 | }; | |
12672 | ||
12673 | ||
12674 | enum | |
12675 | { | |
12676 | CTL_BUS_ISA=1 | |
12677 | }; | |
12678 | ||
12679 | ||
12680 | enum | |
12681 | { | |
12682 | INOTIFY_MAX_USER_INSTANCES=1, | |
12683 | INOTIFY_MAX_USER_WATCHES=2, | |
12684 | INOTIFY_MAX_QUEUED_EVENTS=3 | |
12685 | }; | |
12686 | ||
12687 | ||
12688 | enum | |
12689 | { | |
12690 | KERN_OSTYPE=1, | |
12691 | KERN_OSRELEASE=2, | |
12692 | KERN_OSREV=3, | |
12693 | KERN_VERSION=4, | |
12694 | KERN_SECUREMASK=5, | |
12695 | KERN_PROF=6, | |
12696 | KERN_NODENAME=7, | |
12697 | KERN_DOMAINNAME=8, | |
12698 | ||
12699 | KERN_CAP_BSET=14, | |
12700 | KERN_PANIC=15, | |
12701 | KERN_REALROOTDEV=16, | |
12702 | ||
12703 | KERN_SPARC_REBOOT=21, | |
12704 | KERN_CTLALTDEL=22, | |
12705 | KERN_PRINTK=23, | |
12706 | KERN_NAMETRANS=24, | |
12707 | KERN_PPC_HTABRECLAIM=25, | |
12708 | KERN_PPC_ZEROPAGED=26, | |
12709 | KERN_PPC_POWERSAVE_NAP=27, | |
12710 | KERN_MODPROBE=28, | |
12711 | KERN_SG_BIG_BUFF=29, | |
12712 | KERN_ACCT=30, | |
12713 | KERN_PPC_L2CR=31, | |
12714 | ||
12715 | KERN_RTSIGNR=32, | |
12716 | KERN_RTSIGMAX=33, | |
12717 | ||
12718 | KERN_SHMMAX=34, | |
12719 | KERN_MSGMAX=35, | |
12720 | KERN_MSGMNB=36, | |
12721 | KERN_MSGPOOL=37, | |
12722 | KERN_SYSRQ=38, | |
12723 | KERN_MAX_THREADS=39, | |
12724 | KERN_RANDOM=40, | |
12725 | KERN_SHMALL=41, | |
12726 | KERN_MSGMNI=42, | |
12727 | KERN_SEM=43, | |
12728 | KERN_SPARC_STOP_A=44, | |
12729 | KERN_SHMMNI=45, | |
12730 | KERN_OVERFLOWUID=46, | |
12731 | KERN_OVERFLOWGID=47, | |
12732 | KERN_SHMPATH=48, | |
12733 | KERN_HOTPLUG=49, | |
12734 | KERN_IEEE_EMULATION_WARNINGS=50, | |
12735 | KERN_S390_USER_DEBUG_LOGGING=51, | |
12736 | KERN_CORE_USES_PID=52, | |
12737 | KERN_TAINTED=53, | |
12738 | KERN_CADPID=54, | |
12739 | KERN_PIDMAX=55, | |
12740 | KERN_CORE_PATTERN=56, | |
12741 | KERN_PANIC_ON_OOPS=57, | |
12742 | KERN_HPPA_PWRSW=58, | |
12743 | KERN_HPPA_UNALIGNED=59, | |
12744 | KERN_PRINTK_RATELIMIT=60, | |
12745 | KERN_PRINTK_RATELIMIT_BURST=61, | |
12746 | KERN_PTY=62, | |
12747 | KERN_NGROUPS_MAX=63, | |
12748 | KERN_SPARC_SCONS_PWROFF=64, | |
12749 | KERN_HZ_TIMER=65, | |
12750 | KERN_UNKNOWN_NMI_PANIC=66, | |
12751 | KERN_BOOTLOADER_TYPE=67, | |
12752 | KERN_RANDOMIZE=68, | |
12753 | KERN_SETUID_DUMPABLE=69, | |
12754 | KERN_SPIN_RETRY=70, | |
12755 | KERN_ACPI_VIDEO_FLAGS=71, | |
12756 | KERN_IA64_UNALIGNED=72, | |
12757 | KERN_COMPAT_LOG=73, | |
12758 | KERN_MAX_LOCK_DEPTH=74, | |
12759 | KERN_NMI_WATCHDOG=75, | |
12760 | KERN_PANIC_ON_NMI=76, | |
12761 | }; | |
12762 | ||
12763 | ||
12764 | ||
12765 | ||
12766 | enum | |
12767 | { | |
12768 | VM_UNUSED1=1, | |
12769 | VM_UNUSED2=2, | |
12770 | VM_UNUSED3=3, | |
12771 | VM_UNUSED4=4, | |
12772 | VM_OVERCOMMIT_MEMORY=5, | |
12773 | VM_UNUSED5=6, | |
12774 | VM_UNUSED7=7, | |
12775 | VM_UNUSED8=8, | |
12776 | VM_UNUSED9=9, | |
12777 | VM_PAGE_CLUSTER=10, | |
12778 | VM_DIRTY_BACKGROUND=11, | |
12779 | VM_DIRTY_RATIO=12, | |
12780 | VM_DIRTY_WB_CS=13, | |
12781 | VM_DIRTY_EXPIRE_CS=14, | |
12782 | VM_NR_PDFLUSH_THREADS=15, | |
12783 | VM_OVERCOMMIT_RATIO=16, | |
12784 | VM_PAGEBUF=17, | |
12785 | VM_HUGETLB_PAGES=18, | |
12786 | VM_SWAPPINESS=19, | |
12787 | VM_LOWMEM_RESERVE_RATIO=20, | |
12788 | VM_MIN_FREE_KBYTES=21, | |
12789 | VM_MAX_MAP_COUNT=22, | |
12790 | VM_LAPTOP_MODE=23, | |
12791 | VM_BLOCK_DUMP=24, | |
12792 | VM_HUGETLB_GROUP=25, | |
12793 | VM_VFS_CACHE_PRESSURE=26, | |
12794 | VM_LEGACY_VA_LAYOUT=27, | |
12795 | VM_SWAP_TOKEN_TIMEOUT=28, | |
12796 | VM_DROP_PAGECACHE=29, | |
12797 | VM_PERCPU_PAGELIST_FRACTION=30, | |
12798 | VM_ZONE_RECLAIM_MODE=31, | |
12799 | VM_MIN_UNMAPPED=32, | |
12800 | VM_PANIC_ON_OOM=33, | |
12801 | VM_VDSO_ENABLED=34, | |
12802 | VM_MIN_SLAB=35, | |
12803 | }; | |
12804 | ||
12805 | ||
12806 | ||
12807 | enum | |
12808 | { | |
12809 | NET_CORE=1, | |
12810 | NET_ETHER=2, | |
12811 | NET_802=3, | |
12812 | NET_UNIX=4, | |
12813 | NET_IPV4=5, | |
12814 | NET_IPX=6, | |
12815 | NET_ATALK=7, | |
12816 | NET_NETROM=8, | |
12817 | NET_AX25=9, | |
12818 | NET_BRIDGE=10, | |
12819 | NET_ROSE=11, | |
12820 | NET_IPV6=12, | |
12821 | NET_X25=13, | |
12822 | NET_TR=14, | |
12823 | NET_DECNET=15, | |
12824 | NET_ECONET=16, | |
12825 | NET_SCTP=17, | |
12826 | NET_LLC=18, | |
12827 | NET_NETFILTER=19, | |
12828 | NET_DCCP=20, | |
12829 | }; | |
12830 | ||
12831 | ||
12832 | enum | |
12833 | { | |
12834 | RANDOM_POOLSIZE=1, | |
12835 | RANDOM_ENTROPY_COUNT=2, | |
12836 | RANDOM_READ_THRESH=3, | |
12837 | RANDOM_WRITE_THRESH=4, | |
12838 | RANDOM_BOOT_ID=5, | |
12839 | RANDOM_UUID=6 | |
12840 | }; | |
12841 | ||
12842 | ||
12843 | enum | |
12844 | { | |
12845 | PTY_MAX=1, | |
12846 | PTY_NR=2 | |
12847 | }; | |
12848 | ||
12849 | ||
12850 | enum | |
12851 | { | |
12852 | BUS_ISA_MEM_BASE=1, | |
12853 | BUS_ISA_PORT_BASE=2, | |
12854 | BUS_ISA_PORT_SHIFT=3 | |
12855 | }; | |
12856 | ||
12857 | ||
12858 | enum | |
12859 | { | |
12860 | NET_CORE_WMEM_MAX=1, | |
12861 | NET_CORE_RMEM_MAX=2, | |
12862 | NET_CORE_WMEM_DEFAULT=3, | |
12863 | NET_CORE_RMEM_DEFAULT=4, | |
12864 | ||
12865 | NET_CORE_MAX_BACKLOG=6, | |
12866 | NET_CORE_FASTROUTE=7, | |
12867 | NET_CORE_MSG_COST=8, | |
12868 | NET_CORE_MSG_BURST=9, | |
12869 | NET_CORE_OPTMEM_MAX=10, | |
12870 | NET_CORE_HOT_LIST_LENGTH=11, | |
12871 | NET_CORE_DIVERT_VERSION=12, | |
12872 | NET_CORE_NO_CONG_THRESH=13, | |
12873 | NET_CORE_NO_CONG=14, | |
12874 | NET_CORE_LO_CONG=15, | |
12875 | NET_CORE_MOD_CONG=16, | |
12876 | NET_CORE_DEV_WEIGHT=17, | |
12877 | NET_CORE_SOMAXCONN=18, | |
12878 | NET_CORE_BUDGET=19, | |
12879 | NET_CORE_AEVENT_ETIME=20, | |
12880 | NET_CORE_AEVENT_RSEQTH=21, | |
12881 | }; | |
12882 | ||
12883 | ||
12884 | ||
12885 | ||
12886 | ||
12887 | ||
12888 | ||
12889 | enum | |
12890 | { | |
12891 | NET_UNIX_DESTROY_DELAY=1, | |
12892 | NET_UNIX_DELETE_DELAY=2, | |
12893 | NET_UNIX_MAX_DGRAM_QLEN=3, | |
12894 | }; | |
12895 | ||
12896 | ||
12897 | enum | |
12898 | { | |
12899 | NET_NF_CONNTRACK_MAX=1, | |
12900 | NET_NF_CONNTRACK_TCP_TIMEOUT_SYN_SENT=2, | |
12901 | NET_NF_CONNTRACK_TCP_TIMEOUT_SYN_RECV=3, | |
12902 | NET_NF_CONNTRACK_TCP_TIMEOUT_ESTABLISHED=4, | |
12903 | NET_NF_CONNTRACK_TCP_TIMEOUT_FIN_WAIT=5, | |
12904 | NET_NF_CONNTRACK_TCP_TIMEOUT_CLOSE_WAIT=6, | |
12905 | NET_NF_CONNTRACK_TCP_TIMEOUT_LAST_ACK=7, | |
12906 | NET_NF_CONNTRACK_TCP_TIMEOUT_TIME_WAIT=8, | |
12907 | NET_NF_CONNTRACK_TCP_TIMEOUT_CLOSE=9, | |
12908 | NET_NF_CONNTRACK_UDP_TIMEOUT=10, | |
12909 | NET_NF_CONNTRACK_UDP_TIMEOUT_STREAM=11, | |
12910 | NET_NF_CONNTRACK_ICMP_TIMEOUT=12, | |
12911 | NET_NF_CONNTRACK_GENERIC_TIMEOUT=13, | |
12912 | NET_NF_CONNTRACK_BUCKETS=14, | |
12913 | NET_NF_CONNTRACK_LOG_INVALID=15, | |
12914 | NET_NF_CONNTRACK_TCP_TIMEOUT_MAX_RETRANS=16, | |
12915 | NET_NF_CONNTRACK_TCP_LOOSE=17, | |
12916 | NET_NF_CONNTRACK_TCP_BE_LIBERAL=18, | |
12917 | NET_NF_CONNTRACK_TCP_MAX_RETRANS=19, | |
12918 | NET_NF_CONNTRACK_SCTP_TIMEOUT_CLOSED=20, | |
12919 | NET_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_WAIT=21, | |
12920 | NET_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_ECHOED=22, | |
12921 | NET_NF_CONNTRACK_SCTP_TIMEOUT_ESTABLISHED=23, | |
12922 | NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_SENT=24, | |
12923 | NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_RECD=25, | |
12924 | NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_ACK_SENT=26, | |
12925 | NET_NF_CONNTRACK_COUNT=27, | |
12926 | NET_NF_CONNTRACK_ICMPV6_TIMEOUT=28, | |
12927 | NET_NF_CONNTRACK_FRAG6_TIMEOUT=29, | |
12928 | NET_NF_CONNTRACK_FRAG6_LOW_THRESH=30, | |
12929 | NET_NF_CONNTRACK_FRAG6_HIGH_THRESH=31, | |
12930 | NET_NF_CONNTRACK_CHECKSUM=32, | |
12931 | }; | |
12932 | ||
12933 | ||
12934 | enum | |
12935 | { | |
12936 | ||
12937 | NET_IPV4_FORWARD=8, | |
12938 | NET_IPV4_DYNADDR=9, | |
12939 | ||
12940 | NET_IPV4_CONF=16, | |
12941 | NET_IPV4_NEIGH=17, | |
12942 | NET_IPV4_ROUTE=18, | |
12943 | NET_IPV4_FIB_HASH=19, | |
12944 | NET_IPV4_NETFILTER=20, | |
12945 | ||
12946 | NET_IPV4_TCP_TIMESTAMPS=33, | |
12947 | NET_IPV4_TCP_WINDOW_SCALING=34, | |
12948 | NET_IPV4_TCP_SACK=35, | |
12949 | NET_IPV4_TCP_RETRANS_COLLAPSE=36, | |
12950 | NET_IPV4_DEFAULT_TTL=37, | |
12951 | NET_IPV4_AUTOCONFIG=38, | |
12952 | NET_IPV4_NO_PMTU_DISC=39, | |
12953 | NET_IPV4_TCP_SYN_RETRIES=40, | |
12954 | NET_IPV4_IPFRAG_HIGH_THRESH=41, | |
12955 | NET_IPV4_IPFRAG_LOW_THRESH=42, | |
12956 | NET_IPV4_IPFRAG_TIME=43, | |
12957 | NET_IPV4_TCP_MAX_KA_PROBES=44, | |
12958 | NET_IPV4_TCP_KEEPALIVE_TIME=45, | |
12959 | NET_IPV4_TCP_KEEPALIVE_PROBES=46, | |
12960 | NET_IPV4_TCP_RETRIES1=47, | |
12961 | NET_IPV4_TCP_RETRIES2=48, | |
12962 | NET_IPV4_TCP_FIN_TIMEOUT=49, | |
12963 | NET_IPV4_IP_MASQ_DEBUG=50, | |
12964 | NET_TCP_SYNCOOKIES=51, | |
12965 | NET_TCP_STDURG=52, | |
12966 | NET_TCP_RFC1337=53, | |
12967 | NET_TCP_SYN_TAILDROP=54, | |
12968 | NET_TCP_MAX_SYN_BACKLOG=55, | |
12969 | NET_IPV4_LOCAL_PORT_RANGE=56, | |
12970 | NET_IPV4_ICMP_ECHO_IGNORE_ALL=57, | |
12971 | NET_IPV4_ICMP_ECHO_IGNORE_BROADCASTS=58, | |
12972 | NET_IPV4_ICMP_SOURCEQUENCH_RATE=59, | |
12973 | NET_IPV4_ICMP_DESTUNREACH_RATE=60, | |
12974 | NET_IPV4_ICMP_TIMEEXCEED_RATE=61, | |
12975 | NET_IPV4_ICMP_PARAMPROB_RATE=62, | |
12976 | NET_IPV4_ICMP_ECHOREPLY_RATE=63, | |
12977 | NET_IPV4_ICMP_IGNORE_BOGUS_ERROR_RESPONSES=64, | |
12978 | NET_IPV4_IGMP_MAX_MEMBERSHIPS=65, | |
12979 | NET_TCP_TW_RECYCLE=66, | |
12980 | NET_IPV4_ALWAYS_DEFRAG=67, | |
12981 | NET_IPV4_TCP_KEEPALIVE_INTVL=68, | |
12982 | NET_IPV4_INET_PEER_THRESHOLD=69, | |
12983 | NET_IPV4_INET_PEER_MINTTL=70, | |
12984 | NET_IPV4_INET_PEER_MAXTTL=71, | |
12985 | NET_IPV4_INET_PEER_GC_MINTIME=72, | |
12986 | NET_IPV4_INET_PEER_GC_MAXTIME=73, | |
12987 | NET_TCP_ORPHAN_RETRIES=74, | |
12988 | NET_TCP_ABORT_ON_OVERFLOW=75, | |
12989 | NET_TCP_SYNACK_RETRIES=76, | |
12990 | NET_TCP_MAX_ORPHANS=77, | |
12991 | NET_TCP_MAX_TW_BUCKETS=78, | |
12992 | NET_TCP_FACK=79, | |
12993 | NET_TCP_REORDERING=80, | |
12994 | NET_TCP_ECN=81, | |
12995 | NET_TCP_DSACK=82, | |
12996 | NET_TCP_MEM=83, | |
12997 | NET_TCP_WMEM=84, | |
12998 | NET_TCP_RMEM=85, | |
12999 | NET_TCP_APP_WIN=86, | |
13000 | NET_TCP_ADV_WIN_SCALE=87, | |
13001 | NET_IPV4_NONLOCAL_BIND=88, | |
13002 | NET_IPV4_ICMP_RATELIMIT=89, | |
13003 | NET_IPV4_ICMP_RATEMASK=90, | |
13004 | NET_TCP_TW_REUSE=91, | |
13005 | NET_TCP_FRTO=92, | |
13006 | NET_TCP_LOW_LATENCY=93, | |
13007 | NET_IPV4_IPFRAG_SECRET_INTERVAL=94, | |
13008 | NET_IPV4_IGMP_MAX_MSF=96, | |
13009 | NET_TCP_NO_METRICS_SAVE=97, | |
13010 | NET_TCP_DEFAULT_WIN_SCALE=105, | |
13011 | NET_TCP_MODERATE_RCVBUF=106, | |
13012 | NET_TCP_TSO_WIN_DIVISOR=107, | |
13013 | NET_TCP_BIC_BETA=108, | |
13014 | NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR=109, | |
13015 | NET_TCP_CONG_CONTROL=110, | |
13016 | NET_TCP_ABC=111, | |
13017 | NET_IPV4_IPFRAG_MAX_DIST=112, | |
13018 | NET_TCP_MTU_PROBING=113, | |
13019 | NET_TCP_BASE_MSS=114, | |
13020 | NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS=115, | |
13021 | NET_TCP_DMA_COPYBREAK=116, | |
13022 | NET_TCP_SLOW_START_AFTER_IDLE=117, | |
13023 | NET_CIPSOV4_CACHE_ENABLE=118, | |
13024 | NET_CIPSOV4_CACHE_BUCKET_SIZE=119, | |
13025 | NET_CIPSOV4_RBM_OPTFMT=120, | |
13026 | NET_CIPSOV4_RBM_STRICTVALID=121, | |
13027 | }; | |
13028 | ||
13029 | enum { | |
13030 | NET_IPV4_ROUTE_FLUSH=1, | |
13031 | NET_IPV4_ROUTE_MIN_DELAY=2, | |
13032 | NET_IPV4_ROUTE_MAX_DELAY=3, | |
13033 | NET_IPV4_ROUTE_GC_THRESH=4, | |
13034 | NET_IPV4_ROUTE_MAX_SIZE=5, | |
13035 | NET_IPV4_ROUTE_GC_MIN_INTERVAL=6, | |
13036 | NET_IPV4_ROUTE_GC_TIMEOUT=7, | |
13037 | NET_IPV4_ROUTE_GC_INTERVAL=8, | |
13038 | NET_IPV4_ROUTE_REDIRECT_LOAD=9, | |
13039 | NET_IPV4_ROUTE_REDIRECT_NUMBER=10, | |
13040 | NET_IPV4_ROUTE_REDIRECT_SILENCE=11, | |
13041 | NET_IPV4_ROUTE_ERROR_COST=12, | |
13042 | NET_IPV4_ROUTE_ERROR_BURST=13, | |
13043 | NET_IPV4_ROUTE_GC_ELASTICITY=14, | |
13044 | NET_IPV4_ROUTE_MTU_EXPIRES=15, | |
13045 | NET_IPV4_ROUTE_MIN_PMTU=16, | |
13046 | NET_IPV4_ROUTE_MIN_ADVMSS=17, | |
13047 | NET_IPV4_ROUTE_SECRET_INTERVAL=18, | |
13048 | NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS=19, | |
13049 | }; | |
13050 | ||
13051 | enum | |
13052 | { | |
13053 | NET_PROTO_CONF_ALL=-2, | |
13054 | NET_PROTO_CONF_DEFAULT=-3 | |
13055 | ||
13056 | ||
13057 | }; | |
13058 | ||
13059 | enum | |
13060 | { | |
13061 | NET_IPV4_CONF_FORWARDING=1, | |
13062 | NET_IPV4_CONF_MC_FORWARDING=2, | |
13063 | NET_IPV4_CONF_PROXY_ARP=3, | |
13064 | NET_IPV4_CONF_ACCEPT_REDIRECTS=4, | |
13065 | NET_IPV4_CONF_SECURE_REDIRECTS=5, | |
13066 | NET_IPV4_CONF_SEND_REDIRECTS=6, | |
13067 | NET_IPV4_CONF_SHARED_MEDIA=7, | |
13068 | NET_IPV4_CONF_RP_FILTER=8, | |
13069 | NET_IPV4_CONF_ACCEPT_SOURCE_ROUTE=9, | |
13070 | NET_IPV4_CONF_BOOTP_RELAY=10, | |
13071 | NET_IPV4_CONF_LOG_MARTIANS=11, | |
13072 | NET_IPV4_CONF_TAG=12, | |
13073 | NET_IPV4_CONF_ARPFILTER=13, | |
13074 | NET_IPV4_CONF_MEDIUM_ID=14, | |
13075 | NET_IPV4_CONF_NOXFRM=15, | |
13076 | NET_IPV4_CONF_NOPOLICY=16, | |
13077 | NET_IPV4_CONF_FORCE_IGMP_VERSION=17, | |
13078 | NET_IPV4_CONF_ARP_ANNOUNCE=18, | |
13079 | NET_IPV4_CONF_ARP_IGNORE=19, | |
13080 | NET_IPV4_CONF_PROMOTE_SECONDARIES=20, | |
13081 | NET_IPV4_CONF_ARP_ACCEPT=21, | |
13082 | __NET_IPV4_CONF_MAX | |
13083 | }; | |
13084 | ||
13085 | ||
13086 | enum | |
13087 | { | |
13088 | NET_IPV4_NF_CONNTRACK_MAX=1, | |
13089 | NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_SYN_SENT=2, | |
13090 | NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_SYN_RECV=3, | |
13091 | NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_ESTABLISHED=4, | |
13092 | NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_FIN_WAIT=5, | |
13093 | NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_CLOSE_WAIT=6, | |
13094 | NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_LAST_ACK=7, | |
13095 | NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_TIME_WAIT=8, | |
13096 | NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_CLOSE=9, | |
13097 | NET_IPV4_NF_CONNTRACK_UDP_TIMEOUT=10, | |
13098 | NET_IPV4_NF_CONNTRACK_UDP_TIMEOUT_STREAM=11, | |
13099 | NET_IPV4_NF_CONNTRACK_ICMP_TIMEOUT=12, | |
13100 | NET_IPV4_NF_CONNTRACK_GENERIC_TIMEOUT=13, | |
13101 | NET_IPV4_NF_CONNTRACK_BUCKETS=14, | |
13102 | NET_IPV4_NF_CONNTRACK_LOG_INVALID=15, | |
13103 | NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_MAX_RETRANS=16, | |
13104 | NET_IPV4_NF_CONNTRACK_TCP_LOOSE=17, | |
13105 | NET_IPV4_NF_CONNTRACK_TCP_BE_LIBERAL=18, | |
13106 | NET_IPV4_NF_CONNTRACK_TCP_MAX_RETRANS=19, | |
13107 | NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_CLOSED=20, | |
13108 | NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_WAIT=21, | |
13109 | NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_ECHOED=22, | |
13110 | NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_ESTABLISHED=23, | |
13111 | NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_SENT=24, | |
13112 | NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_RECD=25, | |
13113 | NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_ACK_SENT=26, | |
13114 | NET_IPV4_NF_CONNTRACK_COUNT=27, | |
13115 | NET_IPV4_NF_CONNTRACK_CHECKSUM=28, | |
13116 | }; | |
13117 | ||
13118 | ||
13119 | enum { | |
13120 | NET_IPV6_CONF=16, | |
13121 | NET_IPV6_NEIGH=17, | |
13122 | NET_IPV6_ROUTE=18, | |
13123 | NET_IPV6_ICMP=19, | |
13124 | NET_IPV6_BINDV6ONLY=20, | |
13125 | NET_IPV6_IP6FRAG_HIGH_THRESH=21, | |
13126 | NET_IPV6_IP6FRAG_LOW_THRESH=22, | |
13127 | NET_IPV6_IP6FRAG_TIME=23, | |
13128 | NET_IPV6_IP6FRAG_SECRET_INTERVAL=24, | |
13129 | NET_IPV6_MLD_MAX_MSF=25, | |
13130 | }; | |
13131 | ||
13132 | enum { | |
13133 | NET_IPV6_ROUTE_FLUSH=1, | |
13134 | NET_IPV6_ROUTE_GC_THRESH=2, | |
13135 | NET_IPV6_ROUTE_MAX_SIZE=3, | |
13136 | NET_IPV6_ROUTE_GC_MIN_INTERVAL=4, | |
13137 | NET_IPV6_ROUTE_GC_TIMEOUT=5, | |
13138 | NET_IPV6_ROUTE_GC_INTERVAL=6, | |
13139 | NET_IPV6_ROUTE_GC_ELASTICITY=7, | |
13140 | NET_IPV6_ROUTE_MTU_EXPIRES=8, | |
13141 | NET_IPV6_ROUTE_MIN_ADVMSS=9, | |
13142 | NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS=10 | |
13143 | }; | |
13144 | ||
13145 | enum { | |
13146 | NET_IPV6_FORWARDING=1, | |
13147 | NET_IPV6_HOP_LIMIT=2, | |
13148 | NET_IPV6_MTU=3, | |
13149 | NET_IPV6_ACCEPT_RA=4, | |
13150 | NET_IPV6_ACCEPT_REDIRECTS=5, | |
13151 | NET_IPV6_AUTOCONF=6, | |
13152 | NET_IPV6_DAD_TRANSMITS=7, | |
13153 | NET_IPV6_RTR_SOLICITS=8, | |
13154 | NET_IPV6_RTR_SOLICIT_INTERVAL=9, | |
13155 | NET_IPV6_RTR_SOLICIT_DELAY=10, | |
13156 | NET_IPV6_USE_TEMPADDR=11, | |
13157 | NET_IPV6_TEMP_VALID_LFT=12, | |
13158 | NET_IPV6_TEMP_PREFERED_LFT=13, | |
13159 | NET_IPV6_REGEN_MAX_RETRY=14, | |
13160 | NET_IPV6_MAX_DESYNC_FACTOR=15, | |
13161 | NET_IPV6_MAX_ADDRESSES=16, | |
13162 | NET_IPV6_FORCE_MLD_VERSION=17, | |
13163 | NET_IPV6_ACCEPT_RA_DEFRTR=18, | |
13164 | NET_IPV6_ACCEPT_RA_PINFO=19, | |
13165 | NET_IPV6_ACCEPT_RA_RTR_PREF=20, | |
13166 | NET_IPV6_RTR_PROBE_INTERVAL=21, | |
13167 | NET_IPV6_ACCEPT_RA_RT_INFO_MAX_PLEN=22, | |
13168 | NET_IPV6_PROXY_NDP=23, | |
13169 | __NET_IPV6_MAX | |
13170 | }; | |
13171 | ||
13172 | ||
13173 | enum { | |
13174 | NET_IPV6_ICMP_RATELIMIT=1 | |
13175 | }; | |
13176 | ||
13177 | ||
13178 | enum { | |
13179 | NET_NEIGH_MCAST_SOLICIT=1, | |
13180 | NET_NEIGH_UCAST_SOLICIT=2, | |
13181 | NET_NEIGH_APP_SOLICIT=3, | |
13182 | NET_NEIGH_RETRANS_TIME=4, | |
13183 | NET_NEIGH_REACHABLE_TIME=5, | |
13184 | NET_NEIGH_DELAY_PROBE_TIME=6, | |
13185 | NET_NEIGH_GC_STALE_TIME=7, | |
13186 | NET_NEIGH_UNRES_QLEN=8, | |
13187 | NET_NEIGH_PROXY_QLEN=9, | |
13188 | NET_NEIGH_ANYCAST_DELAY=10, | |
13189 | NET_NEIGH_PROXY_DELAY=11, | |
13190 | NET_NEIGH_LOCKTIME=12, | |
13191 | NET_NEIGH_GC_INTERVAL=13, | |
13192 | NET_NEIGH_GC_THRESH1=14, | |
13193 | NET_NEIGH_GC_THRESH2=15, | |
13194 | NET_NEIGH_GC_THRESH3=16, | |
13195 | NET_NEIGH_RETRANS_TIME_MS=17, | |
13196 | NET_NEIGH_REACHABLE_TIME_MS=18, | |
13197 | __NET_NEIGH_MAX | |
13198 | }; | |
13199 | ||
13200 | ||
13201 | enum { | |
13202 | NET_DCCP_DEFAULT=1, | |
13203 | }; | |
13204 | ||
13205 | ||
13206 | enum { | |
13207 | NET_DCCP_DEFAULT_SEQ_WINDOW = 1, | |
13208 | NET_DCCP_DEFAULT_RX_CCID = 2, | |
13209 | NET_DCCP_DEFAULT_TX_CCID = 3, | |
13210 | NET_DCCP_DEFAULT_ACK_RATIO = 4, | |
13211 | NET_DCCP_DEFAULT_SEND_ACKVEC = 5, | |
13212 | NET_DCCP_DEFAULT_SEND_NDP = 6, | |
13213 | }; | |
13214 | ||
13215 | ||
13216 | enum { | |
13217 | NET_IPX_PPROP_BROADCASTING=1, | |
13218 | NET_IPX_FORWARDING=2 | |
13219 | }; | |
13220 | ||
13221 | ||
13222 | enum { | |
13223 | NET_LLC2=1, | |
13224 | NET_LLC_STATION=2, | |
13225 | }; | |
13226 | ||
13227 | ||
13228 | enum { | |
13229 | NET_LLC2_TIMEOUT=1, | |
13230 | }; | |
13231 | ||
13232 | ||
13233 | enum { | |
13234 | NET_LLC_STATION_ACK_TIMEOUT=1, | |
13235 | }; | |
13236 | ||
13237 | ||
13238 | enum { | |
13239 | NET_LLC2_ACK_TIMEOUT=1, | |
13240 | NET_LLC2_P_TIMEOUT=2, | |
13241 | NET_LLC2_REJ_TIMEOUT=3, | |
13242 | NET_LLC2_BUSY_TIMEOUT=4, | |
13243 | }; | |
13244 | ||
13245 | ||
13246 | enum { | |
13247 | NET_ATALK_AARP_EXPIRY_TIME=1, | |
13248 | NET_ATALK_AARP_TICK_TIME=2, | |
13249 | NET_ATALK_AARP_RETRANSMIT_LIMIT=3, | |
13250 | NET_ATALK_AARP_RESOLVE_TIME=4 | |
13251 | }; | |
13252 | ||
13253 | ||
13254 | ||
13255 | enum { | |
13256 | NET_NETROM_DEFAULT_PATH_QUALITY=1, | |
13257 | NET_NETROM_OBSOLESCENCE_COUNT_INITIALISER=2, | |
13258 | NET_NETROM_NETWORK_TTL_INITIALISER=3, | |
13259 | NET_NETROM_TRANSPORT_TIMEOUT=4, | |
13260 | NET_NETROM_TRANSPORT_MAXIMUM_TRIES=5, | |
13261 | NET_NETROM_TRANSPORT_ACKNOWLEDGE_DELAY=6, | |
13262 | NET_NETROM_TRANSPORT_BUSY_DELAY=7, | |
13263 | NET_NETROM_TRANSPORT_REQUESTED_WINDOW_SIZE=8, | |
13264 | NET_NETROM_TRANSPORT_NO_ACTIVITY_TIMEOUT=9, | |
13265 | NET_NETROM_ROUTING_CONTROL=10, | |
13266 | NET_NETROM_LINK_FAILS_COUNT=11, | |
13267 | NET_NETROM_RESET=12 | |
13268 | }; | |
13269 | ||
13270 | ||
13271 | enum { | |
13272 | NET_AX25_IP_DEFAULT_MODE=1, | |
13273 | NET_AX25_DEFAULT_MODE=2, | |
13274 | NET_AX25_BACKOFF_TYPE=3, | |
13275 | NET_AX25_CONNECT_MODE=4, | |
13276 | NET_AX25_STANDARD_WINDOW=5, | |
13277 | NET_AX25_EXTENDED_WINDOW=6, | |
13278 | NET_AX25_T1_TIMEOUT=7, | |
13279 | NET_AX25_T2_TIMEOUT=8, | |
13280 | NET_AX25_T3_TIMEOUT=9, | |
13281 | NET_AX25_IDLE_TIMEOUT=10, | |
13282 | NET_AX25_N2=11, | |
13283 | NET_AX25_PACLEN=12, | |
13284 | NET_AX25_PROTOCOL=13, | |
13285 | NET_AX25_DAMA_SLAVE_TIMEOUT=14 | |
13286 | }; | |
13287 | ||
13288 | ||
13289 | enum { | |
13290 | NET_ROSE_RESTART_REQUEST_TIMEOUT=1, | |
13291 | NET_ROSE_CALL_REQUEST_TIMEOUT=2, | |
13292 | NET_ROSE_RESET_REQUEST_TIMEOUT=3, | |
13293 | NET_ROSE_CLEAR_REQUEST_TIMEOUT=4, | |
13294 | NET_ROSE_ACK_HOLD_BACK_TIMEOUT=5, | |
13295 | NET_ROSE_ROUTING_CONTROL=6, | |
13296 | NET_ROSE_LINK_FAIL_TIMEOUT=7, | |
13297 | NET_ROSE_MAX_VCS=8, | |
13298 | NET_ROSE_WINDOW_SIZE=9, | |
13299 | NET_ROSE_NO_ACTIVITY_TIMEOUT=10 | |
13300 | }; | |
13301 | ||
13302 | ||
13303 | enum { | |
13304 | NET_X25_RESTART_REQUEST_TIMEOUT=1, | |
13305 | NET_X25_CALL_REQUEST_TIMEOUT=2, | |
13306 | NET_X25_RESET_REQUEST_TIMEOUT=3, | |
13307 | NET_X25_CLEAR_REQUEST_TIMEOUT=4, | |
13308 | NET_X25_ACK_HOLD_BACK_TIMEOUT=5 | |
13309 | }; | |
13310 | ||
13311 | ||
13312 | enum | |
13313 | { | |
13314 | NET_TR_RIF_TIMEOUT=1 | |
13315 | }; | |
13316 | ||
13317 | ||
13318 | enum { | |
13319 | NET_DECNET_NODE_TYPE = 1, | |
13320 | NET_DECNET_NODE_ADDRESS = 2, | |
13321 | NET_DECNET_NODE_NAME = 3, | |
13322 | NET_DECNET_DEFAULT_DEVICE = 4, | |
13323 | NET_DECNET_TIME_WAIT = 5, | |
13324 | NET_DECNET_DN_COUNT = 6, | |
13325 | NET_DECNET_DI_COUNT = 7, | |
13326 | NET_DECNET_DR_COUNT = 8, | |
13327 | NET_DECNET_DST_GC_INTERVAL = 9, | |
13328 | NET_DECNET_CONF = 10, | |
13329 | NET_DECNET_NO_FC_MAX_CWND = 11, | |
13330 | NET_DECNET_MEM = 12, | |
13331 | NET_DECNET_RMEM = 13, | |
13332 | NET_DECNET_WMEM = 14, | |
13333 | NET_DECNET_DEBUG_LEVEL = 255 | |
13334 | }; | |
13335 | ||
13336 | ||
13337 | enum { | |
13338 | NET_DECNET_CONF_LOOPBACK = -2, | |
13339 | NET_DECNET_CONF_DDCMP = -3, | |
13340 | NET_DECNET_CONF_PPP = -4, | |
13341 | NET_DECNET_CONF_X25 = -5, | |
13342 | NET_DECNET_CONF_GRE = -6, | |
13343 | NET_DECNET_CONF_ETHER = -7 | |
13344 | ||
13345 | ||
13346 | }; | |
13347 | ||
13348 | ||
13349 | enum { | |
13350 | NET_DECNET_CONF_DEV_PRIORITY = 1, | |
13351 | NET_DECNET_CONF_DEV_T1 = 2, | |
13352 | NET_DECNET_CONF_DEV_T2 = 3, | |
13353 | NET_DECNET_CONF_DEV_T3 = 4, | |
13354 | NET_DECNET_CONF_DEV_FORWARDING = 5, | |
13355 | NET_DECNET_CONF_DEV_BLKSIZE = 6, | |
13356 | NET_DECNET_CONF_DEV_STATE = 7 | |
13357 | }; | |
13358 | ||
13359 | ||
13360 | enum { | |
13361 | NET_SCTP_RTO_INITIAL = 1, | |
13362 | NET_SCTP_RTO_MIN = 2, | |
13363 | NET_SCTP_RTO_MAX = 3, | |
13364 | NET_SCTP_RTO_ALPHA = 4, | |
13365 | NET_SCTP_RTO_BETA = 5, | |
13366 | NET_SCTP_VALID_COOKIE_LIFE = 6, | |
13367 | NET_SCTP_ASSOCIATION_MAX_RETRANS = 7, | |
13368 | NET_SCTP_PATH_MAX_RETRANS = 8, | |
13369 | NET_SCTP_MAX_INIT_RETRANSMITS = 9, | |
13370 | NET_SCTP_HB_INTERVAL = 10, | |
13371 | NET_SCTP_PRESERVE_ENABLE = 11, | |
13372 | NET_SCTP_MAX_BURST = 12, | |
13373 | NET_SCTP_ADDIP_ENABLE = 13, | |
13374 | NET_SCTP_PRSCTP_ENABLE = 14, | |
13375 | NET_SCTP_SNDBUF_POLICY = 15, | |
13376 | NET_SCTP_SACK_TIMEOUT = 16, | |
13377 | NET_SCTP_RCVBUF_POLICY = 17, | |
13378 | }; | |
13379 | ||
13380 | ||
13381 | enum { | |
13382 | NET_BRIDGE_NF_CALL_ARPTABLES = 1, | |
13383 | NET_BRIDGE_NF_CALL_IPTABLES = 2, | |
13384 | NET_BRIDGE_NF_CALL_IP6TABLES = 3, | |
13385 | NET_BRIDGE_NF_FILTER_VLAN_TAGGED = 4, | |
13386 | }; | |
13387 | ||
13388 | ||
13389 | enum | |
13390 | { | |
13391 | FS_NRINODE=1, | |
13392 | FS_STATINODE=2, | |
13393 | FS_MAXINODE=3, | |
13394 | FS_NRDQUOT=4, | |
13395 | FS_MAXDQUOT=5, | |
13396 | FS_NRFILE=6, | |
13397 | FS_MAXFILE=7, | |
13398 | FS_DENTRY=8, | |
13399 | FS_NRSUPER=9, | |
13400 | FS_MAXSUPER=10, | |
13401 | FS_OVERFLOWUID=11, | |
13402 | FS_OVERFLOWGID=12, | |
13403 | FS_LEASES=13, | |
13404 | FS_DIR_NOTIFY=14, | |
13405 | FS_LEASE_TIME=15, | |
13406 | FS_DQSTATS=16, | |
13407 | FS_XFS=17, | |
13408 | FS_AIO_NR=18, | |
13409 | FS_AIO_MAX_NR=19, | |
13410 | FS_INOTIFY=20, | |
13411 | }; | |
13412 | ||
13413 | ||
13414 | enum { | |
13415 | FS_DQ_LOOKUPS = 1, | |
13416 | FS_DQ_DROPS = 2, | |
13417 | FS_DQ_READS = 3, | |
13418 | FS_DQ_WRITES = 4, | |
13419 | FS_DQ_CACHE_HITS = 5, | |
13420 | FS_DQ_ALLOCATED = 6, | |
13421 | FS_DQ_FREE = 7, | |
13422 | FS_DQ_SYNCS = 8, | |
13423 | FS_DQ_WARNINGS = 9, | |
13424 | }; | |
13425 | ||
13426 | ||
13427 | ||
13428 | ||
13429 | enum { | |
13430 | DEV_CDROM=1, | |
13431 | DEV_HWMON=2, | |
13432 | DEV_PARPORT=3, | |
13433 | DEV_RAID=4, | |
13434 | DEV_MAC_HID=5, | |
13435 | DEV_SCSI=6, | |
13436 | DEV_IPMI=7, | |
13437 | }; | |
13438 | ||
13439 | ||
13440 | enum { | |
13441 | DEV_CDROM_INFO=1, | |
13442 | DEV_CDROM_AUTOCLOSE=2, | |
13443 | DEV_CDROM_AUTOEJECT=3, | |
13444 | DEV_CDROM_DEBUG=4, | |
13445 | DEV_CDROM_LOCK=5, | |
13446 | DEV_CDROM_CHECK_MEDIA=6 | |
13447 | }; | |
13448 | ||
13449 | ||
13450 | enum { | |
13451 | DEV_PARPORT_DEFAULT=-3 | |
13452 | }; | |
13453 | ||
13454 | ||
13455 | enum { | |
13456 | DEV_RAID_SPEED_LIMIT_MIN=1, | |
13457 | DEV_RAID_SPEED_LIMIT_MAX=2 | |
13458 | }; | |
13459 | ||
13460 | ||
13461 | enum { | |
13462 | DEV_PARPORT_DEFAULT_TIMESLICE=1, | |
13463 | DEV_PARPORT_DEFAULT_SPINTIME=2 | |
13464 | }; | |
13465 | ||
13466 | ||
13467 | enum { | |
13468 | DEV_PARPORT_SPINTIME=1, | |
13469 | DEV_PARPORT_BASE_ADDR=2, | |
13470 | DEV_PARPORT_IRQ=3, | |
13471 | DEV_PARPORT_DMA=4, | |
13472 | DEV_PARPORT_MODES=5, | |
13473 | DEV_PARPORT_DEVICES=6, | |
13474 | DEV_PARPORT_AUTOPROBE=16 | |
13475 | }; | |
13476 | ||
13477 | ||
13478 | enum { | |
13479 | DEV_PARPORT_DEVICES_ACTIVE=-3, | |
13480 | }; | |
13481 | ||
13482 | ||
13483 | enum { | |
13484 | DEV_PARPORT_DEVICE_TIMESLICE=1, | |
13485 | }; | |
13486 | ||
13487 | ||
13488 | enum { | |
13489 | DEV_MAC_HID_KEYBOARD_SENDS_LINUX_KEYCODES=1, | |
13490 | DEV_MAC_HID_KEYBOARD_LOCK_KEYCODES=2, | |
13491 | DEV_MAC_HID_MOUSE_BUTTON_EMULATION=3, | |
13492 | DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE=4, | |
13493 | DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE=5, | |
13494 | DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES=6 | |
13495 | }; | |
13496 | ||
13497 | ||
13498 | enum { | |
13499 | DEV_SCSI_LOGGING_LEVEL=1, | |
13500 | }; | |
13501 | ||
13502 | ||
13503 | enum { | |
13504 | DEV_IPMI_POWEROFF_POWERCYCLE=1, | |
13505 | }; | |
13506 | ||
13507 | ||
13508 | enum | |
13509 | { | |
13510 | ABI_DEFHANDLER_COFF=1, | |
13511 | ABI_DEFHANDLER_ELF=2, | |
13512 | ABI_DEFHANDLER_LCALL7=3, | |
13513 | ABI_DEFHANDLER_LIBCSO=4, | |
13514 | ABI_TRACE=5, | |
13515 | ABI_FAKE_UTSNAME=6, | |
13516 | }; | |
13517 | ||
13518 | ||
13519 | ||
13520 | ||
13521 | extern void sysctl_init(void); | |
13522 | ||
13523 | typedef struct ctl_table ctl_table; | |
13524 | ||
13525 | typedef int ctl_handler (ctl_table *table, int *name, int nlen, | |
13526 | void *oldval, size_t *oldlenp, | |
13527 | void *newval, size_t newlen, | |
13528 | void **context); | |
13529 | ||
13530 | typedef int proc_handler (ctl_table *ctl, int write, struct file * filp, | |
13531 | void *buffer, size_t *lenp, loff_t *ppos); | |
13532 | ||
13533 | extern int proc_dostring(ctl_table *, int, struct file *, | |
13534 | void *, size_t *, loff_t *); | |
13535 | extern int proc_dointvec(ctl_table *, int, struct file *, | |
13536 | void *, size_t *, loff_t *); | |
13537 | extern int proc_dointvec_bset(ctl_table *, int, struct file *, | |
13538 | void *, size_t *, loff_t *); | |
13539 | extern int proc_dointvec_minmax(ctl_table *, int, struct file *, | |
13540 | void *, size_t *, loff_t *); | |
13541 | extern int proc_dointvec_jiffies(ctl_table *, int, struct file *, | |
13542 | void *, size_t *, loff_t *); | |
13543 | extern int proc_dointvec_userhz_jiffies(ctl_table *, int, struct file *, | |
13544 | void *, size_t *, loff_t *); | |
13545 | extern int proc_dointvec_ms_jiffies(ctl_table *, int, struct file *, | |
13546 | void *, size_t *, loff_t *); | |
13547 | extern int proc_doulongvec_minmax(ctl_table *, int, struct file *, | |
13548 | void *, size_t *, loff_t *); | |
13549 | extern int proc_doulongvec_ms_jiffies_minmax(ctl_table *table, int, | |
13550 | struct file *, void *, size_t *, loff_t *); | |
13551 | ||
13552 | extern int do_sysctl (int *name, int nlen, | |
13553 | void *oldval, size_t *oldlenp, | |
13554 | void *newval, size_t newlen); | |
13555 | ||
13556 | extern int do_sysctl_strategy (ctl_table *table, | |
13557 | int *name, int nlen, | |
13558 | void *oldval, size_t *oldlenp, | |
13559 | void *newval, size_t newlen, void ** context); | |
13560 | ||
13561 | extern ctl_handler sysctl_string; | |
13562 | extern ctl_handler sysctl_intvec; | |
13563 | extern ctl_handler sysctl_jiffies; | |
13564 | extern ctl_handler sysctl_ms_jiffies; | |
13565 | # 1010 "include/linux/sysctl.h" | |
13566 | struct ctl_table | |
13567 | { | |
13568 | int ctl_name; | |
13569 | const char *procname; | |
13570 | void *data; | |
13571 | int maxlen; | |
13572 | mode_t mode; | |
13573 | ctl_table *child; | |
13574 | proc_handler *proc_handler; | |
13575 | ctl_handler *strategy; | |
13576 | struct proc_dir_entry *de; | |
13577 | void *extra1; | |
13578 | void *extra2; | |
13579 | }; | |
13580 | ||
13581 | ||
13582 | ||
13583 | struct ctl_table_header | |
13584 | { | |
13585 | ctl_table *ctl_table; | |
13586 | struct list_head ctl_entry; | |
13587 | int used; | |
13588 | struct completion *unregistering; | |
13589 | }; | |
13590 | ||
13591 | struct ctl_table_header * register_sysctl_table(ctl_table * table, | |
13592 | int insert_at_head); | |
13593 | void unregister_sysctl_table(struct ctl_table_header * table); | |
13594 | # 317 "include/linux/net.h" 2 | |
13595 | extern ctl_table net_table[]; | |
13596 | extern int net_msg_cost; | |
13597 | extern int net_msg_burst; | |
13598 | # 29 "include/linux/skbuff.h" 2 | |
13599 | # 1 "include/linux/textsearch.h" 1 | |
13600 | # 13 "include/linux/textsearch.h" | |
13601 | struct ts_config; | |
13602 | # 25 "include/linux/textsearch.h" | |
13603 | struct ts_state | |
13604 | { | |
13605 | unsigned int offset; | |
13606 | char cb[40]; | |
13607 | }; | |
13608 | # 41 "include/linux/textsearch.h" | |
13609 | struct ts_ops | |
13610 | { | |
13611 | const char *name; | |
13612 | struct ts_config * (*init)(const void *, unsigned int, gfp_t); | |
13613 | unsigned int (*find)(struct ts_config *, | |
13614 | struct ts_state *); | |
13615 | void (*destroy)(struct ts_config *); | |
13616 | void * (*get_pattern)(struct ts_config *); | |
13617 | unsigned int (*get_pattern_len)(struct ts_config *); | |
13618 | struct module *owner; | |
13619 | struct list_head list; | |
13620 | }; | |
13621 | ||
13622 | ||
13623 | ||
13624 | ||
13625 | ||
13626 | ||
13627 | ||
13628 | struct ts_config | |
13629 | { | |
13630 | struct ts_ops *ops; | |
13631 | # 76 "include/linux/textsearch.h" | |
13632 | unsigned int (*get_next_block)(unsigned int consumed, | |
13633 | const u8 **dst, | |
13634 | struct ts_config *conf, | |
13635 | struct ts_state *state); | |
13636 | # 89 "include/linux/textsearch.h" | |
13637 | void (*finish)(struct ts_config *conf, | |
13638 | struct ts_state *state); | |
13639 | }; | |
13640 | # 105 "include/linux/textsearch.h" | |
13641 | static inline __attribute__((always_inline)) unsigned int textsearch_next(struct ts_config *conf, | |
13642 | struct ts_state *state) | |
13643 | { | |
13644 | unsigned int ret = conf->ops->find(conf, state); | |
13645 | ||
13646 | if (conf->finish) | |
13647 | conf->finish(conf, state); | |
13648 | ||
13649 | return ret; | |
13650 | } | |
13651 | # 124 "include/linux/textsearch.h" | |
13652 | static inline __attribute__((always_inline)) unsigned int textsearch_find(struct ts_config *conf, | |
13653 | struct ts_state *state) | |
13654 | { | |
13655 | state->offset = 0; | |
13656 | return textsearch_next(conf, state); | |
13657 | } | |
13658 | ||
13659 | ||
13660 | ||
13661 | ||
13662 | ||
13663 | static inline __attribute__((always_inline)) void *textsearch_get_pattern(struct ts_config *conf) | |
13664 | { | |
13665 | return conf->ops->get_pattern(conf); | |
13666 | } | |
13667 | ||
13668 | ||
13669 | ||
13670 | ||
13671 | ||
13672 | static inline __attribute__((always_inline)) unsigned int textsearch_get_pattern_len(struct ts_config *conf) | |
13673 | { | |
13674 | return conf->ops->get_pattern_len(conf); | |
13675 | } | |
13676 | ||
13677 | extern int textsearch_register(struct ts_ops *); | |
13678 | extern int textsearch_unregister(struct ts_ops *); | |
13679 | extern struct ts_config *textsearch_prepare(const char *, const void *, | |
13680 | unsigned int, gfp_t, int); | |
13681 | extern void textsearch_destroy(struct ts_config *conf); | |
13682 | extern unsigned int textsearch_find_continuous(struct ts_config *, | |
13683 | struct ts_state *, | |
13684 | const void *, unsigned int); | |
13685 | ||
13686 | ||
13687 | ||
13688 | ||
13689 | ||
13690 | static inline __attribute__((always_inline)) struct ts_config *alloc_ts_config(size_t payload, | |
13691 | gfp_t gfp_mask) | |
13692 | { | |
13693 | struct ts_config *conf; | |
13694 | ||
13695 | conf = kmalloc((((sizeof(*conf)) + 8 -1) & ~(8 -1)) + payload, gfp_mask); | |
13696 | if (conf == ((void *)0)) | |
13697 | return ERR_PTR(-12); | |
13698 | ||
13699 | memset(conf, 0, (((sizeof(*conf)) + 8 -1) & ~(8 -1)) + payload); | |
13700 | return conf; | |
13701 | } | |
13702 | ||
13703 | static inline __attribute__((always_inline)) void *ts_config_priv(struct ts_config *conf) | |
13704 | { | |
13705 | return ((u8 *) conf + (((sizeof(struct ts_config)) + 8 -1) & ~(8 -1))); | |
13706 | } | |
13707 | # 30 "include/linux/skbuff.h" 2 | |
13708 | # 1 "include/net/checksum.h" 1 | |
13709 | # 26 "include/net/checksum.h" | |
13710 | # 1 "include/asm/checksum.h" 1 | |
13711 | # 18 "include/asm/checksum.h" | |
13712 | unsigned int csum_partial(const unsigned char *buff, int len, unsigned int sum); | |
13713 | # 28 "include/asm/checksum.h" | |
13714 | unsigned int csum_partial_copy(const unsigned char *src, unsigned char *dst, | |
13715 | int len, int sum); | |
13716 | # 38 "include/asm/checksum.h" | |
13717 | extern unsigned int csum_partial_copy_from_user(const unsigned char *src, | |
13718 | unsigned char *dst, int len, | |
13719 | int sum, int *csum_err); | |
13720 | ||
13721 | ||
13722 | ||
13723 | ||
13724 | unsigned short ip_fast_csum(unsigned char *iph, unsigned int ihl); | |
13725 | ||
13726 | ||
13727 | ||
13728 | ||
13729 | ||
13730 | static inline __attribute__((always_inline)) unsigned int csum_fold(unsigned int sum) | |
13731 | { | |
13732 | while (sum >> 16) | |
13733 | sum = (sum & 0xffff) + (sum >> 16); | |
13734 | return ((~(sum << 16)) >> 16); | |
13735 | } | |
13736 | ||
13737 | ||
13738 | ||
13739 | ||
13740 | ||
13741 | ||
13742 | static inline __attribute__((always_inline)) unsigned int | |
13743 | csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr, unsigned short len, | |
13744 | unsigned short proto, unsigned int sum) | |
13745 | { | |
13746 | ||
13747 | __asm__ ("%0 = %0 + %1;\n\t" | |
13748 | "CC = AC0;\n\t" | |
13749 | "if !CC jump 4;\n\t" | |
13750 | "%0 = %0 + %4;\n\t" | |
13751 | "%0 = %0 + %2;\n\t" | |
13752 | "CC = AC0;\n\t" | |
13753 | "if !CC jump 4;\n\t" | |
13754 | "%0 = %0 + %4;\n\t" | |
13755 | "%0 = %0 + %3;\n\t" | |
13756 | "CC = AC0;\n\t" | |
13757 | "if !CC jump 4;\n\t" | |
13758 | "%0 = %0 + %4;\n\t" | |
13759 | "NOP;\n\t" | |
13760 | : "=d" (sum) | |
13761 | : "d" (daddr), "d" (saddr), "d" ((ntohs(len)<<16)+proto*256), "d" (1), "0"(sum)); | |
13762 | ||
13763 | return (sum); | |
13764 | } | |
13765 | ||
13766 | static inline __attribute__((always_inline)) unsigned short int | |
13767 | csum_tcpudp_magic(unsigned long saddr, unsigned long daddr, unsigned short len, | |
13768 | unsigned short proto, unsigned int sum) | |
13769 | { | |
13770 | return csum_fold(csum_tcpudp_nofold(saddr, daddr, len, proto, sum)); | |
13771 | } | |
13772 | ||
13773 | ||
13774 | ||
13775 | ||
13776 | ||
13777 | ||
13778 | extern unsigned short ip_compute_csum(const unsigned char *buff, int len); | |
13779 | # 27 "include/net/checksum.h" 2 | |
13780 | ||
13781 | ||
13782 | static inline __attribute__((always_inline)) | |
13783 | unsigned int csum_and_copy_from_user (const unsigned char *src, unsigned char *dst, | |
13784 | int len, int sum, int *err_ptr) | |
13785 | { | |
13786 | if (_access_ok((unsigned long)(src),(len))) | |
13787 | return csum_partial_copy_from_user(src, dst, len, sum, err_ptr); | |
13788 | ||
13789 | if (len) | |
13790 | *err_ptr = -14; | |
13791 | ||
13792 | return sum; | |
13793 | } | |
13794 | ||
13795 | ||
13796 | ||
13797 | static __inline__ __attribute__((always_inline)) unsigned int csum_and_copy_to_user | |
13798 | (const unsigned char *src, unsigned char *dst, int len, unsigned int sum, int *err_ptr) | |
13799 | { | |
13800 | sum = csum_partial(src, len, sum); | |
13801 | ||
13802 | if (_access_ok((unsigned long)(dst),(len))) { | |
13803 | if (copy_to_user(dst, src, len) == 0) | |
13804 | return sum; | |
13805 | } | |
13806 | if (len) | |
13807 | *err_ptr = -14; | |
13808 | ||
13809 | return -1; | |
13810 | } | |
13811 | ||
13812 | ||
13813 | static inline __attribute__((always_inline)) unsigned int csum_add(unsigned int csum, unsigned int addend) | |
13814 | { | |
13815 | csum += addend; | |
13816 | return csum + (csum < addend); | |
13817 | } | |
13818 | ||
13819 | static inline __attribute__((always_inline)) unsigned int csum_sub(unsigned int csum, unsigned int addend) | |
13820 | { | |
13821 | return csum_add(csum, ~addend); | |
13822 | } | |
13823 | ||
13824 | static inline __attribute__((always_inline)) unsigned int | |
13825 | csum_block_add(unsigned int csum, unsigned int csum2, int offset) | |
13826 | { | |
13827 | if (offset&1) | |
13828 | csum2 = ((csum2&0xFF00FF)<<8)+((csum2>>8)&0xFF00FF); | |
13829 | return csum_add(csum, csum2); | |
13830 | } | |
13831 | ||
13832 | static inline __attribute__((always_inline)) unsigned int | |
13833 | csum_block_sub(unsigned int csum, unsigned int csum2, int offset) | |
13834 | { | |
13835 | if (offset&1) | |
13836 | csum2 = ((csum2&0xFF00FF)<<8)+((csum2>>8)&0xFF00FF); | |
13837 | return csum_sub(csum, csum2); | |
13838 | } | |
13839 | # 31 "include/linux/skbuff.h" 2 | |
13840 | # 1 "include/linux/dmaengine.h" 1 | |
13841 | # 32 "include/linux/skbuff.h" 2 | |
13842 | # 87 "include/linux/skbuff.h" | |
13843 | struct net_device; | |
13844 | # 110 "include/linux/skbuff.h" | |
13845 | struct sk_buff_head { | |
13846 | ||
13847 | struct sk_buff *next; | |
13848 | struct sk_buff *prev; | |
13849 | ||
13850 | __u32 qlen; | |
13851 | spinlock_t lock; | |
13852 | }; | |
13853 | ||
13854 | struct sk_buff; | |
13855 | ||
13856 | ||
13857 | ||
13858 | ||
13859 | typedef struct skb_frag_struct skb_frag_t; | |
13860 | ||
13861 | struct skb_frag_struct { | |
13862 | struct page *page; | |
13863 | __u16 page_offset; | |
13864 | __u16 size; | |
13865 | }; | |
13866 | ||
13867 | ||
13868 | ||
13869 | ||
13870 | struct skb_shared_info { | |
13871 | atomic_t dataref; | |
13872 | unsigned short nr_frags; | |
13873 | unsigned short gso_size; | |
13874 | ||
13875 | unsigned short gso_segs; | |
13876 | unsigned short gso_type; | |
13877 | unsigned int ip6_frag_id; | |
13878 | struct sk_buff *frag_list; | |
13879 | skb_frag_t frags[(65536/(1UL << 12) + 2)]; | |
13880 | }; | |
13881 | # 161 "include/linux/skbuff.h" | |
13882 | struct skb_timeval { | |
13883 | u32 off_sec; | |
13884 | u32 off_usec; | |
13885 | }; | |
13886 | ||
13887 | ||
13888 | enum { | |
13889 | SKB_FCLONE_UNAVAILABLE, | |
13890 | SKB_FCLONE_ORIG, | |
13891 | SKB_FCLONE_CLONE, | |
13892 | }; | |
13893 | ||
13894 | enum { | |
13895 | SKB_GSO_TCPV4 = 1 << 0, | |
13896 | SKB_GSO_UDP = 1 << 1, | |
13897 | ||
13898 | ||
13899 | SKB_GSO_DODGY = 1 << 2, | |
13900 | ||
13901 | ||
13902 | SKB_GSO_TCP_ECN = 1 << 3, | |
13903 | ||
13904 | SKB_GSO_TCPV6 = 1 << 4, | |
13905 | }; | |
13906 | # 232 "include/linux/skbuff.h" | |
13907 | struct sk_buff { | |
13908 | ||
13909 | struct sk_buff *next; | |
13910 | struct sk_buff *prev; | |
13911 | ||
13912 | struct sock *sk; | |
13913 | struct skb_timeval tstamp; | |
13914 | struct net_device *dev; | |
13915 | struct net_device *input_dev; | |
13916 | ||
13917 | union { | |
13918 | struct tcphdr *th; | |
13919 | struct udphdr *uh; | |
13920 | struct icmphdr *icmph; | |
13921 | struct igmphdr *igmph; | |
13922 | struct iphdr *ipiph; | |
13923 | struct ipv6hdr *ipv6h; | |
13924 | unsigned char *raw; | |
13925 | } h; | |
13926 | ||
13927 | union { | |
13928 | struct iphdr *iph; | |
13929 | struct ipv6hdr *ipv6h; | |
13930 | struct arphdr *arph; | |
13931 | unsigned char *raw; | |
13932 | } nh; | |
13933 | ||
13934 | union { | |
13935 | unsigned char *raw; | |
13936 | } mac; | |
13937 | ||
13938 | struct dst_entry *dst; | |
13939 | struct sec_path *sp; | |
13940 | ||
13941 | ||
13942 | ||
13943 | ||
13944 | ||
13945 | ||
13946 | ||
13947 | char cb[48]; | |
13948 | ||
13949 | unsigned int len, | |
13950 | data_len, | |
13951 | mac_len, | |
13952 | csum; | |
13953 | __u32 priority; | |
13954 | __u8 local_df:1, | |
13955 | cloned:1, | |
13956 | ip_summed:2, | |
13957 | nohdr:1, | |
13958 | nfctinfo:3; | |
13959 | __u8 pkt_type:3, | |
13960 | fclone:2, | |
13961 | ipvs_property:1; | |
13962 | __be16 protocol; | |
13963 | ||
13964 | void (*destructor)(struct sk_buff *skb); | |
13965 | # 315 "include/linux/skbuff.h" | |
13966 | unsigned int truesize; | |
13967 | atomic_t users; | |
13968 | unsigned char *head, | |
13969 | *data, | |
13970 | *tail, | |
13971 | *end; | |
13972 | }; | |
13973 | # 331 "include/linux/skbuff.h" | |
13974 | extern void kfree_skb(struct sk_buff *skb); | |
13975 | extern void __kfree_skb(struct sk_buff *skb); | |
13976 | extern struct sk_buff *__alloc_skb(unsigned int size, | |
13977 | gfp_t priority, int fclone); | |
13978 | static inline __attribute__((always_inline)) struct sk_buff *alloc_skb(unsigned int size, | |
13979 | gfp_t priority) | |
13980 | { | |
13981 | return __alloc_skb(size, priority, 0); | |
13982 | } | |
13983 | ||
13984 | static inline __attribute__((always_inline)) struct sk_buff *alloc_skb_fclone(unsigned int size, | |
13985 | gfp_t priority) | |
13986 | { | |
13987 | return __alloc_skb(size, priority, 1); | |
13988 | } | |
13989 | ||
13990 | extern struct sk_buff *alloc_skb_from_cache(kmem_cache_t *cp, | |
13991 | unsigned int size, | |
13992 | gfp_t priority); | |
13993 | extern void kfree_skbmem(struct sk_buff *skb); | |
13994 | extern struct sk_buff *skb_clone(struct sk_buff *skb, | |
13995 | gfp_t priority); | |
13996 | extern struct sk_buff *skb_copy(const struct sk_buff *skb, | |
13997 | gfp_t priority); | |
13998 | extern struct sk_buff *pskb_copy(struct sk_buff *skb, | |
13999 | gfp_t gfp_mask); | |
14000 | extern int pskb_expand_head(struct sk_buff *skb, | |
14001 | int nhead, int ntail, | |
14002 | gfp_t gfp_mask); | |
14003 | extern struct sk_buff *skb_realloc_headroom(struct sk_buff *skb, | |
14004 | unsigned int headroom); | |
14005 | extern struct sk_buff *skb_copy_expand(const struct sk_buff *skb, | |
14006 | int newheadroom, int newtailroom, | |
14007 | gfp_t priority); | |
14008 | extern int skb_pad(struct sk_buff *skb, int pad); | |
14009 | ||
14010 | extern void skb_over_panic(struct sk_buff *skb, int len, | |
14011 | void *here); | |
14012 | extern void skb_under_panic(struct sk_buff *skb, int len, | |
14013 | void *here); | |
14014 | extern void skb_truesize_bug(struct sk_buff *skb); | |
14015 | ||
14016 | static inline __attribute__((always_inline)) void skb_truesize_check(struct sk_buff *skb) | |
14017 | { | |
14018 | if (__builtin_expect(!!((int)skb->truesize < sizeof(struct sk_buff) + skb->len), 0)) | |
14019 | skb_truesize_bug(skb); | |
14020 | } | |
14021 | ||
14022 | extern int skb_append_datato_frags(struct sock *sk, struct sk_buff *skb, | |
14023 | int getfrag(void *from, char *to, int offset, | |
14024 | int len,int odd, struct sk_buff *skb), | |
14025 | void *from, int length); | |
14026 | ||
14027 | struct skb_seq_state | |
14028 | { | |
14029 | __u32 lower_offset; | |
14030 | __u32 upper_offset; | |
14031 | __u32 frag_idx; | |
14032 | __u32 stepped_offset; | |
14033 | struct sk_buff *root_skb; | |
14034 | struct sk_buff *cur_skb; | |
14035 | __u8 *frag_data; | |
14036 | }; | |
14037 | ||
14038 | extern void skb_prepare_seq_read(struct sk_buff *skb, | |
14039 | unsigned int from, unsigned int to, | |
14040 | struct skb_seq_state *st); | |
14041 | extern unsigned int skb_seq_read(unsigned int consumed, const u8 **data, | |
14042 | struct skb_seq_state *st); | |
14043 | extern void skb_abort_seq_read(struct skb_seq_state *st); | |
14044 | ||
14045 | extern unsigned int skb_find_text(struct sk_buff *skb, unsigned int from, | |
14046 | unsigned int to, struct ts_config *config, | |
14047 | struct ts_state *state); | |
14048 | # 415 "include/linux/skbuff.h" | |
14049 | static inline __attribute__((always_inline)) int skb_queue_empty(const struct sk_buff_head *list) | |
14050 | { | |
14051 | return list->next == (struct sk_buff *)list; | |
14052 | } | |
14053 | # 427 "include/linux/skbuff.h" | |
14054 | static inline __attribute__((always_inline)) struct sk_buff *skb_get(struct sk_buff *skb) | |
14055 | { | |
14056 | atomic_inc(&skb->users); | |
14057 | return skb; | |
14058 | } | |
14059 | # 446 "include/linux/skbuff.h" | |
14060 | static inline __attribute__((always_inline)) int skb_cloned(const struct sk_buff *skb) | |
14061 | { | |
14062 | return skb->cloned && | |
14063 | (((&((struct skb_shared_info *)((skb)->end))->dataref)->counter) & ((1 << 16) - 1)) != 1; | |
14064 | } | |
14065 | # 459 "include/linux/skbuff.h" | |
14066 | static inline __attribute__((always_inline)) int skb_header_cloned(const struct sk_buff *skb) | |
14067 | { | |
14068 | int dataref; | |
14069 | ||
14070 | if (!skb->cloned) | |
14071 | return 0; | |
14072 | ||
14073 | dataref = ((&((struct skb_shared_info *)((skb)->end))->dataref)->counter); | |
14074 | dataref = (dataref & ((1 << 16) - 1)) - (dataref >> 16); | |
14075 | return dataref != 1; | |
14076 | } | |
14077 | # 479 "include/linux/skbuff.h" | |
14078 | static inline __attribute__((always_inline)) void skb_header_release(struct sk_buff *skb) | |
14079 | { | |
14080 | do { if (__builtin_expect(!!((skb->nohdr)!=0), 0)) do { dump_stack(); printk("<4>" "\nkernel BUG at %s:%d!\n", "include/linux/skbuff.h", 481); panic("BUG!"); } while (0); } while(0); | |
14081 | skb->nohdr = 1; | |
14082 | atomic_add(1 << 16, &((struct skb_shared_info *)((skb)->end))->dataref); | |
14083 | } | |
14084 | # 493 "include/linux/skbuff.h" | |
14085 | static inline __attribute__((always_inline)) int skb_shared(const struct sk_buff *skb) | |
14086 | { | |
14087 | return ((&skb->users)->counter) != 1; | |
14088 | } | |
14089 | # 511 "include/linux/skbuff.h" | |
14090 | static inline __attribute__((always_inline)) struct sk_buff *skb_share_check(struct sk_buff *skb, | |
14091 | gfp_t pri) | |
14092 | { | |
14093 | do { if (pri & (( gfp_t)0x10u)) do { do { } while (0); } while (0); } while (0); | |
14094 | if (skb_shared(skb)) { | |
14095 | struct sk_buff *nskb = skb_clone(skb, pri); | |
14096 | kfree_skb(skb); | |
14097 | skb = nskb; | |
14098 | } | |
14099 | return skb; | |
14100 | } | |
14101 | # 543 "include/linux/skbuff.h" | |
14102 | static inline __attribute__((always_inline)) struct sk_buff *skb_unshare(struct sk_buff *skb, | |
14103 | gfp_t pri) | |
14104 | { | |
14105 | do { if (pri & (( gfp_t)0x10u)) do { do { } while (0); } while (0); } while (0); | |
14106 | if (skb_cloned(skb)) { | |
14107 | struct sk_buff *nskb = skb_copy(skb, pri); | |
14108 | kfree_skb(skb); | |
14109 | skb = nskb; | |
14110 | } | |
14111 | return skb; | |
14112 | } | |
14113 | # 568 "include/linux/skbuff.h" | |
14114 | static inline __attribute__((always_inline)) struct sk_buff *skb_peek(struct sk_buff_head *list_) | |
14115 | { | |
14116 | struct sk_buff *list = ((struct sk_buff *)list_)->next; | |
14117 | if (list == (struct sk_buff *)list_) | |
14118 | list = ((void *)0); | |
14119 | return list; | |
14120 | } | |
14121 | # 589 "include/linux/skbuff.h" | |
14122 | static inline __attribute__((always_inline)) struct sk_buff *skb_peek_tail(struct sk_buff_head *list_) | |
14123 | { | |
14124 | struct sk_buff *list = ((struct sk_buff *)list_)->prev; | |
14125 | if (list == (struct sk_buff *)list_) | |
14126 | list = ((void *)0); | |
14127 | return list; | |
14128 | } | |
14129 | ||
14130 | ||
14131 | ||
14132 | ||
14133 | ||
14134 | ||
14135 | ||
14136 | static inline __attribute__((always_inline)) __u32 skb_queue_len(const struct sk_buff_head *list_) | |
14137 | { | |
14138 | return list_->qlen; | |
14139 | } | |
14140 | # 616 "include/linux/skbuff.h" | |
14141 | static inline __attribute__((always_inline)) void skb_queue_head_init(struct sk_buff_head *list) | |
14142 | { | |
14143 | do { *(&list->lock) = (spinlock_t) { .raw_lock = { }, }; } while (0); | |
14144 | list->prev = list->next = (struct sk_buff *)list; | |
14145 | list->qlen = 0; | |
14146 | } | |
14147 | # 641 "include/linux/skbuff.h" | |
14148 | static inline __attribute__((always_inline)) void __skb_queue_after(struct sk_buff_head *list, | |
14149 | struct sk_buff *prev, | |
14150 | struct sk_buff *newsk) | |
14151 | { | |
14152 | struct sk_buff *next; | |
14153 | list->qlen++; | |
14154 | ||
14155 | next = prev->next; | |
14156 | newsk->next = next; | |
14157 | newsk->prev = prev; | |
14158 | next->prev = prev->next = newsk; | |
14159 | } | |
14160 | # 664 "include/linux/skbuff.h" | |
14161 | extern void skb_queue_head(struct sk_buff_head *list, struct sk_buff *newsk); | |
14162 | static inline __attribute__((always_inline)) void __skb_queue_head(struct sk_buff_head *list, | |
14163 | struct sk_buff *newsk) | |
14164 | { | |
14165 | __skb_queue_after(list, (struct sk_buff *)list, newsk); | |
14166 | } | |
14167 | # 681 "include/linux/skbuff.h" | |
14168 | extern void skb_queue_tail(struct sk_buff_head *list, struct sk_buff *newsk); | |
14169 | static inline __attribute__((always_inline)) void __skb_queue_tail(struct sk_buff_head *list, | |
14170 | struct sk_buff *newsk) | |
14171 | { | |
14172 | struct sk_buff *prev, *next; | |
14173 | ||
14174 | list->qlen++; | |
14175 | next = (struct sk_buff *)list; | |
14176 | prev = next->prev; | |
14177 | newsk->next = next; | |
14178 | newsk->prev = prev; | |
14179 | next->prev = prev->next = newsk; | |
14180 | } | |
14181 | # 704 "include/linux/skbuff.h" | |
14182 | extern struct sk_buff *skb_dequeue(struct sk_buff_head *list); | |
14183 | static inline __attribute__((always_inline)) struct sk_buff *__skb_dequeue(struct sk_buff_head *list) | |
14184 | { | |
14185 | struct sk_buff *next, *prev, *result; | |
14186 | ||
14187 | prev = (struct sk_buff *) list; | |
14188 | next = prev->next; | |
14189 | result = ((void *)0); | |
14190 | if (next != prev) { | |
14191 | result = next; | |
14192 | next = next->next; | |
14193 | list->qlen--; | |
14194 | next->prev = prev; | |
14195 | prev->next = next; | |
14196 | result->next = result->prev = ((void *)0); | |
14197 | } | |
14198 | return result; | |
14199 | } | |
14200 | ||
14201 | ||
14202 | ||
14203 | ||
14204 | ||
14205 | extern void skb_insert(struct sk_buff *old, struct sk_buff *newsk, struct sk_buff_head *list); | |
14206 | static inline __attribute__((always_inline)) void __skb_insert(struct sk_buff *newsk, | |
14207 | struct sk_buff *prev, struct sk_buff *next, | |
14208 | struct sk_buff_head *list) | |
14209 | { | |
14210 | newsk->next = next; | |
14211 | newsk->prev = prev; | |
14212 | next->prev = prev->next = newsk; | |
14213 | list->qlen++; | |
14214 | } | |
14215 | ||
14216 | ||
14217 | ||
14218 | ||
14219 | extern void skb_append(struct sk_buff *old, struct sk_buff *newsk, struct sk_buff_head *list); | |
14220 | static inline __attribute__((always_inline)) void __skb_append(struct sk_buff *old, struct sk_buff *newsk, struct sk_buff_head *list) | |
14221 | { | |
14222 | __skb_insert(newsk, old, old->next, list); | |
14223 | } | |
14224 | ||
14225 | ||
14226 | ||
14227 | ||
14228 | ||
14229 | extern void skb_unlink(struct sk_buff *skb, struct sk_buff_head *list); | |
14230 | static inline __attribute__((always_inline)) void __skb_unlink(struct sk_buff *skb, struct sk_buff_head *list) | |
14231 | { | |
14232 | struct sk_buff *next, *prev; | |
14233 | ||
14234 | list->qlen--; | |
14235 | next = skb->next; | |
14236 | prev = skb->prev; | |
14237 | skb->next = skb->prev = ((void *)0); | |
14238 | next->prev = prev; | |
14239 | prev->next = next; | |
14240 | } | |
14241 | # 775 "include/linux/skbuff.h" | |
14242 | extern struct sk_buff *skb_dequeue_tail(struct sk_buff_head *list); | |
14243 | static inline __attribute__((always_inline)) struct sk_buff *__skb_dequeue_tail(struct sk_buff_head *list) | |
14244 | { | |
14245 | struct sk_buff *skb = skb_peek_tail(list); | |
14246 | if (skb) | |
14247 | __skb_unlink(skb, list); | |
14248 | return skb; | |
14249 | } | |
14250 | ||
14251 | ||
14252 | static inline __attribute__((always_inline)) int skb_is_nonlinear(const struct sk_buff *skb) | |
14253 | { | |
14254 | return skb->data_len; | |
14255 | } | |
14256 | ||
14257 | static inline __attribute__((always_inline)) unsigned int skb_headlen(const struct sk_buff *skb) | |
14258 | { | |
14259 | return skb->len - skb->data_len; | |
14260 | } | |
14261 | ||
14262 | static inline __attribute__((always_inline)) int skb_pagelen(const struct sk_buff *skb) | |
14263 | { | |
14264 | int i, len = 0; | |
14265 | ||
14266 | for (i = (int)((struct skb_shared_info *)((skb)->end))->nr_frags - 1; i >= 0; i--) | |
14267 | len += ((struct skb_shared_info *)((skb)->end))->frags[i].size; | |
14268 | return len + skb_headlen(skb); | |
14269 | } | |
14270 | ||
14271 | static inline __attribute__((always_inline)) void skb_fill_page_desc(struct sk_buff *skb, int i, | |
14272 | struct page *page, int off, int size) | |
14273 | { | |
14274 | skb_frag_t *frag = &((struct skb_shared_info *)((skb)->end))->frags[i]; | |
14275 | ||
14276 | frag->page = page; | |
14277 | frag->page_offset = off; | |
14278 | frag->size = size; | |
14279 | ((struct skb_shared_info *)((skb)->end))->nr_frags = i + 1; | |
14280 | } | |
14281 | # 822 "include/linux/skbuff.h" | |
14282 | static inline __attribute__((always_inline)) unsigned char *__skb_put(struct sk_buff *skb, unsigned int len) | |
14283 | { | |
14284 | unsigned char *tmp = skb->tail; | |
14285 | do { if (__builtin_expect(!!((skb_is_nonlinear(skb))!=0), 0)) do { dump_stack(); printk("<4>" "\nkernel BUG at %s:%d!\n", "include/linux/skbuff.h", 825); panic("BUG!"); } while (0); } while(0); | |
14286 | skb->tail += len; | |
14287 | skb->len += len; | |
14288 | return tmp; | |
14289 | } | |
14290 | # 840 "include/linux/skbuff.h" | |
14291 | static inline __attribute__((always_inline)) unsigned char *skb_put(struct sk_buff *skb, unsigned int len) | |
14292 | { | |
14293 | unsigned char *tmp = skb->tail; | |
14294 | do { if (__builtin_expect(!!((skb_is_nonlinear(skb))!=0), 0)) do { dump_stack(); printk("<4>" "\nkernel BUG at %s:%d!\n", "include/linux/skbuff.h", 843); panic("BUG!"); } while (0); } while(0); | |
14295 | skb->tail += len; | |
14296 | skb->len += len; | |
14297 | if (__builtin_expect(!!(skb->tail>skb->end), 0)) | |
14298 | skb_over_panic(skb, len, ({ __label__ _l; _l: &&_l;})); | |
14299 | return tmp; | |
14300 | } | |
14301 | ||
14302 | static inline __attribute__((always_inline)) unsigned char *__skb_push(struct sk_buff *skb, unsigned int len) | |
14303 | { | |
14304 | skb->data -= len; | |
14305 | skb->len += len; | |
14306 | return skb->data; | |
14307 | } | |
14308 | # 867 "include/linux/skbuff.h" | |
14309 | static inline __attribute__((always_inline)) unsigned char *skb_push(struct sk_buff *skb, unsigned int len) | |
14310 | { | |
14311 | skb->data -= len; | |
14312 | skb->len += len; | |
14313 | if (__builtin_expect(!!(skb->data<skb->head), 0)) | |
14314 | skb_under_panic(skb, len, ({ __label__ _l; _l: &&_l;})); | |
14315 | return skb->data; | |
14316 | } | |
14317 | ||
14318 | static inline __attribute__((always_inline)) unsigned char *__skb_pull(struct sk_buff *skb, unsigned int len) | |
14319 | { | |
14320 | skb->len -= len; | |
14321 | do { if (__builtin_expect(!!((skb->len < skb->data_len)!=0), 0)) do { dump_stack(); printk("<4>" "\nkernel BUG at %s:%d!\n", "include/linux/skbuff.h", 879); panic("BUG!"); } while (0); } while(0); | |
14322 | return skb->data += len; | |
14323 | } | |
14324 | # 893 "include/linux/skbuff.h" | |
14325 | static inline __attribute__((always_inline)) unsigned char *skb_pull(struct sk_buff *skb, unsigned int len) | |
14326 | { | |
14327 | return __builtin_expect(!!(len > skb->len), 0) ? ((void *)0) : __skb_pull(skb, len); | |
14328 | } | |
14329 | ||
14330 | extern unsigned char *__pskb_pull_tail(struct sk_buff *skb, int delta); | |
14331 | ||
14332 | static inline __attribute__((always_inline)) unsigned char *__pskb_pull(struct sk_buff *skb, unsigned int len) | |
14333 | { | |
14334 | if (len > skb_headlen(skb) && | |
14335 | !__pskb_pull_tail(skb, len-skb_headlen(skb))) | |
14336 | return ((void *)0); | |
14337 | skb->len -= len; | |
14338 | return skb->data += len; | |
14339 | } | |
14340 | ||
14341 | static inline __attribute__((always_inline)) unsigned char *pskb_pull(struct sk_buff *skb, unsigned int len) | |
14342 | { | |
14343 | return __builtin_expect(!!(len > skb->len), 0) ? ((void *)0) : __pskb_pull(skb, len); | |
14344 | } | |
14345 | ||
14346 | static inline __attribute__((always_inline)) int pskb_may_pull(struct sk_buff *skb, unsigned int len) | |
14347 | { | |
14348 | if (__builtin_expect(!!(len <= skb_headlen(skb)), 1)) | |
14349 | return 1; | |
14350 | if (__builtin_expect(!!(len > skb->len), 0)) | |
14351 | return 0; | |
14352 | return __pskb_pull_tail(skb, len-skb_headlen(skb)) != ((void *)0); | |
14353 | } | |
14354 | ||
14355 | ||
14356 | ||
14357 | ||
14358 | ||
14359 | ||
14360 | ||
14361 | static inline __attribute__((always_inline)) int skb_headroom(const struct sk_buff *skb) | |
14362 | { | |
14363 | return skb->data - skb->head; | |
14364 | } | |
14365 | ||
14366 | ||
14367 | ||
14368 | ||
14369 | ||
14370 | ||
14371 | ||
14372 | static inline __attribute__((always_inline)) int skb_tailroom(const struct sk_buff *skb) | |
14373 | { | |
14374 | return skb_is_nonlinear(skb) ? 0 : skb->end - skb->tail; | |
14375 | } | |
14376 | # 953 "include/linux/skbuff.h" | |
14377 | static inline __attribute__((always_inline)) void skb_reserve(struct sk_buff *skb, int len) | |
14378 | { | |
14379 | skb->data += len; | |
14380 | skb->tail += len; | |
14381 | } | |
14382 | # 1002 "include/linux/skbuff.h" | |
14383 | extern int ___pskb_trim(struct sk_buff *skb, unsigned int len); | |
14384 | ||
14385 | static inline __attribute__((always_inline)) void __skb_trim(struct sk_buff *skb, unsigned int len) | |
14386 | { | |
14387 | if (__builtin_expect(!!(skb->data_len), 0)) { | |
14388 | ({ typeof(1) __ret_warn_on = (1); if (__builtin_expect(!!(__ret_warn_on), 0)) { printk("BUG: warning at %s:%d/%s()\n", "include/linux/skbuff.h", 1007, (__func__)); dump_stack(); } __builtin_expect(!!(__ret_warn_on), 0); }); | |
14389 | return; | |
14390 | } | |
14391 | skb->len = len; | |
14392 | skb->tail = skb->data + len; | |
14393 | } | |
14394 | # 1023 "include/linux/skbuff.h" | |
14395 | static inline __attribute__((always_inline)) void skb_trim(struct sk_buff *skb, unsigned int len) | |
14396 | { | |
14397 | if (skb->len > len) | |
14398 | __skb_trim(skb, len); | |
14399 | } | |
14400 | ||
14401 | ||
14402 | static inline __attribute__((always_inline)) int __pskb_trim(struct sk_buff *skb, unsigned int len) | |
14403 | { | |
14404 | if (skb->data_len) | |
14405 | return ___pskb_trim(skb, len); | |
14406 | __skb_trim(skb, len); | |
14407 | return 0; | |
14408 | } | |
14409 | ||
14410 | static inline __attribute__((always_inline)) int pskb_trim(struct sk_buff *skb, unsigned int len) | |
14411 | { | |
14412 | return (len < skb->len) ? __pskb_trim(skb, len) : 0; | |
14413 | } | |
14414 | # 1052 "include/linux/skbuff.h" | |
14415 | static inline __attribute__((always_inline)) void pskb_trim_unique(struct sk_buff *skb, unsigned int len) | |
14416 | { | |
14417 | int err = pskb_trim(skb, len); | |
14418 | do { if (__builtin_expect(!!((err)!=0), 0)) do { dump_stack(); printk("<4>" "\nkernel BUG at %s:%d!\n", "include/linux/skbuff.h", 1055); panic("BUG!"); } while (0); } while(0); | |
14419 | } | |
14420 | # 1066 "include/linux/skbuff.h" | |
14421 | static inline __attribute__((always_inline)) void skb_orphan(struct sk_buff *skb) | |
14422 | { | |
14423 | if (skb->destructor) | |
14424 | skb->destructor(skb); | |
14425 | skb->destructor = ((void *)0); | |
14426 | skb->sk = ((void *)0); | |
14427 | } | |
14428 | # 1082 "include/linux/skbuff.h" | |
14429 | extern void skb_queue_purge(struct sk_buff_head *list); | |
14430 | static inline __attribute__((always_inline)) void __skb_queue_purge(struct sk_buff_head *list) | |
14431 | { | |
14432 | struct sk_buff *skb; | |
14433 | while ((skb = __skb_dequeue(list)) != ((void *)0)) | |
14434 | kfree_skb(skb); | |
14435 | } | |
14436 | # 1102 "include/linux/skbuff.h" | |
14437 | static inline __attribute__((always_inline)) struct sk_buff *__dev_alloc_skb(unsigned int length, | |
14438 | gfp_t gfp_mask) | |
14439 | { | |
14440 | struct sk_buff *skb = alloc_skb(length + 16, gfp_mask); | |
14441 | if (__builtin_expect(!!(skb), 1)) | |
14442 | skb_reserve(skb, 16); | |
14443 | return skb; | |
14444 | } | |
14445 | # 1123 "include/linux/skbuff.h" | |
14446 | static inline __attribute__((always_inline)) struct sk_buff *dev_alloc_skb(unsigned int length) | |
14447 | { | |
14448 | return __dev_alloc_skb(length, ((( gfp_t)0x20u))); | |
14449 | } | |
14450 | ||
14451 | extern struct sk_buff *__netdev_alloc_skb(struct net_device *dev, | |
14452 | unsigned int length, gfp_t gfp_mask); | |
14453 | # 1144 "include/linux/skbuff.h" | |
14454 | static inline __attribute__((always_inline)) struct sk_buff *netdev_alloc_skb(struct net_device *dev, | |
14455 | unsigned int length) | |
14456 | { | |
14457 | return __netdev_alloc_skb(dev, length, ((( gfp_t)0x20u))); | |
14458 | } | |
14459 | # 1162 "include/linux/skbuff.h" | |
14460 | static inline __attribute__((always_inline)) int skb_cow(struct sk_buff *skb, unsigned int headroom) | |
14461 | { | |
14462 | int delta = (headroom > 16 ? headroom : 16) - | |
14463 | skb_headroom(skb); | |
14464 | ||
14465 | if (delta < 0) | |
14466 | delta = 0; | |
14467 | ||
14468 | if (delta || skb_cloned(skb)) | |
14469 | return pskb_expand_head(skb, (delta + (16 -1)) & | |
14470 | ~(16 -1), 0, ((( gfp_t)0x20u))); | |
14471 | return 0; | |
14472 | } | |
14473 | # 1187 "include/linux/skbuff.h" | |
14474 | static inline __attribute__((always_inline)) int skb_padto(struct sk_buff *skb, unsigned int len) | |
14475 | { | |
14476 | unsigned int size = skb->len; | |
14477 | if (__builtin_expect(!!(size >= len), 1)) | |
14478 | return 0; | |
14479 | return skb_pad(skb, len-size); | |
14480 | } | |
14481 | ||
14482 | static inline __attribute__((always_inline)) int skb_add_data(struct sk_buff *skb, | |
14483 | char *from, int copy) | |
14484 | { | |
14485 | const int off = skb->len; | |
14486 | ||
14487 | if (skb->ip_summed == 0) { | |
14488 | int err = 0; | |
14489 | unsigned int csum = csum_and_copy_from_user(from, | |
14490 | skb_put(skb, copy), | |
14491 | copy, 0, &err); | |
14492 | if (!err) { | |
14493 | skb->csum = csum_block_add(skb->csum, csum, off); | |
14494 | return 0; | |
14495 | } | |
14496 | } else if (!copy_from_user(skb_put(skb, copy), from, copy)) | |
14497 | return 0; | |
14498 | ||
14499 | __skb_trim(skb, off); | |
14500 | return -14; | |
14501 | } | |
14502 | ||
14503 | static inline __attribute__((always_inline)) int skb_can_coalesce(struct sk_buff *skb, int i, | |
14504 | struct page *page, int off) | |
14505 | { | |
14506 | if (i) { | |
14507 | struct skb_frag_struct *frag = &((struct skb_shared_info *)((skb)->end))->frags[i - 1]; | |
14508 | ||
14509 | return page == frag->page && | |
14510 | off == frag->page_offset + frag->size; | |
14511 | } | |
14512 | return 0; | |
14513 | } | |
14514 | ||
14515 | static inline __attribute__((always_inline)) int __skb_linearize(struct sk_buff *skb) | |
14516 | { | |
14517 | return __pskb_pull_tail(skb, skb->data_len) ? 0 : -12; | |
14518 | } | |
14519 | # 1240 "include/linux/skbuff.h" | |
14520 | static inline __attribute__((always_inline)) int skb_linearize(struct sk_buff *skb) | |
14521 | { | |
14522 | return skb_is_nonlinear(skb) ? __skb_linearize(skb) : 0; | |
14523 | } | |
14524 | # 1252 "include/linux/skbuff.h" | |
14525 | static inline __attribute__((always_inline)) int skb_linearize_cow(struct sk_buff *skb) | |
14526 | { | |
14527 | return skb_is_nonlinear(skb) || skb_cloned(skb) ? | |
14528 | __skb_linearize(skb) : 0; | |
14529 | } | |
14530 | # 1269 "include/linux/skbuff.h" | |
14531 | static inline __attribute__((always_inline)) void skb_postpull_rcsum(struct sk_buff *skb, | |
14532 | const void *start, unsigned int len) | |
14533 | { | |
14534 | if (skb->ip_summed == 3) | |
14535 | skb->csum = csum_sub(skb->csum, csum_partial(start, len, 0)); | |
14536 | } | |
14537 | ||
14538 | unsigned char *skb_pull_rcsum(struct sk_buff *skb, unsigned int len); | |
14539 | # 1287 "include/linux/skbuff.h" | |
14540 | static inline __attribute__((always_inline)) int pskb_trim_rcsum(struct sk_buff *skb, unsigned int len) | |
14541 | { | |
14542 | if (__builtin_expect(!!(len >= skb->len), 1)) | |
14543 | return 0; | |
14544 | if (skb->ip_summed == 3) | |
14545 | skb->ip_summed = 0; | |
14546 | return __pskb_trim(skb, len); | |
14547 | } | |
14548 | ||
14549 | static inline __attribute__((always_inline)) void *kmap_skb_frag(const skb_frag_t *frag) | |
14550 | { | |
14551 | ||
14552 | ||
14553 | ||
14554 | ||
14555 | ||
14556 | return lowmem_page_address(frag->page); | |
14557 | } | |
14558 | ||
14559 | static inline __attribute__((always_inline)) void kunmap_skb_frag(void *vaddr) | |
14560 | { | |
14561 | do { } while (0); | |
14562 | ||
14563 | ||
14564 | ||
14565 | } | |
14566 | # 1325 "include/linux/skbuff.h" | |
14567 | extern struct sk_buff *skb_recv_datagram(struct sock *sk, unsigned flags, | |
14568 | int noblock, int *err); | |
14569 | extern unsigned int datagram_poll(struct file *file, struct socket *sock, | |
14570 | struct poll_table_struct *wait); | |
14571 | extern int skb_copy_datagram_iovec(const struct sk_buff *from, | |
14572 | int offset, struct iovec *to, | |
14573 | int size); | |
14574 | extern int skb_copy_and_csum_datagram_iovec(struct sk_buff *skb, | |
14575 | int hlen, | |
14576 | struct iovec *iov); | |
14577 | extern void skb_free_datagram(struct sock *sk, struct sk_buff *skb); | |
14578 | extern void skb_kill_datagram(struct sock *sk, struct sk_buff *skb, | |
14579 | unsigned int flags); | |
14580 | extern unsigned int skb_checksum(const struct sk_buff *skb, int offset, | |
14581 | int len, unsigned int csum); | |
14582 | extern int skb_copy_bits(const struct sk_buff *skb, int offset, | |
14583 | void *to, int len); | |
14584 | extern int skb_store_bits(const struct sk_buff *skb, int offset, | |
14585 | void *from, int len); | |
14586 | extern unsigned int skb_copy_and_csum_bits(const struct sk_buff *skb, | |
14587 | int offset, u8 *to, int len, | |
14588 | unsigned int csum); | |
14589 | extern void skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to); | |
14590 | extern void skb_split(struct sk_buff *skb, | |
14591 | struct sk_buff *skb1, const u32 len); | |
14592 | ||
14593 | extern struct sk_buff *skb_segment(struct sk_buff *skb, int features); | |
14594 | ||
14595 | static inline __attribute__((always_inline)) void *skb_header_pointer(const struct sk_buff *skb, int offset, | |
14596 | int len, void *buffer) | |
14597 | { | |
14598 | int hlen = skb_headlen(skb); | |
14599 | ||
14600 | if (hlen - offset >= len) | |
14601 | return skb->data + offset; | |
14602 | ||
14603 | if (skb_copy_bits(skb, offset, buffer, len) < 0) | |
14604 | return ((void *)0); | |
14605 | ||
14606 | return buffer; | |
14607 | } | |
14608 | ||
14609 | extern void skb_init(void); | |
14610 | extern void skb_add_mtu(int mtu); | |
14611 | # 1379 "include/linux/skbuff.h" | |
14612 | static inline __attribute__((always_inline)) void skb_get_timestamp(const struct sk_buff *skb, struct timeval *stamp) | |
14613 | { | |
14614 | stamp->tv_sec = skb->tstamp.off_sec; | |
14615 | stamp->tv_usec = skb->tstamp.off_usec; | |
14616 | } | |
14617 | # 1394 "include/linux/skbuff.h" | |
14618 | static inline __attribute__((always_inline)) void skb_set_timestamp(struct sk_buff *skb, const struct timeval *stamp) | |
14619 | { | |
14620 | skb->tstamp.off_sec = stamp->tv_sec; | |
14621 | skb->tstamp.off_usec = stamp->tv_usec; | |
14622 | } | |
14623 | ||
14624 | extern void __net_timestamp(struct sk_buff *skb); | |
14625 | ||
14626 | extern unsigned int __skb_checksum_complete(struct sk_buff *skb); | |
14627 | # 1420 "include/linux/skbuff.h" | |
14628 | static inline __attribute__((always_inline)) unsigned int skb_checksum_complete(struct sk_buff *skb) | |
14629 | { | |
14630 | return skb->ip_summed != 2 && | |
14631 | __skb_checksum_complete(skb); | |
14632 | } | |
14633 | # 1476 "include/linux/skbuff.h" | |
14634 | static inline __attribute__((always_inline)) void nf_reset(struct sk_buff *skb) {} | |
14635 | # 1490 "include/linux/skbuff.h" | |
14636 | static inline __attribute__((always_inline)) void skb_copy_secmark(struct sk_buff *to, const struct sk_buff *from) | |
14637 | { } | |
14638 | ||
14639 | static inline __attribute__((always_inline)) void skb_init_secmark(struct sk_buff *skb) | |
14640 | { } | |
14641 | ||
14642 | ||
14643 | static inline __attribute__((always_inline)) int skb_is_gso(const struct sk_buff *skb) | |
14644 | { | |
14645 | return ((struct skb_shared_info *)((skb)->end))->gso_size; | |
14646 | } | |
14647 | # 112 "include/linux/if_ether.h" 2 | |
14648 | ||
14649 | static inline __attribute__((always_inline)) struct ethhdr *eth_hdr(const struct sk_buff *skb) | |
14650 | { | |
14651 | return (struct ethhdr *)skb->mac.raw; | |
14652 | } | |
14653 | ||
14654 | ||
14655 | extern struct ctl_table ether_table[]; | |
14656 | # 30 "include/linux/netdevice.h" 2 | |
14657 | # 1 "include/linux/if_packet.h" 1 | |
14658 | ||
14659 | ||
14660 | ||
14661 | struct sockaddr_pkt | |
14662 | { | |
14663 | unsigned short spkt_family; | |
14664 | unsigned char spkt_device[14]; | |
14665 | unsigned short spkt_protocol; | |
14666 | }; | |
14667 | ||
14668 | struct sockaddr_ll | |
14669 | { | |
14670 | unsigned short sll_family; | |
14671 | unsigned short sll_protocol; | |
14672 | int sll_ifindex; | |
14673 | unsigned short sll_hatype; | |
14674 | unsigned char sll_pkttype; | |
14675 | unsigned char sll_halen; | |
14676 | unsigned char sll_addr[8]; | |
14677 | }; | |
14678 | # 43 "include/linux/if_packet.h" | |
14679 | struct tpacket_stats | |
14680 | { | |
14681 | unsigned int tp_packets; | |
14682 | unsigned int tp_drops; | |
14683 | }; | |
14684 | ||
14685 | struct tpacket_hdr | |
14686 | { | |
14687 | unsigned long tp_status; | |
14688 | ||
14689 | ||
14690 | ||
14691 | ||
14692 | ||
14693 | unsigned int tp_len; | |
14694 | unsigned int tp_snaplen; | |
14695 | unsigned short tp_mac; | |
14696 | unsigned short tp_net; | |
14697 | unsigned int tp_sec; | |
14698 | unsigned int tp_usec; | |
14699 | }; | |
14700 | # 82 "include/linux/if_packet.h" | |
14701 | struct tpacket_req | |
14702 | { | |
14703 | unsigned int tp_block_size; | |
14704 | unsigned int tp_block_nr; | |
14705 | unsigned int tp_frame_size; | |
14706 | unsigned int tp_frame_nr; | |
14707 | }; | |
14708 | ||
14709 | struct packet_mreq | |
14710 | { | |
14711 | int mr_ifindex; | |
14712 | unsigned short mr_type; | |
14713 | unsigned short mr_alen; | |
14714 | unsigned char mr_address[8]; | |
14715 | }; | |
14716 | # 31 "include/linux/netdevice.h" 2 | |
14717 | ||
14718 | ||
14719 | ||
14720 | ||
14721 | ||
14722 | ||
14723 | # 1 "include/linux/device.h" 1 | |
14724 | # 14 "include/linux/device.h" | |
14725 | # 1 "include/linux/ioport.h" 1 | |
14726 | # 17 "include/linux/ioport.h" | |
14727 | struct resource { | |
14728 | resource_size_t start; | |
14729 | resource_size_t end; | |
14730 | const char *name; | |
14731 | unsigned long flags; | |
14732 | struct resource *parent, *sibling, *child; | |
14733 | }; | |
14734 | ||
14735 | struct resource_list { | |
14736 | struct resource_list *next; | |
14737 | struct resource *res; | |
14738 | struct pci_dev *dev; | |
14739 | }; | |
14740 | # 94 "include/linux/ioport.h" | |
14741 | extern struct resource ioport_resource; | |
14742 | extern struct resource iomem_resource; | |
14743 | ||
14744 | extern int request_resource(struct resource *root, struct resource *new); | |
14745 | extern struct resource * ____request_resource(struct resource *root, struct resource *new); | |
14746 | extern int release_resource(struct resource *new); | |
14747 | extern int insert_resource(struct resource *parent, struct resource *new); | |
14748 | extern int allocate_resource(struct resource *root, struct resource *new, | |
14749 | resource_size_t size, resource_size_t min, | |
14750 | resource_size_t max, resource_size_t align, | |
14751 | void (*alignf)(void *, struct resource *, | |
14752 | resource_size_t, resource_size_t), | |
14753 | void *alignf_data); | |
14754 | int adjust_resource(struct resource *res, resource_size_t start, | |
14755 | resource_size_t size); | |
14756 | ||
14757 | ||
14758 | extern int find_next_system_ram(struct resource *res); | |
14759 | ||
14760 | ||
14761 | ||
14762 | ||
14763 | ||
14764 | ||
14765 | extern struct resource * __request_region(struct resource *, | |
14766 | resource_size_t start, | |
14767 | resource_size_t n, const char *name); | |
14768 | ||
14769 | ||
14770 | ||
14771 | ||
14772 | ||
14773 | ||
14774 | extern int __check_region(struct resource *, resource_size_t, resource_size_t); | |
14775 | extern void __release_region(struct resource *, resource_size_t, | |
14776 | resource_size_t); | |
14777 | ||
14778 | static inline __attribute__((always_inline)) int __attribute__((deprecated)) check_region(resource_size_t s, | |
14779 | resource_size_t n) | |
14780 | { | |
14781 | return __check_region(&ioport_resource, s, n); | |
14782 | } | |
14783 | # 15 "include/linux/device.h" 2 | |
14784 | ||
14785 | # 1 "include/linux/klist.h" 1 | |
14786 | # 20 "include/linux/klist.h" | |
14787 | struct klist_node; | |
14788 | struct klist { | |
14789 | spinlock_t k_lock; | |
14790 | struct list_head k_list; | |
14791 | void (*get)(struct klist_node *); | |
14792 | void (*put)(struct klist_node *); | |
14793 | }; | |
14794 | ||
14795 | ||
14796 | extern void klist_init(struct klist * k, void (*get)(struct klist_node *), | |
14797 | void (*put)(struct klist_node *)); | |
14798 | ||
14799 | struct klist_node { | |
14800 | struct klist * n_klist; | |
14801 | struct list_head n_node; | |
14802 | struct kref n_ref; | |
14803 | struct completion n_removed; | |
14804 | }; | |
14805 | ||
14806 | extern void klist_add_tail(struct klist_node * n, struct klist * k); | |
14807 | extern void klist_add_head(struct klist_node * n, struct klist * k); | |
14808 | ||
14809 | extern void klist_del(struct klist_node * n); | |
14810 | extern void klist_remove(struct klist_node * n); | |
14811 | ||
14812 | extern int klist_node_attached(struct klist_node * n); | |
14813 | ||
14814 | ||
14815 | struct klist_iter { | |
14816 | struct klist * i_klist; | |
14817 | struct list_head * i_head; | |
14818 | struct klist_node * i_cur; | |
14819 | }; | |
14820 | ||
14821 | ||
14822 | extern void klist_iter_init(struct klist * k, struct klist_iter * i); | |
14823 | extern void klist_iter_init_node(struct klist * k, struct klist_iter * i, | |
14824 | struct klist_node * n); | |
14825 | extern void klist_iter_exit(struct klist_iter * i); | |
14826 | extern struct klist_node * klist_next(struct klist_iter * i); | |
14827 | # 17 "include/linux/device.h" 2 | |
14828 | # 31 "include/linux/device.h" | |
14829 | struct device; | |
14830 | struct device_driver; | |
14831 | struct class; | |
14832 | struct class_device; | |
14833 | ||
14834 | struct bus_type { | |
14835 | const char * name; | |
14836 | ||
14837 | struct subsystem subsys; | |
14838 | struct kset drivers; | |
14839 | struct kset devices; | |
14840 | struct klist klist_devices; | |
14841 | struct klist klist_drivers; | |
14842 | ||
14843 | struct bus_attribute * bus_attrs; | |
14844 | struct device_attribute * dev_attrs; | |
14845 | struct driver_attribute * drv_attrs; | |
14846 | ||
14847 | int (*match)(struct device * dev, struct device_driver * drv); | |
14848 | int (*uevent)(struct device *dev, char **envp, | |
14849 | int num_envp, char *buffer, int buffer_size); | |
14850 | int (*probe)(struct device * dev); | |
14851 | int (*remove)(struct device * dev); | |
14852 | void (*shutdown)(struct device * dev); | |
14853 | ||
14854 | int (*suspend)(struct device * dev, pm_message_t state); | |
14855 | int (*suspend_late)(struct device * dev, pm_message_t state); | |
14856 | int (*resume_early)(struct device * dev); | |
14857 | int (*resume)(struct device * dev); | |
14858 | }; | |
14859 | ||
14860 | extern int __attribute__((warn_unused_result)) bus_register(struct bus_type * bus); | |
14861 | extern void bus_unregister(struct bus_type * bus); | |
14862 | ||
14863 | extern int __attribute__((warn_unused_result)) bus_rescan_devices(struct bus_type * bus); | |
14864 | ||
14865 | ||
14866 | ||
14867 | int bus_for_each_dev(struct bus_type * bus, struct device * start, void * data, | |
14868 | int (*fn)(struct device *, void *)); | |
14869 | struct device * bus_find_device(struct bus_type *bus, struct device *start, | |
14870 | void *data, int (*match)(struct device *, void *)); | |
14871 | ||
14872 | int __attribute__((warn_unused_result)) bus_for_each_drv(struct bus_type *bus, | |
14873 | struct device_driver *start, void *data, | |
14874 | int (*fn)(struct device_driver *, void *)); | |
14875 | ||
14876 | ||
14877 | ||
14878 | struct bus_attribute { | |
14879 | struct attribute attr; | |
14880 | ssize_t (*show)(struct bus_type *, char * buf); | |
14881 | ssize_t (*store)(struct bus_type *, const char * buf, size_t count); | |
14882 | }; | |
14883 | ||
14884 | ||
14885 | ||
14886 | ||
14887 | extern int __attribute__((warn_unused_result)) bus_create_file(struct bus_type *, | |
14888 | struct bus_attribute *); | |
14889 | extern void bus_remove_file(struct bus_type *, struct bus_attribute *); | |
14890 | ||
14891 | struct device_driver { | |
14892 | const char * name; | |
14893 | struct bus_type * bus; | |
14894 | ||
14895 | struct completion unloaded; | |
14896 | struct kobject kobj; | |
14897 | struct klist klist_devices; | |
14898 | struct klist_node knode_bus; | |
14899 | ||
14900 | struct module * owner; | |
14901 | ||
14902 | int (*probe) (struct device * dev); | |
14903 | int (*remove) (struct device * dev); | |
14904 | void (*shutdown) (struct device * dev); | |
14905 | int (*suspend) (struct device * dev, pm_message_t state); | |
14906 | int (*resume) (struct device * dev); | |
14907 | ||
14908 | unsigned int multithread_probe:1; | |
14909 | }; | |
14910 | ||
14911 | ||
14912 | extern int __attribute__((warn_unused_result)) driver_register(struct device_driver * drv); | |
14913 | extern void driver_unregister(struct device_driver * drv); | |
14914 | ||
14915 | extern struct device_driver * get_driver(struct device_driver * drv); | |
14916 | extern void put_driver(struct device_driver * drv); | |
14917 | extern struct device_driver *driver_find(const char *name, struct bus_type *bus); | |
14918 | extern int driver_probe_done(void); | |
14919 | ||
14920 | ||
14921 | ||
14922 | struct driver_attribute { | |
14923 | struct attribute attr; | |
14924 | ssize_t (*show)(struct device_driver *, char * buf); | |
14925 | ssize_t (*store)(struct device_driver *, const char * buf, size_t count); | |
14926 | }; | |
14927 | ||
14928 | ||
14929 | ||
14930 | ||
14931 | extern int __attribute__((warn_unused_result)) driver_create_file(struct device_driver *, | |
14932 | struct driver_attribute *); | |
14933 | extern void driver_remove_file(struct device_driver *, struct driver_attribute *); | |
14934 | ||
14935 | extern int __attribute__((warn_unused_result)) driver_for_each_device(struct device_driver * drv, | |
14936 | struct device *start, void *data, | |
14937 | int (*fn)(struct device *, void *)); | |
14938 | struct device * driver_find_device(struct device_driver *drv, | |
14939 | struct device *start, void *data, | |
14940 | int (*match)(struct device *, void *)); | |
14941 | ||
14942 | ||
14943 | ||
14944 | ||
14945 | struct class { | |
14946 | const char * name; | |
14947 | struct module * owner; | |
14948 | ||
14949 | struct subsystem subsys; | |
14950 | struct list_head children; | |
14951 | struct list_head devices; | |
14952 | struct list_head interfaces; | |
14953 | struct semaphore sem; | |
14954 | ||
14955 | struct kobject *virtual_dir; | |
14956 | ||
14957 | struct class_attribute * class_attrs; | |
14958 | struct class_device_attribute * class_dev_attrs; | |
14959 | struct device_attribute * dev_attrs; | |
14960 | ||
14961 | int (*uevent)(struct class_device *dev, char **envp, | |
14962 | int num_envp, char *buffer, int buffer_size); | |
14963 | int (*dev_uevent)(struct device *dev, char **envp, int num_envp, | |
14964 | char *buffer, int buffer_size); | |
14965 | ||
14966 | void (*release)(struct class_device *dev); | |
14967 | void (*class_release)(struct class *class); | |
14968 | void (*dev_release)(struct device *dev); | |
14969 | ||
14970 | int (*suspend)(struct device *, pm_message_t state); | |
14971 | int (*resume)(struct device *); | |
14972 | }; | |
14973 | ||
14974 | extern int __attribute__((warn_unused_result)) class_register(struct class *); | |
14975 | extern void class_unregister(struct class *); | |
14976 | ||
14977 | ||
14978 | struct class_attribute { | |
14979 | struct attribute attr; | |
14980 | ssize_t (*show)(struct class *, char * buf); | |
14981 | ssize_t (*store)(struct class *, const char * buf, size_t count); | |
14982 | }; | |
14983 | ||
14984 | ||
14985 | ||
14986 | ||
14987 | extern int __attribute__((warn_unused_result)) class_create_file(struct class *, | |
14988 | const struct class_attribute *); | |
14989 | extern void class_remove_file(struct class *, const struct class_attribute *); | |
14990 | ||
14991 | struct class_device_attribute { | |
14992 | struct attribute attr; | |
14993 | ssize_t (*show)(struct class_device *, char * buf); | |
14994 | ssize_t (*store)(struct class_device *, const char * buf, size_t count); | |
14995 | }; | |
14996 | ||
14997 | ||
14998 | ||
14999 | ||
15000 | ||
15001 | extern int __attribute__((warn_unused_result)) class_device_create_file(struct class_device *, | |
15002 | const struct class_device_attribute *); | |
15003 | # 231 "include/linux/device.h" | |
15004 | struct class_device { | |
15005 | struct list_head node; | |
15006 | ||
15007 | struct kobject kobj; | |
15008 | struct class * class; | |
15009 | dev_t devt; | |
15010 | struct class_device_attribute *devt_attr; | |
15011 | struct class_device_attribute uevent_attr; | |
15012 | struct device * dev; | |
15013 | void * class_data; | |
15014 | struct class_device *parent; | |
15015 | struct attribute_group ** groups; | |
15016 | ||
15017 | void (*release)(struct class_device *dev); | |
15018 | int (*uevent)(struct class_device *dev, char **envp, | |
15019 | int num_envp, char *buffer, int buffer_size); | |
15020 | char class_id[20]; | |
15021 | }; | |
15022 | ||
15023 | static inline __attribute__((always_inline)) void * | |
15024 | class_get_devdata (struct class_device *dev) | |
15025 | { | |
15026 | return dev->class_data; | |
15027 | } | |
15028 | ||
15029 | static inline __attribute__((always_inline)) void | |
15030 | class_set_devdata (struct class_device *dev, void *data) | |
15031 | { | |
15032 | dev->class_data = data; | |
15033 | } | |
15034 | ||
15035 | ||
15036 | extern int __attribute__((warn_unused_result)) class_device_register(struct class_device *); | |
15037 | extern void class_device_unregister(struct class_device *); | |
15038 | extern void class_device_initialize(struct class_device *); | |
15039 | extern int __attribute__((warn_unused_result)) class_device_add(struct class_device *); | |
15040 | extern void class_device_del(struct class_device *); | |
15041 | ||
15042 | extern int class_device_rename(struct class_device *, char *); | |
15043 | ||
15044 | extern struct class_device * class_device_get(struct class_device *); | |
15045 | extern void class_device_put(struct class_device *); | |
15046 | ||
15047 | extern void class_device_remove_file(struct class_device *, | |
15048 | const struct class_device_attribute *); | |
15049 | extern int __attribute__((warn_unused_result)) class_device_create_bin_file(struct class_device *, | |
15050 | struct bin_attribute *); | |
15051 | extern void class_device_remove_bin_file(struct class_device *, | |
15052 | struct bin_attribute *); | |
15053 | ||
15054 | struct class_interface { | |
15055 | struct list_head node; | |
15056 | struct class *class; | |
15057 | ||
15058 | int (*add) (struct class_device *, struct class_interface *); | |
15059 | void (*remove) (struct class_device *, struct class_interface *); | |
15060 | int (*add_dev) (struct device *, struct class_interface *); | |
15061 | void (*remove_dev) (struct device *, struct class_interface *); | |
15062 | }; | |
15063 | ||
15064 | extern int __attribute__((warn_unused_result)) class_interface_register(struct class_interface *); | |
15065 | extern void class_interface_unregister(struct class_interface *); | |
15066 | ||
15067 | extern struct class *class_create(struct module *owner, const char *name); | |
15068 | extern void class_destroy(struct class *cls); | |
15069 | extern struct class_device *class_device_create(struct class *cls, | |
15070 | struct class_device *parent, | |
15071 | dev_t devt, | |
15072 | struct device *device, | |
15073 | const char *fmt, ...) | |
15074 | __attribute__((format(printf,5,6))); | |
15075 | extern void class_device_destroy(struct class *cls, dev_t devt); | |
15076 | ||
15077 | ||
15078 | struct device_attribute { | |
15079 | struct attribute attr; | |
15080 | ssize_t (*show)(struct device *dev, struct device_attribute *attr, | |
15081 | char *buf); | |
15082 | ssize_t (*store)(struct device *dev, struct device_attribute *attr, | |
15083 | const char *buf, size_t count); | |
15084 | }; | |
15085 | ||
15086 | ||
15087 | ||
15088 | ||
15089 | extern int __attribute__((warn_unused_result)) device_create_file(struct device *device, | |
15090 | struct device_attribute * entry); | |
15091 | extern void device_remove_file(struct device * dev, struct device_attribute * attr); | |
15092 | extern int __attribute__((warn_unused_result)) device_create_bin_file(struct device *dev, | |
15093 | struct bin_attribute *attr); | |
15094 | extern void device_remove_bin_file(struct device *dev, | |
15095 | struct bin_attribute *attr); | |
15096 | struct device { | |
15097 | struct klist klist_children; | |
15098 | struct klist_node knode_parent; | |
15099 | struct klist_node knode_driver; | |
15100 | struct klist_node knode_bus; | |
15101 | struct device * parent; | |
15102 | ||
15103 | struct kobject kobj; | |
15104 | char bus_id[20]; | |
15105 | unsigned is_registered:1; | |
15106 | struct device_attribute uevent_attr; | |
15107 | struct device_attribute *devt_attr; | |
15108 | ||
15109 | struct semaphore sem; | |
15110 | ||
15111 | ||
15112 | ||
15113 | struct bus_type * bus; | |
15114 | struct device_driver *driver; | |
15115 | ||
15116 | void *driver_data; | |
15117 | void *platform_data; | |
15118 | ||
15119 | void *firmware_data; | |
15120 | ||
15121 | struct dev_pm_info power; | |
15122 | ||
15123 | u64 *dma_mask; | |
15124 | u64 coherent_dma_mask; | |
15125 | ||
15126 | ||
15127 | ||
15128 | ||
15129 | ||
15130 | struct list_head dma_pools; | |
15131 | ||
15132 | struct dma_coherent_mem *dma_mem; | |
15133 | ||
15134 | ||
15135 | ||
15136 | struct list_head node; | |
15137 | struct class *class; | |
15138 | dev_t devt; | |
15139 | struct attribute_group **groups; | |
15140 | ||
15141 | void (*release)(struct device * dev); | |
15142 | }; | |
15143 | ||
15144 | static inline __attribute__((always_inline)) void * | |
15145 | dev_get_drvdata (struct device *dev) | |
15146 | { | |
15147 | return dev->driver_data; | |
15148 | } | |
15149 | ||
15150 | static inline __attribute__((always_inline)) void | |
15151 | dev_set_drvdata (struct device *dev, void *data) | |
15152 | { | |
15153 | dev->driver_data = data; | |
15154 | } | |
15155 | ||
15156 | static inline __attribute__((always_inline)) int device_is_registered(struct device *dev) | |
15157 | { | |
15158 | return dev->is_registered; | |
15159 | } | |
15160 | ||
15161 | ||
15162 | ||
15163 | ||
15164 | extern int __attribute__((warn_unused_result)) device_register(struct device * dev); | |
15165 | extern void device_unregister(struct device * dev); | |
15166 | extern void device_initialize(struct device * dev); | |
15167 | extern int __attribute__((warn_unused_result)) device_add(struct device * dev); | |
15168 | extern void device_del(struct device * dev); | |
15169 | extern int device_for_each_child(struct device *, void *, | |
15170 | int (*fn)(struct device *, void *)); | |
15171 | extern int device_rename(struct device *dev, char *new_name); | |
15172 | ||
15173 | ||
15174 | ||
15175 | ||
15176 | ||
15177 | extern int __attribute__((warn_unused_result)) device_bind_driver(struct device *dev); | |
15178 | extern void device_release_driver(struct device * dev); | |
15179 | extern int __attribute__((warn_unused_result)) device_attach(struct device * dev); | |
15180 | extern int __attribute__((warn_unused_result)) driver_attach(struct device_driver *drv); | |
15181 | extern int __attribute__((warn_unused_result)) device_reprobe(struct device *dev); | |
15182 | ||
15183 | ||
15184 | ||
15185 | ||
15186 | extern struct device *device_create(struct class *cls, struct device *parent, | |
15187 | dev_t devt, const char *fmt, ...) | |
15188 | __attribute__((format(printf,4,5))); | |
15189 | extern void device_destroy(struct class *cls, dev_t devt); | |
15190 | ||
15191 | extern int virtual_device_parent(struct device *dev); | |
15192 | ||
15193 | ||
15194 | ||
15195 | ||
15196 | ||
15197 | ||
15198 | ||
15199 | extern int (*platform_notify)(struct device * dev); | |
15200 | ||
15201 | extern int (*platform_notify_remove)(struct device * dev); | |
15202 | ||
15203 | ||
15204 | ||
15205 | ||
15206 | ||
15207 | ||
15208 | extern struct device * get_device(struct device * dev); | |
15209 | extern void put_device(struct device * dev); | |
15210 | ||
15211 | ||
15212 | ||
15213 | extern void device_shutdown(void); | |
15214 | ||
15215 | ||
15216 | ||
15217 | extern int __attribute__((warn_unused_result)) firmware_register(struct subsystem *); | |
15218 | extern void firmware_unregister(struct subsystem *); | |
15219 | ||
15220 | ||
15221 | extern const char *dev_driver_string(struct device *dev); | |
15222 | # 38 "include/linux/netdevice.h" 2 | |
15223 | ||
15224 | ||
15225 | ||
15226 | struct divert_blk; | |
15227 | struct vlan_group; | |
15228 | struct ethtool_ops; | |
15229 | struct netpoll_info; | |
15230 | # 110 "include/linux/netdevice.h" | |
15231 | struct net_device_stats | |
15232 | { | |
15233 | unsigned long rx_packets; | |
15234 | unsigned long tx_packets; | |
15235 | unsigned long rx_bytes; | |
15236 | unsigned long tx_bytes; | |
15237 | unsigned long rx_errors; | |
15238 | unsigned long tx_errors; | |
15239 | unsigned long rx_dropped; | |
15240 | unsigned long tx_dropped; | |
15241 | unsigned long multicast; | |
15242 | unsigned long collisions; | |
15243 | ||
15244 | ||
15245 | unsigned long rx_length_errors; | |
15246 | unsigned long rx_over_errors; | |
15247 | unsigned long rx_crc_errors; | |
15248 | unsigned long rx_frame_errors; | |
15249 | unsigned long rx_fifo_errors; | |
15250 | unsigned long rx_missed_errors; | |
15251 | ||
15252 | ||
15253 | unsigned long tx_aborted_errors; | |
15254 | unsigned long tx_carrier_errors; | |
15255 | unsigned long tx_fifo_errors; | |
15256 | unsigned long tx_heartbeat_errors; | |
15257 | unsigned long tx_window_errors; | |
15258 | ||
15259 | ||
15260 | unsigned long rx_compressed; | |
15261 | unsigned long tx_compressed; | |
15262 | }; | |
15263 | ||
15264 | ||
15265 | ||
15266 | enum { | |
15267 | IF_PORT_UNKNOWN = 0, | |
15268 | IF_PORT_10BASE2, | |
15269 | IF_PORT_10BASET, | |
15270 | IF_PORT_AUI, | |
15271 | IF_PORT_100BASET, | |
15272 | IF_PORT_100BASETX, | |
15273 | IF_PORT_100BASEFX | |
15274 | }; | |
15275 | ||
15276 | ||
15277 | ||
15278 | ||
15279 | ||
15280 | ||
15281 | struct neighbour; | |
15282 | struct neigh_parms; | |
15283 | struct sk_buff; | |
15284 | ||
15285 | struct netif_rx_stats | |
15286 | { | |
15287 | unsigned total; | |
15288 | unsigned dropped; | |
15289 | unsigned time_squeeze; | |
15290 | unsigned cpu_collision; | |
15291 | }; | |
15292 | ||
15293 | extern __typeof__(struct netif_rx_stats) per_cpu__netdev_rx_stat; | |
15294 | ||
15295 | ||
15296 | ||
15297 | ||
15298 | ||
15299 | ||
15300 | struct dev_mc_list | |
15301 | { | |
15302 | struct dev_mc_list *next; | |
15303 | __u8 dmi_addr[32]; | |
15304 | unsigned char dmi_addrlen; | |
15305 | int dmi_users; | |
15306 | int dmi_gusers; | |
15307 | }; | |
15308 | ||
15309 | struct hh_cache | |
15310 | { | |
15311 | struct hh_cache *hh_next; | |
15312 | atomic_t hh_refcnt; | |
15313 | __be16 hh_type; | |
15314 | ||
15315 | ||
15316 | ||
15317 | int hh_len; | |
15318 | int (*hh_output)(struct sk_buff *skb); | |
15319 | rwlock_t hh_lock; | |
15320 | ||
15321 | ||
15322 | ||
15323 | ||
15324 | ||
15325 | ||
15326 | ||
15327 | unsigned long hh_data[(((32)+(16 -1))&~(16 - 1)) / sizeof(long)]; | |
15328 | }; | |
15329 | # 227 "include/linux/netdevice.h" | |
15330 | enum netdev_state_t | |
15331 | { | |
15332 | __LINK_STATE_XOFF=0, | |
15333 | __LINK_STATE_START, | |
15334 | __LINK_STATE_PRESENT, | |
15335 | __LINK_STATE_SCHED, | |
15336 | __LINK_STATE_NOCARRIER, | |
15337 | __LINK_STATE_RX_SCHED, | |
15338 | __LINK_STATE_LINKWATCH_PENDING, | |
15339 | __LINK_STATE_DORMANT, | |
15340 | __LINK_STATE_QDISC_RUNNING, | |
15341 | }; | |
15342 | ||
15343 | ||
15344 | ||
15345 | ||
15346 | ||
15347 | ||
15348 | struct netdev_boot_setup { | |
15349 | char name[16]; | |
15350 | struct ifmap map; | |
15351 | }; | |
15352 | ||
15353 | ||
15354 | extern int __attribute__ ((__section__ (".init.text"))) netdev_boot_setup(char *str); | |
15355 | # 263 "include/linux/netdevice.h" | |
15356 | struct net_device | |
15357 | { | |
15358 | ||
15359 | ||
15360 | ||
15361 | ||
15362 | ||
15363 | ||
15364 | char name[16]; | |
15365 | ||
15366 | struct hlist_node name_hlist; | |
15367 | ||
15368 | ||
15369 | ||
15370 | ||
15371 | ||
15372 | unsigned long mem_end; | |
15373 | unsigned long mem_start; | |
15374 | unsigned long base_addr; | |
15375 | unsigned int irq; | |
15376 | ||
15377 | ||
15378 | ||
15379 | ||
15380 | ||
15381 | ||
15382 | unsigned char if_port; | |
15383 | unsigned char dma; | |
15384 | ||
15385 | unsigned long state; | |
15386 | ||
15387 | struct net_device *next; | |
15388 | ||
15389 | ||
15390 | int (*init)(struct net_device *dev); | |
15391 | ||
15392 | ||
15393 | ||
15394 | ||
15395 | unsigned long features; | |
15396 | # 331 "include/linux/netdevice.h" | |
15397 | struct net_device *next_sched; | |
15398 | ||
15399 | ||
15400 | int ifindex; | |
15401 | int iflink; | |
15402 | ||
15403 | ||
15404 | struct net_device_stats* (*get_stats)(struct net_device *dev); | |
15405 | ||
15406 | ||
15407 | ||
15408 | const struct iw_handler_def * wireless_handlers; | |
15409 | ||
15410 | struct iw_public_data * wireless_data; | |
15411 | ||
15412 | const struct ethtool_ops *ethtool_ops; | |
15413 | # 355 "include/linux/netdevice.h" | |
15414 | unsigned int flags; | |
15415 | unsigned short gflags; | |
15416 | unsigned short priv_flags; | |
15417 | unsigned short padded; | |
15418 | ||
15419 | unsigned char operstate; | |
15420 | unsigned char link_mode; | |
15421 | ||
15422 | unsigned mtu; | |
15423 | unsigned short type; | |
15424 | unsigned short hard_header_len; | |
15425 | ||
15426 | struct net_device *master; | |
15427 | ||
15428 | ||
15429 | ||
15430 | ||
15431 | unsigned char perm_addr[32]; | |
15432 | unsigned char addr_len; | |
15433 | unsigned short dev_id; | |
15434 | ||
15435 | struct dev_mc_list *mc_list; | |
15436 | int mc_count; | |
15437 | int promiscuity; | |
15438 | int allmulti; | |
15439 | ||
15440 | ||
15441 | ||
15442 | ||
15443 | void *atalk_ptr; | |
15444 | void *ip_ptr; | |
15445 | void *dn_ptr; | |
15446 | void *ip6_ptr; | |
15447 | void *ec_ptr; | |
15448 | void *ax25_ptr; | |
15449 | ||
15450 | ||
15451 | ||
15452 | ||
15453 | struct list_head poll_list ; | |
15454 | ||
15455 | ||
15456 | int (*poll) (struct net_device *dev, int *quota); | |
15457 | int quota; | |
15458 | int weight; | |
15459 | unsigned long last_rx; | |
15460 | ||
15461 | unsigned char dev_addr[32]; | |
15462 | ||
15463 | ||
15464 | unsigned char broadcast[32]; | |
15465 | ||
15466 | ||
15467 | ||
15468 | ||
15469 | ||
15470 | spinlock_t queue_lock ; | |
15471 | struct Qdisc *qdisc; | |
15472 | struct Qdisc *qdisc_sleeping; | |
15473 | struct list_head qdisc_list; | |
15474 | unsigned long tx_queue_len; | |
15475 | ||
15476 | ||
15477 | struct sk_buff *gso_skb; | |
15478 | ||
15479 | ||
15480 | spinlock_t ingress_lock; | |
15481 | struct Qdisc *qdisc_ingress; | |
15482 | ||
15483 | ||
15484 | ||
15485 | ||
15486 | ||
15487 | spinlock_t _xmit_lock ; | |
15488 | ||
15489 | ||
15490 | ||
15491 | int xmit_lock_owner; | |
15492 | void *priv; | |
15493 | int (*hard_start_xmit) (struct sk_buff *skb, | |
15494 | struct net_device *dev); | |
15495 | ||
15496 | unsigned long trans_start; | |
15497 | ||
15498 | int watchdog_timeo; | |
15499 | struct timer_list watchdog_timer; | |
15500 | ||
15501 | ||
15502 | ||
15503 | ||
15504 | ||
15505 | atomic_t refcnt ; | |
15506 | ||
15507 | ||
15508 | struct list_head todo_list; | |
15509 | ||
15510 | struct hlist_node index_hlist; | |
15511 | ||
15512 | ||
15513 | enum { NETREG_UNINITIALIZED=0, | |
15514 | NETREG_REGISTERED, | |
15515 | NETREG_UNREGISTERING, | |
15516 | NETREG_UNREGISTERED, | |
15517 | NETREG_RELEASED, | |
15518 | } reg_state; | |
15519 | ||
15520 | ||
15521 | void (*uninit)(struct net_device *dev); | |
15522 | ||
15523 | void (*destructor)(struct net_device *dev); | |
15524 | ||
15525 | ||
15526 | int (*open)(struct net_device *dev); | |
15527 | int (*stop)(struct net_device *dev); | |
15528 | ||
15529 | int (*hard_header) (struct sk_buff *skb, | |
15530 | struct net_device *dev, | |
15531 | unsigned short type, | |
15532 | void *daddr, | |
15533 | void *saddr, | |
15534 | unsigned len); | |
15535 | int (*rebuild_header)(struct sk_buff *skb); | |
15536 | ||
15537 | void (*set_multicast_list)(struct net_device *dev); | |
15538 | ||
15539 | int (*set_mac_address)(struct net_device *dev, | |
15540 | void *addr); | |
15541 | ||
15542 | int (*do_ioctl)(struct net_device *dev, | |
15543 | struct ifreq *ifr, int cmd); | |
15544 | ||
15545 | int (*set_config)(struct net_device *dev, | |
15546 | struct ifmap *map); | |
15547 | ||
15548 | int (*hard_header_cache)(struct neighbour *neigh, | |
15549 | struct hh_cache *hh); | |
15550 | void (*header_cache_update)(struct hh_cache *hh, | |
15551 | struct net_device *dev, | |
15552 | unsigned char * haddr); | |
15553 | ||
15554 | int (*change_mtu)(struct net_device *dev, int new_mtu); | |
15555 | ||
15556 | ||
15557 | void (*tx_timeout) (struct net_device *dev); | |
15558 | ||
15559 | void (*vlan_rx_register)(struct net_device *dev, | |
15560 | struct vlan_group *grp); | |
15561 | void (*vlan_rx_add_vid)(struct net_device *dev, | |
15562 | unsigned short vid); | |
15563 | void (*vlan_rx_kill_vid)(struct net_device *dev, | |
15564 | unsigned short vid); | |
15565 | ||
15566 | int (*hard_header_parse)(struct sk_buff *skb, | |
15567 | unsigned char *haddr); | |
15568 | int (*neigh_setup)(struct net_device *dev, struct neigh_parms *); | |
15569 | ||
15570 | struct netpoll_info *npinfo; | |
15571 | ||
15572 | ||
15573 | void (*poll_controller)(struct net_device *dev); | |
15574 | ||
15575 | ||
15576 | ||
15577 | struct net_bridge_port *br_port; | |
15578 | ||
15579 | ||
15580 | ||
15581 | ||
15582 | ||
15583 | ||
15584 | ||
15585 | struct class_device class_dev; | |
15586 | ||
15587 | struct attribute_group *sysfs_groups[3]; | |
15588 | }; | |
15589 | ||
15590 | ||
15591 | ||
15592 | ||
15593 | static inline __attribute__((always_inline)) void *netdev_priv(struct net_device *dev) | |
15594 | { | |
15595 | return (char *)dev + ((sizeof(struct net_device) | |
15596 | + (32 - 1)) | |
15597 | & ~(32 - 1)); | |
15598 | } | |
15599 | ||
15600 | ||
15601 | ||
15602 | ||
15603 | ||
15604 | ||
15605 | ||
15606 | struct packet_type { | |
15607 | __be16 type; | |
15608 | struct net_device *dev; | |
15609 | int (*func) (struct sk_buff *, | |
15610 | struct net_device *, | |
15611 | struct packet_type *, | |
15612 | struct net_device *); | |
15613 | struct sk_buff *(*gso_segment)(struct sk_buff *skb, | |
15614 | int features); | |
15615 | int (*gso_send_check)(struct sk_buff *skb); | |
15616 | void *af_packet_priv; | |
15617 | struct list_head list; | |
15618 | }; | |
15619 | ||
15620 | # 1 "include/linux/interrupt.h" 1 | |
15621 | # 10 "include/linux/interrupt.h" | |
15622 | # 1 "include/linux/irqreturn.h" 1 | |
15623 | # 19 "include/linux/irqreturn.h" | |
15624 | typedef int irqreturn_t; | |
15625 | # 11 "include/linux/interrupt.h" 2 | |
15626 | ||
15627 | ||
15628 | # 1 "include/linux/irqflags.h" 1 | |
15629 | # 14 "include/linux/interrupt.h" 2 | |
15630 | # 1 "include/linux/bottom_half.h" 1 | |
15631 | extern void local_bh_disable(void); | |
15632 | extern void __local_bh_enable(void); | |
15633 | extern void _local_bh_enable(void); | |
15634 | extern void local_bh_enable(void); | |
15635 | extern void local_bh_enable_ip(unsigned long ip); | |
15636 | # 15 "include/linux/interrupt.h" 2 | |
15637 | # 68 "include/linux/interrupt.h" | |
15638 | typedef irqreturn_t (*irq_handler_t)(int, void *); | |
15639 | ||
15640 | struct irqaction { | |
15641 | irq_handler_t handler; | |
15642 | unsigned long flags; | |
15643 | cpumask_t mask; | |
15644 | const char *name; | |
15645 | void *dev_id; | |
15646 | struct irqaction *next; | |
15647 | int irq; | |
15648 | struct proc_dir_entry *dir; | |
15649 | }; | |
15650 | ||
15651 | extern irqreturn_t no_action(int cpl, void *dev_id); | |
15652 | extern int request_irq(unsigned int, irq_handler_t handler, | |
15653 | unsigned long, const char *, void *); | |
15654 | extern void free_irq(unsigned int, void *); | |
15655 | # 105 "include/linux/interrupt.h" | |
15656 | extern void disable_irq_nosync(unsigned int irq); | |
15657 | extern void disable_irq(unsigned int irq); | |
15658 | extern void enable_irq(unsigned int irq); | |
15659 | # 120 "include/linux/interrupt.h" | |
15660 | static inline __attribute__((always_inline)) void disable_irq_nosync_lockdep(unsigned int irq) | |
15661 | { | |
15662 | disable_irq_nosync(irq); | |
15663 | ||
15664 | ||
15665 | ||
15666 | } | |
15667 | ||
15668 | static inline __attribute__((always_inline)) void disable_irq_nosync_lockdep_irqsave(unsigned int irq, unsigned long *flags) | |
15669 | { | |
15670 | disable_irq_nosync(irq); | |
15671 | ||
15672 | ||
15673 | ||
15674 | } | |
15675 | ||
15676 | static inline __attribute__((always_inline)) void disable_irq_lockdep(unsigned int irq) | |
15677 | { | |
15678 | disable_irq(irq); | |
15679 | ||
15680 | ||
15681 | ||
15682 | } | |
15683 | ||
15684 | static inline __attribute__((always_inline)) void enable_irq_lockdep(unsigned int irq) | |
15685 | { | |
15686 | ||
15687 | ||
15688 | ||
15689 | enable_irq(irq); | |
15690 | } | |
15691 | ||
15692 | static inline __attribute__((always_inline)) void enable_irq_lockdep_irqrestore(unsigned int irq, unsigned long *flags) | |
15693 | { | |
15694 | ||
15695 | ||
15696 | ||
15697 | enable_irq(irq); | |
15698 | } | |
15699 | ||
15700 | ||
15701 | extern int set_irq_wake(unsigned int irq, unsigned int on); | |
15702 | ||
15703 | static inline __attribute__((always_inline)) int enable_irq_wake(unsigned int irq) | |
15704 | { | |
15705 | return set_irq_wake(irq, 1); | |
15706 | } | |
15707 | ||
15708 | static inline __attribute__((always_inline)) int disable_irq_wake(unsigned int irq) | |
15709 | { | |
15710 | return set_irq_wake(irq, 0); | |
15711 | } | |
15712 | # 196 "include/linux/interrupt.h" | |
15713 | static inline __attribute__((always_inline)) void __attribute__((deprecated)) cli(void) | |
15714 | { | |
15715 | do { int _tmp_dummy; __asm__ __volatile__ ( "cli %0;" :"=d" (_tmp_dummy):); } while (0); | |
15716 | } | |
15717 | static inline __attribute__((always_inline)) void __attribute__((deprecated)) sti(void) | |
15718 | { | |
15719 | do { __asm__ __volatile__ ( "sti %0;" ::"d"(irq_flags)); } while (0); | |
15720 | } | |
15721 | static inline __attribute__((always_inline)) void __attribute__((deprecated)) save_flags(unsigned long *x) | |
15722 | { | |
15723 | asm volatile ("cli %0;" "sti %0;" :"=d"(*x):);; | |
15724 | } | |
15725 | ||
15726 | static inline __attribute__((always_inline)) void __attribute__((deprecated)) restore_flags(unsigned long x) | |
15727 | { | |
15728 | do { if (((x) != 0x1f)) do { __asm__ __volatile__ ( "sti %0;" ::"d"(irq_flags)); } while (0); } while (0); | |
15729 | } | |
15730 | ||
15731 | static inline __attribute__((always_inline)) void __attribute__((deprecated)) save_and_cli(unsigned long *x) | |
15732 | { | |
15733 | do { __asm__ __volatile__ ( "cli %0;" :"=&d"(*x):); } while (0); | |
15734 | } | |
15735 | # 227 "include/linux/interrupt.h" | |
15736 | enum | |
15737 | { | |
15738 | HI_SOFTIRQ=0, | |
15739 | TIMER_SOFTIRQ, | |
15740 | NET_TX_SOFTIRQ, | |
15741 | NET_RX_SOFTIRQ, | |
15742 | BLOCK_SOFTIRQ, | |
15743 | TASKLET_SOFTIRQ | |
15744 | }; | |
15745 | ||
15746 | ||
15747 | ||
15748 | ||
15749 | ||
15750 | struct softirq_action | |
15751 | { | |
15752 | void (*action)(struct softirq_action *); | |
15753 | void *data; | |
15754 | }; | |
15755 | ||
15756 | void do_softirq(void); | |
15757 | extern void open_softirq(int nr, void (*action)(struct softirq_action*), void *data); | |
15758 | extern void softirq_init(void); | |
15759 | ||
15760 | extern void raise_softirq_irqoff(unsigned int nr); | |
15761 | extern void raise_softirq(unsigned int nr); | |
15762 | # 275 "include/linux/interrupt.h" | |
15763 | struct tasklet_struct | |
15764 | { | |
15765 | struct tasklet_struct *next; | |
15766 | unsigned long state; | |
15767 | atomic_t count; | |
15768 | void (*func)(unsigned long); | |
15769 | unsigned long data; | |
15770 | }; | |
15771 | # 291 "include/linux/interrupt.h" | |
15772 | enum | |
15773 | { | |
15774 | TASKLET_STATE_SCHED, | |
15775 | TASKLET_STATE_RUN | |
15776 | }; | |
15777 | # 319 "include/linux/interrupt.h" | |
15778 | extern void __tasklet_schedule(struct tasklet_struct *t); | |
15779 | ||
15780 | static inline __attribute__((always_inline)) void tasklet_schedule(struct tasklet_struct *t) | |
15781 | { | |
15782 | if (!test_and_set_bit(TASKLET_STATE_SCHED, &t->state)) | |
15783 | __tasklet_schedule(t); | |
15784 | } | |
15785 | ||
15786 | extern void __tasklet_hi_schedule(struct tasklet_struct *t); | |
15787 | ||
15788 | static inline __attribute__((always_inline)) void tasklet_hi_schedule(struct tasklet_struct *t) | |
15789 | { | |
15790 | if (!test_and_set_bit(TASKLET_STATE_SCHED, &t->state)) | |
15791 | __tasklet_hi_schedule(t); | |
15792 | } | |
15793 | ||
15794 | ||
15795 | static inline __attribute__((always_inline)) void tasklet_disable_nosync(struct tasklet_struct *t) | |
15796 | { | |
15797 | atomic_inc(&t->count); | |
15798 | __asm__ __volatile__("": : :"memory"); | |
15799 | } | |
15800 | ||
15801 | static inline __attribute__((always_inline)) void tasklet_disable(struct tasklet_struct *t) | |
15802 | { | |
15803 | tasklet_disable_nosync(t); | |
15804 | do { } while (0); | |
15805 | __asm__ __volatile__("": : :"memory"); | |
15806 | } | |
15807 | ||
15808 | static inline __attribute__((always_inline)) void tasklet_enable(struct tasklet_struct *t) | |
15809 | { | |
15810 | __asm__ __volatile__("": : :"memory"); | |
15811 | atomic_dec(&t->count); | |
15812 | } | |
15813 | ||
15814 | static inline __attribute__((always_inline)) void tasklet_hi_enable(struct tasklet_struct *t) | |
15815 | { | |
15816 | __asm__ __volatile__("": : :"memory"); | |
15817 | atomic_dec(&t->count); | |
15818 | } | |
15819 | ||
15820 | extern void tasklet_kill(struct tasklet_struct *t); | |
15821 | extern void tasklet_kill_immediate(struct tasklet_struct *t, unsigned int cpu); | |
15822 | extern void tasklet_init(struct tasklet_struct *t, | |
15823 | void (*func)(unsigned long), unsigned long data); | |
15824 | # 408 "include/linux/interrupt.h" | |
15825 | extern unsigned long probe_irq_on(void); | |
15826 | extern int probe_irq_off(unsigned long); | |
15827 | extern unsigned int probe_irq_mask(unsigned long); | |
15828 | # 562 "include/linux/netdevice.h" 2 | |
15829 | ||
15830 | ||
15831 | extern struct net_device loopback_dev; | |
15832 | extern struct net_device *dev_base; | |
15833 | extern rwlock_t dev_base_lock; | |
15834 | ||
15835 | extern int netdev_boot_setup_check(struct net_device *dev); | |
15836 | extern unsigned long netdev_boot_base(const char *prefix, int unit); | |
15837 | extern struct net_device *dev_getbyhwaddr(unsigned short type, char *hwaddr); | |
15838 | extern struct net_device *dev_getfirstbyhwtype(unsigned short type); | |
15839 | extern void dev_add_pack(struct packet_type *pt); | |
15840 | extern void dev_remove_pack(struct packet_type *pt); | |
15841 | extern void __dev_remove_pack(struct packet_type *pt); | |
15842 | ||
15843 | extern struct net_device *dev_get_by_flags(unsigned short flags, | |
15844 | unsigned short mask); | |
15845 | extern struct net_device *dev_get_by_name(const char *name); | |
15846 | extern struct net_device *__dev_get_by_name(const char *name); | |
15847 | extern int dev_alloc_name(struct net_device *dev, const char *name); | |
15848 | extern int dev_open(struct net_device *dev); | |
15849 | extern int dev_close(struct net_device *dev); | |
15850 | extern int dev_queue_xmit(struct sk_buff *skb); | |
15851 | extern int register_netdevice(struct net_device *dev); | |
15852 | extern int unregister_netdevice(struct net_device *dev); | |
15853 | extern void free_netdev(struct net_device *dev); | |
15854 | extern void synchronize_net(void); | |
15855 | extern int register_netdevice_notifier(struct notifier_block *nb); | |
15856 | extern int unregister_netdevice_notifier(struct notifier_block *nb); | |
15857 | extern int call_netdevice_notifiers(unsigned long val, void *v); | |
15858 | extern struct net_device *dev_get_by_index(int ifindex); | |
15859 | extern struct net_device *__dev_get_by_index(int ifindex); | |
15860 | extern int dev_restart(struct net_device *dev); | |
15861 | ||
15862 | extern int netpoll_trap(void); | |
15863 | ||
15864 | ||
15865 | typedef int gifconf_func_t(struct net_device * dev, char * bufptr, int len); | |
15866 | extern int register_gifconf(unsigned int family, gifconf_func_t * gifconf); | |
15867 | static inline __attribute__((always_inline)) int unregister_gifconf(unsigned int family) | |
15868 | { | |
15869 | return register_gifconf(family, ((void *)0)); | |
15870 | } | |
15871 | ||
15872 | ||
15873 | ||
15874 | ||
15875 | ||
15876 | ||
15877 | struct softnet_data | |
15878 | { | |
15879 | struct net_device *output_queue; | |
15880 | struct sk_buff_head input_pkt_queue; | |
15881 | struct list_head poll_list; | |
15882 | struct sk_buff *completion_queue; | |
15883 | ||
15884 | struct net_device backlog_dev; | |
15885 | ||
15886 | ||
15887 | ||
15888 | }; | |
15889 | ||
15890 | extern __typeof__(struct softnet_data) per_cpu__softnet_data; | |
15891 | ||
15892 | ||
15893 | ||
15894 | extern void __netif_schedule(struct net_device *dev); | |
15895 | ||
15896 | static inline __attribute__((always_inline)) void netif_schedule(struct net_device *dev) | |
15897 | { | |
15898 | if (!(__builtin_constant_p(__LINK_STATE_XOFF) ? __constant_test_bit((__LINK_STATE_XOFF),(&dev->state)) : __test_bit((__LINK_STATE_XOFF),(&dev->state)))) | |
15899 | __netif_schedule(dev); | |
15900 | } | |
15901 | ||
15902 | static inline __attribute__((always_inline)) void netif_start_queue(struct net_device *dev) | |
15903 | { | |
15904 | clear_bit(__LINK_STATE_XOFF, &dev->state); | |
15905 | } | |
15906 | ||
15907 | static inline __attribute__((always_inline)) void netif_wake_queue(struct net_device *dev) | |
15908 | { | |
15909 | ||
15910 | if (netpoll_trap()) | |
15911 | return; | |
15912 | ||
15913 | if (test_and_clear_bit(__LINK_STATE_XOFF, &dev->state)) | |
15914 | __netif_schedule(dev); | |
15915 | } | |
15916 | ||
15917 | static inline __attribute__((always_inline)) void netif_stop_queue(struct net_device *dev) | |
15918 | { | |
15919 | ||
15920 | if (netpoll_trap()) | |
15921 | return; | |
15922 | ||
15923 | set_bit(__LINK_STATE_XOFF, &dev->state); | |
15924 | } | |
15925 | ||
15926 | static inline __attribute__((always_inline)) int netif_queue_stopped(const struct net_device *dev) | |
15927 | { | |
15928 | return (__builtin_constant_p(__LINK_STATE_XOFF) ? __constant_test_bit((__LINK_STATE_XOFF),(&dev->state)) : __test_bit((__LINK_STATE_XOFF),(&dev->state))); | |
15929 | } | |
15930 | ||
15931 | static inline __attribute__((always_inline)) int netif_running(const struct net_device *dev) | |
15932 | { | |
15933 | return (__builtin_constant_p(__LINK_STATE_START) ? __constant_test_bit((__LINK_STATE_START),(&dev->state)) : __test_bit((__LINK_STATE_START),(&dev->state))); | |
15934 | } | |
15935 | ||
15936 | ||
15937 | ||
15938 | ||
15939 | ||
15940 | static inline __attribute__((always_inline)) void dev_kfree_skb_irq(struct sk_buff *skb) | |
15941 | { | |
15942 | if ((atomic_sub_return(1, (&skb->users)) == 0)) { | |
15943 | struct softnet_data *sd; | |
15944 | unsigned long flags; | |
15945 | ||
15946 | do { __asm__ __volatile__ ( "cli %0;" :"=&d"(flags):); } while (0); | |
15947 | sd = &per_cpu__softnet_data; | |
15948 | skb->next = sd->completion_queue; | |
15949 | sd->completion_queue = skb; | |
15950 | raise_softirq_irqoff(NET_TX_SOFTIRQ); | |
15951 | do { if (((flags) != 0x1f)) do { __asm__ __volatile__ ( "sti %0;" ::"d"(irq_flags)); } while (0); } while (0); | |
15952 | } | |
15953 | } | |
15954 | ||
15955 | ||
15956 | ||
15957 | ||
15958 | extern void dev_kfree_skb_any(struct sk_buff *skb); | |
15959 | ||
15960 | ||
15961 | extern int netif_rx(struct sk_buff *skb); | |
15962 | extern int netif_rx_ni(struct sk_buff *skb); | |
15963 | ||
15964 | extern int netif_receive_skb(struct sk_buff *skb); | |
15965 | extern int dev_valid_name(const char *name); | |
15966 | extern int dev_ioctl(unsigned int cmd, void *); | |
15967 | extern int dev_ethtool(struct ifreq *); | |
15968 | extern unsigned dev_get_flags(const struct net_device *); | |
15969 | extern int dev_change_flags(struct net_device *, unsigned); | |
15970 | extern int dev_change_name(struct net_device *, char *); | |
15971 | extern int dev_set_mtu(struct net_device *, int); | |
15972 | extern int dev_set_mac_address(struct net_device *, | |
15973 | struct sockaddr *); | |
15974 | extern int dev_hard_start_xmit(struct sk_buff *skb, | |
15975 | struct net_device *dev); | |
15976 | ||
15977 | extern void dev_init(void); | |
15978 | ||
15979 | extern int netdev_budget; | |
15980 | ||
15981 | ||
15982 | extern void netdev_run_todo(void); | |
15983 | ||
15984 | static inline __attribute__((always_inline)) void dev_put(struct net_device *dev) | |
15985 | { | |
15986 | atomic_dec(&dev->refcnt); | |
15987 | } | |
15988 | ||
15989 | static inline __attribute__((always_inline)) void dev_hold(struct net_device *dev) | |
15990 | { | |
15991 | atomic_inc(&dev->refcnt); | |
15992 | } | |
15993 | # 736 "include/linux/netdevice.h" | |
15994 | extern void linkwatch_fire_event(struct net_device *dev); | |
15995 | ||
15996 | static inline __attribute__((always_inline)) int netif_carrier_ok(const struct net_device *dev) | |
15997 | { | |
15998 | return !(__builtin_constant_p(__LINK_STATE_NOCARRIER) ? __constant_test_bit((__LINK_STATE_NOCARRIER),(&dev->state)) : __test_bit((__LINK_STATE_NOCARRIER),(&dev->state))); | |
15999 | } | |
16000 | ||
16001 | extern void __netdev_watchdog_up(struct net_device *dev); | |
16002 | ||
16003 | extern void netif_carrier_on(struct net_device *dev); | |
16004 | ||
16005 | extern void netif_carrier_off(struct net_device *dev); | |
16006 | ||
16007 | static inline __attribute__((always_inline)) void netif_dormant_on(struct net_device *dev) | |
16008 | { | |
16009 | if (!test_and_set_bit(__LINK_STATE_DORMANT, &dev->state)) | |
16010 | linkwatch_fire_event(dev); | |
16011 | } | |
16012 | ||
16013 | static inline __attribute__((always_inline)) void netif_dormant_off(struct net_device *dev) | |
16014 | { | |
16015 | if (test_and_clear_bit(__LINK_STATE_DORMANT, &dev->state)) | |
16016 | linkwatch_fire_event(dev); | |
16017 | } | |
16018 | ||
16019 | static inline __attribute__((always_inline)) int netif_dormant(const struct net_device *dev) | |
16020 | { | |
16021 | return (__builtin_constant_p(__LINK_STATE_DORMANT) ? __constant_test_bit((__LINK_STATE_DORMANT),(&dev->state)) : __test_bit((__LINK_STATE_DORMANT),(&dev->state))); | |
16022 | } | |
16023 | ||
16024 | ||
16025 | static inline __attribute__((always_inline)) int netif_oper_up(const struct net_device *dev) { | |
16026 | return (dev->operstate == IF_OPER_UP || | |
16027 | dev->operstate == IF_OPER_UNKNOWN ); | |
16028 | } | |
16029 | ||
16030 | ||
16031 | static inline __attribute__((always_inline)) int netif_device_present(struct net_device *dev) | |
16032 | { | |
16033 | return (__builtin_constant_p(__LINK_STATE_PRESENT) ? __constant_test_bit((__LINK_STATE_PRESENT),(&dev->state)) : __test_bit((__LINK_STATE_PRESENT),(&dev->state))); | |
16034 | } | |
16035 | ||
16036 | extern void netif_device_detach(struct net_device *dev); | |
16037 | ||
16038 | extern void netif_device_attach(struct net_device *dev); | |
16039 | ||
16040 | ||
16041 | ||
16042 | ||
16043 | ||
16044 | ||
16045 | enum { | |
16046 | NETIF_MSG_DRV = 0x0001, | |
16047 | NETIF_MSG_PROBE = 0x0002, | |
16048 | NETIF_MSG_LINK = 0x0004, | |
16049 | NETIF_MSG_TIMER = 0x0008, | |
16050 | NETIF_MSG_IFDOWN = 0x0010, | |
16051 | NETIF_MSG_IFUP = 0x0020, | |
16052 | NETIF_MSG_RX_ERR = 0x0040, | |
16053 | NETIF_MSG_TX_ERR = 0x0080, | |
16054 | NETIF_MSG_TX_QUEUED = 0x0100, | |
16055 | NETIF_MSG_INTR = 0x0200, | |
16056 | NETIF_MSG_TX_DONE = 0x0400, | |
16057 | NETIF_MSG_RX_STATUS = 0x0800, | |
16058 | NETIF_MSG_PKTDATA = 0x1000, | |
16059 | NETIF_MSG_HW = 0x2000, | |
16060 | NETIF_MSG_WOL = 0x4000, | |
16061 | }; | |
16062 | # 821 "include/linux/netdevice.h" | |
16063 | static inline __attribute__((always_inline)) u32 netif_msg_init(int debug_value, int default_msg_enable_bits) | |
16064 | { | |
16065 | ||
16066 | if (debug_value < 0 || debug_value >= (sizeof(u32) * 8)) | |
16067 | return default_msg_enable_bits; | |
16068 | if (debug_value == 0) | |
16069 | return 0; | |
16070 | ||
16071 | return (1 << debug_value) - 1; | |
16072 | } | |
16073 | ||
16074 | ||
16075 | static inline __attribute__((always_inline)) int __netif_rx_schedule_prep(struct net_device *dev) | |
16076 | { | |
16077 | return !test_and_set_bit(__LINK_STATE_RX_SCHED, &dev->state); | |
16078 | } | |
16079 | ||
16080 | ||
16081 | static inline __attribute__((always_inline)) int netif_rx_schedule_prep(struct net_device *dev) | |
16082 | { | |
16083 | return netif_running(dev) && __netif_rx_schedule_prep(dev); | |
16084 | } | |
16085 | ||
16086 | ||
16087 | ||
16088 | ||
16089 | ||
16090 | extern void __netif_rx_schedule(struct net_device *dev); | |
16091 | ||
16092 | ||
16093 | ||
16094 | static inline __attribute__((always_inline)) void netif_rx_schedule(struct net_device *dev) | |
16095 | { | |
16096 | if (netif_rx_schedule_prep(dev)) | |
16097 | __netif_rx_schedule(dev); | |
16098 | } | |
16099 | ||
16100 | ||
16101 | ||
16102 | ||
16103 | static inline __attribute__((always_inline)) int netif_rx_reschedule(struct net_device *dev, int undo) | |
16104 | { | |
16105 | if (netif_rx_schedule_prep(dev)) { | |
16106 | unsigned long flags; | |
16107 | ||
16108 | dev->quota += undo; | |
16109 | ||
16110 | do { __asm__ __volatile__ ( "cli %0;" :"=&d"(flags):); } while (0); | |
16111 | list_add_tail(&dev->poll_list, &per_cpu__softnet_data.poll_list); | |
16112 | do { ((irq_stat[0].__softirq_pending) |= (1UL << (NET_RX_SOFTIRQ))); } while (0); | |
16113 | do { if (((flags) != 0x1f)) do { __asm__ __volatile__ ( "sti %0;" ::"d"(irq_flags)); } while (0); } while (0); | |
16114 | return 1; | |
16115 | } | |
16116 | return 0; | |
16117 | } | |
16118 | ||
16119 | ||
16120 | ||
16121 | ||
16122 | ||
16123 | ||
16124 | static inline __attribute__((always_inline)) void netif_rx_complete(struct net_device *dev) | |
16125 | { | |
16126 | unsigned long flags; | |
16127 | ||
16128 | do { __asm__ __volatile__ ( "cli %0;" :"=&d"(flags):); } while (0); | |
16129 | do { if (__builtin_expect(!!((!(__builtin_constant_p(__LINK_STATE_RX_SCHED) ? __constant_test_bit((__LINK_STATE_RX_SCHED),(&dev->state)) : __test_bit((__LINK_STATE_RX_SCHED),(&dev->state))))!=0), 0)) do { dump_stack(); printk("<4>" "\nkernel BUG at %s:%d!\n", "include/linux/netdevice.h", 887); panic("BUG!"); } while (0); } while(0); | |
16130 | list_del(&dev->poll_list); | |
16131 | __asm__ __volatile__("": : :"memory"); | |
16132 | clear_bit(__LINK_STATE_RX_SCHED, &dev->state); | |
16133 | do { if (((flags) != 0x1f)) do { __asm__ __volatile__ ( "sti %0;" ::"d"(irq_flags)); } while (0); } while (0); | |
16134 | } | |
16135 | ||
16136 | static inline __attribute__((always_inline)) void netif_poll_disable(struct net_device *dev) | |
16137 | { | |
16138 | while (test_and_set_bit(__LINK_STATE_RX_SCHED, &dev->state)) | |
16139 | ||
16140 | schedule_timeout_interruptible(1); | |
16141 | } | |
16142 | ||
16143 | static inline __attribute__((always_inline)) void netif_poll_enable(struct net_device *dev) | |
16144 | { | |
16145 | clear_bit(__LINK_STATE_RX_SCHED, &dev->state); | |
16146 | } | |
16147 | ||
16148 | ||
16149 | ||
16150 | ||
16151 | static inline __attribute__((always_inline)) void __netif_rx_complete(struct net_device *dev) | |
16152 | { | |
16153 | do { if (__builtin_expect(!!((!(__builtin_constant_p(__LINK_STATE_RX_SCHED) ? __constant_test_bit((__LINK_STATE_RX_SCHED),(&dev->state)) : __test_bit((__LINK_STATE_RX_SCHED),(&dev->state))))!=0), 0)) do { dump_stack(); printk("<4>" "\nkernel BUG at %s:%d!\n", "include/linux/netdevice.h", 911); panic("BUG!"); } while (0); } while(0); | |
16154 | list_del(&dev->poll_list); | |
16155 | __asm__ __volatile__("": : :"memory"); | |
16156 | clear_bit(__LINK_STATE_RX_SCHED, &dev->state); | |
16157 | } | |
16158 | ||
16159 | static inline __attribute__((always_inline)) void netif_tx_lock(struct net_device *dev) | |
16160 | { | |
16161 | do { do { } while (0); (void)0; (void)(&dev->_xmit_lock); } while (0); | |
16162 | dev->xmit_lock_owner = 0; | |
16163 | } | |
16164 | ||
16165 | static inline __attribute__((always_inline)) void netif_tx_lock_bh(struct net_device *dev) | |
16166 | { | |
16167 | do { local_bh_disable(); do { do { } while (0); (void)0; (void)(&dev->_xmit_lock); } while (0); } while (0); | |
16168 | dev->xmit_lock_owner = 0; | |
16169 | } | |
16170 | ||
16171 | static inline __attribute__((always_inline)) int netif_tx_trylock(struct net_device *dev) | |
16172 | { | |
16173 | int ok = (({ do { do { } while (0); (void)0; (void)(&dev->_xmit_lock); } while (0); 1; })); | |
16174 | if (__builtin_expect(!!(ok), 1)) | |
16175 | dev->xmit_lock_owner = 0; | |
16176 | return ok; | |
16177 | } | |
16178 | ||
16179 | static inline __attribute__((always_inline)) void netif_tx_unlock(struct net_device *dev) | |
16180 | { | |
16181 | dev->xmit_lock_owner = -1; | |
16182 | do { do { } while (0); (void)0; (void)(&dev->_xmit_lock); } while (0); | |
16183 | } | |
16184 | ||
16185 | static inline __attribute__((always_inline)) void netif_tx_unlock_bh(struct net_device *dev) | |
16186 | { | |
16187 | dev->xmit_lock_owner = -1; | |
16188 | do { do { } while (0); local_bh_enable(); (void)0; (void)(&dev->_xmit_lock); } while (0); | |
16189 | } | |
16190 | ||
16191 | static inline __attribute__((always_inline)) void netif_tx_disable(struct net_device *dev) | |
16192 | { | |
16193 | netif_tx_lock_bh(dev); | |
16194 | netif_stop_queue(dev); | |
16195 | netif_tx_unlock_bh(dev); | |
16196 | } | |
16197 | ||
16198 | ||
16199 | ||
16200 | extern void ether_setup(struct net_device *dev); | |
16201 | ||
16202 | ||
16203 | extern struct net_device *alloc_netdev(int sizeof_priv, const char *name, | |
16204 | void (*setup)(struct net_device *)); | |
16205 | extern int register_netdev(struct net_device *dev); | |
16206 | extern void unregister_netdev(struct net_device *dev); | |
16207 | ||
16208 | extern void dev_mc_upload(struct net_device *dev); | |
16209 | extern int dev_mc_delete(struct net_device *dev, void *addr, int alen, int all); | |
16210 | extern int dev_mc_add(struct net_device *dev, void *addr, int alen, int newonly); | |
16211 | extern void dev_mc_discard(struct net_device *dev); | |
16212 | extern void dev_set_promiscuity(struct net_device *dev, int inc); | |
16213 | extern void dev_set_allmulti(struct net_device *dev, int inc); | |
16214 | extern void netdev_state_change(struct net_device *dev); | |
16215 | extern void netdev_features_change(struct net_device *dev); | |
16216 | ||
16217 | extern void dev_load(const char *name); | |
16218 | extern void dev_mcast_init(void); | |
16219 | extern int netdev_max_backlog; | |
16220 | extern int weight_p; | |
16221 | extern int netdev_set_master(struct net_device *dev, struct net_device *master); | |
16222 | extern int skb_checksum_help(struct sk_buff *skb); | |
16223 | extern struct sk_buff *skb_gso_segment(struct sk_buff *skb, int features); | |
16224 | ||
16225 | extern void netdev_rx_csum_fault(struct net_device *dev); | |
16226 | ||
16227 | ||
16228 | ||
16229 | ||
16230 | ||
16231 | ||
16232 | extern void net_enable_timestamp(void); | |
16233 | extern void net_disable_timestamp(void); | |
16234 | ||
16235 | ||
16236 | extern void *dev_seq_start(struct seq_file *seq, loff_t *pos); | |
16237 | extern void *dev_seq_next(struct seq_file *seq, void *v, loff_t *pos); | |
16238 | extern void dev_seq_stop(struct seq_file *seq, void *v); | |
16239 | ||
16240 | ||
16241 | extern void linkwatch_run_queue(void); | |
16242 | ||
16243 | static inline __attribute__((always_inline)) int net_gso_ok(int features, int gso_type) | |
16244 | { | |
16245 | int feature = gso_type << 16; | |
16246 | return (features & feature) == feature; | |
16247 | } | |
16248 | ||
16249 | static inline __attribute__((always_inline)) int skb_gso_ok(struct sk_buff *skb, int features) | |
16250 | { | |
16251 | return net_gso_ok(features, ((struct skb_shared_info *)((skb)->end))->gso_type); | |
16252 | } | |
16253 | ||
16254 | static inline __attribute__((always_inline)) int netif_needs_gso(struct net_device *dev, struct sk_buff *skb) | |
16255 | { | |
16256 | return skb_is_gso(skb) && | |
16257 | (!skb_gso_ok(skb, dev->features) || | |
16258 | __builtin_expect(!!(skb->ip_summed != 1), 0)); | |
16259 | } | |
16260 | ||
16261 | ||
16262 | ||
16263 | ||
16264 | ||
16265 | static inline __attribute__((always_inline)) int skb_bond_should_drop(struct sk_buff *skb) | |
16266 | { | |
16267 | struct net_device *dev = skb->dev; | |
16268 | struct net_device *master = dev->master; | |
16269 | ||
16270 | if (master && | |
16271 | (dev->priv_flags & 0x4)) { | |
16272 | if ((dev->priv_flags & 0x40) && | |
16273 | skb->protocol == (( __be16)((__u16)( (((__u16)((0x0806)) & (__u16)0x00ffU) << 8) | (((__u16)((0x0806)) & (__u16)0xff00U) >> 8) )))) | |
16274 | return 0; | |
16275 | ||
16276 | if (master->priv_flags & 0x10) { | |
16277 | if (skb->pkt_type != 1 && | |
16278 | skb->pkt_type != 2) | |
16279 | return 0; | |
16280 | } | |
16281 | if (master->priv_flags & 0x8 && | |
16282 | skb->protocol == (( __be16)((__u16)( (((__u16)((0x8809)) & (__u16)0x00ffU) << 8) | (((__u16)((0x8809)) & (__u16)0xff00U) >> 8) )))) | |
16283 | return 0; | |
16284 | ||
16285 | return 1; | |
16286 | } | |
16287 | return 0; | |
16288 | } | |
16289 | # 62 "net/ipv4/ip_output.c" 2 | |
16290 | # 1 "include/linux/etherdevice.h" 1 | |
16291 | # 32 "include/linux/etherdevice.h" | |
16292 | extern int eth_header(struct sk_buff *skb, struct net_device *dev, | |
16293 | unsigned short type, void *daddr, | |
16294 | void *saddr, unsigned len); | |
16295 | extern int eth_rebuild_header(struct sk_buff *skb); | |
16296 | extern __be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev); | |
16297 | extern void eth_header_cache_update(struct hh_cache *hh, struct net_device *dev, | |
16298 | unsigned char * haddr); | |
16299 | extern int eth_header_cache(struct neighbour *neigh, | |
16300 | struct hh_cache *hh); | |
16301 | ||
16302 | extern struct net_device *alloc_etherdev(int sizeof_priv); | |
16303 | static inline __attribute__((always_inline)) void eth_copy_and_sum (struct sk_buff *dest, | |
16304 | const unsigned char *src, | |
16305 | int len, int base) | |
16306 | { | |
16307 | memcpy (dest->data, src, len); | |
16308 | } | |
16309 | ||
16310 | ||
16311 | ||
16312 | ||
16313 | ||
16314 | ||
16315 | ||
16316 | static inline __attribute__((always_inline)) int is_zero_ether_addr(const u8 *addr) | |
16317 | { | |
16318 | return !(addr[0] | addr[1] | addr[2] | addr[3] | addr[4] | addr[5]); | |
16319 | } | |
16320 | # 68 "include/linux/etherdevice.h" | |
16321 | static inline __attribute__((always_inline)) int is_multicast_ether_addr(const u8 *addr) | |
16322 | { | |
16323 | return (0x01 & addr[0]); | |
16324 | } | |
16325 | ||
16326 | ||
16327 | ||
16328 | ||
16329 | ||
16330 | ||
16331 | ||
16332 | static inline __attribute__((always_inline)) int is_broadcast_ether_addr(const u8 *addr) | |
16333 | { | |
16334 | return (addr[0] & addr[1] & addr[2] & addr[3] & addr[4] & addr[5]) == 0xff; | |
16335 | } | |
16336 | # 93 "include/linux/etherdevice.h" | |
16337 | static inline __attribute__((always_inline)) int is_valid_ether_addr(const u8 *addr) | |
16338 | { | |
16339 | ||
16340 | ||
16341 | return !is_multicast_ether_addr(addr) && !is_zero_ether_addr(addr); | |
16342 | } | |
16343 | # 107 "include/linux/etherdevice.h" | |
16344 | static inline __attribute__((always_inline)) void random_ether_addr(u8 *addr) | |
16345 | { | |
16346 | get_random_bytes (addr, 6); | |
16347 | addr [0] &= 0xfe; | |
16348 | addr [0] |= 0x02; | |
16349 | } | |
16350 | # 121 "include/linux/etherdevice.h" | |
16351 | static inline __attribute__((always_inline)) unsigned compare_ether_addr(const u8 *addr1, const u8 *addr2) | |
16352 | { | |
16353 | const u16 *a = (const u16 *) addr1; | |
16354 | const u16 *b = (const u16 *) addr2; | |
16355 | ||
16356 | ((void)sizeof(char[1 - 2*!!(6 != 6)])); | |
16357 | return ((a[0] ^ b[0]) | (a[1] ^ b[1]) | (a[2] ^ b[2])) != 0; | |
16358 | } | |
16359 | # 63 "net/ipv4/ip_output.c" 2 | |
16360 | # 1 "include/linux/proc_fs.h" 1 | |
16361 | ||
16362 | ||
16363 | ||
16364 | ||
16365 | ||
16366 | ||
16367 | # 1 "include/linux/magic.h" 1 | |
16368 | # 8 "include/linux/proc_fs.h" 2 | |
16369 | # 24 "include/linux/proc_fs.h" | |
16370 | enum { | |
16371 | PROC_ROOT_INO = 1, | |
16372 | }; | |
16373 | # 43 "include/linux/proc_fs.h" | |
16374 | typedef int (read_proc_t)(char *page, char **start, off_t off, | |
16375 | int count, int *eof, void *data); | |
16376 | typedef int (write_proc_t)(struct file *file, const char *buffer, | |
16377 | unsigned long count, void *data); | |
16378 | typedef int (get_info_t)(char *, char **, off_t, int); | |
16379 | ||
16380 | struct proc_dir_entry { | |
16381 | unsigned int low_ino; | |
16382 | unsigned short namelen; | |
16383 | const char *name; | |
16384 | mode_t mode; | |
16385 | nlink_t nlink; | |
16386 | uid_t uid; | |
16387 | gid_t gid; | |
16388 | loff_t size; | |
16389 | struct inode_operations * proc_iops; | |
16390 | const struct file_operations * proc_fops; | |
16391 | get_info_t *get_info; | |
16392 | struct module *owner; | |
16393 | struct proc_dir_entry *next, *parent, *subdir; | |
16394 | void *data; | |
16395 | read_proc_t *read_proc; | |
16396 | write_proc_t *write_proc; | |
16397 | atomic_t count; | |
16398 | int deleted; | |
16399 | void *set; | |
16400 | }; | |
16401 | ||
16402 | struct kcore_list { | |
16403 | struct kcore_list *next; | |
16404 | unsigned long addr; | |
16405 | size_t size; | |
16406 | }; | |
16407 | ||
16408 | struct vmcore { | |
16409 | struct list_head list; | |
16410 | unsigned long long paddr; | |
16411 | unsigned long long size; | |
16412 | loff_t offset; | |
16413 | }; | |
16414 | ||
16415 | ||
16416 | ||
16417 | extern struct proc_dir_entry proc_root; | |
16418 | extern struct proc_dir_entry *proc_root_fs; | |
16419 | extern struct proc_dir_entry *proc_net; | |
16420 | extern struct proc_dir_entry *proc_net_stat; | |
16421 | extern struct proc_dir_entry *proc_bus; | |
16422 | extern struct proc_dir_entry *proc_root_driver; | |
16423 | extern struct proc_dir_entry *proc_root_kcore; | |
16424 | ||
16425 | extern spinlock_t proc_subdir_lock; | |
16426 | ||
16427 | extern void proc_root_init(void); | |
16428 | extern void proc_misc_init(void); | |
16429 | ||
16430 | struct mm_struct; | |
16431 | ||
16432 | void proc_flush_task(struct task_struct *task); | |
16433 | struct dentry *proc_pid_lookup(struct inode *dir, struct dentry * dentry, struct nameidata *); | |
16434 | int proc_pid_readdir(struct file * filp, void * dirent, filldir_t filldir); | |
16435 | unsigned long task_vsize(struct mm_struct *); | |
16436 | int task_statm(struct mm_struct *, int *, int *, int *, int *); | |
16437 | char *task_mem(struct mm_struct *, char *); | |
16438 | ||
16439 | extern struct proc_dir_entry *create_proc_entry(const char *name, mode_t mode, | |
16440 | struct proc_dir_entry *parent); | |
16441 | extern void remove_proc_entry(const char *name, struct proc_dir_entry *parent); | |
16442 | ||
16443 | extern struct vfsmount *proc_mnt; | |
16444 | extern int proc_fill_super(struct super_block *,void *,int); | |
16445 | extern struct inode *proc_get_inode(struct super_block *, unsigned int, struct proc_dir_entry *); | |
16446 | ||
16447 | extern int proc_match(int, const char *,struct proc_dir_entry *); | |
16448 | # 125 "include/linux/proc_fs.h" | |
16449 | extern int proc_readdir(struct file *, void *, filldir_t); | |
16450 | extern struct dentry *proc_lookup(struct inode *, struct dentry *, struct nameidata *); | |
16451 | ||
16452 | extern const struct file_operations proc_kcore_operations; | |
16453 | extern const struct file_operations proc_kmsg_operations; | |
16454 | extern const struct file_operations ppc_htab_operations; | |
16455 | ||
16456 | ||
16457 | ||
16458 | ||
16459 | struct tty_driver; | |
16460 | extern void proc_tty_init(void); | |
16461 | extern void proc_tty_register_driver(struct tty_driver *driver); | |
16462 | extern void proc_tty_unregister_driver(struct tty_driver *driver); | |
16463 | # 156 "include/linux/proc_fs.h" | |
16464 | extern struct proc_dir_entry *proc_symlink(const char *, | |
16465 | struct proc_dir_entry *, const char *); | |
16466 | extern struct proc_dir_entry *proc_mkdir(const char *,struct proc_dir_entry *); | |
16467 | extern struct proc_dir_entry *proc_mkdir_mode(const char *name, mode_t mode, | |
16468 | struct proc_dir_entry *parent); | |
16469 | ||
16470 | static inline __attribute__((always_inline)) struct proc_dir_entry *create_proc_read_entry(const char *name, | |
16471 | mode_t mode, struct proc_dir_entry *base, | |
16472 | read_proc_t *read_proc, void * data) | |
16473 | { | |
16474 | struct proc_dir_entry *res=create_proc_entry(name,mode,base); | |
16475 | if (res) { | |
16476 | res->read_proc=read_proc; | |
16477 | res->data=data; | |
16478 | } | |
16479 | return res; | |
16480 | } | |
16481 | ||
16482 | static inline __attribute__((always_inline)) struct proc_dir_entry *create_proc_info_entry(const char *name, | |
16483 | mode_t mode, struct proc_dir_entry *base, get_info_t *get_info) | |
16484 | { | |
16485 | struct proc_dir_entry *res=create_proc_entry(name,mode,base); | |
16486 | if (res) res->get_info=get_info; | |
16487 | return res; | |
16488 | } | |
16489 | ||
16490 | static inline __attribute__((always_inline)) struct proc_dir_entry *proc_net_create(const char *name, | |
16491 | mode_t mode, get_info_t *get_info) | |
16492 | { | |
16493 | return create_proc_info_entry(name,mode,proc_net,get_info); | |
16494 | } | |
16495 | ||
16496 | static inline __attribute__((always_inline)) struct proc_dir_entry *proc_net_fops_create(const char *name, | |
16497 | mode_t mode, const struct file_operations *fops) | |
16498 | { | |
16499 | struct proc_dir_entry *res = create_proc_entry(name, mode, proc_net); | |
16500 | if (res) | |
16501 | res->proc_fops = fops; | |
16502 | return res; | |
16503 | } | |
16504 | ||
16505 | static inline __attribute__((always_inline)) void proc_net_remove(const char *name) | |
16506 | { | |
16507 | remove_proc_entry(name,proc_net); | |
16508 | } | |
16509 | # 240 "include/linux/proc_fs.h" | |
16510 | static inline __attribute__((always_inline)) void kclist_add(struct kcore_list *new, void *addr, size_t size) | |
16511 | { | |
16512 | } | |
16513 | ||
16514 | ||
16515 | ||
16516 | ||
16517 | union proc_op { | |
16518 | int (*proc_get_link)(struct inode *, struct dentry **, struct vfsmount **); | |
16519 | int (*proc_read)(struct task_struct *task, char *page); | |
16520 | }; | |
16521 | ||
16522 | struct proc_inode { | |
16523 | struct pid *pid; | |
16524 | int fd; | |
16525 | union proc_op op; | |
16526 | struct proc_dir_entry *pde; | |
16527 | struct inode vfs_inode; | |
16528 | }; | |
16529 | ||
16530 | static inline __attribute__((always_inline)) struct proc_inode *PROC_I(const struct inode *inode) | |
16531 | { | |
16532 | return ({ const typeof( ((struct proc_inode *)0)->vfs_inode ) *__mptr = (inode); (struct proc_inode *)( (char *)__mptr - __builtin_offsetof(struct proc_inode,vfs_inode) );}); | |
16533 | } | |
16534 | ||
16535 | static inline __attribute__((always_inline)) struct proc_dir_entry *PDE(const struct inode *inode) | |
16536 | { | |
16537 | return PROC_I(inode)->pde; | |
16538 | } | |
16539 | ||
16540 | struct proc_maps_private { | |
16541 | struct pid *pid; | |
16542 | struct task_struct *task; | |
16543 | ||
16544 | ||
16545 | ||
16546 | }; | |
16547 | # 64 "net/ipv4/ip_output.c" 2 | |
16548 | ||
16549 | ||
16550 | ||
16551 | # 1 "include/net/snmp.h" 1 | |
16552 | # 25 "include/net/snmp.h" | |
16553 | # 1 "include/linux/snmp.h" 1 | |
16554 | # 18 "include/linux/snmp.h" | |
16555 | enum | |
16556 | { | |
16557 | IPSTATS_MIB_NUM = 0, | |
16558 | IPSTATS_MIB_INRECEIVES, | |
16559 | IPSTATS_MIB_INHDRERRORS, | |
16560 | IPSTATS_MIB_INTOOBIGERRORS, | |
16561 | IPSTATS_MIB_INNOROUTES, | |
16562 | IPSTATS_MIB_INADDRERRORS, | |
16563 | IPSTATS_MIB_INUNKNOWNPROTOS, | |
16564 | IPSTATS_MIB_INTRUNCATEDPKTS, | |
16565 | IPSTATS_MIB_INDISCARDS, | |
16566 | IPSTATS_MIB_INDELIVERS, | |
16567 | IPSTATS_MIB_OUTFORWDATAGRAMS, | |
16568 | IPSTATS_MIB_OUTREQUESTS, | |
16569 | IPSTATS_MIB_OUTDISCARDS, | |
16570 | IPSTATS_MIB_OUTNOROUTES, | |
16571 | IPSTATS_MIB_REASMTIMEOUT, | |
16572 | IPSTATS_MIB_REASMREQDS, | |
16573 | IPSTATS_MIB_REASMOKS, | |
16574 | IPSTATS_MIB_REASMFAILS, | |
16575 | IPSTATS_MIB_FRAGOKS, | |
16576 | IPSTATS_MIB_FRAGFAILS, | |
16577 | IPSTATS_MIB_FRAGCREATES, | |
16578 | IPSTATS_MIB_INMCASTPKTS, | |
16579 | IPSTATS_MIB_OUTMCASTPKTS, | |
16580 | __IPSTATS_MIB_MAX | |
16581 | }; | |
16582 | ||
16583 | ||
16584 | ||
16585 | ||
16586 | ||
16587 | ||
16588 | enum | |
16589 | { | |
16590 | ICMP_MIB_NUM = 0, | |
16591 | ICMP_MIB_INMSGS, | |
16592 | ICMP_MIB_INERRORS, | |
16593 | ICMP_MIB_INDESTUNREACHS, | |
16594 | ICMP_MIB_INTIMEEXCDS, | |
16595 | ICMP_MIB_INPARMPROBS, | |
16596 | ICMP_MIB_INSRCQUENCHS, | |
16597 | ICMP_MIB_INREDIRECTS, | |
16598 | ICMP_MIB_INECHOS, | |
16599 | ICMP_MIB_INECHOREPS, | |
16600 | ICMP_MIB_INTIMESTAMPS, | |
16601 | ICMP_MIB_INTIMESTAMPREPS, | |
16602 | ICMP_MIB_INADDRMASKS, | |
16603 | ICMP_MIB_INADDRMASKREPS, | |
16604 | ICMP_MIB_OUTMSGS, | |
16605 | ICMP_MIB_OUTERRORS, | |
16606 | ICMP_MIB_OUTDESTUNREACHS, | |
16607 | ICMP_MIB_OUTTIMEEXCDS, | |
16608 | ICMP_MIB_OUTPARMPROBS, | |
16609 | ICMP_MIB_OUTSRCQUENCHS, | |
16610 | ICMP_MIB_OUTREDIRECTS, | |
16611 | ICMP_MIB_OUTECHOS, | |
16612 | ICMP_MIB_OUTECHOREPS, | |
16613 | ICMP_MIB_OUTTIMESTAMPS, | |
16614 | ICMP_MIB_OUTTIMESTAMPREPS, | |
16615 | ICMP_MIB_OUTADDRMASKS, | |
16616 | ICMP_MIB_OUTADDRMASKREPS, | |
16617 | __ICMP_MIB_MAX | |
16618 | }; | |
16619 | ||
16620 | ||
16621 | ||
16622 | ||
16623 | ||
16624 | enum | |
16625 | { | |
16626 | ICMP6_MIB_NUM = 0, | |
16627 | ICMP6_MIB_INMSGS, | |
16628 | ICMP6_MIB_INERRORS, | |
16629 | ICMP6_MIB_INDESTUNREACHS, | |
16630 | ICMP6_MIB_INPKTTOOBIGS, | |
16631 | ICMP6_MIB_INTIMEEXCDS, | |
16632 | ICMP6_MIB_INPARMPROBLEMS, | |
16633 | ICMP6_MIB_INECHOS, | |
16634 | ICMP6_MIB_INECHOREPLIES, | |
16635 | ICMP6_MIB_INGROUPMEMBQUERIES, | |
16636 | ICMP6_MIB_INGROUPMEMBRESPONSES, | |
16637 | ICMP6_MIB_INGROUPMEMBREDUCTIONS, | |
16638 | ICMP6_MIB_INROUTERSOLICITS, | |
16639 | ICMP6_MIB_INROUTERADVERTISEMENTS, | |
16640 | ICMP6_MIB_INNEIGHBORSOLICITS, | |
16641 | ICMP6_MIB_INNEIGHBORADVERTISEMENTS, | |
16642 | ICMP6_MIB_INREDIRECTS, | |
16643 | ICMP6_MIB_OUTMSGS, | |
16644 | ICMP6_MIB_OUTDESTUNREACHS, | |
16645 | ICMP6_MIB_OUTPKTTOOBIGS, | |
16646 | ICMP6_MIB_OUTTIMEEXCDS, | |
16647 | ICMP6_MIB_OUTPARMPROBLEMS, | |
16648 | ICMP6_MIB_OUTECHOREPLIES, | |
16649 | ICMP6_MIB_OUTROUTERSOLICITS, | |
16650 | ICMP6_MIB_OUTNEIGHBORSOLICITS, | |
16651 | ICMP6_MIB_OUTNEIGHBORADVERTISEMENTS, | |
16652 | ICMP6_MIB_OUTREDIRECTS, | |
16653 | ICMP6_MIB_OUTGROUPMEMBRESPONSES, | |
16654 | ICMP6_MIB_OUTGROUPMEMBREDUCTIONS, | |
16655 | __ICMP6_MIB_MAX | |
16656 | }; | |
16657 | ||
16658 | ||
16659 | ||
16660 | ||
16661 | ||
16662 | ||
16663 | enum | |
16664 | { | |
16665 | TCP_MIB_NUM = 0, | |
16666 | TCP_MIB_RTOALGORITHM, | |
16667 | TCP_MIB_RTOMIN, | |
16668 | TCP_MIB_RTOMAX, | |
16669 | TCP_MIB_MAXCONN, | |
16670 | TCP_MIB_ACTIVEOPENS, | |
16671 | TCP_MIB_PASSIVEOPENS, | |
16672 | TCP_MIB_ATTEMPTFAILS, | |
16673 | TCP_MIB_ESTABRESETS, | |
16674 | TCP_MIB_CURRESTAB, | |
16675 | TCP_MIB_INSEGS, | |
16676 | TCP_MIB_OUTSEGS, | |
16677 | TCP_MIB_RETRANSSEGS, | |
16678 | TCP_MIB_INERRS, | |
16679 | TCP_MIB_OUTRSTS, | |
16680 | __TCP_MIB_MAX | |
16681 | }; | |
16682 | ||
16683 | ||
16684 | ||
16685 | ||
16686 | ||
16687 | ||
16688 | enum | |
16689 | { | |
16690 | UDP_MIB_NUM = 0, | |
16691 | UDP_MIB_INDATAGRAMS, | |
16692 | UDP_MIB_NOPORTS, | |
16693 | UDP_MIB_INERRORS, | |
16694 | UDP_MIB_OUTDATAGRAMS, | |
16695 | UDP_MIB_RCVBUFERRORS, | |
16696 | UDP_MIB_SNDBUFERRORS, | |
16697 | __UDP_MIB_MAX | |
16698 | }; | |
16699 | ||
16700 | ||
16701 | enum | |
16702 | { | |
16703 | LINUX_MIB_NUM = 0, | |
16704 | LINUX_MIB_SYNCOOKIESSENT, | |
16705 | LINUX_MIB_SYNCOOKIESRECV, | |
16706 | LINUX_MIB_SYNCOOKIESFAILED, | |
16707 | LINUX_MIB_EMBRYONICRSTS, | |
16708 | LINUX_MIB_PRUNECALLED, | |
16709 | LINUX_MIB_RCVPRUNED, | |
16710 | LINUX_MIB_OFOPRUNED, | |
16711 | LINUX_MIB_OUTOFWINDOWICMPS, | |
16712 | LINUX_MIB_LOCKDROPPEDICMPS, | |
16713 | LINUX_MIB_ARPFILTER, | |
16714 | LINUX_MIB_TIMEWAITED, | |
16715 | LINUX_MIB_TIMEWAITRECYCLED, | |
16716 | LINUX_MIB_TIMEWAITKILLED, | |
16717 | LINUX_MIB_PAWSPASSIVEREJECTED, | |
16718 | LINUX_MIB_PAWSACTIVEREJECTED, | |
16719 | LINUX_MIB_PAWSESTABREJECTED, | |
16720 | LINUX_MIB_DELAYEDACKS, | |
16721 | LINUX_MIB_DELAYEDACKLOCKED, | |
16722 | LINUX_MIB_DELAYEDACKLOST, | |
16723 | LINUX_MIB_LISTENOVERFLOWS, | |
16724 | LINUX_MIB_LISTENDROPS, | |
16725 | LINUX_MIB_TCPPREQUEUED, | |
16726 | LINUX_MIB_TCPDIRECTCOPYFROMBACKLOG, | |
16727 | LINUX_MIB_TCPDIRECTCOPYFROMPREQUEUE, | |
16728 | LINUX_MIB_TCPPREQUEUEDROPPED, | |
16729 | LINUX_MIB_TCPHPHITS, | |
16730 | LINUX_MIB_TCPHPHITSTOUSER, | |
16731 | LINUX_MIB_TCPPUREACKS, | |
16732 | LINUX_MIB_TCPHPACKS, | |
16733 | LINUX_MIB_TCPRENORECOVERY, | |
16734 | LINUX_MIB_TCPSACKRECOVERY, | |
16735 | LINUX_MIB_TCPSACKRENEGING, | |
16736 | LINUX_MIB_TCPFACKREORDER, | |
16737 | LINUX_MIB_TCPSACKREORDER, | |
16738 | LINUX_MIB_TCPRENOREORDER, | |
16739 | LINUX_MIB_TCPTSREORDER, | |
16740 | LINUX_MIB_TCPFULLUNDO, | |
16741 | LINUX_MIB_TCPPARTIALUNDO, | |
16742 | LINUX_MIB_TCPDSACKUNDO, | |
16743 | LINUX_MIB_TCPLOSSUNDO, | |
16744 | LINUX_MIB_TCPLOSS, | |
16745 | LINUX_MIB_TCPLOSTRETRANSMIT, | |
16746 | LINUX_MIB_TCPRENOFAILURES, | |
16747 | LINUX_MIB_TCPSACKFAILURES, | |
16748 | LINUX_MIB_TCPLOSSFAILURES, | |
16749 | LINUX_MIB_TCPFASTRETRANS, | |
16750 | LINUX_MIB_TCPFORWARDRETRANS, | |
16751 | LINUX_MIB_TCPSLOWSTARTRETRANS, | |
16752 | LINUX_MIB_TCPTIMEOUTS, | |
16753 | LINUX_MIB_TCPRENORECOVERYFAIL, | |
16754 | LINUX_MIB_TCPSACKRECOVERYFAIL, | |
16755 | LINUX_MIB_TCPSCHEDULERFAILED, | |
16756 | LINUX_MIB_TCPRCVCOLLAPSED, | |
16757 | LINUX_MIB_TCPDSACKOLDSENT, | |
16758 | LINUX_MIB_TCPDSACKOFOSENT, | |
16759 | LINUX_MIB_TCPDSACKRECV, | |
16760 | LINUX_MIB_TCPDSACKOFORECV, | |
16761 | LINUX_MIB_TCPABORTONSYN, | |
16762 | LINUX_MIB_TCPABORTONDATA, | |
16763 | LINUX_MIB_TCPABORTONCLOSE, | |
16764 | LINUX_MIB_TCPABORTONMEMORY, | |
16765 | LINUX_MIB_TCPABORTONTIMEOUT, | |
16766 | LINUX_MIB_TCPABORTONLINGER, | |
16767 | LINUX_MIB_TCPABORTFAILED, | |
16768 | LINUX_MIB_TCPMEMORYPRESSURES, | |
16769 | __LINUX_MIB_MAX | |
16770 | }; | |
16771 | # 26 "include/net/snmp.h" 2 | |
16772 | # 35 "include/net/snmp.h" | |
16773 | struct snmp_mib { | |
16774 | char *name; | |
16775 | int entry; | |
16776 | }; | |
16777 | # 73 "include/net/snmp.h" | |
16778 | struct ipstats_mib { | |
16779 | unsigned long mibs[__IPSTATS_MIB_MAX]; | |
16780 | } ; | |
16781 | ||
16782 | ||
16783 | ||
16784 | ||
16785 | ||
16786 | struct icmp_mib { | |
16787 | unsigned long mibs[(__ICMP_MIB_MAX + 1)]; | |
16788 | } ; | |
16789 | ||
16790 | ||
16791 | ||
16792 | struct icmpv6_mib { | |
16793 | unsigned long mibs[__ICMP6_MIB_MAX]; | |
16794 | } ; | |
16795 | ||
16796 | ||
16797 | ||
16798 | struct tcp_mib { | |
16799 | unsigned long mibs[__TCP_MIB_MAX]; | |
16800 | } ; | |
16801 | ||
16802 | ||
16803 | ||
16804 | struct udp_mib { | |
16805 | unsigned long mibs[__UDP_MIB_MAX]; | |
16806 | } ; | |
16807 | ||
16808 | ||
16809 | ||
16810 | struct linux_mib { | |
16811 | unsigned long mibs[__LINUX_MIB_MAX]; | |
16812 | }; | |
16813 | # 68 "net/ipv4/ip_output.c" 2 | |
16814 | # 1 "include/net/ip.h" 1 | |
16815 | # 26 "include/net/ip.h" | |
16816 | # 1 "include/linux/ip.h" 1 | |
16817 | # 85 "include/linux/ip.h" | |
16818 | struct iphdr { | |
16819 | ||
16820 | __u8 ihl:4, | |
16821 | version:4; | |
16822 | ||
16823 | ||
16824 | ||
16825 | ||
16826 | ||
16827 | ||
16828 | __u8 tos; | |
16829 | __be16 tot_len; | |
16830 | __be16 id; | |
16831 | __be16 frag_off; | |
16832 | __u8 ttl; | |
16833 | __u8 protocol; | |
16834 | __be16 check; | |
16835 | __be32 saddr; | |
16836 | __be32 daddr; | |
16837 | ||
16838 | }; | |
16839 | ||
16840 | struct ip_auth_hdr { | |
16841 | __u8 nexthdr; | |
16842 | __u8 hdrlen; | |
16843 | __be16 reserved; | |
16844 | __be32 spi; | |
16845 | __be32 seq_no; | |
16846 | __u8 auth_data[0]; | |
16847 | }; | |
16848 | ||
16849 | struct ip_esp_hdr { | |
16850 | __be32 spi; | |
16851 | __be32 seq_no; | |
16852 | __u8 enc_data[0]; | |
16853 | }; | |
16854 | ||
16855 | struct ip_comp_hdr { | |
16856 | __u8 nexthdr; | |
16857 | __u8 flags; | |
16858 | __be16 cpi; | |
16859 | }; | |
16860 | ||
16861 | struct ip_beet_phdr { | |
16862 | __u8 nexthdr; | |
16863 | __u8 hdrlen; | |
16864 | __u8 padlen; | |
16865 | __u8 reserved; | |
16866 | }; | |
16867 | # 27 "include/net/ip.h" 2 | |
16868 | ||
16869 | ||
16870 | # 1 "include/net/inet_sock.h" 1 | |
16871 | # 23 "include/net/inet_sock.h" | |
16872 | # 1 "include/net/flow.h" 1 | |
16873 | # 10 "include/net/flow.h" | |
16874 | # 1 "include/linux/in6.h" 1 | |
16875 | # 30 "include/linux/in6.h" | |
16876 | struct in6_addr | |
16877 | { | |
16878 | union | |
16879 | { | |
16880 | __u8 u6_addr8[16]; | |
16881 | __be16 u6_addr16[8]; | |
16882 | __be32 u6_addr32[4]; | |
16883 | } in6_u; | |
16884 | ||
16885 | ||
16886 | ||
16887 | }; | |
16888 | # 51 "include/linux/in6.h" | |
16889 | extern const struct in6_addr in6addr_loopback; | |
16890 | ||
16891 | ||
16892 | struct sockaddr_in6 { | |
16893 | unsigned short int sin6_family; | |
16894 | __be16 sin6_port; | |
16895 | __u32 sin6_flowinfo; | |
16896 | struct in6_addr sin6_addr; | |
16897 | __u32 sin6_scope_id; | |
16898 | }; | |
16899 | ||
16900 | struct ipv6_mreq { | |
16901 | ||
16902 | struct in6_addr ipv6mr_multiaddr; | |
16903 | ||
16904 | ||
16905 | int ipv6mr_ifindex; | |
16906 | }; | |
16907 | ||
16908 | ||
16909 | ||
16910 | struct in6_flowlabel_req | |
16911 | { | |
16912 | struct in6_addr flr_dst; | |
16913 | __u32 flr_label; | |
16914 | __u8 flr_action; | |
16915 | __u8 flr_share; | |
16916 | __u16 flr_flags; | |
16917 | __u16 flr_expires; | |
16918 | __u16 flr_linger; | |
16919 | __u32 __flr_pad; | |
16920 | ||
16921 | }; | |
16922 | # 11 "include/net/flow.h" 2 | |
16923 | ||
16924 | ||
16925 | struct flowi { | |
16926 | int oif; | |
16927 | int iif; | |
16928 | ||
16929 | union { | |
16930 | struct { | |
16931 | __be32 daddr; | |
16932 | __be32 saddr; | |
16933 | __u32 fwmark; | |
16934 | __u8 tos; | |
16935 | __u8 scope; | |
16936 | } ip4_u; | |
16937 | ||
16938 | struct { | |
16939 | struct in6_addr daddr; | |
16940 | struct in6_addr saddr; | |
16941 | __u32 fwmark; | |
16942 | __u32 flowlabel; | |
16943 | } ip6_u; | |
16944 | ||
16945 | struct { | |
16946 | __le16 daddr; | |
16947 | __le16 saddr; | |
16948 | __u32 fwmark; | |
16949 | __u8 scope; | |
16950 | } dn_u; | |
16951 | } nl_u; | |
16952 | # 54 "include/net/flow.h" | |
16953 | __u8 proto; | |
16954 | __u8 flags; | |
16955 | ||
16956 | union { | |
16957 | struct { | |
16958 | __be16 sport; | |
16959 | __be16 dport; | |
16960 | } ports; | |
16961 | ||
16962 | struct { | |
16963 | __u8 type; | |
16964 | __u8 code; | |
16965 | } icmpt; | |
16966 | ||
16967 | struct { | |
16968 | __le16 sport; | |
16969 | __le16 dport; | |
16970 | } dnports; | |
16971 | ||
16972 | __be32 spi; | |
16973 | ||
16974 | ||
16975 | ||
16976 | ||
16977 | ||
16978 | ||
16979 | } uli_u; | |
16980 | # 89 "include/net/flow.h" | |
16981 | __u32 secid; | |
16982 | } __attribute__((__aligned__(32/8))); | |
16983 | ||
16984 | ||
16985 | ||
16986 | ||
16987 | ||
16988 | struct sock; | |
16989 | typedef int (*flow_resolve_t)(struct flowi *key, u16 family, u8 dir, | |
16990 | void **objp, atomic_t **obj_refp); | |
16991 | ||
16992 | extern void *flow_cache_lookup(struct flowi *key, u16 family, u8 dir, | |
16993 | flow_resolve_t resolver); | |
16994 | extern void flow_cache_flush(void); | |
16995 | extern atomic_t flow_cache_genid; | |
16996 | # 24 "include/net/inet_sock.h" 2 | |
16997 | # 1 "include/net/sock.h" 1 | |
16998 | # 50 "include/net/sock.h" | |
16999 | # 1 "include/linux/security.h" 1 | |
17000 | # 26 "include/linux/security.h" | |
17001 | # 1 "include/linux/binfmts.h" 1 | |
17002 | ||
17003 | ||
17004 | ||
17005 | ||
17006 | ||
17007 | struct pt_regs; | |
17008 | # 23 "include/linux/binfmts.h" | |
17009 | struct linux_binprm{ | |
17010 | char buf[128]; | |
17011 | struct page *page[32]; | |
17012 | struct mm_struct *mm; | |
17013 | unsigned long p; | |
17014 | int sh_bang; | |
17015 | struct file * file; | |
17016 | int e_uid, e_gid; | |
17017 | kernel_cap_t cap_inheritable, cap_permitted, cap_effective; | |
17018 | void *security; | |
17019 | int argc, envc; | |
17020 | char * filename; | |
17021 | char * interp; | |
17022 | ||
17023 | ||
17024 | unsigned interp_flags; | |
17025 | unsigned interp_data; | |
17026 | unsigned long loader, exec; | |
17027 | }; | |
17028 | # 55 "include/linux/binfmts.h" | |
17029 | struct linux_binfmt { | |
17030 | struct linux_binfmt * next; | |
17031 | struct module *module; | |
17032 | int (*load_binary)(struct linux_binprm *, struct pt_regs * regs); | |
17033 | int (*load_shlib)(struct file *); | |
17034 | int (*core_dump)(long signr, struct pt_regs * regs, struct file * file); | |
17035 | unsigned long min_coredump; | |
17036 | }; | |
17037 | ||
17038 | extern int register_binfmt(struct linux_binfmt *); | |
17039 | extern int unregister_binfmt(struct linux_binfmt *); | |
17040 | ||
17041 | extern int prepare_binprm(struct linux_binprm *); | |
17042 | extern void remove_arg_zero(struct linux_binprm *); | |
17043 | extern int search_binary_handler(struct linux_binprm *,struct pt_regs *); | |
17044 | extern int flush_old_exec(struct linux_binprm * bprm); | |
17045 | ||
17046 | extern int suid_dumpable; | |
17047 | # 82 "include/linux/binfmts.h" | |
17048 | extern int setup_arg_pages(struct linux_binprm * bprm, | |
17049 | unsigned long stack_top, | |
17050 | int executable_stack); | |
17051 | extern int copy_strings_kernel(int argc,char ** argv,struct linux_binprm *bprm); | |
17052 | extern void compute_creds(struct linux_binprm *binprm); | |
17053 | extern int do_coredump(long signr, int exit_code, struct pt_regs * regs); | |
17054 | extern int set_binfmt(struct linux_binfmt *new); | |
17055 | # 27 "include/linux/security.h" 2 | |
17056 | ||
17057 | ||
17058 | ||
17059 | # 1 "include/linux/shm.h" 1 | |
17060 | # 19 "include/linux/shm.h" | |
17061 | # 1 "include/asm/shmparam.h" 1 | |
17062 | # 20 "include/linux/shm.h" 2 | |
17063 | ||
17064 | ||
17065 | struct shmid_ds { | |
17066 | struct ipc_perm shm_perm; | |
17067 | int shm_segsz; | |
17068 | __kernel_time_t shm_atime; | |
17069 | __kernel_time_t shm_dtime; | |
17070 | __kernel_time_t shm_ctime; | |
17071 | __kernel_ipc_pid_t shm_cpid; | |
17072 | __kernel_ipc_pid_t shm_lpid; | |
17073 | unsigned short shm_nattch; | |
17074 | unsigned short shm_unused; | |
17075 | void *shm_unused2; | |
17076 | void *shm_unused3; | |
17077 | }; | |
17078 | ||
17079 | ||
17080 | # 1 "include/asm/shmbuf.h" 1 | |
17081 | # 14 "include/asm/shmbuf.h" | |
17082 | struct shmid64_ds { | |
17083 | struct ipc64_perm shm_perm; | |
17084 | size_t shm_segsz; | |
17085 | __kernel_time_t shm_atime; | |
17086 | unsigned long __unused1; | |
17087 | __kernel_time_t shm_dtime; | |
17088 | unsigned long __unused2; | |
17089 | __kernel_time_t shm_ctime; | |
17090 | unsigned long __unused3; | |
17091 | __kernel_pid_t shm_cpid; | |
17092 | __kernel_pid_t shm_lpid; | |
17093 | unsigned long shm_nattch; | |
17094 | unsigned long __unused4; | |
17095 | unsigned long __unused5; | |
17096 | }; | |
17097 | ||
17098 | struct shminfo64 { | |
17099 | unsigned long shmmax; | |
17100 | unsigned long shmmin; | |
17101 | unsigned long shmmni; | |
17102 | unsigned long shmseg; | |
17103 | unsigned long shmall; | |
17104 | unsigned long __unused1; | |
17105 | unsigned long __unused2; | |
17106 | unsigned long __unused3; | |
17107 | unsigned long __unused4; | |
17108 | }; | |
17109 | # 38 "include/linux/shm.h" 2 | |
17110 | # 58 "include/linux/shm.h" | |
17111 | struct shminfo { | |
17112 | int shmmax; | |
17113 | int shmmin; | |
17114 | int shmmni; | |
17115 | int shmseg; | |
17116 | int shmall; | |
17117 | }; | |
17118 | ||
17119 | struct shm_info { | |
17120 | int used_ids; | |
17121 | unsigned long shm_tot; | |
17122 | unsigned long shm_rss; | |
17123 | unsigned long shm_swp; | |
17124 | unsigned long swap_attempts; | |
17125 | unsigned long swap_successes; | |
17126 | }; | |
17127 | ||
17128 | ||
17129 | struct shmid_kernel | |
17130 | { | |
17131 | struct kern_ipc_perm shm_perm; | |
17132 | struct file * shm_file; | |
17133 | int id; | |
17134 | unsigned long shm_nattch; | |
17135 | unsigned long shm_segsz; | |
17136 | time_t shm_atim; | |
17137 | time_t shm_dtim; | |
17138 | time_t shm_ctim; | |
17139 | pid_t shm_cprid; | |
17140 | pid_t shm_lprid; | |
17141 | struct user_struct *mlock_user; | |
17142 | }; | |
17143 | # 100 "include/linux/shm.h" | |
17144 | static inline __attribute__((always_inline)) long do_shmat(int shmid, char *shmaddr, | |
17145 | int shmflg, unsigned long *addr) | |
17146 | { | |
17147 | return -38; | |
17148 | } | |
17149 | # 31 "include/linux/security.h" 2 | |
17150 | # 1 "include/linux/msg.h" 1 | |
17151 | # 15 "include/linux/msg.h" | |
17152 | struct msqid_ds { | |
17153 | struct ipc_perm msg_perm; | |
17154 | struct msg *msg_first; | |
17155 | struct msg *msg_last; | |
17156 | __kernel_time_t msg_stime; | |
17157 | __kernel_time_t msg_rtime; | |
17158 | __kernel_time_t msg_ctime; | |
17159 | unsigned long msg_lcbytes; | |
17160 | unsigned long msg_lqbytes; | |
17161 | unsigned short msg_cbytes; | |
17162 | unsigned short msg_qnum; | |
17163 | unsigned short msg_qbytes; | |
17164 | __kernel_ipc_pid_t msg_lspid; | |
17165 | __kernel_ipc_pid_t msg_lrpid; | |
17166 | }; | |
17167 | ||
17168 | ||
17169 | # 1 "include/asm/msgbuf.h" 1 | |
17170 | # 14 "include/asm/msgbuf.h" | |
17171 | struct msqid64_ds { | |
17172 | struct ipc64_perm msg_perm; | |
17173 | __kernel_time_t msg_stime; | |
17174 | unsigned long __unused1; | |
17175 | __kernel_time_t msg_rtime; | |
17176 | unsigned long __unused2; | |
17177 | __kernel_time_t msg_ctime; | |
17178 | unsigned long __unused3; | |
17179 | unsigned long msg_cbytes; | |
17180 | unsigned long msg_qnum; | |
17181 | unsigned long msg_qbytes; | |
17182 | __kernel_pid_t msg_lspid; | |
17183 | __kernel_pid_t msg_lrpid; | |
17184 | unsigned long __unused4; | |
17185 | unsigned long __unused5; | |
17186 | }; | |
17187 | # 33 "include/linux/msg.h" 2 | |
17188 | ||
17189 | ||
17190 | struct msgbuf { | |
17191 | long mtype; | |
17192 | char mtext[1]; | |
17193 | }; | |
17194 | ||
17195 | ||
17196 | struct msginfo { | |
17197 | int msgpool; | |
17198 | int msgmap; | |
17199 | int msgmax; | |
17200 | int msgmnb; | |
17201 | int msgmni; | |
17202 | int msgssz; | |
17203 | int msgtql; | |
17204 | unsigned short msgseg; | |
17205 | }; | |
17206 | # 68 "include/linux/msg.h" | |
17207 | struct msg_msg { | |
17208 | struct list_head m_list; | |
17209 | long m_type; | |
17210 | int m_ts; | |
17211 | struct msg_msgseg* next; | |
17212 | void *security; | |
17213 | ||
17214 | }; | |
17215 | ||
17216 | ||
17217 | struct msg_queue { | |
17218 | struct kern_ipc_perm q_perm; | |
17219 | int q_id; | |
17220 | time_t q_stime; | |
17221 | time_t q_rtime; | |
17222 | time_t q_ctime; | |
17223 | unsigned long q_cbytes; | |
17224 | unsigned long q_qnum; | |
17225 | unsigned long q_qbytes; | |
17226 | pid_t q_lspid; | |
17227 | pid_t q_lrpid; | |
17228 | ||
17229 | struct list_head q_messages; | |
17230 | struct list_head q_receivers; | |
17231 | struct list_head q_senders; | |
17232 | }; | |
17233 | # 32 "include/linux/security.h" 2 | |
17234 | ||
17235 | # 1 "include/linux/key.h" 1 | |
17236 | # 27 "include/linux/key.h" | |
17237 | typedef int32_t key_serial_t; | |
17238 | ||
17239 | ||
17240 | typedef uint32_t key_perm_t; | |
17241 | ||
17242 | struct key; | |
17243 | # 381 "include/linux/key.h" | |
17244 | extern struct key root_user_keyring; | |
17245 | extern struct key root_session_keyring; | |
17246 | # 34 "include/linux/security.h" 2 | |
17247 | # 1 "include/linux/xfrm.h" 1 | |
17248 | # 13 "include/linux/xfrm.h" | |
17249 | typedef union | |
17250 | { | |
17251 | __be32 a4; | |
17252 | __be32 a6[4]; | |
17253 | } xfrm_address_t; | |
17254 | ||
17255 | ||
17256 | ||
17257 | ||
17258 | ||
17259 | struct xfrm_id | |
17260 | { | |
17261 | xfrm_address_t daddr; | |
17262 | __be32 spi; | |
17263 | __u8 proto; | |
17264 | }; | |
17265 | ||
17266 | struct xfrm_sec_ctx { | |
17267 | __u8 ctx_doi; | |
17268 | __u8 ctx_alg; | |
17269 | __u16 ctx_len; | |
17270 | __u32 ctx_sid; | |
17271 | char ctx_str[0]; | |
17272 | }; | |
17273 | # 48 "include/linux/xfrm.h" | |
17274 | struct xfrm_selector | |
17275 | { | |
17276 | xfrm_address_t daddr; | |
17277 | xfrm_address_t saddr; | |
17278 | __be16 dport; | |
17279 | __be16 dport_mask; | |
17280 | __be16 sport; | |
17281 | __be16 sport_mask; | |
17282 | __u16 family; | |
17283 | __u8 prefixlen_d; | |
17284 | __u8 prefixlen_s; | |
17285 | __u8 proto; | |
17286 | int ifindex; | |
17287 | uid_t user; | |
17288 | }; | |
17289 | ||
17290 | ||
17291 | ||
17292 | struct xfrm_lifetime_cfg | |
17293 | { | |
17294 | __u64 soft_byte_limit; | |
17295 | __u64 hard_byte_limit; | |
17296 | __u64 soft_packet_limit; | |
17297 | __u64 hard_packet_limit; | |
17298 | __u64 soft_add_expires_seconds; | |
17299 | __u64 hard_add_expires_seconds; | |
17300 | __u64 soft_use_expires_seconds; | |
17301 | __u64 hard_use_expires_seconds; | |
17302 | }; | |
17303 | ||
17304 | struct xfrm_lifetime_cur | |
17305 | { | |
17306 | __u64 bytes; | |
17307 | __u64 packets; | |
17308 | __u64 add_time; | |
17309 | __u64 use_time; | |
17310 | }; | |
17311 | ||
17312 | struct xfrm_replay_state | |
17313 | { | |
17314 | __u32 oseq; | |
17315 | __u32 seq; | |
17316 | __u32 bitmap; | |
17317 | }; | |
17318 | ||
17319 | struct xfrm_algo { | |
17320 | char alg_name[64]; | |
17321 | int alg_key_len; | |
17322 | char alg_key[0]; | |
17323 | }; | |
17324 | ||
17325 | struct xfrm_stats { | |
17326 | __u32 replay_window; | |
17327 | __u32 replay; | |
17328 | __u32 integrity_failed; | |
17329 | }; | |
17330 | ||
17331 | enum | |
17332 | { | |
17333 | XFRM_POLICY_TYPE_MAIN = 0, | |
17334 | XFRM_POLICY_TYPE_SUB = 1, | |
17335 | XFRM_POLICY_TYPE_MAX = 2 | |
17336 | }; | |
17337 | ||
17338 | enum | |
17339 | { | |
17340 | XFRM_POLICY_IN = 0, | |
17341 | XFRM_POLICY_OUT = 1, | |
17342 | XFRM_POLICY_FWD = 2, | |
17343 | XFRM_POLICY_MAX = 3 | |
17344 | }; | |
17345 | ||
17346 | enum | |
17347 | { | |
17348 | XFRM_SHARE_ANY, | |
17349 | XFRM_SHARE_SESSION, | |
17350 | XFRM_SHARE_USER, | |
17351 | XFRM_SHARE_UNIQUE | |
17352 | }; | |
17353 | # 136 "include/linux/xfrm.h" | |
17354 | enum { | |
17355 | XFRM_MSG_BASE = 0x10, | |
17356 | ||
17357 | XFRM_MSG_NEWSA = 0x10, | |
17358 | ||
17359 | XFRM_MSG_DELSA, | |
17360 | ||
17361 | XFRM_MSG_GETSA, | |
17362 | ||
17363 | ||
17364 | XFRM_MSG_NEWPOLICY, | |
17365 | ||
17366 | XFRM_MSG_DELPOLICY, | |
17367 | ||
17368 | XFRM_MSG_GETPOLICY, | |
17369 | ||
17370 | ||
17371 | XFRM_MSG_ALLOCSPI, | |
17372 | ||
17373 | XFRM_MSG_ACQUIRE, | |
17374 | ||
17375 | XFRM_MSG_EXPIRE, | |
17376 | ||
17377 | ||
17378 | XFRM_MSG_UPDPOLICY, | |
17379 | ||
17380 | XFRM_MSG_UPDSA, | |
17381 | ||
17382 | ||
17383 | XFRM_MSG_POLEXPIRE, | |
17384 | ||
17385 | ||
17386 | XFRM_MSG_FLUSHSA, | |
17387 | ||
17388 | XFRM_MSG_FLUSHPOLICY, | |
17389 | ||
17390 | ||
17391 | XFRM_MSG_NEWAE, | |
17392 | ||
17393 | XFRM_MSG_GETAE, | |
17394 | ||
17395 | ||
17396 | XFRM_MSG_REPORT, | |
17397 | ||
17398 | ||
17399 | __XFRM_MSG_MAX | |
17400 | }; | |
17401 | # 191 "include/linux/xfrm.h" | |
17402 | struct xfrm_user_sec_ctx { | |
17403 | __u16 len; | |
17404 | __u16 exttype; | |
17405 | __u8 ctx_alg; | |
17406 | __u8 ctx_doi; | |
17407 | __u16 ctx_len; | |
17408 | }; | |
17409 | ||
17410 | struct xfrm_user_tmpl { | |
17411 | struct xfrm_id id; | |
17412 | __u16 family; | |
17413 | xfrm_address_t saddr; | |
17414 | __u32 reqid; | |
17415 | __u8 mode; | |
17416 | __u8 share; | |
17417 | __u8 optional; | |
17418 | __u32 aalgos; | |
17419 | __u32 ealgos; | |
17420 | __u32 calgos; | |
17421 | }; | |
17422 | ||
17423 | struct xfrm_encap_tmpl { | |
17424 | __u16 encap_type; | |
17425 | __u16 encap_sport; | |
17426 | __u16 encap_dport; | |
17427 | xfrm_address_t encap_oa; | |
17428 | }; | |
17429 | ||
17430 | ||
17431 | enum xfrm_ae_ftype_t { | |
17432 | XFRM_AE_UNSPEC, | |
17433 | XFRM_AE_RTHR=1, | |
17434 | XFRM_AE_RVAL=2, | |
17435 | XFRM_AE_LVAL=4, | |
17436 | XFRM_AE_ETHR=8, | |
17437 | XFRM_AE_CR=16, | |
17438 | XFRM_AE_CE=32, | |
17439 | XFRM_AE_CU=64, | |
17440 | __XFRM_AE_MAX | |
17441 | ||
17442 | ||
17443 | }; | |
17444 | ||
17445 | struct xfrm_userpolicy_type { | |
17446 | __u8 type; | |
17447 | __u16 reserved1; | |
17448 | __u8 reserved2; | |
17449 | }; | |
17450 | ||
17451 | ||
17452 | enum xfrm_attr_type_t { | |
17453 | XFRMA_UNSPEC, | |
17454 | XFRMA_ALG_AUTH, | |
17455 | XFRMA_ALG_CRYPT, | |
17456 | XFRMA_ALG_COMP, | |
17457 | XFRMA_ENCAP, | |
17458 | XFRMA_TMPL, | |
17459 | XFRMA_SA, | |
17460 | XFRMA_POLICY, | |
17461 | XFRMA_SEC_CTX, | |
17462 | XFRMA_LTIME_VAL, | |
17463 | XFRMA_REPLAY_VAL, | |
17464 | XFRMA_REPLAY_THRESH, | |
17465 | XFRMA_ETIMER_THRESH, | |
17466 | XFRMA_SRCADDR, | |
17467 | XFRMA_COADDR, | |
17468 | XFRMA_LASTUSED, | |
17469 | XFRMA_POLICY_TYPE, | |
17470 | __XFRMA_MAX | |
17471 | ||
17472 | ||
17473 | }; | |
17474 | ||
17475 | struct xfrm_usersa_info { | |
17476 | struct xfrm_selector sel; | |
17477 | struct xfrm_id id; | |
17478 | xfrm_address_t saddr; | |
17479 | struct xfrm_lifetime_cfg lft; | |
17480 | struct xfrm_lifetime_cur curlft; | |
17481 | struct xfrm_stats stats; | |
17482 | __u32 seq; | |
17483 | __u32 reqid; | |
17484 | __u16 family; | |
17485 | __u8 mode; | |
17486 | __u8 replay_window; | |
17487 | __u8 flags; | |
17488 | ||
17489 | ||
17490 | ||
17491 | ||
17492 | }; | |
17493 | ||
17494 | struct xfrm_usersa_id { | |
17495 | xfrm_address_t daddr; | |
17496 | __be32 spi; | |
17497 | __u16 family; | |
17498 | __u8 proto; | |
17499 | }; | |
17500 | ||
17501 | struct xfrm_aevent_id { | |
17502 | struct xfrm_usersa_id sa_id; | |
17503 | __u32 flags; | |
17504 | }; | |
17505 | ||
17506 | struct xfrm_userspi_info { | |
17507 | struct xfrm_usersa_info info; | |
17508 | __u32 min; | |
17509 | __u32 max; | |
17510 | }; | |
17511 | ||
17512 | struct xfrm_userpolicy_info { | |
17513 | struct xfrm_selector sel; | |
17514 | struct xfrm_lifetime_cfg lft; | |
17515 | struct xfrm_lifetime_cur curlft; | |
17516 | __u32 priority; | |
17517 | __u32 index; | |
17518 | __u8 dir; | |
17519 | __u8 action; | |
17520 | ||
17521 | ||
17522 | __u8 flags; | |
17523 | ||
17524 | __u8 share; | |
17525 | }; | |
17526 | ||
17527 | struct xfrm_userpolicy_id { | |
17528 | struct xfrm_selector sel; | |
17529 | __u32 index; | |
17530 | __u8 dir; | |
17531 | }; | |
17532 | ||
17533 | struct xfrm_user_acquire { | |
17534 | struct xfrm_id id; | |
17535 | xfrm_address_t saddr; | |
17536 | struct xfrm_selector sel; | |
17537 | struct xfrm_userpolicy_info policy; | |
17538 | __u32 aalgos; | |
17539 | __u32 ealgos; | |
17540 | __u32 calgos; | |
17541 | __u32 seq; | |
17542 | }; | |
17543 | ||
17544 | struct xfrm_user_expire { | |
17545 | struct xfrm_usersa_info state; | |
17546 | __u8 hard; | |
17547 | }; | |
17548 | ||
17549 | struct xfrm_user_polexpire { | |
17550 | struct xfrm_userpolicy_info pol; | |
17551 | __u8 hard; | |
17552 | }; | |
17553 | ||
17554 | struct xfrm_usersa_flush { | |
17555 | __u8 proto; | |
17556 | }; | |
17557 | ||
17558 | struct xfrm_user_report { | |
17559 | __u8 proto; | |
17560 | struct xfrm_selector sel; | |
17561 | }; | |
17562 | # 361 "include/linux/xfrm.h" | |
17563 | enum xfrm_nlgroups { | |
17564 | XFRMNLGRP_NONE, | |
17565 | ||
17566 | XFRMNLGRP_ACQUIRE, | |
17567 | ||
17568 | XFRMNLGRP_EXPIRE, | |
17569 | ||
17570 | XFRMNLGRP_SA, | |
17571 | ||
17572 | XFRMNLGRP_POLICY, | |
17573 | ||
17574 | XFRMNLGRP_AEVENTS, | |
17575 | ||
17576 | XFRMNLGRP_REPORT, | |
17577 | ||
17578 | __XFRMNLGRP_MAX | |
17579 | }; | |
17580 | # 35 "include/linux/security.h" 2 | |
17581 | ||
17582 | ||
17583 | struct ctl_table; | |
17584 | ||
17585 | ||
17586 | ||
17587 | ||
17588 | ||
17589 | extern int cap_capable (struct task_struct *tsk, int cap); | |
17590 | extern int cap_settime (struct timespec *ts, struct timezone *tz); | |
17591 | extern int cap_ptrace (struct task_struct *parent, struct task_struct *child); | |
17592 | extern int cap_capget (struct task_struct *target, kernel_cap_t *effective, kernel_cap_t *inheritable, kernel_cap_t *permitted); | |
17593 | extern int cap_capset_check (struct task_struct *target, kernel_cap_t *effective, kernel_cap_t *inheritable, kernel_cap_t *permitted); | |
17594 | extern void cap_capset_set (struct task_struct *target, kernel_cap_t *effective, kernel_cap_t *inheritable, kernel_cap_t *permitted); | |
17595 | extern int cap_bprm_set_security (struct linux_binprm *bprm); | |
17596 | extern void cap_bprm_apply_creds (struct linux_binprm *bprm, int unsafe); | |
17597 | extern int cap_bprm_secureexec(struct linux_binprm *bprm); | |
17598 | extern int cap_inode_setxattr(struct dentry *dentry, char *name, void *value, size_t size, int flags); | |
17599 | extern int cap_inode_removexattr(struct dentry *dentry, char *name); | |
17600 | extern int cap_task_post_setuid (uid_t old_ruid, uid_t old_euid, uid_t old_suid, int flags); | |
17601 | extern void cap_task_reparent_to_init (struct task_struct *p); | |
17602 | extern int cap_syslog (int type); | |
17603 | extern int cap_vm_enough_memory (long pages); | |
17604 | ||
17605 | struct msghdr; | |
17606 | struct sk_buff; | |
17607 | struct sock; | |
17608 | struct sockaddr; | |
17609 | struct socket; | |
17610 | struct flowi; | |
17611 | struct dst_entry; | |
17612 | struct xfrm_selector; | |
17613 | struct xfrm_policy; | |
17614 | struct xfrm_state; | |
17615 | struct xfrm_user_sec_ctx; | |
17616 | ||
17617 | extern int cap_netlink_send(struct sock *sk, struct sk_buff *skb); | |
17618 | extern int cap_netlink_recv(struct sk_buff *skb, int cap); | |
17619 | # 90 "include/linux/security.h" | |
17620 | struct nfsctl_arg; | |
17621 | struct sched_param; | |
17622 | struct swap_info_struct; | |
17623 | struct request_sock; | |
17624 | # 2154 "include/linux/security.h" | |
17625 | static inline __attribute__((always_inline)) int security_init(void) | |
17626 | { | |
17627 | return 0; | |
17628 | } | |
17629 | ||
17630 | static inline __attribute__((always_inline)) int security_ptrace (struct task_struct *parent, struct task_struct * child) | |
17631 | { | |
17632 | return cap_ptrace (parent, child); | |
17633 | } | |
17634 | ||
17635 | static inline __attribute__((always_inline)) int security_capget (struct task_struct *target, | |
17636 | kernel_cap_t *effective, | |
17637 | kernel_cap_t *inheritable, | |
17638 | kernel_cap_t *permitted) | |
17639 | { | |
17640 | return cap_capget (target, effective, inheritable, permitted); | |
17641 | } | |
17642 | ||
17643 | static inline __attribute__((always_inline)) int security_capset_check (struct task_struct *target, | |
17644 | kernel_cap_t *effective, | |
17645 | kernel_cap_t *inheritable, | |
17646 | kernel_cap_t *permitted) | |
17647 | { | |
17648 | return cap_capset_check (target, effective, inheritable, permitted); | |
17649 | } | |
17650 | ||
17651 | static inline __attribute__((always_inline)) void security_capset_set (struct task_struct *target, | |
17652 | kernel_cap_t *effective, | |
17653 | kernel_cap_t *inheritable, | |
17654 | kernel_cap_t *permitted) | |
17655 | { | |
17656 | cap_capset_set (target, effective, inheritable, permitted); | |
17657 | } | |
17658 | ||
17659 | static inline __attribute__((always_inline)) int security_capable(struct task_struct *tsk, int cap) | |
17660 | { | |
17661 | return cap_capable(tsk, cap); | |
17662 | } | |
17663 | ||
17664 | static inline __attribute__((always_inline)) int security_acct (struct file *file) | |
17665 | { | |
17666 | return 0; | |
17667 | } | |
17668 | ||
17669 | static inline __attribute__((always_inline)) int security_sysctl(struct ctl_table *table, int op) | |
17670 | { | |
17671 | return 0; | |
17672 | } | |
17673 | ||
17674 | static inline __attribute__((always_inline)) int security_quotactl (int cmds, int type, int id, | |
17675 | struct super_block * sb) | |
17676 | { | |
17677 | return 0; | |
17678 | } | |
17679 | ||
17680 | static inline __attribute__((always_inline)) int security_quota_on (struct dentry * dentry) | |
17681 | { | |
17682 | return 0; | |
17683 | } | |
17684 | ||
17685 | static inline __attribute__((always_inline)) int security_syslog(int type) | |
17686 | { | |
17687 | return cap_syslog(type); | |
17688 | } | |
17689 | ||
17690 | static inline __attribute__((always_inline)) int security_settime(struct timespec *ts, struct timezone *tz) | |
17691 | { | |
17692 | return cap_settime(ts, tz); | |
17693 | } | |
17694 | ||
17695 | static inline __attribute__((always_inline)) int security_vm_enough_memory(long pages) | |
17696 | { | |
17697 | return cap_vm_enough_memory(pages); | |
17698 | } | |
17699 | ||
17700 | static inline __attribute__((always_inline)) int security_bprm_alloc (struct linux_binprm *bprm) | |
17701 | { | |
17702 | return 0; | |
17703 | } | |
17704 | ||
17705 | static inline __attribute__((always_inline)) void security_bprm_free (struct linux_binprm *bprm) | |
17706 | { } | |
17707 | ||
17708 | static inline __attribute__((always_inline)) void security_bprm_apply_creds (struct linux_binprm *bprm, int unsafe) | |
17709 | { | |
17710 | cap_bprm_apply_creds (bprm, unsafe); | |
17711 | } | |
17712 | ||
17713 | static inline __attribute__((always_inline)) void security_bprm_post_apply_creds (struct linux_binprm *bprm) | |
17714 | { | |
17715 | return; | |
17716 | } | |
17717 | ||
17718 | static inline __attribute__((always_inline)) int security_bprm_set (struct linux_binprm *bprm) | |
17719 | { | |
17720 | return cap_bprm_set_security (bprm); | |
17721 | } | |
17722 | ||
17723 | static inline __attribute__((always_inline)) int security_bprm_check (struct linux_binprm *bprm) | |
17724 | { | |
17725 | return 0; | |
17726 | } | |
17727 | ||
17728 | static inline __attribute__((always_inline)) int security_bprm_secureexec (struct linux_binprm *bprm) | |
17729 | { | |
17730 | return cap_bprm_secureexec(bprm); | |
17731 | } | |
17732 | ||
17733 | static inline __attribute__((always_inline)) int security_sb_alloc (struct super_block *sb) | |
17734 | { | |
17735 | return 0; | |
17736 | } | |
17737 | ||
17738 | static inline __attribute__((always_inline)) void security_sb_free (struct super_block *sb) | |
17739 | { } | |
17740 | ||
17741 | static inline __attribute__((always_inline)) int security_sb_copy_data (struct file_system_type *type, | |
17742 | void *orig, void *copy) | |
17743 | { | |
17744 | return 0; | |
17745 | } | |
17746 | ||
17747 | static inline __attribute__((always_inline)) int security_sb_kern_mount (struct super_block *sb, void *data) | |
17748 | { | |
17749 | return 0; | |
17750 | } | |
17751 | ||
17752 | static inline __attribute__((always_inline)) int security_sb_statfs (struct dentry *dentry) | |
17753 | { | |
17754 | return 0; | |
17755 | } | |
17756 | ||
17757 | static inline __attribute__((always_inline)) int security_sb_mount (char *dev_name, struct nameidata *nd, | |
17758 | char *type, unsigned long flags, | |
17759 | void *data) | |
17760 | { | |
17761 | return 0; | |
17762 | } | |
17763 | ||
17764 | static inline __attribute__((always_inline)) int security_sb_check_sb (struct vfsmount *mnt, | |
17765 | struct nameidata *nd) | |
17766 | { | |
17767 | return 0; | |
17768 | } | |
17769 | ||
17770 | static inline __attribute__((always_inline)) int security_sb_umount (struct vfsmount *mnt, int flags) | |
17771 | { | |
17772 | return 0; | |
17773 | } | |
17774 | ||
17775 | static inline __attribute__((always_inline)) void security_sb_umount_close (struct vfsmount *mnt) | |
17776 | { } | |
17777 | ||
17778 | static inline __attribute__((always_inline)) void security_sb_umount_busy (struct vfsmount *mnt) | |
17779 | { } | |
17780 | ||
17781 | static inline __attribute__((always_inline)) void security_sb_post_remount (struct vfsmount *mnt, | |
17782 | unsigned long flags, void *data) | |
17783 | { } | |
17784 | ||
17785 | static inline __attribute__((always_inline)) void security_sb_post_mountroot (void) | |
17786 | { } | |
17787 | ||
17788 | static inline __attribute__((always_inline)) void security_sb_post_addmount (struct vfsmount *mnt, | |
17789 | struct nameidata *mountpoint_nd) | |
17790 | { } | |
17791 | ||
17792 | static inline __attribute__((always_inline)) int security_sb_pivotroot (struct nameidata *old_nd, | |
17793 | struct nameidata *new_nd) | |
17794 | { | |
17795 | return 0; | |
17796 | } | |
17797 | ||
17798 | static inline __attribute__((always_inline)) void security_sb_post_pivotroot (struct nameidata *old_nd, | |
17799 | struct nameidata *new_nd) | |
17800 | { } | |
17801 | ||
17802 | static inline __attribute__((always_inline)) int security_inode_alloc (struct inode *inode) | |
17803 | { | |
17804 | return 0; | |
17805 | } | |
17806 | ||
17807 | static inline __attribute__((always_inline)) void security_inode_free (struct inode *inode) | |
17808 | { } | |
17809 | ||
17810 | static inline __attribute__((always_inline)) int security_inode_init_security (struct inode *inode, | |
17811 | struct inode *dir, | |
17812 | char **name, | |
17813 | void **value, | |
17814 | size_t *len) | |
17815 | { | |
17816 | return -95; | |
17817 | } | |
17818 | ||
17819 | static inline __attribute__((always_inline)) int security_inode_create (struct inode *dir, | |
17820 | struct dentry *dentry, | |
17821 | int mode) | |
17822 | { | |
17823 | return 0; | |
17824 | } | |
17825 | ||
17826 | static inline __attribute__((always_inline)) int security_inode_link (struct dentry *old_dentry, | |
17827 | struct inode *dir, | |
17828 | struct dentry *new_dentry) | |
17829 | { | |
17830 | return 0; | |
17831 | } | |
17832 | ||
17833 | static inline __attribute__((always_inline)) int security_inode_unlink (struct inode *dir, | |
17834 | struct dentry *dentry) | |
17835 | { | |
17836 | return 0; | |
17837 | } | |
17838 | ||
17839 | static inline __attribute__((always_inline)) int security_inode_symlink (struct inode *dir, | |
17840 | struct dentry *dentry, | |
17841 | const char *old_name) | |
17842 | { | |
17843 | return 0; | |
17844 | } | |
17845 | ||
17846 | static inline __attribute__((always_inline)) int security_inode_mkdir (struct inode *dir, | |
17847 | struct dentry *dentry, | |
17848 | int mode) | |
17849 | { | |
17850 | return 0; | |
17851 | } | |
17852 | ||
17853 | static inline __attribute__((always_inline)) int security_inode_rmdir (struct inode *dir, | |
17854 | struct dentry *dentry) | |
17855 | { | |
17856 | return 0; | |
17857 | } | |
17858 | ||
17859 | static inline __attribute__((always_inline)) int security_inode_mknod (struct inode *dir, | |
17860 | struct dentry *dentry, | |
17861 | int mode, dev_t dev) | |
17862 | { | |
17863 | return 0; | |
17864 | } | |
17865 | ||
17866 | static inline __attribute__((always_inline)) int security_inode_rename (struct inode *old_dir, | |
17867 | struct dentry *old_dentry, | |
17868 | struct inode *new_dir, | |
17869 | struct dentry *new_dentry) | |
17870 | { | |
17871 | return 0; | |
17872 | } | |
17873 | ||
17874 | static inline __attribute__((always_inline)) int security_inode_readlink (struct dentry *dentry) | |
17875 | { | |
17876 | return 0; | |
17877 | } | |
17878 | ||
17879 | static inline __attribute__((always_inline)) int security_inode_follow_link (struct dentry *dentry, | |
17880 | struct nameidata *nd) | |
17881 | { | |
17882 | return 0; | |
17883 | } | |
17884 | ||
17885 | static inline __attribute__((always_inline)) int security_inode_permission (struct inode *inode, int mask, | |
17886 | struct nameidata *nd) | |
17887 | { | |
17888 | return 0; | |
17889 | } | |
17890 | ||
17891 | static inline __attribute__((always_inline)) int security_inode_setattr (struct dentry *dentry, | |
17892 | struct iattr *attr) | |
17893 | { | |
17894 | return 0; | |
17895 | } | |
17896 | ||
17897 | static inline __attribute__((always_inline)) int security_inode_getattr (struct vfsmount *mnt, | |
17898 | struct dentry *dentry) | |
17899 | { | |
17900 | return 0; | |
17901 | } | |
17902 | ||
17903 | static inline __attribute__((always_inline)) void security_inode_delete (struct inode *inode) | |
17904 | { } | |
17905 | ||
17906 | static inline __attribute__((always_inline)) int security_inode_setxattr (struct dentry *dentry, char *name, | |
17907 | void *value, size_t size, int flags) | |
17908 | { | |
17909 | return cap_inode_setxattr(dentry, name, value, size, flags); | |
17910 | } | |
17911 | ||
17912 | static inline __attribute__((always_inline)) void security_inode_post_setxattr (struct dentry *dentry, char *name, | |
17913 | void *value, size_t size, int flags) | |
17914 | { } | |
17915 | ||
17916 | static inline __attribute__((always_inline)) int security_inode_getxattr (struct dentry *dentry, char *name) | |
17917 | { | |
17918 | return 0; | |
17919 | } | |
17920 | ||
17921 | static inline __attribute__((always_inline)) int security_inode_listxattr (struct dentry *dentry) | |
17922 | { | |
17923 | return 0; | |
17924 | } | |
17925 | ||
17926 | static inline __attribute__((always_inline)) int security_inode_removexattr (struct dentry *dentry, char *name) | |
17927 | { | |
17928 | return cap_inode_removexattr(dentry, name); | |
17929 | } | |
17930 | ||
17931 | static inline __attribute__((always_inline)) const char *security_inode_xattr_getsuffix (void) | |
17932 | { | |
17933 | return ((void *)0) ; | |
17934 | } | |
17935 | ||
17936 | static inline __attribute__((always_inline)) int security_inode_getsecurity(const struct inode *inode, const char *name, void *buffer, size_t size, int err) | |
17937 | { | |
17938 | return -95; | |
17939 | } | |
17940 | ||
17941 | static inline __attribute__((always_inline)) int security_inode_setsecurity(struct inode *inode, const char *name, const void *value, size_t size, int flags) | |
17942 | { | |
17943 | return -95; | |
17944 | } | |
17945 | ||
17946 | static inline __attribute__((always_inline)) int security_inode_listsecurity(struct inode *inode, char *buffer, size_t buffer_size) | |
17947 | { | |
17948 | return 0; | |
17949 | } | |
17950 | ||
17951 | static inline __attribute__((always_inline)) int security_file_permission (struct file *file, int mask) | |
17952 | { | |
17953 | return 0; | |
17954 | } | |
17955 | ||
17956 | static inline __attribute__((always_inline)) int security_file_alloc (struct file *file) | |
17957 | { | |
17958 | return 0; | |
17959 | } | |
17960 | ||
17961 | static inline __attribute__((always_inline)) void security_file_free (struct file *file) | |
17962 | { } | |
17963 | ||
17964 | static inline __attribute__((always_inline)) int security_file_ioctl (struct file *file, unsigned int cmd, | |
17965 | unsigned long arg) | |
17966 | { | |
17967 | return 0; | |
17968 | } | |
17969 | ||
17970 | static inline __attribute__((always_inline)) int security_file_mmap (struct file *file, unsigned long reqprot, | |
17971 | unsigned long prot, | |
17972 | unsigned long flags) | |
17973 | { | |
17974 | return 0; | |
17975 | } | |
17976 | ||
17977 | static inline __attribute__((always_inline)) int security_file_mprotect (struct vm_area_struct *vma, | |
17978 | unsigned long reqprot, | |
17979 | unsigned long prot) | |
17980 | { | |
17981 | return 0; | |
17982 | } | |
17983 | ||
17984 | static inline __attribute__((always_inline)) int security_file_lock (struct file *file, unsigned int cmd) | |
17985 | { | |
17986 | return 0; | |
17987 | } | |
17988 | ||
17989 | static inline __attribute__((always_inline)) int security_file_fcntl (struct file *file, unsigned int cmd, | |
17990 | unsigned long arg) | |
17991 | { | |
17992 | return 0; | |
17993 | } | |
17994 | ||
17995 | static inline __attribute__((always_inline)) int security_file_set_fowner (struct file *file) | |
17996 | { | |
17997 | return 0; | |
17998 | } | |
17999 | ||
18000 | static inline __attribute__((always_inline)) int security_file_send_sigiotask (struct task_struct *tsk, | |
18001 | struct fown_struct *fown, | |
18002 | int sig) | |
18003 | { | |
18004 | return 0; | |
18005 | } | |
18006 | ||
18007 | static inline __attribute__((always_inline)) int security_file_receive (struct file *file) | |
18008 | { | |
18009 | return 0; | |
18010 | } | |
18011 | ||
18012 | static inline __attribute__((always_inline)) int security_task_create (unsigned long clone_flags) | |
18013 | { | |
18014 | return 0; | |
18015 | } | |
18016 | ||
18017 | static inline __attribute__((always_inline)) int security_task_alloc (struct task_struct *p) | |
18018 | { | |
18019 | return 0; | |
18020 | } | |
18021 | ||
18022 | static inline __attribute__((always_inline)) void security_task_free (struct task_struct *p) | |
18023 | { } | |
18024 | ||
18025 | static inline __attribute__((always_inline)) int security_task_setuid (uid_t id0, uid_t id1, uid_t id2, | |
18026 | int flags) | |
18027 | { | |
18028 | return 0; | |
18029 | } | |
18030 | ||
18031 | static inline __attribute__((always_inline)) int security_task_post_setuid (uid_t old_ruid, uid_t old_euid, | |
18032 | uid_t old_suid, int flags) | |
18033 | { | |
18034 | return cap_task_post_setuid (old_ruid, old_euid, old_suid, flags); | |
18035 | } | |
18036 | ||
18037 | static inline __attribute__((always_inline)) int security_task_setgid (gid_t id0, gid_t id1, gid_t id2, | |
18038 | int flags) | |
18039 | { | |
18040 | return 0; | |
18041 | } | |
18042 | ||
18043 | static inline __attribute__((always_inline)) int security_task_setpgid (struct task_struct *p, pid_t pgid) | |
18044 | { | |
18045 | return 0; | |
18046 | } | |
18047 | ||
18048 | static inline __attribute__((always_inline)) int security_task_getpgid (struct task_struct *p) | |
18049 | { | |
18050 | return 0; | |
18051 | } | |
18052 | ||
18053 | static inline __attribute__((always_inline)) int security_task_getsid (struct task_struct *p) | |
18054 | { | |
18055 | return 0; | |
18056 | } | |
18057 | ||
18058 | static inline __attribute__((always_inline)) void security_task_getsecid (struct task_struct *p, u32 *secid) | |
18059 | { } | |
18060 | ||
18061 | static inline __attribute__((always_inline)) int security_task_setgroups (struct group_info *group_info) | |
18062 | { | |
18063 | return 0; | |
18064 | } | |
18065 | ||
18066 | static inline __attribute__((always_inline)) int security_task_setnice (struct task_struct *p, int nice) | |
18067 | { | |
18068 | return 0; | |
18069 | } | |
18070 | ||
18071 | static inline __attribute__((always_inline)) int security_task_setioprio (struct task_struct *p, int ioprio) | |
18072 | { | |
18073 | return 0; | |
18074 | } | |
18075 | ||
18076 | static inline __attribute__((always_inline)) int security_task_getioprio (struct task_struct *p) | |
18077 | { | |
18078 | return 0; | |
18079 | } | |
18080 | ||
18081 | static inline __attribute__((always_inline)) int security_task_setrlimit (unsigned int resource, | |
18082 | struct rlimit *new_rlim) | |
18083 | { | |
18084 | return 0; | |
18085 | } | |
18086 | ||
18087 | static inline __attribute__((always_inline)) int security_task_setscheduler (struct task_struct *p, | |
18088 | int policy, | |
18089 | struct sched_param *lp) | |
18090 | { | |
18091 | return 0; | |
18092 | } | |
18093 | ||
18094 | static inline __attribute__((always_inline)) int security_task_getscheduler (struct task_struct *p) | |
18095 | { | |
18096 | return 0; | |
18097 | } | |
18098 | ||
18099 | static inline __attribute__((always_inline)) int security_task_movememory (struct task_struct *p) | |
18100 | { | |
18101 | return 0; | |
18102 | } | |
18103 | ||
18104 | static inline __attribute__((always_inline)) int security_task_kill (struct task_struct *p, | |
18105 | struct siginfo *info, int sig, | |
18106 | u32 secid) | |
18107 | { | |
18108 | return 0; | |
18109 | } | |
18110 | ||
18111 | static inline __attribute__((always_inline)) int security_task_wait (struct task_struct *p) | |
18112 | { | |
18113 | return 0; | |
18114 | } | |
18115 | ||
18116 | static inline __attribute__((always_inline)) int security_task_prctl (int option, unsigned long arg2, | |
18117 | unsigned long arg3, | |
18118 | unsigned long arg4, | |
18119 | unsigned long arg5) | |
18120 | { | |
18121 | return 0; | |
18122 | } | |
18123 | ||
18124 | static inline __attribute__((always_inline)) void security_task_reparent_to_init (struct task_struct *p) | |
18125 | { | |
18126 | cap_task_reparent_to_init (p); | |
18127 | } | |
18128 | ||
18129 | static inline __attribute__((always_inline)) void security_task_to_inode(struct task_struct *p, struct inode *inode) | |
18130 | { } | |
18131 | ||
18132 | static inline __attribute__((always_inline)) int security_ipc_permission (struct kern_ipc_perm *ipcp, | |
18133 | short flag) | |
18134 | { | |
18135 | return 0; | |
18136 | } | |
18137 | ||
18138 | static inline __attribute__((always_inline)) int security_msg_msg_alloc (struct msg_msg * msg) | |
18139 | { | |
18140 | return 0; | |
18141 | } | |
18142 | ||
18143 | static inline __attribute__((always_inline)) void security_msg_msg_free (struct msg_msg * msg) | |
18144 | { } | |
18145 | ||
18146 | static inline __attribute__((always_inline)) int security_msg_queue_alloc (struct msg_queue *msq) | |
18147 | { | |
18148 | return 0; | |
18149 | } | |
18150 | ||
18151 | static inline __attribute__((always_inline)) void security_msg_queue_free (struct msg_queue *msq) | |
18152 | { } | |
18153 | ||
18154 | static inline __attribute__((always_inline)) int security_msg_queue_associate (struct msg_queue * msq, | |
18155 | int msqflg) | |
18156 | { | |
18157 | return 0; | |
18158 | } | |
18159 | ||
18160 | static inline __attribute__((always_inline)) int security_msg_queue_msgctl (struct msg_queue * msq, int cmd) | |
18161 | { | |
18162 | return 0; | |
18163 | } | |
18164 | ||
18165 | static inline __attribute__((always_inline)) int security_msg_queue_msgsnd (struct msg_queue * msq, | |
18166 | struct msg_msg * msg, int msqflg) | |
18167 | { | |
18168 | return 0; | |
18169 | } | |
18170 | ||
18171 | static inline __attribute__((always_inline)) int security_msg_queue_msgrcv (struct msg_queue * msq, | |
18172 | struct msg_msg * msg, | |
18173 | struct task_struct * target, | |
18174 | long type, int mode) | |
18175 | { | |
18176 | return 0; | |
18177 | } | |
18178 | ||
18179 | static inline __attribute__((always_inline)) int security_shm_alloc (struct shmid_kernel *shp) | |
18180 | { | |
18181 | return 0; | |
18182 | } | |
18183 | ||
18184 | static inline __attribute__((always_inline)) void security_shm_free (struct shmid_kernel *shp) | |
18185 | { } | |
18186 | ||
18187 | static inline __attribute__((always_inline)) int security_shm_associate (struct shmid_kernel * shp, | |
18188 | int shmflg) | |
18189 | { | |
18190 | return 0; | |
18191 | } | |
18192 | ||
18193 | static inline __attribute__((always_inline)) int security_shm_shmctl (struct shmid_kernel * shp, int cmd) | |
18194 | { | |
18195 | return 0; | |
18196 | } | |
18197 | ||
18198 | static inline __attribute__((always_inline)) int security_shm_shmat (struct shmid_kernel * shp, | |
18199 | char *shmaddr, int shmflg) | |
18200 | { | |
18201 | return 0; | |
18202 | } | |
18203 | ||
18204 | static inline __attribute__((always_inline)) int security_sem_alloc (struct sem_array *sma) | |
18205 | { | |
18206 | return 0; | |
18207 | } | |
18208 | ||
18209 | static inline __attribute__((always_inline)) void security_sem_free (struct sem_array *sma) | |
18210 | { } | |
18211 | ||
18212 | static inline __attribute__((always_inline)) int security_sem_associate (struct sem_array * sma, int semflg) | |
18213 | { | |
18214 | return 0; | |
18215 | } | |
18216 | ||
18217 | static inline __attribute__((always_inline)) int security_sem_semctl (struct sem_array * sma, int cmd) | |
18218 | { | |
18219 | return 0; | |
18220 | } | |
18221 | ||
18222 | static inline __attribute__((always_inline)) int security_sem_semop (struct sem_array * sma, | |
18223 | struct sembuf * sops, unsigned nsops, | |
18224 | int alter) | |
18225 | { | |
18226 | return 0; | |
18227 | } | |
18228 | ||
18229 | static inline __attribute__((always_inline)) void security_d_instantiate (struct dentry *dentry, struct inode *inode) | |
18230 | { } | |
18231 | ||
18232 | static inline __attribute__((always_inline)) int security_getprocattr(struct task_struct *p, char *name, void *value, size_t size) | |
18233 | { | |
18234 | return -22; | |
18235 | } | |
18236 | ||
18237 | static inline __attribute__((always_inline)) int security_setprocattr(struct task_struct *p, char *name, void *value, size_t size) | |
18238 | { | |
18239 | return -22; | |
18240 | } | |
18241 | ||
18242 | static inline __attribute__((always_inline)) int security_netlink_send (struct sock *sk, struct sk_buff *skb) | |
18243 | { | |
18244 | return cap_netlink_send (sk, skb); | |
18245 | } | |
18246 | ||
18247 | static inline __attribute__((always_inline)) int security_netlink_recv (struct sk_buff *skb, int cap) | |
18248 | { | |
18249 | return cap_netlink_recv (skb, cap); | |
18250 | } | |
18251 | ||
18252 | static inline __attribute__((always_inline)) struct dentry *securityfs_create_dir(const char *name, | |
18253 | struct dentry *parent) | |
18254 | { | |
18255 | return ERR_PTR(-19); | |
18256 | } | |
18257 | ||
18258 | static inline __attribute__((always_inline)) struct dentry *securityfs_create_file(const char *name, | |
18259 | mode_t mode, | |
18260 | struct dentry *parent, | |
18261 | void *data, | |
18262 | struct file_operations *fops) | |
18263 | { | |
18264 | return ERR_PTR(-19); | |
18265 | } | |
18266 | ||
18267 | static inline __attribute__((always_inline)) void securityfs_remove(struct dentry *dentry) | |
18268 | { | |
18269 | } | |
18270 | ||
18271 | static inline __attribute__((always_inline)) int security_secid_to_secctx(u32 secid, char **secdata, u32 *seclen) | |
18272 | { | |
18273 | return -95; | |
18274 | } | |
18275 | ||
18276 | static inline __attribute__((always_inline)) void security_release_secctx(char *secdata, u32 seclen) | |
18277 | { | |
18278 | } | |
18279 | # 2970 "include/linux/security.h" | |
18280 | static inline __attribute__((always_inline)) int security_unix_stream_connect(struct socket * sock, | |
18281 | struct socket * other, | |
18282 | struct sock * newsk) | |
18283 | { | |
18284 | return 0; | |
18285 | } | |
18286 | ||
18287 | static inline __attribute__((always_inline)) int security_unix_may_send(struct socket * sock, | |
18288 | struct socket * other) | |
18289 | { | |
18290 | return 0; | |
18291 | } | |
18292 | ||
18293 | static inline __attribute__((always_inline)) int security_socket_create (int family, int type, | |
18294 | int protocol, int kern) | |
18295 | { | |
18296 | return 0; | |
18297 | } | |
18298 | ||
18299 | static inline __attribute__((always_inline)) int security_socket_post_create(struct socket * sock, | |
18300 | int family, | |
18301 | int type, | |
18302 | int protocol, int kern) | |
18303 | { | |
18304 | return 0; | |
18305 | } | |
18306 | ||
18307 | static inline __attribute__((always_inline)) int security_socket_bind(struct socket * sock, | |
18308 | struct sockaddr * address, | |
18309 | int addrlen) | |
18310 | { | |
18311 | return 0; | |
18312 | } | |
18313 | ||
18314 | static inline __attribute__((always_inline)) int security_socket_connect(struct socket * sock, | |
18315 | struct sockaddr * address, | |
18316 | int addrlen) | |
18317 | { | |
18318 | return 0; | |
18319 | } | |
18320 | ||
18321 | static inline __attribute__((always_inline)) int security_socket_listen(struct socket * sock, int backlog) | |
18322 | { | |
18323 | return 0; | |
18324 | } | |
18325 | ||
18326 | static inline __attribute__((always_inline)) int security_socket_accept(struct socket * sock, | |
18327 | struct socket * newsock) | |
18328 | { | |
18329 | return 0; | |
18330 | } | |
18331 | ||
18332 | static inline __attribute__((always_inline)) void security_socket_post_accept(struct socket * sock, | |
18333 | struct socket * newsock) | |
18334 | { | |
18335 | } | |
18336 | ||
18337 | static inline __attribute__((always_inline)) int security_socket_sendmsg(struct socket * sock, | |
18338 | struct msghdr * msg, int size) | |
18339 | { | |
18340 | return 0; | |
18341 | } | |
18342 | ||
18343 | static inline __attribute__((always_inline)) int security_socket_recvmsg(struct socket * sock, | |
18344 | struct msghdr * msg, int size, | |
18345 | int flags) | |
18346 | { | |
18347 | return 0; | |
18348 | } | |
18349 | ||
18350 | static inline __attribute__((always_inline)) int security_socket_getsockname(struct socket * sock) | |
18351 | { | |
18352 | return 0; | |
18353 | } | |
18354 | ||
18355 | static inline __attribute__((always_inline)) int security_socket_getpeername(struct socket * sock) | |
18356 | { | |
18357 | return 0; | |
18358 | } | |
18359 | ||
18360 | static inline __attribute__((always_inline)) int security_socket_getsockopt(struct socket * sock, | |
18361 | int level, int optname) | |
18362 | { | |
18363 | return 0; | |
18364 | } | |
18365 | ||
18366 | static inline __attribute__((always_inline)) int security_socket_setsockopt(struct socket * sock, | |
18367 | int level, int optname) | |
18368 | { | |
18369 | return 0; | |
18370 | } | |
18371 | ||
18372 | static inline __attribute__((always_inline)) int security_socket_shutdown(struct socket * sock, int how) | |
18373 | { | |
18374 | return 0; | |
18375 | } | |
18376 | static inline __attribute__((always_inline)) int security_sock_rcv_skb (struct sock * sk, | |
18377 | struct sk_buff * skb) | |
18378 | { | |
18379 | return 0; | |
18380 | } | |
18381 | ||
18382 | static inline __attribute__((always_inline)) int security_socket_getpeersec_stream(struct socket *sock, char *optval, | |
18383 | int *optlen, unsigned len) | |
18384 | { | |
18385 | return -92; | |
18386 | } | |
18387 | ||
18388 | static inline __attribute__((always_inline)) int security_socket_getpeersec_dgram(struct socket *sock, struct sk_buff *skb, u32 *secid) | |
18389 | { | |
18390 | return -92; | |
18391 | } | |
18392 | ||
18393 | static inline __attribute__((always_inline)) int security_sk_alloc(struct sock *sk, int family, gfp_t priority) | |
18394 | { | |
18395 | return 0; | |
18396 | } | |
18397 | ||
18398 | static inline __attribute__((always_inline)) void security_sk_free(struct sock *sk) | |
18399 | { | |
18400 | } | |
18401 | ||
18402 | static inline __attribute__((always_inline)) void security_sk_clone(const struct sock *sk, struct sock *newsk) | |
18403 | { | |
18404 | } | |
18405 | ||
18406 | static inline __attribute__((always_inline)) void security_sk_classify_flow(struct sock *sk, struct flowi *fl) | |
18407 | { | |
18408 | } | |
18409 | ||
18410 | static inline __attribute__((always_inline)) void security_req_classify_flow(const struct request_sock *req, struct flowi *fl) | |
18411 | { | |
18412 | } | |
18413 | ||
18414 | static inline __attribute__((always_inline)) void security_sock_graft(struct sock* sk, struct socket *parent) | |
18415 | { | |
18416 | } | |
18417 | ||
18418 | static inline __attribute__((always_inline)) int security_inet_conn_request(struct sock *sk, | |
18419 | struct sk_buff *skb, struct request_sock *req) | |
18420 | { | |
18421 | return 0; | |
18422 | } | |
18423 | ||
18424 | static inline __attribute__((always_inline)) void security_inet_csk_clone(struct sock *newsk, | |
18425 | const struct request_sock *req) | |
18426 | { | |
18427 | } | |
18428 | # 3194 "include/linux/security.h" | |
18429 | static inline __attribute__((always_inline)) int security_xfrm_policy_alloc(struct xfrm_policy *xp, struct xfrm_user_sec_ctx *sec_ctx) | |
18430 | { | |
18431 | return 0; | |
18432 | } | |
18433 | ||
18434 | static inline __attribute__((always_inline)) int security_xfrm_policy_clone(struct xfrm_policy *old, struct xfrm_policy *new) | |
18435 | { | |
18436 | return 0; | |
18437 | } | |
18438 | ||
18439 | static inline __attribute__((always_inline)) void security_xfrm_policy_free(struct xfrm_policy *xp) | |
18440 | { | |
18441 | } | |
18442 | ||
18443 | static inline __attribute__((always_inline)) int security_xfrm_policy_delete(struct xfrm_policy *xp) | |
18444 | { | |
18445 | return 0; | |
18446 | } | |
18447 | ||
18448 | static inline __attribute__((always_inline)) int security_xfrm_state_alloc(struct xfrm_state *x, | |
18449 | struct xfrm_user_sec_ctx *sec_ctx) | |
18450 | { | |
18451 | return 0; | |
18452 | } | |
18453 | ||
18454 | static inline __attribute__((always_inline)) int security_xfrm_state_alloc_acquire(struct xfrm_state *x, | |
18455 | struct xfrm_sec_ctx *polsec, u32 secid) | |
18456 | { | |
18457 | return 0; | |
18458 | } | |
18459 | ||
18460 | static inline __attribute__((always_inline)) void security_xfrm_state_free(struct xfrm_state *x) | |
18461 | { | |
18462 | } | |
18463 | ||
18464 | static inline __attribute__((always_inline)) int security_xfrm_state_delete(struct xfrm_state *x) | |
18465 | { | |
18466 | return 0; | |
18467 | } | |
18468 | ||
18469 | static inline __attribute__((always_inline)) int security_xfrm_policy_lookup(struct xfrm_policy *xp, u32 fl_secid, u8 dir) | |
18470 | { | |
18471 | return 0; | |
18472 | } | |
18473 | ||
18474 | static inline __attribute__((always_inline)) int security_xfrm_state_pol_flow_match(struct xfrm_state *x, | |
18475 | struct xfrm_policy *xp, struct flowi *fl) | |
18476 | { | |
18477 | return 1; | |
18478 | } | |
18479 | ||
18480 | static inline __attribute__((always_inline)) int security_xfrm_flow_state_match(struct flowi *fl, | |
18481 | struct xfrm_state *xfrm, struct xfrm_policy *xp) | |
18482 | { | |
18483 | return 1; | |
18484 | } | |
18485 | ||
18486 | static inline __attribute__((always_inline)) int security_xfrm_decode_session(struct sk_buff *skb, u32 *secid) | |
18487 | { | |
18488 | return 0; | |
18489 | } | |
18490 | ||
18491 | static inline __attribute__((always_inline)) void security_skb_classify_flow(struct sk_buff *skb, struct flowi *fl) | |
18492 | { | |
18493 | } | |
18494 | # 51 "include/net/sock.h" 2 | |
18495 | ||
18496 | # 1 "include/linux/filter.h" 1 | |
18497 | # 26 "include/linux/filter.h" | |
18498 | struct sock_filter | |
18499 | { | |
18500 | __u16 code; | |
18501 | __u8 jt; | |
18502 | __u8 jf; | |
18503 | __u32 k; | |
18504 | }; | |
18505 | ||
18506 | struct sock_fprog | |
18507 | { | |
18508 | unsigned short len; | |
18509 | struct sock_filter *filter; | |
18510 | }; | |
18511 | ||
18512 | ||
18513 | struct sk_filter | |
18514 | { | |
18515 | atomic_t refcnt; | |
18516 | unsigned int len; | |
18517 | struct rcu_head rcu; | |
18518 | struct sock_filter insns[0]; | |
18519 | }; | |
18520 | ||
18521 | static inline __attribute__((always_inline)) unsigned int sk_filter_len(struct sk_filter *fp) | |
18522 | { | |
18523 | return fp->len*sizeof(struct sock_filter) + sizeof(*fp); | |
18524 | } | |
18525 | # 144 "include/linux/filter.h" | |
18526 | struct sk_buff; | |
18527 | struct sock; | |
18528 | ||
18529 | extern unsigned int sk_run_filter(struct sk_buff *skb, struct sock_filter *filter, int flen); | |
18530 | extern int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk); | |
18531 | extern int sk_chk_filter(struct sock_filter *filter, int flen); | |
18532 | # 53 "include/net/sock.h" 2 | |
18533 | ||
18534 | ||
18535 | # 1 "include/net/dst.h" 1 | |
18536 | # 12 "include/net/dst.h" | |
18537 | # 1 "include/linux/rtnetlink.h" 1 | |
18538 | ||
18539 | ||
18540 | ||
18541 | # 1 "include/linux/netlink.h" 1 | |
18542 | # 29 "include/linux/netlink.h" | |
18543 | struct sockaddr_nl | |
18544 | { | |
18545 | sa_family_t nl_family; | |
18546 | unsigned short nl_pad; | |
18547 | __u32 nl_pid; | |
18548 | __u32 nl_groups; | |
18549 | }; | |
18550 | ||
18551 | struct nlmsghdr | |
18552 | { | |
18553 | __u32 nlmsg_len; | |
18554 | __u16 nlmsg_type; | |
18555 | __u16 nlmsg_flags; | |
18556 | __u32 nlmsg_seq; | |
18557 | __u32 nlmsg_pid; | |
18558 | }; | |
18559 | # 94 "include/linux/netlink.h" | |
18560 | struct nlmsgerr | |
18561 | { | |
18562 | int error; | |
18563 | struct nlmsghdr msg; | |
18564 | }; | |
18565 | ||
18566 | ||
18567 | ||
18568 | ||
18569 | ||
18570 | struct nl_pktinfo | |
18571 | { | |
18572 | __u32 group; | |
18573 | }; | |
18574 | ||
18575 | ||
18576 | ||
18577 | enum { | |
18578 | NETLINK_UNCONNECTED = 0, | |
18579 | NETLINK_CONNECTED, | |
18580 | }; | |
18581 | # 125 "include/linux/netlink.h" | |
18582 | struct nlattr | |
18583 | { | |
18584 | __u16 nla_len; | |
18585 | __u16 nla_type; | |
18586 | }; | |
18587 | # 140 "include/linux/netlink.h" | |
18588 | struct netlink_skb_parms | |
18589 | { | |
18590 | struct ucred creds; | |
18591 | __u32 pid; | |
18592 | __u32 dst_pid; | |
18593 | __u32 dst_group; | |
18594 | kernel_cap_t eff_cap; | |
18595 | __u32 loginuid; | |
18596 | __u32 sid; | |
18597 | }; | |
18598 | ||
18599 | ||
18600 | ||
18601 | ||
18602 | ||
18603 | extern struct sock *netlink_kernel_create(int unit, unsigned int groups, void (*input)(struct sock *sk, int len), struct module *module); | |
18604 | extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err); | |
18605 | extern int netlink_has_listeners(struct sock *sk, unsigned int group); | |
18606 | extern int netlink_unicast(struct sock *ssk, struct sk_buff *skb, __u32 pid, int nonblock); | |
18607 | extern int netlink_broadcast(struct sock *ssk, struct sk_buff *skb, __u32 pid, | |
18608 | __u32 group, gfp_t allocation); | |
18609 | extern void netlink_set_err(struct sock *ssk, __u32 pid, __u32 group, int code); | |
18610 | extern int netlink_register_notifier(struct notifier_block *nb); | |
18611 | extern int netlink_unregister_notifier(struct notifier_block *nb); | |
18612 | ||
18613 | ||
18614 | struct sock *netlink_getsockbyfilp(struct file *filp); | |
18615 | int netlink_attachskb(struct sock *sk, struct sk_buff *skb, int nonblock, | |
18616 | long timeo, struct sock *ssk); | |
18617 | void netlink_detachskb(struct sock *sk, struct sk_buff *skb); | |
18618 | int netlink_sendskb(struct sock *sk, struct sk_buff *skb, int protocol); | |
18619 | # 179 "include/linux/netlink.h" | |
18620 | struct netlink_callback | |
18621 | { | |
18622 | struct sk_buff *skb; | |
18623 | struct nlmsghdr *nlh; | |
18624 | int (*dump)(struct sk_buff * skb, struct netlink_callback *cb); | |
18625 | int (*done)(struct netlink_callback *cb); | |
18626 | int family; | |
18627 | long args[5]; | |
18628 | }; | |
18629 | ||
18630 | struct netlink_notify | |
18631 | { | |
18632 | int pid; | |
18633 | int protocol; | |
18634 | }; | |
18635 | ||
18636 | static __inline__ __attribute__((always_inline)) struct nlmsghdr * | |
18637 | __nlmsg_put(struct sk_buff *skb, u32 pid, u32 seq, int type, int len, int flags) | |
18638 | { | |
18639 | struct nlmsghdr *nlh; | |
18640 | int size = ((len)+( ((((int) ( ((sizeof(struct nlmsghdr))+4 -1) & ~(4 -1) )))+4 -1) & ~(4 -1) )); | |
18641 | ||
18642 | nlh = (struct nlmsghdr*)skb_put(skb, ( ((size)+4 -1) & ~(4 -1) )); | |
18643 | nlh->nlmsg_type = type; | |
18644 | nlh->nlmsg_len = size; | |
18645 | nlh->nlmsg_flags = flags; | |
18646 | nlh->nlmsg_pid = pid; | |
18647 | nlh->nlmsg_seq = seq; | |
18648 | memset(((void*)(((char*)nlh) + ((0)+( ((((int) ( ((sizeof(struct nlmsghdr))+4 -1) & ~(4 -1) )))+4 -1) & ~(4 -1) )))) + len, 0, ( ((size)+4 -1) & ~(4 -1) ) - size); | |
18649 | return nlh; | |
18650 | } | |
18651 | # 231 "include/linux/netlink.h" | |
18652 | extern int netlink_dump_start(struct sock *ssk, struct sk_buff *skb, | |
18653 | struct nlmsghdr *nlh, | |
18654 | int (*dump)(struct sk_buff *skb, struct netlink_callback*), | |
18655 | int (*done)(struct netlink_callback*)); | |
18656 | ||
18657 | ||
18658 | ||
18659 | ||
18660 | extern void netlink_set_nonroot(int protocol, unsigned flag); | |
18661 | # 5 "include/linux/rtnetlink.h" 2 | |
18662 | # 1 "include/linux/if_link.h" 1 | |
18663 | ||
18664 | ||
18665 | ||
18666 | ||
18667 | ||
18668 | ||
18669 | struct rtnl_link_stats | |
18670 | { | |
18671 | __u32 rx_packets; | |
18672 | __u32 tx_packets; | |
18673 | __u32 rx_bytes; | |
18674 | __u32 tx_bytes; | |
18675 | __u32 rx_errors; | |
18676 | __u32 tx_errors; | |
18677 | __u32 rx_dropped; | |
18678 | __u32 tx_dropped; | |
18679 | __u32 multicast; | |
18680 | __u32 collisions; | |
18681 | ||
18682 | ||
18683 | __u32 rx_length_errors; | |
18684 | __u32 rx_over_errors; | |
18685 | __u32 rx_crc_errors; | |
18686 | __u32 rx_frame_errors; | |
18687 | __u32 rx_fifo_errors; | |
18688 | __u32 rx_missed_errors; | |
18689 | ||
18690 | ||
18691 | __u32 tx_aborted_errors; | |
18692 | __u32 tx_carrier_errors; | |
18693 | __u32 tx_fifo_errors; | |
18694 | __u32 tx_heartbeat_errors; | |
18695 | __u32 tx_window_errors; | |
18696 | ||
18697 | ||
18698 | __u32 rx_compressed; | |
18699 | __u32 tx_compressed; | |
18700 | }; | |
18701 | ||
18702 | ||
18703 | struct rtnl_link_ifmap | |
18704 | { | |
18705 | __u64 mem_start; | |
18706 | __u64 mem_end; | |
18707 | __u64 base_addr; | |
18708 | __u16 irq; | |
18709 | __u8 dma; | |
18710 | __u8 port; | |
18711 | }; | |
18712 | ||
18713 | enum | |
18714 | { | |
18715 | IFLA_UNSPEC, | |
18716 | IFLA_ADDRESS, | |
18717 | IFLA_BROADCAST, | |
18718 | IFLA_IFNAME, | |
18719 | IFLA_MTU, | |
18720 | IFLA_LINK, | |
18721 | IFLA_QDISC, | |
18722 | IFLA_STATS, | |
18723 | IFLA_COST, | |
18724 | ||
18725 | IFLA_PRIORITY, | |
18726 | ||
18727 | IFLA_MASTER, | |
18728 | ||
18729 | IFLA_WIRELESS, | |
18730 | ||
18731 | IFLA_PROTINFO, | |
18732 | ||
18733 | IFLA_TXQLEN, | |
18734 | ||
18735 | IFLA_MAP, | |
18736 | ||
18737 | IFLA_WEIGHT, | |
18738 | ||
18739 | IFLA_OPERSTATE, | |
18740 | IFLA_LINKMODE, | |
18741 | __IFLA_MAX | |
18742 | }; | |
18743 | # 121 "include/linux/if_link.h" | |
18744 | enum | |
18745 | { | |
18746 | IFLA_INET6_UNSPEC, | |
18747 | IFLA_INET6_FLAGS, | |
18748 | IFLA_INET6_CONF, | |
18749 | IFLA_INET6_STATS, | |
18750 | IFLA_INET6_MCAST, | |
18751 | IFLA_INET6_CACHEINFO, | |
18752 | __IFLA_INET6_MAX | |
18753 | }; | |
18754 | ||
18755 | ||
18756 | ||
18757 | struct ifla_cacheinfo | |
18758 | { | |
18759 | __u32 max_reasm_len; | |
18760 | __u32 tstamp; | |
18761 | __u32 reachable_time; | |
18762 | __u32 retrans_time; | |
18763 | }; | |
18764 | # 6 "include/linux/rtnetlink.h" 2 | |
18765 | # 1 "include/linux/if_addr.h" 1 | |
18766 | ||
18767 | ||
18768 | ||
18769 | ||
18770 | ||
18771 | struct ifaddrmsg | |
18772 | { | |
18773 | __u8 ifa_family; | |
18774 | __u8 ifa_prefixlen; | |
18775 | __u8 ifa_flags; | |
18776 | __u8 ifa_scope; | |
18777 | __u32 ifa_index; | |
18778 | }; | |
18779 | # 22 "include/linux/if_addr.h" | |
18780 | enum | |
18781 | { | |
18782 | IFA_UNSPEC, | |
18783 | IFA_ADDRESS, | |
18784 | IFA_LOCAL, | |
18785 | IFA_LABEL, | |
18786 | IFA_BROADCAST, | |
18787 | IFA_ANYCAST, | |
18788 | IFA_CACHEINFO, | |
18789 | IFA_MULTICAST, | |
18790 | __IFA_MAX, | |
18791 | }; | |
18792 | # 47 "include/linux/if_addr.h" | |
18793 | struct ifa_cacheinfo | |
18794 | { | |
18795 | __u32 ifa_prefered; | |
18796 | __u32 ifa_valid; | |
18797 | __u32 cstamp; | |
18798 | __u32 tstamp; | |
18799 | }; | |
18800 | # 7 "include/linux/rtnetlink.h" 2 | |
18801 | # 1 "include/linux/neighbour.h" 1 | |
18802 | ||
18803 | ||
18804 | ||
18805 | ||
18806 | ||
18807 | struct ndmsg | |
18808 | { | |
18809 | __u8 ndm_family; | |
18810 | __u8 ndm_pad1; | |
18811 | __u16 ndm_pad2; | |
18812 | __s32 ndm_ifindex; | |
18813 | __u16 ndm_state; | |
18814 | __u8 ndm_flags; | |
18815 | __u8 ndm_type; | |
18816 | }; | |
18817 | ||
18818 | enum | |
18819 | { | |
18820 | NDA_UNSPEC, | |
18821 | NDA_DST, | |
18822 | NDA_LLADDR, | |
18823 | NDA_CACHEINFO, | |
18824 | NDA_PROBES, | |
18825 | __NDA_MAX | |
18826 | }; | |
18827 | # 57 "include/linux/neighbour.h" | |
18828 | struct nda_cacheinfo | |
18829 | { | |
18830 | __u32 ndm_confirmed; | |
18831 | __u32 ndm_used; | |
18832 | __u32 ndm_updated; | |
18833 | __u32 ndm_refcnt; | |
18834 | }; | |
18835 | # 90 "include/linux/neighbour.h" | |
18836 | struct ndt_stats | |
18837 | { | |
18838 | __u64 ndts_allocs; | |
18839 | __u64 ndts_destroys; | |
18840 | __u64 ndts_hash_grows; | |
18841 | __u64 ndts_res_failed; | |
18842 | __u64 ndts_lookups; | |
18843 | __u64 ndts_hits; | |
18844 | __u64 ndts_rcv_probes_mcast; | |
18845 | __u64 ndts_rcv_probes_ucast; | |
18846 | __u64 ndts_periodic_gc_runs; | |
18847 | __u64 ndts_forced_gc_runs; | |
18848 | }; | |
18849 | ||
18850 | enum { | |
18851 | NDTPA_UNSPEC, | |
18852 | NDTPA_IFINDEX, | |
18853 | NDTPA_REFCNT, | |
18854 | NDTPA_REACHABLE_TIME, | |
18855 | NDTPA_BASE_REACHABLE_TIME, | |
18856 | NDTPA_RETRANS_TIME, | |
18857 | NDTPA_GC_STALETIME, | |
18858 | NDTPA_DELAY_PROBE_TIME, | |
18859 | NDTPA_QUEUE_LEN, | |
18860 | NDTPA_APP_PROBES, | |
18861 | NDTPA_UCAST_PROBES, | |
18862 | NDTPA_MCAST_PROBES, | |
18863 | NDTPA_ANYCAST_DELAY, | |
18864 | NDTPA_PROXY_DELAY, | |
18865 | NDTPA_PROXY_QLEN, | |
18866 | NDTPA_LOCKTIME, | |
18867 | __NDTPA_MAX | |
18868 | }; | |
18869 | ||
18870 | ||
18871 | struct ndtmsg | |
18872 | { | |
18873 | __u8 ndtm_family; | |
18874 | __u8 ndtm_pad1; | |
18875 | __u16 ndtm_pad2; | |
18876 | }; | |
18877 | ||
18878 | struct ndt_config | |
18879 | { | |
18880 | __u16 ndtc_key_len; | |
18881 | __u16 ndtc_entry_size; | |
18882 | __u32 ndtc_entries; | |
18883 | __u32 ndtc_last_flush; | |
18884 | __u32 ndtc_last_rand; | |
18885 | __u32 ndtc_hash_rnd; | |
18886 | __u32 ndtc_hash_mask; | |
18887 | __u32 ndtc_hash_chain_gc; | |
18888 | __u32 ndtc_proxy_qlen; | |
18889 | }; | |
18890 | ||
18891 | enum { | |
18892 | NDTA_UNSPEC, | |
18893 | NDTA_NAME, | |
18894 | NDTA_THRESH1, | |
18895 | NDTA_THRESH2, | |
18896 | NDTA_THRESH3, | |
18897 | NDTA_CONFIG, | |
18898 | NDTA_PARMS, | |
18899 | NDTA_STATS, | |
18900 | NDTA_GC_INTERVAL, | |
18901 | __NDTA_MAX | |
18902 | }; | |
18903 | # 8 "include/linux/rtnetlink.h" 2 | |
18904 | ||
18905 | ||
18906 | ||
18907 | ||
18908 | ||
18909 | ||
18910 | ||
18911 | enum { | |
18912 | RTM_BASE = 16, | |
18913 | ||
18914 | ||
18915 | RTM_NEWLINK = 16, | |
18916 | ||
18917 | RTM_DELLINK, | |
18918 | ||
18919 | RTM_GETLINK, | |
18920 | ||
18921 | RTM_SETLINK, | |
18922 | ||
18923 | ||
18924 | RTM_NEWADDR = 20, | |
18925 | ||
18926 | RTM_DELADDR, | |
18927 | ||
18928 | RTM_GETADDR, | |
18929 | ||
18930 | ||
18931 | RTM_NEWROUTE = 24, | |
18932 | ||
18933 | RTM_DELROUTE, | |
18934 | ||
18935 | RTM_GETROUTE, | |
18936 | ||
18937 | ||
18938 | RTM_NEWNEIGH = 28, | |
18939 | ||
18940 | RTM_DELNEIGH, | |
18941 | ||
18942 | RTM_GETNEIGH, | |
18943 | ||
18944 | ||
18945 | RTM_NEWRULE = 32, | |
18946 | ||
18947 | RTM_DELRULE, | |
18948 | ||
18949 | RTM_GETRULE, | |
18950 | ||
18951 | ||
18952 | RTM_NEWQDISC = 36, | |
18953 | ||
18954 | RTM_DELQDISC, | |
18955 | ||
18956 | RTM_GETQDISC, | |
18957 | ||
18958 | ||
18959 | RTM_NEWTCLASS = 40, | |
18960 | ||
18961 | RTM_DELTCLASS, | |
18962 | ||
18963 | RTM_GETTCLASS, | |
18964 | ||
18965 | ||
18966 | RTM_NEWTFILTER = 44, | |
18967 | ||
18968 | RTM_DELTFILTER, | |
18969 | ||
18970 | RTM_GETTFILTER, | |
18971 | ||
18972 | ||
18973 | RTM_NEWACTION = 48, | |
18974 | ||
18975 | RTM_DELACTION, | |
18976 | ||
18977 | RTM_GETACTION, | |
18978 | ||
18979 | ||
18980 | RTM_NEWPREFIX = 52, | |
18981 | ||
18982 | RTM_GETPREFIX = 54, | |
18983 | ||
18984 | ||
18985 | RTM_GETMULTICAST = 58, | |
18986 | ||
18987 | ||
18988 | RTM_GETANYCAST = 62, | |
18989 | ||
18990 | ||
18991 | RTM_NEWNEIGHTBL = 64, | |
18992 | ||
18993 | RTM_GETNEIGHTBL = 66, | |
18994 | ||
18995 | RTM_SETNEIGHTBL, | |
18996 | ||
18997 | ||
18998 | __RTM_MAX, | |
18999 | ||
19000 | }; | |
19001 | # 116 "include/linux/rtnetlink.h" | |
19002 | struct rtattr | |
19003 | { | |
19004 | unsigned short rta_len; | |
19005 | unsigned short rta_type; | |
19006 | }; | |
19007 | # 143 "include/linux/rtnetlink.h" | |
19008 | struct rtmsg | |
19009 | { | |
19010 | unsigned char rtm_family; | |
19011 | unsigned char rtm_dst_len; | |
19012 | unsigned char rtm_src_len; | |
19013 | unsigned char rtm_tos; | |
19014 | ||
19015 | unsigned char rtm_table; | |
19016 | unsigned char rtm_protocol; | |
19017 | unsigned char rtm_scope; | |
19018 | unsigned char rtm_type; | |
19019 | ||
19020 | unsigned rtm_flags; | |
19021 | }; | |
19022 | ||
19023 | ||
19024 | ||
19025 | enum | |
19026 | { | |
19027 | RTN_UNSPEC, | |
19028 | RTN_UNICAST, | |
19029 | RTN_LOCAL, | |
19030 | RTN_BROADCAST, | |
19031 | ||
19032 | RTN_ANYCAST, | |
19033 | ||
19034 | RTN_MULTICAST, | |
19035 | RTN_BLACKHOLE, | |
19036 | RTN_UNREACHABLE, | |
19037 | RTN_PROHIBIT, | |
19038 | RTN_THROW, | |
19039 | RTN_NAT, | |
19040 | RTN_XRESOLVE, | |
19041 | __RTN_MAX | |
19042 | }; | |
19043 | # 218 "include/linux/rtnetlink.h" | |
19044 | enum rt_scope_t | |
19045 | { | |
19046 | RT_SCOPE_UNIVERSE=0, | |
19047 | ||
19048 | RT_SCOPE_SITE=200, | |
19049 | RT_SCOPE_LINK=253, | |
19050 | RT_SCOPE_HOST=254, | |
19051 | RT_SCOPE_NOWHERE=255 | |
19052 | }; | |
19053 | # 237 "include/linux/rtnetlink.h" | |
19054 | enum rt_class_t | |
19055 | { | |
19056 | RT_TABLE_UNSPEC=0, | |
19057 | ||
19058 | RT_TABLE_DEFAULT=253, | |
19059 | RT_TABLE_MAIN=254, | |
19060 | RT_TABLE_LOCAL=255, | |
19061 | RT_TABLE_MAX=0xFFFFFFFF | |
19062 | }; | |
19063 | ||
19064 | ||
19065 | ||
19066 | ||
19067 | enum rtattr_type_t | |
19068 | { | |
19069 | RTA_UNSPEC, | |
19070 | RTA_DST, | |
19071 | RTA_SRC, | |
19072 | RTA_IIF, | |
19073 | RTA_OIF, | |
19074 | RTA_GATEWAY, | |
19075 | RTA_PRIORITY, | |
19076 | RTA_PREFSRC, | |
19077 | RTA_METRICS, | |
19078 | RTA_MULTIPATH, | |
19079 | RTA_PROTOINFO, | |
19080 | RTA_FLOW, | |
19081 | RTA_CACHEINFO, | |
19082 | RTA_SESSION, | |
19083 | RTA_MP_ALGO, | |
19084 | RTA_TABLE, | |
19085 | __RTA_MAX | |
19086 | }; | |
19087 | # 285 "include/linux/rtnetlink.h" | |
19088 | struct rtnexthop | |
19089 | { | |
19090 | unsigned short rtnh_len; | |
19091 | unsigned char rtnh_flags; | |
19092 | unsigned char rtnh_hops; | |
19093 | int rtnh_ifindex; | |
19094 | }; | |
19095 | # 312 "include/linux/rtnetlink.h" | |
19096 | struct rta_cacheinfo | |
19097 | { | |
19098 | __u32 rta_clntref; | |
19099 | __u32 rta_lastuse; | |
19100 | __s32 rta_expires; | |
19101 | __u32 rta_error; | |
19102 | __u32 rta_used; | |
19103 | ||
19104 | ||
19105 | __u32 rta_id; | |
19106 | __u32 rta_ts; | |
19107 | __u32 rta_tsage; | |
19108 | }; | |
19109 | ||
19110 | ||
19111 | ||
19112 | enum | |
19113 | { | |
19114 | RTAX_UNSPEC, | |
19115 | ||
19116 | RTAX_LOCK, | |
19117 | ||
19118 | RTAX_MTU, | |
19119 | ||
19120 | RTAX_WINDOW, | |
19121 | ||
19122 | RTAX_RTT, | |
19123 | ||
19124 | RTAX_RTTVAR, | |
19125 | ||
19126 | RTAX_SSTHRESH, | |
19127 | ||
19128 | RTAX_CWND, | |
19129 | ||
19130 | RTAX_ADVMSS, | |
19131 | ||
19132 | RTAX_REORDERING, | |
19133 | ||
19134 | RTAX_HOPLIMIT, | |
19135 | ||
19136 | RTAX_INITCWND, | |
19137 | ||
19138 | RTAX_FEATURES, | |
19139 | ||
19140 | __RTAX_MAX | |
19141 | }; | |
19142 | # 366 "include/linux/rtnetlink.h" | |
19143 | struct rta_session | |
19144 | { | |
19145 | __u8 proto; | |
19146 | __u8 pad1; | |
19147 | __u16 pad2; | |
19148 | ||
19149 | union { | |
19150 | struct { | |
19151 | __u16 sport; | |
19152 | __u16 dport; | |
19153 | } ports; | |
19154 | ||
19155 | struct { | |
19156 | __u8 type; | |
19157 | __u8 code; | |
19158 | __u16 ident; | |
19159 | } icmpt; | |
19160 | ||
19161 | __u32 spi; | |
19162 | } u; | |
19163 | }; | |
19164 | ||
19165 | ||
19166 | ||
19167 | ||
19168 | ||
19169 | struct rtgenmsg | |
19170 | { | |
19171 | unsigned char rtgen_family; | |
19172 | }; | |
19173 | # 406 "include/linux/rtnetlink.h" | |
19174 | struct ifinfomsg | |
19175 | { | |
19176 | unsigned char ifi_family; | |
19177 | unsigned char __ifi_pad; | |
19178 | unsigned short ifi_type; | |
19179 | int ifi_index; | |
19180 | unsigned ifi_flags; | |
19181 | unsigned ifi_change; | |
19182 | }; | |
19183 | ||
19184 | ||
19185 | ||
19186 | ||
19187 | ||
19188 | struct prefixmsg | |
19189 | { | |
19190 | unsigned char prefix_family; | |
19191 | unsigned char prefix_pad1; | |
19192 | unsigned short prefix_pad2; | |
19193 | int prefix_ifindex; | |
19194 | unsigned char prefix_type; | |
19195 | unsigned char prefix_len; | |
19196 | unsigned char prefix_flags; | |
19197 | unsigned char prefix_pad3; | |
19198 | }; | |
19199 | ||
19200 | enum | |
19201 | { | |
19202 | PREFIX_UNSPEC, | |
19203 | PREFIX_ADDRESS, | |
19204 | PREFIX_CACHEINFO, | |
19205 | __PREFIX_MAX | |
19206 | }; | |
19207 | ||
19208 | ||
19209 | ||
19210 | struct prefix_cacheinfo | |
19211 | { | |
19212 | __u32 preferred_time; | |
19213 | __u32 valid_time; | |
19214 | }; | |
19215 | ||
19216 | ||
19217 | ||
19218 | ||
19219 | ||
19220 | ||
19221 | struct tcmsg | |
19222 | { | |
19223 | unsigned char tcm_family; | |
19224 | unsigned char tcm__pad1; | |
19225 | unsigned short tcm__pad2; | |
19226 | int tcm_ifindex; | |
19227 | __u32 tcm_handle; | |
19228 | __u32 tcm_parent; | |
19229 | __u32 tcm_info; | |
19230 | }; | |
19231 | ||
19232 | enum | |
19233 | { | |
19234 | TCA_UNSPEC, | |
19235 | TCA_KIND, | |
19236 | TCA_OPTIONS, | |
19237 | TCA_STATS, | |
19238 | TCA_XSTATS, | |
19239 | TCA_RATE, | |
19240 | TCA_FCNT, | |
19241 | TCA_STATS2, | |
19242 | __TCA_MAX | |
19243 | }; | |
19244 | # 506 "include/linux/rtnetlink.h" | |
19245 | enum rtnetlink_groups { | |
19246 | RTNLGRP_NONE, | |
19247 | ||
19248 | RTNLGRP_LINK, | |
19249 | ||
19250 | RTNLGRP_NOTIFY, | |
19251 | ||
19252 | RTNLGRP_NEIGH, | |
19253 | ||
19254 | RTNLGRP_TC, | |
19255 | ||
19256 | RTNLGRP_IPV4_IFADDR, | |
19257 | ||
19258 | RTNLGRP_IPV4_MROUTE, | |
19259 | ||
19260 | RTNLGRP_IPV4_ROUTE, | |
19261 | ||
19262 | RTNLGRP_IPV4_RULE, | |
19263 | ||
19264 | RTNLGRP_IPV6_IFADDR, | |
19265 | ||
19266 | RTNLGRP_IPV6_MROUTE, | |
19267 | ||
19268 | RTNLGRP_IPV6_ROUTE, | |
19269 | ||
19270 | RTNLGRP_IPV6_IFINFO, | |
19271 | ||
19272 | RTNLGRP_DECnet_IFADDR, | |
19273 | ||
19274 | RTNLGRP_NOP2, | |
19275 | RTNLGRP_DECnet_ROUTE, | |
19276 | ||
19277 | RTNLGRP_DECnet_RULE, | |
19278 | ||
19279 | RTNLGRP_NOP4, | |
19280 | RTNLGRP_IPV6_PREFIX, | |
19281 | ||
19282 | RTNLGRP_IPV6_RULE, | |
19283 | ||
19284 | __RTNLGRP_MAX | |
19285 | }; | |
19286 | ||
19287 | ||
19288 | ||
19289 | struct tcamsg | |
19290 | { | |
19291 | unsigned char tca_family; | |
19292 | unsigned char tca__pad1; | |
19293 | unsigned short tca__pad2; | |
19294 | }; | |
19295 | # 567 "include/linux/rtnetlink.h" | |
19296 | extern size_t rtattr_strlcpy(char *dest, const struct rtattr *rta, size_t size); | |
19297 | static __inline__ __attribute__((always_inline)) int rtattr_strcmp(const struct rtattr *rta, const char *str) | |
19298 | { | |
19299 | int len = strlen(str) + 1; | |
19300 | return len > rta->rta_len || memcmp(((void*)(((char*)(rta)) + (( ((sizeof(struct rtattr))+4 -1) & ~(4 -1) ) + (0)))), str, len); | |
19301 | } | |
19302 | ||
19303 | extern int rtattr_parse(struct rtattr *tb[], int maxattr, struct rtattr *rta, int len); | |
19304 | ||
19305 | ||
19306 | ||
19307 | ||
19308 | struct rtnetlink_link | |
19309 | { | |
19310 | int (*doit)(struct sk_buff *, struct nlmsghdr*, void *attr); | |
19311 | int (*dumpit)(struct sk_buff *, struct netlink_callback *cb); | |
19312 | }; | |
19313 | ||
19314 | extern struct rtnetlink_link * rtnetlink_links[32]; | |
19315 | extern int rtnetlink_send(struct sk_buff *skb, u32 pid, u32 group, int echo); | |
19316 | extern int rtnl_unicast(struct sk_buff *skb, u32 pid); | |
19317 | extern int rtnl_notify(struct sk_buff *skb, u32 pid, u32 group, | |
19318 | struct nlmsghdr *nlh, gfp_t flags); | |
19319 | extern void rtnl_set_sk_err(u32 group, int error); | |
19320 | extern int rtnetlink_put_metrics(struct sk_buff *skb, u32 *metrics); | |
19321 | ||
19322 | extern void __rta_fill(struct sk_buff *skb, int attrtype, int attrlen, const void *data); | |
19323 | # 679 "include/linux/rtnetlink.h" | |
19324 | static inline __attribute__((always_inline)) struct rtattr * | |
19325 | __rta_reserve(struct sk_buff *skb, int attrtype, int attrlen) | |
19326 | { | |
19327 | struct rtattr *rta; | |
19328 | int size = (( ((sizeof(struct rtattr))+4 -1) & ~(4 -1) ) + (attrlen)); | |
19329 | ||
19330 | rta = (struct rtattr*)skb_put(skb, ( ((size)+4 -1) & ~(4 -1) )); | |
19331 | rta->rta_type = attrtype; | |
19332 | rta->rta_len = size; | |
19333 | memset(((void*)(((char*)(rta)) + (( ((sizeof(struct rtattr))+4 -1) & ~(4 -1) ) + (0)))) + attrlen, 0, ( ((size)+4 -1) & ~(4 -1) ) - size); | |
19334 | return rta; | |
19335 | } | |
19336 | ||
19337 | ||
19338 | ||
19339 | ||
19340 | ||
19341 | ||
19342 | extern void rtmsg_ifinfo(int type, struct net_device *dev, unsigned change); | |
19343 | ||
19344 | ||
19345 | extern void rtnl_lock(void); | |
19346 | extern void rtnl_unlock(void); | |
19347 | extern int rtnl_trylock(void); | |
19348 | ||
19349 | extern void rtnetlink_init(void); | |
19350 | extern void __rtnl_unlock(void); | |
19351 | # 723 "include/linux/rtnetlink.h" | |
19352 | static inline __attribute__((always_inline)) u32 rtm_get_table(struct rtattr **rta, u8 table) | |
19353 | { | |
19354 | return ({ if (!rta[RTA_TABLE-1] || ((int)((rta[RTA_TABLE-1])->rta_len) - (( ((sizeof(struct rtattr))+4 -1) & ~(4 -1) ) + (0))) < sizeof(u32)) goto rtattr_failure; *(u32 *) ((void*)(((char*)(rta[RTA_TABLE-1])) + (( ((sizeof(struct rtattr))+4 -1) & ~(4 -1) ) + (0)))); }); | |
19355 | rtattr_failure: | |
19356 | return table; | |
19357 | } | |
19358 | # 13 "include/net/dst.h" 2 | |
19359 | ||
19360 | ||
19361 | # 1 "include/net/neighbour.h" 1 | |
19362 | # 23 "include/net/neighbour.h" | |
19363 | # 1 "include/linux/seq_file.h" 1 | |
19364 | # 9 "include/linux/seq_file.h" | |
19365 | struct seq_operations; | |
19366 | struct file; | |
19367 | struct vfsmount; | |
19368 | struct dentry; | |
19369 | struct inode; | |
19370 | ||
19371 | struct seq_file { | |
19372 | char *buf; | |
19373 | size_t size; | |
19374 | size_t from; | |
19375 | size_t count; | |
19376 | loff_t index; | |
19377 | loff_t version; | |
19378 | struct mutex lock; | |
19379 | struct seq_operations *op; | |
19380 | void *private; | |
19381 | }; | |
19382 | ||
19383 | struct seq_operations { | |
19384 | void * (*start) (struct seq_file *m, loff_t *pos); | |
19385 | void (*stop) (struct seq_file *m, void *v); | |
19386 | void * (*next) (struct seq_file *m, void *v, loff_t *pos); | |
19387 | int (*show) (struct seq_file *m, void *v); | |
19388 | }; | |
19389 | ||
19390 | int seq_open(struct file *, struct seq_operations *); | |
19391 | ssize_t seq_read(struct file *, char *, size_t, loff_t *); | |
19392 | loff_t seq_lseek(struct file *, loff_t, int); | |
19393 | int seq_release(struct inode *, struct file *); | |
19394 | int seq_escape(struct seq_file *, const char *, const char *); | |
19395 | int seq_putc(struct seq_file *m, char c); | |
19396 | int seq_puts(struct seq_file *m, const char *s); | |
19397 | ||
19398 | int seq_printf(struct seq_file *, const char *, ...) | |
19399 | __attribute__ ((format (printf,2,3))); | |
19400 | ||
19401 | int seq_path(struct seq_file *, struct vfsmount *, struct dentry *, char *); | |
19402 | ||
19403 | int single_open(struct file *, int (*)(struct seq_file *, void *), void *); | |
19404 | int single_release(struct inode *, struct file *); | |
19405 | int seq_release_private(struct inode *, struct file *); | |
19406 | # 24 "include/net/neighbour.h" 2 | |
19407 | # 32 "include/net/neighbour.h" | |
19408 | struct neighbour; | |
19409 | ||
19410 | struct neigh_parms | |
19411 | { | |
19412 | struct net_device *dev; | |
19413 | struct neigh_parms *next; | |
19414 | int (*neigh_setup)(struct neighbour *); | |
19415 | void (*neigh_destructor)(struct neighbour *); | |
19416 | struct neigh_table *tbl; | |
19417 | ||
19418 | void *sysctl_table; | |
19419 | ||
19420 | int dead; | |
19421 | atomic_t refcnt; | |
19422 | struct rcu_head rcu_head; | |
19423 | ||
19424 | int base_reachable_time; | |
19425 | int retrans_time; | |
19426 | int gc_staletime; | |
19427 | int reachable_time; | |
19428 | int delay_probe_time; | |
19429 | ||
19430 | int queue_len; | |
19431 | int ucast_probes; | |
19432 | int app_probes; | |
19433 | int mcast_probes; | |
19434 | int anycast_delay; | |
19435 | int proxy_delay; | |
19436 | int proxy_qlen; | |
19437 | int locktime; | |
19438 | }; | |
19439 | ||
19440 | struct neigh_statistics | |
19441 | { | |
19442 | unsigned long allocs; | |
19443 | unsigned long destroys; | |
19444 | unsigned long hash_grows; | |
19445 | ||
19446 | unsigned long res_failed; | |
19447 | ||
19448 | unsigned long lookups; | |
19449 | unsigned long hits; | |
19450 | ||
19451 | unsigned long rcv_probes_mcast; | |
19452 | unsigned long rcv_probes_ucast; | |
19453 | ||
19454 | unsigned long periodic_gc_runs; | |
19455 | unsigned long forced_gc_runs; | |
19456 | }; | |
19457 | # 89 "include/net/neighbour.h" | |
19458 | struct neighbour | |
19459 | { | |
19460 | struct neighbour *next; | |
19461 | struct neigh_table *tbl; | |
19462 | struct neigh_parms *parms; | |
19463 | struct net_device *dev; | |
19464 | unsigned long used; | |
19465 | unsigned long confirmed; | |
19466 | unsigned long updated; | |
19467 | __u8 flags; | |
19468 | __u8 nud_state; | |
19469 | __u8 type; | |
19470 | __u8 dead; | |
19471 | atomic_t probes; | |
19472 | rwlock_t lock; | |
19473 | unsigned char ha[(((32)+((typeof(32))(sizeof(unsigned long))-1))&~((typeof(32))(sizeof(unsigned long))-1))]; | |
19474 | struct hh_cache *hh; | |
19475 | atomic_t refcnt; | |
19476 | int (*output)(struct sk_buff *skb); | |
19477 | struct sk_buff_head arp_queue; | |
19478 | struct timer_list timer; | |
19479 | struct neigh_ops *ops; | |
19480 | u8 primary_key[0]; | |
19481 | }; | |
19482 | ||
19483 | struct neigh_ops | |
19484 | { | |
19485 | int family; | |
19486 | void (*solicit)(struct neighbour *, struct sk_buff*); | |
19487 | void (*error_report)(struct neighbour *, struct sk_buff*); | |
19488 | int (*output)(struct sk_buff*); | |
19489 | int (*connected_output)(struct sk_buff*); | |
19490 | int (*hh_output)(struct sk_buff*); | |
19491 | int (*queue_xmit)(struct sk_buff*); | |
19492 | }; | |
19493 | ||
19494 | struct pneigh_entry | |
19495 | { | |
19496 | struct pneigh_entry *next; | |
19497 | struct net_device *dev; | |
19498 | u8 flags; | |
19499 | u8 key[0]; | |
19500 | }; | |
19501 | ||
19502 | ||
19503 | ||
19504 | ||
19505 | ||
19506 | ||
19507 | struct neigh_table | |
19508 | { | |
19509 | struct neigh_table *next; | |
19510 | int family; | |
19511 | int entry_size; | |
19512 | int key_len; | |
19513 | __u32 (*hash)(const void *pkey, const struct net_device *); | |
19514 | int (*constructor)(struct neighbour *); | |
19515 | int (*pconstructor)(struct pneigh_entry *); | |
19516 | void (*pdestructor)(struct pneigh_entry *); | |
19517 | void (*proxy_redo)(struct sk_buff *skb); | |
19518 | char *id; | |
19519 | struct neigh_parms parms; | |
19520 | ||
19521 | int gc_interval; | |
19522 | int gc_thresh1; | |
19523 | int gc_thresh2; | |
19524 | int gc_thresh3; | |
19525 | unsigned long last_flush; | |
19526 | struct timer_list gc_timer; | |
19527 | struct timer_list proxy_timer; | |
19528 | struct sk_buff_head proxy_queue; | |
19529 | atomic_t entries; | |
19530 | rwlock_t lock; | |
19531 | unsigned long last_rand; | |
19532 | kmem_cache_t *kmem_cachep; | |
19533 | struct neigh_statistics *stats; | |
19534 | struct neighbour **hash_buckets; | |
19535 | unsigned int hash_mask; | |
19536 | __u32 hash_rnd; | |
19537 | unsigned int hash_chain_gc; | |
19538 | struct pneigh_entry **phash_buckets; | |
19539 | ||
19540 | struct proc_dir_entry *pde; | |
19541 | ||
19542 | }; | |
19543 | # 182 "include/net/neighbour.h" | |
19544 | extern void neigh_table_init(struct neigh_table *tbl); | |
19545 | extern void neigh_table_init_no_netlink(struct neigh_table *tbl); | |
19546 | extern int neigh_table_clear(struct neigh_table *tbl); | |
19547 | extern struct neighbour * neigh_lookup(struct neigh_table *tbl, | |
19548 | const void *pkey, | |
19549 | struct net_device *dev); | |
19550 | extern struct neighbour * neigh_lookup_nodev(struct neigh_table *tbl, | |
19551 | const void *pkey); | |
19552 | extern struct neighbour * neigh_create(struct neigh_table *tbl, | |
19553 | const void *pkey, | |
19554 | struct net_device *dev); | |
19555 | extern void neigh_destroy(struct neighbour *neigh); | |
19556 | extern int __neigh_event_send(struct neighbour *neigh, struct sk_buff *skb); | |
19557 | extern int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new, | |
19558 | u32 flags); | |
19559 | extern void neigh_changeaddr(struct neigh_table *tbl, struct net_device *dev); | |
19560 | extern int neigh_ifdown(struct neigh_table *tbl, struct net_device *dev); | |
19561 | extern int neigh_resolve_output(struct sk_buff *skb); | |
19562 | extern int neigh_connected_output(struct sk_buff *skb); | |
19563 | extern int neigh_compat_output(struct sk_buff *skb); | |
19564 | extern struct neighbour *neigh_event_ns(struct neigh_table *tbl, | |
19565 | u8 *lladdr, void *saddr, | |
19566 | struct net_device *dev); | |
19567 | ||
19568 | extern struct neigh_parms *neigh_parms_alloc(struct net_device *dev, struct neigh_table *tbl); | |
19569 | extern void neigh_parms_release(struct neigh_table *tbl, struct neigh_parms *parms); | |
19570 | extern void neigh_parms_destroy(struct neigh_parms *parms); | |
19571 | extern unsigned long neigh_rand_reach_time(unsigned long base); | |
19572 | ||
19573 | extern void pneigh_enqueue(struct neigh_table *tbl, struct neigh_parms *p, | |
19574 | struct sk_buff *skb); | |
19575 | extern struct pneigh_entry *pneigh_lookup(struct neigh_table *tbl, const void *key, struct net_device *dev, int creat); | |
19576 | extern int pneigh_delete(struct neigh_table *tbl, const void *key, struct net_device *dev); | |
19577 | ||
19578 | struct netlink_callback; | |
19579 | struct nlmsghdr; | |
19580 | extern int neigh_dump_info(struct sk_buff *skb, struct netlink_callback *cb); | |
19581 | extern int neigh_add(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg); | |
19582 | extern int neigh_delete(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg); | |
19583 | extern void neigh_app_ns(struct neighbour *n); | |
19584 | ||
19585 | extern int neightbl_dump_info(struct sk_buff *skb, struct netlink_callback *cb); | |
19586 | extern int neightbl_set(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg); | |
19587 | ||
19588 | extern void neigh_for_each(struct neigh_table *tbl, void (*cb)(struct neighbour *, void *), void *cookie); | |
19589 | extern void __neigh_for_each_release(struct neigh_table *tbl, int (*cb)(struct neighbour *)); | |
19590 | extern void pneigh_for_each(struct neigh_table *tbl, void (*cb)(struct pneigh_entry *)); | |
19591 | ||
19592 | struct neigh_seq_state { | |
19593 | struct neigh_table *tbl; | |
19594 | void *(*neigh_sub_iter)(struct neigh_seq_state *state, | |
19595 | struct neighbour *n, loff_t *pos); | |
19596 | unsigned int bucket; | |
19597 | unsigned int flags; | |
19598 | ||
19599 | ||
19600 | ||
19601 | }; | |
19602 | extern void *neigh_seq_start(struct seq_file *, loff_t *, struct neigh_table *, unsigned int); | |
19603 | extern void *neigh_seq_next(struct seq_file *, void *, loff_t *); | |
19604 | extern void neigh_seq_stop(struct seq_file *, void *); | |
19605 | ||
19606 | extern int neigh_sysctl_register(struct net_device *dev, | |
19607 | struct neigh_parms *p, | |
19608 | int p_id, int pdev_id, | |
19609 | char *p_name, | |
19610 | proc_handler *proc_handler, | |
19611 | ctl_handler *strategy); | |
19612 | extern void neigh_sysctl_unregister(struct neigh_parms *p); | |
19613 | ||
19614 | static inline __attribute__((always_inline)) void __neigh_parms_put(struct neigh_parms *parms) | |
19615 | { | |
19616 | atomic_dec(&parms->refcnt); | |
19617 | } | |
19618 | ||
19619 | static inline __attribute__((always_inline)) void neigh_parms_put(struct neigh_parms *parms) | |
19620 | { | |
19621 | if ((atomic_sub_return(1, (&parms->refcnt)) == 0)) | |
19622 | neigh_parms_destroy(parms); | |
19623 | } | |
19624 | ||
19625 | static inline __attribute__((always_inline)) struct neigh_parms *neigh_parms_clone(struct neigh_parms *parms) | |
19626 | { | |
19627 | atomic_inc(&parms->refcnt); | |
19628 | return parms; | |
19629 | } | |
19630 | ||
19631 | ||
19632 | ||
19633 | ||
19634 | ||
19635 | static inline __attribute__((always_inline)) void neigh_release(struct neighbour *neigh) | |
19636 | { | |
19637 | if ((atomic_sub_return(1, (&neigh->refcnt)) == 0)) | |
19638 | neigh_destroy(neigh); | |
19639 | } | |
19640 | ||
19641 | static inline __attribute__((always_inline)) struct neighbour * neigh_clone(struct neighbour *neigh) | |
19642 | { | |
19643 | if (neigh) | |
19644 | atomic_inc(&neigh->refcnt); | |
19645 | return neigh; | |
19646 | } | |
19647 | ||
19648 | ||
19649 | ||
19650 | static inline __attribute__((always_inline)) void neigh_confirm(struct neighbour *neigh) | |
19651 | { | |
19652 | if (neigh) | |
19653 | neigh->confirmed = jiffies; | |
19654 | } | |
19655 | ||
19656 | static inline __attribute__((always_inline)) int neigh_is_connected(struct neighbour *neigh) | |
19657 | { | |
19658 | return neigh->nud_state&(0x80|0x40|0x02); | |
19659 | } | |
19660 | ||
19661 | static inline __attribute__((always_inline)) int neigh_is_valid(struct neighbour *neigh) | |
19662 | { | |
19663 | return neigh->nud_state&(0x80|0x40|0x02|0x10|0x04|0x08); | |
19664 | } | |
19665 | ||
19666 | static inline __attribute__((always_inline)) int neigh_event_send(struct neighbour *neigh, struct sk_buff *skb) | |
19667 | { | |
19668 | neigh->used = jiffies; | |
19669 | if (!(neigh->nud_state&((0x80|0x40|0x02)|0x08|0x10))) | |
19670 | return __neigh_event_send(neigh, skb); | |
19671 | return 0; | |
19672 | } | |
19673 | ||
19674 | static inline __attribute__((always_inline)) struct neighbour * | |
19675 | __neigh_lookup(struct neigh_table *tbl, const void *pkey, struct net_device *dev, int creat) | |
19676 | { | |
19677 | struct neighbour *n = neigh_lookup(tbl, pkey, dev); | |
19678 | ||
19679 | if (n || !creat) | |
19680 | return n; | |
19681 | ||
19682 | n = neigh_create(tbl, pkey, dev); | |
19683 | return IS_ERR(n) ? ((void *)0) : n; | |
19684 | } | |
19685 | ||
19686 | static inline __attribute__((always_inline)) struct neighbour * | |
19687 | __neigh_lookup_errno(struct neigh_table *tbl, const void *pkey, | |
19688 | struct net_device *dev) | |
19689 | { | |
19690 | struct neighbour *n = neigh_lookup(tbl, pkey, dev); | |
19691 | ||
19692 | if (n) | |
19693 | return n; | |
19694 | ||
19695 | return neigh_create(tbl, pkey, dev); | |
19696 | } | |
19697 | ||
19698 | struct neighbour_cb { | |
19699 | unsigned long sched_next; | |
19700 | unsigned int flags; | |
19701 | }; | |
19702 | # 16 "include/net/dst.h" 2 | |
19703 | # 36 "include/net/dst.h" | |
19704 | struct sk_buff; | |
19705 | ||
19706 | struct dst_entry | |
19707 | { | |
19708 | struct dst_entry *next; | |
19709 | atomic_t __refcnt; | |
19710 | int __use; | |
19711 | struct dst_entry *child; | |
19712 | struct net_device *dev; | |
19713 | short error; | |
19714 | short obsolete; | |
19715 | int flags; | |
19716 | ||
19717 | ||
19718 | ||
19719 | ||
19720 | ||
19721 | unsigned long lastuse; | |
19722 | unsigned long expires; | |
19723 | ||
19724 | unsigned short header_len; | |
19725 | unsigned short nfheader_len; | |
19726 | unsigned short trailer_len; | |
19727 | ||
19728 | u32 metrics[(__RTAX_MAX - 1)]; | |
19729 | struct dst_entry *path; | |
19730 | ||
19731 | unsigned long rate_last; | |
19732 | unsigned long rate_tokens; | |
19733 | ||
19734 | struct neighbour *neighbour; | |
19735 | struct hh_cache *hh; | |
19736 | struct xfrm_state *xfrm; | |
19737 | ||
19738 | int (*input)(struct sk_buff*); | |
19739 | int (*output)(struct sk_buff*); | |
19740 | ||
19741 | ||
19742 | ||
19743 | ||
19744 | ||
19745 | struct dst_ops *ops; | |
19746 | struct rcu_head rcu_head; | |
19747 | ||
19748 | char info[0]; | |
19749 | }; | |
19750 | ||
19751 | ||
19752 | struct dst_ops | |
19753 | { | |
19754 | unsigned short family; | |
19755 | __be16 protocol; | |
19756 | unsigned gc_thresh; | |
19757 | ||
19758 | int (*gc)(void); | |
19759 | struct dst_entry * (*check)(struct dst_entry *, __u32 cookie); | |
19760 | void (*destroy)(struct dst_entry *); | |
19761 | void (*ifdown)(struct dst_entry *, | |
19762 | struct net_device *dev, int how); | |
19763 | struct dst_entry * (*negative_advice)(struct dst_entry *); | |
19764 | void (*link_failure)(struct sk_buff *); | |
19765 | void (*update_pmtu)(struct dst_entry *dst, u32 mtu); | |
19766 | int entry_size; | |
19767 | ||
19768 | atomic_t entries; | |
19769 | kmem_cache_t *kmem_cachep; | |
19770 | }; | |
19771 | ||
19772 | ||
19773 | ||
19774 | static inline __attribute__((always_inline)) u32 | |
19775 | dst_metric(const struct dst_entry *dst, int metric) | |
19776 | { | |
19777 | return dst->metrics[metric-1]; | |
19778 | } | |
19779 | ||
19780 | static inline __attribute__((always_inline)) u32 dst_mtu(const struct dst_entry *dst) | |
19781 | { | |
19782 | u32 mtu = dst_metric(dst, RTAX_MTU); | |
19783 | ||
19784 | ||
19785 | ||
19786 | __asm__ __volatile__("": : :"memory"); | |
19787 | return mtu; | |
19788 | } | |
19789 | ||
19790 | static inline __attribute__((always_inline)) u32 | |
19791 | dst_allfrag(const struct dst_entry *dst) | |
19792 | { | |
19793 | int ret = dst_metric(dst, RTAX_FEATURES) & 0x00000008; | |
19794 | ||
19795 | __asm__ __volatile__("": : :"memory"); | |
19796 | return ret; | |
19797 | } | |
19798 | ||
19799 | static inline __attribute__((always_inline)) int | |
19800 | dst_metric_locked(struct dst_entry *dst, int metric) | |
19801 | { | |
19802 | return dst_metric(dst, RTAX_LOCK) & (1<<metric); | |
19803 | } | |
19804 | ||
19805 | static inline __attribute__((always_inline)) void dst_hold(struct dst_entry * dst) | |
19806 | { | |
19807 | atomic_inc(&dst->__refcnt); | |
19808 | } | |
19809 | ||
19810 | static inline __attribute__((always_inline)) | |
19811 | struct dst_entry * dst_clone(struct dst_entry * dst) | |
19812 | { | |
19813 | if (dst) | |
19814 | atomic_inc(&dst->__refcnt); | |
19815 | return dst; | |
19816 | } | |
19817 | ||
19818 | static inline __attribute__((always_inline)) | |
19819 | void dst_release(struct dst_entry * dst) | |
19820 | { | |
19821 | if (dst) { | |
19822 | ({ typeof(((&dst->__refcnt)->counter) < 1) __ret_warn_on = (((&dst->__refcnt)->counter) < 1); if (__builtin_expect(!!(__ret_warn_on), 0)) { printk("BUG: warning at %s:%d/%s()\n", "include/net/dst.h", 154, (__func__)); dump_stack(); } __builtin_expect(!!(__ret_warn_on), 0); }); | |
19823 | __asm__ __volatile__("": : :"memory"); | |
19824 | atomic_dec(&dst->__refcnt); | |
19825 | } | |
19826 | } | |
19827 | ||
19828 | ||
19829 | ||
19830 | ||
19831 | ||
19832 | static inline __attribute__((always_inline)) struct dst_entry *dst_pop(struct dst_entry *dst) | |
19833 | { | |
19834 | struct dst_entry *child = dst_clone(dst->child); | |
19835 | ||
19836 | dst_release(dst); | |
19837 | return child; | |
19838 | } | |
19839 | ||
19840 | extern void * dst_alloc(struct dst_ops * ops); | |
19841 | extern void __dst_free(struct dst_entry * dst); | |
19842 | extern struct dst_entry *dst_destroy(struct dst_entry * dst); | |
19843 | ||
19844 | static inline __attribute__((always_inline)) void dst_free(struct dst_entry * dst) | |
19845 | { | |
19846 | if (dst->obsolete > 1) | |
19847 | return; | |
19848 | if (!((&dst->__refcnt)->counter)) { | |
19849 | dst = dst_destroy(dst); | |
19850 | if (!dst) | |
19851 | return; | |
19852 | } | |
19853 | __dst_free(dst); | |
19854 | } | |
19855 | ||
19856 | static inline __attribute__((always_inline)) void dst_rcu_free(struct rcu_head *head) | |
19857 | { | |
19858 | struct dst_entry *dst = ({ const typeof( ((struct dst_entry *)0)->rcu_head ) *__mptr = (head); (struct dst_entry *)( (char *)__mptr - __builtin_offsetof(struct dst_entry,rcu_head) );}); | |
19859 | dst_free(dst); | |
19860 | } | |
19861 | ||
19862 | static inline __attribute__((always_inline)) void dst_confirm(struct dst_entry *dst) | |
19863 | { | |
19864 | if (dst) | |
19865 | neigh_confirm(dst->neighbour); | |
19866 | } | |
19867 | ||
19868 | static inline __attribute__((always_inline)) void dst_negative_advice(struct dst_entry **dst_p) | |
19869 | { | |
19870 | struct dst_entry * dst = *dst_p; | |
19871 | if (dst && dst->ops->negative_advice) | |
19872 | *dst_p = dst->ops->negative_advice(dst); | |
19873 | } | |
19874 | ||
19875 | static inline __attribute__((always_inline)) void dst_link_failure(struct sk_buff *skb) | |
19876 | { | |
19877 | struct dst_entry * dst = skb->dst; | |
19878 | if (dst && dst->ops && dst->ops->link_failure) | |
19879 | dst->ops->link_failure(skb); | |
19880 | } | |
19881 | ||
19882 | static inline __attribute__((always_inline)) void dst_set_expires(struct dst_entry *dst, int timeout) | |
19883 | { | |
19884 | unsigned long expires = jiffies + timeout; | |
19885 | ||
19886 | if (expires == 0) | |
19887 | expires = 1; | |
19888 | ||
19889 | if (dst->expires == 0 || (({ unsigned long __dummy; typeof(dst->expires) __dummy2; (void)(&__dummy == &__dummy2); 1; }) && ({ unsigned long __dummy; typeof(expires) __dummy2; (void)(&__dummy == &__dummy2); 1; }) && ((long)(expires) - (long)(dst->expires) < 0))) | |
19890 | dst->expires = expires; | |
19891 | } | |
19892 | ||
19893 | ||
19894 | static inline __attribute__((always_inline)) int dst_output(struct sk_buff *skb) | |
19895 | { | |
19896 | return skb->dst->output(skb); | |
19897 | } | |
19898 | ||
19899 | ||
19900 | static inline __attribute__((always_inline)) int dst_input(struct sk_buff *skb) | |
19901 | { | |
19902 | int err; | |
19903 | ||
19904 | for (;;) { | |
19905 | err = skb->dst->input(skb); | |
19906 | ||
19907 | if (__builtin_expect(!!(err == 0), 1)) | |
19908 | return err; | |
19909 | ||
19910 | if (__builtin_expect(!!(err != 4), 0)) | |
19911 | return err; | |
19912 | } | |
19913 | } | |
19914 | ||
19915 | static inline __attribute__((always_inline)) struct dst_entry *dst_check(struct dst_entry *dst, u32 cookie) | |
19916 | { | |
19917 | if (dst->obsolete) | |
19918 | dst = dst->ops->check(dst, cookie); | |
19919 | return dst; | |
19920 | } | |
19921 | ||
19922 | extern void dst_init(void); | |
19923 | ||
19924 | struct flowi; | |
19925 | ||
19926 | static inline __attribute__((always_inline)) int xfrm_lookup(struct dst_entry **dst_p, struct flowi *fl, | |
19927 | struct sock *sk, int flags) | |
19928 | { | |
19929 | return 0; | |
19930 | } | |
19931 | # 56 "include/net/sock.h" 2 | |
19932 | # 77 "include/net/sock.h" | |
19933 | struct sock_iocb; | |
19934 | typedef struct { | |
19935 | spinlock_t slock; | |
19936 | struct sock_iocb *owner; | |
19937 | wait_queue_head_t wq; | |
19938 | # 91 "include/net/sock.h" | |
19939 | } socket_lock_t; | |
19940 | ||
19941 | struct sock; | |
19942 | struct proto; | |
19943 | # 111 "include/net/sock.h" | |
19944 | struct sock_common { | |
19945 | unsigned short skc_family; | |
19946 | volatile unsigned char skc_state; | |
19947 | unsigned char skc_reuse; | |
19948 | int skc_bound_dev_if; | |
19949 | struct hlist_node skc_node; | |
19950 | struct hlist_node skc_bind_node; | |
19951 | atomic_t skc_refcnt; | |
19952 | unsigned int skc_hash; | |
19953 | struct proto *skc_prot; | |
19954 | }; | |
19955 | # 182 "include/net/sock.h" | |
19956 | struct sock { | |
19957 | ||
19958 | ||
19959 | ||
19960 | ||
19961 | struct sock_common __sk_common; | |
19962 | # 197 "include/net/sock.h" | |
19963 | unsigned char sk_shutdown : 2, | |
19964 | sk_no_check : 2, | |
19965 | sk_userlocks : 4; | |
19966 | unsigned char sk_protocol; | |
19967 | unsigned short sk_type; | |
19968 | int sk_rcvbuf; | |
19969 | socket_lock_t sk_lock; | |
19970 | wait_queue_head_t *sk_sleep; | |
19971 | struct dst_entry *sk_dst_cache; | |
19972 | struct xfrm_policy *sk_policy[2]; | |
19973 | rwlock_t sk_dst_lock; | |
19974 | atomic_t sk_rmem_alloc; | |
19975 | atomic_t sk_wmem_alloc; | |
19976 | atomic_t sk_omem_alloc; | |
19977 | struct sk_buff_head sk_receive_queue; | |
19978 | struct sk_buff_head sk_write_queue; | |
19979 | struct sk_buff_head sk_async_wait_queue; | |
19980 | int sk_wmem_queued; | |
19981 | int sk_forward_alloc; | |
19982 | gfp_t sk_allocation; | |
19983 | int sk_sndbuf; | |
19984 | int sk_route_caps; | |
19985 | int sk_gso_type; | |
19986 | int sk_rcvlowat; | |
19987 | unsigned long sk_flags; | |
19988 | unsigned long sk_lingertime; | |
19989 | ||
19990 | ||
19991 | ||
19992 | ||
19993 | ||
19994 | struct { | |
19995 | struct sk_buff *head; | |
19996 | struct sk_buff *tail; | |
19997 | } sk_backlog; | |
19998 | struct sk_buff_head sk_error_queue; | |
19999 | struct proto *sk_prot_creator; | |
20000 | rwlock_t sk_callback_lock; | |
20001 | int sk_err, | |
20002 | sk_err_soft; | |
20003 | unsigned short sk_ack_backlog; | |
20004 | unsigned short sk_max_ack_backlog; | |
20005 | __u32 sk_priority; | |
20006 | struct ucred sk_peercred; | |
20007 | long sk_rcvtimeo; | |
20008 | long sk_sndtimeo; | |
20009 | struct sk_filter *sk_filter; | |
20010 | void *sk_protinfo; | |
20011 | struct timer_list sk_timer; | |
20012 | struct timeval sk_stamp; | |
20013 | struct socket *sk_socket; | |
20014 | void *sk_user_data; | |
20015 | struct page *sk_sndmsg_page; | |
20016 | struct sk_buff *sk_send_head; | |
20017 | __u32 sk_sndmsg_off; | |
20018 | int sk_write_pending; | |
20019 | void *sk_security; | |
20020 | void (*sk_state_change)(struct sock *sk); | |
20021 | void (*sk_data_ready)(struct sock *sk, int bytes); | |
20022 | void (*sk_write_space)(struct sock *sk); | |
20023 | void (*sk_error_report)(struct sock *sk); | |
20024 | int (*sk_backlog_rcv)(struct sock *sk, | |
20025 | struct sk_buff *skb); | |
20026 | void (*sk_destruct)(struct sock *sk); | |
20027 | }; | |
20028 | ||
20029 | ||
20030 | ||
20031 | ||
20032 | static inline __attribute__((always_inline)) struct sock *__sk_head(const struct hlist_head *head) | |
20033 | { | |
20034 | return ({ const typeof( ((struct sock *)0)->__sk_common.skc_node ) *__mptr = (head->first); (struct sock *)( (char *)__mptr - __builtin_offsetof(struct sock,__sk_common.skc_node) );}); | |
20035 | } | |
20036 | ||
20037 | static inline __attribute__((always_inline)) struct sock *sk_head(const struct hlist_head *head) | |
20038 | { | |
20039 | return hlist_empty(head) ? ((void *)0) : __sk_head(head); | |
20040 | } | |
20041 | ||
20042 | static inline __attribute__((always_inline)) struct sock *sk_next(const struct sock *sk) | |
20043 | { | |
20044 | return sk->__sk_common.skc_node.next ? | |
20045 | ({ const typeof( ((struct sock *)0)->__sk_common.skc_node ) *__mptr = (sk->__sk_common.skc_node.next); (struct sock *)( (char *)__mptr - __builtin_offsetof(struct sock,__sk_common.skc_node) );}) : ((void *)0); | |
20046 | } | |
20047 | ||
20048 | static inline __attribute__((always_inline)) int sk_unhashed(const struct sock *sk) | |
20049 | { | |
20050 | return hlist_unhashed(&sk->__sk_common.skc_node); | |
20051 | } | |
20052 | ||
20053 | static inline __attribute__((always_inline)) int sk_hashed(const struct sock *sk) | |
20054 | { | |
20055 | return !sk_unhashed(sk); | |
20056 | } | |
20057 | ||
20058 | static __inline__ __attribute__((always_inline)) void sk_node_init(struct hlist_node *node) | |
20059 | { | |
20060 | node->pprev = ((void *)0); | |
20061 | } | |
20062 | ||
20063 | static __inline__ __attribute__((always_inline)) void __sk_del_node(struct sock *sk) | |
20064 | { | |
20065 | __hlist_del(&sk->__sk_common.skc_node); | |
20066 | } | |
20067 | ||
20068 | static __inline__ __attribute__((always_inline)) int __sk_del_node_init(struct sock *sk) | |
20069 | { | |
20070 | if (sk_hashed(sk)) { | |
20071 | __sk_del_node(sk); | |
20072 | sk_node_init(&sk->__sk_common.skc_node); | |
20073 | return 1; | |
20074 | } | |
20075 | return 0; | |
20076 | } | |
20077 | ||
20078 | ||
20079 | ||
20080 | ||
20081 | ||
20082 | ||
20083 | ||
20084 | static inline __attribute__((always_inline)) void sock_hold(struct sock *sk) | |
20085 | { | |
20086 | atomic_inc(&sk->__sk_common.skc_refcnt); | |
20087 | } | |
20088 | ||
20089 | ||
20090 | ||
20091 | ||
20092 | static inline __attribute__((always_inline)) void __sock_put(struct sock *sk) | |
20093 | { | |
20094 | atomic_dec(&sk->__sk_common.skc_refcnt); | |
20095 | } | |
20096 | ||
20097 | static __inline__ __attribute__((always_inline)) int sk_del_node_init(struct sock *sk) | |
20098 | { | |
20099 | int rc = __sk_del_node_init(sk); | |
20100 | ||
20101 | if (rc) { | |
20102 | ||
20103 | ({ typeof(((&sk->__sk_common.skc_refcnt)->counter) == 1) __ret_warn_on = (((&sk->__sk_common.skc_refcnt)->counter) == 1); if (__builtin_expect(!!(__ret_warn_on), 0)) { printk("BUG: warning at %s:%d/%s()\n", "include/net/sock.h", 337, (__func__)); dump_stack(); } __builtin_expect(!!(__ret_warn_on), 0); }); | |
20104 | __sock_put(sk); | |
20105 | } | |
20106 | return rc; | |
20107 | } | |
20108 | ||
20109 | static __inline__ __attribute__((always_inline)) void __sk_add_node(struct sock *sk, struct hlist_head *list) | |
20110 | { | |
20111 | hlist_add_head(&sk->__sk_common.skc_node, list); | |
20112 | } | |
20113 | ||
20114 | static __inline__ __attribute__((always_inline)) void sk_add_node(struct sock *sk, struct hlist_head *list) | |
20115 | { | |
20116 | sock_hold(sk); | |
20117 | __sk_add_node(sk, list); | |
20118 | } | |
20119 | ||
20120 | static __inline__ __attribute__((always_inline)) void __sk_del_bind_node(struct sock *sk) | |
20121 | { | |
20122 | __hlist_del(&sk->__sk_common.skc_bind_node); | |
20123 | } | |
20124 | ||
20125 | static __inline__ __attribute__((always_inline)) void sk_add_bind_node(struct sock *sk, | |
20126 | struct hlist_head *list) | |
20127 | { | |
20128 | hlist_add_head(&sk->__sk_common.skc_bind_node, list); | |
20129 | } | |
20130 | # 379 "include/net/sock.h" | |
20131 | enum sock_flags { | |
20132 | SOCK_DEAD, | |
20133 | SOCK_DONE, | |
20134 | SOCK_URGINLINE, | |
20135 | SOCK_KEEPOPEN, | |
20136 | SOCK_LINGER, | |
20137 | SOCK_DESTROY, | |
20138 | SOCK_BROADCAST, | |
20139 | SOCK_TIMESTAMP, | |
20140 | SOCK_ZAPPED, | |
20141 | SOCK_USE_WRITE_QUEUE, | |
20142 | SOCK_DBG, | |
20143 | SOCK_RCVTSTAMP, | |
20144 | SOCK_LOCALROUTE, | |
20145 | SOCK_QUEUE_SHRUNK, | |
20146 | }; | |
20147 | ||
20148 | static inline __attribute__((always_inline)) void sock_copy_flags(struct sock *nsk, struct sock *osk) | |
20149 | { | |
20150 | nsk->sk_flags = osk->sk_flags; | |
20151 | } | |
20152 | ||
20153 | static inline __attribute__((always_inline)) void sock_set_flag(struct sock *sk, enum sock_flags flag) | |
20154 | { | |
20155 | __set_bit(flag, &sk->sk_flags); | |
20156 | } | |
20157 | ||
20158 | static inline __attribute__((always_inline)) void sock_reset_flag(struct sock *sk, enum sock_flags flag) | |
20159 | { | |
20160 | __clear_bit(flag, &sk->sk_flags); | |
20161 | } | |
20162 | ||
20163 | static inline __attribute__((always_inline)) int sock_flag(struct sock *sk, enum sock_flags flag) | |
20164 | { | |
20165 | return (__builtin_constant_p(flag) ? __constant_test_bit((flag),(&sk->sk_flags)) : __test_bit((flag),(&sk->sk_flags))); | |
20166 | } | |
20167 | ||
20168 | static inline __attribute__((always_inline)) void sk_acceptq_removed(struct sock *sk) | |
20169 | { | |
20170 | sk->sk_ack_backlog--; | |
20171 | } | |
20172 | ||
20173 | static inline __attribute__((always_inline)) void sk_acceptq_added(struct sock *sk) | |
20174 | { | |
20175 | sk->sk_ack_backlog++; | |
20176 | } | |
20177 | ||
20178 | static inline __attribute__((always_inline)) int sk_acceptq_is_full(struct sock *sk) | |
20179 | { | |
20180 | return sk->sk_ack_backlog > sk->sk_max_ack_backlog; | |
20181 | } | |
20182 | ||
20183 | ||
20184 | ||
20185 | ||
20186 | static inline __attribute__((always_inline)) int sk_stream_min_wspace(struct sock *sk) | |
20187 | { | |
20188 | return sk->sk_wmem_queued / 2; | |
20189 | } | |
20190 | ||
20191 | static inline __attribute__((always_inline)) int sk_stream_wspace(struct sock *sk) | |
20192 | { | |
20193 | return sk->sk_sndbuf - sk->sk_wmem_queued; | |
20194 | } | |
20195 | ||
20196 | extern void sk_stream_write_space(struct sock *sk); | |
20197 | ||
20198 | static inline __attribute__((always_inline)) int sk_stream_memory_free(struct sock *sk) | |
20199 | { | |
20200 | return sk->sk_wmem_queued < sk->sk_sndbuf; | |
20201 | } | |
20202 | ||
20203 | extern void sk_stream_rfree(struct sk_buff *skb); | |
20204 | ||
20205 | static inline __attribute__((always_inline)) void sk_stream_set_owner_r(struct sk_buff *skb, struct sock *sk) | |
20206 | { | |
20207 | skb->sk = sk; | |
20208 | skb->destructor = sk_stream_rfree; | |
20209 | atomic_add(skb->truesize, &sk->sk_rmem_alloc); | |
20210 | sk->sk_forward_alloc -= skb->truesize; | |
20211 | } | |
20212 | ||
20213 | static inline __attribute__((always_inline)) void sk_stream_free_skb(struct sock *sk, struct sk_buff *skb) | |
20214 | { | |
20215 | skb_truesize_check(skb); | |
20216 | sock_set_flag(sk, SOCK_QUEUE_SHRUNK); | |
20217 | sk->sk_wmem_queued -= skb->truesize; | |
20218 | sk->sk_forward_alloc += skb->truesize; | |
20219 | __kfree_skb(skb); | |
20220 | } | |
20221 | ||
20222 | ||
20223 | static inline __attribute__((always_inline)) void sk_add_backlog(struct sock *sk, struct sk_buff *skb) | |
20224 | { | |
20225 | if (!sk->sk_backlog.tail) { | |
20226 | sk->sk_backlog.head = sk->sk_backlog.tail = skb; | |
20227 | } else { | |
20228 | sk->sk_backlog.tail->next = skb; | |
20229 | sk->sk_backlog.tail = skb; | |
20230 | } | |
20231 | skb->next = ((void *)0); | |
20232 | } | |
20233 | # 494 "include/net/sock.h" | |
20234 | extern int sk_stream_wait_connect(struct sock *sk, long *timeo_p); | |
20235 | extern int sk_stream_wait_memory(struct sock *sk, long *timeo_p); | |
20236 | extern void sk_stream_wait_close(struct sock *sk, long timeo_p); | |
20237 | extern int sk_stream_error(struct sock *sk, int flags, int err); | |
20238 | extern void sk_stream_kill_queues(struct sock *sk); | |
20239 | ||
20240 | extern int sk_wait_data(struct sock *sk, long *timeo); | |
20241 | ||
20242 | struct request_sock_ops; | |
20243 | struct timewait_sock_ops; | |
20244 | ||
20245 | ||
20246 | ||
20247 | ||
20248 | ||
20249 | struct proto { | |
20250 | void (*close)(struct sock *sk, | |
20251 | long timeout); | |
20252 | int (*connect)(struct sock *sk, | |
20253 | struct sockaddr *uaddr, | |
20254 | int addr_len); | |
20255 | int (*disconnect)(struct sock *sk, int flags); | |
20256 | ||
20257 | struct sock * (*accept) (struct sock *sk, int flags, int *err); | |
20258 | ||
20259 | int (*ioctl)(struct sock *sk, int cmd, | |
20260 | unsigned long arg); | |
20261 | int (*init)(struct sock *sk); | |
20262 | int (*destroy)(struct sock *sk); | |
20263 | void (*shutdown)(struct sock *sk, int how); | |
20264 | int (*setsockopt)(struct sock *sk, int level, | |
20265 | int optname, char *optval, | |
20266 | int optlen); | |
20267 | int (*getsockopt)(struct sock *sk, int level, | |
20268 | int optname, char *optval, | |
20269 | int *option); | |
20270 | int (*compat_setsockopt)(struct sock *sk, | |
20271 | int level, | |
20272 | int optname, char *optval, | |
20273 | int optlen); | |
20274 | int (*compat_getsockopt)(struct sock *sk, | |
20275 | int level, | |
20276 | int optname, char *optval, | |
20277 | int *option); | |
20278 | int (*sendmsg)(struct kiocb *iocb, struct sock *sk, | |
20279 | struct msghdr *msg, size_t len); | |
20280 | int (*recvmsg)(struct kiocb *iocb, struct sock *sk, | |
20281 | struct msghdr *msg, | |
20282 | size_t len, int noblock, int flags, | |
20283 | int *addr_len); | |
20284 | int (*sendpage)(struct sock *sk, struct page *page, | |
20285 | int offset, size_t size, int flags); | |
20286 | int (*bind)(struct sock *sk, | |
20287 | struct sockaddr *uaddr, int addr_len); | |
20288 | ||
20289 | int (*backlog_rcv) (struct sock *sk, | |
20290 | struct sk_buff *skb); | |
20291 | ||
20292 | ||
20293 | void (*hash)(struct sock *sk); | |
20294 | void (*unhash)(struct sock *sk); | |
20295 | int (*get_port)(struct sock *sk, unsigned short snum); | |
20296 | ||
20297 | ||
20298 | void (*enter_memory_pressure)(void); | |
20299 | atomic_t *memory_allocated; | |
20300 | atomic_t *sockets_allocated; | |
20301 | ||
20302 | ||
20303 | ||
20304 | ||
20305 | ||
20306 | ||
20307 | int *memory_pressure; | |
20308 | int *sysctl_mem; | |
20309 | int *sysctl_wmem; | |
20310 | int *sysctl_rmem; | |
20311 | int max_header; | |
20312 | ||
20313 | kmem_cache_t *slab; | |
20314 | unsigned int obj_size; | |
20315 | ||
20316 | atomic_t *orphan_count; | |
20317 | ||
20318 | struct request_sock_ops *rsk_prot; | |
20319 | struct timewait_sock_ops *twsk_prot; | |
20320 | ||
20321 | struct module *owner; | |
20322 | ||
20323 | char name[32]; | |
20324 | ||
20325 | struct list_head node; | |
20326 | ||
20327 | ||
20328 | ||
20329 | struct { | |
20330 | int inuse; | |
20331 | u8 __pad[(1 << 5) - sizeof(int)]; | |
20332 | } stats[1]; | |
20333 | }; | |
20334 | ||
20335 | extern int proto_register(struct proto *prot, int alloc_slab); | |
20336 | extern void proto_unregister(struct proto *prot); | |
20337 | # 624 "include/net/sock.h" | |
20338 | static __inline__ __attribute__((always_inline)) void sock_prot_inc_use(struct proto *prot) | |
20339 | { | |
20340 | prot->stats[0].inuse++; | |
20341 | } | |
20342 | ||
20343 | static __inline__ __attribute__((always_inline)) void sock_prot_dec_use(struct proto *prot) | |
20344 | { | |
20345 | prot->stats[0].inuse--; | |
20346 | } | |
20347 | ||
20348 | ||
20349 | ||
20350 | ||
20351 | static inline __attribute__((always_inline)) void __sk_prot_rehash(struct sock *sk) | |
20352 | { | |
20353 | sk->__sk_common.skc_prot->unhash(sk); | |
20354 | sk->__sk_common.skc_prot->hash(sk); | |
20355 | } | |
20356 | # 659 "include/net/sock.h" | |
20357 | struct sock_iocb { | |
20358 | struct list_head list; | |
20359 | ||
20360 | int flags; | |
20361 | int size; | |
20362 | struct socket *sock; | |
20363 | struct sock *sk; | |
20364 | struct scm_cookie *scm; | |
20365 | struct msghdr *msg, async_msg; | |
20366 | struct kiocb *kiocb; | |
20367 | }; | |
20368 | ||
20369 | static inline __attribute__((always_inline)) struct sock_iocb *kiocb_to_siocb(struct kiocb *iocb) | |
20370 | { | |
20371 | return (struct sock_iocb *)iocb->private; | |
20372 | } | |
20373 | ||
20374 | static inline __attribute__((always_inline)) struct kiocb *siocb_to_kiocb(struct sock_iocb *si) | |
20375 | { | |
20376 | return si->kiocb; | |
20377 | } | |
20378 | ||
20379 | struct socket_alloc { | |
20380 | struct socket socket; | |
20381 | struct inode vfs_inode; | |
20382 | }; | |
20383 | ||
20384 | static inline __attribute__((always_inline)) struct socket *SOCKET_I(struct inode *inode) | |
20385 | { | |
20386 | return &({ const typeof( ((struct socket_alloc *)0)->vfs_inode ) *__mptr = (inode); (struct socket_alloc *)( (char *)__mptr - __builtin_offsetof(struct socket_alloc,vfs_inode) );})->socket; | |
20387 | } | |
20388 | ||
20389 | static inline __attribute__((always_inline)) struct inode *SOCK_INODE(struct socket *socket) | |
20390 | { | |
20391 | return &({ const typeof( ((struct socket_alloc *)0)->socket ) *__mptr = (socket); (struct socket_alloc *)( (char *)__mptr - __builtin_offsetof(struct socket_alloc,socket) );})->vfs_inode; | |
20392 | } | |
20393 | ||
20394 | extern void __sk_stream_mem_reclaim(struct sock *sk); | |
20395 | extern int sk_stream_mem_schedule(struct sock *sk, int size, int kind); | |
20396 | ||
20397 | ||
20398 | ||
20399 | static inline __attribute__((always_inline)) int sk_stream_pages(int amt) | |
20400 | { | |
20401 | return (amt + ((int)(1UL << 12)) - 1) / ((int)(1UL << 12)); | |
20402 | } | |
20403 | ||
20404 | static inline __attribute__((always_inline)) void sk_stream_mem_reclaim(struct sock *sk) | |
20405 | { | |
20406 | if (sk->sk_forward_alloc >= ((int)(1UL << 12))) | |
20407 | __sk_stream_mem_reclaim(sk); | |
20408 | } | |
20409 | ||
20410 | static inline __attribute__((always_inline)) void sk_stream_writequeue_purge(struct sock *sk) | |
20411 | { | |
20412 | struct sk_buff *skb; | |
20413 | ||
20414 | while ((skb = __skb_dequeue(&sk->sk_write_queue)) != ((void *)0)) | |
20415 | sk_stream_free_skb(sk, skb); | |
20416 | sk_stream_mem_reclaim(sk); | |
20417 | } | |
20418 | ||
20419 | static inline __attribute__((always_inline)) int sk_stream_rmem_schedule(struct sock *sk, struct sk_buff *skb) | |
20420 | { | |
20421 | return (int)skb->truesize <= sk->sk_forward_alloc || | |
20422 | sk_stream_mem_schedule(sk, skb->truesize, 1); | |
20423 | } | |
20424 | ||
20425 | static inline __attribute__((always_inline)) int sk_stream_wmem_schedule(struct sock *sk, int size) | |
20426 | { | |
20427 | return size <= sk->sk_forward_alloc || | |
20428 | sk_stream_mem_schedule(sk, size, 0); | |
20429 | } | |
20430 | # 748 "include/net/sock.h" | |
20431 | extern void lock_sock(struct sock *sk); | |
20432 | extern void release_sock(struct sock *sk); | |
20433 | # 758 "include/net/sock.h" | |
20434 | extern struct sock *sk_alloc(int family, | |
20435 | gfp_t priority, | |
20436 | struct proto *prot, int zero_it); | |
20437 | extern void sk_free(struct sock *sk); | |
20438 | extern struct sock *sk_clone(const struct sock *sk, | |
20439 | const gfp_t priority); | |
20440 | ||
20441 | extern struct sk_buff *sock_wmalloc(struct sock *sk, | |
20442 | unsigned long size, int force, | |
20443 | gfp_t priority); | |
20444 | extern struct sk_buff *sock_rmalloc(struct sock *sk, | |
20445 | unsigned long size, int force, | |
20446 | gfp_t priority); | |
20447 | extern void sock_wfree(struct sk_buff *skb); | |
20448 | extern void sock_rfree(struct sk_buff *skb); | |
20449 | ||
20450 | extern int sock_setsockopt(struct socket *sock, int level, | |
20451 | int op, char *optval, | |
20452 | int optlen); | |
20453 | ||
20454 | extern int sock_getsockopt(struct socket *sock, int level, | |
20455 | int op, char *optval, | |
20456 | int *optlen); | |
20457 | extern struct sk_buff *sock_alloc_send_skb(struct sock *sk, | |
20458 | unsigned long size, | |
20459 | int noblock, | |
20460 | int *errcode); | |
20461 | extern void *sock_kmalloc(struct sock *sk, int size, | |
20462 | gfp_t priority); | |
20463 | extern void sock_kfree_s(struct sock *sk, void *mem, int size); | |
20464 | extern void sk_send_sigurg(struct sock *sk); | |
20465 | ||
20466 | ||
20467 | ||
20468 | ||
20469 | ||
20470 | extern int sock_no_bind(struct socket *, | |
20471 | struct sockaddr *, int); | |
20472 | extern int sock_no_connect(struct socket *, | |
20473 | struct sockaddr *, int, int); | |
20474 | extern int sock_no_socketpair(struct socket *, | |
20475 | struct socket *); | |
20476 | extern int sock_no_accept(struct socket *, | |
20477 | struct socket *, int); | |
20478 | extern int sock_no_getname(struct socket *, | |
20479 | struct sockaddr *, int *, int); | |
20480 | extern unsigned int sock_no_poll(struct file *, struct socket *, | |
20481 | struct poll_table_struct *); | |
20482 | extern int sock_no_ioctl(struct socket *, unsigned int, | |
20483 | unsigned long); | |
20484 | extern int sock_no_listen(struct socket *, int); | |
20485 | extern int sock_no_shutdown(struct socket *, int); | |
20486 | extern int sock_no_getsockopt(struct socket *, int , int, | |
20487 | char *, int *); | |
20488 | extern int sock_no_setsockopt(struct socket *, int, int, | |
20489 | char *, int); | |
20490 | extern int sock_no_sendmsg(struct kiocb *, struct socket *, | |
20491 | struct msghdr *, size_t); | |
20492 | extern int sock_no_recvmsg(struct kiocb *, struct socket *, | |
20493 | struct msghdr *, size_t, int); | |
20494 | extern int sock_no_mmap(struct file *file, | |
20495 | struct socket *sock, | |
20496 | struct vm_area_struct *vma); | |
20497 | extern ssize_t sock_no_sendpage(struct socket *sock, | |
20498 | struct page *page, | |
20499 | int offset, size_t size, | |
20500 | int flags); | |
20501 | ||
20502 | ||
20503 | ||
20504 | ||
20505 | ||
20506 | extern int sock_common_getsockopt(struct socket *sock, int level, int optname, | |
20507 | char *optval, int *optlen); | |
20508 | extern int sock_common_recvmsg(struct kiocb *iocb, struct socket *sock, | |
20509 | struct msghdr *msg, size_t size, int flags); | |
20510 | extern int sock_common_setsockopt(struct socket *sock, int level, int optname, | |
20511 | char *optval, int optlen); | |
20512 | extern int compat_sock_common_getsockopt(struct socket *sock, int level, | |
20513 | int optname, char *optval, int *optlen); | |
20514 | extern int compat_sock_common_setsockopt(struct socket *sock, int level, | |
20515 | int optname, char *optval, int optlen); | |
20516 | ||
20517 | extern void sk_common_release(struct sock *sk); | |
20518 | ||
20519 | ||
20520 | ||
20521 | ||
20522 | ||
20523 | ||
20524 | extern void sock_init_data(struct socket *sock, struct sock *sk); | |
20525 | # 864 "include/net/sock.h" | |
20526 | static inline __attribute__((always_inline)) int sk_filter(struct sock *sk, struct sk_buff *skb) | |
20527 | { | |
20528 | int err; | |
20529 | struct sk_filter *filter; | |
20530 | ||
20531 | err = security_sock_rcv_skb(sk, skb); | |
20532 | if (err) | |
20533 | return err; | |
20534 | ||
20535 | do { local_bh_disable(); (void)0; } while(0); | |
20536 | filter = sk->sk_filter; | |
20537 | if (filter) { | |
20538 | unsigned int pkt_len = sk_run_filter(skb, filter->insns, | |
20539 | filter->len); | |
20540 | err = pkt_len ? pskb_trim(skb, pkt_len) : -1; | |
20541 | } | |
20542 | do { (void)0; local_bh_enable(); } while(0); | |
20543 | ||
20544 | return err; | |
20545 | } | |
20546 | ||
20547 | ||
20548 | ||
20549 | ||
20550 | ||
20551 | static inline __attribute__((always_inline)) void sk_filter_rcu_free(struct rcu_head *rcu) | |
20552 | { | |
20553 | struct sk_filter *fp = ({ const typeof( ((struct sk_filter *)0)->rcu ) *__mptr = (rcu); (struct sk_filter *)( (char *)__mptr - __builtin_offsetof(struct sk_filter,rcu) );}); | |
20554 | kfree(fp); | |
20555 | } | |
20556 | # 903 "include/net/sock.h" | |
20557 | static inline __attribute__((always_inline)) void sk_filter_release(struct sock *sk, struct sk_filter *fp) | |
20558 | { | |
20559 | unsigned int size = sk_filter_len(fp); | |
20560 | ||
20561 | atomic_sub(size, &sk->sk_omem_alloc); | |
20562 | ||
20563 | if ((atomic_sub_return(1, (&fp->refcnt)) == 0)) | |
20564 | call_rcu_bh(&fp->rcu, sk_filter_rcu_free); | |
20565 | } | |
20566 | ||
20567 | static inline __attribute__((always_inline)) void sk_filter_charge(struct sock *sk, struct sk_filter *fp) | |
20568 | { | |
20569 | atomic_inc(&fp->refcnt); | |
20570 | atomic_add(sk_filter_len(fp), &sk->sk_omem_alloc); | |
20571 | } | |
20572 | # 945 "include/net/sock.h" | |
20573 | static inline __attribute__((always_inline)) void sock_put(struct sock *sk) | |
20574 | { | |
20575 | if ((atomic_sub_return(1, (&sk->__sk_common.skc_refcnt)) == 0)) | |
20576 | sk_free(sk); | |
20577 | } | |
20578 | ||
20579 | extern int sk_receive_skb(struct sock *sk, struct sk_buff *skb); | |
20580 | # 960 "include/net/sock.h" | |
20581 | static inline __attribute__((always_inline)) void sock_orphan(struct sock *sk) | |
20582 | { | |
20583 | do { local_bh_disable(); do { do { } while (0); (void)0; (void)(&sk->sk_callback_lock); } while (0); } while (0); | |
20584 | sock_set_flag(sk, SOCK_DEAD); | |
20585 | sk->sk_socket = ((void *)0); | |
20586 | sk->sk_sleep = ((void *)0); | |
20587 | do { do { } while (0); local_bh_enable(); (void)0; (void)(&sk->sk_callback_lock); } while (0); | |
20588 | } | |
20589 | ||
20590 | static inline __attribute__((always_inline)) void sock_graft(struct sock *sk, struct socket *parent) | |
20591 | { | |
20592 | do { local_bh_disable(); do { do { } while (0); (void)0; (void)(&sk->sk_callback_lock); } while (0); } while (0); | |
20593 | sk->sk_sleep = &parent->wait; | |
20594 | parent->sk = sk; | |
20595 | sk->sk_socket = parent; | |
20596 | security_sock_graft(sk, parent); | |
20597 | do { do { } while (0); local_bh_enable(); (void)0; (void)(&sk->sk_callback_lock); } while (0); | |
20598 | } | |
20599 | ||
20600 | static inline __attribute__((always_inline)) void sock_copy(struct sock *nsk, const struct sock *osk) | |
20601 | { | |
20602 | ||
20603 | ||
20604 | ||
20605 | ||
20606 | memcpy(nsk, osk, osk->__sk_common.skc_prot->obj_size); | |
20607 | ||
20608 | ||
20609 | ||
20610 | ||
20611 | } | |
20612 | ||
20613 | extern int sock_i_uid(struct sock *sk); | |
20614 | extern unsigned long sock_i_ino(struct sock *sk); | |
20615 | ||
20616 | static inline __attribute__((always_inline)) struct dst_entry * | |
20617 | __sk_dst_get(struct sock *sk) | |
20618 | { | |
20619 | return sk->sk_dst_cache; | |
20620 | } | |
20621 | ||
20622 | static inline __attribute__((always_inline)) struct dst_entry * | |
20623 | sk_dst_get(struct sock *sk) | |
20624 | { | |
20625 | struct dst_entry *dst; | |
20626 | ||
20627 | do { do { } while (0); (void)0; (void)(&sk->sk_dst_lock); } while (0); | |
20628 | dst = sk->sk_dst_cache; | |
20629 | if (dst) | |
20630 | dst_hold(dst); | |
20631 | do { do { } while (0); (void)0; (void)(&sk->sk_dst_lock); } while (0); | |
20632 | return dst; | |
20633 | } | |
20634 | ||
20635 | static inline __attribute__((always_inline)) void | |
20636 | __sk_dst_set(struct sock *sk, struct dst_entry *dst) | |
20637 | { | |
20638 | struct dst_entry *old_dst; | |
20639 | ||
20640 | old_dst = sk->sk_dst_cache; | |
20641 | sk->sk_dst_cache = dst; | |
20642 | dst_release(old_dst); | |
20643 | } | |
20644 | ||
20645 | static inline __attribute__((always_inline)) void | |
20646 | sk_dst_set(struct sock *sk, struct dst_entry *dst) | |
20647 | { | |
20648 | do { do { } while (0); (void)0; (void)(&sk->sk_dst_lock); } while (0); | |
20649 | __sk_dst_set(sk, dst); | |
20650 | do { do { } while (0); (void)0; (void)(&sk->sk_dst_lock); } while (0); | |
20651 | } | |
20652 | ||
20653 | static inline __attribute__((always_inline)) void | |
20654 | __sk_dst_reset(struct sock *sk) | |
20655 | { | |
20656 | struct dst_entry *old_dst; | |
20657 | ||
20658 | old_dst = sk->sk_dst_cache; | |
20659 | sk->sk_dst_cache = ((void *)0); | |
20660 | dst_release(old_dst); | |
20661 | } | |
20662 | ||
20663 | static inline __attribute__((always_inline)) void | |
20664 | sk_dst_reset(struct sock *sk) | |
20665 | { | |
20666 | do { do { } while (0); (void)0; (void)(&sk->sk_dst_lock); } while (0); | |
20667 | __sk_dst_reset(sk); | |
20668 | do { do { } while (0); (void)0; (void)(&sk->sk_dst_lock); } while (0); | |
20669 | } | |
20670 | ||
20671 | extern struct dst_entry *__sk_dst_check(struct sock *sk, u32 cookie); | |
20672 | ||
20673 | extern struct dst_entry *sk_dst_check(struct sock *sk, u32 cookie); | |
20674 | ||
20675 | static inline __attribute__((always_inline)) int sk_can_gso(const struct sock *sk) | |
20676 | { | |
20677 | return net_gso_ok(sk->sk_route_caps, sk->sk_gso_type); | |
20678 | } | |
20679 | ||
20680 | static inline __attribute__((always_inline)) void sk_setup_caps(struct sock *sk, struct dst_entry *dst) | |
20681 | { | |
20682 | __sk_dst_set(sk, dst); | |
20683 | sk->sk_route_caps = dst->dev->features; | |
20684 | if (sk->sk_route_caps & 2048) | |
20685 | sk->sk_route_caps |= 0xffff0000; | |
20686 | if (sk_can_gso(sk)) { | |
20687 | if (dst->header_len) | |
20688 | sk->sk_route_caps &= ~0xffff0000; | |
20689 | else | |
20690 | sk->sk_route_caps |= 1 | 8; | |
20691 | } | |
20692 | } | |
20693 | ||
20694 | static inline __attribute__((always_inline)) void sk_charge_skb(struct sock *sk, struct sk_buff *skb) | |
20695 | { | |
20696 | sk->sk_wmem_queued += skb->truesize; | |
20697 | sk->sk_forward_alloc -= skb->truesize; | |
20698 | } | |
20699 | ||
20700 | static inline __attribute__((always_inline)) int skb_copy_to_page(struct sock *sk, char *from, | |
20701 | struct sk_buff *skb, struct page *page, | |
20702 | int off, int copy) | |
20703 | { | |
20704 | if (skb->ip_summed == 0) { | |
20705 | int err = 0; | |
20706 | unsigned int csum = csum_and_copy_from_user(from, | |
20707 | lowmem_page_address(page) + off, | |
20708 | copy, 0, &err); | |
20709 | if (err) | |
20710 | return err; | |
20711 | skb->csum = csum_block_add(skb->csum, csum, skb->len); | |
20712 | } else if (copy_from_user(lowmem_page_address(page) + off, from, copy)) | |
20713 | return -14; | |
20714 | ||
20715 | skb->len += copy; | |
20716 | skb->data_len += copy; | |
20717 | skb->truesize += copy; | |
20718 | sk->sk_wmem_queued += copy; | |
20719 | sk->sk_forward_alloc -= copy; | |
20720 | return 0; | |
20721 | } | |
20722 | # 1111 "include/net/sock.h" | |
20723 | static inline __attribute__((always_inline)) void skb_set_owner_w(struct sk_buff *skb, struct sock *sk) | |
20724 | { | |
20725 | sock_hold(sk); | |
20726 | skb->sk = sk; | |
20727 | skb->destructor = sock_wfree; | |
20728 | atomic_add(skb->truesize, &sk->sk_wmem_alloc); | |
20729 | } | |
20730 | ||
20731 | static inline __attribute__((always_inline)) void skb_set_owner_r(struct sk_buff *skb, struct sock *sk) | |
20732 | { | |
20733 | skb->sk = sk; | |
20734 | skb->destructor = sock_rfree; | |
20735 | atomic_add(skb->truesize, &sk->sk_rmem_alloc); | |
20736 | } | |
20737 | ||
20738 | extern void sk_reset_timer(struct sock *sk, struct timer_list* timer, | |
20739 | unsigned long expires); | |
20740 | ||
20741 | extern void sk_stop_timer(struct sock *sk, struct timer_list* timer); | |
20742 | ||
20743 | extern int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb); | |
20744 | ||
20745 | static inline __attribute__((always_inline)) int sock_queue_err_skb(struct sock *sk, struct sk_buff *skb) | |
20746 | { | |
20747 | ||
20748 | ||
20749 | ||
20750 | if (((&sk->sk_rmem_alloc)->counter) + skb->truesize >= | |
20751 | (unsigned)sk->sk_rcvbuf) | |
20752 | return -12; | |
20753 | skb_set_owner_r(skb, sk); | |
20754 | skb_queue_tail(&sk->sk_error_queue, skb); | |
20755 | if (!sock_flag(sk, SOCK_DEAD)) | |
20756 | sk->sk_data_ready(sk, skb->len); | |
20757 | return 0; | |
20758 | } | |
20759 | ||
20760 | ||
20761 | ||
20762 | ||
20763 | ||
20764 | static inline __attribute__((always_inline)) int sock_error(struct sock *sk) | |
20765 | { | |
20766 | int err; | |
20767 | if (__builtin_expect(!!(!sk->sk_err), 1)) | |
20768 | return 0; | |
20769 | err = ((__typeof__(*(&sk->sk_err)))__xchg((unsigned long)(0),(&sk->sk_err),sizeof(*(&sk->sk_err)))); | |
20770 | return -err; | |
20771 | } | |
20772 | ||
20773 | static inline __attribute__((always_inline)) unsigned long sock_wspace(struct sock *sk) | |
20774 | { | |
20775 | int amt = 0; | |
20776 | ||
20777 | if (!(sk->sk_shutdown & 2)) { | |
20778 | amt = sk->sk_sndbuf - ((&sk->sk_wmem_alloc)->counter); | |
20779 | if (amt < 0) | |
20780 | amt = 0; | |
20781 | } | |
20782 | return amt; | |
20783 | } | |
20784 | ||
20785 | static inline __attribute__((always_inline)) void sk_wake_async(struct sock *sk, int how, int band) | |
20786 | { | |
20787 | if (sk->sk_socket && sk->sk_socket->fasync_list) | |
20788 | sock_wake_async(sk->sk_socket, how, band); | |
20789 | } | |
20790 | ||
20791 | ||
20792 | ||
20793 | ||
20794 | static inline __attribute__((always_inline)) void sk_stream_moderate_sndbuf(struct sock *sk) | |
20795 | { | |
20796 | if (!(sk->sk_userlocks & 1)) { | |
20797 | sk->sk_sndbuf = ({ typeof(sk->sk_sndbuf) _x = (sk->sk_sndbuf); typeof(sk->sk_wmem_queued / 2) _y = (sk->sk_wmem_queued / 2); (void) (&_x == &_y); _x < _y ? _x : _y; }); | |
20798 | sk->sk_sndbuf = ({ typeof(sk->sk_sndbuf) _x = (sk->sk_sndbuf); typeof(2048) _y = (2048); (void) (&_x == &_y); _x > _y ? _x : _y; }); | |
20799 | } | |
20800 | } | |
20801 | ||
20802 | static inline __attribute__((always_inline)) struct sk_buff *sk_stream_alloc_pskb(struct sock *sk, | |
20803 | int size, int mem, | |
20804 | gfp_t gfp) | |
20805 | { | |
20806 | struct sk_buff *skb; | |
20807 | int hdr_len; | |
20808 | ||
20809 | hdr_len = (((sk->__sk_common.skc_prot->max_header) + ((1 << 5) - 1)) & ~((1 << 5) - 1)); | |
20810 | skb = alloc_skb_fclone(size + hdr_len, gfp); | |
20811 | if (skb) { | |
20812 | skb->truesize += mem; | |
20813 | if (sk_stream_wmem_schedule(sk, skb->truesize)) { | |
20814 | skb_reserve(skb, hdr_len); | |
20815 | return skb; | |
20816 | } | |
20817 | __kfree_skb(skb); | |
20818 | } else { | |
20819 | sk->__sk_common.skc_prot->enter_memory_pressure(); | |
20820 | sk_stream_moderate_sndbuf(sk); | |
20821 | } | |
20822 | return ((void *)0); | |
20823 | } | |
20824 | ||
20825 | static inline __attribute__((always_inline)) struct sk_buff *sk_stream_alloc_skb(struct sock *sk, | |
20826 | int size, | |
20827 | gfp_t gfp) | |
20828 | { | |
20829 | return sk_stream_alloc_pskb(sk, size, 0, gfp); | |
20830 | } | |
20831 | ||
20832 | static inline __attribute__((always_inline)) struct page *sk_stream_alloc_page(struct sock *sk) | |
20833 | { | |
20834 | struct page *page = ((void *)0); | |
20835 | ||
20836 | page = alloc_pages_node(((0)), sk->sk_allocation, 0); | |
20837 | if (!page) { | |
20838 | sk->__sk_common.skc_prot->enter_memory_pressure(); | |
20839 | sk_stream_moderate_sndbuf(sk); | |
20840 | } | |
20841 | return page; | |
20842 | } | |
20843 | # 1247 "include/net/sock.h" | |
20844 | static inline __attribute__((always_inline)) int sock_writeable(const struct sock *sk) | |
20845 | { | |
20846 | return ((&sk->sk_wmem_alloc)->counter) < (sk->sk_sndbuf / 2); | |
20847 | } | |
20848 | ||
20849 | static inline __attribute__((always_inline)) gfp_t gfp_any(void) | |
20850 | { | |
20851 | return (((current_thread_info()->preempt_count) & (((1UL << (8))-1) << (0 + 8)))) ? ((( gfp_t)0x20u)) : ((( gfp_t)0x10u) | (( gfp_t)0x40u) | (( gfp_t)0x80u)); | |
20852 | } | |
20853 | ||
20854 | static inline __attribute__((always_inline)) long sock_rcvtimeo(const struct sock *sk, int noblock) | |
20855 | { | |
20856 | return noblock ? 0 : sk->sk_rcvtimeo; | |
20857 | } | |
20858 | ||
20859 | static inline __attribute__((always_inline)) long sock_sndtimeo(const struct sock *sk, int noblock) | |
20860 | { | |
20861 | return noblock ? 0 : sk->sk_sndtimeo; | |
20862 | } | |
20863 | ||
20864 | static inline __attribute__((always_inline)) int sock_rcvlowat(const struct sock *sk, int waitall, int len) | |
20865 | { | |
20866 | return (waitall ? len : ({ int __x = (sk->sk_rcvlowat); int __y = (len); __x < __y ? __x: __y; })) ? : 1; | |
20867 | } | |
20868 | ||
20869 | ||
20870 | ||
20871 | ||
20872 | static inline __attribute__((always_inline)) int sock_intr_errno(long timeo) | |
20873 | { | |
20874 | return timeo == ((long)(~0UL>>1)) ? -512 : -4; | |
20875 | } | |
20876 | ||
20877 | static __inline__ __attribute__((always_inline)) void | |
20878 | sock_recv_timestamp(struct msghdr *msg, struct sock *sk, struct sk_buff *skb) | |
20879 | { | |
20880 | struct timeval stamp; | |
20881 | ||
20882 | skb_get_timestamp(skb, &stamp); | |
20883 | if (sock_flag(sk, SOCK_RCVTSTAMP)) { | |
20884 | ||
20885 | ||
20886 | if (stamp.tv_sec == 0) | |
20887 | do_gettimeofday(&stamp); | |
20888 | skb_set_timestamp(skb, &stamp); | |
20889 | put_cmsg(msg, 1, 29, sizeof(struct timeval), | |
20890 | &stamp); | |
20891 | } else | |
20892 | sk->sk_stamp = stamp; | |
20893 | } | |
20894 | # 1317 "include/net/sock.h" | |
20895 | static inline __attribute__((always_inline)) void sk_eat_skb(struct sock *sk, struct sk_buff *skb, int copied_early) | |
20896 | { | |
20897 | __skb_unlink(skb, &sk->sk_receive_queue); | |
20898 | __kfree_skb(skb); | |
20899 | } | |
20900 | ||
20901 | ||
20902 | extern void sock_enable_timestamp(struct sock *sk); | |
20903 | extern int sock_get_timestamp(struct sock *, struct timeval *); | |
20904 | # 1363 "include/net/sock.h" | |
20905 | static inline __attribute__((always_inline)) void sock_valbool_flag(struct sock *sk, int bit, int valbool) | |
20906 | { | |
20907 | if (valbool) | |
20908 | sock_set_flag(sk, bit); | |
20909 | else | |
20910 | sock_reset_flag(sk, bit); | |
20911 | } | |
20912 | ||
20913 | extern __u32 sysctl_wmem_max; | |
20914 | extern __u32 sysctl_rmem_max; | |
20915 | ||
20916 | ||
20917 | int siocdevprivate_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg); | |
20918 | ||
20919 | ||
20920 | ||
20921 | ||
20922 | ||
20923 | ||
20924 | ||
20925 | extern void sk_init(void); | |
20926 | ||
20927 | ||
20928 | extern struct ctl_table core_table[]; | |
20929 | ||
20930 | ||
20931 | extern int sysctl_optmem_max; | |
20932 | ||
20933 | extern __u32 sysctl_wmem_default; | |
20934 | extern __u32 sysctl_rmem_default; | |
20935 | # 25 "include/net/inet_sock.h" 2 | |
20936 | # 1 "include/net/request_sock.h" 1 | |
20937 | # 24 "include/net/request_sock.h" | |
20938 | struct request_sock; | |
20939 | struct sk_buff; | |
20940 | struct dst_entry; | |
20941 | struct proto; | |
20942 | ||
20943 | struct request_sock_ops { | |
20944 | int family; | |
20945 | kmem_cache_t *slab; | |
20946 | int obj_size; | |
20947 | int (*rtx_syn_ack)(struct sock *sk, | |
20948 | struct request_sock *req, | |
20949 | struct dst_entry *dst); | |
20950 | void (*send_ack)(struct sk_buff *skb, | |
20951 | struct request_sock *req); | |
20952 | void (*send_reset)(struct sk_buff *skb); | |
20953 | void (*destructor)(struct request_sock *req); | |
20954 | }; | |
20955 | ||
20956 | ||
20957 | ||
20958 | struct request_sock { | |
20959 | struct request_sock *dl_next; | |
20960 | u16 mss; | |
20961 | u8 retrans; | |
20962 | u8 __pad; | |
20963 | ||
20964 | u32 window_clamp; | |
20965 | u32 rcv_wnd; | |
20966 | u32 ts_recent; | |
20967 | unsigned long expires; | |
20968 | struct request_sock_ops *rsk_ops; | |
20969 | struct sock *sk; | |
20970 | u32 secid; | |
20971 | }; | |
20972 | ||
20973 | static inline __attribute__((always_inline)) struct request_sock *reqsk_alloc(struct request_sock_ops *ops) | |
20974 | { | |
20975 | struct request_sock *req = kmem_cache_alloc(ops->slab, ((( gfp_t)0x20u))); | |
20976 | ||
20977 | if (req != ((void *)0)) | |
20978 | req->rsk_ops = ops; | |
20979 | ||
20980 | return req; | |
20981 | } | |
20982 | ||
20983 | static inline __attribute__((always_inline)) void __reqsk_free(struct request_sock *req) | |
20984 | { | |
20985 | kmem_cache_free(req->rsk_ops->slab, req); | |
20986 | } | |
20987 | ||
20988 | static inline __attribute__((always_inline)) void reqsk_free(struct request_sock *req) | |
20989 | { | |
20990 | req->rsk_ops->destructor(req); | |
20991 | __reqsk_free(req); | |
20992 | } | |
20993 | ||
20994 | extern int sysctl_max_syn_backlog; | |
20995 | ||
20996 | ||
20997 | ||
20998 | ||
20999 | ||
21000 | struct listen_sock { | |
21001 | u8 max_qlen_log; | |
21002 | ||
21003 | int qlen; | |
21004 | int qlen_young; | |
21005 | int clock_hand; | |
21006 | u32 hash_rnd; | |
21007 | u32 nr_table_entries; | |
21008 | struct request_sock *syn_table[0]; | |
21009 | }; | |
21010 | # 113 "include/net/request_sock.h" | |
21011 | struct request_sock_queue { | |
21012 | struct request_sock *rskq_accept_head; | |
21013 | struct request_sock *rskq_accept_tail; | |
21014 | rwlock_t syn_wait_lock; | |
21015 | u8 rskq_defer_accept; | |
21016 | ||
21017 | struct listen_sock *listen_opt; | |
21018 | }; | |
21019 | ||
21020 | extern int reqsk_queue_alloc(struct request_sock_queue *queue, | |
21021 | const int nr_table_entries); | |
21022 | ||
21023 | static inline __attribute__((always_inline)) struct listen_sock *reqsk_queue_yank_listen_sk(struct request_sock_queue *queue) | |
21024 | { | |
21025 | struct listen_sock *lopt; | |
21026 | ||
21027 | do { local_bh_disable(); do { do { } while (0); (void)0; (void)(&queue->syn_wait_lock); } while (0); } while (0); | |
21028 | lopt = queue->listen_opt; | |
21029 | queue->listen_opt = ((void *)0); | |
21030 | do { do { } while (0); local_bh_enable(); (void)0; (void)(&queue->syn_wait_lock); } while (0); | |
21031 | ||
21032 | return lopt; | |
21033 | } | |
21034 | ||
21035 | static inline __attribute__((always_inline)) void __reqsk_queue_destroy(struct request_sock_queue *queue) | |
21036 | { | |
21037 | kfree(reqsk_queue_yank_listen_sk(queue)); | |
21038 | } | |
21039 | ||
21040 | extern void reqsk_queue_destroy(struct request_sock_queue *queue); | |
21041 | ||
21042 | static inline __attribute__((always_inline)) struct request_sock * | |
21043 | reqsk_queue_yank_acceptq(struct request_sock_queue *queue) | |
21044 | { | |
21045 | struct request_sock *req = queue->rskq_accept_head; | |
21046 | ||
21047 | queue->rskq_accept_head = ((void *)0); | |
21048 | return req; | |
21049 | } | |
21050 | ||
21051 | static inline __attribute__((always_inline)) int reqsk_queue_empty(struct request_sock_queue *queue) | |
21052 | { | |
21053 | return queue->rskq_accept_head == ((void *)0); | |
21054 | } | |
21055 | ||
21056 | static inline __attribute__((always_inline)) void reqsk_queue_unlink(struct request_sock_queue *queue, | |
21057 | struct request_sock *req, | |
21058 | struct request_sock **prev_req) | |
21059 | { | |
21060 | do { do { } while (0); (void)0; (void)(&queue->syn_wait_lock); } while (0); | |
21061 | *prev_req = req->dl_next; | |
21062 | do { do { } while (0); (void)0; (void)(&queue->syn_wait_lock); } while (0); | |
21063 | } | |
21064 | ||
21065 | static inline __attribute__((always_inline)) void reqsk_queue_add(struct request_sock_queue *queue, | |
21066 | struct request_sock *req, | |
21067 | struct sock *parent, | |
21068 | struct sock *child) | |
21069 | { | |
21070 | req->sk = child; | |
21071 | sk_acceptq_added(parent); | |
21072 | ||
21073 | if (queue->rskq_accept_head == ((void *)0)) | |
21074 | queue->rskq_accept_head = req; | |
21075 | else | |
21076 | queue->rskq_accept_tail->dl_next = req; | |
21077 | ||
21078 | queue->rskq_accept_tail = req; | |
21079 | req->dl_next = ((void *)0); | |
21080 | } | |
21081 | ||
21082 | static inline __attribute__((always_inline)) struct request_sock *reqsk_queue_remove(struct request_sock_queue *queue) | |
21083 | { | |
21084 | struct request_sock *req = queue->rskq_accept_head; | |
21085 | ||
21086 | do { if (__builtin_expect(!!(!(req != ((void *)0))), 0)) { printk("<3>" "KERNEL: assertion (%s) failed at %s (%d)\n", "req != NULL", "include/net/request_sock.h" , 188); } } while(0); | |
21087 | ||
21088 | queue->rskq_accept_head = req->dl_next; | |
21089 | if (queue->rskq_accept_head == ((void *)0)) | |
21090 | queue->rskq_accept_tail = ((void *)0); | |
21091 | ||
21092 | return req; | |
21093 | } | |
21094 | ||
21095 | static inline __attribute__((always_inline)) struct sock *reqsk_queue_get_child(struct request_sock_queue *queue, | |
21096 | struct sock *parent) | |
21097 | { | |
21098 | struct request_sock *req = reqsk_queue_remove(queue); | |
21099 | struct sock *child = req->sk; | |
21100 | ||
21101 | do { if (__builtin_expect(!!(!(child != ((void *)0))), 0)) { printk("<3>" "KERNEL: assertion (%s) failed at %s (%d)\n", "child != NULL", "include/net/request_sock.h" , 203); } } while(0); | |
21102 | ||
21103 | sk_acceptq_removed(parent); | |
21104 | __reqsk_free(req); | |
21105 | return child; | |
21106 | } | |
21107 | ||
21108 | static inline __attribute__((always_inline)) int reqsk_queue_removed(struct request_sock_queue *queue, | |
21109 | struct request_sock *req) | |
21110 | { | |
21111 | struct listen_sock *lopt = queue->listen_opt; | |
21112 | ||
21113 | if (req->retrans == 0) | |
21114 | --lopt->qlen_young; | |
21115 | ||
21116 | return --lopt->qlen; | |
21117 | } | |
21118 | ||
21119 | static inline __attribute__((always_inline)) int reqsk_queue_added(struct request_sock_queue *queue) | |
21120 | { | |
21121 | struct listen_sock *lopt = queue->listen_opt; | |
21122 | const int prev_qlen = lopt->qlen; | |
21123 | ||
21124 | lopt->qlen_young++; | |
21125 | lopt->qlen++; | |
21126 | return prev_qlen; | |
21127 | } | |
21128 | ||
21129 | static inline __attribute__((always_inline)) int reqsk_queue_len(const struct request_sock_queue *queue) | |
21130 | { | |
21131 | return queue->listen_opt != ((void *)0) ? queue->listen_opt->qlen : 0; | |
21132 | } | |
21133 | ||
21134 | static inline __attribute__((always_inline)) int reqsk_queue_len_young(const struct request_sock_queue *queue) | |
21135 | { | |
21136 | return queue->listen_opt->qlen_young; | |
21137 | } | |
21138 | ||
21139 | static inline __attribute__((always_inline)) int reqsk_queue_is_full(const struct request_sock_queue *queue) | |
21140 | { | |
21141 | return queue->listen_opt->qlen >> queue->listen_opt->max_qlen_log; | |
21142 | } | |
21143 | ||
21144 | static inline __attribute__((always_inline)) void reqsk_queue_hash_req(struct request_sock_queue *queue, | |
21145 | u32 hash, struct request_sock *req, | |
21146 | unsigned long timeout) | |
21147 | { | |
21148 | struct listen_sock *lopt = queue->listen_opt; | |
21149 | ||
21150 | req->expires = jiffies + timeout; | |
21151 | req->retrans = 0; | |
21152 | req->sk = ((void *)0); | |
21153 | req->dl_next = lopt->syn_table[hash]; | |
21154 | ||
21155 | do { do { } while (0); (void)0; (void)(&queue->syn_wait_lock); } while (0); | |
21156 | lopt->syn_table[hash] = req; | |
21157 | do { do { } while (0); (void)0; (void)(&queue->syn_wait_lock); } while (0); | |
21158 | } | |
21159 | # 26 "include/net/inet_sock.h" 2 | |
21160 | # 38 "include/net/inet_sock.h" | |
21161 | struct ip_options { | |
21162 | __be32 faddr; | |
21163 | unsigned char optlen; | |
21164 | unsigned char srr; | |
21165 | unsigned char rr; | |
21166 | unsigned char ts; | |
21167 | unsigned char is_data:1, | |
21168 | is_strictroute:1, | |
21169 | srr_is_hit:1, | |
21170 | is_changed:1, | |
21171 | rr_needaddr:1, | |
21172 | ts_needtime:1, | |
21173 | ts_needaddr:1; | |
21174 | unsigned char router_alert; | |
21175 | unsigned char cipso; | |
21176 | unsigned char __pad2; | |
21177 | unsigned char __data[0]; | |
21178 | }; | |
21179 | ||
21180 | ||
21181 | ||
21182 | struct inet_request_sock { | |
21183 | struct request_sock req; | |
21184 | ||
21185 | ||
21186 | ||
21187 | ||
21188 | __be32 loc_addr; | |
21189 | __be32 rmt_addr; | |
21190 | __be16 rmt_port; | |
21191 | u16 snd_wscale : 4, | |
21192 | rcv_wscale : 4, | |
21193 | tstamp_ok : 1, | |
21194 | sack_ok : 1, | |
21195 | wscale_ok : 1, | |
21196 | ecn_ok : 1, | |
21197 | acked : 1; | |
21198 | struct ip_options *opt; | |
21199 | }; | |
21200 | ||
21201 | static inline __attribute__((always_inline)) struct inet_request_sock *inet_rsk(const struct request_sock *sk) | |
21202 | { | |
21203 | return (struct inet_request_sock *)sk; | |
21204 | } | |
21205 | ||
21206 | struct ip_mc_socklist; | |
21207 | struct ipv6_pinfo; | |
21208 | struct rtable; | |
21209 | # 106 "include/net/inet_sock.h" | |
21210 | struct inet_sock { | |
21211 | ||
21212 | struct sock sk; | |
21213 | ||
21214 | ||
21215 | ||
21216 | ||
21217 | __be32 daddr; | |
21218 | __be32 rcv_saddr; | |
21219 | __be16 dport; | |
21220 | __u16 num; | |
21221 | __be32 saddr; | |
21222 | __s16 uc_ttl; | |
21223 | __u16 cmsg_flags; | |
21224 | struct ip_options *opt; | |
21225 | __be16 sport; | |
21226 | __u16 id; | |
21227 | __u8 tos; | |
21228 | __u8 mc_ttl; | |
21229 | __u8 pmtudisc; | |
21230 | __u8 recverr:1, | |
21231 | is_icsk:1, | |
21232 | freebind:1, | |
21233 | hdrincl:1, | |
21234 | mc_loop:1; | |
21235 | int mc_index; | |
21236 | __be32 mc_addr; | |
21237 | struct ip_mc_socklist *mc_list; | |
21238 | struct { | |
21239 | unsigned int flags; | |
21240 | unsigned int fragsize; | |
21241 | struct ip_options *opt; | |
21242 | struct rtable *rt; | |
21243 | int length; | |
21244 | __be32 addr; | |
21245 | struct flowi fl; | |
21246 | } cork; | |
21247 | }; | |
21248 | ||
21249 | ||
21250 | ||
21251 | ||
21252 | static inline __attribute__((always_inline)) struct inet_sock *inet_sk(const struct sock *sk) | |
21253 | { | |
21254 | return (struct inet_sock *)sk; | |
21255 | } | |
21256 | ||
21257 | static inline __attribute__((always_inline)) void __inet_sk_copy_descendant(struct sock *sk_to, | |
21258 | const struct sock *sk_from, | |
21259 | const int ancestor_size) | |
21260 | { | |
21261 | memcpy(inet_sk(sk_to) + 1, inet_sk(sk_from) + 1, | |
21262 | sk_from->__sk_common.skc_prot->obj_size - ancestor_size); | |
21263 | } | |
21264 | ||
21265 | static inline __attribute__((always_inline)) void inet_sk_copy_descendant(struct sock *sk_to, | |
21266 | const struct sock *sk_from) | |
21267 | { | |
21268 | __inet_sk_copy_descendant(sk_to, sk_from, sizeof(struct inet_sock)); | |
21269 | } | |
21270 | ||
21271 | ||
21272 | extern int inet_sk_rebuild_header(struct sock *sk); | |
21273 | ||
21274 | static inline __attribute__((always_inline)) unsigned int inet_ehashfn(const __be32 laddr, const __u16 lport, | |
21275 | const __be32 faddr, const __be16 fport) | |
21276 | { | |
21277 | unsigned int h = (( __u32)laddr ^ lport) ^ (( __u32)faddr ^ ( __u32)fport); | |
21278 | h ^= h >> 16; | |
21279 | h ^= h >> 8; | |
21280 | return h; | |
21281 | } | |
21282 | ||
21283 | static inline __attribute__((always_inline)) int inet_sk_ehashfn(const struct sock *sk) | |
21284 | { | |
21285 | const struct inet_sock *inet = inet_sk(sk); | |
21286 | const __be32 laddr = inet->rcv_saddr; | |
21287 | const __u16 lport = inet->num; | |
21288 | const __be32 faddr = inet->daddr; | |
21289 | const __be16 fport = inet->dport; | |
21290 | ||
21291 | return inet_ehashfn(laddr, lport, faddr, fport); | |
21292 | } | |
21293 | # 30 "include/net/ip.h" 2 | |
21294 | ||
21295 | ||
21296 | struct sock; | |
21297 | ||
21298 | struct inet_skb_parm | |
21299 | { | |
21300 | struct ip_options opt; | |
21301 | unsigned char flags; | |
21302 | ||
21303 | ||
21304 | ||
21305 | ||
21306 | ||
21307 | ||
21308 | }; | |
21309 | ||
21310 | struct ipcm_cookie | |
21311 | { | |
21312 | __be32 addr; | |
21313 | int oif; | |
21314 | struct ip_options *opt; | |
21315 | }; | |
21316 | ||
21317 | ||
21318 | ||
21319 | struct ip_ra_chain | |
21320 | { | |
21321 | struct ip_ra_chain *next; | |
21322 | struct sock *sk; | |
21323 | void (*destructor)(struct sock *); | |
21324 | }; | |
21325 | ||
21326 | extern struct ip_ra_chain *ip_ra_chain; | |
21327 | extern rwlock_t ip_ra_lock; | |
21328 | # 73 "include/net/ip.h" | |
21329 | struct msghdr; | |
21330 | struct net_device; | |
21331 | struct packet_type; | |
21332 | struct rtable; | |
21333 | struct sk_buff; | |
21334 | struct sockaddr; | |
21335 | ||
21336 | extern void ip_mc_dropsocket(struct sock *); | |
21337 | extern void ip_mc_dropdevice(struct net_device *dev); | |
21338 | extern int igmp_mc_proc_init(void); | |
21339 | ||
21340 | ||
21341 | ||
21342 | ||
21343 | ||
21344 | extern int ip_build_and_send_pkt(struct sk_buff *skb, struct sock *sk, | |
21345 | __be32 saddr, __be32 daddr, | |
21346 | struct ip_options *opt); | |
21347 | extern int ip_rcv(struct sk_buff *skb, struct net_device *dev, | |
21348 | struct packet_type *pt, struct net_device *orig_dev); | |
21349 | extern int ip_local_deliver(struct sk_buff *skb); | |
21350 | extern int ip_mr_input(struct sk_buff *skb); | |
21351 | extern int ip_output(struct sk_buff *skb); | |
21352 | extern int ip_mc_output(struct sk_buff *skb); | |
21353 | extern int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *)); | |
21354 | extern int ip_do_nat(struct sk_buff *skb); | |
21355 | extern void ip_send_check(struct iphdr *ip); | |
21356 | extern int ip_queue_xmit(struct sk_buff *skb, int ipfragok); | |
21357 | extern void ip_init(void); | |
21358 | extern int ip_append_data(struct sock *sk, | |
21359 | int getfrag(void *from, char *to, int offset, int len, | |
21360 | int odd, struct sk_buff *skb), | |
21361 | void *from, int len, int protolen, | |
21362 | struct ipcm_cookie *ipc, | |
21363 | struct rtable *rt, | |
21364 | unsigned int flags); | |
21365 | extern int ip_generic_getfrag(void *from, char *to, int offset, int len, int odd, struct sk_buff *skb); | |
21366 | extern ssize_t ip_append_page(struct sock *sk, struct page *page, | |
21367 | int offset, size_t size, int flags); | |
21368 | extern int ip_push_pending_frames(struct sock *sk); | |
21369 | extern void ip_flush_pending_frames(struct sock *sk); | |
21370 | ||
21371 | ||
21372 | extern int ip4_datagram_connect(struct sock *sk, | |
21373 | struct sockaddr *uaddr, int addr_len); | |
21374 | # 126 "include/net/ip.h" | |
21375 | static inline __attribute__((always_inline)) void ip_tr_mc_map(u32 addr, char *buf) | |
21376 | { | |
21377 | buf[0]=0xC0; | |
21378 | buf[1]=0x00; | |
21379 | buf[2]=0x00; | |
21380 | buf[3]=0x04; | |
21381 | buf[4]=0x00; | |
21382 | buf[5]=0x00; | |
21383 | } | |
21384 | ||
21385 | struct ip_reply_arg { | |
21386 | struct kvec iov[1]; | |
21387 | u32 csum; | |
21388 | int csumoffset; | |
21389 | ||
21390 | }; | |
21391 | ||
21392 | void ip_send_reply(struct sock *sk, struct sk_buff *skb, struct ip_reply_arg *arg, | |
21393 | unsigned int len); | |
21394 | ||
21395 | struct ipv4_config | |
21396 | { | |
21397 | int log_martians; | |
21398 | int no_pmtu_disc; | |
21399 | }; | |
21400 | ||
21401 | extern struct ipv4_config ipv4_config; | |
21402 | extern __typeof__(struct ipstats_mib) *ip_statistics[2]; | |
21403 | ||
21404 | ||
21405 | ||
21406 | extern __typeof__(struct linux_mib) *net_statistics[2]; | |
21407 | ||
21408 | ||
21409 | ||
21410 | ||
21411 | ||
21412 | ||
21413 | extern int sysctl_local_port_range[2]; | |
21414 | extern int sysctl_ip_default_ttl; | |
21415 | extern int sysctl_ip_nonlocal_bind; | |
21416 | ||
21417 | ||
21418 | extern int sysctl_ipfrag_high_thresh; | |
21419 | extern int sysctl_ipfrag_low_thresh; | |
21420 | extern int sysctl_ipfrag_time; | |
21421 | extern int sysctl_ipfrag_secret_interval; | |
21422 | extern int sysctl_ipfrag_max_dist; | |
21423 | ||
21424 | ||
21425 | extern int inet_peer_threshold; | |
21426 | extern int inet_peer_minttl; | |
21427 | extern int inet_peer_maxttl; | |
21428 | extern int inet_peer_gc_mintime; | |
21429 | extern int inet_peer_gc_maxtime; | |
21430 | ||
21431 | ||
21432 | extern int sysctl_ip_dynaddr; | |
21433 | ||
21434 | extern void ipfrag_init(void); | |
21435 | ||
21436 | ||
21437 | ||
21438 | ||
21439 | ||
21440 | ||
21441 | static inline __attribute__((always_inline)) | |
21442 | int ip_decrease_ttl(struct iphdr *iph) | |
21443 | { | |
21444 | u32 check = iph->check; | |
21445 | check += htons(0x0100); | |
21446 | iph->check = check + (check>=0xFFFF); | |
21447 | return --iph->ttl; | |
21448 | } | |
21449 | ||
21450 | static inline __attribute__((always_inline)) | |
21451 | int ip_dont_fragment(struct sock *sk, struct dst_entry *dst) | |
21452 | { | |
21453 | return (inet_sk(sk)->pmtudisc == 2 || | |
21454 | (inet_sk(sk)->pmtudisc == 1 && | |
21455 | !(dst_metric(dst, RTAX_LOCK)&(1<<RTAX_MTU)))); | |
21456 | } | |
21457 | ||
21458 | extern void __ip_select_ident(struct iphdr *iph, struct dst_entry *dst, int more); | |
21459 | ||
21460 | static inline __attribute__((always_inline)) void ip_select_ident(struct iphdr *iph, struct dst_entry *dst, struct sock *sk) | |
21461 | { | |
21462 | if (iph->frag_off & htons(0x4000)) { | |
21463 | ||
21464 | ||
21465 | ||
21466 | ||
21467 | ||
21468 | iph->id = (sk && inet_sk(sk)->daddr) ? | |
21469 | htons(inet_sk(sk)->id++) : 0; | |
21470 | } else | |
21471 | __ip_select_ident(iph, dst, 0); | |
21472 | } | |
21473 | ||
21474 | static inline __attribute__((always_inline)) void ip_select_ident_more(struct iphdr *iph, struct dst_entry *dst, struct sock *sk, int more) | |
21475 | { | |
21476 | if (iph->frag_off & htons(0x4000)) { | |
21477 | if (sk && inet_sk(sk)->daddr) { | |
21478 | iph->id = htons(inet_sk(sk)->id); | |
21479 | inet_sk(sk)->id += 1 + more; | |
21480 | } else | |
21481 | iph->id = 0; | |
21482 | } else | |
21483 | __ip_select_ident(iph, dst, more); | |
21484 | } | |
21485 | ||
21486 | ||
21487 | ||
21488 | ||
21489 | ||
21490 | static inline __attribute__((always_inline)) void ip_eth_mc_map(u32 addr, char *buf) | |
21491 | { | |
21492 | addr=ntohl(addr); | |
21493 | buf[0]=0x01; | |
21494 | buf[1]=0x00; | |
21495 | buf[2]=0x5e; | |
21496 | buf[5]=addr&0xFF; | |
21497 | addr>>=8; | |
21498 | buf[4]=addr&0xFF; | |
21499 | addr>>=8; | |
21500 | buf[3]=addr&0x7F; | |
21501 | } | |
21502 | ||
21503 | ||
21504 | ||
21505 | ||
21506 | ||
21507 | ||
21508 | static inline __attribute__((always_inline)) void ip_ib_mc_map(u32 addr, char *buf) | |
21509 | { | |
21510 | buf[0] = 0; | |
21511 | buf[1] = 0xff; | |
21512 | buf[2] = 0xff; | |
21513 | buf[3] = 0xff; | |
21514 | addr = ntohl(addr); | |
21515 | buf[4] = 0xff; | |
21516 | buf[5] = 0x12; | |
21517 | buf[6] = 0x40; | |
21518 | buf[7] = 0x1b; | |
21519 | buf[8] = 0; | |
21520 | buf[9] = 0; | |
21521 | buf[10] = 0; | |
21522 | buf[11] = 0; | |
21523 | buf[12] = 0; | |
21524 | buf[13] = 0; | |
21525 | buf[14] = 0; | |
21526 | buf[15] = 0; | |
21527 | buf[19] = addr & 0xff; | |
21528 | addr >>= 8; | |
21529 | buf[18] = addr & 0xff; | |
21530 | addr >>= 8; | |
21531 | buf[17] = addr & 0xff; | |
21532 | addr >>= 8; | |
21533 | buf[16] = addr & 0x0f; | |
21534 | } | |
21535 | ||
21536 | ||
21537 | ||
21538 | ||
21539 | ||
21540 | static __inline__ __attribute__((always_inline)) void inet_reset_saddr(struct sock *sk) | |
21541 | { | |
21542 | inet_sk(sk)->rcv_saddr = inet_sk(sk)->saddr = 0; | |
21543 | # 302 "include/net/ip.h" | |
21544 | } | |
21545 | ||
21546 | ||
21547 | ||
21548 | extern int ip_call_ra_chain(struct sk_buff *skb); | |
21549 | ||
21550 | ||
21551 | ||
21552 | ||
21553 | ||
21554 | enum ip_defrag_users | |
21555 | { | |
21556 | IP_DEFRAG_LOCAL_DELIVER, | |
21557 | IP_DEFRAG_CALL_RA_CHAIN, | |
21558 | IP_DEFRAG_CONNTRACK_IN, | |
21559 | IP_DEFRAG_CONNTRACK_OUT, | |
21560 | IP_DEFRAG_VS_IN, | |
21561 | IP_DEFRAG_VS_OUT, | |
21562 | IP_DEFRAG_VS_FWD | |
21563 | }; | |
21564 | ||
21565 | struct sk_buff *ip_defrag(struct sk_buff *skb, u32 user); | |
21566 | extern int ip_frag_nqueues; | |
21567 | extern atomic_t ip_frag_mem; | |
21568 | ||
21569 | ||
21570 | ||
21571 | ||
21572 | ||
21573 | extern int ip_forward(struct sk_buff *skb); | |
21574 | extern int ip_net_unreachable(struct sk_buff *skb); | |
21575 | ||
21576 | ||
21577 | ||
21578 | ||
21579 | ||
21580 | extern void ip_options_build(struct sk_buff *skb, struct ip_options *opt, __be32 daddr, struct rtable *rt, int is_frag); | |
21581 | extern int ip_options_echo(struct ip_options *dopt, struct sk_buff *skb); | |
21582 | extern void ip_options_fragment(struct sk_buff *skb); | |
21583 | extern int ip_options_compile(struct ip_options *opt, struct sk_buff *skb); | |
21584 | extern int ip_options_get(struct ip_options **optp, | |
21585 | unsigned char *data, int optlen); | |
21586 | extern int ip_options_get_from_user(struct ip_options **optp, | |
21587 | unsigned char *data, int optlen); | |
21588 | extern void ip_options_undo(struct ip_options * opt); | |
21589 | extern void ip_forward_options(struct sk_buff *skb); | |
21590 | extern int ip_options_rcv_srr(struct sk_buff *skb); | |
21591 | ||
21592 | ||
21593 | ||
21594 | ||
21595 | ||
21596 | extern void ip_cmsg_recv(struct msghdr *msg, struct sk_buff *skb); | |
21597 | extern int ip_cmsg_send(struct msghdr *msg, struct ipcm_cookie *ipc); | |
21598 | extern int ip_setsockopt(struct sock *sk, int level, int optname, char *optval, int optlen); | |
21599 | extern int ip_getsockopt(struct sock *sk, int level, int optname, char *optval, int *optlen); | |
21600 | extern int compat_ip_setsockopt(struct sock *sk, int level, | |
21601 | int optname, char *optval, int optlen); | |
21602 | extern int compat_ip_getsockopt(struct sock *sk, int level, | |
21603 | int optname, char *optval, int *optlen); | |
21604 | extern int ip_ra_control(struct sock *sk, unsigned char on, void (*destructor)(struct sock *)); | |
21605 | ||
21606 | extern int ip_recv_error(struct sock *sk, struct msghdr *msg, int len); | |
21607 | extern void ip_icmp_error(struct sock *sk, struct sk_buff *skb, int err, | |
21608 | __be16 port, u32 info, u8 *payload); | |
21609 | extern void ip_local_error(struct sock *sk, int err, __be32 daddr, __be16 dport, | |
21610 | u32 info); | |
21611 | ||
21612 | ||
21613 | ||
21614 | ||
21615 | int ipv4_doint_and_flush(ctl_table *ctl, int write, | |
21616 | struct file* filp, void *buffer, | |
21617 | size_t *lenp, loff_t *ppos); | |
21618 | int ipv4_doint_and_flush_strategy(ctl_table *table, int *name, int nlen, | |
21619 | void *oldval, size_t *oldlenp, | |
21620 | void *newval, size_t newlen, | |
21621 | void **context); | |
21622 | ||
21623 | extern int ip_misc_proc_init(void); | |
21624 | ||
21625 | ||
21626 | extern struct ctl_table ipv4_table[]; | |
21627 | # 69 "net/ipv4/ip_output.c" 2 | |
21628 | # 1 "include/net/protocol.h" 1 | |
21629 | # 36 "include/net/protocol.h" | |
21630 | struct net_protocol { | |
21631 | int (*handler)(struct sk_buff *skb); | |
21632 | void (*err_handler)(struct sk_buff *skb, u32 info); | |
21633 | int (*gso_send_check)(struct sk_buff *skb); | |
21634 | struct sk_buff *(*gso_segment)(struct sk_buff *skb, | |
21635 | int features); | |
21636 | int no_policy; | |
21637 | }; | |
21638 | # 69 "include/net/protocol.h" | |
21639 | struct inet_protosw { | |
21640 | struct list_head list; | |
21641 | ||
21642 | ||
21643 | unsigned short type; | |
21644 | int protocol; | |
21645 | ||
21646 | struct proto *prot; | |
21647 | const struct proto_ops *ops; | |
21648 | ||
21649 | int capability; | |
21650 | ||
21651 | ||
21652 | ||
21653 | char no_check; | |
21654 | unsigned char flags; | |
21655 | }; | |
21656 | ||
21657 | ||
21658 | ||
21659 | ||
21660 | extern struct net_protocol *inet_protocol_base; | |
21661 | extern struct net_protocol *inet_protos[256]; | |
21662 | ||
21663 | ||
21664 | ||
21665 | ||
21666 | ||
21667 | extern int inet_add_protocol(struct net_protocol *prot, unsigned char num); | |
21668 | extern int inet_del_protocol(struct net_protocol *prot, unsigned char num); | |
21669 | extern void inet_register_protosw(struct inet_protosw *p); | |
21670 | extern void inet_unregister_protosw(struct inet_protosw *p); | |
21671 | # 70 "net/ipv4/ip_output.c" 2 | |
21672 | # 1 "include/net/route.h" 1 | |
21673 | # 28 "include/net/route.h" | |
21674 | # 1 "include/net/inetpeer.h" 1 | |
21675 | # 18 "include/net/inetpeer.h" | |
21676 | struct inet_peer | |
21677 | { | |
21678 | ||
21679 | struct inet_peer *avl_left, *avl_right; | |
21680 | __be32 v4daddr; | |
21681 | __u16 avl_height; | |
21682 | __u16 ip_id_count; | |
21683 | struct inet_peer *unused_next, **unused_prevp; | |
21684 | __u32 dtime; | |
21685 | ||
21686 | atomic_t refcnt; | |
21687 | atomic_t rid; | |
21688 | __u32 tcp_ts; | |
21689 | unsigned long tcp_ts_stamp; | |
21690 | }; | |
21691 | ||
21692 | void inet_initpeers(void) __attribute__ ((__section__ (".init.text"))); | |
21693 | ||
21694 | ||
21695 | struct inet_peer *inet_getpeer(__be32 daddr, int create); | |
21696 | ||
21697 | ||
21698 | extern void inet_putpeer(struct inet_peer *p); | |
21699 | ||
21700 | extern spinlock_t inet_peer_idlock; | |
21701 | ||
21702 | static inline __attribute__((always_inline)) __u16 inet_getid(struct inet_peer *p, int more) | |
21703 | { | |
21704 | __u16 id; | |
21705 | ||
21706 | do { local_bh_disable(); do { do { } while (0); (void)0; (void)(&inet_peer_idlock); } while (0); } while (0); | |
21707 | id = p->ip_id_count; | |
21708 | p->ip_id_count += 1 + more; | |
21709 | do { do { } while (0); local_bh_enable(); (void)0; (void)(&inet_peer_idlock); } while (0); | |
21710 | return id; | |
21711 | } | |
21712 | # 29 "include/net/route.h" 2 | |
21713 | ||
21714 | # 1 "include/linux/in_route.h" 1 | |
21715 | # 31 "include/net/route.h" 2 | |
21716 | ||
21717 | # 1 "include/linux/route.h" 1 | |
21718 | # 30 "include/linux/route.h" | |
21719 | struct rtentry | |
21720 | { | |
21721 | unsigned long rt_pad1; | |
21722 | struct sockaddr rt_dst; | |
21723 | struct sockaddr rt_gateway; | |
21724 | struct sockaddr rt_genmask; | |
21725 | unsigned short rt_flags; | |
21726 | short rt_pad2; | |
21727 | unsigned long rt_pad3; | |
21728 | void *rt_pad4; | |
21729 | short rt_metric; | |
21730 | char *rt_dev; | |
21731 | unsigned long rt_mtu; | |
21732 | ||
21733 | ||
21734 | ||
21735 | unsigned long rt_window; | |
21736 | unsigned short rt_irtt; | |
21737 | }; | |
21738 | # 33 "include/net/route.h" 2 | |
21739 | # 49 "include/net/route.h" | |
21740 | struct fib_nh; | |
21741 | struct inet_peer; | |
21742 | struct rtable | |
21743 | { | |
21744 | union | |
21745 | { | |
21746 | struct dst_entry dst; | |
21747 | struct rtable *rt_next; | |
21748 | } u; | |
21749 | ||
21750 | struct in_device *idev; | |
21751 | ||
21752 | unsigned rt_flags; | |
21753 | __u16 rt_type; | |
21754 | __u16 rt_multipath_alg; | |
21755 | ||
21756 | __be32 rt_dst; | |
21757 | __be32 rt_src; | |
21758 | int rt_iif; | |
21759 | ||
21760 | ||
21761 | __be32 rt_gateway; | |
21762 | ||
21763 | ||
21764 | struct flowi fl; | |
21765 | ||
21766 | ||
21767 | __be32 rt_spec_dst; | |
21768 | struct inet_peer *peer; | |
21769 | }; | |
21770 | ||
21771 | struct ip_rt_acct | |
21772 | { | |
21773 | __u32 o_bytes; | |
21774 | __u32 o_packets; | |
21775 | __u32 i_bytes; | |
21776 | __u32 i_packets; | |
21777 | }; | |
21778 | ||
21779 | struct rt_cache_stat | |
21780 | { | |
21781 | unsigned int in_hit; | |
21782 | unsigned int in_slow_tot; | |
21783 | unsigned int in_slow_mc; | |
21784 | unsigned int in_no_route; | |
21785 | unsigned int in_brd; | |
21786 | unsigned int in_martian_dst; | |
21787 | unsigned int in_martian_src; | |
21788 | unsigned int out_hit; | |
21789 | unsigned int out_slow_tot; | |
21790 | unsigned int out_slow_mc; | |
21791 | unsigned int gc_total; | |
21792 | unsigned int gc_ignored; | |
21793 | unsigned int gc_goal_miss; | |
21794 | unsigned int gc_dst_overflow; | |
21795 | unsigned int in_hlist_search; | |
21796 | unsigned int out_hlist_search; | |
21797 | }; | |
21798 | ||
21799 | extern struct ip_rt_acct *ip_rt_acct; | |
21800 | ||
21801 | struct in_device; | |
21802 | extern int ip_rt_init(void); | |
21803 | extern void ip_rt_redirect(__be32 old_gw, __be32 dst, __be32 new_gw, | |
21804 | __be32 src, struct net_device *dev); | |
21805 | extern void ip_rt_advice(struct rtable **rp, int advice); | |
21806 | extern void rt_cache_flush(int how); | |
21807 | extern int __ip_route_output_key(struct rtable **, const struct flowi *flp); | |
21808 | extern int ip_route_output_key(struct rtable **, struct flowi *flp); | |
21809 | extern int ip_route_output_flow(struct rtable **rp, struct flowi *flp, struct sock *sk, int flags); | |
21810 | extern int ip_route_input(struct sk_buff*, __be32 dst, __be32 src, u8 tos, struct net_device *devin); | |
21811 | extern unsigned short ip_rt_frag_needed(struct iphdr *iph, unsigned short new_mtu); | |
21812 | extern void ip_rt_send_redirect(struct sk_buff *skb); | |
21813 | ||
21814 | extern unsigned inet_addr_type(__be32 addr); | |
21815 | extern void ip_rt_multicast_event(struct in_device *); | |
21816 | extern int ip_rt_ioctl(unsigned int cmd, void *arg); | |
21817 | extern void ip_rt_get_source(u8 *src, struct rtable *rt); | |
21818 | extern int ip_rt_dump(struct sk_buff *skb, struct netlink_callback *cb); | |
21819 | ||
21820 | struct in_ifaddr; | |
21821 | extern void fib_add_ifaddr(struct in_ifaddr *); | |
21822 | ||
21823 | static inline __attribute__((always_inline)) void ip_rt_put(struct rtable * rt) | |
21824 | { | |
21825 | if (rt) | |
21826 | dst_release(&rt->u.dst); | |
21827 | } | |
21828 | ||
21829 | ||
21830 | ||
21831 | extern __u8 ip_tos2prio[16]; | |
21832 | ||
21833 | static inline __attribute__((always_inline)) char rt_tos2priority(u8 tos) | |
21834 | { | |
21835 | return ip_tos2prio[((tos)&0x1E)>>1]; | |
21836 | } | |
21837 | ||
21838 | static inline __attribute__((always_inline)) int ip_route_connect(struct rtable **rp, __be32 dst, | |
21839 | __be32 src, u32 tos, int oif, u8 protocol, | |
21840 | __be16 sport, __be16 dport, struct sock *sk) | |
21841 | { | |
21842 | struct flowi fl = { .oif = oif, | |
21843 | .nl_u = { .ip4_u = { .daddr = dst, | |
21844 | .saddr = src, | |
21845 | .tos = tos } }, | |
21846 | .proto = protocol, | |
21847 | .uli_u = { .ports = | |
21848 | { .sport = sport, | |
21849 | .dport = dport } } }; | |
21850 | ||
21851 | int err; | |
21852 | if (!dst || !src) { | |
21853 | err = __ip_route_output_key(rp, &fl); | |
21854 | if (err) | |
21855 | return err; | |
21856 | fl.nl_u.ip4_u.daddr = (*rp)->rt_dst; | |
21857 | fl.nl_u.ip4_u.saddr = (*rp)->rt_src; | |
21858 | ip_rt_put(*rp); | |
21859 | *rp = ((void *)0); | |
21860 | } | |
21861 | security_sk_classify_flow(sk, &fl); | |
21862 | return ip_route_output_flow(rp, &fl, sk, 0); | |
21863 | } | |
21864 | ||
21865 | static inline __attribute__((always_inline)) int ip_route_newports(struct rtable **rp, u8 protocol, | |
21866 | __be16 sport, __be16 dport, struct sock *sk) | |
21867 | { | |
21868 | if (sport != (*rp)->fl.uli_u.ports.sport || | |
21869 | dport != (*rp)->fl.uli_u.ports.dport) { | |
21870 | struct flowi fl; | |
21871 | ||
21872 | memcpy(&fl, &(*rp)->fl, sizeof(fl)); | |
21873 | fl.uli_u.ports.sport = sport; | |
21874 | fl.uli_u.ports.dport = dport; | |
21875 | fl.proto = protocol; | |
21876 | ip_rt_put(*rp); | |
21877 | *rp = ((void *)0); | |
21878 | security_sk_classify_flow(sk, &fl); | |
21879 | return ip_route_output_flow(rp, &fl, sk, 0); | |
21880 | } | |
21881 | return 0; | |
21882 | } | |
21883 | ||
21884 | extern void rt_bind_peer(struct rtable *rt, int create); | |
21885 | ||
21886 | static inline __attribute__((always_inline)) struct inet_peer *rt_get_peer(struct rtable *rt) | |
21887 | { | |
21888 | if (rt->peer) | |
21889 | return rt->peer; | |
21890 | ||
21891 | rt_bind_peer(rt, 0); | |
21892 | return rt->peer; | |
21893 | } | |
21894 | ||
21895 | extern ctl_table ipv4_route_table[]; | |
21896 | # 71 "net/ipv4/ip_output.c" 2 | |
21897 | # 1 "include/net/xfrm.h" 1 | |
21898 | # 11 "include/net/xfrm.h" | |
21899 | # 1 "include/linux/pfkeyv2.h" 1 | |
21900 | # 14 "include/linux/pfkeyv2.h" | |
21901 | struct sadb_msg { | |
21902 | uint8_t sadb_msg_version; | |
21903 | uint8_t sadb_msg_type; | |
21904 | uint8_t sadb_msg_errno; | |
21905 | uint8_t sadb_msg_satype; | |
21906 | uint16_t sadb_msg_len; | |
21907 | uint16_t sadb_msg_reserved; | |
21908 | uint32_t sadb_msg_seq; | |
21909 | uint32_t sadb_msg_pid; | |
21910 | } __attribute__((packed)); | |
21911 | ||
21912 | ||
21913 | struct sadb_ext { | |
21914 | uint16_t sadb_ext_len; | |
21915 | uint16_t sadb_ext_type; | |
21916 | } __attribute__((packed)); | |
21917 | ||
21918 | ||
21919 | struct sadb_sa { | |
21920 | uint16_t sadb_sa_len; | |
21921 | uint16_t sadb_sa_exttype; | |
21922 | uint32_t sadb_sa_spi; | |
21923 | uint8_t sadb_sa_replay; | |
21924 | uint8_t sadb_sa_state; | |
21925 | uint8_t sadb_sa_auth; | |
21926 | uint8_t sadb_sa_encrypt; | |
21927 | uint32_t sadb_sa_flags; | |
21928 | } __attribute__((packed)); | |
21929 | ||
21930 | ||
21931 | struct sadb_lifetime { | |
21932 | uint16_t sadb_lifetime_len; | |
21933 | uint16_t sadb_lifetime_exttype; | |
21934 | uint32_t sadb_lifetime_allocations; | |
21935 | uint64_t sadb_lifetime_bytes; | |
21936 | uint64_t sadb_lifetime_addtime; | |
21937 | uint64_t sadb_lifetime_usetime; | |
21938 | } __attribute__((packed)); | |
21939 | ||
21940 | ||
21941 | struct sadb_address { | |
21942 | uint16_t sadb_address_len; | |
21943 | uint16_t sadb_address_exttype; | |
21944 | uint8_t sadb_address_proto; | |
21945 | uint8_t sadb_address_prefixlen; | |
21946 | uint16_t sadb_address_reserved; | |
21947 | } __attribute__((packed)); | |
21948 | ||
21949 | ||
21950 | struct sadb_key { | |
21951 | uint16_t sadb_key_len; | |
21952 | uint16_t sadb_key_exttype; | |
21953 | uint16_t sadb_key_bits; | |
21954 | uint16_t sadb_key_reserved; | |
21955 | } __attribute__((packed)); | |
21956 | ||
21957 | ||
21958 | struct sadb_ident { | |
21959 | uint16_t sadb_ident_len; | |
21960 | uint16_t sadb_ident_exttype; | |
21961 | uint16_t sadb_ident_type; | |
21962 | uint16_t sadb_ident_reserved; | |
21963 | uint64_t sadb_ident_id; | |
21964 | } __attribute__((packed)); | |
21965 | ||
21966 | ||
21967 | struct sadb_sens { | |
21968 | uint16_t sadb_sens_len; | |
21969 | uint16_t sadb_sens_exttype; | |
21970 | uint32_t sadb_sens_dpd; | |
21971 | uint8_t sadb_sens_sens_level; | |
21972 | uint8_t sadb_sens_sens_len; | |
21973 | uint8_t sadb_sens_integ_level; | |
21974 | uint8_t sadb_sens_integ_len; | |
21975 | uint32_t sadb_sens_reserved; | |
21976 | } __attribute__((packed)); | |
21977 | ||
21978 | ||
21979 | ||
21980 | ||
21981 | ||
21982 | ||
21983 | struct sadb_prop { | |
21984 | uint16_t sadb_prop_len; | |
21985 | uint16_t sadb_prop_exttype; | |
21986 | uint8_t sadb_prop_replay; | |
21987 | uint8_t sadb_prop_reserved[3]; | |
21988 | } __attribute__((packed)); | |
21989 | ||
21990 | ||
21991 | ||
21992 | ||
21993 | ||
21994 | ||
21995 | ||
21996 | struct sadb_comb { | |
21997 | uint8_t sadb_comb_auth; | |
21998 | uint8_t sadb_comb_encrypt; | |
21999 | uint16_t sadb_comb_flags; | |
22000 | uint16_t sadb_comb_auth_minbits; | |
22001 | uint16_t sadb_comb_auth_maxbits; | |
22002 | uint16_t sadb_comb_encrypt_minbits; | |
22003 | uint16_t sadb_comb_encrypt_maxbits; | |
22004 | uint32_t sadb_comb_reserved; | |
22005 | uint32_t sadb_comb_soft_allocations; | |
22006 | uint32_t sadb_comb_hard_allocations; | |
22007 | uint64_t sadb_comb_soft_bytes; | |
22008 | uint64_t sadb_comb_hard_bytes; | |
22009 | uint64_t sadb_comb_soft_addtime; | |
22010 | uint64_t sadb_comb_hard_addtime; | |
22011 | uint64_t sadb_comb_soft_usetime; | |
22012 | uint64_t sadb_comb_hard_usetime; | |
22013 | } __attribute__((packed)); | |
22014 | ||
22015 | ||
22016 | struct sadb_supported { | |
22017 | uint16_t sadb_supported_len; | |
22018 | uint16_t sadb_supported_exttype; | |
22019 | uint32_t sadb_supported_reserved; | |
22020 | } __attribute__((packed)); | |
22021 | ||
22022 | ||
22023 | ||
22024 | ||
22025 | ||
22026 | ||
22027 | ||
22028 | struct sadb_alg { | |
22029 | uint8_t sadb_alg_id; | |
22030 | uint8_t sadb_alg_ivlen; | |
22031 | uint16_t sadb_alg_minbits; | |
22032 | uint16_t sadb_alg_maxbits; | |
22033 | uint16_t sadb_alg_reserved; | |
22034 | } __attribute__((packed)); | |
22035 | ||
22036 | ||
22037 | struct sadb_spirange { | |
22038 | uint16_t sadb_spirange_len; | |
22039 | uint16_t sadb_spirange_exttype; | |
22040 | uint32_t sadb_spirange_min; | |
22041 | uint32_t sadb_spirange_max; | |
22042 | uint32_t sadb_spirange_reserved; | |
22043 | } __attribute__((packed)); | |
22044 | ||
22045 | ||
22046 | struct sadb_x_kmprivate { | |
22047 | uint16_t sadb_x_kmprivate_len; | |
22048 | uint16_t sadb_x_kmprivate_exttype; | |
22049 | uint32_t sadb_x_kmprivate_reserved; | |
22050 | } __attribute__((packed)); | |
22051 | ||
22052 | ||
22053 | struct sadb_x_sa2 { | |
22054 | uint16_t sadb_x_sa2_len; | |
22055 | uint16_t sadb_x_sa2_exttype; | |
22056 | uint8_t sadb_x_sa2_mode; | |
22057 | uint8_t sadb_x_sa2_reserved1; | |
22058 | uint16_t sadb_x_sa2_reserved2; | |
22059 | uint32_t sadb_x_sa2_sequence; | |
22060 | uint32_t sadb_x_sa2_reqid; | |
22061 | } __attribute__((packed)); | |
22062 | ||
22063 | ||
22064 | struct sadb_x_policy { | |
22065 | uint16_t sadb_x_policy_len; | |
22066 | uint16_t sadb_x_policy_exttype; | |
22067 | uint16_t sadb_x_policy_type; | |
22068 | uint8_t sadb_x_policy_dir; | |
22069 | uint8_t sadb_x_policy_reserved; | |
22070 | uint32_t sadb_x_policy_id; | |
22071 | uint32_t sadb_x_policy_priority; | |
22072 | } __attribute__((packed)); | |
22073 | ||
22074 | ||
22075 | struct sadb_x_ipsecrequest { | |
22076 | uint16_t sadb_x_ipsecrequest_len; | |
22077 | uint16_t sadb_x_ipsecrequest_proto; | |
22078 | uint8_t sadb_x_ipsecrequest_mode; | |
22079 | uint8_t sadb_x_ipsecrequest_level; | |
22080 | uint16_t sadb_x_ipsecrequest_reserved1; | |
22081 | uint32_t sadb_x_ipsecrequest_reqid; | |
22082 | uint32_t sadb_x_ipsecrequest_reserved2; | |
22083 | } __attribute__((packed)); | |
22084 | ||
22085 | ||
22086 | ||
22087 | ||
22088 | ||
22089 | struct sadb_x_nat_t_type { | |
22090 | uint16_t sadb_x_nat_t_type_len; | |
22091 | uint16_t sadb_x_nat_t_type_exttype; | |
22092 | uint8_t sadb_x_nat_t_type_type; | |
22093 | uint8_t sadb_x_nat_t_type_reserved[3]; | |
22094 | } __attribute__((packed)); | |
22095 | ||
22096 | ||
22097 | ||
22098 | struct sadb_x_nat_t_port { | |
22099 | uint16_t sadb_x_nat_t_port_len; | |
22100 | uint16_t sadb_x_nat_t_port_exttype; | |
22101 | uint16_t sadb_x_nat_t_port_port; | |
22102 | uint16_t sadb_x_nat_t_port_reserved; | |
22103 | } __attribute__((packed)); | |
22104 | ||
22105 | ||
22106 | ||
22107 | struct sadb_x_sec_ctx { | |
22108 | uint16_t sadb_x_sec_len; | |
22109 | uint16_t sadb_x_sec_exttype; | |
22110 | uint8_t sadb_x_ctx_alg; | |
22111 | uint8_t sadb_x_ctx_doi; | |
22112 | uint16_t sadb_x_ctx_len; | |
22113 | } __attribute__((packed)); | |
22114 | # 12 "include/net/xfrm.h" 2 | |
22115 | # 1 "include/linux/ipsec.h" 1 | |
22116 | # 12 "include/linux/ipsec.h" | |
22117 | enum { | |
22118 | IPSEC_MODE_ANY = 0, | |
22119 | IPSEC_MODE_TRANSPORT = 1, | |
22120 | IPSEC_MODE_TUNNEL = 2, | |
22121 | IPSEC_MODE_BEET = 3 | |
22122 | }; | |
22123 | ||
22124 | enum { | |
22125 | IPSEC_DIR_ANY = 0, | |
22126 | IPSEC_DIR_INBOUND = 1, | |
22127 | IPSEC_DIR_OUTBOUND = 2, | |
22128 | IPSEC_DIR_FWD = 3, | |
22129 | IPSEC_DIR_MAX = 4, | |
22130 | IPSEC_DIR_INVALID = 5 | |
22131 | }; | |
22132 | ||
22133 | enum { | |
22134 | IPSEC_POLICY_DISCARD = 0, | |
22135 | IPSEC_POLICY_NONE = 1, | |
22136 | IPSEC_POLICY_IPSEC = 2, | |
22137 | IPSEC_POLICY_ENTRUST = 3, | |
22138 | IPSEC_POLICY_BYPASS = 4 | |
22139 | }; | |
22140 | ||
22141 | enum { | |
22142 | IPSEC_LEVEL_DEFAULT = 0, | |
22143 | IPSEC_LEVEL_USE = 1, | |
22144 | IPSEC_LEVEL_REQUIRE = 2, | |
22145 | IPSEC_LEVEL_UNIQUE = 3 | |
22146 | }; | |
22147 | # 13 "include/net/xfrm.h" 2 | |
22148 | ||
22149 | ||
22150 | ||
22151 | ||
22152 | ||
22153 | ||
22154 | # 1 "include/net/ipv6.h" 1 | |
22155 | # 18 "include/net/ipv6.h" | |
22156 | # 1 "include/linux/ipv6.h" 1 | |
22157 | # 18 "include/linux/ipv6.h" | |
22158 | struct in6_pktinfo { | |
22159 | struct in6_addr ipi6_addr; | |
22160 | int ipi6_ifindex; | |
22161 | }; | |
22162 | ||
22163 | ||
22164 | struct in6_ifreq { | |
22165 | struct in6_addr ifr6_addr; | |
22166 | __u32 ifr6_prefixlen; | |
22167 | int ifr6_ifindex; | |
22168 | }; | |
22169 | # 37 "include/linux/ipv6.h" | |
22170 | struct ipv6_rt_hdr { | |
22171 | __u8 nexthdr; | |
22172 | __u8 hdrlen; | |
22173 | __u8 type; | |
22174 | __u8 segments_left; | |
22175 | ||
22176 | ||
22177 | ||
22178 | ||
22179 | ||
22180 | }; | |
22181 | ||
22182 | ||
22183 | struct ipv6_opt_hdr { | |
22184 | __u8 nexthdr; | |
22185 | __u8 hdrlen; | |
22186 | ||
22187 | ||
22188 | ||
22189 | }; | |
22190 | # 69 "include/linux/ipv6.h" | |
22191 | struct rt0_hdr { | |
22192 | struct ipv6_rt_hdr rt_hdr; | |
22193 | __u32 reserved; | |
22194 | struct in6_addr addr[0]; | |
22195 | ||
22196 | ||
22197 | }; | |
22198 | ||
22199 | ||
22200 | ||
22201 | ||
22202 | ||
22203 | struct rt2_hdr { | |
22204 | struct ipv6_rt_hdr rt_hdr; | |
22205 | __u32 reserved; | |
22206 | struct in6_addr addr; | |
22207 | ||
22208 | ||
22209 | }; | |
22210 | ||
22211 | ||
22212 | ||
22213 | ||
22214 | ||
22215 | struct ipv6_destopt_hao { | |
22216 | __u8 type; | |
22217 | __u8 length; | |
22218 | struct in6_addr addr; | |
22219 | } __attribute__ ((__packed__)); | |
22220 | ||
22221 | struct ipv6_auth_hdr { | |
22222 | __u8 nexthdr; | |
22223 | __u8 hdrlen; | |
22224 | __be16 reserved; | |
22225 | __be32 spi; | |
22226 | __be32 seq_no; | |
22227 | __u8 auth_data[0]; | |
22228 | }; | |
22229 | ||
22230 | struct ipv6_esp_hdr { | |
22231 | __be32 spi; | |
22232 | __be32 seq_no; | |
22233 | __u8 enc_data[0]; | |
22234 | }; | |
22235 | ||
22236 | struct ipv6_comp_hdr { | |
22237 | __u8 nexthdr; | |
22238 | __u8 flags; | |
22239 | __be16 cpi; | |
22240 | }; | |
22241 | # 127 "include/linux/ipv6.h" | |
22242 | struct ipv6hdr { | |
22243 | ||
22244 | __u8 priority:4, | |
22245 | version:4; | |
22246 | ||
22247 | ||
22248 | ||
22249 | ||
22250 | ||
22251 | ||
22252 | __u8 flow_lbl[3]; | |
22253 | ||
22254 | __be16 payload_len; | |
22255 | __u8 nexthdr; | |
22256 | __u8 hop_limit; | |
22257 | ||
22258 | struct in6_addr saddr; | |
22259 | struct in6_addr daddr; | |
22260 | }; | |
22261 | ||
22262 | ||
22263 | ||
22264 | ||
22265 | struct ipv6_devconf { | |
22266 | __s32 forwarding; | |
22267 | __s32 hop_limit; | |
22268 | __s32 mtu6; | |
22269 | __s32 accept_ra; | |
22270 | __s32 accept_redirects; | |
22271 | __s32 autoconf; | |
22272 | __s32 dad_transmits; | |
22273 | __s32 rtr_solicits; | |
22274 | __s32 rtr_solicit_interval; | |
22275 | __s32 rtr_solicit_delay; | |
22276 | __s32 force_mld_version; | |
22277 | ||
22278 | ||
22279 | ||
22280 | ||
22281 | ||
22282 | ||
22283 | ||
22284 | __s32 max_addresses; | |
22285 | __s32 accept_ra_defrtr; | |
22286 | __s32 accept_ra_pinfo; | |
22287 | ||
22288 | ||
22289 | ||
22290 | ||
22291 | ||
22292 | ||
22293 | ||
22294 | __s32 proxy_ndp; | |
22295 | void *sysctl; | |
22296 | }; | |
22297 | ||
22298 | ||
22299 | enum { | |
22300 | DEVCONF_FORWARDING = 0, | |
22301 | DEVCONF_HOPLIMIT, | |
22302 | DEVCONF_MTU6, | |
22303 | DEVCONF_ACCEPT_RA, | |
22304 | DEVCONF_ACCEPT_REDIRECTS, | |
22305 | DEVCONF_AUTOCONF, | |
22306 | DEVCONF_DAD_TRANSMITS, | |
22307 | DEVCONF_RTR_SOLICITS, | |
22308 | DEVCONF_RTR_SOLICIT_INTERVAL, | |
22309 | DEVCONF_RTR_SOLICIT_DELAY, | |
22310 | DEVCONF_USE_TEMPADDR, | |
22311 | DEVCONF_TEMP_VALID_LFT, | |
22312 | DEVCONF_TEMP_PREFERED_LFT, | |
22313 | DEVCONF_REGEN_MAX_RETRY, | |
22314 | DEVCONF_MAX_DESYNC_FACTOR, | |
22315 | DEVCONF_MAX_ADDRESSES, | |
22316 | DEVCONF_FORCE_MLD_VERSION, | |
22317 | DEVCONF_ACCEPT_RA_DEFRTR, | |
22318 | DEVCONF_ACCEPT_RA_PINFO, | |
22319 | DEVCONF_ACCEPT_RA_RTR_PREF, | |
22320 | DEVCONF_RTR_PROBE_INTERVAL, | |
22321 | DEVCONF_ACCEPT_RA_RT_INFO_MAX_PLEN, | |
22322 | DEVCONF_PROXY_NDP, | |
22323 | DEVCONF_MAX | |
22324 | }; | |
22325 | ||
22326 | ||
22327 | # 1 "include/linux/icmpv6.h" 1 | |
22328 | ||
22329 | ||
22330 | ||
22331 | ||
22332 | ||
22333 | struct icmp6hdr { | |
22334 | ||
22335 | __u8 icmp6_type; | |
22336 | __u8 icmp6_code; | |
22337 | __u16 icmp6_cksum; | |
22338 | ||
22339 | ||
22340 | union { | |
22341 | __u32 un_data32[1]; | |
22342 | __u16 un_data16[2]; | |
22343 | __u8 un_data8[4]; | |
22344 | ||
22345 | struct icmpv6_echo { | |
22346 | __u16 identifier; | |
22347 | __u16 sequence; | |
22348 | } u_echo; | |
22349 | ||
22350 | struct icmpv6_nd_advt { | |
22351 | ||
22352 | __u32 reserved:5, | |
22353 | override:1, | |
22354 | solicited:1, | |
22355 | router:1, | |
22356 | reserved2:24; | |
22357 | # 38 "include/linux/icmpv6.h" | |
22358 | } u_nd_advt; | |
22359 | ||
22360 | struct icmpv6_nd_ra { | |
22361 | __u8 hop_limit; | |
22362 | ||
22363 | __u8 reserved:4, | |
22364 | router_pref:2, | |
22365 | other:1, | |
22366 | managed:1; | |
22367 | # 56 "include/linux/icmpv6.h" | |
22368 | __u16 rt_lifetime; | |
22369 | } u_nd_ra; | |
22370 | ||
22371 | } icmp6_dataun; | |
22372 | # 76 "include/linux/icmpv6.h" | |
22373 | }; | |
22374 | # 143 "include/linux/icmpv6.h" | |
22375 | struct icmp6_filter { | |
22376 | __u32 data[8]; | |
22377 | }; | |
22378 | # 165 "include/linux/icmpv6.h" | |
22379 | extern void icmpv6_send(struct sk_buff *skb, | |
22380 | int type, int code, | |
22381 | __u32 info, | |
22382 | struct net_device *dev); | |
22383 | ||
22384 | extern int icmpv6_init(struct net_proto_family *ops); | |
22385 | extern int icmpv6_err_convert(int type, int code, | |
22386 | int *err); | |
22387 | extern void icmpv6_cleanup(void); | |
22388 | extern void icmpv6_param_prob(struct sk_buff *skb, | |
22389 | int code, int pos); | |
22390 | # 213 "include/linux/ipv6.h" 2 | |
22391 | # 1 "include/linux/tcp.h" 1 | |
22392 | # 23 "include/linux/tcp.h" | |
22393 | struct tcphdr { | |
22394 | __be16 source; | |
22395 | __be16 dest; | |
22396 | __be32 seq; | |
22397 | __be32 ack_seq; | |
22398 | ||
22399 | __u16 res1:4, | |
22400 | doff:4, | |
22401 | fin:1, | |
22402 | syn:1, | |
22403 | rst:1, | |
22404 | psh:1, | |
22405 | ack:1, | |
22406 | urg:1, | |
22407 | ece:1, | |
22408 | cwr:1; | |
22409 | # 53 "include/linux/tcp.h" | |
22410 | __be16 window; | |
22411 | __be16 check; | |
22412 | __be16 urg_ptr; | |
22413 | }; | |
22414 | ||
22415 | ||
22416 | ||
22417 | ||
22418 | ||
22419 | ||
22420 | union tcp_word_hdr { | |
22421 | struct tcphdr hdr; | |
22422 | __be32 words[5]; | |
22423 | }; | |
22424 | ||
22425 | ||
22426 | ||
22427 | enum { | |
22428 | TCP_FLAG_CWR = (( __be32)((__u32)( (((__u32)((0x00800000)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0x00800000)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0x00800000)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0x00800000)) & (__u32)0xff000000UL) >> 24) ))), | |
22429 | TCP_FLAG_ECE = (( __be32)((__u32)( (((__u32)((0x00400000)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0x00400000)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0x00400000)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0x00400000)) & (__u32)0xff000000UL) >> 24) ))), | |
22430 | TCP_FLAG_URG = (( __be32)((__u32)( (((__u32)((0x00200000)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0x00200000)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0x00200000)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0x00200000)) & (__u32)0xff000000UL) >> 24) ))), | |
22431 | TCP_FLAG_ACK = (( __be32)((__u32)( (((__u32)((0x00100000)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0x00100000)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0x00100000)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0x00100000)) & (__u32)0xff000000UL) >> 24) ))), | |
22432 | TCP_FLAG_PSH = (( __be32)((__u32)( (((__u32)((0x00080000)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0x00080000)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0x00080000)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0x00080000)) & (__u32)0xff000000UL) >> 24) ))), | |
22433 | TCP_FLAG_RST = (( __be32)((__u32)( (((__u32)((0x00040000)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0x00040000)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0x00040000)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0x00040000)) & (__u32)0xff000000UL) >> 24) ))), | |
22434 | TCP_FLAG_SYN = (( __be32)((__u32)( (((__u32)((0x00020000)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0x00020000)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0x00020000)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0x00020000)) & (__u32)0xff000000UL) >> 24) ))), | |
22435 | TCP_FLAG_FIN = (( __be32)((__u32)( (((__u32)((0x00010000)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0x00010000)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0x00010000)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0x00010000)) & (__u32)0xff000000UL) >> 24) ))), | |
22436 | TCP_RESERVED_BITS = (( __be32)((__u32)( (((__u32)((0x0F000000)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0x0F000000)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0x0F000000)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0x0F000000)) & (__u32)0xff000000UL) >> 24) ))), | |
22437 | TCP_DATA_OFFSET = (( __be32)((__u32)( (((__u32)((0xF0000000)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0xF0000000)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0xF0000000)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0xF0000000)) & (__u32)0xff000000UL) >> 24) ))) | |
22438 | }; | |
22439 | # 103 "include/linux/tcp.h" | |
22440 | enum tcp_ca_state | |
22441 | { | |
22442 | TCP_CA_Open = 0, | |
22443 | ||
22444 | TCP_CA_Disorder = 1, | |
22445 | ||
22446 | TCP_CA_CWR = 2, | |
22447 | ||
22448 | TCP_CA_Recovery = 3, | |
22449 | ||
22450 | TCP_CA_Loss = 4 | |
22451 | ||
22452 | }; | |
22453 | ||
22454 | struct tcp_info | |
22455 | { | |
22456 | __u8 tcpi_state; | |
22457 | __u8 tcpi_ca_state; | |
22458 | __u8 tcpi_retransmits; | |
22459 | __u8 tcpi_probes; | |
22460 | __u8 tcpi_backoff; | |
22461 | __u8 tcpi_options; | |
22462 | __u8 tcpi_snd_wscale : 4, tcpi_rcv_wscale : 4; | |
22463 | ||
22464 | __u32 tcpi_rto; | |
22465 | __u32 tcpi_ato; | |
22466 | __u32 tcpi_snd_mss; | |
22467 | __u32 tcpi_rcv_mss; | |
22468 | ||
22469 | __u32 tcpi_unacked; | |
22470 | __u32 tcpi_sacked; | |
22471 | __u32 tcpi_lost; | |
22472 | __u32 tcpi_retrans; | |
22473 | __u32 tcpi_fackets; | |
22474 | ||
22475 | ||
22476 | __u32 tcpi_last_data_sent; | |
22477 | __u32 tcpi_last_ack_sent; | |
22478 | __u32 tcpi_last_data_recv; | |
22479 | __u32 tcpi_last_ack_recv; | |
22480 | ||
22481 | ||
22482 | __u32 tcpi_pmtu; | |
22483 | __u32 tcpi_rcv_ssthresh; | |
22484 | __u32 tcpi_rtt; | |
22485 | __u32 tcpi_rttvar; | |
22486 | __u32 tcpi_snd_ssthresh; | |
22487 | __u32 tcpi_snd_cwnd; | |
22488 | __u32 tcpi_advmss; | |
22489 | __u32 tcpi_reordering; | |
22490 | ||
22491 | __u32 tcpi_rcv_rtt; | |
22492 | __u32 tcpi_rcv_space; | |
22493 | ||
22494 | __u32 tcpi_total_retrans; | |
22495 | }; | |
22496 | ||
22497 | ||
22498 | ||
22499 | ||
22500 | ||
22501 | ||
22502 | # 1 "include/net/inet_connection_sock.h" 1 | |
22503 | # 30 "include/net/inet_connection_sock.h" | |
22504 | struct inet_bind_bucket; | |
22505 | struct inet_hashinfo; | |
22506 | struct tcp_congestion_ops; | |
22507 | ||
22508 | ||
22509 | ||
22510 | ||
22511 | ||
22512 | struct inet_connection_sock_af_ops { | |
22513 | int (*queue_xmit)(struct sk_buff *skb, int ipfragok); | |
22514 | void (*send_check)(struct sock *sk, int len, | |
22515 | struct sk_buff *skb); | |
22516 | int (*rebuild_header)(struct sock *sk); | |
22517 | int (*conn_request)(struct sock *sk, struct sk_buff *skb); | |
22518 | struct sock *(*syn_recv_sock)(struct sock *sk, struct sk_buff *skb, | |
22519 | struct request_sock *req, | |
22520 | struct dst_entry *dst); | |
22521 | int (*remember_stamp)(struct sock *sk); | |
22522 | __u16 net_header_len; | |
22523 | int (*setsockopt)(struct sock *sk, int level, int optname, | |
22524 | char *optval, int optlen); | |
22525 | int (*getsockopt)(struct sock *sk, int level, int optname, | |
22526 | char *optval, int *optlen); | |
22527 | int (*compat_setsockopt)(struct sock *sk, | |
22528 | int level, int optname, | |
22529 | char *optval, int optlen); | |
22530 | int (*compat_getsockopt)(struct sock *sk, | |
22531 | int level, int optname, | |
22532 | char *optval, int *optlen); | |
22533 | void (*addr2sockaddr)(struct sock *sk, struct sockaddr *); | |
22534 | int sockaddr_len; | |
22535 | }; | |
22536 | # 83 "include/net/inet_connection_sock.h" | |
22537 | struct inet_connection_sock { | |
22538 | ||
22539 | struct inet_sock icsk_inet; | |
22540 | struct request_sock_queue icsk_accept_queue; | |
22541 | struct inet_bind_bucket *icsk_bind_hash; | |
22542 | unsigned long icsk_timeout; | |
22543 | struct timer_list icsk_retransmit_timer; | |
22544 | struct timer_list icsk_delack_timer; | |
22545 | __u32 icsk_rto; | |
22546 | __u32 icsk_pmtu_cookie; | |
22547 | const struct tcp_congestion_ops *icsk_ca_ops; | |
22548 | const struct inet_connection_sock_af_ops *icsk_af_ops; | |
22549 | unsigned int (*icsk_sync_mss)(struct sock *sk, u32 pmtu); | |
22550 | __u8 icsk_ca_state; | |
22551 | __u8 icsk_retransmits; | |
22552 | __u8 icsk_pending; | |
22553 | __u8 icsk_backoff; | |
22554 | __u8 icsk_syn_retries; | |
22555 | __u8 icsk_probes_out; | |
22556 | __u16 icsk_ext_hdr_len; | |
22557 | struct { | |
22558 | __u8 pending; | |
22559 | __u8 quick; | |
22560 | __u8 pingpong; | |
22561 | __u8 blocked; | |
22562 | __u32 ato; | |
22563 | unsigned long timeout; | |
22564 | __u32 lrcvtime; | |
22565 | __u16 last_seg_size; | |
22566 | __u16 rcv_mss; | |
22567 | } icsk_ack; | |
22568 | struct { | |
22569 | int enabled; | |
22570 | ||
22571 | ||
22572 | int search_high; | |
22573 | int search_low; | |
22574 | ||
22575 | ||
22576 | int probe_size; | |
22577 | } icsk_mtup; | |
22578 | u32 icsk_ca_priv[16]; | |
22579 | ||
22580 | }; | |
22581 | ||
22582 | ||
22583 | ||
22584 | ||
22585 | ||
22586 | ||
22587 | static inline __attribute__((always_inline)) struct inet_connection_sock *inet_csk(const struct sock *sk) | |
22588 | { | |
22589 | return (struct inet_connection_sock *)sk; | |
22590 | } | |
22591 | ||
22592 | static inline __attribute__((always_inline)) void *inet_csk_ca(const struct sock *sk) | |
22593 | { | |
22594 | return (void *)inet_csk(sk)->icsk_ca_priv; | |
22595 | } | |
22596 | ||
22597 | extern struct sock *inet_csk_clone(struct sock *sk, | |
22598 | const struct request_sock *req, | |
22599 | const gfp_t priority); | |
22600 | ||
22601 | enum inet_csk_ack_state_t { | |
22602 | ICSK_ACK_SCHED = 1, | |
22603 | ICSK_ACK_TIMER = 2, | |
22604 | ICSK_ACK_PUSHED = 4, | |
22605 | ICSK_ACK_PUSHED2 = 8 | |
22606 | }; | |
22607 | ||
22608 | extern void inet_csk_init_xmit_timers(struct sock *sk, | |
22609 | void (*retransmit_handler)(unsigned long), | |
22610 | void (*delack_handler)(unsigned long), | |
22611 | void (*keepalive_handler)(unsigned long)); | |
22612 | extern void inet_csk_clear_xmit_timers(struct sock *sk); | |
22613 | ||
22614 | static inline __attribute__((always_inline)) void inet_csk_schedule_ack(struct sock *sk) | |
22615 | { | |
22616 | inet_csk(sk)->icsk_ack.pending |= ICSK_ACK_SCHED; | |
22617 | } | |
22618 | ||
22619 | static inline __attribute__((always_inline)) int inet_csk_ack_scheduled(const struct sock *sk) | |
22620 | { | |
22621 | return inet_csk(sk)->icsk_ack.pending & ICSK_ACK_SCHED; | |
22622 | } | |
22623 | ||
22624 | static inline __attribute__((always_inline)) void inet_csk_delack_init(struct sock *sk) | |
22625 | { | |
22626 | memset(&inet_csk(sk)->icsk_ack, 0, sizeof(inet_csk(sk)->icsk_ack)); | |
22627 | } | |
22628 | ||
22629 | extern void inet_csk_delete_keepalive_timer(struct sock *sk); | |
22630 | extern void inet_csk_reset_keepalive_timer(struct sock *sk, unsigned long timeout); | |
22631 | ||
22632 | ||
22633 | extern const char inet_csk_timer_bug_msg[]; | |
22634 | ||
22635 | ||
22636 | static inline __attribute__((always_inline)) void inet_csk_clear_xmit_timer(struct sock *sk, const int what) | |
22637 | { | |
22638 | struct inet_connection_sock *icsk = inet_csk(sk); | |
22639 | ||
22640 | if (what == 1 || what == 3) { | |
22641 | icsk->icsk_pending = 0; | |
22642 | ||
22643 | ||
22644 | ||
22645 | } else if (what == 2) { | |
22646 | icsk->icsk_ack.blocked = icsk->icsk_ack.pending = 0; | |
22647 | ||
22648 | ||
22649 | ||
22650 | } | |
22651 | ||
22652 | else { | |
22653 | pr_debug("%s", inet_csk_timer_bug_msg); | |
22654 | } | |
22655 | ||
22656 | } | |
22657 | ||
22658 | ||
22659 | ||
22660 | ||
22661 | static inline __attribute__((always_inline)) void inet_csk_reset_xmit_timer(struct sock *sk, const int what, | |
22662 | unsigned long when, | |
22663 | const unsigned long max_when) | |
22664 | { | |
22665 | struct inet_connection_sock *icsk = inet_csk(sk); | |
22666 | ||
22667 | if (when > max_when) { | |
22668 | ||
22669 | pr_debug("reset_xmit_timer: sk=%p %d when=0x%lx, caller=%p\n", | |
22670 | sk, what, when, ({ __label__ _l; _l: &&_l;})); | |
22671 | ||
22672 | when = max_when; | |
22673 | } | |
22674 | ||
22675 | if (what == 1 || what == 3) { | |
22676 | icsk->icsk_pending = what; | |
22677 | icsk->icsk_timeout = jiffies + when; | |
22678 | sk_reset_timer(sk, &icsk->icsk_retransmit_timer, icsk->icsk_timeout); | |
22679 | } else if (what == 2) { | |
22680 | icsk->icsk_ack.pending |= ICSK_ACK_TIMER; | |
22681 | icsk->icsk_ack.timeout = jiffies + when; | |
22682 | sk_reset_timer(sk, &icsk->icsk_delack_timer, icsk->icsk_ack.timeout); | |
22683 | } | |
22684 | ||
22685 | else { | |
22686 | pr_debug("%s", inet_csk_timer_bug_msg); | |
22687 | } | |
22688 | ||
22689 | } | |
22690 | ||
22691 | extern struct sock *inet_csk_accept(struct sock *sk, int flags, int *err); | |
22692 | ||
22693 | extern struct request_sock *inet_csk_search_req(const struct sock *sk, | |
22694 | struct request_sock ***prevp, | |
22695 | const __be16 rport, | |
22696 | const __be32 raddr, | |
22697 | const __be32 laddr); | |
22698 | extern int inet_csk_bind_conflict(const struct sock *sk, | |
22699 | const struct inet_bind_bucket *tb); | |
22700 | extern int inet_csk_get_port(struct inet_hashinfo *hashinfo, | |
22701 | struct sock *sk, unsigned short snum, | |
22702 | int (*bind_conflict)(const struct sock *sk, | |
22703 | const struct inet_bind_bucket *tb)); | |
22704 | ||
22705 | extern struct dst_entry* inet_csk_route_req(struct sock *sk, | |
22706 | const struct request_sock *req); | |
22707 | ||
22708 | static inline __attribute__((always_inline)) void inet_csk_reqsk_queue_add(struct sock *sk, | |
22709 | struct request_sock *req, | |
22710 | struct sock *child) | |
22711 | { | |
22712 | reqsk_queue_add(&inet_csk(sk)->icsk_accept_queue, req, sk, child); | |
22713 | } | |
22714 | ||
22715 | extern void inet_csk_reqsk_queue_hash_add(struct sock *sk, | |
22716 | struct request_sock *req, | |
22717 | unsigned long timeout); | |
22718 | ||
22719 | static inline __attribute__((always_inline)) void inet_csk_reqsk_queue_removed(struct sock *sk, | |
22720 | struct request_sock *req) | |
22721 | { | |
22722 | if (reqsk_queue_removed(&inet_csk(sk)->icsk_accept_queue, req) == 0) | |
22723 | inet_csk_delete_keepalive_timer(sk); | |
22724 | } | |
22725 | ||
22726 | static inline __attribute__((always_inline)) void inet_csk_reqsk_queue_added(struct sock *sk, | |
22727 | const unsigned long timeout) | |
22728 | { | |
22729 | if (reqsk_queue_added(&inet_csk(sk)->icsk_accept_queue) == 0) | |
22730 | inet_csk_reset_keepalive_timer(sk, timeout); | |
22731 | } | |
22732 | ||
22733 | static inline __attribute__((always_inline)) int inet_csk_reqsk_queue_len(const struct sock *sk) | |
22734 | { | |
22735 | return reqsk_queue_len(&inet_csk(sk)->icsk_accept_queue); | |
22736 | } | |
22737 | ||
22738 | static inline __attribute__((always_inline)) int inet_csk_reqsk_queue_young(const struct sock *sk) | |
22739 | { | |
22740 | return reqsk_queue_len_young(&inet_csk(sk)->icsk_accept_queue); | |
22741 | } | |
22742 | ||
22743 | static inline __attribute__((always_inline)) int inet_csk_reqsk_queue_is_full(const struct sock *sk) | |
22744 | { | |
22745 | return reqsk_queue_is_full(&inet_csk(sk)->icsk_accept_queue); | |
22746 | } | |
22747 | ||
22748 | static inline __attribute__((always_inline)) void inet_csk_reqsk_queue_unlink(struct sock *sk, | |
22749 | struct request_sock *req, | |
22750 | struct request_sock **prev) | |
22751 | { | |
22752 | reqsk_queue_unlink(&inet_csk(sk)->icsk_accept_queue, req, prev); | |
22753 | } | |
22754 | ||
22755 | static inline __attribute__((always_inline)) void inet_csk_reqsk_queue_drop(struct sock *sk, | |
22756 | struct request_sock *req, | |
22757 | struct request_sock **prev) | |
22758 | { | |
22759 | inet_csk_reqsk_queue_unlink(sk, req, prev); | |
22760 | inet_csk_reqsk_queue_removed(sk, req); | |
22761 | reqsk_free(req); | |
22762 | } | |
22763 | ||
22764 | extern void inet_csk_reqsk_queue_prune(struct sock *parent, | |
22765 | const unsigned long interval, | |
22766 | const unsigned long timeout, | |
22767 | const unsigned long max_rto); | |
22768 | ||
22769 | extern void inet_csk_destroy_sock(struct sock *sk); | |
22770 | ||
22771 | ||
22772 | ||
22773 | ||
22774 | static inline __attribute__((always_inline)) unsigned int inet_csk_listen_poll(const struct sock *sk) | |
22775 | { | |
22776 | return !reqsk_queue_empty(&inet_csk(sk)->icsk_accept_queue) ? | |
22777 | (1 | 64) : 0; | |
22778 | } | |
22779 | ||
22780 | extern int inet_csk_listen_start(struct sock *sk, const int nr_table_entries); | |
22781 | extern void inet_csk_listen_stop(struct sock *sk); | |
22782 | ||
22783 | extern void inet_csk_addr2sockaddr(struct sock *sk, struct sockaddr *uaddr); | |
22784 | ||
22785 | extern int inet_csk_ctl_sock_create(struct socket **sock, | |
22786 | unsigned short family, | |
22787 | unsigned short type, | |
22788 | unsigned char protocol); | |
22789 | ||
22790 | extern int inet_csk_compat_getsockopt(struct sock *sk, int level, int optname, | |
22791 | char *optval, int *optlen); | |
22792 | extern int inet_csk_compat_setsockopt(struct sock *sk, int level, int optname, | |
22793 | char *optval, int optlen); | |
22794 | # 166 "include/linux/tcp.h" 2 | |
22795 | # 1 "include/net/inet_timewait_sock.h" 1 | |
22796 | # 27 "include/net/inet_timewait_sock.h" | |
22797 | # 1 "include/net/tcp_states.h" 1 | |
22798 | # 16 "include/net/tcp_states.h" | |
22799 | enum { | |
22800 | TCP_ESTABLISHED = 1, | |
22801 | TCP_SYN_SENT, | |
22802 | TCP_SYN_RECV, | |
22803 | TCP_FIN_WAIT1, | |
22804 | TCP_FIN_WAIT2, | |
22805 | TCP_TIME_WAIT, | |
22806 | TCP_CLOSE, | |
22807 | TCP_CLOSE_WAIT, | |
22808 | TCP_LAST_ACK, | |
22809 | TCP_LISTEN, | |
22810 | TCP_CLOSING, | |
22811 | ||
22812 | TCP_MAX_STATES | |
22813 | }; | |
22814 | ||
22815 | ||
22816 | ||
22817 | ||
22818 | ||
22819 | enum { | |
22820 | TCPF_ESTABLISHED = (1 << 1), | |
22821 | TCPF_SYN_SENT = (1 << 2), | |
22822 | TCPF_SYN_RECV = (1 << 3), | |
22823 | TCPF_FIN_WAIT1 = (1 << 4), | |
22824 | TCPF_FIN_WAIT2 = (1 << 5), | |
22825 | TCPF_TIME_WAIT = (1 << 6), | |
22826 | TCPF_CLOSE = (1 << 7), | |
22827 | TCPF_CLOSE_WAIT = (1 << 8), | |
22828 | TCPF_LAST_ACK = (1 << 9), | |
22829 | TCPF_LISTEN = (1 << 10), | |
22830 | TCPF_CLOSING = (1 << 11) | |
22831 | }; | |
22832 | # 28 "include/net/inet_timewait_sock.h" 2 | |
22833 | # 1 "include/net/timewait_sock.h" 1 | |
22834 | # 17 "include/net/timewait_sock.h" | |
22835 | struct timewait_sock_ops { | |
22836 | kmem_cache_t *twsk_slab; | |
22837 | unsigned int twsk_obj_size; | |
22838 | int (*twsk_unique)(struct sock *sk, | |
22839 | struct sock *sktw, void *twp); | |
22840 | void (*twsk_destructor)(struct sock *sk); | |
22841 | }; | |
22842 | ||
22843 | static inline __attribute__((always_inline)) int twsk_unique(struct sock *sk, struct sock *sktw, void *twp) | |
22844 | { | |
22845 | if (sk->__sk_common.skc_prot->twsk_prot->twsk_unique != ((void *)0)) | |
22846 | return sk->__sk_common.skc_prot->twsk_prot->twsk_unique(sk, sktw, twp); | |
22847 | return 0; | |
22848 | } | |
22849 | ||
22850 | static inline __attribute__((always_inline)) void twsk_destructor(struct sock *sk) | |
22851 | { | |
22852 | if (sk->__sk_common.skc_prot->twsk_prot->twsk_destructor != ((void *)0)) | |
22853 | sk->__sk_common.skc_prot->twsk_prot->twsk_destructor(sk); | |
22854 | } | |
22855 | # 29 "include/net/inet_timewait_sock.h" 2 | |
22856 | ||
22857 | ||
22858 | ||
22859 | struct inet_hashinfo; | |
22860 | # 66 "include/net/inet_timewait_sock.h" | |
22861 | struct inet_timewait_death_row { | |
22862 | ||
22863 | int twcal_hand; | |
22864 | int twcal_jiffie; | |
22865 | struct timer_list twcal_timer; | |
22866 | struct hlist_head twcal_row[(1 << 5)]; | |
22867 | ||
22868 | spinlock_t death_lock; | |
22869 | int tw_count; | |
22870 | int period; | |
22871 | u32 thread_slots; | |
22872 | struct work_struct twkill_work; | |
22873 | struct timer_list tw_timer; | |
22874 | int slot; | |
22875 | struct hlist_head cells[8]; | |
22876 | struct inet_hashinfo *hashinfo; | |
22877 | int sysctl_tw_recycle; | |
22878 | int sysctl_max_tw_buckets; | |
22879 | }; | |
22880 | ||
22881 | extern void inet_twdr_hangman(unsigned long data); | |
22882 | extern void inet_twdr_twkill_work(void *data); | |
22883 | extern void inet_twdr_twcal_tick(unsigned long data); | |
22884 | ||
22885 | ||
22886 | ||
22887 | ||
22888 | ||
22889 | ||
22890 | ||
22891 | struct inet_bind_bucket; | |
22892 | ||
22893 | ||
22894 | ||
22895 | ||
22896 | ||
22897 | ||
22898 | struct inet_timewait_sock { | |
22899 | ||
22900 | ||
22901 | ||
22902 | ||
22903 | struct sock_common __tw_common; | |
22904 | # 118 "include/net/inet_timewait_sock.h" | |
22905 | volatile unsigned char tw_substate; | |
22906 | ||
22907 | unsigned char tw_rcv_wscale; | |
22908 | ||
22909 | ||
22910 | __be16 tw_sport; | |
22911 | __be32 tw_daddr __attribute__((aligned(4))); | |
22912 | __be32 tw_rcv_saddr; | |
22913 | __be16 tw_dport; | |
22914 | __u16 tw_num; | |
22915 | ||
22916 | __u8 tw_ipv6only:1; | |
22917 | ||
22918 | __u16 tw_ipv6_offset; | |
22919 | int tw_timeout; | |
22920 | unsigned long tw_ttd; | |
22921 | struct inet_bind_bucket *tw_tb; | |
22922 | struct hlist_node tw_death_node; | |
22923 | }; | |
22924 | ||
22925 | static inline __attribute__((always_inline)) void inet_twsk_add_node(struct inet_timewait_sock *tw, | |
22926 | struct hlist_head *list) | |
22927 | { | |
22928 | hlist_add_head(&tw->__tw_common.skc_node, list); | |
22929 | } | |
22930 | ||
22931 | static inline __attribute__((always_inline)) void inet_twsk_add_bind_node(struct inet_timewait_sock *tw, | |
22932 | struct hlist_head *list) | |
22933 | { | |
22934 | hlist_add_head(&tw->__tw_common.skc_bind_node, list); | |
22935 | } | |
22936 | ||
22937 | static inline __attribute__((always_inline)) int inet_twsk_dead_hashed(const struct inet_timewait_sock *tw) | |
22938 | { | |
22939 | return !hlist_unhashed(&tw->tw_death_node); | |
22940 | } | |
22941 | ||
22942 | static inline __attribute__((always_inline)) void inet_twsk_dead_node_init(struct inet_timewait_sock *tw) | |
22943 | { | |
22944 | tw->tw_death_node.pprev = ((void *)0); | |
22945 | } | |
22946 | ||
22947 | static inline __attribute__((always_inline)) void __inet_twsk_del_dead_node(struct inet_timewait_sock *tw) | |
22948 | { | |
22949 | __hlist_del(&tw->tw_death_node); | |
22950 | inet_twsk_dead_node_init(tw); | |
22951 | } | |
22952 | ||
22953 | static inline __attribute__((always_inline)) int inet_twsk_del_dead_node(struct inet_timewait_sock *tw) | |
22954 | { | |
22955 | if (inet_twsk_dead_hashed(tw)) { | |
22956 | __inet_twsk_del_dead_node(tw); | |
22957 | return 1; | |
22958 | } | |
22959 | return 0; | |
22960 | } | |
22961 | # 184 "include/net/inet_timewait_sock.h" | |
22962 | static inline __attribute__((always_inline)) struct inet_timewait_sock *inet_twsk(const struct sock *sk) | |
22963 | { | |
22964 | return (struct inet_timewait_sock *)sk; | |
22965 | } | |
22966 | ||
22967 | static inline __attribute__((always_inline)) __be32 inet_rcv_saddr(const struct sock *sk) | |
22968 | { | |
22969 | return __builtin_expect(!!(sk->__sk_common.skc_state != TCP_TIME_WAIT), 1) ? | |
22970 | inet_sk(sk)->rcv_saddr : inet_twsk(sk)->tw_rcv_saddr; | |
22971 | } | |
22972 | ||
22973 | static inline __attribute__((always_inline)) void inet_twsk_put(struct inet_timewait_sock *tw) | |
22974 | { | |
22975 | if ((atomic_sub_return(1, (&tw->__tw_common.skc_refcnt)) == 0)) { | |
22976 | struct module *owner = tw->__tw_common.skc_prot->owner; | |
22977 | twsk_destructor((struct sock *)tw); | |
22978 | ||
22979 | ||
22980 | ||
22981 | ||
22982 | kmem_cache_free(tw->__tw_common.skc_prot->twsk_prot->twsk_slab, tw); | |
22983 | module_put(owner); | |
22984 | } | |
22985 | } | |
22986 | ||
22987 | extern struct inet_timewait_sock *inet_twsk_alloc(const struct sock *sk, | |
22988 | const int state); | |
22989 | ||
22990 | extern void __inet_twsk_kill(struct inet_timewait_sock *tw, | |
22991 | struct inet_hashinfo *hashinfo); | |
22992 | ||
22993 | extern void __inet_twsk_hashdance(struct inet_timewait_sock *tw, | |
22994 | struct sock *sk, | |
22995 | struct inet_hashinfo *hashinfo); | |
22996 | ||
22997 | extern void inet_twsk_schedule(struct inet_timewait_sock *tw, | |
22998 | struct inet_timewait_death_row *twdr, | |
22999 | const int timeo, const int timewait_len); | |
23000 | extern void inet_twsk_deschedule(struct inet_timewait_sock *tw, | |
23001 | struct inet_timewait_death_row *twdr); | |
23002 | # 167 "include/linux/tcp.h" 2 | |
23003 | ||
23004 | ||
23005 | struct tcp_sack_block_wire { | |
23006 | __be32 start_seq; | |
23007 | __be32 end_seq; | |
23008 | }; | |
23009 | ||
23010 | struct tcp_sack_block { | |
23011 | __u32 start_seq; | |
23012 | __u32 end_seq; | |
23013 | }; | |
23014 | ||
23015 | struct tcp_options_received { | |
23016 | ||
23017 | long ts_recent_stamp; | |
23018 | __u32 ts_recent; | |
23019 | __u32 rcv_tsval; | |
23020 | __u32 rcv_tsecr; | |
23021 | __u16 saw_tstamp : 1, | |
23022 | tstamp_ok : 1, | |
23023 | dsack : 1, | |
23024 | wscale_ok : 1, | |
23025 | sack_ok : 4, | |
23026 | snd_wscale : 4, | |
23027 | rcv_wscale : 4; | |
23028 | ||
23029 | __u8 eff_sacks; | |
23030 | __u8 num_sacks; | |
23031 | __u16 user_mss; | |
23032 | __u16 mss_clamp; | |
23033 | }; | |
23034 | ||
23035 | struct tcp_request_sock { | |
23036 | struct inet_request_sock req; | |
23037 | __u32 rcv_isn; | |
23038 | __u32 snt_isn; | |
23039 | }; | |
23040 | ||
23041 | static inline __attribute__((always_inline)) struct tcp_request_sock *tcp_rsk(const struct request_sock *req) | |
23042 | { | |
23043 | return (struct tcp_request_sock *)req; | |
23044 | } | |
23045 | ||
23046 | struct tcp_sock { | |
23047 | ||
23048 | struct inet_connection_sock inet_conn; | |
23049 | int tcp_header_len; | |
23050 | ||
23051 | ||
23052 | ||
23053 | ||
23054 | ||
23055 | __be32 pred_flags; | |
23056 | ||
23057 | ||
23058 | ||
23059 | ||
23060 | ||
23061 | ||
23062 | __u32 rcv_nxt; | |
23063 | __u32 snd_nxt; | |
23064 | ||
23065 | __u32 snd_una; | |
23066 | __u32 snd_sml; | |
23067 | __u32 rcv_tstamp; | |
23068 | __u32 lsndtime; | |
23069 | ||
23070 | ||
23071 | struct { | |
23072 | struct sk_buff_head prequeue; | |
23073 | struct task_struct *task; | |
23074 | struct iovec *iov; | |
23075 | int memory; | |
23076 | int len; | |
23077 | ||
23078 | ||
23079 | ||
23080 | ||
23081 | ||
23082 | ||
23083 | ||
23084 | } ucopy; | |
23085 | ||
23086 | __u32 snd_wl1; | |
23087 | __u32 snd_wnd; | |
23088 | __u32 max_window; | |
23089 | __u32 mss_cache; | |
23090 | __u16 xmit_size_goal; | |
23091 | ||
23092 | ||
23093 | __u32 window_clamp; | |
23094 | __u32 rcv_ssthresh; | |
23095 | ||
23096 | __u32 frto_highmark; | |
23097 | __u8 reordering; | |
23098 | __u8 frto_counter; | |
23099 | __u8 nonagle; | |
23100 | __u8 keepalive_probes; | |
23101 | ||
23102 | ||
23103 | __u32 srtt; | |
23104 | __u32 mdev; | |
23105 | __u32 mdev_max; | |
23106 | __u32 rttvar; | |
23107 | __u32 rtt_seq; | |
23108 | ||
23109 | __u32 packets_out; | |
23110 | __u32 left_out; | |
23111 | __u32 retrans_out; | |
23112 | ||
23113 | ||
23114 | ||
23115 | struct tcp_options_received rx_opt; | |
23116 | ||
23117 | ||
23118 | ||
23119 | ||
23120 | __u32 snd_ssthresh; | |
23121 | __u32 snd_cwnd; | |
23122 | __u16 snd_cwnd_cnt; | |
23123 | __u16 snd_cwnd_clamp; | |
23124 | __u32 snd_cwnd_used; | |
23125 | __u32 snd_cwnd_stamp; | |
23126 | ||
23127 | struct sk_buff_head out_of_order_queue; | |
23128 | ||
23129 | __u32 rcv_wnd; | |
23130 | __u32 rcv_wup; | |
23131 | __u32 write_seq; | |
23132 | __u32 pushed_seq; | |
23133 | __u32 copied_seq; | |
23134 | ||
23135 | ||
23136 | struct tcp_sack_block duplicate_sack[1]; | |
23137 | struct tcp_sack_block selective_acks[4]; | |
23138 | ||
23139 | struct tcp_sack_block recv_sack_cache[4]; | |
23140 | ||
23141 | ||
23142 | struct sk_buff* lost_skb_hint; | |
23143 | ||
23144 | struct sk_buff *scoreboard_skb_hint; | |
23145 | struct sk_buff *retransmit_skb_hint; | |
23146 | struct sk_buff *forward_skb_hint; | |
23147 | struct sk_buff *fastpath_skb_hint; | |
23148 | ||
23149 | int fastpath_cnt_hint; | |
23150 | int lost_cnt_hint; | |
23151 | int retransmit_cnt_hint; | |
23152 | int forward_cnt_hint; | |
23153 | ||
23154 | __u16 advmss; | |
23155 | __u16 prior_ssthresh; | |
23156 | __u32 lost_out; | |
23157 | __u32 sacked_out; | |
23158 | __u32 fackets_out; | |
23159 | __u32 high_seq; | |
23160 | ||
23161 | __u32 retrans_stamp; | |
23162 | ||
23163 | ||
23164 | __u32 undo_marker; | |
23165 | int undo_retrans; | |
23166 | __u32 urg_seq; | |
23167 | __u16 urg_data; | |
23168 | __u8 urg_mode; | |
23169 | __u8 ecn_flags; | |
23170 | __u32 snd_up; | |
23171 | ||
23172 | __u32 total_retrans; | |
23173 | __u32 bytes_acked; | |
23174 | ||
23175 | unsigned int keepalive_time; | |
23176 | unsigned int keepalive_intvl; | |
23177 | int linger2; | |
23178 | ||
23179 | unsigned long last_synq_overflow; | |
23180 | ||
23181 | __u32 tso_deferred; | |
23182 | ||
23183 | ||
23184 | struct { | |
23185 | __u32 rtt; | |
23186 | __u32 seq; | |
23187 | __u32 time; | |
23188 | } rcv_rtt_est; | |
23189 | ||
23190 | ||
23191 | struct { | |
23192 | int space; | |
23193 | __u32 seq; | |
23194 | __u32 time; | |
23195 | } rcvq_space; | |
23196 | ||
23197 | ||
23198 | struct { | |
23199 | __u32 probe_seq_start; | |
23200 | __u32 probe_seq_end; | |
23201 | } mtu_probe; | |
23202 | }; | |
23203 | ||
23204 | static inline __attribute__((always_inline)) struct tcp_sock *tcp_sk(const struct sock *sk) | |
23205 | { | |
23206 | return (struct tcp_sock *)sk; | |
23207 | } | |
23208 | ||
23209 | struct tcp_timewait_sock { | |
23210 | struct inet_timewait_sock tw_sk; | |
23211 | __u32 tw_rcv_nxt; | |
23212 | __u32 tw_snd_nxt; | |
23213 | __u32 tw_rcv_wnd; | |
23214 | __u32 tw_ts_recent; | |
23215 | long tw_ts_recent_stamp; | |
23216 | }; | |
23217 | ||
23218 | static inline __attribute__((always_inline)) struct tcp_timewait_sock *tcp_twsk(const struct sock *sk) | |
23219 | { | |
23220 | return (struct tcp_timewait_sock *)sk; | |
23221 | } | |
23222 | # 214 "include/linux/ipv6.h" 2 | |
23223 | # 1 "include/linux/udp.h" 1 | |
23224 | # 22 "include/linux/udp.h" | |
23225 | struct udphdr { | |
23226 | __be16 source; | |
23227 | __be16 dest; | |
23228 | __be16 len; | |
23229 | __be16 check; | |
23230 | }; | |
23231 | # 42 "include/linux/udp.h" | |
23232 | struct udp_sock { | |
23233 | ||
23234 | struct inet_sock inet; | |
23235 | int pending; | |
23236 | unsigned int corkflag; | |
23237 | __u16 encap_type; | |
23238 | ||
23239 | ||
23240 | ||
23241 | ||
23242 | __u16 len; | |
23243 | }; | |
23244 | ||
23245 | static inline __attribute__((always_inline)) struct udp_sock *udp_sk(const struct sock *sk) | |
23246 | { | |
23247 | return (struct udp_sock *)sk; | |
23248 | } | |
23249 | # 215 "include/linux/ipv6.h" 2 | |
23250 | ||
23251 | # 1 "include/net/if_inet6.h" 1 | |
23252 | # 19 "include/net/if_inet6.h" | |
23253 | # 1 "include/linux/ipv6.h" 1 | |
23254 | # 20 "include/net/if_inet6.h" 2 | |
23255 | # 35 "include/net/if_inet6.h" | |
23256 | struct inet6_ifaddr | |
23257 | { | |
23258 | struct in6_addr addr; | |
23259 | __u32 prefix_len; | |
23260 | ||
23261 | __u32 valid_lft; | |
23262 | __u32 prefered_lft; | |
23263 | unsigned long cstamp; | |
23264 | unsigned long tstamp; | |
23265 | atomic_t refcnt; | |
23266 | spinlock_t lock; | |
23267 | ||
23268 | __u8 probes; | |
23269 | __u8 flags; | |
23270 | ||
23271 | __u16 scope; | |
23272 | ||
23273 | struct timer_list timer; | |
23274 | ||
23275 | struct inet6_dev *idev; | |
23276 | struct rt6_info *rt; | |
23277 | ||
23278 | struct inet6_ifaddr *lst_next; | |
23279 | struct inet6_ifaddr *if_next; | |
23280 | ||
23281 | ||
23282 | ||
23283 | ||
23284 | ||
23285 | ||
23286 | ||
23287 | int dead; | |
23288 | }; | |
23289 | ||
23290 | struct ip6_sf_socklist | |
23291 | { | |
23292 | unsigned int sl_max; | |
23293 | unsigned int sl_count; | |
23294 | struct in6_addr sl_addr[0]; | |
23295 | }; | |
23296 | ||
23297 | ||
23298 | ||
23299 | ||
23300 | ||
23301 | ||
23302 | struct ipv6_mc_socklist | |
23303 | { | |
23304 | struct in6_addr addr; | |
23305 | int ifindex; | |
23306 | struct ipv6_mc_socklist *next; | |
23307 | rwlock_t sflock; | |
23308 | unsigned int sfmode; | |
23309 | struct ip6_sf_socklist *sflist; | |
23310 | }; | |
23311 | ||
23312 | struct ip6_sf_list | |
23313 | { | |
23314 | struct ip6_sf_list *sf_next; | |
23315 | struct in6_addr sf_addr; | |
23316 | unsigned long sf_count[2]; | |
23317 | unsigned char sf_gsresp; | |
23318 | unsigned char sf_oldin; | |
23319 | unsigned char sf_crcount; | |
23320 | }; | |
23321 | ||
23322 | ||
23323 | ||
23324 | ||
23325 | ||
23326 | ||
23327 | ||
23328 | struct ifmcaddr6 | |
23329 | { | |
23330 | struct in6_addr mca_addr; | |
23331 | struct inet6_dev *idev; | |
23332 | struct ifmcaddr6 *next; | |
23333 | struct ip6_sf_list *mca_sources; | |
23334 | struct ip6_sf_list *mca_tomb; | |
23335 | unsigned int mca_sfmode; | |
23336 | unsigned long mca_sfcount[2]; | |
23337 | struct timer_list mca_timer; | |
23338 | unsigned mca_flags; | |
23339 | int mca_users; | |
23340 | atomic_t mca_refcnt; | |
23341 | spinlock_t mca_lock; | |
23342 | unsigned char mca_crcount; | |
23343 | unsigned long mca_cstamp; | |
23344 | unsigned long mca_tstamp; | |
23345 | }; | |
23346 | ||
23347 | ||
23348 | ||
23349 | struct ipv6_ac_socklist | |
23350 | { | |
23351 | struct in6_addr acl_addr; | |
23352 | int acl_ifindex; | |
23353 | struct ipv6_ac_socklist *acl_next; | |
23354 | }; | |
23355 | ||
23356 | struct ifacaddr6 | |
23357 | { | |
23358 | struct in6_addr aca_addr; | |
23359 | struct inet6_dev *aca_idev; | |
23360 | struct rt6_info *aca_rt; | |
23361 | struct ifacaddr6 *aca_next; | |
23362 | int aca_users; | |
23363 | atomic_t aca_refcnt; | |
23364 | spinlock_t aca_lock; | |
23365 | unsigned long aca_cstamp; | |
23366 | unsigned long aca_tstamp; | |
23367 | }; | |
23368 | ||
23369 | ||
23370 | ||
23371 | ||
23372 | ||
23373 | ||
23374 | struct ipv6_devstat { | |
23375 | struct proc_dir_entry *proc_dir_entry; | |
23376 | __typeof__(struct icmpv6_mib) *icmpv6[2]; | |
23377 | }; | |
23378 | ||
23379 | struct inet6_dev | |
23380 | { | |
23381 | struct net_device *dev; | |
23382 | ||
23383 | struct inet6_ifaddr *addr_list; | |
23384 | ||
23385 | struct ifmcaddr6 *mc_list; | |
23386 | struct ifmcaddr6 *mc_tomb; | |
23387 | rwlock_t mc_lock; | |
23388 | unsigned long mc_v1_seen; | |
23389 | unsigned long mc_maxdelay; | |
23390 | unsigned char mc_qrv; | |
23391 | unsigned char mc_gq_running; | |
23392 | unsigned char mc_ifc_count; | |
23393 | struct timer_list mc_gq_timer; | |
23394 | struct timer_list mc_ifc_timer; | |
23395 | ||
23396 | struct ifacaddr6 *ac_list; | |
23397 | rwlock_t lock; | |
23398 | atomic_t refcnt; | |
23399 | __u32 if_flags; | |
23400 | int dead; | |
23401 | ||
23402 | ||
23403 | ||
23404 | ||
23405 | ||
23406 | ||
23407 | ||
23408 | struct neigh_parms *nd_parms; | |
23409 | struct inet6_dev *next; | |
23410 | struct ipv6_devconf cnf; | |
23411 | struct ipv6_devstat stats; | |
23412 | unsigned long tstamp; | |
23413 | struct rcu_head rcu; | |
23414 | }; | |
23415 | ||
23416 | extern struct ipv6_devconf ipv6_devconf; | |
23417 | ||
23418 | static inline __attribute__((always_inline)) void ipv6_eth_mc_map(struct in6_addr *addr, char *buf) | |
23419 | { | |
23420 | ||
23421 | ||
23422 | ||
23423 | ||
23424 | ||
23425 | ||
23426 | buf[0]= 0x33; | |
23427 | buf[1]= 0x33; | |
23428 | ||
23429 | memcpy(buf + 2, &addr->in6_u.u6_addr32[3], sizeof(__u32)); | |
23430 | } | |
23431 | ||
23432 | static inline __attribute__((always_inline)) void ipv6_tr_mc_map(struct in6_addr *addr, char *buf) | |
23433 | { | |
23434 | ||
23435 | ||
23436 | if (((addr->in6_u.u6_addr8[0] == 0xFF) && | |
23437 | ((addr->in6_u.u6_addr8[1] == 0x01) || (addr->in6_u.u6_addr8[1] == 0x02)) && | |
23438 | (addr->in6_u.u6_addr16[1] == 0) && | |
23439 | (addr->in6_u.u6_addr32[1] == 0) && | |
23440 | (addr->in6_u.u6_addr32[2] == 0) && | |
23441 | (addr->in6_u.u6_addr16[6] == 0) && | |
23442 | (addr->in6_u.u6_addr8[15] == 1)) || | |
23443 | ((addr->in6_u.u6_addr8[0] == 0xFF) && | |
23444 | (addr->in6_u.u6_addr8[1] == 0x02) && | |
23445 | (addr->in6_u.u6_addr16[1] == 0) && | |
23446 | (addr->in6_u.u6_addr32[1] == 0) && | |
23447 | (addr->in6_u.u6_addr16[4] == 0) && | |
23448 | (addr->in6_u.u6_addr8[10] == 0) && | |
23449 | (addr->in6_u.u6_addr8[11] == 1) && | |
23450 | (addr->in6_u.u6_addr8[12] == 0xff))) | |
23451 | { | |
23452 | buf[0]=0xC0; | |
23453 | buf[1]=0x00; | |
23454 | buf[2]=0x01; | |
23455 | buf[3]=0x00; | |
23456 | buf[4]=0x00; | |
23457 | buf[5]=0x00; | |
23458 | ||
23459 | } else if ((addr->in6_u.u6_addr8[0] ==0xff) && | |
23460 | ((addr->in6_u.u6_addr8[1] & 0xF0) == 0) && | |
23461 | (addr->in6_u.u6_addr16[1] == 0) && | |
23462 | (addr->in6_u.u6_addr32[1] == 0) && | |
23463 | (addr->in6_u.u6_addr32[2] == 0) && | |
23464 | (addr->in6_u.u6_addr16[6] == 0) && | |
23465 | (addr->in6_u.u6_addr8[15] == 2)) | |
23466 | { | |
23467 | buf[0]=0xC0; | |
23468 | buf[1]=0x00; | |
23469 | buf[2]=0x02; | |
23470 | buf[3]=0x00; | |
23471 | buf[4]=0x00; | |
23472 | buf[5]=0x00; | |
23473 | } else { | |
23474 | unsigned char i ; | |
23475 | ||
23476 | i = addr->in6_u.u6_addr8[15] & 7 ; | |
23477 | buf[0]=0xC0; | |
23478 | buf[1]=0x00; | |
23479 | buf[2]=0x00; | |
23480 | buf[3]=0x01 << i ; | |
23481 | buf[4]=0x00; | |
23482 | buf[5]=0x00; | |
23483 | } | |
23484 | } | |
23485 | ||
23486 | static inline __attribute__((always_inline)) void ipv6_arcnet_mc_map(const struct in6_addr *addr, char *buf) | |
23487 | { | |
23488 | buf[0] = 0x00; | |
23489 | } | |
23490 | ||
23491 | static inline __attribute__((always_inline)) void ipv6_ib_mc_map(struct in6_addr *addr, char *buf) | |
23492 | { | |
23493 | buf[0] = 0; | |
23494 | buf[1] = 0xff; | |
23495 | buf[2] = 0xff; | |
23496 | buf[3] = 0xff; | |
23497 | buf[4] = 0xff; | |
23498 | buf[5] = 0x12; | |
23499 | buf[6] = 0x60; | |
23500 | buf[7] = 0x1b; | |
23501 | buf[8] = 0; | |
23502 | buf[9] = 0; | |
23503 | memcpy(buf + 10, addr->in6_u.u6_addr8 + 6, 10); | |
23504 | } | |
23505 | # 217 "include/linux/ipv6.h" 2 | |
23506 | ||
23507 | ||
23508 | ||
23509 | ||
23510 | ||
23511 | ||
23512 | ||
23513 | struct inet6_skb_parm { | |
23514 | int iif; | |
23515 | __u16 ra; | |
23516 | __u16 hop; | |
23517 | __u16 dst0; | |
23518 | __u16 srcrt; | |
23519 | __u16 dst1; | |
23520 | __u16 lastopt; | |
23521 | __u32 nhoff; | |
23522 | __u16 flags; | |
23523 | ||
23524 | ||
23525 | ||
23526 | ||
23527 | ||
23528 | }; | |
23529 | ||
23530 | ||
23531 | ||
23532 | static inline __attribute__((always_inline)) int inet6_iif(const struct sk_buff *skb) | |
23533 | { | |
23534 | return ((struct inet6_skb_parm*)((skb)->cb))->iif; | |
23535 | } | |
23536 | ||
23537 | struct inet6_request_sock { | |
23538 | struct in6_addr loc_addr; | |
23539 | struct in6_addr rmt_addr; | |
23540 | struct sk_buff *pktopts; | |
23541 | int iif; | |
23542 | }; | |
23543 | ||
23544 | struct tcp6_request_sock { | |
23545 | struct tcp_request_sock tcp6rsk_tcp; | |
23546 | struct inet6_request_sock tcp6rsk_inet6; | |
23547 | }; | |
23548 | # 268 "include/linux/ipv6.h" | |
23549 | struct ipv6_pinfo { | |
23550 | struct in6_addr saddr; | |
23551 | struct in6_addr rcv_saddr; | |
23552 | struct in6_addr daddr; | |
23553 | struct in6_addr *daddr_cache; | |
23554 | ||
23555 | ||
23556 | ||
23557 | ||
23558 | __u32 flow_label; | |
23559 | __u32 frag_size; | |
23560 | __s16 hop_limit; | |
23561 | __s16 mcast_hops; | |
23562 | int mcast_oif; | |
23563 | ||
23564 | ||
23565 | union { | |
23566 | struct { | |
23567 | __u16 srcrt:2, | |
23568 | osrcrt:2, | |
23569 | rxinfo:1, | |
23570 | rxoinfo:1, | |
23571 | rxhlim:1, | |
23572 | rxohlim:1, | |
23573 | hopopts:1, | |
23574 | ohopopts:1, | |
23575 | dstopts:1, | |
23576 | odstopts:1, | |
23577 | rxflow:1, | |
23578 | rxtclass:1; | |
23579 | } bits; | |
23580 | __u16 all; | |
23581 | } rxopt; | |
23582 | ||
23583 | ||
23584 | __u8 mc_loop:1, | |
23585 | recverr:1, | |
23586 | sndflow:1, | |
23587 | pmtudisc:2, | |
23588 | ipv6only:1; | |
23589 | __u8 tclass; | |
23590 | ||
23591 | __u32 dst_cookie; | |
23592 | ||
23593 | struct ipv6_mc_socklist *ipv6_mc_list; | |
23594 | struct ipv6_ac_socklist *ipv6_ac_list; | |
23595 | struct ipv6_fl_socklist *ipv6_fl_list; | |
23596 | ||
23597 | struct ipv6_txoptions *opt; | |
23598 | struct sk_buff *pktoptions; | |
23599 | struct { | |
23600 | struct ipv6_txoptions *opt; | |
23601 | struct rt6_info *rt; | |
23602 | int hop_limit; | |
23603 | int tclass; | |
23604 | } cork; | |
23605 | }; | |
23606 | ||
23607 | ||
23608 | struct raw6_sock { | |
23609 | ||
23610 | struct inet_sock inet; | |
23611 | __u32 checksum; | |
23612 | __u32 offset; | |
23613 | struct icmp6_filter filter; | |
23614 | ||
23615 | struct ipv6_pinfo inet6; | |
23616 | }; | |
23617 | ||
23618 | struct udp6_sock { | |
23619 | struct udp_sock udp; | |
23620 | ||
23621 | struct ipv6_pinfo inet6; | |
23622 | }; | |
23623 | ||
23624 | struct tcp6_sock { | |
23625 | struct tcp_sock tcp; | |
23626 | ||
23627 | struct ipv6_pinfo inet6; | |
23628 | }; | |
23629 | ||
23630 | extern int inet6_sk_rebuild_header(struct sock *sk); | |
23631 | # 440 "include/linux/ipv6.h" | |
23632 | static inline __attribute__((always_inline)) struct ipv6_pinfo * inet6_sk(const struct sock *__sk) | |
23633 | { | |
23634 | return ((void *)0); | |
23635 | } | |
23636 | ||
23637 | static inline __attribute__((always_inline)) struct inet6_request_sock * | |
23638 | inet6_rsk(const struct request_sock *rsk) | |
23639 | { | |
23640 | return ((void *)0); | |
23641 | } | |
23642 | ||
23643 | static inline __attribute__((always_inline)) struct raw6_sock *raw6_sk(const struct sock *sk) | |
23644 | { | |
23645 | return ((void *)0); | |
23646 | } | |
23647 | # 19 "include/net/ipv6.h" 2 | |
23648 | ||
23649 | # 1 "include/net/ndisc.h" 1 | |
23650 | # 18 "include/net/ndisc.h" | |
23651 | enum { | |
23652 | __ND_OPT_PREFIX_INFO_END = 0, | |
23653 | ND_OPT_SOURCE_LL_ADDR = 1, | |
23654 | ND_OPT_TARGET_LL_ADDR = 2, | |
23655 | ND_OPT_PREFIX_INFO = 3, | |
23656 | ND_OPT_REDIRECT_HDR = 4, | |
23657 | ND_OPT_MTU = 5, | |
23658 | __ND_OPT_ARRAY_MAX, | |
23659 | ND_OPT_ROUTE_INFO = 24, | |
23660 | __ND_OPT_MAX | |
23661 | }; | |
23662 | # 47 "include/net/ndisc.h" | |
23663 | struct ctl_table; | |
23664 | struct file; | |
23665 | struct inet6_dev; | |
23666 | struct net_device; | |
23667 | struct net_proto_family; | |
23668 | struct sk_buff; | |
23669 | ||
23670 | extern struct neigh_table nd_tbl; | |
23671 | ||
23672 | struct nd_msg { | |
23673 | struct icmp6hdr icmph; | |
23674 | struct in6_addr target; | |
23675 | __u8 opt[0]; | |
23676 | }; | |
23677 | ||
23678 | struct rs_msg { | |
23679 | struct icmp6hdr icmph; | |
23680 | __u8 opt[0]; | |
23681 | }; | |
23682 | ||
23683 | struct ra_msg { | |
23684 | struct icmp6hdr icmph; | |
23685 | __u32 reachable_time; | |
23686 | __u32 retrans_timer; | |
23687 | }; | |
23688 | ||
23689 | struct nd_opt_hdr { | |
23690 | __u8 nd_opt_type; | |
23691 | __u8 nd_opt_len; | |
23692 | } __attribute__((__packed__)); | |
23693 | ||
23694 | ||
23695 | extern int ndisc_init(struct net_proto_family *ops); | |
23696 | ||
23697 | extern void ndisc_cleanup(void); | |
23698 | ||
23699 | extern int ndisc_rcv(struct sk_buff *skb); | |
23700 | ||
23701 | extern void ndisc_send_ns(struct net_device *dev, | |
23702 | struct neighbour *neigh, | |
23703 | struct in6_addr *solicit, | |
23704 | struct in6_addr *daddr, | |
23705 | struct in6_addr *saddr); | |
23706 | ||
23707 | extern void ndisc_send_rs(struct net_device *dev, | |
23708 | struct in6_addr *saddr, | |
23709 | struct in6_addr *daddr); | |
23710 | ||
23711 | extern void ndisc_forwarding_on(void); | |
23712 | extern void ndisc_forwarding_off(void); | |
23713 | ||
23714 | extern void ndisc_send_redirect(struct sk_buff *skb, | |
23715 | struct neighbour *neigh, | |
23716 | struct in6_addr *target); | |
23717 | ||
23718 | extern int ndisc_mc_map(struct in6_addr *addr, char *buf, struct net_device *dev, int dir); | |
23719 | ||
23720 | ||
23721 | struct rt6_info * dflt_rt_lookup(void); | |
23722 | ||
23723 | ||
23724 | ||
23725 | ||
23726 | extern int igmp6_init(struct net_proto_family *ops); | |
23727 | ||
23728 | extern void igmp6_cleanup(void); | |
23729 | ||
23730 | extern int igmp6_event_query(struct sk_buff *skb); | |
23731 | ||
23732 | extern int igmp6_event_report(struct sk_buff *skb); | |
23733 | ||
23734 | extern void igmp6_cleanup(void); | |
23735 | ||
23736 | ||
23737 | extern int ndisc_ifinfo_sysctl_change(struct ctl_table *ctl, | |
23738 | int write, | |
23739 | struct file * filp, | |
23740 | void *buffer, | |
23741 | size_t *lenp, | |
23742 | loff_t *ppos); | |
23743 | ||
23744 | ||
23745 | extern void inet6_ifinfo_notify(int event, | |
23746 | struct inet6_dev *idev); | |
23747 | ||
23748 | static inline __attribute__((always_inline)) struct neighbour * ndisc_get_neigh(struct net_device *dev, struct in6_addr *addr) | |
23749 | { | |
23750 | ||
23751 | if (dev) | |
23752 | return __neigh_lookup(&nd_tbl, addr, dev, 1); | |
23753 | ||
23754 | return ((void *)0); | |
23755 | } | |
23756 | # 21 "include/net/ipv6.h" 2 | |
23757 | # 97 "include/net/ipv6.h" | |
23758 | struct frag_hdr { | |
23759 | unsigned char nexthdr; | |
23760 | unsigned char reserved; | |
23761 | unsigned short frag_off; | |
23762 | __u32 identification; | |
23763 | }; | |
23764 | # 111 "include/net/ipv6.h" | |
23765 | extern int sysctl_ipv6_bindv6only; | |
23766 | extern int sysctl_mld_max_msf; | |
23767 | ||
23768 | ||
23769 | extern __typeof__(struct ipstats_mib) *ipv6_statistics[2]; | |
23770 | ||
23771 | ||
23772 | ||
23773 | extern __typeof__(struct icmpv6_mib) *icmpv6_statistics[2]; | |
23774 | # 145 "include/net/ipv6.h" | |
23775 | extern __typeof__(struct udp_mib) *udp_stats_in6[2]; | |
23776 | ||
23777 | ||
23778 | ||
23779 | ||
23780 | int snmp6_register_dev(struct inet6_dev *idev); | |
23781 | int snmp6_unregister_dev(struct inet6_dev *idev); | |
23782 | int snmp6_alloc_dev(struct inet6_dev *idev); | |
23783 | int snmp6_free_dev(struct inet6_dev *idev); | |
23784 | int snmp6_mib_init(void *ptr[2], size_t mibsize, size_t mibalign); | |
23785 | void snmp6_mib_free(void *ptr[2]); | |
23786 | ||
23787 | struct ip6_ra_chain | |
23788 | { | |
23789 | struct ip6_ra_chain *next; | |
23790 | struct sock *sk; | |
23791 | int sel; | |
23792 | void (*destructor)(struct sock *); | |
23793 | }; | |
23794 | ||
23795 | extern struct ip6_ra_chain *ip6_ra_chain; | |
23796 | extern rwlock_t ip6_ra_lock; | |
23797 | ||
23798 | ||
23799 | ||
23800 | ||
23801 | ||
23802 | ||
23803 | struct ipv6_txoptions | |
23804 | { | |
23805 | ||
23806 | int tot_len; | |
23807 | ||
23808 | ||
23809 | ||
23810 | __u16 opt_flen; | |
23811 | __u16 opt_nflen; | |
23812 | ||
23813 | struct ipv6_opt_hdr *hopopt; | |
23814 | struct ipv6_opt_hdr *dst0opt; | |
23815 | struct ipv6_rt_hdr *srcrt; | |
23816 | struct ipv6_opt_hdr *dst1opt; | |
23817 | ||
23818 | ||
23819 | }; | |
23820 | ||
23821 | struct ip6_flowlabel | |
23822 | { | |
23823 | struct ip6_flowlabel *next; | |
23824 | u32 label; | |
23825 | struct in6_addr dst; | |
23826 | struct ipv6_txoptions *opt; | |
23827 | atomic_t users; | |
23828 | unsigned long linger; | |
23829 | u8 share; | |
23830 | u32 owner; | |
23831 | unsigned long lastuse; | |
23832 | unsigned long expires; | |
23833 | }; | |
23834 | ||
23835 | ||
23836 | ||
23837 | ||
23838 | struct ipv6_fl_socklist | |
23839 | { | |
23840 | struct ipv6_fl_socklist *next; | |
23841 | struct ip6_flowlabel *fl; | |
23842 | }; | |
23843 | ||
23844 | extern struct ip6_flowlabel *fl6_sock_lookup(struct sock *sk, u32 label); | |
23845 | extern struct ipv6_txoptions *fl6_merge_options(struct ipv6_txoptions * opt_space, | |
23846 | struct ip6_flowlabel * fl, | |
23847 | struct ipv6_txoptions * fopt); | |
23848 | extern void fl6_free_socklist(struct sock *sk); | |
23849 | extern int ipv6_flowlabel_opt(struct sock *sk, char *optval, int optlen); | |
23850 | extern void ip6_flowlabel_init(void); | |
23851 | extern void ip6_flowlabel_cleanup(void); | |
23852 | ||
23853 | static inline __attribute__((always_inline)) void fl6_sock_release(struct ip6_flowlabel *fl) | |
23854 | { | |
23855 | if (fl) | |
23856 | atomic_dec(&fl->users); | |
23857 | } | |
23858 | ||
23859 | extern int ip6_ra_control(struct sock *sk, int sel, | |
23860 | void (*destructor)(struct sock *)); | |
23861 | ||
23862 | ||
23863 | extern int ipv6_parse_hopopts(struct sk_buff **skbp); | |
23864 | ||
23865 | extern struct ipv6_txoptions * ipv6_dup_options(struct sock *sk, struct ipv6_txoptions *opt); | |
23866 | extern struct ipv6_txoptions * ipv6_renew_options(struct sock *sk, struct ipv6_txoptions *opt, | |
23867 | int newtype, | |
23868 | struct ipv6_opt_hdr *newopt, | |
23869 | int newoptlen); | |
23870 | struct ipv6_txoptions *ipv6_fixup_options(struct ipv6_txoptions *opt_space, | |
23871 | struct ipv6_txoptions *opt); | |
23872 | ||
23873 | extern int ipv6_opt_accepted(struct sock *sk, struct sk_buff *skb); | |
23874 | ||
23875 | extern int ip6_frag_nqueues; | |
23876 | extern atomic_t ip6_frag_mem; | |
23877 | ||
23878 | ||
23879 | ||
23880 | ||
23881 | ||
23882 | ||
23883 | ||
23884 | typedef int (*inet_getfrag_t) (const void *data, | |
23885 | struct in6_addr *addr, | |
23886 | char *, | |
23887 | unsigned int, unsigned int); | |
23888 | ||
23889 | extern int __ipv6_addr_type(const struct in6_addr *addr); | |
23890 | static inline __attribute__((always_inline)) int ipv6_addr_type(const struct in6_addr *addr) | |
23891 | { | |
23892 | return __ipv6_addr_type(addr) & 0xffff; | |
23893 | } | |
23894 | ||
23895 | static inline __attribute__((always_inline)) int ipv6_addr_scope(const struct in6_addr *addr) | |
23896 | { | |
23897 | return __ipv6_addr_type(addr) & 0x00f0U; | |
23898 | } | |
23899 | ||
23900 | static inline __attribute__((always_inline)) int __ipv6_addr_src_scope(int type) | |
23901 | { | |
23902 | return (type == 0x0000U ? -1 : (type >> 16)); | |
23903 | } | |
23904 | ||
23905 | static inline __attribute__((always_inline)) int ipv6_addr_src_scope(const struct in6_addr *addr) | |
23906 | { | |
23907 | return __ipv6_addr_src_scope(__ipv6_addr_type(addr)); | |
23908 | } | |
23909 | ||
23910 | static inline __attribute__((always_inline)) int ipv6_addr_cmp(const struct in6_addr *a1, const struct in6_addr *a2) | |
23911 | { | |
23912 | return memcmp((const void *) a1, (const void *) a2, sizeof(struct in6_addr)); | |
23913 | } | |
23914 | ||
23915 | static inline __attribute__((always_inline)) int | |
23916 | ipv6_masked_addr_cmp(const struct in6_addr *a1, const struct in6_addr *m, | |
23917 | const struct in6_addr *a2) | |
23918 | { | |
23919 | unsigned int i; | |
23920 | ||
23921 | for (i = 0; i < 4; i++) | |
23922 | if ((a1->in6_u.u6_addr32[i] ^ a2->in6_u.u6_addr32[i]) & m->in6_u.u6_addr32[i]) | |
23923 | return 1; | |
23924 | return 0; | |
23925 | } | |
23926 | ||
23927 | static inline __attribute__((always_inline)) void ipv6_addr_copy(struct in6_addr *a1, const struct in6_addr *a2) | |
23928 | { | |
23929 | memcpy((void *) a1, (const void *) a2, sizeof(struct in6_addr)); | |
23930 | } | |
23931 | ||
23932 | static inline __attribute__((always_inline)) void ipv6_addr_prefix(struct in6_addr *pfx, | |
23933 | const struct in6_addr *addr, | |
23934 | int plen) | |
23935 | { | |
23936 | ||
23937 | int o = plen >> 3, | |
23938 | b = plen & 0x7; | |
23939 | ||
23940 | memcpy(pfx->in6_u.u6_addr8, addr, o); | |
23941 | if (b != 0) { | |
23942 | pfx->in6_u.u6_addr8[o] = addr->in6_u.u6_addr8[o] & (0xff00 >> b); | |
23943 | o++; | |
23944 | } | |
23945 | if (o < 16) | |
23946 | memset(pfx->in6_u.u6_addr8 + o, 0, 16 - o); | |
23947 | } | |
23948 | ||
23949 | ||
23950 | static inline __attribute__((always_inline)) void ipv6_addr_set(struct in6_addr *addr, | |
23951 | __be32 w1, __be32 w2, | |
23952 | __be32 w3, __be32 w4) | |
23953 | { | |
23954 | addr->in6_u.u6_addr32[0] = w1; | |
23955 | addr->in6_u.u6_addr32[1] = w2; | |
23956 | addr->in6_u.u6_addr32[2] = w3; | |
23957 | addr->in6_u.u6_addr32[3] = w4; | |
23958 | } | |
23959 | ||
23960 | ||
23961 | static inline __attribute__((always_inline)) int ipv6_addr_equal(const struct in6_addr *a1, | |
23962 | const struct in6_addr *a2) | |
23963 | { | |
23964 | return (a1->in6_u.u6_addr32[0] == a2->in6_u.u6_addr32[0] && | |
23965 | a1->in6_u.u6_addr32[1] == a2->in6_u.u6_addr32[1] && | |
23966 | a1->in6_u.u6_addr32[2] == a2->in6_u.u6_addr32[2] && | |
23967 | a1->in6_u.u6_addr32[3] == a2->in6_u.u6_addr32[3]); | |
23968 | } | |
23969 | ||
23970 | static inline __attribute__((always_inline)) int __ipv6_prefix_equal(const __be32 *a1, const __be32 *a2, | |
23971 | unsigned int prefixlen) | |
23972 | { | |
23973 | unsigned pdw, pbi; | |
23974 | ||
23975 | ||
23976 | pdw = prefixlen >> 5; | |
23977 | if (pdw && memcmp(a1, a2, pdw << 2)) | |
23978 | return 0; | |
23979 | ||
23980 | ||
23981 | pbi = prefixlen & 0x1f; | |
23982 | if (pbi && ((a1[pdw] ^ a2[pdw]) & htonl((0xffffffff) << (32 - pbi)))) | |
23983 | return 0; | |
23984 | ||
23985 | return 1; | |
23986 | } | |
23987 | ||
23988 | static inline __attribute__((always_inline)) int ipv6_prefix_equal(const struct in6_addr *a1, | |
23989 | const struct in6_addr *a2, | |
23990 | unsigned int prefixlen) | |
23991 | { | |
23992 | return __ipv6_prefix_equal(a1->in6_u.u6_addr32, a2->in6_u.u6_addr32, | |
23993 | prefixlen); | |
23994 | } | |
23995 | ||
23996 | static inline __attribute__((always_inline)) int ipv6_addr_any(const struct in6_addr *a) | |
23997 | { | |
23998 | return ((a->in6_u.u6_addr32[0] | a->in6_u.u6_addr32[1] | | |
23999 | a->in6_u.u6_addr32[2] | a->in6_u.u6_addr32[3] ) == 0); | |
24000 | } | |
24001 | ||
24002 | ||
24003 | ||
24004 | ||
24005 | ||
24006 | static inline __attribute__((always_inline)) int __ipv6_addr_diff(const void *token1, const void *token2, int addrlen) | |
24007 | { | |
24008 | const __u32 *a1 = token1, *a2 = token2; | |
24009 | int i; | |
24010 | ||
24011 | addrlen >>= 2; | |
24012 | ||
24013 | for (i = 0; i < addrlen; i++) { | |
24014 | __u32 xb = a1[i] ^ a2[i]; | |
24015 | if (xb) { | |
24016 | int j = 31; | |
24017 | ||
24018 | xb = ntohl(xb); | |
24019 | while ((xb & (1 << j)) == 0) | |
24020 | j--; | |
24021 | ||
24022 | return (i * 32 + 31 - j); | |
24023 | } | |
24024 | } | |
24025 | # 412 "include/net/ipv6.h" | |
24026 | return (addrlen << 5); | |
24027 | } | |
24028 | ||
24029 | static inline __attribute__((always_inline)) int ipv6_addr_diff(const struct in6_addr *a1, const struct in6_addr *a2) | |
24030 | { | |
24031 | return __ipv6_addr_diff(a1, a2, sizeof(struct in6_addr)); | |
24032 | } | |
24033 | # 428 "include/net/ipv6.h" | |
24034 | extern int ipv6_rcv(struct sk_buff *skb, | |
24035 | struct net_device *dev, | |
24036 | struct packet_type *pt, | |
24037 | struct net_device *orig_dev); | |
24038 | ||
24039 | extern int ip6_rcv_finish(struct sk_buff *skb); | |
24040 | ||
24041 | ||
24042 | ||
24043 | ||
24044 | extern int ip6_xmit(struct sock *sk, | |
24045 | struct sk_buff *skb, | |
24046 | struct flowi *fl, | |
24047 | struct ipv6_txoptions *opt, | |
24048 | int ipfragok); | |
24049 | ||
24050 | extern int ip6_nd_hdr(struct sock *sk, | |
24051 | struct sk_buff *skb, | |
24052 | struct net_device *dev, | |
24053 | struct in6_addr *saddr, | |
24054 | struct in6_addr *daddr, | |
24055 | int proto, int len); | |
24056 | ||
24057 | extern int ip6_find_1stfragopt(struct sk_buff *skb, u8 **nexthdr); | |
24058 | ||
24059 | extern int ip6_append_data(struct sock *sk, | |
24060 | int getfrag(void *from, char *to, int offset, int len, int odd, struct sk_buff *skb), | |
24061 | void *from, | |
24062 | int length, | |
24063 | int transhdrlen, | |
24064 | int hlimit, | |
24065 | int tclass, | |
24066 | struct ipv6_txoptions *opt, | |
24067 | struct flowi *fl, | |
24068 | struct rt6_info *rt, | |
24069 | unsigned int flags); | |
24070 | ||
24071 | extern int ip6_push_pending_frames(struct sock *sk); | |
24072 | ||
24073 | extern void ip6_flush_pending_frames(struct sock *sk); | |
24074 | ||
24075 | extern int ip6_dst_lookup(struct sock *sk, | |
24076 | struct dst_entry **dst, | |
24077 | struct flowi *fl); | |
24078 | extern int ip6_sk_dst_lookup(struct sock *sk, | |
24079 | struct dst_entry **dst, | |
24080 | struct flowi *fl); | |
24081 | ||
24082 | ||
24083 | ||
24084 | ||
24085 | ||
24086 | extern int ip6_output(struct sk_buff *skb); | |
24087 | extern int ip6_forward(struct sk_buff *skb); | |
24088 | extern int ip6_input(struct sk_buff *skb); | |
24089 | extern int ip6_mc_input(struct sk_buff *skb); | |
24090 | ||
24091 | ||
24092 | ||
24093 | ||
24094 | ||
24095 | extern u8 * ipv6_build_nfrag_opts(struct sk_buff *skb, | |
24096 | u8 *prev_hdr, | |
24097 | struct ipv6_txoptions *opt, | |
24098 | struct in6_addr *daddr, | |
24099 | u32 jumbolen); | |
24100 | extern u8 * ipv6_build_frag_opts(struct sk_buff *skb, | |
24101 | u8 *prev_hdr, | |
24102 | struct ipv6_txoptions *opt); | |
24103 | extern void ipv6_push_nfrag_opts(struct sk_buff *skb, | |
24104 | struct ipv6_txoptions *opt, | |
24105 | u8 *proto, | |
24106 | struct in6_addr **daddr_p); | |
24107 | extern void ipv6_push_frag_opts(struct sk_buff *skb, | |
24108 | struct ipv6_txoptions *opt, | |
24109 | u8 *proto); | |
24110 | ||
24111 | extern int ipv6_skip_exthdr(const struct sk_buff *, int start, | |
24112 | u8 *nexthdrp); | |
24113 | ||
24114 | extern int ipv6_ext_hdr(u8 nexthdr); | |
24115 | ||
24116 | extern int ipv6_find_tlv(struct sk_buff *skb, int offset, int type); | |
24117 | ||
24118 | extern struct ipv6_txoptions * ipv6_invert_rthdr(struct sock *sk, | |
24119 | struct ipv6_rt_hdr *hdr); | |
24120 | ||
24121 | ||
24122 | ||
24123 | ||
24124 | ||
24125 | ||
24126 | extern int ipv6_setsockopt(struct sock *sk, int level, | |
24127 | int optname, | |
24128 | char *optval, | |
24129 | int optlen); | |
24130 | extern int ipv6_getsockopt(struct sock *sk, int level, | |
24131 | int optname, | |
24132 | char *optval, | |
24133 | int *optlen); | |
24134 | extern int compat_ipv6_setsockopt(struct sock *sk, | |
24135 | int level, | |
24136 | int optname, | |
24137 | char *optval, | |
24138 | int optlen); | |
24139 | extern int compat_ipv6_getsockopt(struct sock *sk, | |
24140 | int level, | |
24141 | int optname, | |
24142 | char *optval, | |
24143 | int *optlen); | |
24144 | ||
24145 | extern void ipv6_packet_init(void); | |
24146 | ||
24147 | extern void ipv6_packet_cleanup(void); | |
24148 | ||
24149 | extern int ip6_datagram_connect(struct sock *sk, | |
24150 | struct sockaddr *addr, int addr_len); | |
24151 | ||
24152 | extern int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len); | |
24153 | extern void ipv6_icmp_error(struct sock *sk, struct sk_buff *skb, int err, u16 port, | |
24154 | u32 info, u8 *payload); | |
24155 | extern void ipv6_local_error(struct sock *sk, int err, struct flowi *fl, u32 info); | |
24156 | ||
24157 | extern int inet6_release(struct socket *sock); | |
24158 | extern int inet6_bind(struct socket *sock, struct sockaddr *uaddr, | |
24159 | int addr_len); | |
24160 | extern int inet6_getname(struct socket *sock, struct sockaddr *uaddr, | |
24161 | int *uaddr_len, int peer); | |
24162 | extern int inet6_ioctl(struct socket *sock, unsigned int cmd, | |
24163 | unsigned long arg); | |
24164 | ||
24165 | extern int inet6_hash_connect(struct inet_timewait_death_row *death_row, | |
24166 | struct sock *sk); | |
24167 | ||
24168 | ||
24169 | ||
24170 | ||
24171 | extern int sysctl_ip6frag_high_thresh; | |
24172 | extern int sysctl_ip6frag_low_thresh; | |
24173 | extern int sysctl_ip6frag_time; | |
24174 | extern int sysctl_ip6frag_secret_interval; | |
24175 | ||
24176 | extern const struct proto_ops inet6_stream_ops; | |
24177 | extern const struct proto_ops inet6_dgram_ops; | |
24178 | ||
24179 | struct group_source_req; | |
24180 | struct group_filter; | |
24181 | ||
24182 | extern int ip6_mc_source(int add, int omode, struct sock *sk, | |
24183 | struct group_source_req *pgsr); | |
24184 | extern int ip6_mc_msfilter(struct sock *sk, struct group_filter *gsf); | |
24185 | extern int ip6_mc_msfget(struct sock *sk, struct group_filter *gsf, | |
24186 | struct group_filter *optval, | |
24187 | int *optlen); | |
24188 | ||
24189 | ||
24190 | extern int ac6_proc_init(void); | |
24191 | extern void ac6_proc_exit(void); | |
24192 | extern int raw6_proc_init(void); | |
24193 | extern void raw6_proc_exit(void); | |
24194 | extern int tcp6_proc_init(void); | |
24195 | extern void tcp6_proc_exit(void); | |
24196 | extern int udp6_proc_init(void); | |
24197 | extern void udp6_proc_exit(void); | |
24198 | extern int ipv6_misc_proc_init(void); | |
24199 | extern void ipv6_misc_proc_exit(void); | |
24200 | ||
24201 | extern struct rt6_statistics rt6_stats; | |
24202 | ||
24203 | ||
24204 | ||
24205 | extern ctl_table ipv6_route_table[]; | |
24206 | extern ctl_table ipv6_icmp_table[]; | |
24207 | ||
24208 | extern void ipv6_sysctl_register(void); | |
24209 | extern void ipv6_sysctl_unregister(void); | |
24210 | # 20 "include/net/xfrm.h" 2 | |
24211 | # 1 "include/net/ip6_fib.h" 1 | |
24212 | # 18 "include/net/ip6_fib.h" | |
24213 | # 1 "include/linux/ipv6_route.h" 1 | |
24214 | # 42 "include/linux/ipv6_route.h" | |
24215 | struct in6_rtmsg { | |
24216 | struct in6_addr rtmsg_dst; | |
24217 | struct in6_addr rtmsg_src; | |
24218 | struct in6_addr rtmsg_gateway; | |
24219 | __u32 rtmsg_type; | |
24220 | __u16 rtmsg_dst_len; | |
24221 | __u16 rtmsg_src_len; | |
24222 | __u32 rtmsg_metric; | |
24223 | unsigned long rtmsg_info; | |
24224 | __u32 rtmsg_flags; | |
24225 | int rtmsg_ifindex; | |
24226 | }; | |
24227 | # 19 "include/net/ip6_fib.h" 2 | |
24228 | ||
24229 | ||
24230 | ||
24231 | ||
24232 | # 1 "include/net/netlink.h" 1 | |
24233 | # 162 "include/net/netlink.h" | |
24234 | enum { | |
24235 | NLA_UNSPEC, | |
24236 | NLA_U8, | |
24237 | NLA_U16, | |
24238 | NLA_U32, | |
24239 | NLA_U64, | |
24240 | NLA_STRING, | |
24241 | NLA_FLAG, | |
24242 | NLA_MSECS, | |
24243 | NLA_NESTED, | |
24244 | NLA_NUL_STRING, | |
24245 | __NLA_TYPE_MAX, | |
24246 | }; | |
24247 | # 199 "include/net/netlink.h" | |
24248 | struct nla_policy { | |
24249 | u16 type; | |
24250 | u16 len; | |
24251 | }; | |
24252 | ||
24253 | ||
24254 | ||
24255 | ||
24256 | ||
24257 | ||
24258 | struct nl_info { | |
24259 | struct nlmsghdr *nlh; | |
24260 | u32 pid; | |
24261 | }; | |
24262 | ||
24263 | extern void netlink_run_queue(struct sock *sk, unsigned int *qlen, | |
24264 | int (*cb)(struct sk_buff *, | |
24265 | struct nlmsghdr *, int *)); | |
24266 | extern void netlink_queue_skip(struct nlmsghdr *nlh, | |
24267 | struct sk_buff *skb); | |
24268 | extern int nlmsg_notify(struct sock *sk, struct sk_buff *skb, | |
24269 | u32 pid, unsigned int group, int report, | |
24270 | gfp_t flags); | |
24271 | ||
24272 | extern int nla_validate(struct nlattr *head, int len, int maxtype, | |
24273 | struct nla_policy *policy); | |
24274 | extern int nla_parse(struct nlattr *tb[], int maxtype, | |
24275 | struct nlattr *head, int len, | |
24276 | struct nla_policy *policy); | |
24277 | extern struct nlattr * nla_find(struct nlattr *head, int len, int attrtype); | |
24278 | extern size_t nla_strlcpy(char *dst, const struct nlattr *nla, | |
24279 | size_t dstsize); | |
24280 | extern int nla_memcpy(void *dest, struct nlattr *src, int count); | |
24281 | extern int nla_memcmp(const struct nlattr *nla, const void *data, | |
24282 | size_t size); | |
24283 | extern int nla_strcmp(const struct nlattr *nla, const char *str); | |
24284 | extern struct nlattr * __nla_reserve(struct sk_buff *skb, int attrtype, | |
24285 | int attrlen); | |
24286 | extern void * __nla_reserve_nohdr(struct sk_buff *skb, int attrlen); | |
24287 | extern struct nlattr * nla_reserve(struct sk_buff *skb, int attrtype, | |
24288 | int attrlen); | |
24289 | extern void * nla_reserve_nohdr(struct sk_buff *skb, int attrlen); | |
24290 | extern void __nla_put(struct sk_buff *skb, int attrtype, | |
24291 | int attrlen, const void *data); | |
24292 | extern void __nla_put_nohdr(struct sk_buff *skb, int attrlen, | |
24293 | const void *data); | |
24294 | extern int nla_put(struct sk_buff *skb, int attrtype, | |
24295 | int attrlen, const void *data); | |
24296 | extern int nla_put_nohdr(struct sk_buff *skb, int attrlen, | |
24297 | const void *data); | |
24298 | # 258 "include/net/netlink.h" | |
24299 | static inline __attribute__((always_inline)) int nlmsg_msg_size(int payload) | |
24300 | { | |
24301 | return ((int) ( ((sizeof(struct nlmsghdr))+4 -1) & ~(4 -1) )) + payload; | |
24302 | } | |
24303 | ||
24304 | ||
24305 | ||
24306 | ||
24307 | ||
24308 | static inline __attribute__((always_inline)) int nlmsg_total_size(int payload) | |
24309 | { | |
24310 | return ( ((nlmsg_msg_size(payload))+4 -1) & ~(4 -1) ); | |
24311 | } | |
24312 | ||
24313 | ||
24314 | ||
24315 | ||
24316 | ||
24317 | static inline __attribute__((always_inline)) int nlmsg_padlen(int payload) | |
24318 | { | |
24319 | return nlmsg_total_size(payload) - nlmsg_msg_size(payload); | |
24320 | } | |
24321 | ||
24322 | ||
24323 | ||
24324 | ||
24325 | ||
24326 | static inline __attribute__((always_inline)) void *nlmsg_data(const struct nlmsghdr *nlh) | |
24327 | { | |
24328 | return (unsigned char *) nlh + ((int) ( ((sizeof(struct nlmsghdr))+4 -1) & ~(4 -1) )); | |
24329 | } | |
24330 | ||
24331 | ||
24332 | ||
24333 | ||
24334 | ||
24335 | static inline __attribute__((always_inline)) int nlmsg_len(const struct nlmsghdr *nlh) | |
24336 | { | |
24337 | return nlh->nlmsg_len - ((int) ( ((sizeof(struct nlmsghdr))+4 -1) & ~(4 -1) )); | |
24338 | } | |
24339 | ||
24340 | ||
24341 | ||
24342 | ||
24343 | ||
24344 | ||
24345 | static inline __attribute__((always_inline)) struct nlattr *nlmsg_attrdata(const struct nlmsghdr *nlh, | |
24346 | int hdrlen) | |
24347 | { | |
24348 | unsigned char *data = nlmsg_data(nlh); | |
24349 | return (struct nlattr *) (data + ( ((hdrlen)+4 -1) & ~(4 -1) )); | |
24350 | } | |
24351 | ||
24352 | ||
24353 | ||
24354 | ||
24355 | ||
24356 | ||
24357 | static inline __attribute__((always_inline)) int nlmsg_attrlen(const struct nlmsghdr *nlh, int hdrlen) | |
24358 | { | |
24359 | return nlmsg_len(nlh) - ( ((hdrlen)+4 -1) & ~(4 -1) ); | |
24360 | } | |
24361 | ||
24362 | ||
24363 | ||
24364 | ||
24365 | ||
24366 | ||
24367 | static inline __attribute__((always_inline)) int nlmsg_ok(const struct nlmsghdr *nlh, int remaining) | |
24368 | { | |
24369 | return (remaining >= sizeof(struct nlmsghdr) && | |
24370 | nlh->nlmsg_len >= sizeof(struct nlmsghdr) && | |
24371 | nlh->nlmsg_len <= remaining); | |
24372 | } | |
24373 | # 341 "include/net/netlink.h" | |
24374 | static inline __attribute__((always_inline)) struct nlmsghdr *nlmsg_next(struct nlmsghdr *nlh, int *remaining) | |
24375 | { | |
24376 | int totlen = ( ((nlh->nlmsg_len)+4 -1) & ~(4 -1) ); | |
24377 | ||
24378 | *remaining -= totlen; | |
24379 | ||
24380 | return (struct nlmsghdr *) ((unsigned char *) nlh + totlen); | |
24381 | } | |
24382 | # 360 "include/net/netlink.h" | |
24383 | static inline __attribute__((always_inline)) int nlmsg_parse(struct nlmsghdr *nlh, int hdrlen, | |
24384 | struct nlattr *tb[], int maxtype, | |
24385 | struct nla_policy *policy) | |
24386 | { | |
24387 | if (nlh->nlmsg_len < nlmsg_msg_size(hdrlen)) | |
24388 | return -22; | |
24389 | ||
24390 | return nla_parse(tb, maxtype, nlmsg_attrdata(nlh, hdrlen), | |
24391 | nlmsg_attrlen(nlh, hdrlen), policy); | |
24392 | } | |
24393 | # 379 "include/net/netlink.h" | |
24394 | static inline __attribute__((always_inline)) struct nlattr *nlmsg_find_attr(struct nlmsghdr *nlh, | |
24395 | int hdrlen, int attrtype) | |
24396 | { | |
24397 | return nla_find(nlmsg_attrdata(nlh, hdrlen), | |
24398 | nlmsg_attrlen(nlh, hdrlen), attrtype); | |
24399 | } | |
24400 | # 393 "include/net/netlink.h" | |
24401 | static inline __attribute__((always_inline)) int nlmsg_validate(struct nlmsghdr *nlh, int hdrlen, int maxtype, | |
24402 | struct nla_policy *policy) | |
24403 | { | |
24404 | if (nlh->nlmsg_len < nlmsg_msg_size(hdrlen)) | |
24405 | return -22; | |
24406 | ||
24407 | return nla_validate(nlmsg_attrdata(nlh, hdrlen), | |
24408 | nlmsg_attrlen(nlh, hdrlen), maxtype, policy); | |
24409 | } | |
24410 | ||
24411 | ||
24412 | ||
24413 | ||
24414 | ||
24415 | ||
24416 | ||
24417 | static inline __attribute__((always_inline)) int nlmsg_report(struct nlmsghdr *nlh) | |
24418 | { | |
24419 | return !!(nlh->nlmsg_flags & 8); | |
24420 | } | |
24421 | # 472 "include/net/netlink.h" | |
24422 | static inline __attribute__((always_inline)) struct nlmsghdr *nlmsg_put(struct sk_buff *skb, u32 pid, u32 seq, | |
24423 | int type, int payload, int flags) | |
24424 | { | |
24425 | if (__builtin_expect(!!(skb_tailroom(skb) < nlmsg_total_size(payload)), 0)) | |
24426 | return ((void *)0); | |
24427 | ||
24428 | return __nlmsg_put(skb, pid, seq, type, payload, flags); | |
24429 | } | |
24430 | # 492 "include/net/netlink.h" | |
24431 | static inline __attribute__((always_inline)) struct nlmsghdr *nlmsg_put_answer(struct sk_buff *skb, | |
24432 | struct netlink_callback *cb, | |
24433 | int type, int payload, | |
24434 | int flags) | |
24435 | { | |
24436 | return nlmsg_put(skb, (*(struct netlink_skb_parms*)&((cb->skb)->cb)).pid, cb->nlh->nlmsg_seq, | |
24437 | type, payload, flags); | |
24438 | } | |
24439 | # 508 "include/net/netlink.h" | |
24440 | static inline __attribute__((always_inline)) struct sk_buff *nlmsg_new(int size, gfp_t flags) | |
24441 | { | |
24442 | return alloc_skb(size, flags); | |
24443 | } | |
24444 | # 524 "include/net/netlink.h" | |
24445 | static inline __attribute__((always_inline)) int nlmsg_end(struct sk_buff *skb, struct nlmsghdr *nlh) | |
24446 | { | |
24447 | nlh->nlmsg_len = skb->tail - (unsigned char *) nlh; | |
24448 | ||
24449 | return skb->len; | |
24450 | } | |
24451 | ||
24452 | ||
24453 | ||
24454 | ||
24455 | ||
24456 | ||
24457 | ||
24458 | static inline __attribute__((always_inline)) void *nlmsg_get_pos(struct sk_buff *skb) | |
24459 | { | |
24460 | return skb->tail; | |
24461 | } | |
24462 | # 549 "include/net/netlink.h" | |
24463 | static inline __attribute__((always_inline)) int nlmsg_trim(struct sk_buff *skb, void *mark) | |
24464 | { | |
24465 | if (mark) | |
24466 | skb_trim(skb, (unsigned char *) mark - skb->data); | |
24467 | ||
24468 | return -1; | |
24469 | } | |
24470 | # 565 "include/net/netlink.h" | |
24471 | static inline __attribute__((always_inline)) int nlmsg_cancel(struct sk_buff *skb, struct nlmsghdr *nlh) | |
24472 | { | |
24473 | return nlmsg_trim(skb, nlh); | |
24474 | } | |
24475 | ||
24476 | ||
24477 | ||
24478 | ||
24479 | ||
24480 | static inline __attribute__((always_inline)) void nlmsg_free(struct sk_buff *skb) | |
24481 | { | |
24482 | kfree_skb(skb); | |
24483 | } | |
24484 | # 587 "include/net/netlink.h" | |
24485 | static inline __attribute__((always_inline)) int nlmsg_multicast(struct sock *sk, struct sk_buff *skb, | |
24486 | u32 pid, unsigned int group, gfp_t flags) | |
24487 | { | |
24488 | int err; | |
24489 | ||
24490 | (*(struct netlink_skb_parms*)&((skb)->cb)).dst_group = group; | |
24491 | ||
24492 | err = netlink_broadcast(sk, skb, pid, group, flags); | |
24493 | if (err > 0) | |
24494 | err = 0; | |
24495 | ||
24496 | return err; | |
24497 | } | |
24498 | ||
24499 | ||
24500 | ||
24501 | ||
24502 | ||
24503 | ||
24504 | ||
24505 | static inline __attribute__((always_inline)) int nlmsg_unicast(struct sock *sk, struct sk_buff *skb, u32 pid) | |
24506 | { | |
24507 | int err; | |
24508 | ||
24509 | err = netlink_unicast(sk, skb, pid, 0x40); | |
24510 | if (err > 0) | |
24511 | err = 0; | |
24512 | ||
24513 | return err; | |
24514 | } | |
24515 | # 638 "include/net/netlink.h" | |
24516 | static inline __attribute__((always_inline)) int nla_attr_size(int payload) | |
24517 | { | |
24518 | return ((int) (((sizeof(struct nlattr)) + 4 - 1) & ~(4 - 1))) + payload; | |
24519 | } | |
24520 | ||
24521 | ||
24522 | ||
24523 | ||
24524 | ||
24525 | static inline __attribute__((always_inline)) int nla_total_size(int payload) | |
24526 | { | |
24527 | return (((nla_attr_size(payload)) + 4 - 1) & ~(4 - 1)); | |
24528 | } | |
24529 | ||
24530 | ||
24531 | ||
24532 | ||
24533 | ||
24534 | static inline __attribute__((always_inline)) int nla_padlen(int payload) | |
24535 | { | |
24536 | return nla_total_size(payload) - nla_attr_size(payload); | |
24537 | } | |
24538 | ||
24539 | ||
24540 | ||
24541 | ||
24542 | ||
24543 | static inline __attribute__((always_inline)) void *nla_data(const struct nlattr *nla) | |
24544 | { | |
24545 | return (char *) nla + ((int) (((sizeof(struct nlattr)) + 4 - 1) & ~(4 - 1))); | |
24546 | } | |
24547 | ||
24548 | ||
24549 | ||
24550 | ||
24551 | ||
24552 | static inline __attribute__((always_inline)) int nla_len(const struct nlattr *nla) | |
24553 | { | |
24554 | return nla->nla_len - ((int) (((sizeof(struct nlattr)) + 4 - 1) & ~(4 - 1))); | |
24555 | } | |
24556 | ||
24557 | ||
24558 | ||
24559 | ||
24560 | ||
24561 | ||
24562 | static inline __attribute__((always_inline)) int nla_ok(const struct nlattr *nla, int remaining) | |
24563 | { | |
24564 | return remaining >= sizeof(*nla) && | |
24565 | nla->nla_len >= sizeof(*nla) && | |
24566 | nla->nla_len <= remaining; | |
24567 | } | |
24568 | # 699 "include/net/netlink.h" | |
24569 | static inline __attribute__((always_inline)) struct nlattr *nla_next(const struct nlattr *nla, int *remaining) | |
24570 | { | |
24571 | int totlen = (((nla->nla_len) + 4 - 1) & ~(4 - 1)); | |
24572 | ||
24573 | *remaining -= totlen; | |
24574 | return (struct nlattr *) ((char *) nla + totlen); | |
24575 | } | |
24576 | # 714 "include/net/netlink.h" | |
24577 | static inline __attribute__((always_inline)) struct nlattr *nla_find_nested(struct nlattr *nla, int attrtype) | |
24578 | { | |
24579 | return nla_find(nla_data(nla), nla_len(nla), attrtype); | |
24580 | } | |
24581 | # 728 "include/net/netlink.h" | |
24582 | static inline __attribute__((always_inline)) int nla_parse_nested(struct nlattr *tb[], int maxtype, | |
24583 | struct nlattr *nla, | |
24584 | struct nla_policy *policy) | |
24585 | { | |
24586 | return nla_parse(tb, maxtype, nla_data(nla), nla_len(nla), policy); | |
24587 | } | |
24588 | ||
24589 | ||
24590 | ||
24591 | ||
24592 | ||
24593 | ||
24594 | static inline __attribute__((always_inline)) int nla_put_u8(struct sk_buff *skb, int attrtype, u8 value) | |
24595 | { | |
24596 | return nla_put(skb, attrtype, sizeof(u8), &value); | |
24597 | } | |
24598 | ||
24599 | ||
24600 | ||
24601 | ||
24602 | ||
24603 | ||
24604 | ||
24605 | static inline __attribute__((always_inline)) int nla_put_u16(struct sk_buff *skb, int attrtype, u16 value) | |
24606 | { | |
24607 | return nla_put(skb, attrtype, sizeof(u16), &value); | |
24608 | } | |
24609 | ||
24610 | ||
24611 | ||
24612 | ||
24613 | ||
24614 | ||
24615 | ||
24616 | static inline __attribute__((always_inline)) int nla_put_u32(struct sk_buff *skb, int attrtype, u32 value) | |
24617 | { | |
24618 | return nla_put(skb, attrtype, sizeof(u32), &value); | |
24619 | } | |
24620 | ||
24621 | ||
24622 | ||
24623 | ||
24624 | ||
24625 | ||
24626 | ||
24627 | static inline __attribute__((always_inline)) int nla_put_u64(struct sk_buff *skb, int attrtype, u64 value) | |
24628 | { | |
24629 | return nla_put(skb, attrtype, sizeof(u64), &value); | |
24630 | } | |
24631 | ||
24632 | ||
24633 | ||
24634 | ||
24635 | ||
24636 | ||
24637 | ||
24638 | static inline __attribute__((always_inline)) int nla_put_string(struct sk_buff *skb, int attrtype, | |
24639 | const char *str) | |
24640 | { | |
24641 | return nla_put(skb, attrtype, strlen(str) + 1, str); | |
24642 | } | |
24643 | ||
24644 | ||
24645 | ||
24646 | ||
24647 | ||
24648 | ||
24649 | static inline __attribute__((always_inline)) int nla_put_flag(struct sk_buff *skb, int attrtype) | |
24650 | { | |
24651 | return nla_put(skb, attrtype, 0, ((void *)0)); | |
24652 | } | |
24653 | ||
24654 | ||
24655 | ||
24656 | ||
24657 | ||
24658 | ||
24659 | ||
24660 | static inline __attribute__((always_inline)) int nla_put_msecs(struct sk_buff *skb, int attrtype, | |
24661 | unsigned long jiffies) | |
24662 | { | |
24663 | u64 tmp = jiffies_to_msecs(jiffies); | |
24664 | return nla_put(skb, attrtype, sizeof(u64), &tmp); | |
24665 | } | |
24666 | # 853 "include/net/netlink.h" | |
24667 | static inline __attribute__((always_inline)) u32 nla_get_u32(struct nlattr *nla) | |
24668 | { | |
24669 | return *(u32 *) nla_data(nla); | |
24670 | } | |
24671 | ||
24672 | ||
24673 | ||
24674 | ||
24675 | ||
24676 | static inline __attribute__((always_inline)) __be32 nla_get_be32(struct nlattr *nla) | |
24677 | { | |
24678 | return *(__be32 *) nla_data(nla); | |
24679 | } | |
24680 | ||
24681 | ||
24682 | ||
24683 | ||
24684 | ||
24685 | static inline __attribute__((always_inline)) u16 nla_get_u16(struct nlattr *nla) | |
24686 | { | |
24687 | return *(u16 *) nla_data(nla); | |
24688 | } | |
24689 | ||
24690 | ||
24691 | ||
24692 | ||
24693 | ||
24694 | static inline __attribute__((always_inline)) u8 nla_get_u8(struct nlattr *nla) | |
24695 | { | |
24696 | return *(u8 *) nla_data(nla); | |
24697 | } | |
24698 | ||
24699 | ||
24700 | ||
24701 | ||
24702 | ||
24703 | static inline __attribute__((always_inline)) u64 nla_get_u64(struct nlattr *nla) | |
24704 | { | |
24705 | u64 tmp; | |
24706 | ||
24707 | nla_memcpy(&tmp, nla, sizeof(tmp)); | |
24708 | ||
24709 | return tmp; | |
24710 | } | |
24711 | ||
24712 | ||
24713 | ||
24714 | ||
24715 | ||
24716 | static inline __attribute__((always_inline)) int nla_get_flag(struct nlattr *nla) | |
24717 | { | |
24718 | return !!nla; | |
24719 | } | |
24720 | ||
24721 | ||
24722 | ||
24723 | ||
24724 | ||
24725 | ||
24726 | ||
24727 | static inline __attribute__((always_inline)) unsigned long nla_get_msecs(struct nlattr *nla) | |
24728 | { | |
24729 | u64 msecs = nla_get_u64(nla); | |
24730 | ||
24731 | return msecs_to_jiffies((unsigned long) msecs); | |
24732 | } | |
24733 | # 927 "include/net/netlink.h" | |
24734 | static inline __attribute__((always_inline)) struct nlattr *nla_nest_start(struct sk_buff *skb, int attrtype) | |
24735 | { | |
24736 | struct nlattr *start = (struct nlattr *) skb->tail; | |
24737 | ||
24738 | if (nla_put(skb, attrtype, 0, ((void *)0)) < 0) | |
24739 | return ((void *)0); | |
24740 | ||
24741 | return start; | |
24742 | } | |
24743 | # 947 "include/net/netlink.h" | |
24744 | static inline __attribute__((always_inline)) int nla_nest_end(struct sk_buff *skb, struct nlattr *start) | |
24745 | { | |
24746 | start->nla_len = skb->tail - (unsigned char *) start; | |
24747 | return skb->len; | |
24748 | } | |
24749 | # 961 "include/net/netlink.h" | |
24750 | static inline __attribute__((always_inline)) int nla_nest_cancel(struct sk_buff *skb, struct nlattr *start) | |
24751 | { | |
24752 | return nlmsg_trim(skb, start); | |
24753 | } | |
24754 | # 978 "include/net/netlink.h" | |
24755 | static inline __attribute__((always_inline)) int nla_validate_nested(struct nlattr *start, int maxtype, | |
24756 | struct nla_policy *policy) | |
24757 | { | |
24758 | return nla_validate(nla_data(start), nla_len(start), maxtype, policy); | |
24759 | } | |
24760 | # 24 "include/net/ip6_fib.h" 2 | |
24761 | ||
24762 | struct rt6_info; | |
24763 | ||
24764 | struct fib6_config | |
24765 | { | |
24766 | u32 fc_table; | |
24767 | u32 fc_metric; | |
24768 | int fc_dst_len; | |
24769 | int fc_src_len; | |
24770 | int fc_ifindex; | |
24771 | u32 fc_flags; | |
24772 | u32 fc_protocol; | |
24773 | ||
24774 | struct in6_addr fc_dst; | |
24775 | struct in6_addr fc_src; | |
24776 | struct in6_addr fc_gateway; | |
24777 | ||
24778 | unsigned long fc_expires; | |
24779 | struct nlattr *fc_mx; | |
24780 | int fc_mx_len; | |
24781 | ||
24782 | struct nl_info fc_nlinfo; | |
24783 | }; | |
24784 | ||
24785 | struct fib6_node | |
24786 | { | |
24787 | struct fib6_node *parent; | |
24788 | struct fib6_node *left; | |
24789 | struct fib6_node *right; | |
24790 | ||
24791 | struct fib6_node *subtree; | |
24792 | ||
24793 | struct rt6_info *leaf; | |
24794 | ||
24795 | __u16 fn_bit; | |
24796 | __u16 fn_flags; | |
24797 | __u32 fn_sernum; | |
24798 | }; | |
24799 | # 74 "include/net/ip6_fib.h" | |
24800 | struct rt6key | |
24801 | { | |
24802 | struct in6_addr addr; | |
24803 | int plen; | |
24804 | }; | |
24805 | ||
24806 | struct fib6_table; | |
24807 | ||
24808 | struct rt6_info | |
24809 | { | |
24810 | union { | |
24811 | struct dst_entry dst; | |
24812 | struct rt6_info *next; | |
24813 | } u; | |
24814 | ||
24815 | struct inet6_dev *rt6i_idev; | |
24816 | ||
24817 | ||
24818 | ||
24819 | ||
24820 | ||
24821 | struct fib6_node *rt6i_node; | |
24822 | ||
24823 | struct in6_addr rt6i_gateway; | |
24824 | ||
24825 | u32 rt6i_flags; | |
24826 | u32 rt6i_metric; | |
24827 | atomic_t rt6i_ref; | |
24828 | struct fib6_table *rt6i_table; | |
24829 | ||
24830 | struct rt6key rt6i_dst; | |
24831 | struct rt6key rt6i_src; | |
24832 | ||
24833 | u8 rt6i_protocol; | |
24834 | }; | |
24835 | ||
24836 | struct fib6_walker_t | |
24837 | { | |
24838 | struct fib6_walker_t *prev, *next; | |
24839 | struct fib6_node *root, *node; | |
24840 | struct rt6_info *leaf; | |
24841 | unsigned char state; | |
24842 | unsigned char prune; | |
24843 | int (*func)(struct fib6_walker_t *); | |
24844 | void *args; | |
24845 | }; | |
24846 | ||
24847 | struct rt6_statistics { | |
24848 | __u32 fib_nodes; | |
24849 | __u32 fib_route_nodes; | |
24850 | __u32 fib_rt_alloc; | |
24851 | __u32 fib_rt_entries; | |
24852 | __u32 fib_rt_cache; | |
24853 | __u32 fib_discarded_routes; | |
24854 | }; | |
24855 | # 151 "include/net/ip6_fib.h" | |
24856 | typedef void (*f_pnode)(struct fib6_node *fn, void *); | |
24857 | ||
24858 | struct fib6_table { | |
24859 | struct hlist_node tb6_hlist; | |
24860 | u32 tb6_id; | |
24861 | rwlock_t tb6_lock; | |
24862 | struct fib6_node tb6_root; | |
24863 | }; | |
24864 | # 176 "include/net/ip6_fib.h" | |
24865 | typedef struct rt6_info *(*pol_lookup_t)(struct fib6_table *, | |
24866 | struct flowi *, int); | |
24867 | ||
24868 | ||
24869 | ||
24870 | ||
24871 | ||
24872 | extern struct fib6_table * fib6_get_table(u32 id); | |
24873 | extern struct fib6_table * fib6_new_table(u32 id); | |
24874 | extern struct dst_entry * fib6_rule_lookup(struct flowi *fl, int flags, | |
24875 | pol_lookup_t lookup); | |
24876 | ||
24877 | extern struct fib6_node *fib6_lookup(struct fib6_node *root, | |
24878 | struct in6_addr *daddr, | |
24879 | struct in6_addr *saddr); | |
24880 | ||
24881 | struct fib6_node *fib6_locate(struct fib6_node *root, | |
24882 | struct in6_addr *daddr, int dst_len, | |
24883 | struct in6_addr *saddr, int src_len); | |
24884 | ||
24885 | extern void fib6_clean_all(int (*func)(struct rt6_info *, void *arg), | |
24886 | int prune, void *arg); | |
24887 | ||
24888 | extern int fib6_add(struct fib6_node *root, | |
24889 | struct rt6_info *rt, | |
24890 | struct nl_info *info); | |
24891 | ||
24892 | extern int fib6_del(struct rt6_info *rt, | |
24893 | struct nl_info *info); | |
24894 | ||
24895 | extern void inet6_rt_notify(int event, struct rt6_info *rt, | |
24896 | struct nl_info *info); | |
24897 | ||
24898 | extern void fib6_run_gc(unsigned long dummy); | |
24899 | ||
24900 | extern void fib6_gc_cleanup(void); | |
24901 | ||
24902 | extern void fib6_init(void); | |
24903 | ||
24904 | extern void fib6_rules_init(void); | |
24905 | extern void fib6_rules_cleanup(void); | |
24906 | extern int fib6_rules_dump(struct sk_buff *, | |
24907 | struct netlink_callback *); | |
24908 | # 21 "include/net/xfrm.h" 2 | |
24909 | ||
24910 | ||
24911 | ||
24912 | ||
24913 | ||
24914 | extern struct sock *xfrm_nl; | |
24915 | extern u32 sysctl_xfrm_aevent_etime; | |
24916 | extern u32 sysctl_xfrm_aevent_rseqth; | |
24917 | ||
24918 | extern struct mutex xfrm_cfg_mutex; | |
24919 | # 94 "include/net/xfrm.h" | |
24920 | struct xfrm_state | |
24921 | { | |
24922 | ||
24923 | struct hlist_node bydst; | |
24924 | struct hlist_node bysrc; | |
24925 | struct hlist_node byspi; | |
24926 | ||
24927 | atomic_t refcnt; | |
24928 | spinlock_t lock; | |
24929 | ||
24930 | struct xfrm_id id; | |
24931 | struct xfrm_selector sel; | |
24932 | ||
24933 | u32 genid; | |
24934 | ||
24935 | ||
24936 | struct { | |
24937 | u8 state; | |
24938 | u8 dying; | |
24939 | u32 seq; | |
24940 | } km; | |
24941 | ||
24942 | ||
24943 | struct { | |
24944 | u32 reqid; | |
24945 | u8 mode; | |
24946 | u8 replay_window; | |
24947 | u8 aalgo, ealgo, calgo; | |
24948 | u8 flags; | |
24949 | u16 family; | |
24950 | xfrm_address_t saddr; | |
24951 | int header_len; | |
24952 | int trailer_len; | |
24953 | } props; | |
24954 | ||
24955 | struct xfrm_lifetime_cfg lft; | |
24956 | ||
24957 | ||
24958 | struct xfrm_algo *aalg; | |
24959 | struct xfrm_algo *ealg; | |
24960 | struct xfrm_algo *calg; | |
24961 | ||
24962 | ||
24963 | struct xfrm_encap_tmpl *encap; | |
24964 | ||
24965 | ||
24966 | xfrm_address_t *coaddr; | |
24967 | ||
24968 | ||
24969 | struct xfrm_state *tunnel; | |
24970 | ||
24971 | ||
24972 | atomic_t tunnel_users; | |
24973 | ||
24974 | ||
24975 | struct xfrm_replay_state replay; | |
24976 | ||
24977 | ||
24978 | struct xfrm_replay_state preplay; | |
24979 | ||
24980 | ||
24981 | ||
24982 | ||
24983 | u32 xflags; | |
24984 | ||
24985 | ||
24986 | u32 replay_maxage; | |
24987 | u32 replay_maxdiff; | |
24988 | ||
24989 | ||
24990 | struct timer_list rtimer; | |
24991 | ||
24992 | ||
24993 | struct xfrm_stats stats; | |
24994 | ||
24995 | struct xfrm_lifetime_cur curlft; | |
24996 | struct timer_list timer; | |
24997 | ||
24998 | ||
24999 | u64 lastused; | |
25000 | ||
25001 | ||
25002 | ||
25003 | struct xfrm_type *type; | |
25004 | struct xfrm_mode *mode; | |
25005 | ||
25006 | ||
25007 | struct xfrm_sec_ctx *security; | |
25008 | ||
25009 | ||
25010 | ||
25011 | void *data; | |
25012 | }; | |
25013 | ||
25014 | ||
25015 | ||
25016 | ||
25017 | enum { | |
25018 | XFRM_STATE_VOID, | |
25019 | XFRM_STATE_ACQ, | |
25020 | XFRM_STATE_VALID, | |
25021 | XFRM_STATE_ERROR, | |
25022 | XFRM_STATE_EXPIRED, | |
25023 | XFRM_STATE_DEAD | |
25024 | }; | |
25025 | ||
25026 | ||
25027 | struct km_event | |
25028 | { | |
25029 | union { | |
25030 | u32 hard; | |
25031 | u32 proto; | |
25032 | u32 byid; | |
25033 | u32 aevent; | |
25034 | u32 type; | |
25035 | } data; | |
25036 | ||
25037 | u32 seq; | |
25038 | u32 pid; | |
25039 | u32 event; | |
25040 | }; | |
25041 | ||
25042 | struct xfrm_type; | |
25043 | struct xfrm_dst; | |
25044 | struct xfrm_policy_afinfo { | |
25045 | unsigned short family; | |
25046 | struct xfrm_type *type_map[IPPROTO_MAX]; | |
25047 | struct xfrm_mode *mode_map[5]; | |
25048 | struct dst_ops *dst_ops; | |
25049 | void (*garbage_collect)(void); | |
25050 | int (*dst_lookup)(struct xfrm_dst **dst, struct flowi *fl); | |
25051 | int (*get_saddr)(xfrm_address_t *saddr, xfrm_address_t *daddr); | |
25052 | struct dst_entry *(*find_bundle)(struct flowi *fl, struct xfrm_policy *policy); | |
25053 | int (*bundle_create)(struct xfrm_policy *policy, | |
25054 | struct xfrm_state **xfrm, | |
25055 | int nx, | |
25056 | struct flowi *fl, | |
25057 | struct dst_entry **dst_p); | |
25058 | void (*decode_session)(struct sk_buff *skb, | |
25059 | struct flowi *fl); | |
25060 | }; | |
25061 | ||
25062 | extern int xfrm_policy_register_afinfo(struct xfrm_policy_afinfo *afinfo); | |
25063 | extern int xfrm_policy_unregister_afinfo(struct xfrm_policy_afinfo *afinfo); | |
25064 | extern void km_policy_notify(struct xfrm_policy *xp, int dir, struct km_event *c); | |
25065 | extern void km_state_notify(struct xfrm_state *x, struct km_event *c); | |
25066 | ||
25067 | ||
25068 | struct xfrm_tmpl; | |
25069 | extern int km_query(struct xfrm_state *x, struct xfrm_tmpl *t, struct xfrm_policy *pol); | |
25070 | extern void km_state_expired(struct xfrm_state *x, int hard, u32 pid); | |
25071 | extern int __xfrm_state_delete(struct xfrm_state *x); | |
25072 | ||
25073 | struct xfrm_state_afinfo { | |
25074 | unsigned short family; | |
25075 | int (*init_flags)(struct xfrm_state *x); | |
25076 | void (*init_tempsel)(struct xfrm_state *x, struct flowi *fl, | |
25077 | struct xfrm_tmpl *tmpl, | |
25078 | xfrm_address_t *daddr, xfrm_address_t *saddr); | |
25079 | int (*tmpl_sort)(struct xfrm_tmpl **dst, struct xfrm_tmpl **src, int n); | |
25080 | int (*state_sort)(struct xfrm_state **dst, struct xfrm_state **src, int n); | |
25081 | }; | |
25082 | ||
25083 | extern int xfrm_state_register_afinfo(struct xfrm_state_afinfo *afinfo); | |
25084 | extern int xfrm_state_unregister_afinfo(struct xfrm_state_afinfo *afinfo); | |
25085 | ||
25086 | extern void xfrm_state_delete_tunnel(struct xfrm_state *x); | |
25087 | ||
25088 | struct xfrm_type | |
25089 | { | |
25090 | char *description; | |
25091 | struct module *owner; | |
25092 | __u8 proto; | |
25093 | __u8 flags; | |
25094 | ||
25095 | ||
25096 | int (*init_state)(struct xfrm_state *x); | |
25097 | void (*destructor)(struct xfrm_state *); | |
25098 | int (*input)(struct xfrm_state *, struct sk_buff *skb); | |
25099 | int (*output)(struct xfrm_state *, struct sk_buff *pskb); | |
25100 | int (*reject)(struct xfrm_state *, struct sk_buff *, struct flowi *); | |
25101 | int (*hdr_offset)(struct xfrm_state *, struct sk_buff *, u8 **); | |
25102 | xfrm_address_t *(*local_addr)(struct xfrm_state *, xfrm_address_t *); | |
25103 | xfrm_address_t *(*remote_addr)(struct xfrm_state *, xfrm_address_t *); | |
25104 | ||
25105 | u32 (*get_max_size)(struct xfrm_state *, int size); | |
25106 | }; | |
25107 | ||
25108 | extern int xfrm_register_type(struct xfrm_type *type, unsigned short family); | |
25109 | extern int xfrm_unregister_type(struct xfrm_type *type, unsigned short family); | |
25110 | extern struct xfrm_type *xfrm_get_type(u8 proto, unsigned short family); | |
25111 | extern void xfrm_put_type(struct xfrm_type *type); | |
25112 | ||
25113 | struct xfrm_mode { | |
25114 | int (*input)(struct xfrm_state *x, struct sk_buff *skb); | |
25115 | int (*output)(struct xfrm_state *x,struct sk_buff *skb); | |
25116 | ||
25117 | struct module *owner; | |
25118 | unsigned int encap; | |
25119 | }; | |
25120 | ||
25121 | extern int xfrm_register_mode(struct xfrm_mode *mode, int family); | |
25122 | extern int xfrm_unregister_mode(struct xfrm_mode *mode, int family); | |
25123 | extern struct xfrm_mode *xfrm_get_mode(unsigned int encap, int family); | |
25124 | extern void xfrm_put_mode(struct xfrm_mode *mode); | |
25125 | ||
25126 | struct xfrm_tmpl | |
25127 | { | |
25128 | ||
25129 | ||
25130 | ||
25131 | ||
25132 | ||
25133 | ||
25134 | struct xfrm_id id; | |
25135 | ||
25136 | ||
25137 | xfrm_address_t saddr; | |
25138 | ||
25139 | __u32 reqid; | |
25140 | ||
25141 | ||
25142 | __u8 mode; | |
25143 | ||
25144 | ||
25145 | __u8 share; | |
25146 | ||
25147 | ||
25148 | __u8 optional; | |
25149 | ||
25150 | ||
25151 | __u32 aalgos; | |
25152 | __u32 ealgos; | |
25153 | __u32 calgos; | |
25154 | }; | |
25155 | ||
25156 | ||
25157 | ||
25158 | struct xfrm_policy | |
25159 | { | |
25160 | struct xfrm_policy *next; | |
25161 | struct hlist_node bydst; | |
25162 | struct hlist_node byidx; | |
25163 | ||
25164 | ||
25165 | rwlock_t lock; | |
25166 | atomic_t refcnt; | |
25167 | struct timer_list timer; | |
25168 | ||
25169 | u8 type; | |
25170 | u32 priority; | |
25171 | u32 index; | |
25172 | struct xfrm_selector selector; | |
25173 | struct xfrm_lifetime_cfg lft; | |
25174 | struct xfrm_lifetime_cur curlft; | |
25175 | struct dst_entry *bundles; | |
25176 | __u16 family; | |
25177 | __u8 action; | |
25178 | __u8 flags; | |
25179 | __u8 dead; | |
25180 | __u8 xfrm_nr; | |
25181 | struct xfrm_sec_ctx *security; | |
25182 | struct xfrm_tmpl xfrm_vec[6]; | |
25183 | }; | |
25184 | # 375 "include/net/xfrm.h" | |
25185 | struct xfrm_mgr | |
25186 | { | |
25187 | struct list_head list; | |
25188 | char *id; | |
25189 | int (*notify)(struct xfrm_state *x, struct km_event *c); | |
25190 | int (*acquire)(struct xfrm_state *x, struct xfrm_tmpl *, struct xfrm_policy *xp, int dir); | |
25191 | struct xfrm_policy *(*compile_policy)(struct sock *sk, int opt, u8 *data, int len, int *dir); | |
25192 | int (*new_mapping)(struct xfrm_state *x, xfrm_address_t *ipaddr, u16 sport); | |
25193 | int (*notify_policy)(struct xfrm_policy *x, int dir, struct km_event *c); | |
25194 | int (*report)(u8 proto, struct xfrm_selector *sel, xfrm_address_t *addr); | |
25195 | }; | |
25196 | ||
25197 | extern int xfrm_register_km(struct xfrm_mgr *km); | |
25198 | extern int xfrm_unregister_km(struct xfrm_mgr *km); | |
25199 | ||
25200 | extern unsigned int xfrm_policy_count[XFRM_POLICY_MAX*2]; | |
25201 | ||
25202 | static inline __attribute__((always_inline)) void xfrm_pol_hold(struct xfrm_policy *policy) | |
25203 | { | |
25204 | if (__builtin_expect(!!(policy != ((void *)0)), 1)) | |
25205 | atomic_inc(&policy->refcnt); | |
25206 | } | |
25207 | ||
25208 | extern void __xfrm_policy_destroy(struct xfrm_policy *policy); | |
25209 | ||
25210 | static inline __attribute__((always_inline)) void xfrm_pol_put(struct xfrm_policy *policy) | |
25211 | { | |
25212 | if ((atomic_sub_return(1, (&policy->refcnt)) == 0)) | |
25213 | __xfrm_policy_destroy(policy); | |
25214 | } | |
25215 | # 414 "include/net/xfrm.h" | |
25216 | static inline __attribute__((always_inline)) void xfrm_pols_put(struct xfrm_policy **pols, int npols) | |
25217 | { | |
25218 | xfrm_pol_put(pols[0]); | |
25219 | } | |
25220 | ||
25221 | ||
25222 | extern void __xfrm_state_destroy(struct xfrm_state *); | |
25223 | ||
25224 | static inline __attribute__((always_inline)) void __xfrm_state_put(struct xfrm_state *x) | |
25225 | { | |
25226 | atomic_dec(&x->refcnt); | |
25227 | } | |
25228 | ||
25229 | static inline __attribute__((always_inline)) void xfrm_state_put(struct xfrm_state *x) | |
25230 | { | |
25231 | if ((atomic_sub_return(1, (&x->refcnt)) == 0)) | |
25232 | __xfrm_state_destroy(x); | |
25233 | } | |
25234 | ||
25235 | static inline __attribute__((always_inline)) void xfrm_state_hold(struct xfrm_state *x) | |
25236 | { | |
25237 | atomic_inc(&x->refcnt); | |
25238 | } | |
25239 | ||
25240 | static __inline__ __attribute__((always_inline)) int addr_match(void *token1, void *token2, int prefixlen) | |
25241 | { | |
25242 | __be32 *a1 = token1; | |
25243 | __be32 *a2 = token2; | |
25244 | int pdw; | |
25245 | int pbi; | |
25246 | ||
25247 | pdw = prefixlen >> 5; | |
25248 | pbi = prefixlen & 0x1f; | |
25249 | ||
25250 | if (pdw) | |
25251 | if (memcmp(a1, a2, pdw << 2)) | |
25252 | return 0; | |
25253 | ||
25254 | if (pbi) { | |
25255 | __be32 mask; | |
25256 | ||
25257 | mask = htonl((0xffffffff) << (32 - pbi)); | |
25258 | ||
25259 | if ((a1[pdw] ^ a2[pdw]) & mask) | |
25260 | return 0; | |
25261 | } | |
25262 | ||
25263 | return 1; | |
25264 | } | |
25265 | ||
25266 | static __inline__ __attribute__((always_inline)) | |
25267 | __be16 xfrm_flowi_sport(struct flowi *fl) | |
25268 | { | |
25269 | __be16 port; | |
25270 | switch(fl->proto) { | |
25271 | case IPPROTO_TCP: | |
25272 | case IPPROTO_UDP: | |
25273 | case IPPROTO_SCTP: | |
25274 | port = fl->uli_u.ports.sport; | |
25275 | break; | |
25276 | case IPPROTO_ICMP: | |
25277 | case 58: | |
25278 | port = htons(fl->uli_u.icmpt.type); | |
25279 | break; | |
25280 | ||
25281 | ||
25282 | ||
25283 | ||
25284 | ||
25285 | default: | |
25286 | port = 0; | |
25287 | } | |
25288 | return port; | |
25289 | } | |
25290 | ||
25291 | static __inline__ __attribute__((always_inline)) | |
25292 | __be16 xfrm_flowi_dport(struct flowi *fl) | |
25293 | { | |
25294 | __be16 port; | |
25295 | switch(fl->proto) { | |
25296 | case IPPROTO_TCP: | |
25297 | case IPPROTO_UDP: | |
25298 | case IPPROTO_SCTP: | |
25299 | port = fl->uli_u.ports.dport; | |
25300 | break; | |
25301 | case IPPROTO_ICMP: | |
25302 | case 58: | |
25303 | port = htons(fl->uli_u.icmpt.code); | |
25304 | break; | |
25305 | default: | |
25306 | port = 0; | |
25307 | } | |
25308 | return port; | |
25309 | } | |
25310 | ||
25311 | static inline __attribute__((always_inline)) int | |
25312 | __xfrm4_selector_match(struct xfrm_selector *sel, struct flowi *fl) | |
25313 | { | |
25314 | return addr_match(&fl->nl_u.ip4_u.daddr, &sel->daddr, sel->prefixlen_d) && | |
25315 | addr_match(&fl->nl_u.ip4_u.saddr, &sel->saddr, sel->prefixlen_s) && | |
25316 | !((xfrm_flowi_dport(fl) ^ sel->dport) & sel->dport_mask) && | |
25317 | !((xfrm_flowi_sport(fl) ^ sel->sport) & sel->sport_mask) && | |
25318 | (fl->proto == sel->proto || !sel->proto) && | |
25319 | (fl->oif == sel->ifindex || !sel->ifindex); | |
25320 | } | |
25321 | ||
25322 | static inline __attribute__((always_inline)) int | |
25323 | __xfrm6_selector_match(struct xfrm_selector *sel, struct flowi *fl) | |
25324 | { | |
25325 | return addr_match(&fl->nl_u.ip6_u.daddr, &sel->daddr, sel->prefixlen_d) && | |
25326 | addr_match(&fl->nl_u.ip6_u.saddr, &sel->saddr, sel->prefixlen_s) && | |
25327 | !((xfrm_flowi_dport(fl) ^ sel->dport) & sel->dport_mask) && | |
25328 | !((xfrm_flowi_sport(fl) ^ sel->sport) & sel->sport_mask) && | |
25329 | (fl->proto == sel->proto || !sel->proto) && | |
25330 | (fl->oif == sel->ifindex || !sel->ifindex); | |
25331 | } | |
25332 | ||
25333 | static inline __attribute__((always_inline)) int | |
25334 | xfrm_selector_match(struct xfrm_selector *sel, struct flowi *fl, | |
25335 | unsigned short family) | |
25336 | { | |
25337 | switch (family) { | |
25338 | case 2: | |
25339 | return __xfrm4_selector_match(sel, fl); | |
25340 | case 10: | |
25341 | return __xfrm6_selector_match(sel, fl); | |
25342 | } | |
25343 | return 0; | |
25344 | } | |
25345 | # 557 "include/net/xfrm.h" | |
25346 | static inline __attribute__((always_inline)) int xfrm_sec_ctx_match(struct xfrm_sec_ctx *s1, struct xfrm_sec_ctx *s2) | |
25347 | { | |
25348 | return 1; | |
25349 | } | |
25350 | # 574 "include/net/xfrm.h" | |
25351 | struct xfrm_dst | |
25352 | { | |
25353 | union { | |
25354 | struct xfrm_dst *next; | |
25355 | struct dst_entry dst; | |
25356 | struct rtable rt; | |
25357 | struct rt6_info rt6; | |
25358 | } u; | |
25359 | struct dst_entry *route; | |
25360 | u32 genid; | |
25361 | u32 route_mtu_cached; | |
25362 | u32 child_mtu_cached; | |
25363 | u32 route_cookie; | |
25364 | u32 path_cookie; | |
25365 | }; | |
25366 | ||
25367 | static inline __attribute__((always_inline)) void xfrm_dst_destroy(struct xfrm_dst *xdst) | |
25368 | { | |
25369 | dst_release(xdst->route); | |
25370 | if (__builtin_expect(!!(xdst->u.dst.xfrm), 1)) | |
25371 | xfrm_state_put(xdst->u.dst.xfrm); | |
25372 | } | |
25373 | ||
25374 | extern void xfrm_dst_ifdown(struct dst_entry *dst, struct net_device *dev); | |
25375 | ||
25376 | struct sec_path | |
25377 | { | |
25378 | atomic_t refcnt; | |
25379 | int len; | |
25380 | struct xfrm_state *xvec[6]; | |
25381 | }; | |
25382 | ||
25383 | static inline __attribute__((always_inline)) struct sec_path * | |
25384 | secpath_get(struct sec_path *sp) | |
25385 | { | |
25386 | if (sp) | |
25387 | atomic_inc(&sp->refcnt); | |
25388 | return sp; | |
25389 | } | |
25390 | ||
25391 | extern void __secpath_destroy(struct sec_path *sp); | |
25392 | ||
25393 | static inline __attribute__((always_inline)) void | |
25394 | secpath_put(struct sec_path *sp) | |
25395 | { | |
25396 | if (sp && (atomic_sub_return(1, (&sp->refcnt)) == 0)) | |
25397 | __secpath_destroy(sp); | |
25398 | } | |
25399 | ||
25400 | extern struct sec_path *secpath_dup(struct sec_path *src); | |
25401 | ||
25402 | static inline __attribute__((always_inline)) void | |
25403 | secpath_reset(struct sk_buff *skb) | |
25404 | { | |
25405 | ||
25406 | ||
25407 | ||
25408 | ||
25409 | } | |
25410 | ||
25411 | static inline __attribute__((always_inline)) int | |
25412 | xfrm_addr_any(xfrm_address_t *addr, unsigned short family) | |
25413 | { | |
25414 | switch (family) { | |
25415 | case 2: | |
25416 | return addr->a4 == 0; | |
25417 | case 10: | |
25418 | return ipv6_addr_any((struct in6_addr *)&addr->a6); | |
25419 | } | |
25420 | return 0; | |
25421 | } | |
25422 | ||
25423 | static inline __attribute__((always_inline)) int | |
25424 | __xfrm4_state_addr_cmp(struct xfrm_tmpl *tmpl, struct xfrm_state *x) | |
25425 | { | |
25426 | return (tmpl->saddr.a4 && | |
25427 | tmpl->saddr.a4 != x->props.saddr.a4); | |
25428 | } | |
25429 | ||
25430 | static inline __attribute__((always_inline)) int | |
25431 | __xfrm6_state_addr_cmp(struct xfrm_tmpl *tmpl, struct xfrm_state *x) | |
25432 | { | |
25433 | return (!ipv6_addr_any((struct in6_addr*)&tmpl->saddr) && | |
25434 | ipv6_addr_cmp((struct in6_addr *)&tmpl->saddr, (struct in6_addr*)&x->props.saddr)); | |
25435 | } | |
25436 | ||
25437 | static inline __attribute__((always_inline)) int | |
25438 | xfrm_state_addr_cmp(struct xfrm_tmpl *tmpl, struct xfrm_state *x, unsigned short family) | |
25439 | { | |
25440 | switch (family) { | |
25441 | case 2: | |
25442 | return __xfrm4_state_addr_cmp(tmpl, x); | |
25443 | case 10: | |
25444 | return __xfrm6_state_addr_cmp(tmpl, x); | |
25445 | } | |
25446 | return !0; | |
25447 | } | |
25448 | # 741 "include/net/xfrm.h" | |
25449 | static inline __attribute__((always_inline)) void xfrm_sk_free_policy(struct sock *sk) {} | |
25450 | static inline __attribute__((always_inline)) int xfrm_sk_clone_policy(struct sock *sk) { return 0; } | |
25451 | static inline __attribute__((always_inline)) int xfrm6_route_forward(struct sk_buff *skb) { return 1; } | |
25452 | static inline __attribute__((always_inline)) int xfrm4_route_forward(struct sk_buff *skb) { return 1; } | |
25453 | static inline __attribute__((always_inline)) int xfrm6_policy_check(struct sock *sk, int dir, struct sk_buff *skb) | |
25454 | { | |
25455 | return 1; | |
25456 | } | |
25457 | static inline __attribute__((always_inline)) int xfrm4_policy_check(struct sock *sk, int dir, struct sk_buff *skb) | |
25458 | { | |
25459 | return 1; | |
25460 | } | |
25461 | static inline __attribute__((always_inline)) int xfrm_policy_check(struct sock *sk, int dir, struct sk_buff *skb, unsigned short family) | |
25462 | { | |
25463 | return 1; | |
25464 | } | |
25465 | ||
25466 | ||
25467 | static __inline__ __attribute__((always_inline)) | |
25468 | xfrm_address_t *xfrm_flowi_daddr(struct flowi *fl, unsigned short family) | |
25469 | { | |
25470 | switch (family){ | |
25471 | case 2: | |
25472 | return (xfrm_address_t *)&fl->nl_u.ip4_u.daddr; | |
25473 | case 10: | |
25474 | return (xfrm_address_t *)&fl->nl_u.ip6_u.daddr; | |
25475 | } | |
25476 | return ((void *)0); | |
25477 | } | |
25478 | ||
25479 | static __inline__ __attribute__((always_inline)) | |
25480 | xfrm_address_t *xfrm_flowi_saddr(struct flowi *fl, unsigned short family) | |
25481 | { | |
25482 | switch (family){ | |
25483 | case 2: | |
25484 | return (xfrm_address_t *)&fl->nl_u.ip4_u.saddr; | |
25485 | case 10: | |
25486 | return (xfrm_address_t *)&fl->nl_u.ip6_u.saddr; | |
25487 | } | |
25488 | return ((void *)0); | |
25489 | } | |
25490 | ||
25491 | static __inline__ __attribute__((always_inline)) int | |
25492 | __xfrm4_state_addr_check(struct xfrm_state *x, | |
25493 | xfrm_address_t *daddr, xfrm_address_t *saddr) | |
25494 | { | |
25495 | if (daddr->a4 == x->id.daddr.a4 && | |
25496 | (saddr->a4 == x->props.saddr.a4 || !saddr->a4 || !x->props.saddr.a4)) | |
25497 | return 1; | |
25498 | return 0; | |
25499 | } | |
25500 | ||
25501 | static __inline__ __attribute__((always_inline)) int | |
25502 | __xfrm6_state_addr_check(struct xfrm_state *x, | |
25503 | xfrm_address_t *daddr, xfrm_address_t *saddr) | |
25504 | { | |
25505 | if (!ipv6_addr_cmp((struct in6_addr *)daddr, (struct in6_addr *)&x->id.daddr) && | |
25506 | (!ipv6_addr_cmp((struct in6_addr *)saddr, (struct in6_addr *)&x->props.saddr)|| | |
25507 | ipv6_addr_any((struct in6_addr *)saddr) || | |
25508 | ipv6_addr_any((struct in6_addr *)&x->props.saddr))) | |
25509 | return 1; | |
25510 | return 0; | |
25511 | } | |
25512 | ||
25513 | static __inline__ __attribute__((always_inline)) int | |
25514 | xfrm_state_addr_check(struct xfrm_state *x, | |
25515 | xfrm_address_t *daddr, xfrm_address_t *saddr, | |
25516 | unsigned short family) | |
25517 | { | |
25518 | switch (family) { | |
25519 | case 2: | |
25520 | return __xfrm4_state_addr_check(x, daddr, saddr); | |
25521 | case 10: | |
25522 | return __xfrm6_state_addr_check(x, daddr, saddr); | |
25523 | } | |
25524 | return 0; | |
25525 | } | |
25526 | ||
25527 | static __inline__ __attribute__((always_inline)) int | |
25528 | xfrm_state_addr_flow_check(struct xfrm_state *x, struct flowi *fl, | |
25529 | unsigned short family) | |
25530 | { | |
25531 | switch (family) { | |
25532 | case 2: | |
25533 | return __xfrm4_state_addr_check(x, | |
25534 | (xfrm_address_t *)&fl->nl_u.ip4_u.daddr, | |
25535 | (xfrm_address_t *)&fl->nl_u.ip4_u.saddr); | |
25536 | case 10: | |
25537 | return __xfrm6_state_addr_check(x, | |
25538 | (xfrm_address_t *)&fl->nl_u.ip6_u.daddr, | |
25539 | (xfrm_address_t *)&fl->nl_u.ip6_u.saddr); | |
25540 | } | |
25541 | return 0; | |
25542 | } | |
25543 | ||
25544 | static inline __attribute__((always_inline)) int xfrm_state_kern(struct xfrm_state *x) | |
25545 | { | |
25546 | return ((&x->tunnel_users)->counter); | |
25547 | } | |
25548 | ||
25549 | static inline __attribute__((always_inline)) int xfrm_id_proto_match(u8 proto, u8 userproto) | |
25550 | { | |
25551 | return (!userproto || proto == userproto || | |
25552 | (userproto == 255 && (proto == IPPROTO_AH || | |
25553 | proto == IPPROTO_ESP || | |
25554 | proto == IPPROTO_COMP))); | |
25555 | } | |
25556 | ||
25557 | ||
25558 | ||
25559 | ||
25560 | struct xfrm_algo_auth_info { | |
25561 | u16 icv_truncbits; | |
25562 | u16 icv_fullbits; | |
25563 | }; | |
25564 | ||
25565 | struct xfrm_algo_encr_info { | |
25566 | u16 blockbits; | |
25567 | u16 defkeybits; | |
25568 | }; | |
25569 | ||
25570 | struct xfrm_algo_comp_info { | |
25571 | u16 threshold; | |
25572 | }; | |
25573 | ||
25574 | struct xfrm_algo_desc { | |
25575 | char *name; | |
25576 | char *compat; | |
25577 | u8 available:1; | |
25578 | union { | |
25579 | struct xfrm_algo_auth_info auth; | |
25580 | struct xfrm_algo_encr_info encr; | |
25581 | struct xfrm_algo_comp_info comp; | |
25582 | } uinfo; | |
25583 | struct sadb_alg desc; | |
25584 | }; | |
25585 | ||
25586 | ||
25587 | struct xfrm_tunnel { | |
25588 | int (*handler)(struct sk_buff *skb); | |
25589 | int (*err_handler)(struct sk_buff *skb, __u32 info); | |
25590 | ||
25591 | struct xfrm_tunnel *next; | |
25592 | int priority; | |
25593 | }; | |
25594 | ||
25595 | struct xfrm6_tunnel { | |
25596 | int (*handler)(struct sk_buff *skb); | |
25597 | int (*err_handler)(struct sk_buff *skb, struct inet6_skb_parm *opt, | |
25598 | int type, int code, int offset, __u32 info); | |
25599 | ||
25600 | struct xfrm6_tunnel *next; | |
25601 | int priority; | |
25602 | }; | |
25603 | ||
25604 | extern void xfrm_init(void); | |
25605 | extern void xfrm4_init(void); | |
25606 | extern void xfrm6_init(void); | |
25607 | extern void xfrm6_fini(void); | |
25608 | extern void xfrm_state_init(void); | |
25609 | extern void xfrm4_state_init(void); | |
25610 | extern void xfrm6_state_init(void); | |
25611 | extern void xfrm6_state_fini(void); | |
25612 | ||
25613 | extern int xfrm_state_walk(u8 proto, int (*func)(struct xfrm_state *, int, void*), void *); | |
25614 | extern struct xfrm_state *xfrm_state_alloc(void); | |
25615 | extern struct xfrm_state *xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t *saddr, | |
25616 | struct flowi *fl, struct xfrm_tmpl *tmpl, | |
25617 | struct xfrm_policy *pol, int *err, | |
25618 | unsigned short family); | |
25619 | extern int xfrm_state_check_expire(struct xfrm_state *x); | |
25620 | extern void xfrm_state_insert(struct xfrm_state *x); | |
25621 | extern int xfrm_state_add(struct xfrm_state *x); | |
25622 | extern int xfrm_state_update(struct xfrm_state *x); | |
25623 | extern struct xfrm_state *xfrm_state_lookup(xfrm_address_t *daddr, __be32 spi, u8 proto, unsigned short family); | |
25624 | extern struct xfrm_state *xfrm_state_lookup_byaddr(xfrm_address_t *daddr, xfrm_address_t *saddr, u8 proto, unsigned short family); | |
25625 | ||
25626 | ||
25627 | ||
25628 | ||
25629 | ||
25630 | ||
25631 | static inline __attribute__((always_inline)) int xfrm_tmpl_sort(struct xfrm_tmpl **dst, struct xfrm_tmpl **src, | |
25632 | int n, unsigned short family) | |
25633 | { | |
25634 | return -38; | |
25635 | } | |
25636 | ||
25637 | static inline __attribute__((always_inline)) int xfrm_state_sort(struct xfrm_state **dst, struct xfrm_state **src, | |
25638 | int n, unsigned short family) | |
25639 | { | |
25640 | return -38; | |
25641 | } | |
25642 | ||
25643 | extern struct xfrm_state *xfrm_find_acq_byseq(u32 seq); | |
25644 | extern int xfrm_state_delete(struct xfrm_state *x); | |
25645 | extern void xfrm_state_flush(u8 proto); | |
25646 | extern int xfrm_replay_check(struct xfrm_state *x, __be32 seq); | |
25647 | extern void xfrm_replay_advance(struct xfrm_state *x, __be32 seq); | |
25648 | extern void xfrm_replay_notify(struct xfrm_state *x, int event); | |
25649 | extern int xfrm_state_check(struct xfrm_state *x, struct sk_buff *skb); | |
25650 | extern int xfrm_state_mtu(struct xfrm_state *x, int mtu); | |
25651 | extern int xfrm_init_state(struct xfrm_state *x); | |
25652 | extern int xfrm4_rcv(struct sk_buff *skb); | |
25653 | extern int xfrm4_output(struct sk_buff *skb); | |
25654 | extern int xfrm4_tunnel_register(struct xfrm_tunnel *handler); | |
25655 | extern int xfrm4_tunnel_deregister(struct xfrm_tunnel *handler); | |
25656 | extern int xfrm6_rcv_spi(struct sk_buff *skb, __be32 spi); | |
25657 | extern int xfrm6_rcv(struct sk_buff **pskb); | |
25658 | extern int xfrm6_input_addr(struct sk_buff *skb, xfrm_address_t *daddr, | |
25659 | xfrm_address_t *saddr, u8 proto); | |
25660 | extern int xfrm6_tunnel_register(struct xfrm6_tunnel *handler); | |
25661 | extern int xfrm6_tunnel_deregister(struct xfrm6_tunnel *handler); | |
25662 | extern u32 xfrm6_tunnel_alloc_spi(xfrm_address_t *saddr); | |
25663 | extern void xfrm6_tunnel_free_spi(xfrm_address_t *saddr); | |
25664 | extern u32 xfrm6_tunnel_spi_lookup(xfrm_address_t *saddr); | |
25665 | extern int xfrm6_output(struct sk_buff *skb); | |
25666 | extern int xfrm6_find_1stfragopt(struct xfrm_state *x, struct sk_buff *skb, | |
25667 | u8 **prevhdr); | |
25668 | ||
25669 | ||
25670 | ||
25671 | ||
25672 | ||
25673 | ||
25674 | static inline __attribute__((always_inline)) int xfrm_user_policy(struct sock *sk, int optname, u8 *optval, int optlen) | |
25675 | { | |
25676 | return -92; | |
25677 | } | |
25678 | ||
25679 | static inline __attribute__((always_inline)) int xfrm4_rcv_encap(struct sk_buff *skb, __u16 encap_type) | |
25680 | { | |
25681 | ||
25682 | kfree_skb(skb); | |
25683 | return 0; | |
25684 | } | |
25685 | static inline __attribute__((always_inline)) int xfrm_dst_lookup(struct xfrm_dst **dst, struct flowi *fl, unsigned short family) | |
25686 | { | |
25687 | return -22; | |
25688 | } | |
25689 | ||
25690 | ||
25691 | struct xfrm_policy *xfrm_policy_alloc(gfp_t gfp); | |
25692 | extern int xfrm_policy_walk(u8 type, int (*func)(struct xfrm_policy *, int, int, void*), void *); | |
25693 | int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl); | |
25694 | struct xfrm_policy *xfrm_policy_bysel_ctx(u8 type, int dir, | |
25695 | struct xfrm_selector *sel, | |
25696 | struct xfrm_sec_ctx *ctx, int delete); | |
25697 | struct xfrm_policy *xfrm_policy_byid(u8, int dir, u32 id, int delete); | |
25698 | void xfrm_policy_flush(u8 type); | |
25699 | u32 xfrm_get_acqseq(void); | |
25700 | void xfrm_alloc_spi(struct xfrm_state *x, __be32 minspi, __be32 maxspi); | |
25701 | struct xfrm_state * xfrm_find_acq(u8 mode, u32 reqid, u8 proto, | |
25702 | xfrm_address_t *daddr, xfrm_address_t *saddr, | |
25703 | int create, unsigned short family); | |
25704 | extern void xfrm_policy_flush(u8 type); | |
25705 | extern int xfrm_sk_policy_insert(struct sock *sk, int dir, struct xfrm_policy *pol); | |
25706 | extern int xfrm_bundle_ok(struct xfrm_policy *pol, struct xfrm_dst *xdst, | |
25707 | struct flowi *fl, int family, int strict); | |
25708 | extern void xfrm_init_pmtu(struct dst_entry *dst); | |
25709 | ||
25710 | extern wait_queue_head_t km_waitq; | |
25711 | extern int km_new_mapping(struct xfrm_state *x, xfrm_address_t *ipaddr, u16 sport); | |
25712 | extern void km_policy_expired(struct xfrm_policy *pol, int dir, int hard, u32 pid); | |
25713 | extern int km_report(u8 proto, struct xfrm_selector *sel, xfrm_address_t *addr); | |
25714 | ||
25715 | extern void xfrm_input_init(void); | |
25716 | extern int xfrm_parse_spi(struct sk_buff *skb, u8 nexthdr, __be32 *spi, __be32 *seq); | |
25717 | ||
25718 | extern void xfrm_probe_algs(void); | |
25719 | extern int xfrm_count_auth_supported(void); | |
25720 | extern int xfrm_count_enc_supported(void); | |
25721 | extern struct xfrm_algo_desc *xfrm_aalg_get_byidx(unsigned int idx); | |
25722 | extern struct xfrm_algo_desc *xfrm_ealg_get_byidx(unsigned int idx); | |
25723 | extern struct xfrm_algo_desc *xfrm_aalg_get_byid(int alg_id); | |
25724 | extern struct xfrm_algo_desc *xfrm_ealg_get_byid(int alg_id); | |
25725 | extern struct xfrm_algo_desc *xfrm_calg_get_byid(int alg_id); | |
25726 | extern struct xfrm_algo_desc *xfrm_aalg_get_byname(char *name, int probe); | |
25727 | extern struct xfrm_algo_desc *xfrm_ealg_get_byname(char *name, int probe); | |
25728 | extern struct xfrm_algo_desc *xfrm_calg_get_byname(char *name, int probe); | |
25729 | ||
25730 | struct hash_desc; | |
25731 | struct scatterlist; | |
25732 | typedef int (icv_update_fn_t)(struct hash_desc *, struct scatterlist *, | |
25733 | unsigned int); | |
25734 | ||
25735 | extern int skb_icv_walk(const struct sk_buff *skb, struct hash_desc *tfm, | |
25736 | int offset, int len, icv_update_fn_t icv_update); | |
25737 | ||
25738 | static inline __attribute__((always_inline)) int xfrm_addr_cmp(xfrm_address_t *a, xfrm_address_t *b, | |
25739 | int family) | |
25740 | { | |
25741 | switch (family) { | |
25742 | default: | |
25743 | case 2: | |
25744 | return a->a4 - b->a4; | |
25745 | case 10: | |
25746 | return ipv6_addr_cmp((struct in6_addr *)a, | |
25747 | (struct in6_addr *)b); | |
25748 | } | |
25749 | } | |
25750 | ||
25751 | static inline __attribute__((always_inline)) int xfrm_policy_id2dir(u32 index) | |
25752 | { | |
25753 | return index & 7; | |
25754 | } | |
25755 | ||
25756 | static inline __attribute__((always_inline)) int xfrm_aevent_is_on(void) | |
25757 | { | |
25758 | struct sock *nlsk; | |
25759 | int ret = 0; | |
25760 | ||
25761 | do { do { } while (0); (void)0; } while(0); | |
25762 | nlsk = ({ typeof(xfrm_nl) _________p1 = xfrm_nl; do { } while(0); (_________p1); }); | |
25763 | if (nlsk) | |
25764 | ret = netlink_has_listeners(nlsk, XFRMNLGRP_AEVENTS); | |
25765 | do { (void)0; do { } while (0); } while(0); | |
25766 | return ret; | |
25767 | } | |
25768 | ||
25769 | static inline __attribute__((always_inline)) void xfrm_aevent_doreplay(struct xfrm_state *x) | |
25770 | { | |
25771 | if (xfrm_aevent_is_on()) | |
25772 | xfrm_replay_notify(x, XFRM_AE_CR); | |
25773 | } | |
25774 | # 72 "net/ipv4/ip_output.c" 2 | |
25775 | ||
25776 | ||
25777 | # 1 "include/net/arp.h" 1 | |
25778 | ||
25779 | ||
25780 | ||
25781 | ||
25782 | # 1 "include/linux/if_arp.h" 1 | |
25783 | # 103 "include/linux/if_arp.h" | |
25784 | struct arpreq { | |
25785 | struct sockaddr arp_pa; | |
25786 | struct sockaddr arp_ha; | |
25787 | int arp_flags; | |
25788 | struct sockaddr arp_netmask; | |
25789 | char arp_dev[16]; | |
25790 | }; | |
25791 | ||
25792 | struct arpreq_old { | |
25793 | struct sockaddr arp_pa; | |
25794 | struct sockaddr arp_ha; | |
25795 | int arp_flags; | |
25796 | struct sockaddr arp_netmask; | |
25797 | }; | |
25798 | # 131 "include/linux/if_arp.h" | |
25799 | struct arphdr | |
25800 | { | |
25801 | __be16 ar_hrd; | |
25802 | __be16 ar_pro; | |
25803 | unsigned char ar_hln; | |
25804 | unsigned char ar_pln; | |
25805 | __be16 ar_op; | |
25806 | # 149 "include/linux/if_arp.h" | |
25807 | }; | |
25808 | # 6 "include/net/arp.h" 2 | |
25809 | ||
25810 | ||
25811 | ||
25812 | ||
25813 | extern struct neigh_table arp_tbl; | |
25814 | ||
25815 | extern void arp_init(void); | |
25816 | extern int arp_find(unsigned char *haddr, struct sk_buff *skb); | |
25817 | extern int arp_ioctl(unsigned int cmd, void *arg); | |
25818 | extern void arp_send(int type, int ptype, __be32 dest_ip, | |
25819 | struct net_device *dev, __be32 src_ip, | |
25820 | unsigned char *dest_hw, unsigned char *src_hw, unsigned char *th); | |
25821 | extern int arp_bind_neighbour(struct dst_entry *dst); | |
25822 | extern int arp_mc_map(u32 addr, u8 *haddr, struct net_device *dev, int dir); | |
25823 | extern void arp_ifdown(struct net_device *dev); | |
25824 | ||
25825 | extern struct sk_buff *arp_create(int type, int ptype, __be32 dest_ip, | |
25826 | struct net_device *dev, __be32 src_ip, | |
25827 | unsigned char *dest_hw, unsigned char *src_hw, | |
25828 | unsigned char *target_hw); | |
25829 | extern void arp_xmit(struct sk_buff *skb); | |
25830 | ||
25831 | extern struct neigh_ops arp_broken_ops; | |
25832 | # 75 "net/ipv4/ip_output.c" 2 | |
25833 | # 1 "include/net/icmp.h" 1 | |
25834 | # 21 "include/net/icmp.h" | |
25835 | # 1 "include/linux/icmp.h" 1 | |
25836 | # 68 "include/linux/icmp.h" | |
25837 | struct icmphdr { | |
25838 | __u8 type; | |
25839 | __u8 code; | |
25840 | __be16 checksum; | |
25841 | union { | |
25842 | struct { | |
25843 | __be16 id; | |
25844 | __be16 sequence; | |
25845 | } echo; | |
25846 | __be32 gateway; | |
25847 | struct { | |
25848 | __be16 __unused; | |
25849 | __be16 mtu; | |
25850 | } frag; | |
25851 | } un; | |
25852 | }; | |
25853 | ||
25854 | ||
25855 | ||
25856 | ||
25857 | ||
25858 | ||
25859 | ||
25860 | struct icmp_filter { | |
25861 | __u32 data; | |
25862 | }; | |
25863 | # 22 "include/net/icmp.h" 2 | |
25864 | ||
25865 | ||
25866 | ||
25867 | ||
25868 | struct icmp_err { | |
25869 | int errno; | |
25870 | unsigned fatal:1; | |
25871 | }; | |
25872 | ||
25873 | extern struct icmp_err icmp_err_convert[]; | |
25874 | extern __typeof__(struct icmp_mib) *icmp_statistics[2]; | |
25875 | ||
25876 | ||
25877 | ||
25878 | ||
25879 | struct dst_entry; | |
25880 | struct net_proto_family; | |
25881 | struct sk_buff; | |
25882 | ||
25883 | extern void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info); | |
25884 | extern int icmp_rcv(struct sk_buff *skb); | |
25885 | extern int icmp_ioctl(struct sock *sk, int cmd, unsigned long arg); | |
25886 | extern void icmp_init(struct net_proto_family *ops); | |
25887 | ||
25888 | ||
25889 | extern int xrlim_allow(struct dst_entry *dst, int timeout); | |
25890 | ||
25891 | struct raw_sock { | |
25892 | ||
25893 | struct inet_sock inet; | |
25894 | struct icmp_filter filter; | |
25895 | }; | |
25896 | ||
25897 | static inline __attribute__((always_inline)) struct raw_sock *raw_sk(const struct sock *sk) | |
25898 | { | |
25899 | return (struct raw_sock *)sk; | |
25900 | } | |
25901 | ||
25902 | extern int sysctl_icmp_echo_ignore_all; | |
25903 | extern int sysctl_icmp_echo_ignore_broadcasts; | |
25904 | extern int sysctl_icmp_ignore_bogus_error_responses; | |
25905 | extern int sysctl_icmp_errors_use_inbound_ifaddr; | |
25906 | extern int sysctl_icmp_ratelimit; | |
25907 | extern int sysctl_icmp_ratemask; | |
25908 | # 76 "net/ipv4/ip_output.c" 2 | |
25909 | ||
25910 | ||
25911 | ||
25912 | # 1 "include/linux/igmp.h" 1 | |
25913 | # 29 "include/linux/igmp.h" | |
25914 | struct igmphdr | |
25915 | { | |
25916 | __u8 type; | |
25917 | __u8 code; | |
25918 | __be16 csum; | |
25919 | __be32 group; | |
25920 | }; | |
25921 | # 45 "include/linux/igmp.h" | |
25922 | struct igmpv3_grec { | |
25923 | __u8 grec_type; | |
25924 | __u8 grec_auxwords; | |
25925 | __be16 grec_nsrcs; | |
25926 | __be32 grec_mca; | |
25927 | __be32 grec_src[0]; | |
25928 | }; | |
25929 | ||
25930 | struct igmpv3_report { | |
25931 | __u8 type; | |
25932 | __u8 resv1; | |
25933 | __be16 csum; | |
25934 | __be16 resv2; | |
25935 | __be16 ngrec; | |
25936 | struct igmpv3_grec grec[0]; | |
25937 | }; | |
25938 | ||
25939 | struct igmpv3_query { | |
25940 | __u8 type; | |
25941 | __u8 code; | |
25942 | __be16 csum; | |
25943 | __be32 group; | |
25944 | ||
25945 | __u8 qrv:3, | |
25946 | suppress:1, | |
25947 | resv:4; | |
25948 | ||
25949 | ||
25950 | ||
25951 | ||
25952 | ||
25953 | ||
25954 | ||
25955 | __u8 qqic; | |
25956 | __be16 nsrcs; | |
25957 | __be32 srcs[0]; | |
25958 | }; | |
25959 | # 132 "include/linux/igmp.h" | |
25960 | extern int sysctl_igmp_max_memberships; | |
25961 | extern int sysctl_igmp_max_msf; | |
25962 | ||
25963 | struct ip_sf_socklist | |
25964 | { | |
25965 | unsigned int sl_max; | |
25966 | unsigned int sl_count; | |
25967 | __be32 sl_addr[0]; | |
25968 | }; | |
25969 | # 151 "include/linux/igmp.h" | |
25970 | struct ip_mc_socklist | |
25971 | { | |
25972 | struct ip_mc_socklist *next; | |
25973 | struct ip_mreqn multi; | |
25974 | unsigned int sfmode; | |
25975 | struct ip_sf_socklist *sflist; | |
25976 | }; | |
25977 | ||
25978 | struct ip_sf_list | |
25979 | { | |
25980 | struct ip_sf_list *sf_next; | |
25981 | __be32 sf_inaddr; | |
25982 | unsigned long sf_count[2]; | |
25983 | unsigned char sf_gsresp; | |
25984 | unsigned char sf_oldin; | |
25985 | unsigned char sf_crcount; | |
25986 | }; | |
25987 | ||
25988 | struct ip_mc_list | |
25989 | { | |
25990 | struct in_device *interface; | |
25991 | __be32 multiaddr; | |
25992 | struct ip_sf_list *sources; | |
25993 | struct ip_sf_list *tomb; | |
25994 | unsigned int sfmode; | |
25995 | unsigned long sfcount[2]; | |
25996 | struct ip_mc_list *next; | |
25997 | struct timer_list timer; | |
25998 | int users; | |
25999 | atomic_t refcnt; | |
26000 | spinlock_t lock; | |
26001 | char tm_running; | |
26002 | char reporter; | |
26003 | char unsolicit_count; | |
26004 | char loaded; | |
26005 | unsigned char gsquery; | |
26006 | unsigned char crcount; | |
26007 | }; | |
26008 | # 200 "include/linux/igmp.h" | |
26009 | extern int ip_check_mc(struct in_device *dev, __be32 mc_addr, __be32 src_addr, u16 proto); | |
26010 | extern int igmp_rcv(struct sk_buff *); | |
26011 | extern int ip_mc_join_group(struct sock *sk, struct ip_mreqn *imr); | |
26012 | extern int ip_mc_leave_group(struct sock *sk, struct ip_mreqn *imr); | |
26013 | extern void ip_mc_drop_socket(struct sock *sk); | |
26014 | extern int ip_mc_source(int add, int omode, struct sock *sk, | |
26015 | struct ip_mreq_source *mreqs, int ifindex); | |
26016 | extern int ip_mc_msfilter(struct sock *sk, struct ip_msfilter *msf,int ifindex); | |
26017 | extern int ip_mc_msfget(struct sock *sk, struct ip_msfilter *msf, | |
26018 | struct ip_msfilter *optval, int *optlen); | |
26019 | extern int ip_mc_gsfget(struct sock *sk, struct group_filter *gsf, | |
26020 | struct group_filter *optval, int *optlen); | |
26021 | extern int ip_mc_sf_allow(struct sock *sk, __be32 local, __be32 rmt, int dif); | |
26022 | extern void ip_mr_init(void); | |
26023 | extern void ip_mc_init_dev(struct in_device *); | |
26024 | extern void ip_mc_destroy_dev(struct in_device *); | |
26025 | extern void ip_mc_up(struct in_device *); | |
26026 | extern void ip_mc_down(struct in_device *); | |
26027 | extern void ip_mc_dec_group(struct in_device *in_dev, __be32 addr); | |
26028 | extern void ip_mc_inc_group(struct in_device *in_dev, __be32 addr); | |
26029 | # 80 "net/ipv4/ip_output.c" 2 | |
26030 | # 1 "include/linux/netfilter_ipv4.h" 1 | |
26031 | ||
26032 | ||
26033 | ||
26034 | ||
26035 | ||
26036 | ||
26037 | ||
26038 | # 1 "include/linux/netfilter.h" 1 | |
26039 | # 350 "include/linux/netfilter.h" | |
26040 | static inline __attribute__((always_inline)) int nf_hook_thresh(int pf, unsigned int hook, | |
26041 | struct sk_buff **pskb, | |
26042 | struct net_device *indev, | |
26043 | struct net_device *outdev, | |
26044 | int (*okfn)(struct sk_buff *), int thresh, | |
26045 | int cond) | |
26046 | { | |
26047 | return okfn(*pskb); | |
26048 | } | |
26049 | static inline __attribute__((always_inline)) int nf_hook(int pf, unsigned int hook, struct sk_buff **pskb, | |
26050 | struct net_device *indev, struct net_device *outdev, | |
26051 | int (*okfn)(struct sk_buff *)) | |
26052 | { | |
26053 | return 1; | |
26054 | } | |
26055 | static inline __attribute__((always_inline)) void nf_ct_attach(struct sk_buff *new, struct sk_buff *skb) {} | |
26056 | struct flowi; | |
26057 | static inline __attribute__((always_inline)) void | |
26058 | nf_nat_decode_session(struct sk_buff *skb, struct flowi *fl, int family) {} | |
26059 | # 9 "include/linux/netfilter_ipv4.h" 2 | |
26060 | # 54 "include/linux/netfilter_ipv4.h" | |
26061 | enum nf_ip_hook_priorities { | |
26062 | NF_IP_PRI_FIRST = (-((int)(~0U>>1)) - 1), | |
26063 | NF_IP_PRI_CONNTRACK_DEFRAG = -400, | |
26064 | NF_IP_PRI_RAW = -300, | |
26065 | NF_IP_PRI_SELINUX_FIRST = -225, | |
26066 | NF_IP_PRI_CONNTRACK = -200, | |
26067 | NF_IP_PRI_BRIDGE_SABOTAGE_FORWARD = -175, | |
26068 | NF_IP_PRI_MANGLE = -150, | |
26069 | NF_IP_PRI_NAT_DST = -100, | |
26070 | NF_IP_PRI_BRIDGE_SABOTAGE_LOCAL_OUT = -50, | |
26071 | NF_IP_PRI_FILTER = 0, | |
26072 | NF_IP_PRI_NAT_SRC = 100, | |
26073 | NF_IP_PRI_SELINUX_LAST = 225, | |
26074 | NF_IP_PRI_CONNTRACK_HELPER = ((int)(~0U>>1)) - 2, | |
26075 | NF_IP_PRI_NAT_SEQ_ADJUST = ((int)(~0U>>1)) - 1, | |
26076 | NF_IP_PRI_CONNTRACK_CONFIRM = ((int)(~0U>>1)), | |
26077 | NF_IP_PRI_LAST = ((int)(~0U>>1)), | |
26078 | }; | |
26079 | # 80 "include/linux/netfilter_ipv4.h" | |
26080 | extern int ip_route_me_harder(struct sk_buff **pskb, unsigned addr_type); | |
26081 | extern int ip_xfrm_me_harder(struct sk_buff **pskb); | |
26082 | extern unsigned int nf_ip_checksum(struct sk_buff *skb, unsigned int hook, | |
26083 | unsigned int dataoff, u_int8_t protocol); | |
26084 | # 81 "net/ipv4/ip_output.c" 2 | |
26085 | # 1 "include/linux/netfilter_bridge.h" 1 | |
26086 | # 9 "include/linux/netfilter_bridge.h" | |
26087 | # 1 "include/linux/if_vlan.h" 1 | |
26088 | # 19 "include/linux/if_vlan.h" | |
26089 | struct vlan_group; | |
26090 | struct net_device; | |
26091 | struct packet_type; | |
26092 | struct vlan_collection; | |
26093 | struct vlan_dev_info; | |
26094 | struct hlist_node; | |
26095 | # 42 "include/linux/if_vlan.h" | |
26096 | struct vlan_ethhdr { | |
26097 | unsigned char h_dest[6]; | |
26098 | unsigned char h_source[6]; | |
26099 | __be16 h_vlan_proto; | |
26100 | __be16 h_vlan_TCI; | |
26101 | __be16 h_vlan_encapsulated_proto; | |
26102 | }; | |
26103 | ||
26104 | ||
26105 | ||
26106 | static inline __attribute__((always_inline)) struct vlan_ethhdr *vlan_eth_hdr(const struct sk_buff *skb) | |
26107 | { | |
26108 | return (struct vlan_ethhdr *)skb->mac.raw; | |
26109 | } | |
26110 | ||
26111 | struct vlan_hdr { | |
26112 | __be16 h_vlan_TCI; | |
26113 | __be16 h_vlan_encapsulated_proto; | |
26114 | }; | |
26115 | ||
26116 | ||
26117 | ||
26118 | ||
26119 | extern void vlan_ioctl_set(int (*hook)(void *)); | |
26120 | # 75 "include/linux/if_vlan.h" | |
26121 | struct vlan_group { | |
26122 | int real_dev_ifindex; | |
26123 | struct hlist_node hlist; | |
26124 | struct net_device *vlan_devices[4096]; | |
26125 | struct rcu_head rcu; | |
26126 | }; | |
26127 | ||
26128 | struct vlan_priority_tci_mapping { | |
26129 | unsigned long priority; | |
26130 | unsigned short vlan_qos; | |
26131 | ||
26132 | ||
26133 | ||
26134 | struct vlan_priority_tci_mapping *next; | |
26135 | }; | |
26136 | ||
26137 | ||
26138 | struct vlan_dev_info { | |
26139 | ||
26140 | ||
26141 | ||
26142 | unsigned long ingress_priority_map[8]; | |
26143 | struct vlan_priority_tci_mapping *egress_priority_map[16]; | |
26144 | ||
26145 | unsigned short vlan_id; | |
26146 | unsigned short flags; | |
26147 | ||
26148 | ||
26149 | ||
26150 | ||
26151 | ||
26152 | ||
26153 | ||
26154 | struct dev_mc_list *old_mc_list; | |
26155 | ||
26156 | ||
26157 | ||
26158 | ||
26159 | int old_allmulti; | |
26160 | int old_promiscuity; | |
26161 | struct net_device *real_dev; | |
26162 | struct proc_dir_entry *dent; | |
26163 | unsigned long cnt_inc_headroom_on_tx; | |
26164 | unsigned long cnt_encap_on_xmit; | |
26165 | struct net_device_stats dev_stats; | |
26166 | }; | |
26167 | ||
26168 | ||
26169 | ||
26170 | ||
26171 | ||
26172 | static inline __attribute__((always_inline)) struct net_device_stats *vlan_dev_get_stats(struct net_device *dev) | |
26173 | { | |
26174 | return &(((struct vlan_dev_info *)(dev->priv))->dev_stats); | |
26175 | } | |
26176 | ||
26177 | static inline __attribute__((always_inline)) __u32 vlan_get_ingress_priority(struct net_device *dev, | |
26178 | unsigned short vlan_tag) | |
26179 | { | |
26180 | struct vlan_dev_info *vip = ((struct vlan_dev_info *)(dev->priv)); | |
26181 | ||
26182 | return vip->ingress_priority_map[(vlan_tag >> 13) & 0x7]; | |
26183 | } | |
26184 | ||
26185 | ||
26186 | struct vlan_skb_tx_cookie { | |
26187 | u32 magic; | |
26188 | u32 vlan_tag; | |
26189 | }; | |
26190 | # 152 "include/linux/if_vlan.h" | |
26191 | static inline __attribute__((always_inline)) int __vlan_hwaccel_rx(struct sk_buff *skb, | |
26192 | struct vlan_group *grp, | |
26193 | unsigned short vlan_tag, int polling) | |
26194 | { | |
26195 | struct net_device_stats *stats; | |
26196 | ||
26197 | if (skb_bond_should_drop(skb)) { | |
26198 | dev_kfree_skb_any(skb); | |
26199 | return 1; | |
26200 | } | |
26201 | ||
26202 | skb->dev = grp->vlan_devices[vlan_tag & 0xfff]; | |
26203 | if (skb->dev == ((void *)0)) { | |
26204 | dev_kfree_skb_any(skb); | |
26205 | ||
26206 | ||
26207 | ||
26208 | ||
26209 | return 0; | |
26210 | } | |
26211 | ||
26212 | skb->dev->last_rx = jiffies; | |
26213 | ||
26214 | stats = vlan_dev_get_stats(skb->dev); | |
26215 | stats->rx_packets++; | |
26216 | stats->rx_bytes += skb->len; | |
26217 | ||
26218 | skb->priority = vlan_get_ingress_priority(skb->dev, vlan_tag); | |
26219 | switch (skb->pkt_type) { | |
26220 | case 1: | |
26221 | break; | |
26222 | ||
26223 | case 2: | |
26224 | stats->multicast++; | |
26225 | break; | |
26226 | ||
26227 | case 3: | |
26228 | ||
26229 | ||
26230 | ||
26231 | ||
26232 | if (!compare_ether_addr(eth_hdr(skb)->h_dest, | |
26233 | skb->dev->dev_addr)) | |
26234 | skb->pkt_type = 0; | |
26235 | break; | |
26236 | }; | |
26237 | ||
26238 | return (polling ? netif_receive_skb(skb) : netif_rx(skb)); | |
26239 | } | |
26240 | ||
26241 | static inline __attribute__((always_inline)) int vlan_hwaccel_rx(struct sk_buff *skb, | |
26242 | struct vlan_group *grp, | |
26243 | unsigned short vlan_tag) | |
26244 | { | |
26245 | return __vlan_hwaccel_rx(skb, grp, vlan_tag, 0); | |
26246 | } | |
26247 | ||
26248 | static inline __attribute__((always_inline)) int vlan_hwaccel_receive_skb(struct sk_buff *skb, | |
26249 | struct vlan_group *grp, | |
26250 | unsigned short vlan_tag) | |
26251 | { | |
26252 | return __vlan_hwaccel_rx(skb, grp, vlan_tag, 1); | |
26253 | } | |
26254 | # 227 "include/linux/if_vlan.h" | |
26255 | static inline __attribute__((always_inline)) struct sk_buff *__vlan_put_tag(struct sk_buff *skb, unsigned short tag) | |
26256 | { | |
26257 | struct vlan_ethhdr *veth; | |
26258 | ||
26259 | if (skb_headroom(skb) < 4) { | |
26260 | struct sk_buff *sk_tmp = skb; | |
26261 | skb = skb_realloc_headroom(sk_tmp, 4); | |
26262 | kfree_skb(sk_tmp); | |
26263 | if (!skb) { | |
26264 | printk("<3>" "vlan: failed to realloc headroom\n"); | |
26265 | return ((void *)0); | |
26266 | } | |
26267 | } else { | |
26268 | skb = skb_unshare(skb, ((( gfp_t)0x20u))); | |
26269 | if (!skb) { | |
26270 | printk("<3>" "vlan: failed to unshare skbuff\n"); | |
26271 | return ((void *)0); | |
26272 | } | |
26273 | } | |
26274 | ||
26275 | veth = (struct vlan_ethhdr *)skb_push(skb, 4); | |
26276 | ||
26277 | ||
26278 | memmove(skb->data, skb->data + 4, 2 * 6); | |
26279 | ||
26280 | ||
26281 | veth->h_vlan_proto = (( __be16)((__u16)( (((__u16)((0x8100)) & (__u16)0x00ffU) << 8) | (((__u16)((0x8100)) & (__u16)0xff00U) >> 8) ))); | |
26282 | ||
26283 | ||
26284 | veth->h_vlan_TCI = htons(tag); | |
26285 | ||
26286 | skb->protocol = (( __be16)((__u16)( (((__u16)((0x8100)) & (__u16)0x00ffU) << 8) | (((__u16)((0x8100)) & (__u16)0xff00U) >> 8) ))); | |
26287 | skb->mac.raw -= 4; | |
26288 | skb->nh.raw -= 4; | |
26289 | ||
26290 | return skb; | |
26291 | } | |
26292 | # 272 "include/linux/if_vlan.h" | |
26293 | static inline __attribute__((always_inline)) struct sk_buff *__vlan_hwaccel_put_tag(struct sk_buff *skb, unsigned short tag) | |
26294 | { | |
26295 | struct vlan_skb_tx_cookie *cookie; | |
26296 | ||
26297 | cookie = ((struct vlan_skb_tx_cookie *)&((skb)->cb[0])); | |
26298 | cookie->magic = 0x564c414e; | |
26299 | cookie->vlan_tag = tag; | |
26300 | ||
26301 | return skb; | |
26302 | } | |
26303 | # 293 "include/linux/if_vlan.h" | |
26304 | static inline __attribute__((always_inline)) struct sk_buff *vlan_put_tag(struct sk_buff *skb, unsigned short tag) | |
26305 | { | |
26306 | if (skb->dev->features & 128) { | |
26307 | return __vlan_hwaccel_put_tag(skb, tag); | |
26308 | } else { | |
26309 | return __vlan_put_tag(skb, tag); | |
26310 | } | |
26311 | } | |
26312 | # 309 "include/linux/if_vlan.h" | |
26313 | static inline __attribute__((always_inline)) int __vlan_get_tag(struct sk_buff *skb, unsigned short *tag) | |
26314 | { | |
26315 | struct vlan_ethhdr *veth = (struct vlan_ethhdr *)skb->data; | |
26316 | ||
26317 | if (veth->h_vlan_proto != (( __be16)((__u16)( (((__u16)((0x8100)) & (__u16)0x00ffU) << 8) | (((__u16)((0x8100)) & (__u16)0xff00U) >> 8) )))) { | |
26318 | return -22; | |
26319 | } | |
26320 | ||
26321 | *tag = ntohs(veth->h_vlan_TCI); | |
26322 | ||
26323 | return 0; | |
26324 | } | |
26325 | # 329 "include/linux/if_vlan.h" | |
26326 | static inline __attribute__((always_inline)) int __vlan_hwaccel_get_tag(struct sk_buff *skb, unsigned short *tag) | |
26327 | { | |
26328 | struct vlan_skb_tx_cookie *cookie; | |
26329 | ||
26330 | cookie = ((struct vlan_skb_tx_cookie *)&((skb)->cb[0])); | |
26331 | if (cookie->magic == 0x564c414e) { | |
26332 | *tag = cookie->vlan_tag; | |
26333 | return 0; | |
26334 | } else { | |
26335 | *tag = 0; | |
26336 | return -22; | |
26337 | } | |
26338 | } | |
26339 | # 352 "include/linux/if_vlan.h" | |
26340 | static inline __attribute__((always_inline)) int vlan_get_tag(struct sk_buff *skb, unsigned short *tag) | |
26341 | { | |
26342 | if (skb->dev->features & 128) { | |
26343 | return __vlan_hwaccel_get_tag(skb, tag); | |
26344 | } else { | |
26345 | return __vlan_get_tag(skb, tag); | |
26346 | } | |
26347 | } | |
26348 | ||
26349 | ||
26350 | ||
26351 | ||
26352 | ||
26353 | ||
26354 | enum vlan_ioctl_cmds { | |
26355 | ADD_VLAN_CMD, | |
26356 | DEL_VLAN_CMD, | |
26357 | SET_VLAN_INGRESS_PRIORITY_CMD, | |
26358 | SET_VLAN_EGRESS_PRIORITY_CMD, | |
26359 | GET_VLAN_INGRESS_PRIORITY_CMD, | |
26360 | GET_VLAN_EGRESS_PRIORITY_CMD, | |
26361 | SET_VLAN_NAME_TYPE_CMD, | |
26362 | SET_VLAN_FLAG_CMD, | |
26363 | GET_VLAN_REALDEV_NAME_CMD, | |
26364 | GET_VLAN_VID_CMD | |
26365 | }; | |
26366 | ||
26367 | enum vlan_name_types { | |
26368 | VLAN_NAME_TYPE_PLUS_VID, | |
26369 | VLAN_NAME_TYPE_RAW_PLUS_VID, | |
26370 | VLAN_NAME_TYPE_PLUS_VID_NO_PAD, | |
26371 | VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD, | |
26372 | VLAN_NAME_TYPE_HIGHEST | |
26373 | }; | |
26374 | ||
26375 | struct vlan_ioctl_args { | |
26376 | int cmd; | |
26377 | char device1[24]; | |
26378 | ||
26379 | union { | |
26380 | char device2[24]; | |
26381 | int VID; | |
26382 | unsigned int skb_priority; | |
26383 | unsigned int name_type; | |
26384 | unsigned int bind_type; | |
26385 | unsigned int flag; | |
26386 | } u; | |
26387 | ||
26388 | short vlan_qos; | |
26389 | }; | |
26390 | # 10 "include/linux/netfilter_bridge.h" 2 | |
26391 | # 28 "include/linux/netfilter_bridge.h" | |
26392 | enum nf_br_hook_priorities { | |
26393 | NF_BR_PRI_FIRST = (-((int)(~0U>>1)) - 1), | |
26394 | NF_BR_PRI_NAT_DST_BRIDGED = -300, | |
26395 | NF_BR_PRI_FILTER_BRIDGED = -200, | |
26396 | NF_BR_PRI_BRNF = 0, | |
26397 | NF_BR_PRI_NAT_DST_OTHER = 100, | |
26398 | NF_BR_PRI_FILTER_OTHER = 200, | |
26399 | NF_BR_PRI_NAT_SRC = 300, | |
26400 | NF_BR_PRI_LAST = ((int)(~0U>>1)), | |
26401 | }; | |
26402 | # 82 "net/ipv4/ip_output.c" 2 | |
26403 | # 1 "include/linux/mroute.h" 1 | |
26404 | # 34 "include/linux/mroute.h" | |
26405 | typedef unsigned long vifbitmap_t; | |
26406 | typedef unsigned short vifi_t; | |
26407 | # 54 "include/linux/mroute.h" | |
26408 | struct vifctl { | |
26409 | vifi_t vifc_vifi; | |
26410 | unsigned char vifc_flags; | |
26411 | unsigned char vifc_threshold; | |
26412 | unsigned int vifc_rate_limit; | |
26413 | struct in_addr vifc_lcl_addr; | |
26414 | struct in_addr vifc_rmt_addr; | |
26415 | }; | |
26416 | # 71 "include/linux/mroute.h" | |
26417 | struct mfcctl | |
26418 | { | |
26419 | struct in_addr mfcc_origin; | |
26420 | struct in_addr mfcc_mcastgrp; | |
26421 | vifi_t mfcc_parent; | |
26422 | unsigned char mfcc_ttls[32]; | |
26423 | unsigned int mfcc_pkt_cnt; | |
26424 | unsigned int mfcc_byte_cnt; | |
26425 | unsigned int mfcc_wrong_if; | |
26426 | int mfcc_expire; | |
26427 | }; | |
26428 | ||
26429 | ||
26430 | ||
26431 | ||
26432 | ||
26433 | struct sioc_sg_req | |
26434 | { | |
26435 | struct in_addr src; | |
26436 | struct in_addr grp; | |
26437 | unsigned long pktcnt; | |
26438 | unsigned long bytecnt; | |
26439 | unsigned long wrong_if; | |
26440 | }; | |
26441 | ||
26442 | ||
26443 | ||
26444 | ||
26445 | ||
26446 | struct sioc_vif_req | |
26447 | { | |
26448 | vifi_t vifi; | |
26449 | unsigned long icount; | |
26450 | unsigned long ocount; | |
26451 | unsigned long ibytes; | |
26452 | unsigned long obytes; | |
26453 | }; | |
26454 | ||
26455 | ||
26456 | ||
26457 | ||
26458 | ||
26459 | ||
26460 | struct igmpmsg | |
26461 | { | |
26462 | __u32 unused1,unused2; | |
26463 | unsigned char im_msgtype; | |
26464 | unsigned char im_mbz; | |
26465 | unsigned char im_vif; | |
26466 | unsigned char unused3; | |
26467 | struct in_addr im_src,im_dst; | |
26468 | }; | |
26469 | # 131 "include/linux/mroute.h" | |
26470 | extern int ip_mroute_setsockopt(struct sock *, int, char *, int); | |
26471 | extern int ip_mroute_getsockopt(struct sock *, int, char *, int *); | |
26472 | extern int ipmr_ioctl(struct sock *sk, int cmd, void *arg); | |
26473 | extern void ip_mr_init(void); | |
26474 | ||
26475 | ||
26476 | struct vif_device | |
26477 | { | |
26478 | struct net_device *dev; | |
26479 | unsigned long bytes_in,bytes_out; | |
26480 | unsigned long pkt_in,pkt_out; | |
26481 | unsigned long rate_limit; | |
26482 | unsigned char threshold; | |
26483 | unsigned short flags; | |
26484 | __be32 local,remote; | |
26485 | int link; | |
26486 | }; | |
26487 | ||
26488 | ||
26489 | ||
26490 | struct mfc_cache | |
26491 | { | |
26492 | struct mfc_cache *next; | |
26493 | __be32 mfc_mcastgrp; | |
26494 | __be32 mfc_origin; | |
26495 | vifi_t mfc_parent; | |
26496 | int mfc_flags; | |
26497 | ||
26498 | union { | |
26499 | struct { | |
26500 | unsigned long expires; | |
26501 | struct sk_buff_head unresolved; | |
26502 | } unres; | |
26503 | struct { | |
26504 | unsigned long last_assert; | |
26505 | int minvif; | |
26506 | int maxvif; | |
26507 | unsigned long bytes; | |
26508 | unsigned long pkt; | |
26509 | unsigned long wrong_if; | |
26510 | unsigned char ttls[32]; | |
26511 | } res; | |
26512 | } mfc_un; | |
26513 | }; | |
26514 | # 212 "include/linux/mroute.h" | |
26515 | struct pimreghdr | |
26516 | { | |
26517 | __u8 type; | |
26518 | __u8 reserved; | |
26519 | __be16 csum; | |
26520 | __be32 flags; | |
26521 | }; | |
26522 | ||
26523 | extern int pim_rcv_v1(struct sk_buff *); | |
26524 | ||
26525 | struct rtmsg; | |
26526 | extern int ipmr_get_route(struct sk_buff *skb, struct rtmsg *rtm, int nowait); | |
26527 | # 83 "net/ipv4/ip_output.c" 2 | |
26528 | ||
26529 | ||
26530 | ||
26531 | int sysctl_ip_default_ttl = 64; | |
26532 | ||
26533 | ||
26534 | ||
26535 | void ip_send_check(struct iphdr *iph) | |
26536 | { | |
26537 | iph->check = 0; | |
26538 | iph->check = ip_fast_csum((unsigned char *)iph, iph->ihl); | |
26539 | } | |
26540 | ||
26541 | ||
26542 | static int ip_dev_loopback_xmit(struct sk_buff *newskb) | |
26543 | { | |
26544 | newskb->mac.raw = newskb->data; | |
26545 | __skb_pull(newskb, newskb->nh.raw - newskb->data); | |
26546 | newskb->pkt_type = 5; | |
26547 | newskb->ip_summed = 2; | |
26548 | do { if (__builtin_expect(!!(!(newskb->dst)), 0)) { printk("<3>" "KERNEL: assertion (%s) failed at %s (%d)\n", "newskb->dst", "net/ipv4/ip_output.c" , 103); } } while(0); | |
26549 | netif_rx(newskb); | |
26550 | return 0; | |
26551 | } | |
26552 | ||
26553 | static inline __attribute__((always_inline)) int ip_select_ttl(struct inet_sock *inet, struct dst_entry *dst) | |
26554 | { | |
26555 | int ttl = inet->uc_ttl; | |
26556 | ||
26557 | if (ttl < 0) | |
26558 | ttl = dst_metric(dst, RTAX_HOPLIMIT); | |
26559 | return ttl; | |
26560 | } | |
26561 | ||
26562 | ||
26563 | ||
26564 | ||
26565 | ||
26566 | int ip_build_and_send_pkt(struct sk_buff *skb, struct sock *sk, | |
26567 | __be32 saddr, __be32 daddr, struct ip_options *opt) | |
26568 | { | |
26569 | struct inet_sock *inet = inet_sk(sk); | |
26570 | struct rtable *rt = (struct rtable *)skb->dst; | |
26571 | struct iphdr *iph; | |
26572 | ||
26573 | ||
26574 | if (opt) | |
26575 | iph=(struct iphdr *)skb_push(skb,sizeof(struct iphdr) + opt->optlen); | |
26576 | else | |
26577 | iph=(struct iphdr *)skb_push(skb,sizeof(struct iphdr)); | |
26578 | ||
26579 | iph->version = 4; | |
26580 | iph->ihl = 5; | |
26581 | iph->tos = inet->tos; | |
26582 | if (ip_dont_fragment(sk, &rt->u.dst)) | |
26583 | iph->frag_off = htons(0x4000); | |
26584 | else | |
26585 | iph->frag_off = 0; | |
26586 | iph->ttl = ip_select_ttl(inet, &rt->u.dst); | |
26587 | iph->daddr = rt->rt_dst; | |
26588 | iph->saddr = rt->rt_src; | |
26589 | iph->protocol = sk->sk_protocol; | |
26590 | iph->tot_len = htons(skb->len); | |
26591 | ip_select_ident(iph, &rt->u.dst, sk); | |
26592 | skb->nh.iph = iph; | |
26593 | ||
26594 | if (opt && opt->optlen) { | |
26595 | iph->ihl += opt->optlen>>2; | |
26596 | ip_options_build(skb, opt, daddr, rt, 0); | |
26597 | } | |
26598 | ip_send_check(iph); | |
26599 | ||
26600 | skb->priority = sk->sk_priority; | |
26601 | ||
26602 | ||
26603 | return (dst_output)(skb); | |
26604 | ||
26605 | } | |
26606 | ||
26607 | extern typeof(ip_build_and_send_pkt) ip_build_and_send_pkt; static const char __kstrtab_ip_build_and_send_pkt[] __attribute__((section("__ksymtab_strings"))) = "_" "ip_build_and_send_pkt"; static const struct kernel_symbol __ksymtab_ip_build_and_send_pkt __attribute__((__used__)) __attribute__((section("__ksymtab" "_gpl"), unused)) = { (unsigned long)&ip_build_and_send_pkt, __kstrtab_ip_build_and_send_pkt }; | |
26608 | ||
26609 | static inline __attribute__((always_inline)) int ip_finish_output2(struct sk_buff *skb) | |
26610 | { | |
26611 | struct dst_entry *dst = skb->dst; | |
26612 | struct hh_cache *hh = dst->hh; | |
26613 | struct net_device *dev = dst->dev; | |
26614 | int hh_len = (((dev)->hard_header_len&~(16 - 1)) + 16); | |
26615 | ||
26616 | ||
26617 | if (__builtin_expect(!!(skb_headroom(skb) < hh_len && dev->hard_header), 0)) { | |
26618 | struct sk_buff *skb2; | |
26619 | ||
26620 | skb2 = skb_realloc_headroom(skb, (((dev)->hard_header_len&~(16 - 1)) + 16)); | |
26621 | if (skb2 == ((void *)0)) { | |
26622 | kfree_skb(skb); | |
26623 | return -12; | |
26624 | } | |
26625 | if (skb->sk) | |
26626 | skb_set_owner_w(skb2, skb->sk); | |
26627 | kfree_skb(skb); | |
26628 | skb = skb2; | |
26629 | } | |
26630 | ||
26631 | if (hh) { | |
26632 | int hh_alen; | |
26633 | ||
26634 | do { local_bh_disable(); do { do { } while (0); (void)0; (void)(&hh->hh_lock); } while (0); } while (0); | |
26635 | hh_alen = (((hh->hh_len)+(16 -1))&~(16 - 1)); | |
26636 | memcpy(skb->data - hh_alen, hh->hh_data, hh_alen); | |
26637 | do { do { } while (0); local_bh_enable(); (void)0; (void)(&hh->hh_lock); } while (0); | |
26638 | skb_push(skb, hh->hh_len); | |
26639 | return hh->hh_output(skb); | |
26640 | } else if (dst->neighbour) | |
26641 | return dst->neighbour->output(skb); | |
26642 | ||
26643 | if (net_ratelimit()) | |
26644 | printk("<7>" "ip_finish_output2: No header cache and no neighbour!\n"); | |
26645 | kfree_skb(skb); | |
26646 | return -22; | |
26647 | } | |
26648 | ||
26649 | static inline __attribute__((always_inline)) int ip_finish_output(struct sk_buff *skb) | |
26650 | { | |
26651 | ||
26652 | ||
26653 | ||
26654 | ||
26655 | ||
26656 | ||
26657 | ||
26658 | if (skb->len > dst_mtu(skb->dst) && !skb_is_gso(skb)) | |
26659 | return ip_fragment(skb, ip_finish_output2); | |
26660 | else | |
26661 | return ip_finish_output2(skb); | |
26662 | } | |
26663 | ||
26664 | int ip_mc_output(struct sk_buff *skb) | |
26665 | { | |
26666 | struct sock *sk = skb->sk; | |
26667 | struct rtable *rt = (struct rtable*)skb->dst; | |
26668 | struct net_device *dev = rt->u.dst.dev; | |
26669 | ||
26670 | ||
26671 | ||
26672 | ||
26673 | (({ (void)((0)); ((ip_statistics[!(((current_thread_info()->preempt_count) & (((1UL << (8))-1) << (0 + 8))))])); })->mibs[IPSTATS_MIB_OUTREQUESTS]++); | |
26674 | ||
26675 | skb->dev = dev; | |
26676 | skb->protocol = htons(0x0800); | |
26677 | ||
26678 | ||
26679 | ||
26680 | ||
26681 | ||
26682 | if (rt->rt_flags&0x20000000) { | |
26683 | if ((!sk || inet_sk(sk)->mc_loop) | |
26684 | # 250 "net/ipv4/ip_output.c" | |
26685 | ) { | |
26686 | struct sk_buff *newskb = skb_clone(skb, ((( gfp_t)0x20u))); | |
26687 | if (newskb) | |
26688 | (ip_dev_loopback_xmit)(newskb); | |
26689 | ||
26690 | ||
26691 | } | |
26692 | ||
26693 | ||
26694 | ||
26695 | if (skb->nh.iph->ttl == 0) { | |
26696 | kfree_skb(skb); | |
26697 | return 0; | |
26698 | } | |
26699 | } | |
26700 | ||
26701 | if (rt->rt_flags&0x10000000) { | |
26702 | struct sk_buff *newskb = skb_clone(skb, ((( gfp_t)0x20u))); | |
26703 | if (newskb) | |
26704 | (ip_dev_loopback_xmit)(newskb); | |
26705 | ||
26706 | } | |
26707 | ||
26708 | return (ip_finish_output)(skb); | |
26709 | ||
26710 | ||
26711 | } | |
26712 | ||
26713 | int ip_output(struct sk_buff *skb) | |
26714 | { | |
26715 | struct net_device *dev = skb->dst->dev; | |
26716 | ||
26717 | (({ (void)((0)); ((ip_statistics[!(((current_thread_info()->preempt_count) & (((1UL << (8))-1) << (0 + 8))))])); })->mibs[IPSTATS_MIB_OUTREQUESTS]++); | |
26718 | ||
26719 | skb->dev = dev; | |
26720 | skb->protocol = htons(0x0800); | |
26721 | ||
26722 | return (ip_finish_output)(skb); | |
26723 | ||
26724 | ||
26725 | } | |
26726 | ||
26727 | int ip_queue_xmit(struct sk_buff *skb, int ipfragok) | |
26728 | { | |
26729 | struct sock *sk = skb->sk; | |
26730 | struct inet_sock *inet = inet_sk(sk); | |
26731 | struct ip_options *opt = inet->opt; | |
26732 | struct rtable *rt; | |
26733 | struct iphdr *iph; | |
26734 | ||
26735 | ||
26736 | ||
26737 | ||
26738 | rt = (struct rtable *) skb->dst; | |
26739 | if (rt != ((void *)0)) | |
26740 | goto packet_routed; | |
26741 | ||
26742 | ||
26743 | rt = (struct rtable *)__sk_dst_check(sk, 0); | |
26744 | if (rt == ((void *)0)) { | |
26745 | __be32 daddr; | |
26746 | ||
26747 | ||
26748 | daddr = inet->daddr; | |
26749 | if(opt && opt->srr) | |
26750 | daddr = opt->faddr; | |
26751 | ||
26752 | { | |
26753 | struct flowi fl = { .oif = sk->__sk_common.skc_bound_dev_if, | |
26754 | .nl_u = { .ip4_u = | |
26755 | { .daddr = daddr, | |
26756 | .saddr = inet->saddr, | |
26757 | .tos = (((inet_sk(sk)->tos)&0x1E) | sock_flag(sk, SOCK_LOCALROUTE)) } }, | |
26758 | .proto = sk->sk_protocol, | |
26759 | .uli_u = { .ports = | |
26760 | { .sport = inet->sport, | |
26761 | .dport = inet->dport } } }; | |
26762 | ||
26763 | ||
26764 | ||
26765 | ||
26766 | ||
26767 | security_sk_classify_flow(sk, &fl); | |
26768 | if (ip_route_output_flow(&rt, &fl, sk, 0)) | |
26769 | goto no_route; | |
26770 | } | |
26771 | sk_setup_caps(sk, &rt->u.dst); | |
26772 | } | |
26773 | skb->dst = dst_clone(&rt->u.dst); | |
26774 | ||
26775 | packet_routed: | |
26776 | if (opt && opt->is_strictroute && rt->rt_dst != rt->rt_gateway) | |
26777 | goto no_route; | |
26778 | ||
26779 | ||
26780 | iph = (struct iphdr *) skb_push(skb, sizeof(struct iphdr) + (opt ? opt->optlen : 0)); | |
26781 | *((__u16 *)iph) = htons((4 << 12) | (5 << 8) | (inet->tos & 0xff)); | |
26782 | iph->tot_len = htons(skb->len); | |
26783 | if (ip_dont_fragment(sk, &rt->u.dst) && !ipfragok) | |
26784 | iph->frag_off = htons(0x4000); | |
26785 | else | |
26786 | iph->frag_off = 0; | |
26787 | iph->ttl = ip_select_ttl(inet, &rt->u.dst); | |
26788 | iph->protocol = sk->sk_protocol; | |
26789 | iph->saddr = rt->rt_src; | |
26790 | iph->daddr = rt->rt_dst; | |
26791 | skb->nh.iph = iph; | |
26792 | ||
26793 | ||
26794 | if (opt && opt->optlen) { | |
26795 | iph->ihl += opt->optlen >> 2; | |
26796 | ip_options_build(skb, opt, inet->daddr, rt, 0); | |
26797 | } | |
26798 | ||
26799 | ip_select_ident_more(iph, &rt->u.dst, sk, | |
26800 | (((struct skb_shared_info *)((skb)->end))->gso_segs ?: 1) - 1); | |
26801 | ||
26802 | ||
26803 | ip_send_check(iph); | |
26804 | ||
26805 | skb->priority = sk->sk_priority; | |
26806 | ||
26807 | return (dst_output)(skb); | |
26808 | ||
26809 | ||
26810 | no_route: | |
26811 | (({ (void)((0)); ((ip_statistics[!(((current_thread_info()->preempt_count) & (((1UL << (8))-1) << (0 + 8))))])); })->mibs[IPSTATS_MIB_OUTNOROUTES]++); | |
26812 | kfree_skb(skb); | |
26813 | return -113; | |
26814 | } | |
26815 | ||
26816 | ||
26817 | static void ip_copy_metadata(struct sk_buff *to, struct sk_buff *from) | |
26818 | { | |
26819 | to->pkt_type = from->pkt_type; | |
26820 | to->priority = from->priority; | |
26821 | to->protocol = from->protocol; | |
26822 | dst_release(to->dst); | |
26823 | to->dst = dst_clone(from->dst); | |
26824 | to->dev = from->dev; | |
26825 | ||
26826 | ||
26827 | ((struct inet_skb_parm*)((to)->cb))->flags = ((struct inet_skb_parm*)((from)->cb))->flags; | |
26828 | # 413 "net/ipv4/ip_output.c" | |
26829 | skb_copy_secmark(to, from); | |
26830 | } | |
26831 | # 423 "net/ipv4/ip_output.c" | |
26832 | int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*)) | |
26833 | { | |
26834 | struct iphdr *iph; | |
26835 | int raw = 0; | |
26836 | int ptr; | |
26837 | struct net_device *dev; | |
26838 | struct sk_buff *skb2; | |
26839 | unsigned int mtu, hlen, left, len, ll_rs, pad; | |
26840 | int offset; | |
26841 | __be16 not_last_frag; | |
26842 | struct rtable *rt = (struct rtable*)skb->dst; | |
26843 | int err = 0; | |
26844 | ||
26845 | dev = rt->u.dst.dev; | |
26846 | ||
26847 | ||
26848 | ||
26849 | ||
26850 | ||
26851 | iph = skb->nh.iph; | |
26852 | ||
26853 | if (__builtin_expect(!!((iph->frag_off & htons(0x4000)) && !skb->local_df), 0)) { | |
26854 | (({ (void)((0)); ((ip_statistics[!(((current_thread_info()->preempt_count) & (((1UL << (8))-1) << (0 + 8))))])); })->mibs[IPSTATS_MIB_FRAGFAILS]++); | |
26855 | icmp_send(skb, 3, 4, | |
26856 | htonl(dst_mtu(&rt->u.dst))); | |
26857 | kfree_skb(skb); | |
26858 | return -90; | |
26859 | } | |
26860 | ||
26861 | ||
26862 | ||
26863 | ||
26864 | ||
26865 | hlen = iph->ihl * 4; | |
26866 | mtu = dst_mtu(&rt->u.dst) - hlen; | |
26867 | ((struct inet_skb_parm*)((skb)->cb))->flags |= 8; | |
26868 | # 467 "net/ipv4/ip_output.c" | |
26869 | if (((struct skb_shared_info *)((skb)->end))->frag_list) { | |
26870 | struct sk_buff *frag; | |
26871 | int first_len = skb_pagelen(skb); | |
26872 | ||
26873 | if (first_len - hlen > mtu || | |
26874 | ((first_len - hlen) & 7) || | |
26875 | (iph->frag_off & htons(0x2000|0x1FFF)) || | |
26876 | skb_cloned(skb)) | |
26877 | goto slow_path; | |
26878 | ||
26879 | for (frag = ((struct skb_shared_info *)((skb)->end))->frag_list; frag; frag = frag->next) { | |
26880 | ||
26881 | if (frag->len > mtu || | |
26882 | ((frag->len & 7) && frag->next) || | |
26883 | skb_headroom(frag) < hlen) | |
26884 | goto slow_path; | |
26885 | ||
26886 | ||
26887 | if (skb_shared(frag)) | |
26888 | goto slow_path; | |
26889 | ||
26890 | do { if (__builtin_expect(!!((frag->sk)!=0), 0)) do { dump_stack(); printk("<4>" "\nkernel BUG at %s:%d!\n", "net/ipv4/ip_output.c", 488); panic("BUG!"); } while (0); } while(0); | |
26891 | if (skb->sk) { | |
26892 | sock_hold(skb->sk); | |
26893 | frag->sk = skb->sk; | |
26894 | frag->destructor = sock_wfree; | |
26895 | skb->truesize -= frag->truesize; | |
26896 | } | |
26897 | } | |
26898 | ||
26899 | ||
26900 | ||
26901 | err = 0; | |
26902 | offset = 0; | |
26903 | frag = ((struct skb_shared_info *)((skb)->end))->frag_list; | |
26904 | ((struct skb_shared_info *)((skb)->end))->frag_list = ((void *)0); | |
26905 | skb->data_len = first_len - skb_headlen(skb); | |
26906 | skb->len = first_len; | |
26907 | iph->tot_len = htons(first_len); | |
26908 | iph->frag_off = htons(0x2000); | |
26909 | ip_send_check(iph); | |
26910 | ||
26911 | for (;;) { | |
26912 | ||
26913 | ||
26914 | if (frag) { | |
26915 | frag->ip_summed = 0; | |
26916 | frag->h.raw = frag->data; | |
26917 | frag->nh.raw = __skb_push(frag, hlen); | |
26918 | memcpy(frag->nh.raw, iph, hlen); | |
26919 | iph = frag->nh.iph; | |
26920 | iph->tot_len = htons(frag->len); | |
26921 | ip_copy_metadata(frag, skb); | |
26922 | if (offset == 0) | |
26923 | ip_options_fragment(frag); | |
26924 | offset += skb->len - hlen; | |
26925 | iph->frag_off = htons(offset>>3); | |
26926 | if (frag->next != ((void *)0)) | |
26927 | iph->frag_off |= htons(0x2000); | |
26928 | ||
26929 | ip_send_check(iph); | |
26930 | } | |
26931 | ||
26932 | err = output(skb); | |
26933 | ||
26934 | if (!err) | |
26935 | (({ (void)((0)); ((ip_statistics[!(((current_thread_info()->preempt_count) & (((1UL << (8))-1) << (0 + 8))))])); })->mibs[IPSTATS_MIB_FRAGCREATES]++); | |
26936 | if (err || !frag) | |
26937 | break; | |
26938 | ||
26939 | skb = frag; | |
26940 | frag = skb->next; | |
26941 | skb->next = ((void *)0); | |
26942 | } | |
26943 | ||
26944 | if (err == 0) { | |
26945 | (({ (void)((0)); ((ip_statistics[!(((current_thread_info()->preempt_count) & (((1UL << (8))-1) << (0 + 8))))])); })->mibs[IPSTATS_MIB_FRAGOKS]++); | |
26946 | return 0; | |
26947 | } | |
26948 | ||
26949 | while (frag) { | |
26950 | skb = frag->next; | |
26951 | kfree_skb(frag); | |
26952 | frag = skb; | |
26953 | } | |
26954 | (({ (void)((0)); ((ip_statistics[!(((current_thread_info()->preempt_count) & (((1UL << (8))-1) << (0 + 8))))])); })->mibs[IPSTATS_MIB_FRAGFAILS]++); | |
26955 | return err; | |
26956 | } | |
26957 | ||
26958 | slow_path: | |
26959 | left = skb->len - hlen; | |
26960 | ptr = raw + hlen; | |
26961 | ||
26962 | ||
26963 | ||
26964 | ||
26965 | pad = (0); | |
26966 | ll_rs = ((((rt->u.dst.dev)->hard_header_len+pad)&~(16 - 1)) + 16); | |
26967 | mtu -= pad; | |
26968 | ||
26969 | ||
26970 | ||
26971 | ||
26972 | ||
26973 | offset = (ntohs(iph->frag_off) & 0x1FFF) << 3; | |
26974 | not_last_frag = iph->frag_off & htons(0x2000); | |
26975 | ||
26976 | ||
26977 | ||
26978 | ||
26979 | ||
26980 | while(left > 0) { | |
26981 | len = left; | |
26982 | ||
26983 | if (len > mtu) | |
26984 | len = mtu; | |
26985 | ||
26986 | ||
26987 | if (len < left) { | |
26988 | len &= ~7; | |
26989 | } | |
26990 | ||
26991 | ||
26992 | ||
26993 | ||
26994 | if ((skb2 = alloc_skb(len+hlen+ll_rs, ((( gfp_t)0x20u)))) == ((void *)0)) { | |
26995 | do { } while (0); | |
26996 | err = -12; | |
26997 | goto fail; | |
26998 | } | |
26999 | ||
27000 | ||
27001 | ||
27002 | ||
27003 | ||
27004 | ip_copy_metadata(skb2, skb); | |
27005 | skb_reserve(skb2, ll_rs); | |
27006 | skb_put(skb2, len + hlen); | |
27007 | skb2->nh.raw = skb2->data; | |
27008 | skb2->h.raw = skb2->data + hlen; | |
27009 | ||
27010 | ||
27011 | ||
27012 | ||
27013 | ||
27014 | ||
27015 | if (skb->sk) | |
27016 | skb_set_owner_w(skb2, skb->sk); | |
27017 | ||
27018 | ||
27019 | ||
27020 | ||
27021 | ||
27022 | memcpy(skb2->nh.raw, skb->data, hlen); | |
27023 | ||
27024 | ||
27025 | ||
27026 | ||
27027 | if (skb_copy_bits(skb, ptr, skb2->h.raw, len)) | |
27028 | do { dump_stack(); printk("<4>" "\nkernel BUG at %s:%d!\n", "net/ipv4/ip_output.c", 626); panic("BUG!"); } while (0); | |
27029 | left -= len; | |
27030 | ||
27031 | ||
27032 | ||
27033 | ||
27034 | iph = skb2->nh.iph; | |
27035 | iph->frag_off = htons((offset >> 3)); | |
27036 | ||
27037 | ||
27038 | ||
27039 | ||
27040 | ||
27041 | ||
27042 | ||
27043 | if (offset == 0) | |
27044 | ip_options_fragment(skb); | |
27045 | ||
27046 | ||
27047 | ||
27048 | ||
27049 | ||
27050 | if (left > 0 || not_last_frag) | |
27051 | iph->frag_off |= htons(0x2000); | |
27052 | ptr += len; | |
27053 | offset += len; | |
27054 | ||
27055 | ||
27056 | ||
27057 | ||
27058 | iph->tot_len = htons(len + hlen); | |
27059 | ||
27060 | ip_send_check(iph); | |
27061 | ||
27062 | err = output(skb2); | |
27063 | if (err) | |
27064 | goto fail; | |
27065 | ||
27066 | (({ (void)((0)); ((ip_statistics[!(((current_thread_info()->preempt_count) & (((1UL << (8))-1) << (0 + 8))))])); })->mibs[IPSTATS_MIB_FRAGCREATES]++); | |
27067 | } | |
27068 | kfree_skb(skb); | |
27069 | (({ (void)((0)); ((ip_statistics[!(((current_thread_info()->preempt_count) & (((1UL << (8))-1) << (0 + 8))))])); })->mibs[IPSTATS_MIB_FRAGOKS]++); | |
27070 | return err; | |
27071 | ||
27072 | fail: | |
27073 | kfree_skb(skb); | |
27074 | (({ (void)((0)); ((ip_statistics[!(((current_thread_info()->preempt_count) & (((1UL << (8))-1) << (0 + 8))))])); })->mibs[IPSTATS_MIB_FRAGFAILS]++); | |
27075 | return err; | |
27076 | } | |
27077 | ||
27078 | extern typeof(ip_fragment) ip_fragment; static const char __kstrtab_ip_fragment[] __attribute__((section("__ksymtab_strings"))) = "_" "ip_fragment"; static const struct kernel_symbol __ksymtab_ip_fragment __attribute__((__used__)) __attribute__((section("__ksymtab" ""), unused)) = { (unsigned long)&ip_fragment, __kstrtab_ip_fragment }; | |
27079 | ||
27080 | int | |
27081 | ip_generic_getfrag(void *from, char *to, int offset, int len, int odd, struct sk_buff *skb) | |
27082 | { | |
27083 | struct iovec *iov = from; | |
27084 | ||
27085 | if (skb->ip_summed == 1) { | |
27086 | if (memcpy_fromiovecend(to, iov, offset, len) < 0) | |
27087 | return -14; | |
27088 | } else { | |
27089 | unsigned int csum = 0; | |
27090 | if (csum_partial_copy_fromiovecend(to, iov, offset, len, &csum) < 0) | |
27091 | return -14; | |
27092 | skb->csum = csum_block_add(skb->csum, csum, odd); | |
27093 | } | |
27094 | return 0; | |
27095 | } | |
27096 | ||
27097 | static inline __attribute__((always_inline)) unsigned int | |
27098 | csum_page(struct page *page, int offset, int copy) | |
27099 | { | |
27100 | char *kaddr; | |
27101 | unsigned int csum; | |
27102 | kaddr = kmap(page); | |
27103 | csum = csum_partial(kaddr + offset, copy, 0); | |
27104 | do { (void) (page); } while (0); | |
27105 | return csum; | |
27106 | } | |
27107 | ||
27108 | static inline __attribute__((always_inline)) int ip_ufo_append_data(struct sock *sk, | |
27109 | int getfrag(void *from, char *to, int offset, int len, | |
27110 | int odd, struct sk_buff *skb), | |
27111 | void *from, int length, int hh_len, int fragheaderlen, | |
27112 | int transhdrlen, int mtu,unsigned int flags) | |
27113 | { | |
27114 | struct sk_buff *skb; | |
27115 | int err; | |
27116 | ||
27117 | ||
27118 | ||
27119 | ||
27120 | ||
27121 | if ((skb = skb_peek_tail(&sk->sk_write_queue)) == ((void *)0)) { | |
27122 | skb = sock_alloc_send_skb(sk, | |
27123 | hh_len + fragheaderlen + transhdrlen + 20, | |
27124 | (flags & 0x40), &err); | |
27125 | ||
27126 | if (skb == ((void *)0)) | |
27127 | return err; | |
27128 | ||
27129 | ||
27130 | skb_reserve(skb, hh_len); | |
27131 | ||
27132 | ||
27133 | skb_put(skb,fragheaderlen + transhdrlen); | |
27134 | ||
27135 | ||
27136 | skb->nh.raw = skb->data; | |
27137 | ||
27138 | ||
27139 | skb->h.raw = skb->data + fragheaderlen; | |
27140 | ||
27141 | skb->ip_summed = 1; | |
27142 | skb->csum = 0; | |
27143 | sk->sk_sndmsg_off = 0; | |
27144 | } | |
27145 | ||
27146 | err = skb_append_datato_frags(sk,skb, getfrag, from, | |
27147 | (length - transhdrlen)); | |
27148 | if (!err) { | |
27149 | ||
27150 | ((struct skb_shared_info *)((skb)->end))->gso_size = mtu - fragheaderlen; | |
27151 | ((struct skb_shared_info *)((skb)->end))->gso_type = SKB_GSO_UDP; | |
27152 | __skb_queue_tail(&sk->sk_write_queue, skb); | |
27153 | ||
27154 | return 0; | |
27155 | } | |
27156 | ||
27157 | ||
27158 | ||
27159 | kfree_skb(skb); | |
27160 | return err; | |
27161 | } | |
27162 | # 772 "net/ipv4/ip_output.c" | |
27163 | int ip_append_data(struct sock *sk, | |
27164 | int getfrag(void *from, char *to, int offset, int len, | |
27165 | int odd, struct sk_buff *skb), | |
27166 | void *from, int length, int transhdrlen, | |
27167 | struct ipcm_cookie *ipc, struct rtable *rt, | |
27168 | unsigned int flags) | |
27169 | { | |
27170 | struct inet_sock *inet = inet_sk(sk); | |
27171 | struct sk_buff *skb; | |
27172 | ||
27173 | struct ip_options *opt = ((void *)0); | |
27174 | int hh_len; | |
27175 | int exthdrlen; | |
27176 | int mtu; | |
27177 | int copy; | |
27178 | int err; | |
27179 | int offset = 0; | |
27180 | unsigned int maxfraglen, fragheaderlen; | |
27181 | int csummode = 0; | |
27182 | ||
27183 | if (flags&0x10) | |
27184 | return 0; | |
27185 | ||
27186 | if (skb_queue_empty(&sk->sk_write_queue)) { | |
27187 | ||
27188 | ||
27189 | ||
27190 | opt = ipc->opt; | |
27191 | if (opt) { | |
27192 | if (inet->cork.opt == ((void *)0)) { | |
27193 | inet->cork.opt = kmalloc(sizeof(struct ip_options) + 40, sk->sk_allocation); | |
27194 | if (__builtin_expect(!!(inet->cork.opt == ((void *)0)), 0)) | |
27195 | return -105; | |
27196 | } | |
27197 | memcpy(inet->cork.opt, opt, sizeof(struct ip_options)+opt->optlen); | |
27198 | inet->cork.flags |= 1; | |
27199 | inet->cork.addr = ipc->addr; | |
27200 | } | |
27201 | dst_hold(&rt->u.dst); | |
27202 | inet->cork.fragsize = mtu = dst_mtu(rt->u.dst.path); | |
27203 | inet->cork.rt = rt; | |
27204 | inet->cork.length = 0; | |
27205 | sk->sk_sndmsg_page = ((void *)0); | |
27206 | sk->sk_sndmsg_off = 0; | |
27207 | if ((exthdrlen = rt->u.dst.header_len) != 0) { | |
27208 | length += exthdrlen; | |
27209 | transhdrlen += exthdrlen; | |
27210 | } | |
27211 | } else { | |
27212 | rt = inet->cork.rt; | |
27213 | if (inet->cork.flags & 1) | |
27214 | opt = inet->cork.opt; | |
27215 | ||
27216 | transhdrlen = 0; | |
27217 | exthdrlen = 0; | |
27218 | mtu = inet->cork.fragsize; | |
27219 | } | |
27220 | hh_len = (((rt->u.dst.dev)->hard_header_len&~(16 - 1)) + 16); | |
27221 | ||
27222 | fragheaderlen = sizeof(struct iphdr) + (opt ? opt->optlen : 0); | |
27223 | maxfraglen = ((mtu - fragheaderlen) & ~7) + fragheaderlen; | |
27224 | ||
27225 | if (inet->cork.length + length > 0xFFFF - fragheaderlen) { | |
27226 | ip_local_error(sk, 90, rt->rt_dst, inet->dport, mtu-exthdrlen); | |
27227 | return -90; | |
27228 | } | |
27229 | ||
27230 | ||
27231 | ||
27232 | ||
27233 | ||
27234 | if (transhdrlen && | |
27235 | length + fragheaderlen <= mtu && | |
27236 | rt->u.dst.dev->features & (2 | (4 | 8)) && | |
27237 | !exthdrlen) | |
27238 | csummode = 1; | |
27239 | ||
27240 | inet->cork.length += length; | |
27241 | if (((length > mtu) && (sk->sk_protocol == IPPROTO_UDP)) && | |
27242 | (rt->u.dst.dev->features & (SKB_GSO_UDP << 16))) { | |
27243 | ||
27244 | err = ip_ufo_append_data(sk, getfrag, from, length, hh_len, | |
27245 | fragheaderlen, transhdrlen, mtu, | |
27246 | flags); | |
27247 | if (err) | |
27248 | goto error; | |
27249 | return 0; | |
27250 | } | |
27251 | # 868 "net/ipv4/ip_output.c" | |
27252 | if ((skb = skb_peek_tail(&sk->sk_write_queue)) == ((void *)0)) | |
27253 | goto alloc_new_skb; | |
27254 | ||
27255 | while (length > 0) { | |
27256 | ||
27257 | copy = mtu - skb->len; | |
27258 | if (copy < length) | |
27259 | copy = maxfraglen - skb->len; | |
27260 | if (copy <= 0) { | |
27261 | char *data; | |
27262 | unsigned int datalen; | |
27263 | unsigned int fraglen; | |
27264 | unsigned int fraggap; | |
27265 | unsigned int alloclen; | |
27266 | struct sk_buff *skb_prev; | |
27267 | alloc_new_skb: | |
27268 | skb_prev = skb; | |
27269 | if (skb_prev) | |
27270 | fraggap = skb_prev->len - maxfraglen; | |
27271 | else | |
27272 | fraggap = 0; | |
27273 | ||
27274 | ||
27275 | ||
27276 | ||
27277 | ||
27278 | datalen = length + fraggap; | |
27279 | if (datalen > mtu - fragheaderlen) | |
27280 | datalen = maxfraglen - fragheaderlen; | |
27281 | fraglen = datalen + fragheaderlen; | |
27282 | ||
27283 | if ((flags & 0x8000) && | |
27284 | !(rt->u.dst.dev->features&1)) | |
27285 | alloclen = mtu; | |
27286 | else | |
27287 | alloclen = datalen + fragheaderlen; | |
27288 | ||
27289 | ||
27290 | ||
27291 | ||
27292 | ||
27293 | ||
27294 | if (datalen == length + fraggap) | |
27295 | alloclen += rt->u.dst.trailer_len; | |
27296 | ||
27297 | if (transhdrlen) { | |
27298 | skb = sock_alloc_send_skb(sk, | |
27299 | alloclen + hh_len + 15, | |
27300 | (flags & 0x40), &err); | |
27301 | } else { | |
27302 | skb = ((void *)0); | |
27303 | if (((&sk->sk_wmem_alloc)->counter) <= | |
27304 | 2 * sk->sk_sndbuf) | |
27305 | skb = sock_wmalloc(sk, | |
27306 | alloclen + hh_len + 15, 1, | |
27307 | sk->sk_allocation); | |
27308 | if (__builtin_expect(!!(skb == ((void *)0)), 0)) | |
27309 | err = -105; | |
27310 | } | |
27311 | if (skb == ((void *)0)) | |
27312 | goto error; | |
27313 | ||
27314 | ||
27315 | ||
27316 | ||
27317 | skb->ip_summed = csummode; | |
27318 | skb->csum = 0; | |
27319 | skb_reserve(skb, hh_len); | |
27320 | ||
27321 | ||
27322 | ||
27323 | ||
27324 | data = skb_put(skb, fraglen); | |
27325 | skb->nh.raw = data + exthdrlen; | |
27326 | data += fragheaderlen; | |
27327 | skb->h.raw = data + exthdrlen; | |
27328 | ||
27329 | if (fraggap) { | |
27330 | skb->csum = skb_copy_and_csum_bits( | |
27331 | skb_prev, maxfraglen, | |
27332 | data + transhdrlen, fraggap, 0); | |
27333 | skb_prev->csum = csum_sub(skb_prev->csum, | |
27334 | skb->csum); | |
27335 | data += fraggap; | |
27336 | pskb_trim_unique(skb_prev, maxfraglen); | |
27337 | } | |
27338 | ||
27339 | copy = datalen - transhdrlen - fraggap; | |
27340 | if (copy > 0 && getfrag(from, data + transhdrlen, offset, copy, fraggap, skb) < 0) { | |
27341 | err = -14; | |
27342 | kfree_skb(skb); | |
27343 | goto error; | |
27344 | } | |
27345 | ||
27346 | offset += copy; | |
27347 | length -= datalen - fraggap; | |
27348 | transhdrlen = 0; | |
27349 | exthdrlen = 0; | |
27350 | csummode = 0; | |
27351 | ||
27352 | ||
27353 | ||
27354 | ||
27355 | __skb_queue_tail(&sk->sk_write_queue, skb); | |
27356 | continue; | |
27357 | } | |
27358 | ||
27359 | if (copy > length) | |
27360 | copy = length; | |
27361 | ||
27362 | if (!(rt->u.dst.dev->features&1)) { | |
27363 | unsigned int off; | |
27364 | ||
27365 | off = skb->len; | |
27366 | if (getfrag(from, skb_put(skb, copy), | |
27367 | offset, copy, off, skb) < 0) { | |
27368 | __skb_trim(skb, off); | |
27369 | err = -14; | |
27370 | goto error; | |
27371 | } | |
27372 | } else { | |
27373 | int i = ((struct skb_shared_info *)((skb)->end))->nr_frags; | |
27374 | skb_frag_t *frag = &((struct skb_shared_info *)((skb)->end))->frags[i-1]; | |
27375 | struct page *page = sk->sk_sndmsg_page; | |
27376 | int off = sk->sk_sndmsg_off; | |
27377 | unsigned int left; | |
27378 | ||
27379 | if (page && (left = (1UL << 12) - off) > 0) { | |
27380 | if (copy >= left) | |
27381 | copy = left; | |
27382 | if (page != frag->page) { | |
27383 | if (i == (65536/(1UL << 12) + 2)) { | |
27384 | err = -90; | |
27385 | goto error; | |
27386 | } | |
27387 | get_page(page); | |
27388 | skb_fill_page_desc(skb, i, page, sk->sk_sndmsg_off, 0); | |
27389 | frag = &((struct skb_shared_info *)((skb)->end))->frags[i]; | |
27390 | } | |
27391 | } else if (i < (65536/(1UL << 12) + 2)) { | |
27392 | if (copy > (1UL << 12)) | |
27393 | copy = (1UL << 12); | |
27394 | page = alloc_pages_node(((0)), sk->sk_allocation, 0); | |
27395 | if (page == ((void *)0)) { | |
27396 | err = -12; | |
27397 | goto error; | |
27398 | } | |
27399 | sk->sk_sndmsg_page = page; | |
27400 | sk->sk_sndmsg_off = 0; | |
27401 | ||
27402 | skb_fill_page_desc(skb, i, page, 0, 0); | |
27403 | frag = &((struct skb_shared_info *)((skb)->end))->frags[i]; | |
27404 | skb->truesize += (1UL << 12); | |
27405 | atomic_add((1UL << 12), &sk->sk_wmem_alloc); | |
27406 | } else { | |
27407 | err = -90; | |
27408 | goto error; | |
27409 | } | |
27410 | if (getfrag(from, lowmem_page_address(frag->page)+frag->page_offset+frag->size, offset, copy, skb->len, skb) < 0) { | |
27411 | err = -14; | |
27412 | goto error; | |
27413 | } | |
27414 | sk->sk_sndmsg_off += copy; | |
27415 | frag->size += copy; | |
27416 | skb->len += copy; | |
27417 | skb->data_len += copy; | |
27418 | } | |
27419 | offset += copy; | |
27420 | length -= copy; | |
27421 | } | |
27422 | ||
27423 | return 0; | |
27424 | ||
27425 | error: | |
27426 | inet->cork.length -= length; | |
27427 | (({ (void)((0)); ((ip_statistics[!(((current_thread_info()->preempt_count) & (((1UL << (8))-1) << (0 + 8))))])); })->mibs[IPSTATS_MIB_OUTDISCARDS]++); | |
27428 | return err; | |
27429 | } | |
27430 | ||
27431 | ssize_t ip_append_page(struct sock *sk, struct page *page, | |
27432 | int offset, size_t size, int flags) | |
27433 | { | |
27434 | struct inet_sock *inet = inet_sk(sk); | |
27435 | struct sk_buff *skb; | |
27436 | struct rtable *rt; | |
27437 | struct ip_options *opt = ((void *)0); | |
27438 | int hh_len; | |
27439 | int mtu; | |
27440 | int len; | |
27441 | int err; | |
27442 | unsigned int maxfraglen, fragheaderlen, fraggap; | |
27443 | ||
27444 | if (inet->hdrincl) | |
27445 | return -1; | |
27446 | ||
27447 | if (flags&0x10) | |
27448 | return 0; | |
27449 | ||
27450 | if (skb_queue_empty(&sk->sk_write_queue)) | |
27451 | return -22; | |
27452 | ||
27453 | rt = inet->cork.rt; | |
27454 | if (inet->cork.flags & 1) | |
27455 | opt = inet->cork.opt; | |
27456 | ||
27457 | if (!(rt->u.dst.dev->features&1)) | |
27458 | return -95; | |
27459 | ||
27460 | hh_len = (((rt->u.dst.dev)->hard_header_len&~(16 - 1)) + 16); | |
27461 | mtu = inet->cork.fragsize; | |
27462 | ||
27463 | fragheaderlen = sizeof(struct iphdr) + (opt ? opt->optlen : 0); | |
27464 | maxfraglen = ((mtu - fragheaderlen) & ~7) + fragheaderlen; | |
27465 | ||
27466 | if (inet->cork.length + size > 0xFFFF - fragheaderlen) { | |
27467 | ip_local_error(sk, 90, rt->rt_dst, inet->dport, mtu); | |
27468 | return -90; | |
27469 | } | |
27470 | ||
27471 | if ((skb = skb_peek_tail(&sk->sk_write_queue)) == ((void *)0)) | |
27472 | return -22; | |
27473 | ||
27474 | inet->cork.length += size; | |
27475 | if ((sk->sk_protocol == IPPROTO_UDP) && | |
27476 | (rt->u.dst.dev->features & (SKB_GSO_UDP << 16))) { | |
27477 | ((struct skb_shared_info *)((skb)->end))->gso_size = mtu - fragheaderlen; | |
27478 | ((struct skb_shared_info *)((skb)->end))->gso_type = SKB_GSO_UDP; | |
27479 | } | |
27480 | ||
27481 | ||
27482 | while (size > 0) { | |
27483 | int i; | |
27484 | ||
27485 | if (skb_is_gso(skb)) | |
27486 | len = size; | |
27487 | else { | |
27488 | ||
27489 | ||
27490 | len = mtu - skb->len; | |
27491 | if (len < size) | |
27492 | len = maxfraglen - skb->len; | |
27493 | } | |
27494 | if (len <= 0) { | |
27495 | struct sk_buff *skb_prev; | |
27496 | char *data; | |
27497 | struct iphdr *iph; | |
27498 | int alloclen; | |
27499 | ||
27500 | skb_prev = skb; | |
27501 | fraggap = skb_prev->len - maxfraglen; | |
27502 | ||
27503 | alloclen = fragheaderlen + hh_len + fraggap + 15; | |
27504 | skb = sock_wmalloc(sk, alloclen, 1, sk->sk_allocation); | |
27505 | if (__builtin_expect(!!(!skb), 0)) { | |
27506 | err = -105; | |
27507 | goto error; | |
27508 | } | |
27509 | ||
27510 | ||
27511 | ||
27512 | ||
27513 | skb->ip_summed = 0; | |
27514 | skb->csum = 0; | |
27515 | skb_reserve(skb, hh_len); | |
27516 | ||
27517 | ||
27518 | ||
27519 | ||
27520 | data = skb_put(skb, fragheaderlen + fraggap); | |
27521 | skb->nh.iph = iph = (struct iphdr *)data; | |
27522 | data += fragheaderlen; | |
27523 | skb->h.raw = data; | |
27524 | ||
27525 | if (fraggap) { | |
27526 | skb->csum = skb_copy_and_csum_bits( | |
27527 | skb_prev, maxfraglen, | |
27528 | data, fraggap, 0); | |
27529 | skb_prev->csum = csum_sub(skb_prev->csum, | |
27530 | skb->csum); | |
27531 | pskb_trim_unique(skb_prev, maxfraglen); | |
27532 | } | |
27533 | ||
27534 | ||
27535 | ||
27536 | ||
27537 | __skb_queue_tail(&sk->sk_write_queue, skb); | |
27538 | continue; | |
27539 | } | |
27540 | ||
27541 | i = ((struct skb_shared_info *)((skb)->end))->nr_frags; | |
27542 | if (len > size) | |
27543 | len = size; | |
27544 | if (skb_can_coalesce(skb, i, page, offset)) { | |
27545 | ((struct skb_shared_info *)((skb)->end))->frags[i-1].size += len; | |
27546 | } else if (i < (65536/(1UL << 12) + 2)) { | |
27547 | get_page(page); | |
27548 | skb_fill_page_desc(skb, i, page, offset, len); | |
27549 | } else { | |
27550 | err = -90; | |
27551 | goto error; | |
27552 | } | |
27553 | ||
27554 | if (skb->ip_summed == 0) { | |
27555 | unsigned int csum; | |
27556 | csum = csum_page(page, offset, len); | |
27557 | skb->csum = csum_block_add(skb->csum, csum, skb->len); | |
27558 | } | |
27559 | ||
27560 | skb->len += len; | |
27561 | skb->data_len += len; | |
27562 | offset += len; | |
27563 | size -= len; | |
27564 | } | |
27565 | return 0; | |
27566 | ||
27567 | error: | |
27568 | inet->cork.length -= size; | |
27569 | (({ (void)((0)); ((ip_statistics[!(((current_thread_info()->preempt_count) & (((1UL << (8))-1) << (0 + 8))))])); })->mibs[IPSTATS_MIB_OUTDISCARDS]++); | |
27570 | return err; | |
27571 | } | |
27572 | ||
27573 | ||
27574 | ||
27575 | ||
27576 | ||
27577 | int ip_push_pending_frames(struct sock *sk) | |
27578 | { | |
27579 | struct sk_buff *skb, *tmp_skb; | |
27580 | struct sk_buff **tail_skb; | |
27581 | struct inet_sock *inet = inet_sk(sk); | |
27582 | struct ip_options *opt = ((void *)0); | |
27583 | struct rtable *rt = inet->cork.rt; | |
27584 | struct iphdr *iph; | |
27585 | __be16 df = 0; | |
27586 | __u8 ttl; | |
27587 | int err = 0; | |
27588 | ||
27589 | if ((skb = __skb_dequeue(&sk->sk_write_queue)) == ((void *)0)) | |
27590 | goto out; | |
27591 | tail_skb = &(((struct skb_shared_info *)((skb)->end))->frag_list); | |
27592 | ||
27593 | ||
27594 | if (skb->data < skb->nh.raw) | |
27595 | __skb_pull(skb, skb->nh.raw - skb->data); | |
27596 | while ((tmp_skb = __skb_dequeue(&sk->sk_write_queue)) != ((void *)0)) { | |
27597 | __skb_pull(tmp_skb, skb->h.raw - skb->nh.raw); | |
27598 | *tail_skb = tmp_skb; | |
27599 | tail_skb = &(tmp_skb->next); | |
27600 | skb->len += tmp_skb->len; | |
27601 | skb->data_len += tmp_skb->len; | |
27602 | skb->truesize += tmp_skb->truesize; | |
27603 | __sock_put(tmp_skb->sk); | |
27604 | tmp_skb->destructor = ((void *)0); | |
27605 | tmp_skb->sk = ((void *)0); | |
27606 | } | |
27607 | ||
27608 | ||
27609 | ||
27610 | ||
27611 | ||
27612 | if (inet->pmtudisc != 2) | |
27613 | skb->local_df = 1; | |
27614 | ||
27615 | ||
27616 | ||
27617 | ||
27618 | if (inet->pmtudisc == 2 || | |
27619 | (skb->len <= dst_mtu(&rt->u.dst) && | |
27620 | ip_dont_fragment(sk, &rt->u.dst))) | |
27621 | df = htons(0x4000); | |
27622 | ||
27623 | if (inet->cork.flags & 1) | |
27624 | opt = inet->cork.opt; | |
27625 | ||
27626 | if (rt->rt_type == RTN_MULTICAST) | |
27627 | ttl = inet->mc_ttl; | |
27628 | else | |
27629 | ttl = ip_select_ttl(inet, &rt->u.dst); | |
27630 | ||
27631 | iph = (struct iphdr *)skb->data; | |
27632 | iph->version = 4; | |
27633 | iph->ihl = 5; | |
27634 | if (opt) { | |
27635 | iph->ihl += opt->optlen>>2; | |
27636 | ip_options_build(skb, opt, inet->cork.addr, rt, 0); | |
27637 | } | |
27638 | iph->tos = inet->tos; | |
27639 | iph->tot_len = htons(skb->len); | |
27640 | iph->frag_off = df; | |
27641 | ip_select_ident(iph, &rt->u.dst, sk); | |
27642 | iph->ttl = ttl; | |
27643 | iph->protocol = sk->sk_protocol; | |
27644 | iph->saddr = rt->rt_src; | |
27645 | iph->daddr = rt->rt_dst; | |
27646 | ip_send_check(iph); | |
27647 | ||
27648 | skb->priority = sk->sk_priority; | |
27649 | skb->dst = dst_clone(&rt->u.dst); | |
27650 | ||
27651 | ||
27652 | err = (dst_output)(skb); | |
27653 | ||
27654 | if (err) { | |
27655 | if (err > 0) | |
27656 | err = inet->recverr ? ((err) != 2 ? -105 : 0) : 0; | |
27657 | if (err) | |
27658 | goto error; | |
27659 | } | |
27660 | ||
27661 | out: | |
27662 | inet->cork.flags &= ~1; | |
27663 | kfree(inet->cork.opt); | |
27664 | inet->cork.opt = ((void *)0); | |
27665 | if (inet->cork.rt) { | |
27666 | ip_rt_put(inet->cork.rt); | |
27667 | inet->cork.rt = ((void *)0); | |
27668 | } | |
27669 | return err; | |
27670 | ||
27671 | error: | |
27672 | (({ (void)((0)); ((ip_statistics[!(((current_thread_info()->preempt_count) & (((1UL << (8))-1) << (0 + 8))))])); })->mibs[IPSTATS_MIB_OUTDISCARDS]++); | |
27673 | goto out; | |
27674 | } | |
27675 | ||
27676 | ||
27677 | ||
27678 | ||
27679 | void ip_flush_pending_frames(struct sock *sk) | |
27680 | { | |
27681 | struct inet_sock *inet = inet_sk(sk); | |
27682 | struct sk_buff *skb; | |
27683 | ||
27684 | while ((skb = __skb_dequeue_tail(&sk->sk_write_queue)) != ((void *)0)) | |
27685 | kfree_skb(skb); | |
27686 | ||
27687 | inet->cork.flags &= ~1; | |
27688 | kfree(inet->cork.opt); | |
27689 | inet->cork.opt = ((void *)0); | |
27690 | if (inet->cork.rt) { | |
27691 | ip_rt_put(inet->cork.rt); | |
27692 | inet->cork.rt = ((void *)0); | |
27693 | } | |
27694 | } | |
27695 | ||
27696 | ||
27697 | ||
27698 | ||
27699 | ||
27700 | static int ip_reply_glue_bits(void *dptr, char *to, int offset, | |
27701 | int len, int odd, struct sk_buff *skb) | |
27702 | { | |
27703 | unsigned int csum; | |
27704 | ||
27705 | csum = csum_partial_copy((dptr+offset), (to), (len), (0)); | |
27706 | skb->csum = csum_block_add(skb->csum, csum, odd); | |
27707 | return 0; | |
27708 | } | |
27709 | # 1335 "net/ipv4/ip_output.c" | |
27710 | void ip_send_reply(struct sock *sk, struct sk_buff *skb, struct ip_reply_arg *arg, | |
27711 | unsigned int len) | |
27712 | { | |
27713 | struct inet_sock *inet = inet_sk(sk); | |
27714 | struct { | |
27715 | struct ip_options opt; | |
27716 | char data[40]; | |
27717 | } replyopts; | |
27718 | struct ipcm_cookie ipc; | |
27719 | __be32 daddr; | |
27720 | struct rtable *rt = (struct rtable*)skb->dst; | |
27721 | ||
27722 | if (ip_options_echo(&replyopts.opt, skb)) | |
27723 | return; | |
27724 | ||
27725 | daddr = ipc.addr = rt->rt_src; | |
27726 | ipc.opt = ((void *)0); | |
27727 | ||
27728 | if (replyopts.opt.optlen) { | |
27729 | ipc.opt = &replyopts.opt; | |
27730 | ||
27731 | if (ipc.opt->srr) | |
27732 | daddr = replyopts.opt.faddr; | |
27733 | } | |
27734 | ||
27735 | { | |
27736 | struct flowi fl = { .nl_u = { .ip4_u = | |
27737 | { .daddr = daddr, | |
27738 | .saddr = rt->rt_spec_dst, | |
27739 | .tos = ((skb->nh.iph->tos)&0x1E) } }, | |
27740 | ||
27741 | .uli_u = { .ports = | |
27742 | { .sport = skb->h.th->dest, | |
27743 | .dport = skb->h.th->source } }, | |
27744 | .proto = sk->sk_protocol }; | |
27745 | security_skb_classify_flow(skb, &fl); | |
27746 | if (ip_route_output_key(&rt, &fl)) | |
27747 | return; | |
27748 | } | |
27749 | ||
27750 | ||
27751 | ||
27752 | ||
27753 | ||
27754 | ||
27755 | ||
27756 | do { do { } while (0); (void)0; (void)(&((sk)->sk_lock.slock)); } while (0); | |
27757 | inet->tos = skb->nh.iph->tos; | |
27758 | sk->sk_priority = skb->priority; | |
27759 | sk->sk_protocol = skb->nh.iph->protocol; | |
27760 | ip_append_data(sk, ip_reply_glue_bits, arg->iov->iov_base, len, 0, | |
27761 | &ipc, rt, 0x40); | |
27762 | if ((skb = skb_peek(&sk->sk_write_queue)) != ((void *)0)) { | |
27763 | if (arg->csumoffset >= 0) | |
27764 | *((u16 *)skb->h.raw + arg->csumoffset) = csum_fold(csum_add(skb->csum, arg->csum)); | |
27765 | skb->ip_summed = 0; | |
27766 | ip_push_pending_frames(sk); | |
27767 | } | |
27768 | ||
27769 | do { do { } while (0); (void)0; (void)(&((sk)->sk_lock.slock)); } while (0); | |
27770 | ||
27771 | ip_rt_put(rt); | |
27772 | } | |
27773 | ||
27774 | void __attribute__ ((__section__ (".init.text"))) ip_init(void) | |
27775 | { | |
27776 | ip_rt_init(); | |
27777 | inet_initpeers(); | |
27778 | ||
27779 | ||
27780 | ||
27781 | ||
27782 | } | |
27783 | ||
27784 | extern typeof(ip_generic_getfrag) ip_generic_getfrag; static const char __kstrtab_ip_generic_getfrag[] __attribute__((section("__ksymtab_strings"))) = "_" "ip_generic_getfrag"; static const struct kernel_symbol __ksymtab_ip_generic_getfrag __attribute__((__used__)) __attribute__((section("__ksymtab" ""), unused)) = { (unsigned long)&ip_generic_getfrag, __kstrtab_ip_generic_getfrag }; | |
27785 | extern typeof(ip_queue_xmit) ip_queue_xmit; static const char __kstrtab_ip_queue_xmit[] __attribute__((section("__ksymtab_strings"))) = "_" "ip_queue_xmit"; static const struct kernel_symbol __ksymtab_ip_queue_xmit __attribute__((__used__)) __attribute__((section("__ksymtab" ""), unused)) = { (unsigned long)&ip_queue_xmit, __kstrtab_ip_queue_xmit }; | |
27786 | extern typeof(ip_send_check) ip_send_check; static const char __kstrtab_ip_send_check[] __attribute__((section("__ksymtab_strings"))) = "_" "ip_send_check"; static const struct kernel_symbol __ksymtab_ip_send_check __attribute__((__used__)) __attribute__((section("__ksymtab" ""), unused)) = { (unsigned long)&ip_send_check, __kstrtab_ip_send_check }; |