mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Extending conn_id with a globally unique identifiers.
This commit is contained in:
parent
0f854315e9
commit
881071cc99
6 changed files with 73 additions and 4 deletions
20
src/util.cc
20
src/util.cc
|
@ -340,6 +340,26 @@ 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 );
|
||||
|
||||
str[i] = '\0';
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
int strstr_n(const int big_len, const u_char* big,
|
||||
const int little_len, const u_char* little)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue