[Snort-devel] Minor logging fixes so Snort honors the quiet flag

Bradley A. Plank bplank at ...2952...
Mon Dec 10 10:09:17 EST 2007


Minor logging modifications to be quiet when configured to do so:
[ See diffs below with modifications done using 'ifdef FIX_QUIET' ]


Index: src/detection-plugins/sp_flowbits.c
===================================================================
@@ -574,15 +574,33 @@
         if (fb->types & FLOWBITS_SET) {
             if (!(fb->types & FLOWBITS_ISSET || fb->types &
FLOWBITS_ISNOTSET))
             {
+#ifdef FIX_QUIET
+		if (!pv.quiet_flag) {
+#endif /* FIX_QUIET */
                 LogMessage("Warning: flowbits key '%s' is set but not ever
checked.\n",n->key);
+#ifdef FIX_QUIET
+		}
+#endif /* FIX_QUIET */
             }
         } else {
             if (fb->types & FLOWBITS_ISSET || fb->types &
FLOWBITS_ISNOTSET) {
+#ifdef FIX_QUIET
+		if (!pv.quiet_flag) {
+#endif /* FIX_QUIET */
                 LogMessage("Warning: flowbits key '%s' is checked but not
ever set.\n",n->key);
+#ifdef FIX_QUIET
+		}
+#endif /* FIX_QUIET */
             }
         }
     }
 
+#ifdef FIX_QUIET
+    if (!pv.quiet_flag) {
+#endif /* FIX_QUIET */
     FlowBitsPrintConfig();
+#ifdef FIX_QUIET
+    }
+#endif /* FIX_QUIET */
 }

Index: src/preprocessors/spp_sfportscan.c
===================================================================
@@ -1247,10 +1247,16 @@
     AddFuncToPreprocCleanExitList(PortscanCleanExitFunction, NULL,
PRIORITY_SCANNER, PP_SFPORTSCAN);
     AddFuncToPreprocRestartList(PortscanRestartFunction, NULL,
PRIORITY_SCANNER, PP_SFPORTSCAN);    
 
-    PrintPortscanConf(protos, scan_types, sense_level, ignore_scanners,
-                      ignore_scanned, watch_ip, memcap);
+#ifdef FIX_QUIET
+    if (!pv.quiet_flag) {
+#endif /* FIX_QUIET */
+	PrintPortscanConf(protos, scan_types, sense_level, ignore_scanners,
+			  ignore_scanned, watch_ip, memcap);
+#ifdef FIX_QUIET
+    }
+#endif /* FIX_QUIET */
+
    PortscanPacketInit();

Index: src/preprocessors/snort_stream4_udp.c
===================================================================
@@ -487,6 +487,9 @@
         }
     }
     
+#ifdef FIX_QUIET
+    if (!pv.quiet_flag) {
+#endif /* FIX_QUIET */
     memset(buf, 0, STD_BUF+1);
     snprintf(buf, STD_BUF, "    Stream4 UDP Ports: ");       
 
@@ -517,6 +520,9 @@
         }
     }
     LogMessage("%s\n", buf);
+#ifdef FIX_QUIET
+    }
+#endif /* FIX_QUIET */
 }
 #endif /* STREAM4_UDP */

Index: src/preprocessors/snort_httpinspect.c
===================================================================
@@ -1920,7 +1920,13 @@
         /*
         **  Start writing out the Default Server Config
         */
+#ifdef FIX_QUIET
+	if (!pv.quiet_flag) {
+#endif /* FIX_QUIET */
         LogMessage("    DEFAULT SERVER CONFIG:\n");
+#ifdef FIX_QUIET
+	}
+#endif /* FIX_QUIET */
     }
     else
     {
@@ -1981,13 +1987,25 @@
         /*
         **  Print out the configuration header
         */
+#ifdef FIX_QUIET
+	if (!pv.quiet_flag) {
+#endif /* FIX_QUIET */
         LogMessage("    SERVER: %s\n", inet_ntoa(ip_addr));
+#ifdef FIX_QUIET
+	}
+#endif /* FIX_QUIET */
     }
 
     /*
     **  Finish printing out the server configuration
     */
+#ifdef FIX_QUIET
+    if (!pv.quiet_flag) {
+#endif /* FIX_QUIET */
     PrintServerConf(ServerConf);
+#ifdef FIX_QUIET
+    }
+#endif /* FIX_QUIET */
 
     return 0;
 }
@@ -2116,7 +2134,13 @@
         /*
         **  Let's print out the global config
         */
+#ifdef FIX_QUIET
+	if (!pv.quiet_flag) {
+#endif /* FIX_QUIET */
         PrintGlobalConf(GlobalConf);
+#ifdef FIX_QUIET
+	}
+#endif /* FIX_QUIET */
     }
     /*
     **  Server Configuration
Index: src/preprocessors/Stream5/snort_stream5_tcp.c
===================================================================
@@ -686,7 +686,13 @@
     }
     tcpPolicyList[numTcpPolicies-1] = s5TcpPolicy;
 
+#ifdef FIX_QUIET
+    if (!pv.quiet_flag) {
+#endif /* FIX_QUIET */
     Stream5PrintTcpConfig(s5TcpPolicy);
+#ifdef FIX_QUIET
+    }
+#endif /* FIX_QUIET */
 
     return;
 }
Index: src/preprocessors/Stream5/snort_stream5_icmp.c
===================================================================
@@ -32,6 +32,9 @@
 #include "snort_stream5_icmp.h"
 
 #include "parser.h"
+#ifdef FIX_QUIET
+#include "snort.h"
+#endif /* FIX_QUIET */
 
 #include "profiler.h"
 #ifdef PERF_PROFILING
@@ -95,7 +98,13 @@
 
     Stream5ParseIcmpArgs(args, &icmp_policy);
 
+#ifdef FIX_QUIET
+    if (!pv.quiet_flag) {
+#endif /* FIX_QUIET */
     Stream5PrintIcmpConfig(&icmp_policy);
+#ifdef FIX_QUIET
+    }
+#endif /* FIX_QUIET */
 
     return;
 }
Index: src/preprocessors/Stream5/snort_stream5_udp.c
===================================================================
@@ -146,7 +146,13 @@
     }
     udpPolicyList[numUdpPolicies-1] = s5UdpPolicy;
 
+#ifdef FIX_QUIET
+    if (!pv.quiet_flag) {
+#endif /* FIX_QUIET */
     Stream5PrintUdpConfig(s5UdpPolicy);
+#ifdef FIX_QUIET
+    }
+#endif /* FIX_QUIET */
 
     return;
 }

Index: src/preprocessors/spp_stream4.c
===================================================================
@@ -1085,7 +1085,13 @@
     /* if no arguments, go ahead and return */
     if(args == NULL || args[0] == '\0')
     {
+#ifdef FIX_QUIET
+	if (!pv.quiet_flag) {
+#endif /* FIX_QUIET */
         DisplayStream4Config();
+#ifdef FIX_QUIET
+	}
+#endif /* FIX_QUIET */
         return;
     }
 
@@ -1157,10 +1163,15 @@
             }
             else
             {
+#ifdef FIX_QUIET
+		if (!pv.quiet_flag) {
+#endif /* FIX_QUIET */
                 LogMessage("WARNING %s(%d) => Bad timeout in config file, "
                            "defaulting to %d seconds\n", file_name,
file_line, 
                            PRUNE_QUANTA);
-
+#ifdef FIX_QUIET
+		}
+#endif /* FIX_QUIET */
                 s4data.timeout = PRUNE_QUANTA;
             }
         }
@@ -1172,10 +1183,15 @@
 
                 if(s4data.memcap < 16384)
                 {
+#ifdef FIX_QUIET
+		    if (!pv.quiet_flag) {
+#endif /* FIX_QUIET */
                     LogMessage("WARNING %s(%d) => Ludicrous (<16k) memcap "
                                "size, setting to default (%d bytes)\n",
file_name, 
                                file_line, STREAM4_MEMORY_CAP);
-                    
+#ifdef FIX_QUIET
+		    }
+#endif /* FIX_QUIET */
                     s4data.memcap = STREAM4_MEMORY_CAP;
                 }
             }
@@ -1193,10 +1209,16 @@
 
                 if(s4data.max_sessions < 8192)
                 {
+#ifdef FIX_QUIET
+		    if (!pv.quiet_flag) {
+#endif /* FIX_QUIET */
                     LogMessage("WARNING %s(%d) => Ludicrous (<8k)
max_sessions "
                                "size, setting to default (%d sessions)\n",
file_name, 
                                file_line, STREAM4_MAX_SESSIONS);
-                    
+#ifdef FIX_QUIET
+		    }
+#endif /* FIX_QUIET */
+
                     s4data.max_sessions = STREAM4_MAX_SESSIONS;
                 }
             }
@@ -1219,10 +1241,16 @@
 
                 if(s4data.max_udp_sessions < 8192)
                 {
+#ifdef FIX_QUIET
+		    if (!pv.quiet_flag) {
+#endif /* FIX_QUIET */
                     LogMessage("WARNING %s(%d) => Ludicrous (<8k)
max_udp_sessions "
                                "size, setting to default (%d sessions)\n",
file_name, 
                                file_line, STREAM4_MAX_SESSIONS);
-                    
+#ifdef FIX_QUIET
+		    }
+#endif /* FIX_QUIET */
+
                     s4data.max_udp_sessions = STREAM4_MAX_SESSIONS;
                 }
             }
@@ -1267,9 +1295,15 @@
                 s4data.cache_clean_sessions = atoi(stoks[1]);
                 if (s4data.cache_clean_sessions < 1)
                 {
+#ifdef FIX_QUIET
+		    if (!pv.quiet_flag) {
+#endif /* FIX_QUIET */
                     LogMessage("WARNING %s(%d) => Zero Session Cache
Cleanup, "
                         "reverting to default of %d\n", 
                         file_name, file_line, STREAM4_CLEANUP);
+#ifdef FIX_QUIET
+		    }
+#endif /* FIX_QUIET */
 
                     s4data.cache_clean_sessions = STREAM4_CLEANUP;
                 }
@@ -1297,9 +1331,15 @@
                 }
                 else
                 {
+#ifdef FIX_QUIET
+		    if (!pv.quiet_flag) {
+#endif /* FIX_QUIET */
                     LogMessage("WARNING %s(%d) => Bad TTL Limit"
                                "size, setting to default (%d\n", file_name,

                                file_line, STREAM4_TTL_LIMIT);
+#ifdef FIX_QUIET
+		    }
+#endif /* FIX_QUIET */
 
                     s4data.ttl_limit = STREAM4_TTL_LIMIT;
                 }
@@ -1318,9 +1358,15 @@
             }
             else
             {
+#ifdef FIX_QUIET
+		if (!pv.quiet_flag) {
+#endif /* FIX_QUIET */
                 LogMessage("WARNING %s(%d) => Bad sp_threshold in config
file, "
                            "defaulting to %d new sessions/second\n",
file_name, 
                            file_line, SELF_PRES_THRESHOLD);
+#ifdef FIX_QUIET
+		}
+#endif /* FIX_QUIET */
 
                 s4data.sp_threshold = SELF_PRES_THRESHOLD;
             }
@@ -1331,10 +1377,17 @@
             {
                 s4data.sp_period = atoi(stoks[1]);
             }
-            else            {
+            else
+	    {
+#ifdef FIX_QUIET
+		if (!pv.quiet_flag) {
+#endif /* FIX_QUIET */
                 LogMessage("WARNING %s(%d) => Bad sp_period in config file,
"
                            "defaulting to %d seconds\n", file_name,
file_line, 
                            SELF_PRES_PERIOD);
+#ifdef FIX_QUIET
+		}
+#endif /* FIX_QUIET */
 
                 s4data.sp_period = SELF_PRES_PERIOD;
             }
@@ -1347,9 +1400,15 @@
             }
             else
             {
+#ifdef FIX_QUIET
+		if (!pv.quiet_flag) {
+#endif /* FIX_QUIET */
                 LogMessage("WARNING %s(%d) => Bad suspend_threshold in
config "
                         "file, defaulting to %d new sessions/second\n", 
                         file_name, file_line, SUSPEND_THRESHOLD);
+#ifdef FIX_QUIET
+		}
+#endif /* FIX_QUIET */
 
                 s4data.suspend_threshold = SUSPEND_THRESHOLD;
             }
@@ -1362,9 +1421,15 @@
             }
             else
             {
+#ifdef FIX_QUIET
+		if (!pv.quiet_flag) {
+#endif /* FIX_QUIET */
                 LogMessage("WARNING %s(%d) => Bad suspend_period in config
file, "
                            "defaulting to %d seconds\n", file_name,
file_line, 
                            SUSPEND_PERIOD);
+#ifdef FIX_QUIET
+		}
+#endif /* FIX_QUIET */
 
                 s4data.suspend_period = SUSPEND_PERIOD;
             }
@@ -1417,7 +1482,13 @@
 
     mSplitFree(&toks, num_toks);
 
+#ifdef FIX_QUIET
+    if (!pv.quiet_flag) {
+#endif /* FIX_QUIET */
     DisplayStream4Config();
+#ifdef FIX_QUIET
+    }
+#endif /* FIX_QUIET */
 }
 
 void Stream4InitExternalOptions(u_char *args)
Index: src/preprocessors/spp_stream5.c
===================================================================
@@ -267,7 +267,13 @@
 
     snort_runtime.capabilities.stateful_inspection = 1;
 
+#ifdef FIX_QUIET
+    if (!pv.quiet_flag) {
+#endif /* FIX_QUIET */
     Stream5PrintGlobalConfig();
+#ifdef FIX_QUIET
+    }
+#endif /* FIX_QUIET */
 
     AddFuncToPreprocCleanExitList(Stream5CleanExit, NULL, PRIORITY_FIRST,
PP_STREAM5);
     AddFuncToPreprocRestartList(Stream5Restart, NULL, PRIORITY_FIRST,
PP_STREAM5);

Index: src/preprocessors/spp_flow.c
===================================================================
@@ -156,7 +156,13 @@
                    "-- try more memory (current memcap is %d)\n",
config->memcap);
     }
 
+#ifdef FIX_QUIET
+    if (!pv.quiet_flag) {
+#endif /* FIX_QUIET */
     DisplayFlowConfig();
+#ifdef FIX_QUIET
+    }
+#endif /* FIX_QUIET */
 
     s_flow_running = 1;

Index: src/parser.c
===================================================================
@@ -3219,7 +3224,13 @@
                 
                 p->value = SnortStrdup(value);
             }
+#ifdef FIX_QUIET
+	    if (!pv.quiet_flag) {
+#endif /* FIX_QUIET */
             LogMessage("Var '%s' redefined\n", p->name);
+#ifdef FIX_QUIET
+	    }
+#endif /* FIX_QUIET */
             return (p);
         }
         p = p->next;
@@ -3236,21 +3247,45 @@
     VarHead->next = p;
         
     vlen = strlen(value);
+#ifdef FIX_QUIET
+    if (!pv.quiet_flag) {
+#endif /* FIX_QUIET */
     LogMessage("Var '%s' defined, value len = %d chars", p->name, vlen  );
- 
+ #ifdef FIX_QUIET
+    }
+#endif /* FIX_QUIET */
+
     if( vlen < 64 )
     {
+#ifdef FIX_QUIET
+	if (!pv.quiet_flag) {
+#endif /* FIX_QUIET */
       LogMessage(", value = %s\n", value );
+#ifdef FIX_QUIET
+	}
+#endif /* FIX_QUIET */
     }
     else
     {
-      LogMessage("\n");
+#ifdef FIX_QUIET
+	if (!pv.quiet_flag) {
+#endif /* FIX_QUIET */
+	    LogMessage("\n");
+#ifdef FIX_QUIET
+	}
+#endif /* FIX_QUIET */
       n = 128;
       s = value;
       while(vlen)
       {
          if( n > vlen ) n = vlen;
-         LogMessage("   %.*s\n", n, s );
+#ifdef FIX_QUIET
+	if (!pv.quiet_flag) {
+#endif /* FIX_QUIET */
+	    LogMessage("   %.*s\n", n, s );
+#ifdef FIX_QUIET
+	}
+#endif /* FIX_QUIET */
          s    += n;
          vlen -= n;
       }
@@ -4505,7 +4540,13 @@
     }
     else if(!strcasecmp(config, "logdir"))
     {
+#ifdef FIX_QUIET
+	if (!pv.quiet_flag) {
+#endif /* FIX_QUIET */
         LogMessage("Found logdir config directive (%s)\n", args);
+#ifdef FIX_QUIET
+	}
+#endif /* FIX_QUIET */
         pv.log_dir = SnortStrdup(args);
         DEBUG_WRAP(DebugMessage(DEBUG_INIT, "Log directory = %s\n", 
                     pv.log_dir););

Index: src/snort.c
===================================================================
@@ -707,11 +715,14 @@
         thiszone = gmt2local(0);
     }
 
+#ifdef FIX_QUIET
+    LogMessage("Initializing IPS\n");
+#else
     if(!pv.quiet_flag)
     {
         LogMessage("\n        --== Initializing Snort ==--\n");
     }
