From: Victor Julien Date: Wed, 15 Jan 2014 13:23:16 +0000 (+0100) Subject: app-layer: add logger check to API X-Git-Tag: suricata-2.0rc1~127 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=078ff0c0cc4a1101df21a0212262e96055a330ef;p=thirdparty%2Fsuricata.git app-layer: add logger check to API The new API call: int AppLayerParserProtocolHasLogger(uint8_t ipproto, AppProto alproto) Returns TRUE if a logger is registered on the ip/alproto pair, and FALSE otherwise. --- diff --git a/src/app-layer-parser.c b/src/app-layer-parser.c index 441ca33f11..b33a0144f7 100644 --- a/src/app-layer-parser.c +++ b/src/app-layer-parser.c @@ -943,6 +943,14 @@ int AppLayerParserProtocolSupportsTxs(uint8_t ipproto, AppProto alproto) SCReturnInt(r); } +int AppLayerParserProtocolHasLogger(uint8_t ipproto, AppProto alproto) +{ + SCEnter(); + int ipproto_map = FlowGetProtoMapping(ipproto); + int r = (alp_ctx.ctxs[ipproto_map][alproto].logger == 0) ? 0 : 1; + SCReturnInt(r); +} + void AppLayerParserTriggerRawStreamReassembly(Flow *f) { SCEnter(); diff --git a/src/app-layer-parser.h b/src/app-layer-parser.h index 0f3cc7e885..6496833898 100644 --- a/src/app-layer-parser.h +++ b/src/app-layer-parser.h @@ -185,6 +185,7 @@ int AppLayerParserHasDecoderEvents(uint8_t ipproto, AppProto alproto, void *alst int AppLayerParserProtocolIsTxAware(uint8_t ipproto, AppProto alproto); int AppLayerParserProtocolIsTxEventAware(uint8_t ipproto, AppProto alproto); int AppLayerParserProtocolSupportsTxs(uint8_t ipproto, AppProto alproto); +int AppLayerParserProtocolHasLogger(uint8_t ipproto, AppProto alproto); void AppLayerParserTriggerRawStreamReassembly(Flow *f); /***** Cleanup *****/