mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 22:58:20 +00:00
expose some TCP analyzer utility functions for use by derived classes
This commit is contained in:
parent
aebcb1415d
commit
85acdc14e4
2 changed files with 12 additions and 4 deletions
|
@ -1019,9 +1019,9 @@ void TCP_Analyzer::CheckPIA_FirstPacket(int is_orig, const IP_Hdr* ip)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint64 get_relative_seq(const TCP_Endpoint* endpoint,
|
uint64 TCP_Analyzer::get_relative_seq(const TCP_Endpoint* endpoint,
|
||||||
uint32 cur_base, uint32 last, uint32 wraps,
|
uint32 cur_base, uint32 last,
|
||||||
bool* underflow = 0)
|
uint32 wraps, bool* underflow)
|
||||||
{
|
{
|
||||||
int32 delta = seq_delta(cur_base, last);
|
int32 delta = seq_delta(cur_base, last);
|
||||||
|
|
||||||
|
@ -1052,7 +1052,7 @@ static uint64 get_relative_seq(const TCP_Endpoint* endpoint,
|
||||||
return endpoint->ToRelativeSeqSpace(cur_base, wraps);
|
return endpoint->ToRelativeSeqSpace(cur_base, wraps);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int get_segment_len(int payload_len, TCP_Flags flags)
|
int TCP_Analyzer::get_segment_len(int payload_len, TCP_Flags flags)
|
||||||
{
|
{
|
||||||
int seg_len = payload_len;
|
int seg_len = payload_len;
|
||||||
|
|
||||||
|
|
|
@ -174,6 +174,14 @@ protected:
|
||||||
const u_char* option, TCP_Analyzer* analyzer,
|
const u_char* option, TCP_Analyzer* analyzer,
|
||||||
bool is_orig, void* cookie);
|
bool is_orig, void* cookie);
|
||||||
|
|
||||||
|
// A couple of handle utility functions that we make available
|
||||||
|
// to any derived analyzers.
|
||||||
|
static uint64 get_relative_seq(const TCP_Endpoint* endpoint,
|
||||||
|
uint32 cur_base, uint32 last,
|
||||||
|
uint32 wraps, bool* underflow = 0);
|
||||||
|
|
||||||
|
static int get_segment_len(int payload_len, TCP_Flags flags);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
TCP_Endpoint* orig;
|
TCP_Endpoint* orig;
|
||||||
TCP_Endpoint* resp;
|
TCP_Endpoint* resp;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue