}
sm->ctx = data;
- SigMatchAppendPacket(s, sm);
+ SigMatchAppendSMToList(s, sm, DETECT_SM_LIST_MATCH);
s->flags |= SIG_FLAG_REQUIRE_PACKET;
return 0;
sm->type = DETECT_ASN1;
sm->ctx = (void *)ad;
- SigMatchAppendPacket(s, sm);
+ SigMatchAppendSMToList(s, sm, DETECT_SM_LIST_MATCH);
return 0;
sm->ctx = (void *)cd;
- SigMatchAppendPacket(s, sm);
+ SigMatchAppendSMToList(s, sm, DETECT_SM_LIST_MATCH);
return 0;
sm->ctx = (void *)cd;
- SigMatchAppendPacket(s, sm);
+ SigMatchAppendSMToList(s, sm, DETECT_SM_LIST_MATCH);
return 0;
sm->ctx = (void *)cd;
- SigMatchAppendPacket(s, sm);
+ SigMatchAppendSMToList(s, sm, DETECT_SM_LIST_MATCH);
return 0;
sm->ctx = (void *)cd;
- SigMatchAppendPacket(s, sm);
+ SigMatchAppendSMToList(s, sm, DETECT_SM_LIST_MATCH);
return 0;
sm->ctx = (void *)cd;
- SigMatchAppendPacket(s, sm);
+ SigMatchAppendSMToList(s, sm, DETECT_SM_LIST_MATCH);
return 0;
sm->ctx = (void *)cd;
- SigMatchAppendPacket(s, sm);
+ SigMatchAppendSMToList(s, sm, DETECT_SM_LIST_MATCH);
return 0;
sm->ctx = (void *)cd;
- SigMatchAppendPacket(s, sm);
+ SigMatchAppendSMToList(s, sm, DETECT_SM_LIST_MATCH);
return 0;
sm->type = DETECT_DSIZE;
sm->ctx = (void *)dd;
- SigMatchAppendPacket(s, sm);
+ SigMatchAppendSMToList(s, sm, DETECT_SM_LIST_MATCH);
SCLogDebug("dd->dsize %"PRIu16", dd->dsize2 %"PRIu16", dd->mode %"PRIu8"",
dd->dsize, dd->dsize2, dd->mode);
sm->type = smtype;
sm->ctx = (void *)de;
- SigMatchAppendPacket(s, sm);
+ SigMatchAppendSMToList(s, sm, DETECT_SM_LIST_MATCH);
return 0;
error:
sm->type = DETECT_FLAGS;
sm->ctx = (void *)de;
- SigMatchAppendPacket(s, sm);
+ SigMatchAppendSMToList(s, sm, DETECT_SM_LIST_MATCH);
s->flags |= SIG_FLAG_REQUIRE_PACKET;
return 0;
sm->type = DETECT_FLOW;
sm->ctx = (void *)fd;
- SigMatchAppendPacket(s, sm);
+ SigMatchAppendSMToList(s, sm, DETECT_SM_LIST_MATCH);
/* set the signature direction flags */
if (fd->flags & FLOW_PKT_TOSERVER) {
case DETECT_FLOWBITS_CMD_ISNOTSET:
case DETECT_FLOWBITS_CMD_ISSET:
/* checks, so packet list */
- SigMatchAppendPacket(s, sm);
+ SigMatchAppendSMToList(s, sm, DETECT_SM_LIST_MATCH);
break;
case DETECT_FLOWBITS_CMD_SET:
case FLOWINT_MODIFIER_GT:
case FLOWINT_MODIFIER_ISSET:
case FLOWINT_MODIFIER_NOTSET:
- SigMatchAppendPacket(s, sm);
+ SigMatchAppendSMToList(s, sm, DETECT_SM_LIST_MATCH);
break;
}
sm->type = DETECT_FLOWVAR;
sm->ctx = (void *)cd;
- SigMatchAppendPacket(s, sm);
+ SigMatchAppendSMToList(s, sm, DETECT_SM_LIST_MATCH);
if (dubbed) SCFree(str);
return 0;
sm->type = DETECT_FRAGBITS;
sm->ctx = (void *)de;
- SigMatchAppendPacket(s, sm);
+ SigMatchAppendSMToList(s, sm, DETECT_SM_LIST_MATCH);
s->flags |= SIG_FLAG_REQUIRE_PACKET;
return 0;
sm->type = DETECT_FRAGOFFSET;
sm->ctx = (void *)fragoff;
- SigMatchAppendPacket(s, sm);
+ SigMatchAppendSMToList(s, sm, DETECT_SM_LIST_MATCH);
s->flags |= SIG_FLAG_REQUIRE_PACKET;
return 0;
sm->type = DETECT_ICMP_ID;
sm->ctx = (void *)iid;
- SigMatchAppendPacket(s, sm);
+ SigMatchAppendSMToList(s, sm, DETECT_SM_LIST_MATCH);
s->flags |= SIG_FLAG_REQUIRE_PACKET;
return 0;
sm->type = DETECT_ICMP_SEQ;
sm->ctx = (void *)iseq;
- SigMatchAppendPacket(s, sm);
+ SigMatchAppendSMToList(s, sm, DETECT_SM_LIST_MATCH);
return 0;
sm->type = DETECT_ICODE;
sm->ctx = (void *)icd;
- SigMatchAppendPacket(s, sm);
+ SigMatchAppendSMToList(s, sm, DETECT_SM_LIST_MATCH);
s->flags |= SIG_FLAG_REQUIRE_PACKET;
return 0;
sm->type = DETECT_ID;
sm->ctx = (void *)id_d;
- SigMatchAppendPacket(s, sm);
+ SigMatchAppendSMToList(s, sm, DETECT_SM_LIST_MATCH);
s->flags |= SIG_FLAG_REQUIRE_PACKET;
return 0;
sm->type = DETECT_IPOPTS;
sm->ctx = (void *)de;
- SigMatchAppendPacket(s, sm);
+ SigMatchAppendSMToList(s, sm, DETECT_SM_LIST_MATCH);
s->flags |= SIG_FLAG_REQUIRE_PACKET;
return 0;
goto error;
sm->type = DETECT_IPPROTO;
sm->ctx = (void *)data;
- SigMatchAppendPacket(s, sm);
+ SigMatchAppendSMToList(s, sm, DETECT_SM_LIST_MATCH);
s->flags |= SIG_FLAG_REQUIRE_PACKET;
return 0;
sm->type = DETECT_ITYPE;
sm->ctx = (void *)itd;
- SigMatchAppendPacket(s, sm);
+ SigMatchAppendSMToList(s, sm, DETECT_SM_LIST_MATCH);
s->flags |= SIG_FLAG_REQUIRE_PACKET;
return 0;
return;
}
-/** \brief Append a sig match to the signatures non-payload match list
- *
- * \param s signature
- * \param new sigmatch to append
- */
-void SigMatchAppendPacket(Signature *s, SigMatch *new) {
- if (s->sm_lists[DETECT_SM_LIST_MATCH] == NULL) {
- s->sm_lists[DETECT_SM_LIST_MATCH] = new;
- s->sm_lists_tail[DETECT_SM_LIST_MATCH] = new;
- new->next = NULL;
- new->prev = NULL;
- } else {
- SigMatch *cur = s->sm_lists[DETECT_SM_LIST_MATCH];
-
- for ( ; cur->next != NULL; cur = cur->next);
-
- cur->next = new;
- new->next = NULL;
- new->prev = cur;
- s->sm_lists_tail[DETECT_SM_LIST_MATCH] = new;
- }
-
- new->idx = s->sm_cnt;
- s->sm_cnt++;
-}
-
/** \brief Append a sig match to the signatures threshold list
*
* \param s signature
void SigMatchReplaceContent(Signature *, SigMatch *, SigMatch *);
void SigMatchReplaceContentToUricontent(Signature *, SigMatch *, SigMatch *);
-void SigMatchAppendPacket(Signature *, SigMatch *);
void SigMatchAppendThreshold(Signature *, SigMatch *);
void SigMatchAppendPostMatch(Signature *, SigMatch *);
void SigMatchAppendSMToList(Signature *, SigMatch *, int);
sm->type = DETECT_PKTVAR;
sm->ctx = (void *)cd;
- SigMatchAppendPacket(s, sm);
+ SigMatchAppendSMToList(s, sm, DETECT_SM_LIST_MATCH);
if (dubbed) SCFree(str);
return 0;
sm->type = DETECT_RPC;
sm->ctx = (void *)rd;
- SigMatchAppendPacket(s, sm);
+ SigMatchAppendSMToList(s, sm, DETECT_SM_LIST_MATCH);
s->flags |= SIG_FLAG_REQUIRE_PACKET;
return 0;
sm->type = DETECT_SAMEIP;
sm->ctx = NULL;
- SigMatchAppendPacket(s, sm);
+ SigMatchAppendSMToList(s, sm, DETECT_SM_LIST_MATCH);
s->flags |= SIG_FLAG_REQUIRE_PACKET;
return 0;
}
sm->ctx = data;
- SigMatchAppendPacket(s, sm);
+ SigMatchAppendSMToList(s, sm, DETECT_SM_LIST_MATCH);
s->flags |= SIG_FLAG_REQUIRE_PACKET;
return 0;
sm->type = DETECT_STREAM_SIZE;
sm->ctx = (void *)sd;
- SigMatchAppendPacket(s, sm);
+ SigMatchAppendSMToList(s, sm, DETECT_SM_LIST_MATCH);
return 0;
sm->type = DETECT_TOS;
sm->ctx = (void *)tosd;
- SigMatchAppendPacket(s, sm);
+ SigMatchAppendSMToList(s, sm, DETECT_SM_LIST_MATCH);
s->flags |= SIG_FLAG_REQUIRE_PACKET;
return 0;
sm->type = DETECT_TTL;
sm->ctx = (void *)ttld;
- SigMatchAppendPacket(s, sm);
+ SigMatchAppendSMToList(s, sm, DETECT_SM_LIST_MATCH);
s->flags |= SIG_FLAG_REQUIRE_PACKET;
return 0;
sm->type = DETECT_WINDOW;
sm->ctx = (void *)wd;
- SigMatchAppendPacket(s, sm);
+ SigMatchAppendSMToList(s, sm, DETECT_SM_LIST_MATCH);
s->flags |= SIG_FLAG_REQUIRE_PACKET;
return 0;