int DatasetsInit(void)
{
SCLogDebug("datasets start");
- int n = 0;
ConfNode *datasets = ConfGetNode("datasets");
uint64_t default_memcap = 0;
uint32_t default_hashsize = 0;
char conf_str[1024];
snprintf(conf_str, sizeof(conf_str), "datasets.%d.%s", list_pos, set_name);
- SCLogDebug("(%d) set %s type %s. Conf %s", n, set_name, set_type->val, conf_str);
+ SCLogDebug("set %s type %s. Conf %s", set_name, set_type->val, conf_str);
if (strcmp(set_type->val, "md5") == 0) {
Dataset *dset = DatasetGet(set_name, DATASET_TYPE_MD5, save, load,
hashsize > 0 ? hashsize : default_hashsize);
if (dset == NULL)
FatalError(SC_ERR_FATAL, "failed to setup dataset for %s", set_name);
- SCLogDebug("dataset %s: id %d type %s", set_name, n, set_type->val);
+ SCLogDebug("dataset %s: id %u type %s", set_name, dset->id, set_type->val);
dset->from_yaml = true;
- n++;
} else if (strcmp(set_type->val, "sha256") == 0) {
Dataset *dset = DatasetGet(set_name, DATASET_TYPE_SHA256, save, load,
hashsize > 0 ? hashsize : default_hashsize);
if (dset == NULL)
FatalError(SC_ERR_FATAL, "failed to setup dataset for %s", set_name);
- SCLogDebug("dataset %s: id %d type %s", set_name, n, set_type->val);
+ SCLogDebug("dataset %s: id %u type %s", set_name, dset->id, set_type->val);
dset->from_yaml = true;
- n++;
} else if (strcmp(set_type->val, "string") == 0) {
Dataset *dset = DatasetGet(set_name, DATASET_TYPE_STRING, save, load,
hashsize > 0 ? hashsize : default_hashsize);
if (dset == NULL)
FatalError(SC_ERR_FATAL, "failed to setup dataset for %s", set_name);
- SCLogDebug("dataset %s: id %d type %s", set_name, n, set_type->val);
+ SCLogDebug("dataset %s: id %u type %s", set_name, dset->id, set_type->val);
dset->from_yaml = true;
- n++;
}
list_pos++;
*/
int SigAddressPrepareStage2(DetectEngineCtx *de_ctx)
{
- uint32_t sigs = 0;
-
SCLogDebug("building signature grouping structure, stage 2: "
"building source address lists...");
if (s->init_data->init_flags & SIG_FLAG_INIT_DEONLY) {
DetectEngineAddDecoderEventSig(de_ctx, s);
}
-
- sigs++;
}
IPOnlyPrepare(de_ctx);
static int CIPServiceMatch(ENIPTransaction *enip_data,
DetectCipServiceData *cipserviced)
{
+#ifdef DEBUG
int count = 1;
+#endif
CIPServiceEntry *svc = NULL;
//SCLogDebug("CIPServiceMatchAL");
TAILQ_FOREACH(svc, &enip_data->service_list, next)
return 1;
}
}
+#ifdef DEBUG
count++;
+#endif
}
return 0;
}
void IPOnlyCIDRListFree(IPOnlyCIDRItem *tmphead)
{
SCEnter();
+#ifdef DEBUG
uint32_t i = 0;
-
+#endif
IPOnlyCIDRItem *it, *next = NULL;
if (tmphead == NULL) {
next = it->next;
while (it != NULL) {
+#ifdef DEBUG
i++;
SCLogDebug("Item(%p) %"PRIu32" removed", it, i);
+#endif
SCFree(it);
it = next;
void DetectPortPrintList(DetectPort *head)
{
DetectPort *cur;
+#ifdef DEBUG
uint16_t cnt = 0;
-
+#endif
SCLogDebug("= list start:");
if (head != NULL) {
for (cur = head; cur != NULL; cur = cur->next) {
DetectPortPrint(cur);
+#ifdef DEBUG
cnt++;
+#endif
}
SCLogDebug(" ");
}
Signature *sig = NULL;
SCSigSignatureWrapper *sigw = NULL;
SCSigSignatureWrapper *sigw_list = NULL;
-
+#ifdef DEBUG
int i = 0;
+#endif
SCLogDebug("ordering signatures in memory");
sig = de_ctx->sig_list;
sigw_list = sigw;
sig = sig->next;
+#ifdef DEBUG
i++;
+#endif
}
/* Sort the list */
/* Recreate the sig list in order */
de_ctx->sig_list = NULL;
sigw = sigw_list;
+#ifdef DEBUG
i = 0;
+#endif
while (sigw != NULL) {
+#ifdef DEBUG
i++;
+#endif
sigw->sig->next = NULL;
if (de_ctx->sig_list == NULL) {
/* First entry on the list */
uint16_t flow_mgr_host_spare = StatsRegisterCounter("hosts.spare", th_v);
*/
memset(&ts, 0, sizeof(ts));
- uint32_t hash_passes = 0;
#ifdef FM_PROFILE
+ uint32_t hash_passes = 0;
uint32_t hash_row_checks = 0;
uint32_t hash_passes_chunks = 0;
-#endif
uint32_t hash_full_passes = 0;
+#endif
const uint32_t min_timeout = FlowTimeoutsMin();
const uint32_t pass_in_sec = min_timeout ? min_timeout * 8 : 60;
if (emerg) {
/* in emergency mode, do a full pass of the hash table */
FlowTimeoutHash(&ftd->timeout, &ts, ftd->min, ftd->max, &counters);
- hash_passes++;
+#ifdef FM_PROFILE
hash_full_passes++;
hash_passes++;
-#ifdef FM_PROFILE
hash_passes_chunks += 1;
hash_row_checks += counters.rows_checked;
#endif
hash_pass_iter++;
if (hash_pass_iter == pass_in_sec) {
hash_pass_iter = 0;
+#ifdef FM_PROFILE
hash_full_passes++;
+#endif
StatsIncr(th_v, ftd->cnt.flow_mgr_full_pass);
}
}
- hash_passes++;
#ifdef FM_PROFILE
+ hash_passes++;
hash_row_checks += counters.rows_checked;
hash_passes_chunks += chunks;
#endif
uint64_t recycled_cnt = 0;
struct timeval ts;
memset(&ts, 0, sizeof(ts));
- uint32_t fr_passes = 0;
#ifdef FM_PROFILE
+ uint32_t fr_passes = 0;
struct timeval endts;
struct timeval active;
struct timeval paused;
#endif
TmThreadsUnsetFlag(th_v, THV_PAUSED);
}
- fr_passes++;
#ifdef FM_PROFILE
+ fr_passes++;
struct timeval run_startts;
memset(&run_startts, 0, sizeof(run_startts));
gettimeofday(&run_startts, NULL);
*/
void FlowDisableFlowRecyclerThread(void)
{
- int cnt = 0;
-
/* move all flows still in the hash to the recycler queue */
#ifndef DEBUG
(void)FlowCleanupHash();
strlen(thread_name_flow_rec)) == 0)
{
TmThreadsSetFlag(tv, THV_KILL);
- cnt++;
}
}
SCMutexUnlock(&tv_root_lock);
bool reply_truncated = false;
if (!TAILQ_EMPTY(&tx->response_list)) {
- int resp_code_cnt = 0;
int resp_cnt = 0;
FTPString *response;
bool is_cc_array_open = false;
is_cc_array_open = true;
}
jb_append_string_from_bytes(jb, (const uint8_t *)where, 3);
- resp_code_cnt++;
offset = 4;
}
}
*/
LiveDevice *LiveGetDevice(const char *name)
{
- int i = 0;
LiveDevice *pd;
if (name == NULL) {
if (!strcmp(name, pd->dev)) {
return pd;
}
-
- i++;
}
return NULL;
static bool SCRConfParseFile(DetectEngineCtx *de_ctx, FILE *fd)
{
char line[1024];
- uint8_t i = 1;
-
int runmode = RunmodeGetCurrent();
bool is_conf_test_mode = runmode == RUNMODE_CONF_TEST;
while (fgets(line, sizeof(line), fd) != NULL) {
return false;
}
}
- i++;
}
#ifdef UNITTESTS