1
2
3
4
5
6
7 #ifndef _LINUX_RANDOM_H
8 #define _LINUX_RANDOM_H
9
10
11
12
13 #define RNDGETENTCNT 0x01080000
14
15
16 #define RNDADDTOENTCNT 0x01080001
17
18
19 #define RNDGETPOOL 0x01080002
20
21
22
23
24
25 #define RNDADDENTROPY 0x01080003
26
27
28 #define RNDZAPENTCNT 0x01080004
29
30
31 #define RNDCLEARPOOL 0x01080006
32
33 struct rand_pool_info {
34 int entropy_count;
35 int buf_size;
36 __u32 buf[0];
37 };
38
39
40
41 #ifdef __KERNEL__
42
43 extern void rand_initialize(void);
44 extern void rand_initialize_irq(int irq);
45 extern void rand_initialize_blkdev(int irq, int mode);
46
47 extern void add_keyboard_randomness(unsigned char scancode);
48 extern void add_mouse_randomness(__u32 mouse_data);
49 extern void add_interrupt_randomness(int irq);
50 extern void add_blkdev_randomness(int major);
51
52 extern void get_random_bytes(void *buf, int nbytes);
53
54 #ifndef MODULE
55 extern struct file_operations random_fops, urandom_fops;
56 #endif
57
58 #endif
59
60 #endif