Some working code. Adds UID pools classified by string. Just compiles

and runs; need to go back through and make sure this code is actually
doing what I want it to do.

Note: Added new function unique_id_from(pool: string, prefix: string)
that allows the user to explicitly specify a randomness pool to use when
generating unique IDs.
This commit is contained in:
Gilbert Clark gc355804@ohio.edu 2011-08-08 22:12:40 -07:00
parent f36310dc0e
commit 9322c063cc
10 changed files with 78 additions and 21 deletions

View file

@ -226,7 +226,10 @@ extern int time_compare(struct timeval* tv_a, struct timeval* tv_b);
// Returns an integer that's very likely to be unique, even across Bro
// instances.
#define BRO_DEFAULT_UID_POOL "bro"
#define BRO_SCRIPT_UID_POOL "bro script"
extern uint64 calculate_unique_id();
extern uint64 calculate_unique_id(const std::string& pool);
// For now, don't use hash_maps - they're not fully portable.
#if 0