Deprecate bro_srandom(), replace with zeek::seed_random().

Avoiding zeek::srandom() to avoid potential for confusion with srandom()
This commit is contained in:
Jon Siwek 2020-07-22 11:09:48 -07:00
parent d486af06b1
commit b17627fa09
3 changed files with 16 additions and 2 deletions

View file

@ -230,6 +230,7 @@ long int bro_random();
// Calls the system srandom() function with the given seed if not running
// in deterministic mode, else it updates the state of the deterministic PRNG.
[[deprecated("Remove in v4.1. Use zeek::seed_random()")]]
void bro_srandom(unsigned int seed);
extern uint64_t rand64bit();
@ -614,4 +615,12 @@ long int random_number();
*/
long int max_random();
/**
* Wrapper for system srandom() in the default case, but when running in
* deterministic mode, updates the state used for calling zeek::prng()
* inside of zeek::random_number().
* @param seed Value to use for initializing the PRNG.
*/
void seed_random(unsigned int seed);
} // namespace zeek