memset(ctx->pid_pat_list, 0, (ctx->max_pat_id + 1) * sizeof(SCACBSPatternList));
for (i = 0; i < mpm_ctx->pattern_cnt; i++) {
- if (ctx->parray[i]->flags & MPM_PATTERN_FLAG_NOCASE) {
- if (ctx->pid_pat_list[ctx->parray[i]->id].case_state == 0)
- ctx->pid_pat_list[ctx->parray[i]->id].case_state = 1;
- else if (ctx->pid_pat_list[ctx->parray[i]->id].case_state == 1)
- ctx->pid_pat_list[ctx->parray[i]->id].case_state = 1;
- else
- ctx->pid_pat_list[ctx->parray[i]->id].case_state = 3;
- } else {
- //if (memcmp(ctx->parray[i]->original_pat, ctx->parray[i]->ci,
- // ctx->parray[i]->len) != 0) {
- ctx->pid_pat_list[ctx->parray[i]->id].cs = SCMalloc(ctx->parray[i]->len);
- if (ctx->pid_pat_list[ctx->parray[i]->id].cs == NULL) {
- SCLogError(SC_ERR_MEM_ALLOC, "Error allocating memory");
- exit(EXIT_FAILURE);
- }
- memcpy(ctx->pid_pat_list[ctx->parray[i]->id].cs,
- ctx->parray[i]->original_pat, ctx->parray[i]->len);
- ctx->pid_pat_list[ctx->parray[i]->id].patlen = ctx->parray[i]->len;
-
- if (ctx->pid_pat_list[ctx->parray[i]->id].case_state == 0)
- ctx->pid_pat_list[ctx->parray[i]->id].case_state = 2;
- else if (ctx->pid_pat_list[ctx->parray[i]->id].case_state == 2)
- ctx->pid_pat_list[ctx->parray[i]->id].case_state = 2;
- else
- ctx->pid_pat_list[ctx->parray[i]->id].case_state = 3;
- //}
+ if (!(ctx->parray[i]->flags & MPM_PATTERN_FLAG_NOCASE)) {
+ ctx->pid_pat_list[ctx->parray[i]->id].cs = SCMalloc(ctx->parray[i]->len);
+ if (ctx->pid_pat_list[ctx->parray[i]->id].cs == NULL) {
+ SCLogError(SC_ERR_MEM_ALLOC, "Error allocating memory");
+ exit(EXIT_FAILURE);
+ }
+ memcpy(ctx->pid_pat_list[ctx->parray[i]->id].cs,
+ ctx->parray[i]->original_pat, ctx->parray[i]->len);
+ ctx->pid_pat_list[ctx->parray[i]->id].patlen = ctx->parray[i]->len;
}
}
buf + i - pid_pat_list[pids[k] & 0x0000FFFF].patlen + 1,
pid_pat_list[pids[k] & 0x0000FFFF].patlen) != 0) {
/* inside loop */
- if (pid_pat_list[pids[k] & 0x0000FFFF].case_state != 3) {
- continue;
- }
+ continue;
}
if (pmq->pattern_id_bitarray[(pids[k] & 0x0000FFFF) / 8] & (1 << ((pids[k] & 0x0000FFFF) % 8))) {
;
buf + i - pid_pat_list[pids[k] & 0x0000FFFF].patlen + 1,
pid_pat_list[pids[k] & 0x0000FFFF].patlen) != 0) {
/* inside loop */
- if (pid_pat_list[pids[k] & 0x0000FFFF].case_state != 3) {
- continue;
- }
+ continue;
}
if (pmq->pattern_id_bitarray[(pids[k] & 0x0000FFFF) / 8] & (1 << ((pids[k] & 0x0000FFFF) % 8))) {
;
-/* Copyright (C) 2007-2010 Open Information Security Foundation
+/* Copyright (C) 2007-2014 Open Information Security Foundation
*
* You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free
typedef struct SCACBSPatternList_ {
uint8_t *cs;
uint16_t patlen;
- uint16_t case_state;
} SCACBSPatternList;
typedef struct SCACBSOutputTable_ {
memset(ctx->pid_pat_list, 0, (ctx->max_pat_id + 1) * sizeof(SCACGfbsPatternList));
for (i = 0; i < mpm_ctx->pattern_cnt; i++) {
- if (ctx->parray[i]->flags & MPM_PATTERN_FLAG_NOCASE) {
- if (ctx->pid_pat_list[ctx->parray[i]->id].case_state == 0)
- ctx->pid_pat_list[ctx->parray[i]->id].case_state = 1;
- else if (ctx->pid_pat_list[ctx->parray[i]->id].case_state == 1)
- ctx->pid_pat_list[ctx->parray[i]->id].case_state = 1;
- else
- ctx->pid_pat_list[ctx->parray[i]->id].case_state = 3;
- } else {
+ if (!(ctx->parray[i]->flags & MPM_PATTERN_FLAG_NOCASE)) {
ctx->pid_pat_list[ctx->parray[i]->id].cs = SCMalloc(ctx->parray[i]->len);
if (ctx->pid_pat_list[ctx->parray[i]->id].cs == NULL) {
SCLogError(SC_ERR_MEM_ALLOC, "Error allocating memory");
memcpy(ctx->pid_pat_list[ctx->parray[i]->id].cs,
ctx->parray[i]->original_pat, ctx->parray[i]->len);
ctx->pid_pat_list[ctx->parray[i]->id].patlen = ctx->parray[i]->len;
-
- if (ctx->pid_pat_list[ctx->parray[i]->id].case_state == 0)
- ctx->pid_pat_list[ctx->parray[i]->id].case_state = 2;
- else if (ctx->pid_pat_list[ctx->parray[i]->id].case_state == 2)
- ctx->pid_pat_list[ctx->parray[i]->id].case_state = 2;
- else
- ctx->pid_pat_list[ctx->parray[i]->id].case_state = 3;
}
}
buf + i - pid_pat_list[pids[k] & 0x0000FFFF].patlen + 1,
pid_pat_list[pids[k] & 0x0000FFFF].patlen) != 0) {
/* inside loop */
- if (pid_pat_list[pids[k] & 0x0000FFFF].case_state != 3) {
- continue;
- }
+ continue;
}
if (pmq->pattern_id_bitarray[(pids[k] & 0x0000FFFF) / 8] & (1 << ((pids[k] & 0x0000FFFF) % 8))) {
buf + i - pid_pat_list[pids[k] & 0x0000FFFF].patlen + 1,
pid_pat_list[pids[k] & 0x0000FFFF].patlen) != 0) {
/* inside loop */
- if (pid_pat_list[pids[k] & 0x0000FFFF].case_state != 3) {
- continue;
- }
continue;
}
-/* Copyright (C) 2007-2010 Open Information Security Foundation
+/* Copyright (C) 2007-2014 Open Information Security Foundation
*
* You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free
typedef struct SCACGfbsPatternList_ {
uint8_t *cs;
uint16_t patlen;
- uint16_t case_state;
} SCACGfbsPatternList;
typedef struct SCACGfbsOutputTable_ {
memset(ctx->pid_pat_list, 0, (ctx->max_pat_id + 1) * sizeof(SCACTilePatternList));
for (i = 0; i < mpm_ctx->pattern_cnt; i++) {
- if (ctx->parray[i]->flags & MPM_PATTERN_FLAG_NOCASE) {
- if (ctx->pid_pat_list[ctx->parray[i]->id].case_state == 0)
- ctx->pid_pat_list[ctx->parray[i]->id].case_state = 1;
- else if (ctx->pid_pat_list[ctx->parray[i]->id].case_state == 1)
- ctx->pid_pat_list[ctx->parray[i]->id].case_state = 1;
- else
- ctx->pid_pat_list[ctx->parray[i]->id].case_state = 3;
- } else {
+ if (!(ctx->parray[i]->flags & MPM_PATTERN_FLAG_NOCASE)) {
ctx->pid_pat_list[ctx->parray[i]->id].cs = SCMalloc(ctx->parray[i]->len);
if (ctx->pid_pat_list[ctx->parray[i]->id].cs == NULL) {
SCLogError(SC_ERR_MEM_ALLOC, "Error allocating memory");
memcpy(ctx->pid_pat_list[ctx->parray[i]->id].cs,
ctx->parray[i]->original_pat, ctx->parray[i]->len);
ctx->pid_pat_list[ctx->parray[i]->id].patlen = ctx->parray[i]->len;
-
- if (ctx->pid_pat_list[ctx->parray[i]->id].case_state == 0)
- ctx->pid_pat_list[ctx->parray[i]->id].case_state = 2;
- else if (ctx->pid_pat_list[ctx->parray[i]->id].case_state == 2)
- ctx->pid_pat_list[ctx->parray[i]->id].case_state = 2;
- else
- ctx->pid_pat_list[ctx->parray[i]->id].case_state = 3;
}
}
uint16_t patlen = pid_pat_list[lower_pid].patlen;
if (SCMemcmp(pid_pat_list[lower_pid].cs, buf_offset - patlen, patlen) != 0) {
/* inside loop */
- if (pid_pat_list[lower_pid].case_state != 3) {
- continue;
- }
+ continue;
}
}
if (bitarray[(lower_pid) / 8] & (1 << ((lower_pid) % 8))) {
if (SCMemcmp(pid_pat_list[pids[k] & 0x0000FFFF].cs,
buf + i - pid_pat_list[pids[k] & 0x0000FFFF].patlen + 1,
pid_pat_list[pids[k] & 0x0000FFFF].patlen) != 0) {
- /* inside loop */
- if (pid_pat_list[pids[k] & 0x0000FFFF].case_state != 3) {
- continue;
- }
+ /* inside loop */
+ continue;
}
if (pmq->pattern_id_bitarray[(pids[k] & 0x0000FFFF) / 8] &
(1 << ((pids[k] & 0x0000FFFF) % 8))) {
-/* Copyright (C) 2013 Open Information Security Foundation
+/* Copyright (C) 2013-2014 Open Information Security Foundation
*
* You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free
typedef struct SCACTilePatternList_ {
uint8_t *cs;
uint16_t patlen;
- uint16_t case_state;
} SCACTilePatternList;
typedef struct SCACTileOutputTable_ {
-/* Copyright (C) 2007-2010 Open Information Security Foundation
+/* Copyright (C) 2007-2014 Open Information Security Foundation
*
* You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free
memset(ctx->pid_pat_list, 0, (ctx->max_pat_id + 1) * sizeof(SCACPatternList));
for (i = 0; i < mpm_ctx->pattern_cnt; i++) {
- if (ctx->parray[i]->flags & MPM_PATTERN_FLAG_NOCASE) {
- if (ctx->pid_pat_list[ctx->parray[i]->id].case_state == 0)
- ctx->pid_pat_list[ctx->parray[i]->id].case_state = 1;
- else if (ctx->pid_pat_list[ctx->parray[i]->id].case_state == 1)
- ctx->pid_pat_list[ctx->parray[i]->id].case_state = 1;
- else
- ctx->pid_pat_list[ctx->parray[i]->id].case_state = 3;
- } else {
- //if (memcmp(ctx->parray[i]->original_pat, ctx->parray[i]->ci,
- // ctx->parray[i]->len) != 0) {
- ctx->pid_pat_list[ctx->parray[i]->id].cs = SCMalloc(ctx->parray[i]->len);
- if (ctx->pid_pat_list[ctx->parray[i]->id].cs == NULL) {
- SCLogError(SC_ERR_MEM_ALLOC, "Error allocating memory");
- exit(EXIT_FAILURE);
- }
- memcpy(ctx->pid_pat_list[ctx->parray[i]->id].cs,
- ctx->parray[i]->original_pat, ctx->parray[i]->len);
- ctx->pid_pat_list[ctx->parray[i]->id].patlen = ctx->parray[i]->len;
-
- if (ctx->pid_pat_list[ctx->parray[i]->id].case_state == 0)
- ctx->pid_pat_list[ctx->parray[i]->id].case_state = 2;
- else if (ctx->pid_pat_list[ctx->parray[i]->id].case_state == 2)
- ctx->pid_pat_list[ctx->parray[i]->id].case_state = 2;
- else
- ctx->pid_pat_list[ctx->parray[i]->id].case_state = 3;
- //}
+ if (!(ctx->parray[i]->flags & MPM_PATTERN_FLAG_NOCASE)) {
+ ctx->pid_pat_list[ctx->parray[i]->id].cs = SCMalloc(ctx->parray[i]->len);
+ if (ctx->pid_pat_list[ctx->parray[i]->id].cs == NULL) {
+ SCLogError(SC_ERR_MEM_ALLOC, "Error allocating memory");
+ exit(EXIT_FAILURE);
+ }
+ memcpy(ctx->pid_pat_list[ctx->parray[i]->id].cs,
+ ctx->parray[i]->original_pat, ctx->parray[i]->len);
+ ctx->pid_pat_list[ctx->parray[i]->id].patlen = ctx->parray[i]->len;
}
}
buf + i - pid_pat_list[pids[k] & 0x0000FFFF].patlen + 1,
pid_pat_list[pids[k] & 0x0000FFFF].patlen) != 0) {
/* inside loop */
- if (pid_pat_list[pids[k] & 0x0000FFFF].case_state != 3) {
- continue;
- }
+ continue;
}
if (pmq->pattern_id_bitarray[(pids[k] & 0x0000FFFF) / 8] & (1 << ((pids[k] & 0x0000FFFF) % 8))) {
;
buf + i - pid_pat_list[pids[k] & 0x0000FFFF].patlen + 1,
pid_pat_list[pids[k] & 0x0000FFFF].patlen) != 0) {
/* inside loop */
- if (pid_pat_list[pids[k] & 0x0000FFFF].case_state != 3) {
- continue;
- }
+ continue;
}
if (pmq->pattern_id_bitarray[(pids[k] & 0x0000FFFF) / 8] & (1 << ((pids[k] & 0x0000FFFF) % 8))) {
;
buf + offset - pid_pat_list[pids[k] & 0x0000FFFF].patlen + 1,
pid_pat_list[pids[k] & 0x0000FFFF].patlen) != 0) {
/* inside loop */
- if (pid_pat_list[pids[k] & 0x0000FFFF].case_state != 3) {
- continue;
- }
+ continue;
}
if (pmq->pattern_id_bitarray[(pids[k] & 0x0000FFFF) / 8] & (1 << ((pids[k] & 0x0000FFFF) % 8))) {
;
-/* Copyright (C) 2007-2010 Open Information Security Foundation
+/* Copyright (C) 2007-2014 Open Information Security Foundation
*
* You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free
typedef struct SCACPatternList_ {
uint8_t *cs;
uint16_t patlen;
- uint16_t case_state;
} SCACPatternList;
typedef struct SCACOutputTable_ {