From: Victor Julien Date: Thu, 9 Jan 2014 15:40:59 +0000 (+0100) Subject: app layer: void -> AppLayerProtoDetectThreadCtx X-Git-Tag: suricata-2.0rc1~243 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3b8e9ffbe910997836d5fa2b0c84be0a06853183;p=thirdparty%2Fsuricata.git app layer: void -> AppLayerProtoDetectThreadCtx User AppLayerProtoDetectThreadCtx ptr instead of void. --- diff --git a/src/app-layer-detect-proto.c b/src/app-layer-detect-proto.c index 90405473a6..7cf21de0be 100644 --- a/src/app-layer-detect-proto.c +++ b/src/app-layer-detect-proto.c @@ -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); diff --git a/src/app-layer-detect-proto.h b/src/app-layer-detect-proto.h index 19bd962ece..95e2b09a2a 100644 --- a/src/app-layer-detect-proto.h +++ b/src/app-layer-detect-proto.h @@ -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 *****/ diff --git a/src/app-layer-smb.c b/src/app-layer-smb.c index b9d3509848..5c1249c8d0 100644 --- a/src/app-layer-smb.c +++ b/src/app-layer-smb.c @@ -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;