Add error counters.

remotes/origin/master-1.1.x
Victor Julien 15 years ago
parent 3b239b3e48
commit dda6d3e07b

@ -764,6 +764,9 @@ end:
SCReturnInt(0); SCReturnInt(0);
} }
uint32_t applayererrors = 0;
uint32_t applayerhttperrors = 0;
/** /**
* \brief Layer 7 Parsing main entry point. * \brief Layer 7 Parsing main entry point.
* *
@ -912,6 +915,10 @@ int AppLayerParse(Flow *f, uint8_t proto, uint8_t flags, uint8_t *input,
SCReturnInt(0); SCReturnInt(0);
error: error:
if (ssn != NULL) { if (ssn != NULL) {
applayererrors++;
if (f->alproto == ALPROTO_HTTP)
applayerhttperrors++;
/* Set the no app layer inspection flag for both /* Set the no app layer inspection flag for both
* the stream in this Flow */ * the stream in this Flow */
FlowSetSessionNoApplayerInspectionFlag(f); FlowSetSessionNoApplayerInspectionFlag(f);

@ -261,6 +261,9 @@ int StreamTcpReassembleInit(char quiet)
return 0; return 0;
} }
extern uint32_t applayererrors;
extern uint32_t applayerhttperrors;
void StreamTcpReassembleFree(char quiet) void StreamTcpReassembleFree(char quiet)
{ {
uint16_t u16 = 0; uint16_t u16 = 0;
@ -297,6 +300,9 @@ void StreamTcpReassembleFree(char quiet)
SCMutexDestroy(&segment_pool_memuse_mutex); SCMutexDestroy(&segment_pool_memuse_mutex);
SCMutexDestroy(&segment_pool_cnt_mutex); SCMutexDestroy(&segment_pool_cnt_mutex);
#endif #endif
SCLogInfo("applayererrors %u", applayererrors);
SCLogInfo("applayerhttperrors %u", applayerhttperrors);
} }
TcpReassemblyThreadCtx *StreamTcpReassembleInitThreadCtx(void) TcpReassemblyThreadCtx *StreamTcpReassembleInitThreadCtx(void)

Loading…
Cancel
Save