]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Pull request #3949: sfip: Add < operator so SfIp can be used in std::map and std...
authorSteve Chew (stechew) <stechew@cisco.com>
Fri, 11 Aug 2023 12:29:58 +0000 (12:29 +0000)
committerSteve Chew (stechew) <stechew@cisco.com>
Fri, 11 Aug 2023 12:29:58 +0000 (12:29 +0000)
Merge in SNORT/snort3 from ~STECHEW/snort3:sfip_lessthan to master

Squashed commit of the following:

commit 40ae0e52ba715656e350f99928e696116624c78d
Author: Steve Chew <stechew@cisco.com>
Date:   Tue Aug 8 13:01:59 2023 -0400

    sfip: Add < operator so SfIp can be used in std::map and std::set.

src/sfip/sf_ip.h

index f11833050eac0d60f6a26b766f401b18ada54a24..cb8894e907b712f09033b876a0a833f732b7bf4b 100644 (file)
@@ -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 */