if (prelude_profile_name == NULL)
prelude_profile_name = DEFAULT_PRELUDE_PROFILE;
- log_packet_content = ConfNodeLookupChildValue(conf, "log_packet_content");
- log_packet_header = ConfNodeLookupChildValue(conf, "log_packet_header");
+ log_packet_content = ConfNodeLookupChildValue(conf, "log-packet-content");
+ log_packet_header = ConfNodeLookupChildValue(conf, "log-packet-header");
ret = prelude_client_new(&client, prelude_profile_name);
if ( ret < 0 || ! client ) {
AppLayerRegisterStateFuncs(ALPROTO_TLS, SSLStateAlloc, SSLStateFree);
/* Get the value of no reassembly option from the config file */
- if (ConfGetBool("tls.no_reassemble", &ssl_config.no_reassemble) != 1)
+ if (ConfGetBool("tls.no-reassemble", &ssl_config.no_reassemble) != 1)
ssl_config.no_reassemble = 1;
return;
memset(de_ctx,0,sizeof(DetectEngineCtx));
- if (ConfGetBool("engine.init_failure_fatal", (int *)&(de_ctx->failure_fatal)) != 1) {
+ if (ConfGetBool("engine.init-failure-fatal", (int *)&(de_ctx->failure_fatal)) != 1) {
SCLogDebug("ConfGetBool could not load the value.");
}
/* If we have specific config, overwrite the defaults with them,
* otherwise, leave the default values */
intmax_t val = 0;
- if (ConfGetInt("flow.emergency_recovery", &val) == 1) {
+ if (ConfGetInt("flow.emergency-recovery", &val) == 1) {
if (val <= 100 && val >= 1) {
flow_config.emergency_recovery = (uint8_t)val;
} else {
- SCLogError(SC_ERR_INVALID_VALUE, "flow.emergency_recovery must be in the range of 1 and 100 (as percentage)");
+ SCLogError(SC_ERR_INVALID_VALUE, "flow.emergency-recovery must be in the range of 1 and 100 (as percentage)");
flow_config.emergency_recovery = FLOW_DEFAULT_EMERGENCY_RECOVERY;
}
} else {
- SCLogDebug("flow.emergency_recovery, using default value");
+ SCLogDebug("flow.emergency-recovery, using default value");
flow_config.emergency_recovery = FLOW_DEFAULT_EMERGENCY_RECOVERY;
}
- if (ConfGetInt("flow.prune_flows", &val) == 1) {
+ if (ConfGetInt("flow.prune-flows", &val) == 1) {
flow_config.flow_try_release = (uint8_t)val;
} else {
- SCLogDebug("flow.flow.prune_flows, using default value");
+ SCLogDebug("flow.flow.prune-flows, using default value");
flow_config.flow_try_release = FLOW_DEFAULT_FLOW_PRUNE;
}
exit(EXIT_FAILURE);
}
}
- if ((ConfGet("flow.hash_size", &conf_val)) == 1)
+ if ((ConfGet("flow.hash-size", &conf_val)) == 1)
{
if (ByteExtractStringUint32(&configval, 10, strlen(conf_val),
conf_val) > 0) {
flow_config.prealloc = configval;
}
}
- SCLogDebug("Flow config from suricata.yaml: memcap: %"PRIu64", hash_size: "
+ SCLogDebug("Flow config from suricata.yaml: memcap: %"PRIu64", hash-size: "
"%"PRIu32", prealloc: %"PRIu32, flow_config.memcap,
flow_config.hash_size, flow_config.prealloc);
new = ConfNodeLookupChildValue(proto, "new");
established = ConfNodeLookupChildValue(proto, "established");
closed = ConfNodeLookupChildValue(proto, "closed");
- emergency_new = ConfNodeLookupChildValue(proto, "emergency_new");
+ emergency_new = ConfNodeLookupChildValue(proto, "emergency-new");
emergency_established = ConfNodeLookupChildValue(proto,
- "emergency_established");
+ "emergency-established");
emergency_closed = ConfNodeLookupChildValue(proto,
- "emergency_closed");
+ "emergency-closed");
if (new != NULL &&
ByteExtractStringUint32(&configval, 10, strlen(new), new) > 0) {
new = ConfNodeLookupChildValue(proto, "new");
established = ConfNodeLookupChildValue(proto, "established");
closed = ConfNodeLookupChildValue(proto, "closed");
- emergency_new = ConfNodeLookupChildValue(proto, "emergency_new");
+ emergency_new = ConfNodeLookupChildValue(proto, "emergency-new");
emergency_established = ConfNodeLookupChildValue(proto,
- "emergency_established");
+ "emergency-established");
emergency_closed = ConfNodeLookupChildValue(proto,
- "emergency_closed");
+ "emergency-closed");
if (new != NULL &&
ByteExtractStringUint32(&configval, 10, strlen(new), new) > 0) {
if (proto != NULL) {
new = ConfNodeLookupChildValue(proto, "new");
established = ConfNodeLookupChildValue(proto, "established");
- emergency_new = ConfNodeLookupChildValue(proto, "emergency_new");
+ emergency_new = ConfNodeLookupChildValue(proto, "emergency-new");
emergency_established = ConfNodeLookupChildValue(proto,
- "emergency_established");
+ "emergency-established");
if (new != NULL &&
ByteExtractStringUint32(&configval, 10, strlen(new), new) > 0) {
if (proto != NULL) {
new = ConfNodeLookupChildValue(proto, "new");
established = ConfNodeLookupChildValue(proto, "established");
- emergency_new = ConfNodeLookupChildValue(proto, "emergency_new");
+ emergency_new = ConfNodeLookupChildValue(proto, "emergency-new");
emergency_established = ConfNodeLookupChildValue(proto,
- "emergency_established");
+ "emergency-established");
if (new != NULL &&
ByteExtractStringUint32(&configval, 10, strlen(new), new) > 0) {
RunModeInitialize();
char *iface = NULL;
- if (ConfGet("erf_dag.iface", &iface) == 0) {
- SCLogError(SC_ERR_RUNMODE, "Failed retrieving pcap_file from Conf");
+ if (ConfGet("erf-dag.iface", &iface) == 0) {
+ SCLogError(SC_ERR_RUNMODE, "Failed retrieving erf-dag.iface from Conf");
exit(EXIT_FAILURE);
}
SCLogDebug("iface %s", iface);
RunModeInitialize();
char *file = NULL;
- if (ConfGet("erf_file.file", &file) == 0) {
- SCLogError(SC_ERR_RUNMODE, "Failed retrieving erf_file.file "
+ if (ConfGet("erf-file.file", &file) == 0) {
+ SCLogError(SC_ERR_RUNMODE, "Failed retrieving erf-file.file "
"from Conf");
exit(EXIT_FAILURE);
}
int RunModeFilePcapSingle(DetectEngineCtx *de_ctx)
{
char *file = NULL;
- if (ConfGet("pcap_file.file", &file) == 0) {
+ if (ConfGet("pcap-file.file", &file) == 0) {
SCLogError(SC_ERR_RUNMODE, "Failed retrieving pcap_file from Conf");
exit(EXIT_FAILURE);
}
uint16_t ncpus = UtilCpuGetNumProcessorsOnline();
char *file = NULL;
- if (ConfGet("pcap_file.file", &file) == 0) {
+ if (ConfGet("pcap-file.file", &file) == 0) {
SCLogError(SC_ERR_RUNMODE, "Failed retrieving pcap_file from Conf");
exit(EXIT_FAILURE);
}
SCLogDebug("queues %s", queues);
char *file = NULL;
- if (ConfGet("pcap_file.file", &file) == 0) {
+ if (ConfGet("pcap-file.file", &file) == 0) {
SCLogError(SC_ERR_RUNMODE, "Failed retrieving pcap_file from Conf");
exit(EXIT_FAILURE);
}
RunModeInitialize();
TimeModeSetLive();
- ConfGet("pcap.single_pcap_dev", &live_dev);
+ ConfGet("pcap.single-pcap-dev", &live_dev);
ret = RunModeSetLiveCaptureSingle(de_ctx,
ParsePcapConfig,
RunModeInitialize();
TimeModeSetLive();
- ConfGet("pcap.single_pcap_dev", &live_dev);
+ ConfGet("pcap.single-pcap-dev", &live_dev);
ret = RunModeSetLiveCaptureAuto(de_ctx,
ParsePcapConfig,
RunModeInitialize();
TimeModeSetLive();
- ConfGet("pcap.single_pcap_dev", &live_dev);
+ ConfGet("pcap.single-pcap-dev", &live_dev);
ret = RunModeSetLiveCaptureAutoFp(de_ctx,
ParsePcapConfig,
void RunModeInitialize(void)
{
threading_set_cpu_affinity = FALSE;
- if ((ConfGetBool("threading.set_cpu_affinity", &threading_set_cpu_affinity)) == 0) {
+ if ((ConfGetBool("threading.set-cpu-affinity", &threading_set_cpu_affinity)) == 0) {
threading_set_cpu_affinity = FALSE;
}
/* try to get custom cpu mask value if needed */
if (threading_set_cpu_affinity == TRUE) {
AffinitySetupLoadFromConfig();
}
- if ((ConfGetFloat("threading.detect_thread_ratio", &threading_detect_ratio)) != 1) {
+ if ((ConfGetFloat("threading.detect-thread-ratio", &threading_detect_ratio)) != 1) {
threading_detect_ratio = 1;
}
- SCLogDebug("threading_detect_ratio %f", threading_detect_ratio);
+ SCLogDebug("threading.detect-thread-ratio %f", threading_detect_ratio);
}
}
}
- if ((ConfGetInt("nfq.repeat_mark", &value)) == 1) {
+ if ((ConfGetInt("nfq.repeat-mark", &value)) == 1) {
nfq_config.mark = (uint32_t)value;
}
- if ((ConfGetInt("nfq.repeat_mask", &value)) == 1) {
+ if ((ConfGetInt("nfq.repeat-mask", &value)) == 1) {
nfq_config.mask = (uint32_t)value;
}
- if ((ConfGetInt("nfq.route_queue", &value)) == 1) {
+ if ((ConfGetInt("nfq.route-queue", &value)) == 1) {
nfq_config.next_queue = ((uint32_t)value) << 16;
}
memset(&stream_config, 0, sizeof(stream_config));
/** set config defaults */
- if ((ConfGetInt("stream.max_sessions", &value)) == 1) {
+ if ((ConfGetInt("stream.max-sessions", &value)) == 1) {
stream_config.max_sessions = (uint32_t)value;
} else {
if (RunmodeIsUnittests())
stream_config.max_sessions = STREAMTCP_DEFAULT_SESSIONS;
}
if (!quiet) {
- SCLogInfo("stream \"max_sessions\": %"PRIu32"", stream_config.max_sessions);
+ SCLogInfo("stream \"max-sessions\": %"PRIu32"", stream_config.max_sessions);
}
- if ((ConfGetInt("stream.prealloc_sessions", &value)) == 1) {
+ if ((ConfGetInt("stream.prealloc-sessions", &value)) == 1) {
stream_config.prealloc_sessions = (uint32_t)value;
} else {
if (RunmodeIsUnittests())
stream_config.prealloc_sessions = STREAMTCP_DEFAULT_PREALLOC;
}
if (!quiet) {
- SCLogInfo("stream \"prealloc_sessions\": %"PRIu32"", stream_config.prealloc_sessions);
+ SCLogInfo("stream \"prealloc-sessions\": %"PRIu32"", stream_config.prealloc_sessions);
}
char *temp_stream_memcap_str;
SCLogInfo("stream \"midstream\" session pickups: %s", stream_config.midstream ? "enabled" : "disabled");
}
- ConfGetBool("stream.async_oneside", &stream_config.async_oneside);
+ ConfGetBool("stream.async-oneside", &stream_config.async_oneside);
if (!quiet) {
- SCLogInfo("stream \"async_oneside\": %s", stream_config.async_oneside ? "enabled" : "disabled");
+ SCLogInfo("stream \"async-oneside\": %s", stream_config.async_oneside ? "enabled" : "disabled");
}
int csum = 0;
- if ((ConfGetBool("stream.checksum_validation", &csum)) == 1) {
+ if ((ConfGetBool("stream.checksum-validation", &csum)) == 1) {
if (csum == 1) {
stream_config.flags |= STREAMTCP_INIT_FLAG_CHECKSUM_VALIDATION;
}
}
if (!quiet) {
- SCLogInfo("stream \"checksum_validation\": %s",
+ SCLogInfo("stream \"checksum-validation\": %s",
stream_config.flags & STREAMTCP_INIT_FLAG_CHECKSUM_VALIDATION ?
"enabled" : "disabled");
}
}
char *temp_stream_reassembly_toserver_chunk_size_str;
- if (ConfGet("stream.reassembly.toserver_chunk_size",
+ if (ConfGet("stream.reassembly.toserver-chunk-size",
&temp_stream_reassembly_toserver_chunk_size_str) == 1) {
if (ParseSizeStringU16(temp_stream_reassembly_toserver_chunk_size_str,
&stream_config.reassembly_toserver_chunk_size) < 0) {
SCLogError(SC_ERR_SIZE_PARSE, "Error parsing "
- "stream.reassembly.toserver_chunk_size "
+ "stream.reassembly.toserver-chunk-size "
"from conf file - %s. Killing engine",
temp_stream_reassembly_toserver_chunk_size_str);
exit(EXIT_FAILURE);
stream_config.reassembly_toserver_chunk_size);
char *temp_stream_reassembly_toclient_chunk_size_str;
- if (ConfGet("stream.reassembly.toclient_chunk_size",
+ if (ConfGet("stream.reassembly.toclient-chunk-size",
&temp_stream_reassembly_toclient_chunk_size_str) == 1) {
if (ParseSizeStringU16(temp_stream_reassembly_toclient_chunk_size_str,
&stream_config.reassembly_toclient_chunk_size) < 0) {
SCLogError(SC_ERR_SIZE_PARSE, "Error parsing "
- "stream.reassembly.toclient_chunk_size "
+ "stream.reassembly.toclient-chunk-size "
"from conf file - %s. Killing engine",
temp_stream_reassembly_toclient_chunk_size_str);
exit(EXIT_FAILURE);
stream_config.reassembly_toclient_chunk_size);
if (!quiet) {
- SCLogInfo("stream.reassembly \"toserver_chunk_size\": %"PRIu16,
+ SCLogInfo("stream.reassembly \"toserver-chunk-size\": %"PRIu16,
stream_config.reassembly_toserver_chunk_size);
- SCLogInfo("stream.reassembly \"toclient_chunk_size\": %"PRIu16,
+ SCLogInfo("stream.reassembly \"toclient-chunk-size\": %"PRIu16,
stream_config.reassembly_toclient_chunk_size);
}
exit(EXIT_FAILURE);
}
} else if(strcmp((long_opts[option_index]).name, "init-errors-fatal") == 0) {
- if (ConfSet("engine.init_failure_fatal", "1", 0) != 1) {
- fprintf(stderr, "ERROR: Failed to set engine init_failure_fatal.\n");
+ if (ConfSet("engine.init-failure-fatal", "1", 0) != 1) {
+ fprintf(stderr, "ERROR: Failed to set engine init-failure-fatal.\n");
exit(EXIT_FAILURE);
}
}
}
else if(strcmp((long_opts[option_index]).name, "fatal-unittests") == 0) {
#ifdef UNITTESTS
- if (ConfSet("unittests.failure_fatal", "1", 0) != 1) {
- fprintf(stderr, "ERROR: Failed to set unittests failure_fatal.\n");
+ if (ConfSet("unittests.failure-fatal", "1", 0) != 1) {
+ fprintf(stderr, "ERROR: Failed to set unittests failure-fatal.\n");
exit(EXIT_FAILURE);
}
#else
}
else if (strcmp((long_opts[option_index]).name, "erf-in") == 0) {
run_mode = RUNMODE_ERF_FILE;
- if (ConfSet("erf_file.file", optarg, 0) != 1) {
- fprintf(stderr, "ERROR: Failed to set erf_file.file\n");
+ if (ConfSet("erf-file.file", optarg, 0) != 1) {
+ fprintf(stderr, "ERROR: Failed to set erf-file.file\n");
exit(EXIT_FAILURE);
}
}
else if (strcmp((long_opts[option_index]).name, "dag") == 0) {
#ifdef HAVE_DAG
run_mode = RUNMODE_DAG;
- if (ConfSet("erf_dag.iface", optarg, 0) != 1) {
+ if (ConfSet("erf-dag.iface", optarg, 0) != 1) {
fprintf(stderr, "ERROR: Failed to set erf_dag.iface\n");
exit(EXIT_FAILURE);
}
usage(argv[0]);
exit(EXIT_SUCCESS);
}
- if (ConfSet("pcap_file.file", optarg, 0) != 1) {
- fprintf(stderr, "ERROR: Failed to set pcap_file.file\n");
+ if (ConfSet("pcap-file.file", optarg, 0) != 1) {
+ fprintf(stderr, "ERROR: Failed to set pcap-file.file\n");
exit(EXIT_FAILURE);
}
break;
void AffinitySetupLoadFromConfig()
{
#if !defined __CYGWIN__ && !defined OS_WIN32 && !defined __OpenBSD__
- ConfNode *root = ConfGetNode("threading.cpu_affinity");
+ ConfNode *root = ConfGetNode("threading.cpu-affinity");
ConfNode *affinity;
AffinitySetupInit();
SCLogDebug("Load affinity from config\n");
if (root == NULL) {
- SCLogInfo("can't get cpu_affinity node");
+ SCLogInfo("can't get cpu-affinity node");
return;
}
ConfNode *nprio = NULL;
if (taf == NULL) {
- SCLogError(SC_ERR_INVALID_ARGUMENT, "unknown cpu_affinity type");
+ SCLogError(SC_ERR_INVALID_ARGUMENT, "unknown cpu-affinity type");
exit(EXIT_FAILURE);
} else {
SCLogInfo("Found affinity definition for \"%s\"",
uint32_t unlimited = 0;
size_t rlim_size = sizeof(rlim_t);
- if (ConfGet ("coredump.max_dump", &dump_size_config) == 0) {
+ if (ConfGet ("coredump.max-dump", &dump_size_config) == 0) {
SCLogDebug ("core dump size not specified");
return 1;
}
intmax_t value = 0;
/** set config defaults */
- if ((ConfGetInt("asn1_max_frames", &value)) == 1) {
+ if ((ConfGetInt("asn1-max-frames", &value)) == 1) {
asn1_max_frames_config = (uint16_t)value;
SCLogDebug("Max stack frame set to %"PRIu16, asn1_max_frames_config);
}
int ov[MAX_SUBSTRINGS];
int failure_fatal;
- if (ConfGetBool("unittests.failure_fatal", &failure_fatal) != 1) {
+ if (ConfGetBool("unittests.failure-fatal", &failure_fatal) != 1) {
SCLogDebug("ConfGetBool could not load the value.");
failure_fatal = 0;
}