37static int initialized = 0;
51 filepath = dirname(strdup((*argv)[0]));
59 struct pcap_pkthdr header;
64 if (initialized == 0) {
66 setenv(
"SC_LOG_OP_IFACE",
"file", 0);
67 setenv(
"SC_LOG_FILE",
"/dev/null", 0);
91 memset(&
tv, 0,
sizeof(
tv));
111 if (size < FPC0_HEADER_LEN) {
115 if (FPC_init(&pkts, data, size) < 0) {
120 r = FPC_next(&pkts, &header, &pkt);
122 if (p == NULL || r <= 0 || header.ts.tv_sec >= INT_MAX - 3600) {
136 while (extra_p != NULL) {
142 while (extra_p != NULL) {
147 r = FPC_next(&pkts, &header, &pkt);
148 if (r <= 0 || header.ts.tv_sec >= INT_MAX - 3600) {
int SCConfYamlLoadString(const char *string, size_t len)
Load configuration from a YAML string.
int StatsSetupPrivate(ThreadVars *tv)
int DetectEngineReload(const SCInstance *suri)
Reload the detection engine.
FlowQueue * FlowQueueNew(void)
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
const char * configNoChecksum
int LLVMFuzzerInitialize(const int *argc, char ***argv)
void DecodeRegisterPerfCounters(DecodeThreadVars *dtv, ThreadVars *tv)
DecodeThreadVars * DecodeThreadVarsAlloc(ThreadVars *tv)
Alloc and setup DecodeThreadVars.
Packet * PacketGetFromAlloc(void)
Get a malloced packet.
int PacketCopyData(Packet *p, const uint8_t *pktdata, uint32_t pktlen)
Copy data to Packet payload and set packet length.
void PacketFreeOrRelease(Packet *p)
Return a packet to where it was allocated.
void PacketFree(Packet *p)
Return a malloced packet.
Packet * PacketDequeueNoLock(PacketQueueNoLock *qnl)
void PacketRecycle(Packet *p)
uint32_t max_pending_packets
Structure to hold thread specific data for all decode modules.
Per thread variable structure.
PacketQueueNoLock decode_pq
struct FlowQueue_ * flow_queue
TmEcode(* Func)(ThreadVars *, Packet *, void *)
TmEcode(* ThreadInit)(ThreadVars *, const void *, void **)
int InitGlobal(void)
Global initialization common to all runmodes.
void PostConfLoadedDetectSetup(SCInstance *suri)
void PreRunPostPrivsDropInit(const int runmode)
SCRunMode SCRunmodeGet(void)
Get the current run mode.
void SCRunmodeSet(SCRunMode run_mode)
Set the current run mode.
void GlobalsInitPreConfig(void)
int PostConfLoadedSetup(SCInstance *suri)
TmModule tmm_modules[TMM_SIZE]
void PacketPoolInit(void)
#define SC_ATOMIC_EXTERN(type, name)
wrapper for referencing an atomic variable declared on another file.
#define SC_ATOMIC_SET(name, val)
Set the value for the atomic variable.
TmEcode ConfigSetLogDirectory(const char *name)
#define SCTIME_FROM_TIMEVAL(tv)
void setenv(const char *name, const char *value, int overwrite)