updated after review

master
Emanuel Vintila 2017-12-08 12:47:50 +01:00
parent 1082d3f8de
commit 4a50b16b91
9 changed files with 7 additions and 46 deletions

View File

@ -27,7 +27,6 @@ HostStatisticsCfg::HostStatisticsCfg(XMLElement* elem) : CfgHelper<HostStatistic
ipSubnet = get("subnet");
addrFilter = get("addrFilter");
logPath = get("logPath");
logInt = (uint16_t)getInt("logInterval", 10);
} catch(IllegalEntry ie) {
THROWEXCEPTION("Illegal hostStatistics entry in config file");
}

View File

@ -43,13 +43,11 @@ protected:
std::string getSubnet() { return ipSubnet; }
std::string getAddrFilter() { return addrFilter; }
std::string getLogPath() { return logPath; }
uint16_t getLogIntervall() { return logInt; }
private:
std::string ipSubnet;
std::string addrFilter;
std::string logPath;
uint16_t logInt;
};
#endif /* HOSTSTATISTICSCFG_H_ */

View File

@ -110,8 +110,9 @@ char ** get_filenames(const char * directory, int * num_of_files) {
while ( pDirEnt != NULL ) {
/* Skip hidden entries starting with dot */
if( pDirEnt->d_name[0] != '.' ) {
int fileNameSize = snprintf(filename, sizeof(filename), "%s/%s", directory, pDirEnt->d_name);
/* Skip non-regular files (e.g. directories) */
if ( (snprintf(filename, sizeof(filename), "%s/%s", directory, pDirEnt->d_name) > 0)
if ( ((fileNameSize < (int)sizeof(filename)) && (fileNameSize > 0))
&& (stat(filename, &dirEntStat) == 0) && (S_ISREG(dirEntStat.st_mode)) ) {
//printf( "FOUND: %s\n", pDirEnt->d_name );
filecounter++;
@ -139,9 +140,10 @@ char ** get_filenames(const char * directory, int * num_of_files) {
//printf( "%s\n", pDirEnt->d_name );
/* Skip hidden entries starting with dot */
if( pDirEnt->d_name[0] != '.' ) {
/* Skip non-regular files (e.g. directories) */
if ( (snprintf(filename, sizeof(filename), "%s/%s", directory, pDirEnt->d_name) > 0)
&& (stat(filename, &dirEntStat) == 0) && (S_ISREG(dirEntStat.st_mode)) ) {
int fileNameSize = snprintf(filename, sizeof(filename), "%s/%s", directory, pDirEnt->d_name);
/* Skip non-regular files (e.g. directories) */
if ( ((fileNameSize < (int)sizeof(filename)) && (fileNameSize > 0))
&& (stat(filename, &dirEntStat) == 0) && (S_ISREG(dirEntStat.st_mode)) ) {
snprintf(filenames[i], MAX_SIZE_OF_FILENAME-1, "%s", pDirEnt->d_name);
//printf( "ADDED: %s\n", filenames[i] );
i++;

View File

@ -22,10 +22,7 @@ PacketIDMEFReporterCfg::PacketIDMEFReporterCfg(XMLElement* elem)
it++) {
XMLElement* e = *it;
if (e->matches("snapshotoffset")) {
// snapshotOffset is no longer used
// snapshotOffset = getInt("snapshotoffset");
} else if (e->matches("snapshotlength")) {
if (e->matches("snapshotlength")) {
snapshotLength = getInt("snapshotlength");
} else if (e->matches("analyzerid")) {
analyzerId = e->getFirstText();

View File

@ -27,7 +27,6 @@ protected:
string analyzerId; /**< analyzer id for IDMEF messages */
string idmefTemplate; /**< template file for IDMEF messages */
uint16_t snapshotOffset; /**< offset from start of payload where snapshot is taken */
uint16_t snapshotLength; /**< length of snapshot */

View File

@ -1,6 +0,0 @@
#include "ipfixtracker.h"
IPFixTracker::IPFixTracker()
{
}

View File

@ -1,11 +0,0 @@
#ifndef IPFIXTRACKER_H
#define IPFIXTRACKER_H
class IPFixTracker
{
public:
IPFixTracker();
};
#endif // IPFIXTRACKER_H

View File

@ -1,6 +0,0 @@
#include "IpfixTracker.h"
IpfixTracker::IpfixTracker()
{
}

View File

@ -1,11 +0,0 @@
#ifndef IPFIXTRACKER_H
#define IPFIXTRACKER_H
class IpfixTracker
{
public:
IpfixTracker();
};
#endif // IPFIXTRACKER_H