changeset 1204:4b7fb094ac22

* src/ecos/support.c (read_random): New function which is needed when CYGSEM_NET_RANDOMID is enabled. * include/sys/param.h: Prototype for new function.
author asl
date Mon, 08 Sep 2003 17:28:35 +0000
parents de0f96386f4f
children 39d2693b1adc
files packages/net/bsd_tcpip/current/ChangeLog packages/net/bsd_tcpip/current/include/sys/param.h packages/net/bsd_tcpip/current/src/ecos/support.c
diffstat 3 files changed, 14 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/packages/net/bsd_tcpip/current/ChangeLog
+++ b/packages/net/bsd_tcpip/current/ChangeLog
@@ -1,3 +1,9 @@
+2003-09-08  Andrew Lunn  <andrew.lunn@ascom.ch>
+
+	* src/ecos/support.c (read_random): New function which is needed
+	when CYGSEM_NET_RANDOMID is enabled.
+	* include/sys/param.h: Prototype for new function.
+
 2003-07-25  Andrew Lunn  <andrew.lunn@ascom.ch>
 
 	* include/netinet/icmp_var.h 
--- a/packages/net/bsd_tcpip/current/include/sys/param.h
+++ b/packages/net/bsd_tcpip/current/include/sys/param.h
@@ -877,6 +877,7 @@ extern void ovbcopy(const void *s, void 
 extern void get_mono_time(void);
 extern int arc4random(void);
 extern void get_random_bytes(void *buf, size_t len);
+extern void read_random(void *buf, size_t len);
 extern void read_random_unlimited(void *buf, size_t len);
 extern void *hashinit(int elements, void *type, u_long *hashmask);
 
--- a/packages/net/bsd_tcpip/current/src/ecos/support.c
+++ b/packages/net/bsd_tcpip/current/src/ecos/support.c
@@ -562,6 +562,13 @@ read_random_unlimited(void *buf, size_t 
     get_random_bytes(buf, len);
 }
 
+void read_random(void *buf, size_t len) 
+{
+    CYG_ASSERT(0 == (len & ~3), "Only multiple of words allowed");
+  
+    get_random_bytes(buf, len);
+}
+
 void 
 microtime(struct timeval *tp)
 {