Project

General

Profile

Feature #415

API call: per packet acquisition module packet release function

Added by Victor Julien almost 7 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Effort:
Difficulty:

Description

When discarding a packet because Suricata is done with it, AF_PACKET with mmap needs to tell the kernel to release it. Tilera needs the same.

Allow each pkt acq module to register a packet release function.

Make sure this function is called in TmqhOutputPacketpool.

Document!

(side thought: can this be used to set verdicts in nfq as well?)

History

#1 Updated by Eric Leblond over 6 years ago

The attached patch implement a similar idea. It 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)(struct Packet_ *);
+    void *relptr;

If ReleaseData and relptr are not 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.

All locking have to be handled by the ReleaseData function.

#2 Updated by Eric Leblond over 6 years ago

  • Target version changed from 1.4 to 1.4beta1

#3 Updated by Victor Julien over 6 years ago

  • Status changed from New to Closed
  • % Done changed from 60 to 100

Also available in: Atom PDF