patch-1.3.30 linux/include/linux/random.h
Next file: linux/include/linux/sched.h
Previous file: linux/include/linux/pci.h
Back to the patch index
Back to the overall index
- Lines: 37
- Date:
Mon Sep 25 08:19:07 1995
- Orig file:
v1.3.29/linux/include/linux/random.h
- Orig date:
Thu Jan 1 02:00:00 1970
diff -u --recursive --new-file v1.3.29/linux/include/linux/random.h linux/include/linux/random.h
@@ -0,0 +1,36 @@
+/*
+ * include/linux/random.h
+ *
+ * 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
+
+/* Exported functions */
+
+#ifdef CONFIG_RANDOM
+void rand_initialize(void);
+
+void add_keyboard_randomness(unsigned char scancode);
+void add_interrupt_randomness(int irq);
+
+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
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