suricata
|
Go to the source code of this file.
Data Structures | |
struct | SCInstance_ |
Macros | |
#define | PROG_NAME "Suricata" |
#define | PROG_VER PACKAGE_VERSION |
#define | DEFAULT_CONF_FILE CONFIG_DIR "/suricata.yaml" |
#define | DEFAULT_PID_DIR LOCAL_STATE_DIR "/run/" |
#define | DEFAULT_PID_BASENAME "suricata.pid" |
#define | DEFAULT_PID_FILENAME DEFAULT_PID_DIR DEFAULT_PID_BASENAME |
#define | DOC_URL "https://docs.suricata.io/en/" |
#define | SURICATA_STOP (1 << 0) |
#define | SURICATA_DONE (1 << 2) |
#define | IS_SURI_HOST_MODE_SNIFFER_ONLY(host_mode) ((host_mode) == SURI_HOST_IS_SNIFFER_ONLY) |
Typedefs | |
typedef struct SCInstance_ | SCInstance |
Enumerations | |
enum | { SURICATA_INIT = 0 , SURICATA_RUNTIME , SURICATA_DEINIT } |
enum | EngineMode { ENGINE_MODE_UNKNOWN , ENGINE_MODE_IDS , ENGINE_MODE_IPS , ENGINE_MODE_FIREWALL } |
enum | { SURI_HOST_IS_SNIFFER_ONLY , SURI_HOST_IS_ROUTER } |
Functions | |
const char * | GetDocURL (void) |
void | EngineModeSetFirewall (void) |
void | EngineModeSetIPS (void) |
void | EngineModeSetIDS (void) |
int | EngineModeIsUnknown (void) |
bool | EngineModeIsFirewall (void) |
int | EngineModeIsIPS (void) |
int | EngineModeIsIDS (void) |
void | GlobalsInitPreConfig (void) |
void | EngineStop (void) |
make sure threads can stop the engine by calling this function. Purpose: pcap file mode needs to be able to tell the engine the file eof is reached. | |
void | EngineDone (void) |
Used to indicate that the current task is done. | |
int | RunmodeIsUnittests (void) |
SCRunMode | SCRunmodeGet (void) |
Get the current run mode. | |
void | SCRunmodeSet (SCRunMode run_mode) |
Set the current run mode. | |
void | SCEnableDefaultSignalHandlers (void) |
Enable default signal handlers. | |
int | SuriHasSigFile (void) |
void | SuricataPreInit (const char *progname) |
void | SuricataInit (void) |
void | SuricataPostInit (void) |
void | SuricataMainLoop (void) |
void | SuricataShutdown (void) |
int | InitGlobal (void) |
Global initialization common to all runmodes. | |
void | GlobalsDestroy (void) |
int | PostConfLoadedSetup (SCInstance *suri) |
void | PostConfLoadedDetectSetup (SCInstance *suri) |
int | SCFinalizeRunMode (void) |
TmEcode | SCParseCommandLine (int argc, char **argv) |
int | SCStartInternalRunMode (int argc, char **argv) |
TmEcode | SCLoadYamlConfig (void) |
void | PreRunInit (const int runmode) |
void | PreRunPostPrivsDropInit (const int runmode) |
void | PostRunDeinit (const int runmode, struct timeval *start_time) |
clean up / shutdown code for packet modes | |
void | RegisterAllModules (void) |
const char * | GetProgramVersion (void) |
get string with program version | |
Variables | |
volatile uint8_t | suricata_ctl_flags |
int | g_disable_randomness |
uint16_t | g_vlan_mask |
uint16_t | g_livedev_mask |
uint8_t | g_recurlvl_mask |
bool | g_disable_hashing |
Definition in file suricata.h.
#define DEFAULT_CONF_FILE CONFIG_DIR "/suricata.yaml" |
Definition at line 84 of file suricata.h.
#define DEFAULT_PID_BASENAME "suricata.pid" |
Definition at line 87 of file suricata.h.
#define DEFAULT_PID_DIR LOCAL_STATE_DIR "/run/" |
Definition at line 86 of file suricata.h.
#define DEFAULT_PID_FILENAME DEFAULT_PID_DIR DEFAULT_PID_BASENAME |
Definition at line 88 of file suricata.h.
#define DOC_URL "https://docs.suricata.io/en/" |
Definition at line 90 of file suricata.h.
#define IS_SURI_HOST_MODE_SNIFFER_ONLY | ( | host_mode | ) | ((host_mode) == SURI_HOST_IS_SNIFFER_ONLY) |
Definition at line 129 of file suricata.h.
#define PROG_NAME "Suricata" |
Definition at line 75 of file suricata.h.
#define PROG_VER PACKAGE_VERSION |
Definition at line 76 of file suricata.h.
#define SURICATA_DONE (1 << 2) |
packets capture ended
Definition at line 96 of file suricata.h.
#define SURICATA_STOP (1 << 0) |
gracefully stop the engine: process all outstanding packets first
Definition at line 95 of file suricata.h.
typedef struct SCInstance_ SCInstance |
anonymous enum |
Enumerator | |
---|---|
SURICATA_INIT | |
SURICATA_RUNTIME | |
SURICATA_DEINIT |
Definition at line 99 of file suricata.h.
anonymous enum |
Enumerator | |
---|---|
SURI_HOST_IS_SNIFFER_ONLY | |
SURI_HOST_IS_ROUTER |
Definition at line 124 of file suricata.h.
enum EngineMode |
Enumerator | |
---|---|
ENGINE_MODE_UNKNOWN | |
ENGINE_MODE_IDS | |
ENGINE_MODE_IPS | |
ENGINE_MODE_FIREWALL |
Definition at line 106 of file suricata.h.
void EngineDone | ( | void | ) |
Used to indicate that the current task is done.
This is mainly used by pcap-file to tell it has finished to treat a pcap files when running in unix-socket mode.
Definition at line 481 of file suricata.c.
References suricata_ctl_flags, and SURICATA_DONE.
bool EngineModeIsFirewall | ( | void | ) |
Definition at line 235 of file suricata.c.
References DEBUG_VALIDATE_BUG_ON, ENGINE_MODE_FIREWALL, and ENGINE_MODE_UNKNOWN.
Referenced by SigGroupBuild().
int EngineModeIsIDS | ( | void | ) |
Definition at line 248 of file suricata.c.
References DEBUG_VALIDATE_BUG_ON, ENGINE_MODE_IDS, and ENGINE_MODE_UNKNOWN.
int EngineModeIsIPS | ( | void | ) |
Definition at line 242 of file suricata.c.
References DEBUG_VALIDATE_BUG_ON, ENGINE_MODE_IPS, and ENGINE_MODE_UNKNOWN.
Referenced by AlertFastLogger(), AlertJsonHeader(), CaptureStatsSetup(), CaptureStatsUpdate(), DetectEngineMultiTenantSetup(), EveAddVerdict(), ExceptionPolicyApply(), ExceptionPolicyMidstreamParse(), FlowHandlePacketUpdate(), and StreamTcpInitConfig().
int EngineModeIsUnknown | ( | void | ) |
Definition at line 230 of file suricata.c.
References ENGINE_MODE_UNKNOWN.
Referenced by PostConfLoadedSetup().
void EngineModeSetFirewall | ( | void | ) |
Definition at line 254 of file suricata.c.
References ENGINE_MODE_FIREWALL.
Referenced by PostConfLoadedSetup().
void EngineModeSetIDS | ( | void | ) |
Definition at line 264 of file suricata.c.
References ENGINE_MODE_IDS.
Referenced by ListAppLayerHooks(), ListAppLayerProtocols(), ListKeywords(), LLVMFuzzerTestOneInput(), PostConfLoadedSetup(), and RunUnittests().
void EngineModeSetIPS | ( | void | ) |
Definition at line 259 of file suricata.c.
References ENGINE_MODE_IPS.
Referenced by SCParseCommandLine().
void EngineStop | ( | void | ) |
make sure threads can stop the engine by calling this function. Purpose: pcap file mode needs to be able to tell the engine the file eof is reached.
Definition at line 470 of file suricata.c.
References suricata_ctl_flags, and SURICATA_STOP.
Referenced by ReceiveErfFileLoop().
const char * GetDocURL | ( | void | ) |
Definition at line 1165 of file suricata.c.
References DOC_URL, GetProgramVersion(), and PROG_VER.
Referenced by SigTableList().
const char * GetProgramVersion | ( | void | ) |
get string with program version
Get the program version as passed to us from AC_INIT
Add 'RELEASE' is no '-dev' in the version. Add the REVISION if passed to us.
Possible outputs: release: '5.0.1 RELEASE' dev with rev: '5.0.1-dev (64a789bbf 2019-10-18)' dev w/o rev: '5.0.1-dev'
Definition at line 1186 of file suricata.c.
References PROG_VER, REVISION, and xstr.
Referenced by GetDocURL().
void GlobalsDestroy | ( | void | ) |
Definition at line 390 of file suricata.c.
References AFPPeersListClean(), AppLayerDeSetup(), AppLayerHtpPrintStats(), DatalinkTableDeinit(), DatasetsDestroy(), DatasetsSave(), de_ctx, DetectEngineClearMaster(), DetectEngineDeReference(), DetectEngineGetCurrent(), DetectEngineMoveToFreeList(), DetectParseFreeRegexes(), DPDKCleanupEAL(), FeatureTrackingRelease(), HostShutdown(), HTPAtExitPrintStats(), HTPFreeConfig(), LiveDeviceListClean(), MpmHSGlobalCleanup(), NFQContextsClean(), OutputDeregisterAll(), OutputTxShutdown(), ParseSizeDeinit(), SCInstance_::pid_filename, SCConfDeInit(), SCFree, SCLogDeInitLogModule(), SCPidfileRemove(), SCProtoNameRelease(), SigTableCleanup(), suricata, TagDestroyCtx(), ThresholdDestroy(), TimeDeinit(), TmModuleRunDeInit(), TmqhCleanup(), and VarNameStoreDestroy().
Referenced by main(), and SuricataInit().
void GlobalsInitPreConfig | ( | void | ) |
Definition at line 382 of file suricata.c.
References SCProtoNameInit(), SCThresholdConfGlobalInit(), SupportFastPatternForSigMatchTypes(), and TimeInit().
Referenced by LLVMFuzzerTestOneInput(), RunUnittests(), and SuricataInit().
int InitGlobal | ( | void | ) |
Global initialization common to all runmodes.
This can be used by fuzz targets.
Definition at line 2965 of file suricata.c.
References DatalinkTableInit(), ParseSizeInit(), RunModeRegisterRunModes(), SC_ATOMIC_INIT, SCConfInit(), SCLogError, SCLogInitLogModule(), SCSetThreadName, suricata_context, tmm_modules, TMM_SIZE, UtilSignalBlock(), UtilSignalHandlerSetup(), and VarNameStoreInit().
Referenced by LLVMFuzzerTestOneInput(), and SuricataPreInit().
void PostConfLoadedDetectSetup | ( | SCInstance * | suri | ) |
Definition at line 2625 of file suricata.c.
References de_ctx, SCInstance_::delayed_detect, DETECT_ENGINE_TYPE_NORMAL, DetectEngineAddToMaster(), DetectEngineBumpVersion(), DetectEngineCtxInit(), DetectEngineCtxInitStubForDD(), DetectEngineCtxInitStubForMT(), DetectEngineMultiTenantSetup(), SCInstance_::disabled_detect, FatalError, DetectEngineCtx_::last_reload, SCInstance_::run_mode, RUNMODE_CONF_TEST, SCConfGetBool(), TM_ECODE_OK, DetectEngineCtx_::type, and SCInstance_::unix_socket_enabled.
Referenced by LLVMFuzzerTestOneInput(), and SuricataInit().
int PostConfLoadedSetup | ( | SCInstance * | suri | ) |
This function is meant to contain code that needs to be run once the configuration has been loaded.
Definition at line 2716 of file suricata.c.
References AppLayerHtpNeedFileInspection(), AppLayerSetup(), SCInstance_::capture_plugin_args, SCInstance_::capture_plugin_name, SCInstance_::checksum_validation, SCInstance_::conf_filename, ConfigCheckLogDirectoryExists(), CoredumpLoadConfig(), DecodeGlobalConfig(), DetectAddressTestConfVars(), DetectPortTestConfVars(), SCInstance_::disabled_detect, EngineModeIsUnknown(), EngineModeSetFirewall(), EngineModeSetIDS(), FatalError, FeatureTrackingRegister(), FlowRateRegisterFlowStorage(), g_stats_eps_per_app_proto_errors, HOST_VERBOSE, HostBitInitCtx(), HostInitConfig(), SCInstance_::install_signal_handlers, IPPairBitInitCtx(), SCInstance_::is_firewall, LiveDeviceFinalize(), LiveDevRegisterExtension(), LiveSetOffloadDisable(), LiveSetOffloadWarn(), SCInstance_::log_dir, MacSetRegisterFlowStorage(), MpmTableSetup(), NFQInitConfig(), PacketAlertTagInit(), PreRunInit(), RegisterAllModules(), RegisterFlowBypassInfo(), SCInstance_::run_mode, RUNMODE_AFP_DEV, SCInstance_::runmode_custom_mode, RUNMODE_ENGINE_ANALYSIS, RUNMODE_NFQ, RunModeEngineIsIPS(), SCConfGet(), SCConfGetBool(), SCConfGetNode(), SCConfigGetLogDirectory(), SCConfNodeChildValueIsTrue(), SCConfSet(), SCConfSetFinal(), SCHInfoLoadFromConfig(), SCLogConfig, SCLogError, SCLogInfo, SCLogWarning, SCPluginsLoad(), SCReturnInt, SetMasterExceptionPolicy(), SigTableApplyStrictCommandLineOption(), SigTableInit(), SigTableSetup(), SpmTableSetup(), StorageFinalize(), StorageInit(), SCInstance_::strict_rule_parsing_string, StringParseUint16(), suricata, TagInitCtx(), ThresholdInit(), TM_ECODE_FAILED, TM_ECODE_OK, TmModuleRunInit(), and TmqhSetup().
Referenced by LLVMFuzzerTestOneInput(), and SuricataInit().
void PostRunDeinit | ( | const int | runmode, |
struct timeval * | start_time | ||
) |
clean up / shutdown code for packet modes
Shuts down packet modes, so regular packet runmodes and the per pcap mode in the unix socket.
Definition at line 2331 of file suricata.c.
References DecodeUnregisterCounters(), DefragDestroy(), FlowDisableFlowManagerThread(), FlowDisableFlowRecyclerThread(), FlowShutdown(), FlowWorkToDoCleanup(), HostCleanup(), HttpRangeContainersDestroy(), IPPairShutdown(), PacketPoolDestroy(), PacketPoolInit(), profiling_packets_enabled, RUNMODE_UNIX_SOCKET, RunModeShutDown(), SCProfilingDestroy(), SCProfilingDump(), StatsReleaseResources(), STREAM_VERBOSE, StreamTcpFreeConfig(), THV_FLOW_LOOP, THV_KILL, THV_REQ_FLOW_LOOP, THV_RUNNING_DONE, TM_FLAG_FLOWWORKER_TM, TM_FLAG_PACKET_ALL, TM_FLAG_RECEIVE_TM, TmqResetQueues(), TmThreadClearThreadsFamily(), TmThreadDisablePacketThreads(), TmThreadDisableReceiveThreads(), TmThreadKillThreadsFamily(), TmThreadsUnsealThreads(), TopologyDestroy(), TVT_MGMT, and TVT_PPT.
Referenced by SuricataShutdown().
void PreRunInit | ( | const int | runmode | ) |
Definition at line 2286 of file suricata.c.
References AppLayerParserPostStreamSetup(), AppLayerRegisterGlobalCounters(), DefragInit(), FLOW_QUIET, FlowInitConfig(), HttpRangeContainersInit(), IPPairInitConfig(), OutputFilestoreRegisterGlobalCounters(), RUNMODE_UNIX_SOCKET, SCProfilingInit(), SCProfilingKeywordsGlobalInit(), SCProfilingPrefilterGlobalInit(), SCProfilingSghsGlobalInit(), StatsInit(), STREAM_VERBOSE, and StreamTcpInitConfig().
Referenced by PostConfLoadedSetup().
void PreRunPostPrivsDropInit | ( | const int | runmode | ) |
Definition at line 2315 of file suricata.c.
References DatasetsInit(), RUNMODE_UNIX_SOCKET, RunModeInitializeOutputs(), StatsSetupPostConfigPostOutput(), and StatsSetupPostConfigPreOutput().
Referenced by LLVMFuzzerTestOneInput(), and SuricataInit().
void RegisterAllModules | ( | void | ) |
Definition at line 947 of file suricata.c.
References TmModuleBypassedFlowManagerRegister(), TmModuleDebugList(), TmModuleDecodeAFPRegister(), TmModuleDecodeAFXDPRegister(), TmModuleDecodeDPDKRegister(), TmModuleDecodeErfDagRegister(), TmModuleDecodeErfFileRegister(), TmModuleDecodeIPFWRegister(), TmModuleDecodeLibRegister(), TmModuleDecodeNetmapRegister(), TmModuleDecodeNFLOGRegister(), TmModuleDecodeNFQRegister(), TmModuleDecodePcapFileRegister(), TmModuleDecodePcapRegister(), TmModuleDecodeWinDivertRegister(), TmModuleFlowManagerRegister(), TmModuleFlowRecyclerRegister(), TmModuleFlowWorkerRegister(), TmModuleLoggerRegister(), TmModuleReceiveAFPRegister(), TmModuleReceiveAFXDPRegister(), TmModuleReceiveDPDKRegister(), TmModuleReceiveErfDagRegister(), TmModuleReceiveErfFileRegister(), TmModuleReceiveIPFWRegister(), TmModuleReceiveNetmapRegister(), TmModuleReceiveNFLOGRegister(), TmModuleReceiveNFQRegister(), TmModuleReceivePcapFileRegister(), TmModuleReceivePcapRegister(), TmModuleReceiveWinDivertRegister(), TmModuleRespondRejectRegister(), TmModuleStatsLoggerRegister(), TmModuleUnixManagerRegister(), TmModuleVerdictIPFWRegister(), TmModuleVerdictNFQRegister(), and TmModuleVerdictWinDivertRegister().
Referenced by PostConfLoadedSetup(), and RunUnittests().
int RunmodeIsUnittests | ( | void | ) |
Definition at line 270 of file suricata.c.
References SCInstance_::run_mode, RUNMODE_UNITTEST, and suricata.
Referenced by AppLayerRegisterProtocolDetection(), DetectEngineThreadCtxInit(), RegisterDNP3Parsers(), RegisterSSHParsers(), RegisterSSLParsers(), RegisterTFTPParsers(), SCAppLayerParserConfParserEnabled(), SCAppLayerProtoDetectConfProtoDetectionEnabledDefault(), SCClassConfLoadClassificationConfigFile(), SCRConfLoadReferenceConfigFile(), StreamTcpDecrMemuse(), StreamTcpInitConfig(), StreamTcpThreadCacheReturnSegment(), StreamTcpThreadCacheReturnSession(), and TimeGet().
void SCEnableDefaultSignalHandlers | ( | void | ) |
Enable default signal handlers.
Definition at line 289 of file suricata.c.
References SCInstance_::install_signal_handlers, and suricata.
Referenced by main().
int SCFinalizeRunMode | ( | void | ) |
Definition at line 2451 of file suricata.c.
References CheckValidDaemonModes(), SCInstance_::daemon, SCInstance_::progname, SCInstance_::run_mode, RUNMODE_UNKNOWN, suricata, TM_ECODE_FAILED, and TM_ECODE_OK.
Referenced by main().
TmEcode SCLoadYamlConfig | ( | void | ) |
Definition at line 1012 of file suricata.c.
References SCInstance_::additional_configs, SCInstance_::conf_filename, DEFAULT_CONF_FILE, SCConfGetRootNode(), SCConfYamlHandleInclude(), SCConfYamlLoadFile(), SCEnter, SCLogConfig, SCReturnInt, suricata, TM_ECODE_FAILED, and TM_ECODE_OK.
Referenced by main().
TmEcode SCParseCommandLine | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 1369 of file suricata.c.
References SCInstance_::additional_configs, SCInstance_::aux_run_mode, BUG_ON, SCInstance_::capture_plugin_args, SCInstance_::capture_plugin_name, SCInstance_::checksum_validation, SCInstance_::conf_filename, ConfigCheckDataDirectory(), ConfigCheckLogDirectoryExists(), ConfigSetDataDirectory(), ConfigSetLogDirectory(), coverage_unittests, SCInstance_::daemon, SCInstance_::disabled_detect, SCInstance_::do_setgid, SCInstance_::do_setuid, engine_analysis, EngineModeSetIPS(), ExceptionSimulationCommandLineParser(), FatalError, SCInstance_::firewall_rule_file, SCInstance_::firewall_rule_file_exclusive, g_detect_disabled, g_disable_hashing, g_disable_randomness, g_skip_prefilter, g_system, g_ut_covered, g_ut_modules, GetIfaceMTU(), SCInstance_::group_name, IPFWRegisterQueue(), SCInstance_::is_firewall, IsRunModeOffline(), IsRunModeSystem(), SCInstance_::keyword_info, LiveBuildDeviceListCustom(), LiveRegisterDeviceName(), name, NFQParseAndRegisterQueues(), SCInstance_::offline, SCInstance_::pcap_dev, SCInstance_::pid_filename, SCInstance_::regex_arg, SCInstance_::run_mode, RUNMODE_CONF_TEST, SCInstance_::runmode_custom_mode, RUNMODE_DAG, RUNMODE_DUMP_CONFIG, RUNMODE_DUMP_FEATURES, RUNMODE_ENGINE_ANALYSIS, RUNMODE_ERF_FILE, RUNMODE_IPFW, RUNMODE_LIST_APP_LAYER_HOOKS, RUNMODE_LIST_APP_LAYERS, RUNMODE_LIST_KEYWORDS, RUNMODE_LIST_RUNMODES, RUNMODE_LIST_UNITTEST, RUNMODE_NETMAP, RUNMODE_NFLOG, RUNMODE_NFQ, RUNMODE_PCAP_FILE, RUNMODE_PLUGIN, RUNMODE_PRINT_BUILDINFO, RUNMODE_PRINT_USAGE, RUNMODE_PRINT_VERSION, RUNMODE_UNITTEST, RUNMODE_UNIX_SOCKET, RUNMODE_UNKNOWN, RUNMODE_WINDIVERT, SCCalloc, SCConfSetFinal(), SCConfSetFromString(), SCLogError, SCLogInfo, SCLogWarning, SCRealloc, SCStatFn, SCStrdup, SCInstance_::set_datadir, SCInstance_::set_logdir, SCInstance_::sig_file, SCInstance_::sig_file_exclusive, SCInstance_::strict_rule_parsing_string, strlcpy(), suricata, SCInstance_::system, TM_ECODE_FAILED, TM_ECODE_OK, unittests_fatal, SCInstance_::user_name, and SCInstance_::verbose.
Referenced by main().
SCRunMode SCRunmodeGet | ( | void | ) |
Get the current run mode.
Definition at line 279 of file suricata.c.
References SCInstance_::run_mode, and suricata.
Referenced by ConfUnixSocketIsEnable(), DPDKCleanupEAL(), DPDKCloseDevice(), DPDKFreeDevice(), LLVMFuzzerTestOneInput(), OutputJsonInitCtx(), RunModeGetMainMode(), SCConfLogOpenGeneric(), SCThresholdConfInitContext(), SCThresholdConfParseFile(), and SigLoadSignatures().
void SCRunmodeSet | ( | SCRunMode | run_mode | ) |
Set the current run mode.
Mainly exposed outside of suricata.c as a unit-test helper.
Definition at line 284 of file suricata.c.
References SCInstance_::run_mode, and suricata.
Referenced by LLVMFuzzerTestOneInput(), and main().
int SCStartInternalRunMode | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 2389 of file suricata.c.
References SCInstance_::conf_filename, DEFAULT_CONF_FILE, SCInstance_::keyword_info, ListAppLayerHooks(), ListAppLayerProtocols(), ListKeywords(), SCInstance_::regex_arg, SCInstance_::run_mode, RUNMODE_LIST_APP_LAYER_HOOKS, RUNMODE_LIST_APP_LAYERS, RUNMODE_LIST_KEYWORDS, RUNMODE_LIST_RUNMODES, RUNMODE_LIST_UNITTEST, RUNMODE_PRINT_BUILDINFO, RUNMODE_PRINT_USAGE, RUNMODE_PRINT_VERSION, RUNMODE_UNITTEST, RunModeListRunmodes(), RunUnittests(), SCLogInfo, suricata, TM_ECODE_DONE, TM_ECODE_FAILED, and TM_ECODE_OK.
Referenced by main().
void SuricataInit | ( | void | ) |
Definition at line 3012 of file suricata.c.
References SCInstance_::aux_run_mode, SCInstance_::capture_plugin_args, SCInstance_::capture_plugin_name, ConfUnixSocketIsEnable(), CoredumpEnable(), SCInstance_::daemon, SCInstance_::disabled_detect, FeatureDump(), g_livedev_mask, g_recurlvl_mask, g_vlan_mask, GlobalsDestroy(), GlobalsInitPreConfig(), SCInstance_::groupid, LandlockSandboxing(), SCInstance_::pcap_dev, PostConfLoadedDetectSetup(), PostConfLoadedSetup(), prerun_snap, PreRunPostPrivsDropInit(), SCInstance_::run_mode, RUNMODE_CONF_TEST, SCInstance_::runmode_custom_mode, RUNMODE_DPDK, RUNMODE_DUMP_CONFIG, RUNMODE_DUMP_FEATURES, RUNMODE_ENGINE_ANALYSIS, RUNMODE_UNIX_SOCKET, RunModeDispatch(), RunModeInitializeThreadSettings(), SCConfDump(), SCConfGetBool(), SCDropMainThreadCaps, SCLogDebug, SCLogInfo, SCLogLoadConfig(), SCLogNotice, SCOnLoggingReady(), suricata, SystemHugepageSnapshotCreate(), TM_ECODE_OK, SCInstance_::unix_socket_enabled, UnixManagerThreadSpawnNonRunmode(), SCInstance_::userid, UtilCpuPrintSummary(), and SCInstance_::verbose.
Referenced by main().
void SuricataMainLoop | ( | void | ) |
Definition at line 2922 of file suricata.c.
References DetectEngineReload(), DetectEngineReloadIsStart(), DetectEngineReloadSetIdle(), DetectEngineReloadStart(), OutputNotifyFileRotation(), SCLogNotice, sighup_count, sigint_count, sigterm_count, sigusr2_count, suricata, suricata_ctl_flags, SURICATA_STOP, and TmThreadCheckThreadState().
Referenced by main().
void SuricataPostInit | ( | void | ) |
Definition at line 3111 of file suricata.c.
References FatalError, geteuid, PacketPoolPostRunmodes(), prerun_snap, SCInstance_::run_mode, RUNMODE_DPDK, SC_ATOMIC_SET, SCConfGetBool(), SCLogWarning, SCPledge, suricata, SURICATA_RUNTIME, SystemHugepageEvaluateHugepages(), SystemHugepageSnapshotCreate(), SystemHugepageSnapshotDestroy(), TM_ECODE_FAILED, TM_ECODE_OK, TmThreadContinueThreads(), TmThreadWaitOnThreadInit(), and TmThreadWaitOnThreadRunning().
Referenced by main().
void SuricataPreInit | ( | const char * | progname | ) |
Definition at line 3003 of file suricata.c.
References InitGlobal(), and suricata.
Referenced by main().
void SuricataShutdown | ( | void | ) |
Definition at line 3100 of file suricata.c.
References PostRunDeinit(), SCInstance_::run_mode, SC_ATOMIC_SET, SCInstance_::start_time, suricata, SURICATA_DEINIT, TmThreadKillThreads(), and UnixSocketKillSocketThread().
Referenced by main().
int SuriHasSigFile | ( | void | ) |
Definition at line 225 of file suricata.c.
References SCInstance_::sig_file, and suricata.
|
extern |
Definition at line 214 of file suricata.c.
Referenced by EveEmailLogJson(), FileForceHashParseCfg(), RegisterSSLParsers(), SCParseCommandLine(), SSLEnableJA3(), and SSLEnableJA4().
|
extern |
disable randomness to get reproducible results across runs
Definition at line 195 of file suricata.c.
Referenced by RandomGet(), and SCParseCommandLine().
|
extern |
determine (without branching) if we include the livedev ids when hashing or comparing flows
Definition at line 206 of file suricata.c.
Referenced by FlowKeyGetHash(), RunModeEngineIsIPS(), and SuricataInit().
|
extern |
determine (without branching) if we include the recursion levels when hashing or comparing flows
Definition at line 210 of file suricata.c.
Referenced by FlowGetIpPairProtoHash(), FlowKeyGetHash(), and SuricataInit().
|
extern |
determine (without branching) if we include the vlan_ids when hashing or comparing flows
Definition at line 202 of file suricata.c.
Referenced by FlowGetIpPairProtoHash(), FlowKeyGetHash(), and SuricataInit().
|
extern |
suricata engine control flags
Definition at line 172 of file suricata.c.
Referenced by EngineDone(), EngineStop(), LLVMFuzzerTestOneInput(), PcapFileDispatch(), ReceiveErfDagLoop(), ReceiveErfFileLoop(), and SuricataMainLoop().