commit
3d3054d180
|
@ -5,7 +5,7 @@
|
|||
#include "common/SignalHandler.h"
|
||||
|
||||
#include "common/VermontControl.h"
|
||||
#include "modules/ConfigManager.h"
|
||||
#include "modules/ConfigManager.hpp"
|
||||
|
||||
class MainSignalHandler : public SignalInterface
|
||||
{
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#include "modules/ConfigManager.h"
|
||||
#include "ConfigManager.hpp"
|
||||
#include "core/Connector.h"
|
||||
#include "core/CfgNode.h"
|
||||
#include "common/defs.h"
|
||||
|
@ -156,13 +156,11 @@ void ConfigManager::parseConfig(std::string fileName)
|
|||
* attached to the node) to the graph
|
||||
*/
|
||||
XMLNode::XMLSet<XMLElement*> rootElements = root->getElementChildren();
|
||||
for (XMLNode::XMLSet<XMLElement*>::const_iterator it = rootElements.begin();
|
||||
it != rootElements.end();
|
||||
it++) {
|
||||
for (const auto& element : rootElements) {
|
||||
bool found = false;
|
||||
for (unsigned int i = 0; i < ARRAY_SIZE(configModules); i++) {
|
||||
if ((*it)->getName() == configModules[i]->getName()) {
|
||||
Cfg* cfg = configModules[i]->create(*it);
|
||||
for (auto& module : configModules) {
|
||||
if (element->getName() == module->getName()) {
|
||||
Cfg* cfg = module->create(element);
|
||||
|
||||
// handle special modules
|
||||
SensorManagerCfg* smcfg = dynamic_cast<SensorManagerCfg*>(cfg);
|
||||
|
@ -179,7 +177,7 @@ void ConfigManager::parseConfig(std::string fileName)
|
|||
}
|
||||
|
||||
if (!found) {
|
||||
msg(LOG_ERR, "Unknown cfg entry %s found", (*it)->getName().c_str());
|
||||
msg(LOG_ERR, "Unknown cfg entry %s found", element->getName().c_str());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -642,7 +642,7 @@ int IpfixParser::processIpfixPacket(boost::shared_array<uint8_t> message, uint16
|
|||
}
|
||||
}
|
||||
|
||||
msg(LOG_DEBUG, "IPFIX message from %s contained %u Data Records and %u Template Records. Sequence number was %lu.",
|
||||
DPRINTF_DEBUG("IPFIX message from %s contained %u Data Records and %u Template Records. Sequence number was %lu.",
|
||||
(sourceId->toString()).c_str(), numberOfDataRecords, numberOfTemplateRecords, (unsigned long) sequenceNumber);
|
||||
|
||||
// Update statistics
|
||||
|
@ -834,4 +834,3 @@ void IpfixParser::withdrawBufferedTemplates()
|
|||
bt = bt->next;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -412,30 +412,8 @@ int Rule::dataRecordMatches(IpfixDataRecord* record) {
|
|||
continue;
|
||||
}
|
||||
|
||||
/* Probably, this does not lead to the desired result:
|
||||
if (biflowAggregation) {
|
||||
// check if the rule field as a corresponding type in opposite direction
|
||||
InformationElement::IeId oppDirIeId = InformationElement::oppositeDirectionIeId(ruleField->type);
|
||||
if(oppDirIeId) {
|
||||
recordField = dataTemplateInfo->getFieldInfo(oppDirIeId, ruleField->type.enterprise);
|
||||
if (recordField) {
|
||||
// corresponding data field found, check if it matches. If it doesn't the whole rule cannot be matched
|
||||
if (!matchesPattern(&recordField->type, (recordData + recordField->offset), &ruleField->type, ruleField->pattern)) return 0;
|
||||
if ((ruleField->type.enterprise == 0) && (ruleField->type.length == 5)) {
|
||||
if (oppDirIeId == IPFIX_TYPEID_sourceIPv4Address) {
|
||||
if(!checkMask(dataTemplateInfo->getFieldInfo(IPFIX_TYPEID_sourceIPv4PrefixLength, 0), recordData, ruleField)) return 0;
|
||||
} else if (oppDirIeId == IPFIX_TYPEID_destinationIPv4Address) {
|
||||
if(!checkMask(dataTemplateInfo->getFieldInfo(IPFIX_TYPEID_destinationIPv4PrefixLength, 0), recordData, ruleField)) return 0;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
/* no corresponding data field or fixed data field found, this flow cannot match */
|
||||
msg(LOG_DEBUG, "No corresponding DataDataRecord field for RuleField of type %s", ruleField->type.toString().c_str());
|
||||
DPRINTF_INFO("No corresponding DataDataRecord field for RuleField of type %s", ruleField->type.toString().c_str());
|
||||
return 0;
|
||||
}
|
||||
/* if a non-discarding rule field specifies no pattern, check at least if the data field exists */
|
||||
|
@ -454,7 +432,7 @@ int Rule::dataRecordMatches(IpfixDataRecord* record) {
|
|||
if (ruleField->type==InformationElement::IeInfo(IPFIX_ETYPEID_anonymisationType, IPFIX_PEN_vermont))
|
||||
continue;
|
||||
|
||||
msg(LOG_NOTICE, "No corresponding DataRecord field for RuleField of type %s", ruleField->type.toString().c_str());
|
||||
DPRINTF_INFO("No corresponding DataRecord field for RuleField of type %s", ruleField->type.toString().c_str());
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include "modules/packet/filter//SystematicSampler.h"
|
||||
#include "common/msg.h"
|
||||
#include "CounterDestination.h"
|
||||
#include "modules/ConfigManager.h"
|
||||
#include "modules/ConfigManager.hpp"
|
||||
#include "core/ConnectionSplitter.h"
|
||||
#include "PrinterModule.h"
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
#include "common/defs.h"
|
||||
#include "core/MainSignalHandler.h"
|
||||
|
||||
#include "modules/ConfigManager.h"
|
||||
#include "modules/ConfigManager.hpp"
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
|
Loading…
Reference in New Issue