suricata
capture-hooks.c File Reference
#include "suricata-common.h"
#include "capture-hooks.h"
Include dependency graph for capture-hooks.c:

Go to the source code of this file.

Functions

void CaptureHooksSet (CaptureOnPacketWithAlertsHook OnAlerts, CaptureOnPseudoPacketCreatedHook OnPseudoCreated)
 
void CaptureHooksOnPacketWithAlerts (const Packet *p)
 
void CaptureHooksOnPseudoPacketCreated (Packet *p)
 

Detailed Description

Lightweight indirection layer for capture-related callbacks.

This module lets the capture implementation register small hooks that the generic engine can invoke without hard dependencies. Two hooks are used:

  • on-alerts: invoked when a packet produced alerts so capture can update per-input stats (e.g., deciding if a pcap should be deleted or kept).
  • on-pseudo-created: invoked when the engine creates pseudo packets (e.g., flow timeout or shutdown flush). This allows capture to retain references or track alert outcomes tied to those pseudo packets.

Definition in file capture-hooks.c.

Function Documentation

◆ CaptureHooksOnPacketWithAlerts()

void CaptureHooksOnPacketWithAlerts ( const Packet p)

Definition at line 53 of file capture-hooks.c.

◆ CaptureHooksOnPseudoPacketCreated()

void CaptureHooksOnPseudoPacketCreated ( Packet p)

Definition at line 60 of file capture-hooks.c.

◆ CaptureHooksSet()

void CaptureHooksSet ( CaptureOnPacketWithAlertsHook  OnAlerts,
CaptureOnPseudoPacketCreatedHook  OnPseudoCreated 
)

Definition at line 37 of file capture-hooks.c.

Referenced by PcapFileInstallCaptureHooks().

Here is the caller graph for this function: