suricata
source-erf-file.c File Reference
#include "suricata-common.h"
#include "suricata.h"
#include "tm-threads.h"
#include "source-erf-file.h"
#include "util-datalink.h"
Include dependency graph for source-erf-file.c:

Go to the source code of this file.

Data Structures

struct  DagFlags_
 
struct  DagRecord_
 

Macros

#define DAG_TYPE_ETH   2
 

Typedefs

typedef struct DagFlags_ DagFlags
 

Functions

struct DagRecord_ __attribute__ ((packed))
 DNP3 application object header. More...
 
TmEcode ReceiveErfFileLoop (ThreadVars *tv, void *data, void *slot)
 ERF file reading loop. More...
 
TmEcode ReceiveErfFileThreadInit (ThreadVars *tv, const void *initdata, void **data)
 Initialize the ERF receiver thread. More...
 
void ReceiveErfFileThreadExitStats (ThreadVars *tv, void *data)
 Print some stats to the log at program exit. More...
 
TmEcode ReceiveErfFileThreadDeinit (ThreadVars *, void *)
 
void TmModuleReceiveErfFileRegister (void)
 Register the ERF file receiver (reader) module. More...
 
void TmModuleDecodeErfFileRegister (void)
 Register the ERF file decoder module. More...
 

Variables

uint64_t ts
 
uint8_t type
 
DagFlags flags
 
uint16_t rlen
 
uint16_t lctr
 
uint16_t wlen
 
uint16_t pad
 
 ErfFileThreadVars
 

Detailed Description

Author
Endace Technology Limited.

Support for reading ERF files.

Only ethernet supported at this time.

Definition in file source-erf-file.c.

Macro Definition Documentation

◆ DAG_TYPE_ETH

#define DAG_TYPE_ETH   2

Definition at line 35 of file source-erf-file.c.

Typedef Documentation

◆ DagFlags

typedef struct DagFlags_ DagFlags

Function Documentation

◆ __attribute__()

struct DagRecord_ __attribute__ ( (packed)  )

DNP3 application object header.

Definition at line 1 of file source-erf-file.c.

◆ ReceiveErfFileLoop()

TmEcode ReceiveErfFileLoop ( ThreadVars tv,
void *  data,
void *  slot 
)

ERF file reading loop.

Definition at line 112 of file source-erf-file.c.

References EngineStop(), ErfFileThreadVars, PacketGetFromQueueOrAlloc(), PacketPoolWait(), PKT_SET_SRC, PKT_SRC_WIRE, SCLogError, SCReturnInt, suricata_ctl_flags, SURICATA_STOP, THV_RUNNING, TM_ECODE_FAILED, TM_ECODE_OK, TmThreadsSetFlag(), tv, and unlikely.

Referenced by TmModuleReceiveErfFileRegister().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReceiveErfFileThreadDeinit()

TmEcode ReceiveErfFileThreadDeinit ( ThreadVars ,
void *   
)

◆ ReceiveErfFileThreadExitStats()

void ReceiveErfFileThreadExitStats ( ThreadVars tv,
void *  data 
)

Print some stats to the log at program exit.

Parameters
tvPointer to ThreadVars.
dataPointer to data, ErfFileThreadVars.

Definition at line 306 of file source-erf-file.c.

References ErfFileThreadVars, and SCLogInfo.

Referenced by TmModuleReceiveErfFileRegister().

Here is the caller graph for this function:

◆ ReceiveErfFileThreadInit()

TmEcode ReceiveErfFileThreadInit ( ThreadVars tv,
const void *  initdata,
void **  data 
)

Initialize the ERF receiver thread.

Definition at line 216 of file source-erf-file.c.

References DatalinkSetGlobalType(), ErfFileThreadVars, LINKTYPE_ETHERNET, SCCalloc, SCEnter, SCLogError, SCLogInfo, SCReturnInt, TM_ECODE_FAILED, TM_ECODE_OK, tv, and unlikely.

Referenced by TmModuleReceiveErfFileRegister().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TmModuleDecodeErfFileRegister()

void TmModuleDecodeErfFileRegister ( void  )

Register the ERF file decoder module.

Definition at line 98 of file source-erf-file.c.

References TmModule_::name, TmModule_::ThreadInit, TMM_DECODEERFFILE, and tmm_modules.

Referenced by RegisterAllModules().

Here is the caller graph for this function:

◆ TmModuleReceiveErfFileRegister()

void TmModuleReceiveErfFileRegister ( void  )

Variable Documentation

◆ ErfFileThreadVars

ErfFileThreadVars

◆ flags

DagFlags flags

Definition at line 57 of file source-erf-file.c.

◆ lctr

uint16_t lctr

Definition at line 59 of file source-erf-file.c.

◆ pad

uint16_t pad

Definition at line 61 of file source-erf-file.c.

◆ rlen

uint16_t rlen

Definition at line 58 of file source-erf-file.c.

◆ ts

◆ type

uint8_t type

Definition at line 56 of file source-erf-file.c.

◆ wlen

uint16_t wlen

Definition at line 60 of file source-erf-file.c.