mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 23:58:20 +00:00
Rework Session/Connection tracking to use a std::map instead of PDict
This commit is contained in:
parent
8ab0650c1e
commit
57f29f3e7c
7 changed files with 183 additions and 147 deletions
|
@ -14,14 +14,9 @@ const uint8_t IPAddr::v4_mapped_prefix[12] = { 0, 0, 0, 0,
|
|||
0, 0, 0, 0,
|
||||
0, 0, 0xff, 0xff };
|
||||
|
||||
HashKey* BuildConnIDHashKey(const ConnID& id)
|
||||
ConnIDKey BuildConnIDKey(const ConnID& id)
|
||||
{
|
||||
struct {
|
||||
in6_addr ip1;
|
||||
in6_addr ip2;
|
||||
uint16_t port1;
|
||||
uint16_t port2;
|
||||
} key;
|
||||
ConnIDKey key;
|
||||
|
||||
// Lookup up connection based on canonical ordering, which is
|
||||
// the smaller of <src addr, src port> and <dst addr, dst port>
|
||||
|
@ -43,7 +38,7 @@ HashKey* BuildConnIDHashKey(const ConnID& id)
|
|||
key.port2 = id.src_port;
|
||||
}
|
||||
|
||||
return new HashKey(&key, sizeof(key));
|
||||
return key;
|
||||
}
|
||||
|
||||
static inline uint32_t bit_mask32(int bottom_bits)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue