Move Autoconf's macro definitions into config.h.
[openvswitch] / lib / random.c
index 55507e027ed30aa58cff2723cfc51afaff5c2028..c7a3edf7468edd9fd17a759cd59ee50edfba9ff5 100644 (file)
@@ -31,6 +31,7 @@
  * derivatives without specific, written prior permission.
  */
 
+#include <config.h>
 #include "random.h"
 
 #include <errno.h>
@@ -70,3 +71,9 @@ random_uint32(void)
     random_bytes(&x, sizeof x);
     return x;
 }
+
+int
+random_range(int max) 
+{
+    return random_uint32() % max;
+}