]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
app layer: void -> AppLayerProtoDetectThreadCtx
authorVictor Julien <victor@inliniac.net>
Thu, 9 Jan 2014 15:40:59 +0000 (16:40 +0100)
committerVictor Julien <victor@inliniac.net>
Fri, 10 Jan 2014 10:53:56 +0000 (11:53 +0100)
User AppLayerProtoDetectThreadCtx ptr instead of void.

src/app-layer-detect-proto.c
src/app-layer-detect-proto.h
src/app-layer-smb.c

index 90405473a656ed4c744743fcdf2214243b86883e..7cf21de0be510f35485d376bd01cb4f6daee11b3 100644 (file)
@@ -1198,7 +1198,7 @@ static int AppLayerProtoDetectPMRegisterPattern(uint8_t ipproto, AppProto alprot
 
 /***** Protocol Retrieval *****/
 
-AppProto AppLayerProtoDetectGetProto(void *tctx,
+AppProto AppLayerProtoDetectGetProto(AppLayerProtoDetectThreadCtx *tctx,
                                      Flow *f,
                                      uint8_t *buf, uint32_t buflen,
                                      uint8_t ipproto, uint8_t direction)
@@ -1537,7 +1537,7 @@ int AppLayerProtoDetectConfProtoDetectionEnabled(const char *ipproto,
     SCReturnInt(enabled);
 }
 
-void *AppLayerProtoDetectGetCtxThread(void)
+AppLayerProtoDetectThreadCtx *AppLayerProtoDetectGetCtxThread(void)
 {
     SCEnter();
 
@@ -1583,14 +1583,13 @@ void *AppLayerProtoDetectGetCtxThread(void)
         AppLayerProtoDetectDestroyCtxThread(alpd_tctx);
     alpd_tctx = NULL;
  end:
-    SCReturnPtr(alpd_tctx, "void *");
+    SCReturnPtr(alpd_tctx, "AppLayerProtoDetectThreadCtx");
 }
 
-void AppLayerProtoDetectDestroyCtxThread(void *tctx)
+void AppLayerProtoDetectDestroyCtxThread(AppLayerProtoDetectThreadCtx *alpd_tctx)
 {
     SCEnter();
 
-    AppLayerProtoDetectThreadCtx *alpd_tctx = (AppLayerProtoDetectThreadCtx *)tctx;
     MpmCtx *mpm_ctx;
     MpmThreadCtx *mpm_tctx;
     int ipproto_map, dir;
@@ -1774,7 +1773,7 @@ int AppLayerProtoDetectTest03(void)
     int r = 0;
     Flow f;
     uint16_t pm_results[ALPROTO_MAX];
-    void *alpd_tctx;
+    AppLayerProtoDetectThreadCtx *alpd_tctx;
 
     memset(pm_results, 0, sizeof(pm_results));
 
@@ -1846,7 +1845,7 @@ int AppLayerProtoDetectTest04(void)
     int r = 0;
     Flow f;
     uint16_t pm_results[ALPROTO_MAX];
-    void *alpd_tctx;
+    AppLayerProtoDetectThreadCtx *alpd_tctx;
 
     memset(pm_results, 0, sizeof(pm_results));
 
@@ -1912,7 +1911,7 @@ int AppLayerProtoDetectTest05(void)
     int r = 0;
     Flow f;
     uint16_t pm_results[ALPROTO_MAX];
-    void *alpd_tctx;
+    AppLayerProtoDetectThreadCtx *alpd_tctx;
 
     memset(pm_results, 0, sizeof(pm_results));
 
@@ -1984,7 +1983,7 @@ int AppLayerProtoDetectTest06(void)
     int r = 0;
     Flow f;
     uint16_t pm_results[ALPROTO_MAX];
-    void *alpd_tctx;
+    AppLayerProtoDetectThreadCtx *alpd_tctx;
 
     buf = "HTTP";
     AppLayerProtoDetectPMRegisterPatternCS(IPPROTO_TCP, ALPROTO_HTTP, buf, 4, 0, STREAM_TOCLIENT);
@@ -2054,7 +2053,7 @@ int AppLayerProtoDetectTest07(void)
     int r = 0;
     Flow f;
     uint16_t pm_results[ALPROTO_MAX];
-    void *alpd_tctx;
+    AppLayerProtoDetectThreadCtx *alpd_tctx;
 
     memset(pm_results, 0, sizeof(pm_results));
 
@@ -2139,7 +2138,7 @@ int AppLayerProtoDetectTest08(void)
     int r = 0;
     Flow f;
     uint16_t pm_results[ALPROTO_MAX];
-    void *alpd_tctx;
+    AppLayerProtoDetectThreadCtx *alpd_tctx;
 
     memset(pm_results, 0, sizeof(pm_results));
 
@@ -2220,7 +2219,7 @@ int AppLayerProtoDetectTest09(void)
     int r = 0;
     Flow f;
     uint16_t pm_results[ALPROTO_MAX];
-    void *alpd_tctx;
+    AppLayerProtoDetectThreadCtx *alpd_tctx;
 
     memset(pm_results, 0, sizeof(pm_results));
 
@@ -2296,7 +2295,7 @@ int AppLayerProtoDetectTest10(void)
     int r = 0;
     Flow f;
     uint16_t pm_results[ALPROTO_MAX];
-    void *alpd_tctx;
+    AppLayerProtoDetectThreadCtx *alpd_tctx;
 
     memset(pm_results, 0, sizeof(pm_results));
 
@@ -2366,7 +2365,7 @@ int AppLayerProtoDetectTest11(void)
     int r = 0;
     Flow f;
     uint16_t pm_results[ALPROTO_MAX];
-    void *alpd_tctx;
+    AppLayerProtoDetectThreadCtx *alpd_tctx;
 
     memset(pm_results, 0, sizeof(pm_results));
 
@@ -2513,7 +2512,7 @@ int AppLayerProtoDetectTest13(void)
     int r = 0;
     Flow f;
     uint16_t pm_results[ALPROTO_MAX];
-    void *alpd_tctx;
+    AppLayerProtoDetectThreadCtx *alpd_tctx;
     uint32_t cnt;
 
     AppLayerProtoDetectPMRegisterPatternCS(IPPROTO_UDP, ALPROTO_HTTP, "HTTP", 4, 0, STREAM_TOSERVER);
@@ -2601,7 +2600,7 @@ int AppLayerProtoDetectTest14(void)
     int r = 0;
     Flow f;
     uint16_t pm_results[ALPROTO_MAX];
-    void *alpd_tctx;
+    AppLayerProtoDetectThreadCtx *alpd_tctx;
     uint32_t cnt;
 
     AppLayerProtoDetectPMRegisterPatternCS(IPPROTO_UDP, ALPROTO_HTTP, "HTTP", 4, 0, STREAM_TOSERVER);
index 19bd962ece1c63ed2f2c239b6e1907d579b318ac..95e2b09a2a95668545ff2245ee126518af6536c7 100644 (file)
@@ -44,7 +44,7 @@ typedef uint16_t (*ProbingParserFPtr)(uint8_t *input, uint32_t input_len,
  *
  * \retval The app layer protocol.
  */
-AppProto AppLayerProtoDetectGetProto(void *tctx,
+AppProto AppLayerProtoDetectGetProto(AppLayerProtoDetectThreadCtx *tctx,
                                      Flow *f,
                                      uint8_t *buf, uint32_t buflen,
                                      uint8_t ipproto, uint8_t direction);
@@ -151,14 +151,14 @@ int AppLayerProtoDetectConfProtoDetectionEnabled(const char *ipproto,
  * \retval Pointer to the thread context, on success;
  *         NULL, on failure.
  */
-void *AppLayerProtoDetectGetCtxThread(void);
+AppLayerProtoDetectThreadCtx *AppLayerProtoDetectGetCtxThread(void);
 
 /**
  * \brief Destroys the app layer protocol detection thread context.
  *
  * \param tctx Pointer to the app layer protocol detection thread context.
  */
-void AppLayerProtoDetectDestroyCtxThread(void *tctx);
+void AppLayerProtoDetectDestroyCtxThread(AppLayerProtoDetectThreadCtx *tctx);
 
 /***** Utility *****/
 
index b9d35098484d68a70c7a04468619a4b108014fe6..5c1249c8d0609224ed1d82dc9b40a6e8f2394617 100644 (file)
@@ -2189,7 +2189,7 @@ int SMBParserTest05(void)
     int result = 0;
     AppProto alproto;
     Flow f;
-    void *alpd_tctx;
+    AppLayerProtoDetectThreadCtx *alpd_tctx;
     memset(&f, 0, sizeof(f));
     f.dp = 139;
 
@@ -2272,7 +2272,7 @@ int SMBParserTest06(void)
     int result = 0;
     AppProto alproto;
     Flow f;
-    void *alpd_tctx;
+    AppLayerProtoDetectThreadCtx *alpd_tctx;
     memset(&f, 0, sizeof(f));
     f.dp = 139;