/* convert lists to SigMatchData arrays */
int i = 0;
- for (i = DETECT_SM_LIST_BUILTIN_MAX; i < nlists; i++) {
+ for (i = DETECT_SM_LIST_DYNAMIC_START; i < nlists; i++) {
if (s->init_data->smlists[i] == NULL)
continue;
#include "util-hash-lookup3.h"
static HashListTable *g_buffer_type_hash = NULL;
-static int g_buffer_type_id = DETECT_SM_LIST_MAX; // past DETECT_SM_LIST_NOTSET
+static int g_buffer_type_id = DETECT_SM_LIST_DYNAMIC_START;
static int g_buffer_type_reg_closed = 0;
typedef struct DetectBufferType_ {
g_buffer_type_map = SCCalloc(size, sizeof(DetectBufferType *));
BUG_ON(!g_buffer_type_map);
+ SCLogDebug("DETECT_SM_LIST_DYNAMIC_START %u", DETECT_SM_LIST_DYNAMIC_START);
HashListTableBucket *b = HashListTableGetListHead(g_buffer_type_hash);
while (b) {
DetectBufferType *map = HashListTableGetListData(b);
case DETECT_SM_LIST_THRESHOLD:
return "threshold";
- case DETECT_SM_LIST_BUILTIN_MAX:
case DETECT_SM_LIST_MAX:
return "max (internal)";
- case DETECT_SM_LIST_NOTSET:
- return "not set (internal)";
}
return "error";
}
CASE_CODE_STRING(DETECT_SM_LIST_SUPPRESS, "suppress");
CASE_CODE_STRING(DETECT_SM_LIST_THRESHOLD, "threshold");
CASE_CODE_STRING(DETECT_SM_LIST_MAX, "max (internal)");
- CASE_CODE_STRING(DETECT_SM_LIST_NOTSET, "not set (internal)");
}
#undef CASE_CODE_STRING
return "unknown";
CASE_CODE(DETECT_SM_LIST_SUPPRESS);
CASE_CODE(DETECT_SM_LIST_THRESHOLD);
CASE_CODE(DETECT_SM_LIST_MAX);
- CASE_CODE(DETECT_SM_LIST_NOTSET);
}
return "unknown";
}
{
if (s != NULL) {
int type;
- for (type = 0; type < DETECT_SM_LIST_BUILTIN_MAX; type++) {
+ for (type = 0; type < DETECT_SM_LIST_MAX; type++) {
if (s->sm_arrays[type] != NULL) {
if (ctxs) {
SigMatchData *smd = s->sm_arrays[type];
/* set up inspect engines */
DetectEngineAppInspectionEngine2Signature(s);
+ /* built-ins */
int type;
- for (type = 0; type < DETECT_SM_LIST_BUILTIN_MAX; type++) {
+ for (type = 0; type < DETECT_SM_LIST_MAX; type++) {
SigMatch *sm = s->init_data->smlists[type];
s->sm_arrays[type] = SigMatchList2DataArray(sm);
}
DETECT_SM_LIST_SUPPRESS,
DETECT_SM_LIST_THRESHOLD,
- /* used for Signature->list, which indicates which list
- * we're adding keywords to in cases of sticky buffers like
- * file_data */
- DETECT_SM_LIST_NOTSET,
-
- DETECT_SM_LIST_BUILTIN_MAX,
-
DETECT_SM_LIST_MAX,
+ /* start of dynamically registered lists */
+ DETECT_SM_LIST_DYNAMIC_START = DETECT_SM_LIST_MAX,
};
+/* used for Signature->list, which indicates which list
+ * we're adding keywords to in cases of sticky buffers like
+ * file_data */
+#define DETECT_SM_LIST_NOTSET INT_MAX
+
/* a is ... than b */
enum {
ADDRESS_ER = -1, /**< error e.g. compare ipv4 and ipv6 */
/* Matching structures for the built-ins. The others are in
* their inspect engines. */
- SigMatchData *sm_arrays[DETECT_SM_LIST_BUILTIN_MAX];
+ SigMatchData *sm_arrays[DETECT_SM_LIST_MAX];
/* memory is still owned by the sm_lists/sm_arrays entry */
const struct DetectFilestoreData_ *filestore_ctx;