mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
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:
commit
59d6202104
16 changed files with 271 additions and 6 deletions
26
src/util.cc
26
src/util.cc
|
@ -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 )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue