{
SCEnter();
- if (s->alproto != ALPROTO_UNKNOWN && s->alproto != ALPROTO_DCERPC &&
- s->alproto != ALPROTO_SMB) {
- SCLogError(SC_ERR_CONFLICTING_RULE_KEYWORDS, "rule contains conflicting keywords.");
+ if (DetectSignatureSetAppProto(s, ALPROTO_DCERPC) < 0)
return -1;
- }
+
void *did = rs_dcerpc_iface_parse(arg);
if (did == NULL) {
SCLogError(SC_ERR_INVALID_SIGNATURE, "Error parsing dce_iface option in "
sm->ctx = did;
SigMatchAppendSMToList(s, sm, g_dce_generic_list_id);
- s->init_data->init_flags |= SIG_FLAG_INIT_DCERPC;
return 0;
}
return -1;
}
- if (s->alproto != ALPROTO_UNKNOWN && s->alproto != ALPROTO_DCERPC &&
- s->alproto != ALPROTO_SMB) {
- SCLogError(SC_ERR_CONFLICTING_RULE_KEYWORDS, "rule contains conflicting keywords.");
+ if (DetectSignatureSetAppProto(s, ALPROTO_DCERPC) < 0)
return -1;
- }
+
void *dod = rs_dcerpc_opnum_parse(arg);
if (dod == NULL) {
SCLogError(SC_ERR_INVALID_SIGNATURE, "Error parsing dce_opnum option in "
sm->ctx = (void *)dod;
SigMatchAppendSMToList(s, sm, g_dce_generic_list_id);
- s->init_data->init_flags |= SIG_FLAG_INIT_DCERPC;
return 0;
}
}
/**
- * \brief Creates a SigMatch for the \"dce_stub_data\" keyword being sent as argument,
- * and appends it to the Signature(s).
+ * \brief setups the dce_stub_data list
*
* \param de_ctx Pointer to the detection engine context
* \param s Pointer to signature for the current Signature being parsed
static int DetectDceStubDataSetup(DetectEngineCtx *de_ctx, Signature *s, const char *arg)
{
- if (s->alproto != ALPROTO_UNKNOWN && s->alproto != ALPROTO_DCERPC &&
- s->alproto != ALPROTO_SMB) {
- SCLogError(SC_ERR_CONFLICTING_RULE_KEYWORDS, "rule contains conflicting keywords.");
+ if (DetectSignatureSetAppProto(s, ALPROTO_DCERPC) < 0)
return -1;
- }
if (DetectBufferSetActiveList(s, g_dce_stub_data_buffer_id) < 0)
return -1;
-
- s->init_data->init_flags |= SIG_FLAG_INIT_DCERPC;
return 0;
}
AppLayerHtpNeedFileInspection();
}
}
- if (s->init_data->init_flags & SIG_FLAG_INIT_DCERPC) {
- if (s->alproto != ALPROTO_UNKNOWN && s->alproto != ALPROTO_DCERPC &&
- s->alproto != ALPROTO_SMB) {
- SCLogError(SC_ERR_NO_FILES_FOR_PROTOCOL, "protocol %s doesn't support DCERPC keyword",
- AppProtoToString(s->alproto));
- SCReturnInt(0);
- }
- }
if (s->id == 0) {
SCLogError(SC_ERR_INVALID_SIGNATURE, "Signature missing required value \"sid\".");
SCReturnInt(0);
#define SIG_FLAG_INIT_NEED_FLUSH BIT_U32(7)
#define SIG_FLAG_INIT_PRIO_EXPLICT BIT_U32(8) /**< priority is explicitly set by the priority keyword */
#define SIG_FLAG_INIT_FILEDATA BIT_U32(9) /**< signature has filedata keyword */
-#define SIG_FLAG_INIT_DCERPC BIT_U32(10) /**< signature has DCERPC keyword */
/* signature mask flags */
/** \note: additions should be added to the rule analyzer as well */