diff --git a/src/app-layer-detect-proto.c b/src/app-layer-detect-proto.c index 291d6c4106..9404bec7f0 100644 --- a/src/app-layer-detect-proto.c +++ b/src/app-layer-detect-proto.c @@ -1490,11 +1490,13 @@ int AppLayerProtoDetectPMRegisterPatternCS(uint8_t ipproto, AppProto alproto, uint8_t direction) { SCEnter(); - SCReturnInt(AppLayerProtoDetectPMRegisterPattern(ipproto, alproto, + int r = 0; + r = AppLayerProtoDetectPMRegisterPattern(ipproto, alproto, pattern, depth, offset, direction, - 1 /* case-sensitive */)); + 1 /* case-sensitive */); + SCReturnInt(r); } int AppLayerProtoDetectPMRegisterPatternCI(uint8_t ipproto, AppProto alproto, @@ -1503,11 +1505,13 @@ int AppLayerProtoDetectPMRegisterPatternCI(uint8_t ipproto, AppProto alproto, uint8_t direction) { SCEnter(); - SCReturnInt(AppLayerProtoDetectPMRegisterPattern(ipproto, alproto, + int r = 0; + r = AppLayerProtoDetectPMRegisterPattern(ipproto, alproto, pattern, depth, offset, direction, - 0 /* !case-sensitive */)); + 0 /* !case-sensitive */); + SCReturnInt(r); } /***** Setup/General Registration *****/ diff --git a/src/app-layer-parser.c b/src/app-layer-parser.c index 8097603989..daa54bc514 100644 --- a/src/app-layer-parser.c +++ b/src/app-layer-parser.c @@ -472,15 +472,16 @@ void AppLayerParserRegisterGetEventInfo(uint8_t ipproto, AppProto alproto, void *AppLayerParserGetProtocolParserLocalStorage(uint8_t ipproto, AppProto alproto) { SCEnter(); + void * r = NULL; if (alp_ctx.ctxs[FlowGetProtoMapping(ipproto)][alproto]. LocalStorageAlloc != NULL) { - SCReturnPtr(alp_ctx.ctxs[FlowGetProtoMapping(ipproto)][alproto]. - LocalStorageAlloc(), "void *"); + r = alp_ctx.ctxs[FlowGetProtoMapping(ipproto)][alproto]. + LocalStorageAlloc(); } - SCReturnPtr(NULL, "void *"); + SCReturnPtr(r, "void *"); } void AppLayerParserDestroyProtocolParserLocalStorage(uint8_t ipproto, AppProto alproto, @@ -705,30 +706,38 @@ int AppLayerParserGetStateProgress(uint8_t ipproto, AppProto alproto, void *alstate, uint8_t direction) { SCEnter(); - SCReturnInt(alp_ctx.ctxs[FlowGetProtoMapping(ipproto)][alproto]. - StateGetProgress(alstate, direction)); + int r = 0; + r = alp_ctx.ctxs[FlowGetProtoMapping(ipproto)][alproto]. + StateGetProgress(alstate, direction); + SCReturnInt(r); } uint64_t AppLayerParserGetTxCnt(uint8_t ipproto, AppProto alproto, void *alstate) { SCEnter(); - SCReturnCT(alp_ctx.ctxs[FlowGetProtoMapping(ipproto)][alproto]. - StateGetTxCnt(alstate), "uint64_t"); + uint64_t r = 0; + r = alp_ctx.ctxs[FlowGetProtoMapping(ipproto)][alproto]. + StateGetTxCnt(alstate); + SCReturnCT(r, "uint64_t"); } void *AppLayerParserGetTx(uint8_t ipproto, AppProto alproto, void *alstate, uint64_t tx_id) { SCEnter(); - SCReturnPtr(alp_ctx.ctxs[FlowGetProtoMapping(ipproto)][alproto]. - StateGetTx(alstate, tx_id), "void *"); + void * r = NULL; + r = alp_ctx.ctxs[FlowGetProtoMapping(ipproto)][alproto]. + StateGetTx(alstate, tx_id); + SCReturnPtr(r, "void *"); } int AppLayerParserGetStateProgressCompletionStatus(uint8_t ipproto, AppProto alproto, uint8_t direction) { SCEnter(); - SCReturnInt(alp_ctx.ctxs[FlowGetProtoMapping(ipproto)][alproto]. - StateGetProgressCompletionStatus(direction)); + int r = 0; + r = alp_ctx.ctxs[FlowGetProtoMapping(ipproto)][alproto]. + StateGetProgressCompletionStatus(direction); + SCReturnInt(r); } int AppLayerParserGetEventInfo(uint8_t ipproto, AppProto alproto, const char *event_name, @@ -744,8 +753,10 @@ int AppLayerParserGetEventInfo(uint8_t ipproto, AppProto alproto, const char *ev uint8_t AppLayerParserGetFirstDataDir(uint8_t ipproto, AppProto alproto) { SCEnter(); - SCReturnCT(alp_ctx.ctxs[FlowGetProtoMapping(ipproto)][alproto]. - first_data_dir, "uint8_t"); + uint8_t r = 0; + r = alp_ctx.ctxs[FlowGetProtoMapping(ipproto)][alproto]. + first_data_dir; + SCReturnCT(r, "uint8_t"); } uint64_t AppLayerParserGetTransactionActive(uint8_t ipproto, AppProto alproto, diff --git a/src/app-layer.c b/src/app-layer.c index 18b4de551d..e2f4d088f8 100644 --- a/src/app-layer.c +++ b/src/app-layer.c @@ -554,13 +554,15 @@ int AppLayerHandleUdp(ThreadVars *tv, AppLayerThreadCtx *tctx, Packet *p, Flow * AppProto AppLayerGetProtoByName(char *alproto_name) { SCEnter(); - SCReturnCT(AppLayerProtoDetectGetProtoByName(alproto_name), "AppProto"); + AppProto r = AppLayerProtoDetectGetProtoByName(alproto_name); + SCReturnCT(r, "AppProto"); } char *AppLayerGetProtoName(AppProto alproto) { SCEnter(); - SCReturnCT(AppLayerProtoDetectGetProtoName(alproto), "char *"); + char * r = AppLayerProtoDetectGetProtoName(alproto); + SCReturnCT(r, "char *"); } void AppLayerListSupportedProtocols(void) diff --git a/src/respond-reject.c b/src/respond-reject.c index 25d2792f94..42aabbaa81 100644 --- a/src/respond-reject.c +++ b/src/respond-reject.c @@ -97,10 +97,13 @@ TmEcode RespondRejectFunc(ThreadVars *tv, Packet *p, void *data, PacketQueue *pq int RejectSendIPv4TCP(ThreadVars *tv, Packet *p, void *data) { SCEnter(); + int r = 0; if (PACKET_TEST_ACTION(p, ACTION_REJECT)) { - SCReturnInt(RejectSendLibnet11L3IPv4TCP(tv, p, data, REJECT_DIR_SRC)); + r = RejectSendLibnet11L3IPv4TCP(tv, p, data, REJECT_DIR_SRC); + SCReturnInt(r); } else if (PACKET_TEST_ACTION(p, ACTION_REJECT_DST)) { - SCReturnInt(RejectSendLibnet11L3IPv4TCP(tv, p, data, REJECT_DIR_DST)); + r = RejectSendLibnet11L3IPv4TCP(tv, p, data, REJECT_DIR_DST); + SCReturnInt(r); } else if(PACKET_TEST_ACTION(p, ACTION_REJECT_BOTH)) { int ret; ret = RejectSendLibnet11L3IPv4TCP(tv, p, data, REJECT_DIR_SRC); @@ -116,10 +119,13 @@ int RejectSendIPv4TCP(ThreadVars *tv, Packet *p, void *data) int RejectSendIPv4ICMP(ThreadVars *tv, Packet *p, void *data) { SCEnter(); + int r = 0; if (PACKET_TEST_ACTION(p, ACTION_REJECT)) { - SCReturnInt(RejectSendLibnet11L3IPv4ICMP(tv, p, data, REJECT_DIR_SRC)); + r = RejectSendLibnet11L3IPv4ICMP(tv, p, data, REJECT_DIR_SRC); + SCReturnInt(r); } else if (PACKET_TEST_ACTION(p, ACTION_REJECT_DST)) { - SCReturnInt(RejectSendLibnet11L3IPv4ICMP(tv, p, data, REJECT_DIR_DST)); + r = RejectSendLibnet11L3IPv4ICMP(tv, p, data, REJECT_DIR_DST); + SCReturnInt(r); } else if(PACKET_TEST_ACTION(p, ACTION_REJECT_BOTH)) { int ret; ret = RejectSendLibnet11L3IPv4ICMP(tv, p, data, REJECT_DIR_SRC); @@ -135,10 +141,13 @@ int RejectSendIPv4ICMP(ThreadVars *tv, Packet *p, void *data) int RejectSendIPv6TCP(ThreadVars *tv, Packet *p, void *data) { SCEnter(); + int r = 0; if (PACKET_TEST_ACTION(p, ACTION_REJECT)) { - SCReturnInt(RejectSendLibnet11L3IPv6TCP(tv, p, data, REJECT_DIR_SRC)); + r = RejectSendLibnet11L3IPv6TCP(tv, p, data, REJECT_DIR_SRC); + SCReturnInt(r); } else if (PACKET_TEST_ACTION(p, ACTION_REJECT_DST)) { - SCReturnInt(RejectSendLibnet11L3IPv6TCP(tv, p, data, REJECT_DIR_DST)); + r = RejectSendLibnet11L3IPv6TCP(tv, p, data, REJECT_DIR_DST); + SCReturnInt(r); } else if(PACKET_TEST_ACTION(p, ACTION_REJECT_BOTH)) { int ret; ret = RejectSendLibnet11L3IPv6TCP(tv, p, data, REJECT_DIR_SRC); @@ -154,10 +163,13 @@ int RejectSendIPv6TCP(ThreadVars *tv, Packet *p, void *data) int RejectSendIPv6ICMP(ThreadVars *tv, Packet *p, void *data) { SCEnter(); + int r = 0; if (PACKET_TEST_ACTION(p, ACTION_REJECT)) { - SCReturnInt(RejectSendLibnet11L3IPv6ICMP(tv, p, data, REJECT_DIR_SRC)); + r = RejectSendLibnet11L3IPv6ICMP(tv, p, data, REJECT_DIR_SRC); + SCReturnInt(r); } else if (PACKET_TEST_ACTION(p, ACTION_REJECT_DST)) { - SCReturnInt(RejectSendLibnet11L3IPv6ICMP(tv, p, data, REJECT_DIR_DST)); + r = RejectSendLibnet11L3IPv6ICMP(tv, p, data, REJECT_DIR_DST); + SCReturnInt(r); } else if(PACKET_TEST_ACTION(p, ACTION_REJECT_BOTH)) { int ret; ret = RejectSendLibnet11L3IPv6ICMP(tv, p, data, REJECT_DIR_SRC);