]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Merge pull request #2434 in SNORT/snort3 from ~MMATIRKO/snort3:new_os_event to master
authorMasud Hasan (mashasan) <mashasan@cisco.com>
Thu, 17 Sep 2020 19:45:30 +0000 (19:45 +0000)
committerMasud Hasan (mashasan) <mashasan@cisco.com>
Thu, 17 Sep 2020 19:45:30 +0000 (19:45 +0000)
Squashed commit of the following:

commit d87e89abad84703102a8c034bf2cac25ddadebb8
Author: Michael Matirko <mmatirko@cisco.com>
Date:   Wed Aug 26 14:10:14 2020 -0400

    rna: avoid conflicts with other fingerprint definitions

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

index 5cd8e5c8770e6247f9cf5d857dcdf6448fdc8014..a0eb1c523062307490c40fe537230012c1466c75 100644 (file)
@@ -18,8 +18,8 @@
 
 // rna_fingerprint.h author Silviu Minut <sminut@cisco.com>
 
-#ifndef RNA_FINGERPRINT_H
-#define RNA_FINGERPRINT_H
+#ifndef RNA_FP_H
+#define RNA_FP_H
 
 #include <cstdint>
 #include <string>
@@ -42,21 +42,21 @@ public:
 
     enum FpType
     {
-        FINGERPRINT_TYPE_DERIVED = 0,
-        FINGERPRINT_TYPE_SERVER = 1,
-        FINGERPRINT_TYPE_CLIENT = 2,
-        FINGERPRINT_TYPE_SMB = 3,
-        FINGERPRINT_TYPE_DHCP = 4,
-        FINGERPRINT_TYPE_USER = 5,
-        FINGERPRINT_TYPE_SCAN = 6,
-        FINGERPRINT_TYPE_APP = 7,
-        FINGERPRINT_TYPE_CONFLICT = 8,
-        FINGERPRINT_TYPE_MOBILE = 9,
-        FINGERPRINT_TYPE_SERVER6 = 10,
-        FINGERPRINT_TYPE_CLIENT6 = 11,
-        FINGERPRINT_TYPE_DHCP6 = 12,
-        FINGERPRINT_TYPE_USERAGENT = 13,
-        MAX_FINGERPRINT_TYPES = 14
+        FP_TYPE_DERIVED = 0,
+        FP_TYPE_SERVER = 1,
+        FP_TYPE_CLIENT = 2,
+        FP_TYPE_SMB = 3,
+        FP_TYPE_DHCP = 4,
+        FP_TYPE_USER = 5,
+        FP_TYPE_SCAN = 6,
+        FP_TYPE_APP = 7,
+        FP_TYPE_CONFLICT = 8,
+        FP_TYPE_MOBILE = 9,
+        FP_TYPE_SERVER6 = 10,
+        FP_TYPE_CLIENT6 = 11,
+        FP_TYPE_DHCP6 = 12,
+        FP_TYPE_USERAGENT = 13,
+        MAX_FP_TYPES = 14
     };
 
     uint32_t fpid = 0;
index 7a38af63ce4f687bba96ea2c9f4a48b5cfba05bc..7852900dfe54dfd7548d39909e752a5079eba1da 100644 (file)
@@ -144,15 +144,15 @@ const TcpFingerprint* TcpFpProcessor::get_tcp_fp(const FpTcpKey& key, uint8_t tt
     {
         fptable = table_tcp_server;
         fptype = key.isIpv6 ?
-            FpFingerprint::FpType::FINGERPRINT_TYPE_SERVER6 :
-            FpFingerprint::FpType::FINGERPRINT_TYPE_SERVER;
+            FpFingerprint::FpType::FP_TYPE_SERVER6 :
+            FpFingerprint::FpType::FP_TYPE_SERVER;
     }
     else if (mode == TCP_FP_MODE::CLIENT)
     {
         fptable = table_tcp_client;
         fptype = key.isIpv6 ?
-            FpFingerprint::FpType::FINGERPRINT_TYPE_CLIENT6 :
-            FpFingerprint::FpType::FINGERPRINT_TYPE_CLIENT;
+            FpFingerprint::FpType::FP_TYPE_CLIENT6 :
+            FpFingerprint::FpType::FP_TYPE_CLIENT;
     }
     else
     {
index 343f5a6f4d3e5359f79b35c123f87d04e131adf1..9b3924175fdbd799474527c57eb5deaffa7a387e 100644 (file)
@@ -60,7 +60,7 @@ TEST(rna_module_test, push_tcp_fingerprints)
     // input fingerprint
     RawFingerprint rawfp;
     rawfp.fpid = 948;
-    rawfp.fp_type = FpFingerprint::FpType::FINGERPRINT_TYPE_SERVER;
+    rawfp.fp_type = FpFingerprint::FpType::FP_TYPE_SERVER;
     rawfp.fpuuid = "12345678-1234-1234-1234-012345678912";
     rawfp.ttl = 64;
     rawfp.tcp_window = "10 20 30-40 50 60-70";
@@ -155,7 +155,7 @@ TEST(rna_module_test, push_tcp_fingerprints)
 
     // add one for the client too, by changing only the type and id
     auto client_fpid = rawfp.fpid+1;     // non duplicate id
-    rawfp.fp_type = FpFingerprint::FpType::FINGERPRINT_TYPE_CLIENT;
+    rawfp.fp_type = FpFingerprint::FpType::FP_TYPE_CLIENT;
 
     {
         Value v((double) client_fpid);