SigMatch *sm = NULL;
uint8_t function_code;
+ if (DetectSignatureSetAppProto(s, ALPROTO_DNP3) != 0)
+ return -1;
+
if (!DetectDNP3FuncParseFunctionCode(str, &function_code)) {
SCLogError(SC_ERR_INVALID_SIGNATURE,
"Invalid argument \"%s\" supplied to dnp3_func keyword.", str);
}
sm->type = DETECT_AL_DNP3FUNC;
sm->ctx = (void *)dnp3;
- s->alproto = ALPROTO_DNP3;
- s->flags |= SIG_FLAG_STATE_MATCH;
SigMatchAppendSMToList(s, sm, g_dnp3_match_buffer_id);
SigMatch *sm = NULL;
uint16_t flags;
+ if (DetectSignatureSetAppProto(s, ALPROTO_DNP3) != 0)
+ return -1;
+
if (!DetectDNP3IndParse(str, &flags)) {
SCLogError(SC_ERR_INVALID_SIGNATURE,
"Invalid argument \"%s\" supplied to dnp3.ind keyword.", str);
}
sm->type = DETECT_AL_DNP3IND;
sm->ctx = (void *)detect;
- s->alproto = ALPROTO_DNP3;
- s->flags |= SIG_FLAG_STATE_MATCH;
-
SigMatchAppendSMToList(s, sm, g_dnp3_match_buffer_id);
SCReturnInt(0);
DetectDNP3 *detect = NULL;
SigMatch *sm = NULL;
+ if (DetectSignatureSetAppProto(s, ALPROTO_DNP3) != 0)
+ return -1;
+
if (!DetectDNP3ObjParse(str, &group, &variation)) {
goto fail;
}
}
sm->type = DETECT_AL_DNP3OBJ;
sm->ctx = (void *)detect;
- s->alproto = ALPROTO_DNP3;
- s->flags |= SIG_FLAG_STATE_MATCH;
SigMatchAppendSMToList(s, sm, g_dnp3_match_buffer_id);
SCReturnInt(1);
static int DetectDNP3DataSetup(DetectEngineCtx *de_ctx, Signature *s, const char *str)
{
SCEnter();
- s->init_data->list = g_dnp3_data_buffer_id;
- s->alproto = ALPROTO_DNP3;
+ if (DetectSignatureSetAppProto(s, ALPROTO_DNP3) != 0)
+ return -1;
+
+ DetectBufferSetActiveList(s, g_dnp3_data_buffer_id);
SCReturnInt(0);
}