]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Merge pull request #2465 in SNORT/snort3 from ~MMATIRKO/snort3:uuid_fix to master
authorMasud Hasan (mashasan) <mashasan@cisco.com>
Wed, 9 Sep 2020 20:39:54 +0000 (20:39 +0000)
committerMasud Hasan (mashasan) <mashasan@cisco.com>
Wed, 9 Sep 2020 20:39:54 +0000 (20:39 +0000)
Squashed commit of the following:

commit 2a15dbe7a45f4180ceb83dbd72abf50827ab35c5
Author: Michael Matirko <mmatirko@cisco.com>
Date:   Mon Aug 31 17:17:23 2020 -0400

    rna: remove dependency on uuid library

src/network_inspectors/rna/rna_fingerprint.h
src/network_inspectors/rna/rna_fingerprint_tcp.cc
src/network_inspectors/rna/test/CMakeLists.txt
src/network_inspectors/rna/test/rna_module_test.cc

index 24424dbea06189ea1e89f07adbc584f342fb93fa..5cd8e5c8770e6247f9cf5d857dcdf6448fdc8014 100644 (file)
@@ -23,7 +23,6 @@
 
 #include <cstdint>
 #include <string>
-#include <uuid/uuid.h>
 
 #include "main/snort_types.h"
 
@@ -62,7 +61,7 @@ public:
 
     uint32_t fpid = 0;
     uint32_t fp_type = 0;
-    uuid_t fpuuid;
+    std::string fpuuid;
     uint8_t ttl = 0;
 
     virtual ~FpFingerprint() { }
@@ -71,7 +70,7 @@ public:
     {
         fpid = 0;
         fp_type = 0;
-        uuid_clear(fpuuid);
+        fpuuid.clear();
         ttl = 0;
     }
 };
index e6931db1ae5705cf210143354f13dabb05937ef8..7a38af63ce4f687bba96ea2c9f4a48b5cfba05bc 100644 (file)
@@ -69,7 +69,7 @@ TcpFingerprint::TcpFingerprint(const RawFingerprint& rfp)
 {
     fpid = rfp.fpid;
     fp_type = rfp.fp_type;
-    uuid_parse(rfp.fpuuid.c_str(), fpuuid);
+    fpuuid = rfp.fpuuid;
     ttl = rfp.ttl;
 
     parse_fp_element(rfp.tcp_window, tcp_window);
@@ -85,7 +85,7 @@ bool TcpFingerprint::operator==(const TcpFingerprint& y) const
     return (
         fpid == y.fpid &&
         fp_type == y.fp_type &&
-        !uuid_compare(fpuuid, y.fpuuid) &&
+        fpuuid == y.fpuuid &&
         ttl == y.ttl &&
         equal(tcp_window.begin(), tcp_window.end(), y.tcp_window.begin()) &&
         equal(mss.begin(), mss.end(), y.mss.begin()) &&
@@ -482,7 +482,7 @@ TEST_CASE("get_tcp_fp_processor", "[rna_fingerprint_tcp]")
 TEST_CASE("clear_fingerprint", "[rna_fingerprint_tcp]")
 {
     TcpFingerprint fpx;
-    uuid_clear(fpx.fpuuid);
+    fpx.fpuuid.clear();
 
     RawFingerprint rawfp;
     rawfp.fpid = 948;
@@ -534,7 +534,7 @@ TEST_CASE("raw_to_tcp_fp", "[rna_fingerprint_tcp]")
     TcpFingerprint tfpe;
     tfpe.fpid = rawfp.fpid;
     tfpe.fp_type = rawfp.fp_type;
-    uuid_parse(rawfp.fpuuid.c_str(), tfpe.fpuuid);
+    tfpe.fpuuid = rawfp.fpuuid;
     tfpe.ttl = rawfp.ttl;
     tfpe.tcp_window = vector<FpElement> {
         FpElement("10"), FpElement("20"), FpElement("30-40"),
index e087bfead25ddca15526e5c7b3ca4c4848c5a04c..9cdb23b5028789a92700350d8ce295259954a552 100644 (file)
@@ -5,5 +5,4 @@ add_cpputest( rna_module_test
         $<TARGET_OBJECTS:catch_tests>
     LIBS
         ${DNET_LIBRARIES}
-        uuid
 )
index ffced25227a349fd5a18e54c4a1b3e842969b9d4..343f5a6f4d3e5359f79b35c123f87d04e131adf1 100644 (file)
@@ -74,7 +74,7 @@ TEST(rna_module_test, push_tcp_fingerprints)
     TcpFingerprint tfpe;
     tfpe.fpid = rawfp.fpid;
     tfpe.fp_type = rawfp.fp_type;
-    uuid_parse(rawfp.fpuuid.c_str(), tfpe.fpuuid);
+    tfpe.fpuuid = rawfp.fpuuid;
     tfpe.ttl = rawfp.ttl;
     tfpe.tcp_window = vector<FpElement> {
         FpElement("10"), FpElement("20"), FpElement("30-40"),