]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect-parse: content modifier cleanup
authorVictor Julien <victor@inliniac.net>
Fri, 9 Dec 2016 18:01:01 +0000 (19:01 +0100)
committerVictor Julien <victor@inliniac.net>
Thu, 16 Feb 2017 09:35:40 +0000 (10:35 +0100)
15 files changed:
src/detect-http-client-body.c
src/detect-http-cookie.c
src/detect-http-header.c
src/detect-http-hh.c
src/detect-http-hrh.c
src/detect-http-method.c
src/detect-http-raw-header.c
src/detect-http-raw-uri.c
src/detect-http-server-body.c
src/detect-http-stat-code.c
src/detect-http-stat-msg.c
src/detect-http-ua.c
src/detect-http-uri.c
src/detect-parse.c
src/detect-parse.h

index 9e3d2cc7e93d965ea716c312edfd21cde3f04239..9ec6be6d398ee9b4fc19bd77079b2a402d54e350 100644 (file)
@@ -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);
 }
 
 /**
index 56f38e7bf4b36f8fcc809c9b28a0a1be832bcbbe..1cc61fe8170f9cfe439d84a4154f8f194968e149 100644 (file)
@@ -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)
index af1524f83419519170f77b93e38a869c107804d1..55a248b1429fd67691a104c7a2f6ef8f3e2dc264 100644 (file)
@@ -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)
index 1abaf8a8c2e016f94d132b829ba835b398f5182e..5e51c7cba90d228c7d7e43c3016cd0dd691cfe7a 100644 (file)
@@ -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)
index 7c9022e98dfe06966e0b289e98dea9b8ca5bec63..439eaef785953789dd79d77c2b52531b452155a7 100644 (file)
@@ -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)
index af703c9a0f2183b433da356353d158edffffef42..3fa059cb770f4ac2819470c6b71baaae74f87ee0 100644 (file)
@@ -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);
 }
 
 /**
index e7c122bcd3aeafa09d2c77d60cf9e514e0a24557..b1a03254d79deb88214cba600d5d8e1375ebeacf 100644 (file)
@@ -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)
index 3079f2e87856417741d3a986644b16cb1a9b775b..29f2c69308c9104312ee041483d35616db7cd5a3 100644 (file)
@@ -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)
index 9c40d480d2f52f489f20dbcc5b5e31ce39c9b1f6..b2157d8fefc1d73a212e57ddaf35cb699a53ff30 100644 (file)
@@ -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);
 }
 
 /**
index 2749584bb85ef9c71afe690c7259a12b22c1dd11..8a3b4d4b6eff3ee590f04e312ec800d97e7661f3 100644 (file)
@@ -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)
index c61c6659234dbd84b84f3a443e8db93137b23ff6..d3a916c2b706b749f3d289d8130855f467eee15f 100644 (file)
@@ -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)
index 625d2875501523b2873d5edc23634d7ba00e8e16..5e0824dab7a70bebc46c1f5a60899694a9d03b64 100644 (file)
@@ -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)
index 1d6b102785c858ab23e12a3394d8632e6b776b1e..45acf4a7db42ecf975f8626a93e6e19a6de88580 100644 (file)
@@ -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)
index 5b8b93937900a4f4bac2208b5937189fac716afa..1886ee9081dd548852f0aad92a086e1557c96f42 100644 (file)
@@ -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;
 
index 9dfe5ac2191a607fba2c2263cd3fca97760d13b6..15f509226695fb37e294c2468e042572afc5deb0 100644 (file)
@@ -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);