mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 01:58:20 +00:00
Refactoring various usages of new IPAddr class.
Reducing number of places that internal representation was exposed via GetBytes/CopyIPv6. Also fixed a bug in remask_addr bif.
This commit is contained in:
parent
d887eb3178
commit
d7dafe2fe2
24 changed files with 301 additions and 267 deletions
|
@ -32,12 +32,8 @@ TCP_Endpoint::TCP_Endpoint(TCP_Analyzer* arg_analyzer, int arg_is_orig)
|
|||
dst_addr = is_orig ? tcp_analyzer->Conn()->OrigAddr() :
|
||||
tcp_analyzer->Conn()->RespAddr();
|
||||
|
||||
const uint32* src_bytes;
|
||||
const uint32* dst_bytes;
|
||||
int n = src_addr.GetBytes(&src_bytes);
|
||||
int m = dst_addr.GetBytes(&dst_bytes);
|
||||
checksum_base = ones_complement_checksum((void*) src_bytes, n*4, 0);
|
||||
checksum_base = ones_complement_checksum((void*) dst_bytes, m*4, checksum_base);
|
||||
checksum_base = ones_complement_checksum(src_addr, 0);
|
||||
checksum_base = ones_complement_checksum(dst_addr, checksum_base);
|
||||
// Note, for IPv6, strictly speaking this field is 32 bits
|
||||
// rather than 16 bits. But because the upper bits are all zero,
|
||||
// we get the same checksum either way. The same applies to
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue