Browse Source

Minor tweaks to snfLOGmgr.* to eliminate compiler warnings.

git-svn-id: https://svn.microneil.com/svn/SNFMulti/trunk@8 dc71a809-1921-45c4-985c-09c81d0142d9
wx
madscientist 15 years ago
parent
commit
64ea95611e
3 changed files with 18 additions and 16 deletions
  1. 13
    12
      snfLOGmgr.cpp
  2. 3
    3
      snfLOGmgr.hpp
  3. 2
    1
      snfLOGmgr.inline.hpp

+ 13
- 12
snfLOGmgr.cpp View File

@@ -91,8 +91,8 @@ void DiscLogger::myTask() {
//// snfScanData ///////////////////////////////////////////////////////////////

snfScanData::snfScanData(int ScanHorizon) : // How to create.
FilteredData(ScanHorizon, 0), // Allocate the Filtered Data buffer.
ReadyToClear(true) { // Make sure the clear will happen.
ReadyToClear(true), // Make sure initial clear will happen.
FilteredData(ScanHorizon, 0) { // Allocate the Filtered Data buffer.
clear(); // Start with no data.
}

@@ -225,18 +225,19 @@ msclock IntervalTimer::Elapsed() {
const ThreadType snfLOGmgr::Type("snfLOGmgr"); // The thread's type.

snfLOGmgr::snfLOGmgr() : // Constructor for the LOG manager
Thread(snfLOGmgr::Type, "Log Manager"), // snfLOGmgr Type and Name.
Thread(snfLOGmgr::Type, "Log Manager"), // snfLOGmgr Type and Name.
Configured(false), // Not yet configured.
TimeToDie(false), // Not yet time to die.
PeekEnableCounter(0), // No peeking yet.
SampleEnableCounter(0), // No sampling yet.
myNETmgr(NULL), // No NET mgr yet.
myGBUdb(NULL), // No GBUdb yet.
NewerRulebaseIsAvailable(false), // No newer rulebase yet.
SecondStatusLogger("Second Status Logger"), // Lazy writer for Second status.
MinuteStatusLogger("Minute Status Logger"), // Lazy writer for Minute status.
HourStatusLogger("Hour Status Logger"), // Lazy writer for Hour status.
XMLScanLogger("XML Scan Logger"), // Lazy writer for XML Scan log.
ClassicScanLogger("Classic Scan Logger"), // Lazy writer for Classic Scan log.
PeekEnableCounter(0),
SampleEnableCounter(0),
myNETmgr(NULL),
myGBUdb(NULL),
NewerRulebaseIsAvailable(false),
TimeToDie(false) {
ClassicScanLogger("Classic Scan Logger") { // Lazy writer for Classic Scan log.
StartupTime = Timestamp(); // Record when did we start.
CurrentCounters = &CounterPackA; // Assign the active CounterPack.
ReportingCounters = &CounterPackB; // Assign the reporting CounterPack.
@@ -1736,7 +1737,7 @@ string snfLOGmgr::Timestamp(time_t t) {
char TimestampBfr[20]; // Create a small buffer.
tm* gmt; // Get a ptr to a tm structure.
gmt = gmtime(&t); // Fill it with UTC.
sprintf(TimestampBfr,"%04d%02d%02d%02d%02d%02d\0", // Format yyyymmddhhmmss
sprintf(TimestampBfr,"%04d%02d%02d%02d%02d%02d", // Format yyyymmddhhmmss
gmt->tm_year+1900,
gmt->tm_mon+1,
gmt->tm_mday,
@@ -1757,7 +1758,7 @@ string snfLOGmgr::LocalTimestamp(time_t t) {
char TimestampBfr[20]; // Create a small buffer.
tm* localt; // Get a ptr to a tm structure.
localt = localtime(&t); // Fill it with local time.
sprintf(TimestampBfr,"%04d%02d%02d%02d%02d%02d\0", // Format yyyymmddhhmmss
sprintf(TimestampBfr,"%04d%02d%02d%02d%02d%02d", // Format yyyymmddhhmmss
localt->tm_year+1900,
localt->tm_mon+1,
localt->tm_mday,

+ 3
- 3
snfLOGmgr.hpp View File

@@ -466,9 +466,6 @@ class snfLOGmgr : private Thread {
Mutex SampleMutex; // Protects Sample Loop Counter.
Mutex StatusReportMutex; // Protects status report post & get.

volatile int PeekEnableCounter; // How many peek attempts recently?
volatile int SampleEnableCounter; // How many sample attempts recently?

snfCounterPack CounterPackA, CounterPackB; // Swapable counter packs.

snfCounterPack* CurrentCounters; // Current Event Counters.
@@ -479,6 +476,9 @@ class snfLOGmgr : private Thread {
volatile bool Configured; // True if we're properly configured.
volatile bool TimeToDie; // True when the thread should stop.

volatile int PeekEnableCounter; // How many peek attempts recently?
volatile int SampleEnableCounter; // How many sample attempts recently?
void myTask(); // Thread task.

time_t StartupTime; // Time since engine started.

+ 2
- 1
snfLOGmgr.inline.hpp View File

@@ -43,7 +43,8 @@ inline bool snfScanData::isDrillDownSource(IPScanRecord& X) {

inline IPScanRecord& snfScanData::SourceIPRecord(IPScanRecord& X) { // Sets the source IP record.
SourceIPOrdinal = X.Ordinal; // Here's the ordinal.
SourceIPFoundFlag = true; // Here's the truth flag.
SourceIPFoundFlag = true; // Here's the truth flag.
return X; // Return what was set.
}

inline IPScanRecord& snfScanData::SourceIPRecord() { // Gets the source IP record.

Loading…
Cancel
Save