Go to the documentation of this file.
34 #define DAG_TYPE_ETH 2
56 typedef struct ErfFileThreadVars_ {
117 etv->slot = ((
TmSlot *)slot)->slot_next;
146 if (TmThreadsSlotProcessPkt(etv->tv, etv->slot, p) !=
TM_ECODE_OK) {
161 size_t r = fread(&dr,
sizeof(DagRecord), 1, etv->erf);
163 if (feof(etv->erf)) {
173 if (
rlen <
sizeof(DagRecord)) {
175 "record length less than size of header");
180 if (feof(etv->erf)) {
191 SCLogError(
"DAG record type %d not implemented.", dr.type);
201 ts = (
ts & 0xffffffffULL) * 1000000;
203 uint64_t usecs = (
ts >> 32);
220 if (initdata == NULL) {
225 FILE *erf = fopen((
const char *)initdata,
"r");
227 SCLogError(
"Failed to open %s: %s", (
char *)initdata, strerror(errno));
233 SCLogError(
"Failed to allocate memory for ERF file thread vars.");
241 SCLogInfo(
"Processing ERF file %s", (
char *)initdata);
252 DecodeErfFileThreadInit(
ThreadVars *
tv,
const void *initdata,
void **data)
310 SCLogInfo(
"Packets: %"PRIu32
"; Bytes: %"PRIu64, etv->pkts, etv->bytes);
#define PKT_IS_PSEUDOPKT(p)
return 1 if the packet is a pseudo packet
void TmThreadsSetFlag(ThreadVars *tv, uint32_t flag)
Set a thread flag.
void ReceiveErfFileThreadExitStats(ThreadVars *, void *)
Print some stats to the log at program exit.
void TmModuleDecodeErfFileRegister(void)
Register the ERF file decoder module.
void PacketDecodeFinalize(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p)
Finalize decoding of a packet.
void TmqhOutputPacketpool(ThreadVars *t, Packet *p)
TmEcode(* PktAcqLoop)(ThreadVars *, void *, void *)
TmEcode(* ThreadDeinit)(ThreadVars *, void *)
#define PKT_SET_SRC(p, src_val)
void DecodeRegisterPerfCounters(DecodeThreadVars *dtv, ThreadVars *tv)
#define SCTIME_FROM_SECS(s)
#define SCTIME_ADD_USECS(ts, us)
TmEcode(* PktAcqBreakLoop)(ThreadVars *, void *)
Per thread variable structure.
TmEcode(* Func)(ThreadVars *, Packet *, void *)
void PacketPoolWait(void)
#define TM_FLAG_DECODE_TM
TmModule tmm_modules[TMM_SIZE]
struct DagFlags_ DagFlags
#define SCLogInfo(...)
Macro used to log INFORMATIONAL messages.
#define TM_FLAG_RECEIVE_TM
void TmModuleReceiveErfFileRegister(void)
Register the ERF file receiver (reader) module.
TmEcode ReceiveErfFileThreadDeinit(ThreadVars *, void *)
struct DagRecord_ __attribute__((packed))
DNP3 application object header.
void DecodeThreadVarsFree(ThreadVars *tv, DecodeThreadVars *dtv)
TmEcode(* ThreadInit)(ThreadVars *, const void *, void **)
void EngineStop(void)
make sure threads can stop the engine by calling this function. Purpose: pcap file mode needs to be a...
void(* ThreadExitPrintStats)(ThreadVars *, void *)
#define SCLogError(...)
Macro used to log ERROR messages.
void DatalinkSetGlobalType(int datalink)
Structure to hold thread specific data for all decode modules.
DecodeThreadVars * DecodeThreadVarsAlloc(ThreadVars *tv)
Alloc and setup DecodeThreadVars.
TmEcode ReceiveErfFileThreadInit(ThreadVars *, const void *, void **)
Initialize the ERF receiver thread.
TmEcode ReceiveErfFileLoop(ThreadVars *, void *, void *)
ERF file reading loop.
Packet * PacketGetFromQueueOrAlloc(void)
Get a packet. We try to get a packet from the packetpool first, but if that is empty we alloc a packe...
int DecodeEthernet(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p, const uint8_t *pkt, uint32_t len)
void DecodeUpdatePacketCounters(ThreadVars *tv, const DecodeThreadVars *dtv, const Packet *p)
#define LINKTYPE_ETHERNET
volatile uint8_t suricata_ctl_flags