root/include/linux/random.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


   1 /*
   2  * include/linux/random.h
   3  *
   4  * Include file for the random number generator.
   5  */
   6 
   7 #ifndef _LINUX_RANDOM_H
   8 #define _LINUX_RANDOM_H
   9 
  10 /* ioctl()'s for the random number generator */
  11 
  12 /* Get the entropy count. */
  13 #define RNDGETENTCNT    0x01080000
  14 
  15 /* Add to (or subtract from) the entropy count.  (Superuser only.) */
  16 #define RNDADDTOENTCNT  0x01080001
  17 
  18 /* Get the contents of the entropy pool.  (Superuser only.) */
  19 #define RNDGETPOOL      0x01080002
  20 
  21 /* 
  22  * Write bytes into the entropy pool and add to the entropy count.
  23  * (Superuser only.)
  24  */
  25 #define RNDADDENTROPY   0x01080003
  26 
  27 /* Clear entropy count to 0.  (Superuser only.) */
  28 #define RNDZAPENTCNT    0x01080004
  29 
  30 /* Clear the entropy pool and associated counters.  (Superuser only.) */
  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 /* Exported functions */
  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 /* __KERNEL___ */
  59 
  60 #endif /* _LINUX_RANDOM_H */

/* [previous][next][first][last][top][bottom][index][help] */