app layer: void -> AppLayerProtoDetectThreadCtx

User AppLayerProtoDetectThreadCtx ptr instead of void.
pull/753/head
Victor Julien 11 years ago
parent 8dbf7a0d78
commit 3b8e9ffbe9

@ -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);

@ -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 *****/

@ -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;

Loading…
Cancel
Save