bugfix in debug mode:

removed function calls from SCReturnX macros
pull/969/merge
jeka 11 years ago committed by Victor Julien
parent 0765bcc73e
commit dc1599e0dc

@ -1490,11 +1490,13 @@ int AppLayerProtoDetectPMRegisterPatternCS(uint8_t ipproto, AppProto alproto,
uint8_t direction) uint8_t direction)
{ {
SCEnter(); SCEnter();
SCReturnInt(AppLayerProtoDetectPMRegisterPattern(ipproto, alproto, int r = 0;
r = AppLayerProtoDetectPMRegisterPattern(ipproto, alproto,
pattern, pattern,
depth, offset, depth, offset,
direction, direction,
1 /* case-sensitive */)); 1 /* case-sensitive */);
SCReturnInt(r);
} }
int AppLayerProtoDetectPMRegisterPatternCI(uint8_t ipproto, AppProto alproto, int AppLayerProtoDetectPMRegisterPatternCI(uint8_t ipproto, AppProto alproto,
@ -1503,11 +1505,13 @@ int AppLayerProtoDetectPMRegisterPatternCI(uint8_t ipproto, AppProto alproto,
uint8_t direction) uint8_t direction)
{ {
SCEnter(); SCEnter();
SCReturnInt(AppLayerProtoDetectPMRegisterPattern(ipproto, alproto, int r = 0;
r = AppLayerProtoDetectPMRegisterPattern(ipproto, alproto,
pattern, pattern,
depth, offset, depth, offset,
direction, direction,
0 /* !case-sensitive */)); 0 /* !case-sensitive */);
SCReturnInt(r);
} }
/***** Setup/General Registration *****/ /***** Setup/General Registration *****/

@ -472,15 +472,16 @@ void AppLayerParserRegisterGetEventInfo(uint8_t ipproto, AppProto alproto,
void *AppLayerParserGetProtocolParserLocalStorage(uint8_t ipproto, AppProto alproto) void *AppLayerParserGetProtocolParserLocalStorage(uint8_t ipproto, AppProto alproto)
{ {
SCEnter(); SCEnter();
void * r = NULL;
if (alp_ctx.ctxs[FlowGetProtoMapping(ipproto)][alproto]. if (alp_ctx.ctxs[FlowGetProtoMapping(ipproto)][alproto].
LocalStorageAlloc != NULL) LocalStorageAlloc != NULL)
{ {
SCReturnPtr(alp_ctx.ctxs[FlowGetProtoMapping(ipproto)][alproto]. r = alp_ctx.ctxs[FlowGetProtoMapping(ipproto)][alproto].
LocalStorageAlloc(), "void *"); LocalStorageAlloc();
} }
SCReturnPtr(NULL, "void *"); SCReturnPtr(r, "void *");
} }
void AppLayerParserDestroyProtocolParserLocalStorage(uint8_t ipproto, AppProto alproto, void AppLayerParserDestroyProtocolParserLocalStorage(uint8_t ipproto, AppProto alproto,
@ -705,30 +706,38 @@ int AppLayerParserGetStateProgress(uint8_t ipproto, AppProto alproto,
void *alstate, uint8_t direction) void *alstate, uint8_t direction)
{ {
SCEnter(); SCEnter();
SCReturnInt(alp_ctx.ctxs[FlowGetProtoMapping(ipproto)][alproto]. int r = 0;
StateGetProgress(alstate, direction)); r = alp_ctx.ctxs[FlowGetProtoMapping(ipproto)][alproto].
StateGetProgress(alstate, direction);
SCReturnInt(r);
} }
uint64_t AppLayerParserGetTxCnt(uint8_t ipproto, AppProto alproto, void *alstate) uint64_t AppLayerParserGetTxCnt(uint8_t ipproto, AppProto alproto, void *alstate)
{ {
SCEnter(); SCEnter();
SCReturnCT(alp_ctx.ctxs[FlowGetProtoMapping(ipproto)][alproto]. uint64_t r = 0;
StateGetTxCnt(alstate), "uint64_t"); 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) void *AppLayerParserGetTx(uint8_t ipproto, AppProto alproto, void *alstate, uint64_t tx_id)
{ {
SCEnter(); SCEnter();
SCReturnPtr(alp_ctx.ctxs[FlowGetProtoMapping(ipproto)][alproto]. void * r = NULL;
StateGetTx(alstate, tx_id), "void *"); r = alp_ctx.ctxs[FlowGetProtoMapping(ipproto)][alproto].
StateGetTx(alstate, tx_id);
SCReturnPtr(r, "void *");
} }
int AppLayerParserGetStateProgressCompletionStatus(uint8_t ipproto, AppProto alproto, int AppLayerParserGetStateProgressCompletionStatus(uint8_t ipproto, AppProto alproto,
uint8_t direction) uint8_t direction)
{ {
SCEnter(); SCEnter();
SCReturnInt(alp_ctx.ctxs[FlowGetProtoMapping(ipproto)][alproto]. int r = 0;
StateGetProgressCompletionStatus(direction)); r = alp_ctx.ctxs[FlowGetProtoMapping(ipproto)][alproto].
StateGetProgressCompletionStatus(direction);
SCReturnInt(r);
} }
int AppLayerParserGetEventInfo(uint8_t ipproto, AppProto alproto, const char *event_name, 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) uint8_t AppLayerParserGetFirstDataDir(uint8_t ipproto, AppProto alproto)
{ {
SCEnter(); SCEnter();
SCReturnCT(alp_ctx.ctxs[FlowGetProtoMapping(ipproto)][alproto]. uint8_t r = 0;
first_data_dir, "uint8_t"); r = alp_ctx.ctxs[FlowGetProtoMapping(ipproto)][alproto].
first_data_dir;
SCReturnCT(r, "uint8_t");
} }
uint64_t AppLayerParserGetTransactionActive(uint8_t ipproto, AppProto alproto, uint64_t AppLayerParserGetTransactionActive(uint8_t ipproto, AppProto alproto,

@ -554,13 +554,15 @@ int AppLayerHandleUdp(ThreadVars *tv, AppLayerThreadCtx *tctx, Packet *p, Flow *
AppProto AppLayerGetProtoByName(char *alproto_name) AppProto AppLayerGetProtoByName(char *alproto_name)
{ {
SCEnter(); SCEnter();
SCReturnCT(AppLayerProtoDetectGetProtoByName(alproto_name), "AppProto"); AppProto r = AppLayerProtoDetectGetProtoByName(alproto_name);
SCReturnCT(r, "AppProto");
} }
char *AppLayerGetProtoName(AppProto alproto) char *AppLayerGetProtoName(AppProto alproto)
{ {
SCEnter(); SCEnter();
SCReturnCT(AppLayerProtoDetectGetProtoName(alproto), "char *"); char * r = AppLayerProtoDetectGetProtoName(alproto);
SCReturnCT(r, "char *");
} }
void AppLayerListSupportedProtocols(void) void AppLayerListSupportedProtocols(void)

@ -97,10 +97,13 @@ TmEcode RespondRejectFunc(ThreadVars *tv, Packet *p, void *data, PacketQueue *pq
int RejectSendIPv4TCP(ThreadVars *tv, Packet *p, void *data) int RejectSendIPv4TCP(ThreadVars *tv, Packet *p, void *data)
{ {
SCEnter(); SCEnter();
int r = 0;
if (PACKET_TEST_ACTION(p, ACTION_REJECT)) { 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)) { } 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)) { } else if(PACKET_TEST_ACTION(p, ACTION_REJECT_BOTH)) {
int ret; int ret;
ret = RejectSendLibnet11L3IPv4TCP(tv, p, data, REJECT_DIR_SRC); 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) int RejectSendIPv4ICMP(ThreadVars *tv, Packet *p, void *data)
{ {
SCEnter(); SCEnter();
int r = 0;
if (PACKET_TEST_ACTION(p, ACTION_REJECT)) { 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)) { } 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)) { } else if(PACKET_TEST_ACTION(p, ACTION_REJECT_BOTH)) {
int ret; int ret;
ret = RejectSendLibnet11L3IPv4ICMP(tv, p, data, REJECT_DIR_SRC); 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) int RejectSendIPv6TCP(ThreadVars *tv, Packet *p, void *data)
{ {
SCEnter(); SCEnter();
int r = 0;
if (PACKET_TEST_ACTION(p, ACTION_REJECT)) { 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)) { } 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)) { } else if(PACKET_TEST_ACTION(p, ACTION_REJECT_BOTH)) {
int ret; int ret;
ret = RejectSendLibnet11L3IPv6TCP(tv, p, data, REJECT_DIR_SRC); 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) int RejectSendIPv6ICMP(ThreadVars *tv, Packet *p, void *data)
{ {
SCEnter(); SCEnter();
int r = 0;
if (PACKET_TEST_ACTION(p, ACTION_REJECT)) { 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)) { } 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)) { } else if(PACKET_TEST_ACTION(p, ACTION_REJECT_BOTH)) {
int ret; int ret;
ret = RejectSendLibnet11L3IPv6ICMP(tv, p, data, REJECT_DIR_SRC); ret = RejectSendLibnet11L3IPv6ICMP(tv, p, data, REJECT_DIR_SRC);

Loading…
Cancel
Save