# HG changeset patch # User asl # Date 1063042115 0 # Node ID 4b7fb094ac22f919b80d0d4f99e59ebf0e437f43 # Parent de0f96386f4f2f0b9ff2be4f73165ac887112741 * 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. diff --git a/packages/net/bsd_tcpip/current/ChangeLog b/packages/net/bsd_tcpip/current/ChangeLog --- a/packages/net/bsd_tcpip/current/ChangeLog +++ b/packages/net/bsd_tcpip/current/ChangeLog @@ -1,3 +1,9 @@ +2003-09-08 Andrew Lunn + + * 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 * include/netinet/icmp_var.h diff --git a/packages/net/bsd_tcpip/current/include/sys/param.h b/packages/net/bsd_tcpip/current/include/sys/param.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); diff --git a/packages/net/bsd_tcpip/current/src/ecos/support.c b/packages/net/bsd_tcpip/current/src/ecos/support.c --- 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) {