suricata
source-pcap-file-directory-helper.c File Reference
#include "source-pcap-file-directory-helper.h"
#include "suricata.h"
#include "runmode-unix-socket.h"
#include "util-mem.h"
#include "util-time.h"
#include "util-path.h"
#include "source-pcap-file.h"
Include dependency graph for source-pcap-file-directory-helper.c:

Go to the source code of this file.

Functions

void CleanupPendingFile (PendingFile *pending)
 
void CleanupPcapFileDirectoryVars (PcapFileDirectoryVars *ptv)
 
TmEcode PcapDetermineDirectoryOrFile (char *filename, DIR **directory)
 
TmEcode PcapDirectoryDispatch (PcapFileDirectoryVars *ptv)
 

Variables

PcapFileGlobalVars pcap_g
 

Detailed Description

Author
Danny Browning danny.nosp@m..bro.nosp@m.wning.nosp@m.@pro.nosp@m.tectw.nosp@m.ise..nosp@m.com

Helper methods for directory based packet acquisition

Definition in file source-pcap-file-directory-helper.c.

Function Documentation

◆ CleanupPcapFileDirectoryVars()

void CleanupPcapFileDirectoryVars ( PcapFileDirectoryVars ptv)

Cleanup resources associated with a PcapFileDirectoryVars object

Parameters
ptvObject to be cleaned up

Definition at line 109 of file source-pcap-file-directory-helper.c.

References CleanupPcapFileFileVars(), CleanupPendingFile(), PcapFileDirectoryVars_::current_file, PcapFileDirectoryVars_::directory, PcapFileDirectoryVars_::filename, next, SCFree, PcapFileDirectoryVars_::shared, TAILQ_EMPTY, TAILQ_FIRST, and TAILQ_REMOVE.

Here is the call graph for this function:

◆ CleanupPendingFile()

void CleanupPendingFile ( PendingFile pending)

Cleanup resources associated with a PendingFile object

Parameters
pendingObject to be cleaned up

Definition at line 100 of file source-pcap-file-directory-helper.c.

References PendingFile_::filename, and SCFree.

Referenced by CleanupPcapFileDirectoryVars().

Here is the caller graph for this function:

◆ PcapDetermineDirectoryOrFile()

TmEcode PcapDetermineDirectoryOrFile ( char *  filename,
DIR **  directory 
)

Determine if a given string represents a file or directory. If a directory, populate the directory object.

Parameters
filenameString to check
directoryDirectory point to populate if directory
Returns
TM_ECODE_OK if string or directory

Definition at line 174 of file source-pcap-file-directory-helper.c.

References SCLogDebug, SCLogError, TM_ECODE_FAILED, and TM_ECODE_OK.

◆ PcapDirectoryDispatch()

TmEcode PcapDirectoryDispatch ( PcapFileDirectoryVars ptv)

Dispatch a directory for processing, where information for processing the directory is contained in a PcapFileDirectoryVars object

Parameters
ptvPcapFileDirectoryVars object containing information for processing the directory
Returns

Definition at line 480 of file source-pcap-file-directory-helper.c.

References PcapFileDirectoryVars_::poll_interval, SCEnter, and PcapFileDirectoryVars_::should_loop.

Variable Documentation

◆ pcap_g

Definition at line 38 of file source-pcap-file.c.