]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Merge pull request #2349 in SNORT/snort3 from ~BBANTWAL/snort3:no_warn to master
authorBhagya Tholpady (bbantwal) <bbantwal@cisco.com>
Mon, 27 Jul 2020 19:04:23 +0000 (19:04 +0000)
committerBhagya Tholpady (bbantwal) <bbantwal@cisco.com>
Mon, 27 Jul 2020 19:04:23 +0000 (19:04 +0000)
Squashed commit of the following:

commit ae9359ed4b14970d1015aee7d7bb181d312ed9da
Author: Bhagya Tholpady <bbantwal@cisco.com>
Date:   Sun Jul 26 14:10:29 2020 -0400

    main: rename the config options to ignore flowbits and rules warnings

src/main/snort_module.cc

index 1f373d7e1ef329be1b542b49a9872db9c0dae15f..e936098faa25c18e7a9b49c011a4cce0d9760e03 100644 (file)
@@ -411,12 +411,6 @@ static const Parameter s_params[] =
     { "--id-zero", Parameter::PT_IMPLIED, nullptr, nullptr,
       "use id prefix / subdirectory even with one packet thread" },
 
-    { "--ignore-warn-flowbits", Parameter::PT_IMPLIED, nullptr, nullptr,
-      "ignore warnings about flowbits that are checked but not set and vice-versa" },
-
-    { "--ignore-warn-rules", Parameter::PT_IMPLIED, nullptr, nullptr,
-      "ignore warnings about duplicate rules and rule parsing issues" },
-
     { "--include-path", Parameter::PT_STRING, nullptr, nullptr,
       "<path> where to find Lua and rule included files; "
       "searched before current or config directories" },
@@ -460,6 +454,12 @@ static const Parameter s_params[] =
     { "--nolock-pidfile", Parameter::PT_IMPLIED, nullptr, nullptr,
       "do not try to lock Snort PID file" },
 
+    { "--no-warn-flowbits", Parameter::PT_IMPLIED, nullptr, nullptr,
+      "ignore warnings about flowbits that are checked but not set and vice-versa" },
+
+    { "--no-warn-rules", Parameter::PT_IMPLIED, nullptr, nullptr,
+      "ignore warnings about duplicate rules and rule parsing issues" },
+
     { "--pause", Parameter::PT_IMPLIED, nullptr, nullptr,
       "wait for resume/quit command before processing packets/terminating", },
 
@@ -660,8 +660,8 @@ public:
 
 private:
     SFDAQModuleConfig* module_config;
-    bool ignore_warn_flowbits = false;
-    bool ignore_warn_rules = false;
+    bool no_warn_flowbits = false;
+    bool no_warn_rules = false;
 };
 
 void SnortModule::set_trace(const Trace* trace) const
@@ -977,6 +977,12 @@ bool SnortModule::set(const char*, Value& v, SnortConfig* sc)
     else if ( v.is("--nolock-pidfile") )
         sc->run_flags |= RUN_FLAG__NO_LOCK_PID_FILE;
 
+    else if ( v.is("--no-warn-flowbits") )
+        no_warn_flowbits = true;
+
+    else if ( v.is("--no-warn-rules") )
+        no_warn_rules = true;
+
     else if ( v.is("--pause") )
         sc->run_flags |= RUN_FLAG__PAUSE;
 
@@ -1090,12 +1096,6 @@ bool SnortModule::set(const char*, Value& v, SnortConfig* sc)
     else if ( v.is("--warn-hosts") )
         sc->warning_flags |= (1 << WARN_HOSTS);
 
-    else if ( v.is("--ignore-warn-flowbits") )
-        ignore_warn_flowbits = true;
-
-    else if ( v.is("--ignore-warn-rules") )
-        ignore_warn_rules = true;
-
     else if ( v.is("--warn-plugins") )
         sc->warning_flags |= (1 << WARN_PLUGINS);
 
@@ -1125,16 +1125,16 @@ bool SnortModule::end(const char*, int, SnortConfig* sc)
     if ( sc->offload_threads and ThreadConfig::get_instance_max() != 1 )
         ParseError("You can not enable experimental offload with more than one packet thread.");
 
-    if ( ignore_warn_flowbits )
+    if ( no_warn_flowbits )
     {
         sc->warning_flags &= ~(1 << WARN_FLOWBITS);
-        ignore_warn_flowbits = false;
+        no_warn_flowbits = false;
     }
 
-    if ( ignore_warn_rules )
+    if ( no_warn_rules )
     {
         sc->warning_flags &= ~(1 << WARN_RULES);
-        ignore_warn_rules = false;
+        no_warn_rules = false;
     }
 
     return true;