Move ICMP counterpart methods outside of ICMPAnalyzer class

These were previously global methods in the old analyzer, and moving them
to be private members of ICMPAnalyzer broke the usage of them by at least
one external plugin.
This commit is contained in:
Tim Wojtulewicz 2021-05-26 14:19:56 -07:00
parent 12d768d0d8
commit 1eed8b7f67
2 changed files with 69 additions and 65 deletions

View file

@ -99,11 +99,6 @@ private:
ICMPSessionAdapter* adapter);
void UpdateEndpointVal(const ValPtr& endp, bool is_orig);
// Returns the counterpart type to the given type (e.g., the counterpart
// to ICMP_ECHOREPLY is ICMP_ECHO).
int ICMP4_counterpart(int icmp_type, int icmp_code, bool& is_one_way);
int ICMP6_counterpart(int icmp_type, int icmp_code, bool& is_one_way);
};
class ICMPSessionAdapter final : public IP::SessionAdapter {
@ -135,5 +130,10 @@ private:
int reply_len = -1;
};
// Returns the counterpart type to the given type (e.g., the counterpart
// to ICMP_ECHOREPLY is ICMP_ECHO).
extern int ICMP4_counterpart(int icmp_type, int icmp_code, bool& is_one_way);
extern int ICMP6_counterpart(int icmp_type, int icmp_code, bool& is_one_way);
} // namespace packet_analysis::ICMP
} // namespace zeek