]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
app-layer: add logger check to API
authorVictor Julien <victor@inliniac.net>
Wed, 15 Jan 2014 13:23:16 +0000 (14:23 +0100)
committerVictor Julien <victor@inliniac.net>
Mon, 27 Jan 2014 14:20:59 +0000 (15:20 +0100)
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.

src/app-layer-parser.c
src/app-layer-parser.h

index 441ca33f11369f82fc1138117a9cebe79d07f439..b33a0144f7b2a1ac797f1905e239d172299c4d8e 100644 (file)
@@ -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();
index 0f3cc7e885fbe7d04d099a8680ac637d04b35015..6496833898f5c552b572cb84fb5ba5c213a525fc 100644 (file)
@@ -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 *****/