From: Steve Chew (stechew) Date: Fri, 11 Aug 2023 12:29:58 +0000 (+0000) Subject: Pull request #3949: sfip: Add < operator so SfIp can be used in std::map and std... X-Git-Tag: 3.1.69.0~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0669a74d1970a29cce4b8ff53ffc6954420cc19e;p=thirdparty%2Fsnort3.git Pull request #3949: sfip: Add < operator so SfIp can be used in std::map and std::set. Merge in SNORT/snort3 from ~STECHEW/snort3:sfip_lessthan to master Squashed commit of the following: commit 40ae0e52ba715656e350f99928e696116624c78d Author: Steve Chew Date: Tue Aug 8 13:01:59 2023 -0400 sfip: Add < operator so SfIp can be used in std::map and std::set. --- diff --git a/src/sfip/sf_ip.h b/src/sfip/sf_ip.h index f11833050..cb8894e90 100644 --- a/src/sfip/sf_ip.h +++ b/src/sfip/sf_ip.h @@ -88,6 +88,7 @@ struct SO_PUBLIC SfIp bool fast_eq6(const SfIp& ip2) const; bool fast_equals_raw(const SfIp& ip2) const; bool operator==(const SfIp& ip2) const; + bool operator < (const SfIp& rhs) const; /* * Miscellaneous @@ -456,6 +457,11 @@ inline bool SfIp::operator==(const SfIp& ip2) const return fast_equals_raw(ip2); } +inline bool SfIp::operator < (const SfIp& rhs) const +{ + return less_than(rhs); +} + /* End of member function definitions */ /* Support functions */