replace all Signature->tmatch instances in the engine with Signature->sm_lists[DETECT_SM_LIST_TMATCH]

remotes/origin/master-1.1.x
Anoop Saldanha 15 years ago committed by Victor Julien
parent 3d2f81d978
commit ede7be34b5

@ -219,7 +219,7 @@ void PacketAlertFinalize(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx
} else {
/* Now, if we have an alert, we have to check if we want
* to tag this session or src/dst host */
sm = s->tmatch;
sm = s->sm_lists[DETECT_SM_LIST_TMATCH];
while (sm) {
/* tags are set only for alerts */
sigmatch_table[sm->type].Match(NULL, det_ctx, p, s, sm);

@ -239,17 +239,17 @@ void SigMatchAppendDcePayload(Signature *s, SigMatch *new) {
* \param new sigmatch to append
*/
void SigMatchAppendTag(Signature *s, SigMatch *new) {
if (s->tmatch == NULL) {
s->tmatch = new;
s->tmatch_tail = new;
if (s->sm_lists[DETECT_SM_LIST_TMATCH] == NULL) {
s->sm_lists[DETECT_SM_LIST_TMATCH] = new;
s->sm_lists_tail[DETECT_SM_LIST_TMATCH] = new;
new->next = NULL;
new->prev = NULL;
} else {
SigMatch *cur = s->tmatch_tail;
SigMatch *cur = s->sm_lists_tail[DETECT_SM_LIST_TMATCH];
cur->next = new;
new->prev = cur;
new->next = NULL;
s->tmatch_tail = new;
s->sm_lists_tail[DETECT_SM_LIST_TMATCH] = new;
}
new->idx = s->sm_cnt;
@ -1072,7 +1072,7 @@ void SigFree(Signature *s) {
sm = nsm;
}
sm = s->tmatch;
sm = s->sm_lists[DETECT_SM_LIST_TMATCH];
while (sm != NULL) {
nsm = sm->next;
SigMatchFree(sm);

@ -354,17 +354,6 @@ typedef struct Signature_ {
/** netblocks and hosts specified at the sid, in CIDR format */
IPOnlyCIDRItem *CidrSrc, *CidrDst;
/* holds all sm lists */
struct SigMatch_ *sm_lists[DETECT_SM_LIST_MAX];
/** ptr to the SigMatch lists */
//struct SigMatch_ *pmatch; /* payload matches */
//struct SigMatch_ *umatch; /* uricontent payload matches */
//struct SigMatch_ *amatch; /* general app layer matches */
//struct SigMatch_ *dmatch; /* dce app layer matches */
//struct SigMatch_ *match; /* non-payload matches */
struct SigMatch_ *tmatch; /* list of tags matches */
struct SigMatch_ *dsize_sm;
/* helper for init phase */
@ -408,16 +397,11 @@ typedef struct Signature_ {
uint16_t profiling_id;
#endif
/* holds all sm lists */
struct SigMatch_ *sm_lists[DETECT_SM_LIST_MAX];
/* holds all sm lists' tails */
struct SigMatch_ *sm_lists_tail[DETECT_SM_LIST_MAX];
//struct SigMatch_ *match_tail; /* non-payload matches, tail of the list */
//struct SigMatch_ *pmatch_tail; /* payload matches, tail of the list */
//struct SigMatch_ *umatch_tail; /* uricontent payload matches, tail of the list */
//struct SigMatch_ *amatch_tail; /* general app layer matches, tail of the list */
//struct SigMatch_ *dmatch_tail; /* dce app layer matches, tail of the list */
struct SigMatch_ *tmatch_tail; /* tag matches, tail of the list */
/** address settings for this signature */
DetectAddressHead src, dst;

Loading…
Cancel
Save