]> git.ipfire.org Git - people/ms/suricata.git/commit - src/source-af-packet.h
capture: add data release mechanism
authorEric Leblond <eric@regit.org>
Fri, 15 Jun 2012 15:18:57 +0000 (17:18 +0200)
committerVictor Julien <victor@inliniac.net>
Mon, 3 Sep 2012 13:27:38 +0000 (15:27 +0200)
commit2011a3f87e433b0c8b72ea2b8b2b10d6ed8485e3
treebebef198573dcc61e233822ca997b6055d2e1d84
parent8879df80049a1db693e1f196f50928cf2472f12f
capture: add data release mechanism

This patch adds a data release mechanism. If the capture module
has a call to indicate that userland has finished with the data,
it is possible to use this system. The data will then be released
when the treatment of the packet is finished.

To do so the Packet structure has been modified:
+    TmEcode (*ReleaseData)(ThreadVars *, struct Packet_ *);
If ReleaseData is null, the function is called when the treatment
of the Packet is finished.
Thus it is sufficient for the capture module to code a function
wrapping the data release mechanism and to assign it to ReleaseData
field.

This patch also includes an implementation of this mechanism for
AF_PACKET.
src/decode.h
src/source-af-packet.c
src/source-af-packet.h
src/tmqh-packetpool.c