Merge remote branch 'origin/topic/robin/conn-ids'

* origin/topic/robin/conn-ids:
  Moving uid from conn_id to connection, and making output determistic if a hash seed is given.
  Extending conn_id with a globally unique identifiers.
This commit is contained in:
Robin Sommer 2011-04-22 22:09:44 -07:00
commit 59d6202104
16 changed files with 271 additions and 6 deletions

View file

@ -340,6 +340,27 @@ int atoi_n(int len, const char* s, const char** end, int base, int& result)
return 1;
}
char* uitoa_n(uint64 value, char* str, int n, int base)
{
static char dig[] = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
int i = 0;
uint64 v;
char* p, *q;
char c;
v = value;
do {
str[i++] = dig[v % base];
v /= base;
} while ( v && i < n - 1 );
str[i] = '\0';
return str;
}
int strstr_n(const int big_len, const u_char* big,
const int little_len, const u_char* little)
{
@ -661,6 +682,11 @@ void init_random_seed(uint32 seed, const char* read_file, const char* write_file
write_file);
}
bool have_random_seed()
{
return bro_rand_determistic;
}
long int bro_random()
{
if ( ! bro_rand_determistic )