suricata
source-erf-file.c File Reference
#include "suricata-common.h"
#include "suricata.h"
#include "tm-threads.h"
#include "source-erf-file.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 *)
 
TmEcode DecodeErfFileThreadInit (ThreadVars *tv, const void *initdata, void **data)
 Initialize the ERF decoder thread. More...
 
TmEcode DecodeErfFileThreadDeinit (ThreadVars *tv, void *data)
 
TmEcode DecodeErfFile (ThreadVars *tv, Packet *p, void *data, PacketQueue *pq, PacketQueue *postpq)
 Decode the ERF file. More...
 
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

#define DAG_TYPE_ETH   2

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

Referenced by ReceiveErfFileLoop().

Typedef Documentation

typedef struct DagFlags_ DagFlags

Function Documentation

struct DagRecord_ __attribute__ ( (packed)  )

DNP3 application object header.

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

TmEcode DecodeErfFile ( ThreadVars tv,
Packet p,
void *  data,
PacketQueue pq,
PacketQueue postpq 
)

Decode the ERF file.

This function ups the decoder counters and then passes the packet off to the ethernet decoder.

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

References DecodeEthernet(), DecodeUpdatePacketCounters(), Packet_::flags, GET_PKT_DATA, GET_PKT_LEN, PacketDecodeFinalize(), PKT_PSEUDO_STREAM_END, SCEnter, SCReturnInt, and TM_ECODE_OK.

Referenced by TmModuleDecodeErfFileRegister().

Here is the call graph for this function:

Here is the caller graph for this function:

TmEcode DecodeErfFileThreadDeinit ( ThreadVars tv,
void *  data 
)

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

References DecodeThreadVarsFree(), SCReturnInt, and TM_ECODE_OK.

Referenced by TmModuleDecodeErfFileRegister().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Initialize the ERF decoder thread.

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

References DecodeRegisterPerfCounters(), DecodeThreadVarsAlloc(), SCEnter, SCReturnInt, TM_ECODE_FAILED, and TM_ECODE_OK.

Referenced by TmModuleDecodeErfFileRegister().

Here is the call graph for this function:

Here is the caller graph for this function:

TmEcode ReceiveErfFileLoop ( ThreadVars tv,
void *  data,
void *  slot 
)
TmEcode ReceiveErfFileThreadDeinit ( ThreadVars ,
void *   
)
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 305 of file source-erf-file.c.

References ErfFileThreadVars, and SCLogInfo.

Referenced by TmModuleReceiveErfFileRegister().

Here is the caller graph for this function:

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

Initialize the ERF receiver thread.

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

References ErfFileThreadVars, SC_ERR_FOPEN, SC_ERR_INVALID_ARGUMENT, SC_ERR_MEM_ALLOC, SCEnter, SCLogError, SCLogInfo, SCMalloc, SCReturnInt, TM_ECODE_FAILED, TM_ECODE_OK, and unlikely.

Referenced by TmModuleReceiveErfFileRegister().

Here is the caller graph for this function:

void TmModuleDecodeErfFileRegister ( void  )

Register the ERF file decoder module.

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

References TmModule_::cap_flags, DecodeErfFile(), DecodeErfFileThreadDeinit(), DecodeErfFileThreadInit(), TmModule_::flags, TmModule_::Func, TmModule_::name, TmModule_::RegisterTests, TmModule_::ThreadDeinit, TmModule_::ThreadExitPrintStats, TmModule_::ThreadInit, TM_FLAG_DECODE_TM, TMM_DECODEERFFILE, and tmm_modules.

Referenced by RegisterAllModules().

Here is the call graph for this function:

Here is the caller graph for this function:

void TmModuleReceiveErfFileRegister ( void  )

Variable Documentation

ErfFileThreadVars
DagFlags flags

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

uint16_t lctr

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

uint16_t pad

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

Referenced by SigMatchSignaturesGetSgh().

uint16_t rlen

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

Referenced by ComputeSHA1(), ReceiveErfDagLoop(), and ReceiveErfFileLoop().

uint8_t type

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

uint16_t wlen

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

Referenced by ReceiveErfDagLoop(), and ReceiveErfFileLoop().