detect-parse: content modifier cleanup

pull/2559/head
Victor Julien 9 years ago
parent 6f867c3c73
commit d2f77978ec

@ -122,8 +122,7 @@ int DetectHttpClientBodySetup(DetectEngineCtx *de_ctx, Signature *s, char *arg)
return DetectEngineContentModifierBufferSetup(de_ctx, s, arg,
DETECT_AL_HTTP_CLIENT_BODY,
g_http_client_body_buffer_id,
ALPROTO_HTTP,
NULL);
ALPROTO_HTTP);
}
/**

@ -136,8 +136,7 @@ static int DetectHttpCookieSetup(DetectEngineCtx *de_ctx, Signature *s, char *st
return DetectEngineContentModifierBufferSetup(de_ctx, s, str,
DETECT_AL_HTTP_COOKIE,
g_http_cookie_buffer_id,
ALPROTO_HTTP,
NULL);
ALPROTO_HTTP);
}
static void DetectHttpCookieSetupCallback(Signature *s)

@ -140,8 +140,7 @@ int DetectHttpHeaderSetup(DetectEngineCtx *de_ctx, Signature *s, char *arg)
return DetectEngineContentModifierBufferSetup(de_ctx, s, arg,
DETECT_AL_HTTP_HEADER,
g_http_header_buffer_id,
ALPROTO_HTTP,
NULL);
ALPROTO_HTTP);
}
static void DetectHttpHeaderSetupCallback(Signature *s)

@ -119,8 +119,7 @@ int DetectHttpHHSetup(DetectEngineCtx *de_ctx, Signature *s, char *arg)
return DetectEngineContentModifierBufferSetup(de_ctx, s, arg,
DETECT_AL_HTTP_HOST,
g_http_host_buffer_id,
ALPROTO_HTTP,
NULL);
ALPROTO_HTTP);
}
static void DetectHttpHostSetupCallback(Signature *s)

@ -115,8 +115,7 @@ int DetectHttpHRHSetup(DetectEngineCtx *de_ctx, Signature *s, char *arg)
return DetectEngineContentModifierBufferSetup(de_ctx, s, arg,
DETECT_AL_HTTP_RAW_HOST,
g_http_raw_host_buffer_id,
ALPROTO_HTTP,
NULL);
ALPROTO_HTTP);
}
static void DetectHttpHostRawSetupCallback(Signature *s)

@ -119,8 +119,7 @@ static int DetectHttpMethodSetup(DetectEngineCtx *de_ctx, Signature *s, char *st
return DetectEngineContentModifierBufferSetup(de_ctx, s, str,
DETECT_AL_HTTP_METHOD,
g_http_method_buffer_id,
ALPROTO_HTTP,
NULL);
ALPROTO_HTTP);
}
/**

@ -142,8 +142,7 @@ int DetectHttpRawHeaderSetup(DetectEngineCtx *de_ctx, Signature *s, char *arg)
return DetectEngineContentModifierBufferSetup(de_ctx, s, arg,
DETECT_AL_HTTP_RAW_HEADER,
g_http_raw_header_buffer_id,
ALPROTO_HTTP,
NULL);
ALPROTO_HTTP);
}
static _Bool DetectHttpRawHeaderValidateCallback(const Signature *s)

@ -107,8 +107,7 @@ static int DetectHttpRawUriSetup(DetectEngineCtx *de_ctx, Signature *s, char *ar
return DetectEngineContentModifierBufferSetup(de_ctx, s, arg,
DETECT_AL_HTTP_RAW_URI,
g_http_raw_uri_buffer_id,
ALPROTO_HTTP,
NULL);
ALPROTO_HTTP);
}
static void DetectHttpRawUriSetupCallback(Signature *s)

@ -103,7 +103,7 @@ int DetectHttpServerBodySetup(DetectEngineCtx *de_ctx, Signature *s, char *arg)
return DetectEngineContentModifierBufferSetup(de_ctx, s, arg,
DETECT_AL_HTTP_SERVER_BODY,
g_file_data_buffer_id,
ALPROTO_HTTP, NULL);
ALPROTO_HTTP);
}
/**

@ -117,8 +117,7 @@ static int DetectHttpStatCodeSetup(DetectEngineCtx *de_ctx, Signature *s, char *
return DetectEngineContentModifierBufferSetup(de_ctx, s, arg,
DETECT_AL_HTTP_STAT_CODE,
g_http_stat_code_buffer_id,
ALPROTO_HTTP,
NULL);
ALPROTO_HTTP);
}
static void DetectHttpStatCodeSetupCallback(Signature *s)

@ -117,8 +117,7 @@ static int DetectHttpStatMsgSetup(DetectEngineCtx *de_ctx, Signature *s, char *a
return DetectEngineContentModifierBufferSetup(de_ctx, s, arg,
DETECT_AL_HTTP_STAT_MSG,
g_http_stat_msg_buffer_id,
ALPROTO_HTTP,
NULL);
ALPROTO_HTTP);
}
static void DetectHttpStatMsgSetupCallback(Signature *s)

@ -116,8 +116,7 @@ int DetectHttpUASetup(DetectEngineCtx *de_ctx, Signature *s, char *arg)
return DetectEngineContentModifierBufferSetup(de_ctx, s, arg,
DETECT_AL_HTTP_USER_AGENT,
g_http_ua_buffer_id,
ALPROTO_HTTP,
NULL);
ALPROTO_HTTP);
}
static void DetectHttpUASetupCallback(Signature *s)

@ -110,8 +110,7 @@ int DetectHttpUriSetup(DetectEngineCtx *de_ctx, Signature *s, char *str)
return DetectEngineContentModifierBufferSetup(de_ctx, s, str,
DETECT_AL_HTTP_URI,
g_http_uri_buffer_id,
ALPROTO_HTTP,
NULL);
ALPROTO_HTTP);
}
static void DetectHttpUriSetupCallback(Signature *s)

@ -194,10 +194,10 @@ const char *DetectListToString(int list)
return "unknown";
}
/** \param arg NULL or empty string */
int DetectEngineContentModifierBufferSetup(DetectEngineCtx *de_ctx,
Signature *s, const char *arg,
int sm_type, int sm_list,
AppProto alproto, void (*CustomCallback)(Signature *s))
Signature *s, const char *arg, int sm_type, int sm_list,
AppProto alproto)
{
SigMatch *sm = NULL;
int ret = -1;
@ -263,8 +263,6 @@ int DetectEngineContentModifierBufferSetup(DetectEngineCtx *de_ctx,
}
}
}
if (CustomCallback != NULL)
CustomCallback(s);
s->alproto = alproto;
s->flags |= SIG_FLAG_APPLAYER;

@ -57,9 +57,9 @@ int SigMatchListSMBelongsTo(const Signature *, const SigMatch *);
int DetectParseDupSigHashInit(DetectEngineCtx *);
void DetectParseDupSigHashFree(DetectEngineCtx *);
int DetectEngineContentModifierBufferSetup(DetectEngineCtx *de_ctx, Signature *s, const char *arg,
int sm_type, int sm_list,
AppProto alproto, void (*CustomCallback)(Signature *s));
int DetectEngineContentModifierBufferSetup(DetectEngineCtx *de_ctx,
Signature *s, const char *arg, int sm_type, int sm_list,
AppProto alproto);
const char *DetectListToHumanString(int list);
const char *DetectListToString(int list);

Loading…
Cancel
Save