-
+#endif /* FIX_QUIET */
     
     if(runMode == MODE_IDS && pv.rules_order_flag)
     {
@@ -811,7 +822,13 @@
         /* XXX: Why are we doing this twice? */
         //CheckLogDir();
 
-        LogMessage("Tagged Packet Limit: %d\n", pv.tagged_packet_limit);
+#ifdef FIX_QUIET
+	if (!pv.quiet_flag) {
+#endif /* FIX_QUIET */
+	    LogMessage("Tagged Packet Limit: %d\n", pv.tagged_packet_limit);
+#ifdef FIX_QUIET
+	}
+#endif /* FIX_QUIET */
 
         OtnXMatchDataInitialize();
@@ -2143,11 +2185,26 @@
 #ifdef GIDS
 #ifdef IPFW
             case 'J':
-                LogMessage("Reading from ipfw divert socket\n");
+#ifdef FIX_QUIET
+		if (!pv.quiet_flag) {
+#endif /* FIX_QUIET */
+		    LogMessage("Reading from ipfw divert socket\n");
+#ifdef FIX_QUIET
+		}
+#endif /* FIX_QUIET */
+
                 pv.inline_flag = 1;
                 pv.divert_port = atoi(optarg);
-                DEBUG_WRAP(DebugMessage(DEBUG_INIT, "Divert port set to:
%d\n", pv.divert_port););
-                LogMessage("IPFW Divert port set to: %d\n",
pv.divert_port);
+
+#ifdef FIX_QUIET
+		if (!pv.quiet_flag) {
+#endif /* FIX_QUIET */
+		    DEBUG_WRAP(DebugMessage(DEBUG_INIT, "Divert port set to:
%d\n", pv.divert_port););
+		    LogMessage("IPFW Divert port set to: %d\n",
pv.divert_port);
+#ifdef FIX_QUIET
+		}
+#endif /* FIX_QUIET */
+
                 pv.promisc_flag = 0;
                 pv.interface = NULL;
                 break;

Index: src/fpcreate.c
===================================================================
@@ -228,42 +228,85 @@
 */
 int fpSetDetectSearchMethod( char * method )
 {
-    LogMessage("Detection:\n");
+#ifdef FIX_QUIET
+    if (!pv.quiet_flag) {
+#endif /* FIX_QUIET */
+	LogMessage("Detection:\n");
+#ifdef FIX_QUIET
+    }
+#endif /* FIX_QUIET */
 
     if( !strcasecmp(method,"ac-std") ) /* default */
     {
        fpDetect.search_method = MPSE_AC ;
-       LogMessage("   Search-Method = AC-Std\n");
+#ifdef FIX_QUIET
+	if (!pv.quiet_flag) {
+#endif /* FIX_QUIET */
+	    LogMessage("   Search-Method = AC-Std\n");
+#ifdef FIX_QUIET
+	}
+#endif /* FIX_QUIET */
+
        return 0;
     }
     if( !strcasecmp(method,"ac-bnfa") )
     {
        fpDetect.search_method = MPSE_AC_BNFA ;
-       LogMessage("   Search-Method = AC-BNFA\n");
+#ifdef FIX_QUIET
+	if (!pv.quiet_flag) {
+#endif /* FIX_QUIET */
+	    LogMessage("   Search-Method = AC-BNFA\n");
+#ifdef FIX_QUIET
+	}
+#endif /* FIX_QUIET */
        return 0;
     }
     if( !strcasecmp(method,"ac") )
     {
        fpDetect.search_method = MPSE_ACF ;
-       LogMessage("   Search-Method = AC-Full\n");
+#ifdef FIX_QUIET
+	if (!pv.quiet_flag) {
+#endif /* FIX_QUIET */
+	    LogMessage("   Search-Method = AC-Full\n");
+#ifdef FIX_QUIET
+	}
+#endif /* FIX_QUIET */
        return 0;
     }
     if( !strcasecmp(method,"acs") )
     {
        fpDetect.search_method = MPSE_ACS ;
-       LogMessage("   Search-Method = AC-Sparse\n");
+#ifdef FIX_QUIET
+	if (!pv.quiet_flag) {
+#endif /* FIX_QUIET */
+	    LogMessage("   Search-Method = AC-Sparse\n");
+#ifdef FIX_QUIET
+	}
+#endif /* FIX_QUIET */
        return 0;
     }
     if( !strcasecmp(method,"ac-banded") )
     {
        fpDetect.search_method = MPSE_ACB ;
-       LogMessage("   Search-Method = AC-Banded\n");
+#ifdef FIX_QUIET
+	if (!pv.quiet_flag) {
+#endif /* FIX_QUIET */
+	    LogMessage("   Search-Method = AC-Banded\n");
+#ifdef FIX_QUIET
+	}
+#endif /* FIX_QUIET */
        return 0;
     }
     if( !strcasecmp(method,"ac-sparsebands") )
     {
        fpDetect.search_method = MPSE_ACSB ;
-       LogMessage("   Search-Method = AC-Sparse-Bands\n");
+#ifdef FIX_QUIET
+	if (!pv.quiet_flag) {
+#endif /* FIX_QUIET */
+	    LogMessage("   Search-Method = AC-Sparse-Bands\n");
+#ifdef FIX_QUIET
+	}
+#endif /* FIX_QUIET */
        return 0;
     }
         
@@ -272,14 +315,26 @@
     if( !strcasecmp(method,"mwm") ) 
     {
        fpDetect.search_method = MPSE_LOWMEM ;
-       LogMessage("   Search-Method = Low-Mem (MWM depracated)\n");
+#ifdef FIX_QUIET
+	if (!pv.quiet_flag) {
+#endif /* FIX_QUIET */
+	    LogMessage("   Search-Method = Low-Mem (MWM depracated)\n");
+#ifdef FIX_QUIET
+	}
+#endif /* FIX_QUIET */
        return 0;
     }
 
     if( !strcasecmp(method,"lowmem") )
     {
        fpDetect.search_method = MPSE_LOWMEM ;
-       LogMessage("   Search-Method = Low-Mem\n");
+#ifdef FIX_QUIET
+	if (!pv.quiet_flag) {
+#endif /* FIX_QUIET */
+	    LogMessage("   Search-Method = Low-Mem\n");
+#ifdef FIX_QUIET
+	}
+#endif /* FIX_QUIET */
        return 0;
     }
     return 1;

Index: src/dynamic-plugins/sf_dynamic_plugins.c
===================================================================
@@ -1067,18 +1067,32 @@
     DumpDetectionRules ruleDumpFunc = NULL;
     int retVal = 0;
 
+#ifdef FIX_QUIET
+    if (!pv.quiet_flag) {
+#endif /* FIX_QUIET */
     LogMessage("Dumping dynamic rules...\n");
+#ifdef FIX_QUIET
+    }
+#endif /* FIX_QUIET */
+
     while (plugin)
     {
 DISABLE_WARNING(4055)
         ruleDumpFunc = (DumpDetectionRules) getSymbol(plugin->handle,
"DumpSkeletonRules", &(plugin->metaData), NONFATAL);
 ENABLE_WARNING(4055)
 
+#ifdef FIX_QUIET
+	if (!pv.quiet_flag) {
+#endif /* FIX_QUIET */
         LogMessage("Dumping dynamic rules for Library %s %d.%d.%d\n",
             plugin->metaData.uniqueName,
             plugin->metaData.major,
             plugin->metaData.minor,
             plugin->metaData.build);
+#ifdef FIX_QUIET
+	}
+#endif /* FIX_QUIET */
+
         if (ruleDumpFunc != NULL)
         {
             if (ruleDumpFunc())
@@ -1088,7 +1102,15 @@
         }
         plugin = plugin->next;
     }
+
+#ifdef FIX_QUIET
+    if (!pv.quiet_flag) {
+#endif /* FIX_QUIET */
     LogMessage("  Finished dumping dynamic rules.\n");
+#ifdef FIX_QUIET
+    }
+#endif /* FIX_QUIET */
+
     return retVal;
 }
 
@@ -1099,8 +1121,14 @@
     InitPreprocessorLibFunc preprocInit;
     PluginHandle handle;
 
+#ifdef FIX_QUIET
+    if (!pv.quiet_flag) {
+#endif /* FIX_QUIET */
     LogMessage("%sLoading dynamic preprocessor library %s... ",
                indent ? "  " : "", library_name);
+#ifdef FIX_QUIET
+    }
+#endif /* FIX_QUIET */
 
     handle = openDynamicLibrary(library_name, 1);
     metaData.libraryPath = library_name;
@@ -1121,15 +1149,36 @@
 
     AddPreprocessorPlugin(handle, preprocInit, &metaData);
 
+#ifdef FIX_QUIET
+    if (!pv.quiet_flag) {
+#endif /* FIX_QUIET */
     LogMessage("done\n");
+#ifdef FIX_QUIET
+    }
+#endif /* FIX_QUIET */
+
     return 0;
 }
 
 void LoadAllDynamicPreprocessors(char *path)
 {
+#ifdef FIX_QUIET
+    if (!pv.quiet_flag) {
+#endif /* FIX_QUIET */
     LogMessage("Loading all dynamic preprocessor libs from %s...\n", path);
+#ifdef FIX_QUIET
+    }
+#endif /* FIX_QUIET */
+
     LoadAllLibs(path, LoadDynamicPreprocessor);
+
+#ifdef FIX_QUIET
+    if (!pv.quiet_flag) {
+#endif /* FIX_QUIET */
     LogMessage("  Finished Loading all dynamic preprocessor libs from
%s\n", path);
+#ifdef FIX_QUIET
+    }
+#endif /* FIX_QUIET */
 }
 
 void CloseDynamicPreprocessorLibs()






More information about the Snort-devel mailing list