From: Masud Hasan (mashasan) Date: Wed, 9 Sep 2020 20:39:54 +0000 (+0000) Subject: Merge pull request #2465 in SNORT/snort3 from ~MMATIRKO/snort3:uuid_fix to master X-Git-Tag: 3.0.2-6~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=01ab356b65769252d68b3a591daed6ea410dd238;p=thirdparty%2Fsnort3.git Merge pull request #2465 in SNORT/snort3 from ~MMATIRKO/snort3:uuid_fix to master Squashed commit of the following: commit 2a15dbe7a45f4180ceb83dbd72abf50827ab35c5 Author: Michael Matirko Date: Mon Aug 31 17:17:23 2020 -0400 rna: remove dependency on uuid library --- diff --git a/src/network_inspectors/rna/rna_fingerprint.h b/src/network_inspectors/rna/rna_fingerprint.h index 24424dbea..5cd8e5c87 100644 --- a/src/network_inspectors/rna/rna_fingerprint.h +++ b/src/network_inspectors/rna/rna_fingerprint.h @@ -23,7 +23,6 @@ #include #include -#include #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; } }; diff --git a/src/network_inspectors/rna/rna_fingerprint_tcp.cc b/src/network_inspectors/rna/rna_fingerprint_tcp.cc index e6931db1a..7a38af63c 100644 --- a/src/network_inspectors/rna/rna_fingerprint_tcp.cc +++ b/src/network_inspectors/rna/rna_fingerprint_tcp.cc @@ -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("10"), FpElement("20"), FpElement("30-40"), diff --git a/src/network_inspectors/rna/test/CMakeLists.txt b/src/network_inspectors/rna/test/CMakeLists.txt index e087bfead..9cdb23b50 100644 --- a/src/network_inspectors/rna/test/CMakeLists.txt +++ b/src/network_inspectors/rna/test/CMakeLists.txt @@ -5,5 +5,4 @@ add_cpputest( rna_module_test $ LIBS ${DNET_LIBRARIES} - uuid ) diff --git a/src/network_inspectors/rna/test/rna_module_test.cc b/src/network_inspectors/rna/test/rna_module_test.cc index ffced2522..343f5a6f4 100644 --- a/src/network_inspectors/rna/test/rna_module_test.cc +++ b/src/network_inspectors/rna/test/rna_module_test.cc @@ -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("10"), FpElement("20"), FpElement("30-40"),