patch-1.3.35 linux/include/linux/random.h

Next file: linux/include/linux/rpcsock.h
Previous file: linux/include/linux/major.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.34/linux/include/linux/random.h linux/include/linux/random.h
@@ -4,33 +4,44 @@
  * Include file for the random number generator.
  */
 
-/*
- * We should always include the random number generator, since it's
- * relatively small, and it's most useful when application developers
- * can assume that all Linux systems have it.  (Ideally, it would be
- * best if we could assume that all Unix systems had it, but oh
- * well....)
- * 
- * Also, many kernel routines will have a use for good random numbers,
- * for example, for truely random TCP sequence numbers, which prevent
- * certain forms of TCP spoofing attacks.
- */
-#define CONFIG_RANDOM
+#ifndef _LINUX_RANDOM_H
+#define _LINUX_RANDOM_H
+
+/* ioctl()'s for the random number generator */
+
+#define RNDGETENTCNT	0x01080000
+#define RNDADDTOENTCNT	0x01080001
+#define RNDGETPOOL	0x01080002
+
+struct rand_pool_state {
+	int	entropy_count;
+	int	pool_size;
+	__u32	pool[0];
+};
 
 /* Exported functions */
 
-#ifdef CONFIG_RANDOM
+#ifdef __KERNEL__
+
 void rand_initialize(void);
+void rand_initialize_irq(int irq);
+void rand_initialize_blkdev(int irq);
 
 void add_keyboard_randomness(unsigned char scancode);
+void add_mouse_randomness(__u32 mouse_data);
 void add_interrupt_randomness(int irq);
+void add_blkdev_randomness(int major);
 
 void get_random_bytes(void *buf, int nbytes);
 int read_random(struct inode * inode, struct file * file,
 		char * buf, int nbytes);
 int read_random_unlimited(struct inode * inode, struct file * file,
 			  char * buf, int nbytes);
-#else
-#define add_keyboard_randomness(x)
-#define add_interrupt_randomness(x)
-#endif
+int write_random(struct inode * inode, struct file * file,
+		 const char * buffer, int count);
+int random_ioctl(struct inode * inode, struct file * file,
+		 unsigned int cmd, unsigned long arg);
+
+#endif /* __KERNEL___ */
+
+#endif /* _LINUX_RANDOM_H */

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this