|
|
|
|
|
|
|
|
const std::string SnifferPathKey("SNIFFER_PATH"); ///< Text to replace with directory of the rulebase.
|
|
|
const std::string SnifferPathKey("SNIFFER_PATH"); ///< Text to replace with directory of the rulebase.
|
|
|
|
|
|
|
|
|
// SNIFFER_PATH is replaced with the path of the rulebase.
|
|
|
// SNIFFER_PATH is replaced with the path of the rulebase.
|
|
|
const std::string UtilityConfig::RulebaseDownloadStatusFile("SNIFFER_PATH/getRulebase.status");
|
|
|
|
|
|
|
|
|
const std::string UtilityConfig::RulebaseDownloadStatusFile("SNIFFER_PATHgetRulebase.status");
|
|
|
|
|
|
|
|
|
#ifdef DEFAULT_DATA_DIR
|
|
|
#ifdef DEFAULT_DATA_DIR
|
|
|
// *nix, DEFAULT_DATA_DIR is specified on the compile command line.
|
|
|
// *nix, DEFAULT_DATA_DIR is specified on the compile command line.
|
|
|
|
|
|
|
|
|
string
|
|
|
string
|
|
|
UtilityConfig::GetRulebasePath(void) {
|
|
|
UtilityConfig::GetRulebasePath(void) {
|
|
|
|
|
|
|
|
|
return CFGData.paths_rulebase_path;
|
|
|
|
|
|
|
|
|
if (CFGData.paths_rulebase_path.empty())
|
|
|
|
|
|
return "";
|
|
|
|
|
|
|
|
|
|
|
|
// Ensure that there's a trailing "/".
|
|
|
|
|
|
if (CFGData.paths_rulebase_path[CFGData.paths_rulebase_path.length() - 1] ==
|
|
|
|
|
|
'/')
|
|
|
|
|
|
return CFGData.paths_rulebase_path;
|
|
|
|
|
|
|
|
|
|
|
|
return CFGData.paths_rulebase_path + "/";
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
string
|
|
|
string
|
|
|
|
|
|
|
|
|
if (!Input) {
|
|
|
if (!Input) {
|
|
|
string Temp;
|
|
|
string Temp;
|
|
|
|
|
|
|
|
|
Temp = "Error opening rulebase download scriptstatus file " + StatusFile;
|
|
|
|
|
|
|
|
|
Temp = "Error opening rulebase download script status file " + StatusFile;
|
|
|
Temp += ": ";
|
|
|
Temp += ": ";
|
|
|
Temp += strerror(errno);
|
|
|
Temp += strerror(errno);
|
|
|
throw std::runtime_error(Temp);
|
|
|
throw std::runtime_error(Temp);
|