Move get_relative_seq and get_segment_len to public static methods

This commit is contained in:
Tim Wojtulewicz 2023-02-16 10:45:11 -07:00
parent f6872b588e
commit 024d3a227a
2 changed files with 8 additions and 3 deletions

View file

@ -77,7 +77,7 @@ void TCPSessionAdapter::Done()
finished = 1;
}
static int get_segment_len(int payload_len, analyzer::tcp::TCP_Flags flags)
int TCPSessionAdapter::get_segment_len(int payload_len, analyzer::tcp::TCP_Flags flags)
{
int seg_len = payload_len;
@ -175,8 +175,9 @@ static void init_endpoint(analyzer::tcp::TCP_Endpoint* endpoint, analyzer::tcp::
}
}
static uint64_t get_relative_seq(const analyzer::tcp::TCP_Endpoint* endpoint, uint32_t cur_base,
uint32_t last, uint32_t wraps, bool* underflow)
uint64_t TCPSessionAdapter::get_relative_seq(const analyzer::tcp::TCP_Endpoint* endpoint,
uint32_t cur_base, uint32_t last, uint32_t wraps,
bool* underflow)
{
int32_t delta = seq_delta(cur_base, last);

View file

@ -78,6 +78,10 @@ public:
void AddExtraAnalyzers(Connection* conn) override;
static int get_segment_len(int payload_len, analyzer::tcp::TCP_Flags flags);
static uint64_t get_relative_seq(const analyzer::tcp::TCP_Endpoint* endpoint, uint32_t cur_base,
uint32_t last, uint32_t wraps, bool* underflow);
protected:
friend class analyzer::tcp::TCP_ApplicationAnalyzer;
friend class analyzer::tcp::TCP_Endpoint;