Move everything in util.h to zeek::util namespace.

This commit includes renaming a number of methods prefixed with bro_ to be prefixed with zeek_.
This commit is contained in:
Tim Wojtulewicz 2020-08-06 10:40:24 -07:00
parent 8862b585fa
commit 8d2d867a65
179 changed files with 1277 additions and 1033 deletions

View file

@ -137,7 +137,7 @@ BasicBloomFilter* BasicBloomFilter::Clone() const
std::string BasicBloomFilter::InternalState() const
{
return fmt("%" PRIu64, bits->Hash());
return zeek::util::fmt("%" PRIu64, bits->Hash());
}
BasicBloomFilter::BasicBloomFilter()
@ -256,7 +256,7 @@ CountingBloomFilter* CountingBloomFilter::Clone() const
std::string CountingBloomFilter::InternalState() const
{
return fmt("%" PRIu64, cells->Hash());
return zeek::util::fmt("%" PRIu64, cells->Hash());
}
// TODO: Use partitioning in add/count to allow for reusing CMS bounds.

View file

@ -33,7 +33,7 @@ Hasher::seed_t Hasher::MakeSeed(const void* data, size_t size)
else
{
unsigned int first_seed = initial_seed();
unsigned int first_seed = zeek::util::initial_seed();
zeek::detail::hash_update(ctx, &first_seed, sizeof(first_seed));
}
@ -119,7 +119,7 @@ DefaultHasher::DefaultHasher(size_t k, Hasher::seed_t seed)
for ( size_t i = 1; i <= k; ++i )
{
seed_t s = Seed();
s.h[0] += zeek::prng(i);
s.h[0] += zeek::util::prng(i);
hash_functions.push_back(UHF(s));
}
}
@ -149,7 +149,7 @@ bool DefaultHasher::Equals(const Hasher* other) const
}
DoubleHasher::DoubleHasher(size_t k, seed_t seed)
: Hasher(k, seed), h1(seed + zeek::prng(1)), h2(seed + zeek::prng(2))
: Hasher(k, seed), h1(seed + zeek::util::prng(1)), h2(seed + zeek::util::prng(2))
{
}