diff --git a/CHANGES b/CHANGES index ff70e07e34..563719caf7 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ + 100. [cleanup] does not need or + . isc_random_t moved to . + 99. [cleanup] Rate limiter now has separate shutdown() and destroy() functions, and it guarantees that all queued events are delivered even in the shutdown case. diff --git a/lib/isc/include/isc/random.h b/lib/isc/include/isc/random.h index 7971fff028..232f81a76d 100644 --- a/lib/isc/include/isc/random.h +++ b/lib/isc/include/isc/random.h @@ -19,9 +19,7 @@ #define ISC_RANDOM_H 1 #include -#include -#include -#include +#include /* * Implements a random state pool which will let the caller return a @@ -32,16 +30,18 @@ ISC_LANG_BEGINDECLS -typedef struct { +struct isc_random { unsigned int magic; #if 0 isc_mutex_t lock; #endif -} isc_random_t; +}; + #define ISC_RANDOM_MAGIC 0x52416e64 /* RAnd. */ #define ISC_RANDOM_VALID(x) ((x) != NULL && (x->magic) == ISC_RANDOM_MAGIC) -isc_result_t isc_random_init(isc_random_t *r); +isc_result_t +isc_random_init(isc_random_t *r); /* * Initialize a random state. * @@ -51,7 +51,8 @@ isc_result_t isc_random_init(isc_random_t *r); * r != NULL. */ -isc_result_t isc_random_invalidate(isc_random_t *r); +isc_result_t +isc_random_invalidate(isc_random_t *r); /* * Invalidate a random state. This will wipe any information contained in * the state and make it unusable. @@ -60,7 +61,8 @@ isc_result_t isc_random_invalidate(isc_random_t *r); * r be a valid pool. */ -void isc_random_seed(isc_random_t *r, isc_uint32_t seed); +void +isc_random_seed(isc_random_t *r, isc_uint32_t seed); /* * Set the initial seed of the random state. Note that on some systems * the private state isn't all that private, and setting the seed may @@ -70,7 +72,8 @@ void isc_random_seed(isc_random_t *r, isc_uint32_t seed); * r be a valid pool. */ -void isc_random_get(isc_random_t *r, isc_uint32_t *val); +void +isc_random_get(isc_random_t *r, isc_uint32_t *val); /* * Get a random value. Note that on some systems the private state isn't * all that private, and getting a value may alter what other state pools diff --git a/lib/isc/include/isc/types.h b/lib/isc/include/isc/types.h index 56b4a35d57..65ee27e45e 100644 --- a/lib/isc/include/isc/types.h +++ b/lib/isc/include/isc/types.h @@ -45,6 +45,7 @@ typedef struct isc_mempool isc_mempool_t; typedef struct isc_msgcat isc_msgcat_t; typedef struct isc_ondestroy isc_ondestroy_t; typedef struct isc_netaddr isc_netaddr_t; +typedef struct isc_random isc_random_t; typedef struct isc_region isc_region_t; typedef unsigned int isc_result_t; typedef struct isc_rwlock isc_rwlock_t;