|
suricata
|

Go to the source code of this file.
Macros | |
| #define | DetectEngineGetMaxSigId(de_ctx) ((de_ctx)->signum) |
Definition in file detect-engine.h.
Definition at line 92 of file detect-engine.h.
| void DetectAppLayerInspectEngineRegister | ( | const char * | name, |
| AppProto | alproto, | ||
| uint32_t | dir, | ||
| uint8_t | progress, | ||
| InspectEngineFuncPtr | Callback2, | ||
| InspectionBufferGetDataPtr | GetData | ||
| ) |
Registers an app inspection engine.
| name | Name of the detection list |
| alproto | App layer protocol for which we will register the engine. |
| direction | The direction for the engine: SIG_FLAG_TOSERVER or SIG_FLAG_TOCLIENT |
| progress | Minimal progress value for inspect engine to run |
| Callback | The engine callback. |
Definition at line 276 of file detect-engine.c.
Referenced by SCDetectHelperBufferProgressRegister().

| void DetectAppLayerInspectEngineRegisterSingle | ( | const char * | name, |
| AppProto | alproto, | ||
| uint32_t | dir, | ||
| uint8_t | progress, | ||
| InspectEngineFuncPtr | Callback2, | ||
| InspectionSingleBufferGetDataPtr | GetData | ||
| ) |
Definition at line 322 of file detect-engine.c.
| void DetectAppLayerInspectEngineRegisterSubState | ( | const char * | name, |
| AppProto | alproto, | ||
| uint32_t | dir, | ||
| uint8_t | type, | ||
| uint8_t | progress, | ||
| InspectEngineFuncPtr | Callback2, | ||
| InspectionBufferGetDataPtr | GetData | ||
| ) |
register an app inspection engine for a tx type
| type | the tx type |
Definition at line 299 of file detect-engine.c.
Referenced by DetectFileRegisterFileProtocols(), DetectRegisterAppLayerHookLists(), and SCDetectHelperBufferProgressRegisterSubState().

| void DetectAppLayerMultiRegister | ( | const char * | name, |
| AppProto | alproto, | ||
| uint32_t | dir, | ||
| uint8_t | progress, | ||
| InspectionMultiBufferGetDataPtr | GetData, | ||
| int | priority | ||
| ) |
Definition at line 2330 of file detect-engine.c.
| void DetectAppLayerMultiRegisterSubState | ( | const char * | name, |
| AppProto | alproto, | ||
| uint32_t | dir, | ||
| uint8_t | sub_state, | ||
| uint8_t | progress, | ||
| InspectionMultiBufferGetDataPtr | GetData, | ||
| int | priority | ||
| ) |
Definition at line 2318 of file detect-engine.c.
| bool DetectBufferIsPresent | ( | const Signature * | s, |
| const uint32_t | buf_id | ||
| ) |
Definition at line 1698 of file detect-engine.c.
References SignatureInitData_::buffer_index, SignatureInitData_::buffers, SignatureInitDataBuffer_::id, and Signature_::init_data.
| void DetectBufferTypeCloseRegistration | ( | void | ) |
Definition at line 1842 of file detect-engine.c.
References BUG_ON.
| int DetectBufferTypeGetByName | ( | const char * | name | ) |
Definition at line 1453 of file detect-engine.c.
Referenced by DetectEngineAppInspectionEngine2Signature(), DetectFrameMpmRegister(), and DetectPktInspectEngineRegister().

| int DetectBufferTypeMaxId | ( | void | ) |
Definition at line 1210 of file detect-engine.c.
| int DetectBufferTypeRegister | ( | const char * | name | ) |
Definition at line 1389 of file detect-engine.c.
References BUG_ON.
Referenced by DetectPktInspectEngineRegister(), SCDetectHelperBufferProgressRegister(), and SCDetectHelperBufferProgressRegisterSubState().

| void DetectBufferTypeRegisterSetupCallback | ( | const char * | name, |
| void(*)(const DetectEngineCtx *, Signature *, const DetectBufferType *) | Callback | ||
| ) |
Definition at line 1658 of file detect-engine.c.
References BUG_ON.
Referenced by SCDetectRegisterBufferLowerMd5Callbacks().

| void DetectBufferTypeRegisterValidateCallback | ( | const char * | name, |
| bool(*)(const Signature *, const char **sigerror, const DetectBufferType *) | ValidateCallback | ||
| ) |
Definition at line 1676 of file detect-engine.c.
References BUG_ON.
Referenced by SCDetectRegisterBufferLowerMd5Callbacks().

| void DetectBufferTypeSetDescriptionByName | ( | const char * | name, |
| const char * | desc | ||
| ) |
Definition at line 1550 of file detect-engine.c.
References BUG_ON.
| void DetectBufferTypeSetRunAlways | ( | const char * | name | ) |
Definition at line 1561 of file detect-engine.c.
| void DetectBufferTypeSupportsFrames | ( | const char * | name | ) |
Definition at line 1413 of file detect-engine.c.
References BUG_ON.
Referenced by DetectFrameMpmRegister().

| void DetectBufferTypeSupportsMpm | ( | const char * | name | ) |
Definition at line 1433 of file detect-engine.c.
References BUG_ON.
Referenced by DetectFrameMpmRegister().

| void DetectBufferTypeSupportsMultiInstance | ( | const char * | name | ) |
Definition at line 1403 of file detect-engine.c.
References BUG_ON.
| void DetectBufferTypeSupportsPacket | ( | const char * | name | ) |
Definition at line 1423 of file detect-engine.c.
References BUG_ON.
| void DetectBufferTypeSupportsTransformations | ( | const char * | name | ) |
Definition at line 1443 of file detect-engine.c.
References BUG_ON.
Referenced by DetectFrameMpmRegister().

| int DetectEngineAddToMaster | ( | DetectEngineCtx * | de_ctx | ) |
Definition at line 5108 of file detect-engine.c.
References de_ctx, and SCLogDebug.
| const char* DetectEngineAppHookToName | ( | const AppProto | p, |
| const uint8_t | sub_state, | ||
| const uint8_t | state, | ||
| const uint8_t | direction | ||
| ) |
| direction | STREAM_TOSERVER or STREAM_TOCLIENT |
Definition at line 846 of file detect-engine.c.
References AppLayerParserGetStateNameById(), AppLayerParserGetStateProgressCompletionStatus(), AppLayerParserGetSubStateProgressName(), AppLayerParserSupportsSubStates(), BUG_ON, name, and p.
Referenced by DetectEngineAppHookToSmlist().


| int DetectEngineAppHookToSmlist | ( | const AppProto | p, |
| const uint8_t | sub_state, | ||
| const uint8_t | state, | ||
| const uint8_t | direction | ||
| ) |
get the sm_list for a app hook
| sub_state | sub_state to use or 0 if not in use |
Definition at line 885 of file detect-engine.c.
References AppProtoToStringRaw(), DetectEngineAppHookToName(), name, p, and SCLogError.
Referenced by DetectEngineAppInspectionEngine2Signature().


| int DetectEngineAppInspectionEngine2Signature | ( | DetectEngineCtx * | de_ctx, |
| Signature * | s | ||
| ) |
Definition at line 939 of file detect-engine.c.
References DetectEngineAppInspectionEngine_::alproto, SignatureHook_::app, Signature_::app_progress_hook, SignatureInitData_::buffer_index, BUG_ON, DE_STATE_FLAG_BASE, DetectBufferTypeGetByName(), DetectEngineAppHookToSmlist(), Signature_::flags, SignatureInitData_::hook, Signature_::id, Signature_::init_data, SignatureInitData_::mpm_sm, SignatureInitData_::mpm_sm_list, SCLogDebug, SIG_FLAG_FW_HOOK_LTE, SIG_FLAG_TOCLIENT, SIG_FLAG_TOSERVER, and SignatureHook_::t.

| void DetectEngineAppInspectionEngineSignatureFree | ( | DetectEngineCtx * | de_ctx, |
| Signature * | s | ||
| ) |
free app inspect engines for a signature
For lists that are registered multiple times, like http_header and http_cookie, making the engines owner of the lists is complicated. Multiple engines in a sig may be pointing to the same list. To address this the 'free' code needs to be extra careful about not double freeing, so it takes an approach to first fill an array of the to-free pointers before freeing them.
Definition at line 1104 of file detect-engine.c.
References Signature_::app_inspect, BUG_ON, SigMatchData_::ctx, de_ctx, Signature_::frame_inspect, SigTableElmt_::Free, SigMatchData_::is_last, next, DetectEngineAppInspectionEngine_::next, DetectEnginePktInspectionEngine::next, DetectEngineFrameInspectionEngine::next, Signature_::pkt_inspect, SCFree, sigmatch_table, DetectEngineAppInspectionEngine_::smd, DetectEnginePktInspectionEngine::smd, DetectEngineFrameInspectionEngine::smd, and SigMatchData_::type.
| void DetectEngineBufferRunSetupCallback | ( | const DetectEngineCtx * | de_ctx, |
| const int | id, | ||
| Signature * | s | ||
| ) |
Definition at line 1668 of file detect-engine.c.
References de_ctx, DetectEngineBufferTypeGetById(), and DetectBufferType_::SetupCallback.

| bool DetectEngineBufferRunValidateCallback | ( | const DetectEngineCtx * | de_ctx, |
| const int | id, | ||
| const Signature * | s, | ||
| const char ** | sigerror | ||
| ) |
Definition at line 1687 of file detect-engine.c.
References DetectEngineTransforms::cnt, de_ctx, DetectEngineBufferTypeGetById(), DetectBufferType_::transforms, and DetectBufferType_::ValidateCallback.

| const DetectBufferType* DetectEngineBufferTypeGetById | ( | const DetectEngineCtx * | de_ctx, |
| const int | id | ||
| ) |
Definition at line 1473 of file detect-engine.c.
References DetectEngineCtx_::buffer_type_hash_id, de_ctx, HashListTableLookup(), and DetectBufferType_::id.
Referenced by DetectEngineBufferRunSetupCallback(), DetectEngineBufferRunValidateCallback(), DetectEngineBufferTypeGetByIdTransforms(), DetectEngineBufferTypeGetDescriptionById(), DetectEngineBufferTypeGetNameById(), DetectEngineBufferTypeSupportsFramesGetById(), DetectEngineBufferTypeSupportsMpmGetById(), DetectEngineBufferTypeSupportsMultiInstanceGetById(), DetectEngineBufferTypeSupportsPacketGetById(), and DetectEngineBufferTypeValidateTransform().


| int DetectEngineBufferTypeGetByIdTransforms | ( | DetectEngineCtx * | de_ctx, |
| const int | id, | ||
| TransformData * | transforms, | ||
| uint8_t | transform_cnt | ||
| ) |
Definition at line 1849 of file detect-engine.c.
References DetectEngineTransforms::cnt, de_ctx, DetectEngineBufferTypeGetById(), DetectBufferType_::name, SCLogDebug, SCLogError, strlcpy(), DetectBufferType_::supports_transforms, DetectEngineTransforms::transforms, and DetectBufferType_::transforms.
Referenced by DetectBufferGetActiveList().


| const char* DetectEngineBufferTypeGetDescriptionById | ( | const DetectEngineCtx * | de_ctx, |
| const int | id | ||
| ) |
Definition at line 1581 of file detect-engine.c.
References de_ctx, DetectBufferType_::description, and DetectEngineBufferTypeGetById().
Referenced by EngineAnalysisFP().


| const char* DetectEngineBufferTypeGetNameById | ( | const DetectEngineCtx * | de_ctx, |
| const int | id | ||
| ) |
Definition at line 1483 of file detect-engine.c.
References de_ctx, DetectEngineBufferTypeGetById(), and DetectBufferType_::name.
Referenced by DetectEngineBufferTypeSetRunAlways(), DumpPatterns(), EngineAnalysisFP(), and EngineAnalysisRules2().


| int DetectEngineBufferTypeRegister | ( | DetectEngineCtx * | de_ctx, |
| const char * | name | ||
| ) |
Definition at line 1540 of file detect-engine.c.
Referenced by DetectEngineFrameInspectEngineRegister(), and DetectEngineFrameMpmRegister().

| int DetectEngineBufferTypeRegisterWithFrameEngines | ( | DetectEngineCtx * | de_ctx, |
| const char * | name, | ||
| const int | direction, | ||
| const AppProto | alproto, | ||
| const uint8_t | frame_type | ||
| ) |
Definition at line 1506 of file detect-engine.c.
| void DetectEngineBufferTypeSetRunAlways | ( | DetectEngineCtx * | de_ctx, |
| const int | id | ||
| ) |
Definition at line 1570 of file detect-engine.c.
References de_ctx, DetectEngineBufferTypeGetNameById(), and name.

| void DetectEngineBufferTypeSupportsFrames | ( | DetectEngineCtx * | de_ctx, |
| const char * | name | ||
| ) |
Definition at line 1590 of file detect-engine.c.
Referenced by DetectEngineFrameMpmRegister().

| bool DetectEngineBufferTypeSupportsFramesGetById | ( | const DetectEngineCtx * | de_ctx, |
| const int | id | ||
| ) |
Definition at line 1649 of file detect-engine.c.
References de_ctx, DetectEngineBufferTypeGetById(), DetectBufferType_::frame, and SCLogDebug.

| void DetectEngineBufferTypeSupportsMpm | ( | DetectEngineCtx * | de_ctx, |
| const char * | name | ||
| ) |
Definition at line 1606 of file detect-engine.c.
Referenced by DetectEngineFrameMpmRegister().

| bool DetectEngineBufferTypeSupportsMpmGetById | ( | const DetectEngineCtx * | de_ctx, |
| const int | id | ||
| ) |
Definition at line 1640 of file detect-engine.c.
References de_ctx, DetectEngineBufferTypeGetById(), DetectBufferType_::mpm, and SCLogDebug.
Referenced by DetectGetLastSMFromMpmLists(), and FastPatternSupportEnabledForSigMatchList().


| bool DetectEngineBufferTypeSupportsMultiInstanceGetById | ( | const DetectEngineCtx * | de_ctx, |
| const int | id | ||
| ) |
Definition at line 1622 of file detect-engine.c.
References BOOL2STR, de_ctx, DetectEngineBufferTypeGetById(), DetectBufferType_::multi_instance, and SCLogDebug.
Referenced by DetectBufferGetActiveList().


| void DetectEngineBufferTypeSupportsPacket | ( | DetectEngineCtx * | de_ctx, |
| const char * | name | ||
| ) |
Definition at line 1598 of file detect-engine.c.
| bool DetectEngineBufferTypeSupportsPacketGetById | ( | const DetectEngineCtx * | de_ctx, |
| const int | id | ||
| ) |
Definition at line 1631 of file detect-engine.c.
References de_ctx, DetectEngineBufferTypeGetById(), DetectBufferType_::packet, and SCLogDebug.

| void DetectEngineBufferTypeSupportsTransformations | ( | DetectEngineCtx * | de_ctx, |
| const char * | name | ||
| ) |
Definition at line 1614 of file detect-engine.c.
Referenced by DetectEngineFrameMpmRegister().

| bool DetectEngineBufferTypeValidateTransform | ( | DetectEngineCtx * | de_ctx, |
| int | sm_list, | ||
| const uint8_t * | content, | ||
| uint16_t | content_len, | ||
| const char ** | namestr | ||
| ) |
Check content byte array compatibility with transforms.
The "content" array is presented to the transforms so that each transform may validate that it's compatible with the transform.
When a transform indicates the byte array is incompatible, none of the subsequent transforms, if any, are invoked. This means the first validation failure terminates the loop.
| de_ctx | Detection engine context. |
| sm_list | The SM list id. |
| content | The byte array being validated |
| namestr | returns the name of the transform that is incompatible with content. |
| true | (false) If any of the transforms indicate the byte array is (is not) compatible. |
Definition at line 1726 of file detect-engine.c.
References BUG_ON, DetectEngineTransforms::cnt, de_ctx, DetectEngineBufferTypeGetById(), SigTableElmt_::name, TransformData_::options, sigmatch_table, TransformData_::transform, DetectEngineTransforms::transforms, DetectBufferType_::transforms, and SigTableElmt_::TransformValidate.
Referenced by DetectContentSetup().


| void DetectEngineBumpVersion | ( | void | ) |
Definition at line 4172 of file detect-engine.c.
| void DetectEngineClearMaster | ( | void | ) |
Definition at line 5208 of file detect-engine.c.
Referenced by GlobalsDestroy().

| void DetectEngineCtxFree | ( | DetectEngineCtx * | de_ctx | ) |
Free a DetectEngineCtx::
| de_ctx | DetectEngineCtx:: to be freed |
Definition at line 2913 of file detect-engine.c.
References MpmTableElmt_::ConfigDeinit, de_ctx, DetectEngineFreeFastPatternList(), DetectParseDupSigHashFree(), DetectEngineCtx_::filedata_config, DetectEngineCtx_::mpm_cfg, DetectEngineCtx_::mpm_matcher, mpm_table, MpmFactoryDeRegisterAllMpmCtxProfiles(), MpmStoreFree(), DetectEngineCtx_::profile_keyword_ctx, DetectEngineCtx_::profile_sgh_ctx, SCClassConfDeInitContext(), SCFree, SCProfilingKeywordDestroyCtx(), SCProfilingPrefilterDestroyCtx(), SCProfilingSghDestroyCtx(), SCRConfDeInitContext(), SCSigSignatureOrderingModuleCleanup(), DetectEngineCtx_::sig_array, SigCleanSignatures(), SigGroupCleanup(), SigGroupHeadHashFree(), DetectEngineCtx_::sm_types_prefilter, DetectEngineCtx_::sm_types_silent_error, DetectEngineCtx_::spm_global_thread_ctx, and SpmDestroyGlobalThreadCtx().

| DetectEngineCtx* DetectEngineCtxInit | ( | void | ) |
Definition at line 2874 of file detect-engine.c.
Referenced by DetectEngineCtxInitWithPrefix().

| DetectEngineCtx* DetectEngineCtxInitStubForDD | ( | void | ) |
Definition at line 2869 of file detect-engine.c.
| DetectEngineCtx* DetectEngineCtxInitStubForMT | ( | void | ) |
Definition at line 2864 of file detect-engine.c.
| DetectEngineCtx* DetectEngineCtxInitWithPrefix | ( | const char * | prefix, |
| uint32_t | tenant_id | ||
| ) |
Definition at line 2879 of file detect-engine.c.
References DetectEngineCtxInit().

| void DetectEngineDeReference | ( | DetectEngineCtx ** | de_ctx | ) |
Definition at line 5084 of file detect-engine.c.
References de_ctx, and DEBUG_VALIDATE_BUG_ON.
Referenced by DetectEngineMpmCacheService(), GlobalsDestroy(), and SCDetectEngineRegisterRateFilterCallback().

| int DetectEngineEnabled | ( | void | ) |
Check if detection is enabled.
| bool | true or false |
Definition at line 4148 of file detect-engine.c.
Referenced by SuricataMainLoop().

| void DetectEngineFrameInspectEngineRegister | ( | DetectEngineCtx * | de_ctx, |
| const char * | name, | ||
| int | dir, | ||
| InspectionBufferFrameInspectFunc | Callback, | ||
| AppProto | alproto, | ||
| uint8_t | type | ||
| ) |
register inspect engine at start up time
Definition at line 480 of file detect-engine.c.
References DetectEngineFrameInspectionEngine::alproto, BUG_ON, DetectEngineFrameInspectionEngine::Callback, de_ctx, DETECT_SM_LIST_MATCH, DetectEngineBufferTypeRegister(), DetectEngineFrameInspectionEngine::dir, FatalError, DetectEngineCtx_::frame_inspect_engines, name, SCCalloc, SCLogError, SIG_FLAG_TOSERVER, DetectEngineFrameInspectionEngine::sm_list, DetectEngineFrameInspectionEngine::sm_list_base, type, DetectEngineFrameInspectionEngine::type, unlikely, and DetectEngineFrameInspectionEngine::v1.

| DetectEngineCtx* DetectEngineGetByTenantId | ( | uint32_t | tenant_id | ) |
Definition at line 5058 of file detect-engine.c.
| DetectEngineCtx* DetectEngineGetCurrent | ( | void | ) |
Definition at line 4181 of file detect-engine.c.
Referenced by DetectEngineMpmCacheService(), DetectEngineThreadCtxInit(), GlobalsDestroy(), and SCDetectEngineRegisterRateFilterCallback().

| uint32_t DetectEngineGetVersion | ( | void | ) |
Definition at line 4162 of file detect-engine.c.
References version.
| uint8_t DetectEngineInspectBufferGeneric | ( | DetectEngineCtx * | de_ctx, |
| DetectEngineThreadCtx * | det_ctx, | ||
| const DetectEngineAppInspectionEngine * | engine, | ||
| const Signature * | s, | ||
| Flow * | f, | ||
| uint8_t | flags, | ||
| void * | alstate, | ||
| void * | txv, | ||
| uint64_t | tx_id | ||
| ) |
Do the content inspection & validation for a signature.
| de_ctx | Detection engine context |
| det_ctx | Detection engine thread context |
| s | Signature to inspect |
| f | Flow |
| flags | app layer flags |
| state | App layer state |
| 0 | no match. |
| 1 | match. |
| 2 | Sig can't match. |
Definition at line 2268 of file detect-engine.c.
References SCLogDebug, and DetectEngineAppInspectionEngine_::sm_list.
| uint8_t DetectEngineInspectBufferSingle | ( | DetectEngineCtx * | de_ctx, |
| DetectEngineThreadCtx * | det_ctx, | ||
| const DetectEngineAppInspectionEngine * | engine, | ||
| const Signature * | s, | ||
| Flow * | f, | ||
| uint8_t | flags, | ||
| void * | alstate, | ||
| void * | txv, | ||
| uint64_t | tx_id | ||
| ) |
Do the content inspection & validation for a signature.
| de_ctx | Detection engine context |
| det_ctx | Detection engine thread context |
| s | Signature to inspect |
| f | Flow |
| flags | app layer flags |
| state | App layer state |
| 0 | no match. |
| 1 | match. |
| 2 | Sig can't match. |
Definition at line 2208 of file detect-engine.c.
References SCLogDebug, and DetectEngineAppInspectionEngine_::sm_list.
| uint8_t DetectEngineInspectGenericList | ( | DetectEngineCtx * | , |
| DetectEngineThreadCtx * | , | ||
| const struct DetectEngineAppInspectionEngine_ * | , | ||
| const Signature * | , | ||
| Flow * | , | ||
| uint8_t | , | ||
| void * | , | ||
| void * | , | ||
| uint64_t | |||
| ) |
Definition at line 2156 of file detect-engine.c.
References SigMatchData_::ctx, DETECT_ENGINE_INSPECT_SIG_NO_MATCH, f, flags, SigTableElmt_::flags, KEYWORD_PROFILING_END, KEYWORD_PROFILING_START, SCLogDebug, SIGMATCH_STATEFUL, sigmatch_table, DetectEngineAppInspectionEngine_::smd, and SigMatchData_::type.
Referenced by DetectRegisterAppLayerHookLists(), SCDetectHelperBufferProgressRegister(), and SCDetectHelperBufferProgressRegisterSubState().

| uint8_t DetectEngineInspectMultiBufferGeneric | ( | DetectEngineCtx * | de_ctx, |
| DetectEngineThreadCtx * | det_ctx, | ||
| const DetectEngineAppInspectionEngine * | engine, | ||
| const Signature * | s, | ||
| Flow * | f, | ||
| uint8_t | flags, | ||
| void * | alstate, | ||
| void * | txv, | ||
| uint64_t | tx_id | ||
| ) |
Definition at line 2381 of file detect-engine.c.
References de_ctx, DETECT_ENGINE_CONTENT_INSPECTION_MODE_STATE, DETECT_ENGINE_INSPECT_SIG_MATCH, DetectEngineContentInspectionBuffer(), DetectGetMultiData(), f, flags, DetectEngineAppInspectionEngine_::GetMultiData, InspectionBuffer::inspect, DetectEngineAppInspectionEngine_::mpm, DetectEngineAppInspectionEngine_::sm_list, DetectEngineAppInspectionEngine_::smd, DetectEngineAppInspectionEngine_::transforms, and DetectEngineAppInspectionEngine_::v2.

| int DetectEngineInspectPktBufferGeneric | ( | DetectEngineThreadCtx * | det_ctx, |
| const DetectEnginePktInspectionEngine * | engine, | ||
| const Signature * | s, | ||
| Packet * | p, | ||
| uint8_t * | _alert_flags | ||
| ) |
Do the content inspection & validation for a signature.
| de_ctx | Detection engine context |
| det_ctx | Detection engine thread context |
| s | Signature to inspect |
| p | Packet |
| 0 | no match. |
| 1 | match. |
Definition at line 2428 of file detect-engine.c.
References DetectEngineThreadCtx_::de_ctx, DETECT_CI_FLAGS_END, DETECT_CI_FLAGS_START, DETECT_ENGINE_CONTENT_INSPECTION_MODE_HEADER, DETECT_ENGINE_INSPECT_SIG_MATCH, DETECT_ENGINE_INSPECT_SIG_NO_MATCH, DetectEngineContentInspection(), InspectionBuffer::flags, Packet_::flow, DetectEnginePktInspectionEngine::GetData, InspectionBuffer::inspect, InspectionBuffer::inspect_len, DetectEnginePktInspectionEngine::mpm, p, SCLogDebug, DetectEnginePktInspectionEngine::sm_list, DetectEnginePktInspectionEngine::smd, DetectEnginePktInspectionEngine::transforms, unlikely, and DetectEnginePktInspectionEngine::v1.

| int DetectEngineLoadTenantBlocking | ( | uint32_t | tenant_id, |
| const char * | yaml | ||
| ) |
Load a tenant and wait for loading to complete.
Definition at line 4477 of file detect-engine.c.
| int DetectEngineMoveToFreeList | ( | DetectEngineCtx * | de_ctx | ) |
Definition at line 5168 of file detect-engine.c.
Referenced by GlobalsDestroy().

| void DetectEngineMpmCacheService | ( | uint32_t | op_flags | ) |
Definition at line 2713 of file detect-engine.c.
References MpmConfig_::cache_dir_path, MpmConfig_::cache_stats, MpmTableElmt_::CachePrune, MpmTableElmt_::CacheRuleset, MpmTableElmt_::CacheStatsDeinit, MpmTableElmt_::CacheStatsInit, MpmTableElmt_::CacheStatsPrint, de_ctx, DETECT_ENGINE_MPM_CACHE_OP_PRUNE, DETECT_ENGINE_MPM_CACHE_OP_SAVE, DetectEngineDeReference(), DetectEngineGetCurrent(), DetectEngineCtx_::mpm_cfg, DetectEngineCtx_::mpm_matcher, and mpm_table.

| bool DetectEngineMpmCachingEnabled | ( | void | ) |
Definition at line 2684 of file detect-engine.c.
References SCConfGetBool().
Referenced by DetectEngineMpmCachingGetPath().


| const char* DetectEngineMpmCachingGetPath | ( | void | ) |
Definition at line 2693 of file detect-engine.c.
References DetectEngineMpmCachingEnabled(), SCConfGet(), and SCLogInfo.

| int DetectEngineMTApply | ( | void | ) |
Definition at line 5367 of file detect-engine.c.
| bool DetectEngineMultiTenantEnabled | ( | void | ) |
Definition at line 4218 of file detect-engine.c.
| int DetectEngineMultiTenantSetup | ( | const bool | unix_socket | ) |
setup multi-detect / multi-tenancy
See if MT is enabled. If so, setup the selector, tenants and mappings. Tenants and mappings are optional, and can also dynamically be added and removed from the unix socket.
Definition at line 4697 of file detect-engine.c.
References TENANT_SELECTOR_UNKNOWN.
| int DetectEngineMustParseMetadata | ( | void | ) |
Definition at line 5434 of file detect-engine.c.
Referenced by DetectMetadataHashInit().

| bool DetectEnginePktInspectionRun | ( | ThreadVars * | tv, |
| DetectEngineThreadCtx * | det_ctx, | ||
| const Signature * | s, | ||
| Flow * | f, | ||
| Packet * | p, | ||
| uint8_t * | alert_flags | ||
| ) |
Definition at line 1999 of file detect-engine.c.
References DetectEnginePktInspectionEngine::Callback, DETECT_ENGINE_INSPECT_SIG_MATCH, Signature_::id, DetectEnginePktInspectionEngine::next, p, Signature_::pkt_inspect, SCEnter, SCLogDebug, and DetectEnginePktInspectionEngine::v1.
| int DetectEnginePktInspectionSetup | ( | Signature * | s | ) |
Definition at line 2047 of file detect-engine.c.
References DETECT_SM_LIST_PMATCH, Signature_::init_data, SignatureInitData_::init_flags, SIG_FLAG_INIT_STATE_MATCH, and Signature_::sm_arrays.
| void DetectEnginePruneFreeList | ( | void | ) |
Definition at line 5178 of file detect-engine.c.
| DetectEngineCtx* DetectEngineReference | ( | DetectEngineCtx * | ) |
Definition at line 4204 of file detect-engine.c.
References de_ctx, and DetectEngineCtx_::ref_cnt.
Referenced by DetectEngineThreadCtxInitForReload().

| void DetectEngineRegisterTests | ( | void | ) |
Definition at line 5846 of file detect-engine.c.
References UtRegisterTest().

| int DetectEngineReload | ( | const SCInstance * | suri | ) |
Reload the detection engine.
| filename | YAML file to load for the detect config |
| -1 | error |
| 0 | ok |
Definition at line 5235 of file detect-engine.c.
References SCInstance_::conf_filename, and SCLogNotice.
Referenced by SuricataMainLoop().

| int DetectEngineReloadIsIdle | ( | void | ) |
Definition at line 2117 of file detect-engine.c.
References SCMutexLock.
| int DetectEngineReloadIsStart | ( | void | ) |
Definition at line 2097 of file detect-engine.c.
References SCMutexLock.
Referenced by SuricataMainLoop().

| void DetectEngineReloadSetIdle | ( | void | ) |
Definition at line 2109 of file detect-engine.c.
References SCMutexLock.
Referenced by SuricataMainLoop().

| int DetectEngineReloadStart | ( | void | ) |
Definition at line 2083 of file detect-engine.c.
References SCMutexLock.
Referenced by SuricataMainLoop().

| int DetectEngineReloadTenantBlocking | ( | uint32_t | tenant_id, |
| const char * | yaml, | ||
| int | reload_cnt | ||
| ) |
Reload a tenant and wait for loading to complete.
Definition at line 4491 of file detect-engine.c.
| int DetectEngineReloadTenantsBlocking | ( | const int | reload_cnt | ) |
Reload all tenants and wait for loading to complete.
Definition at line 4505 of file detect-engine.c.
| void DetectEngineResetMaxSigId | ( | DetectEngineCtx * | ) |
Definition at line 3337 of file detect-engine.c.
References de_ctx, and DetectEngineCtx_::signum.
Referenced by SigCleanSignatures().

| void DetectEngineSetParseMetadata | ( | void | ) |
Definition at line 5424 of file detect-engine.c.
| int DetectEngineTenantRegisterLivedev | ( | uint32_t | tenant_id, |
| int | device_id | ||
| ) |
Definition at line 5019 of file detect-engine.c.
| int DetectEngineTenantRegisterPcapFile | ( | uint32_t | tenant_id | ) |
Definition at line 5041 of file detect-engine.c.
References SCLogInfo, and TENANT_SELECTOR_DIRECT.
| int DetectEngineTenantRegisterTunnel | ( | uint32_t | tenant_id, |
| uint16_t | tunnel_id | ||
| ) |
Definition at line 5025 of file detect-engine.c.
| int DetectEngineTenantRegisterVlanId | ( | uint32_t | tenant_id, |
| uint16_t | vlan_id | ||
| ) |
Definition at line 5031 of file detect-engine.c.
| int DetectEngineTenantUnregisterPcapFile | ( | uint32_t | tenant_id | ) |
Definition at line 5047 of file detect-engine.c.
References SCLogInfo, and TENANT_SELECTOR_DIRECT.
| int DetectEngineTenantUnregisterVlanId | ( | uint32_t | tenant_id, |
| uint16_t | vlan_id | ||
| ) |
Definition at line 5036 of file detect-engine.c.
| TmEcode DetectEngineThreadCtxDeinit | ( | ThreadVars * | , |
| void * | |||
| ) |
Definition at line 3944 of file detect-engine.c.
References HashTableFree(), DetectEngineThreadCtx_::mt_det_ctxs_hash, SCLogWarning, and TM_ECODE_OK.
Referenced by DetectEngineThreadCtxInit(), UTHMatchPackets(), UTHMatchPacketsWithResults(), UTHPacketMatchSig(), and UTHPacketMatchSigMpm().


| int DetectEngineThreadCtxGetJsonContext | ( | DetectEngineThreadCtx * | det_ctx | ) |
Definition at line 5559 of file detect-engine.c.
References DetectEngineThreadCtx_::json_content, DetectEngineThreadCtx_::json_content_capacity, DetectEngineThreadCtx_::json_content_len, SCLogDebug, SCRealloc, SIG_JSON_CONTENT_ARRAY_LEN, and unlikely.
| TmEcode DetectEngineThreadCtxInit | ( | ThreadVars * | tv, |
| void * | initdata, | ||
| void ** | data | ||
| ) |
initialize thread specific detection engine context
| tv | ThreadVars for this thread |
| initdata | pointer to de_ctx |
| data[out] | pointer to store our thread detection ctx |
| TM_ECODE_OK | if all went well |
| TM_ECODE_FAILED | on serious errors |
alert counter setup
Definition at line 3666 of file detect-engine.c.
References DetectEngineThreadCtx_::de_ctx, DETECT_ENGINE_TYPE_NORMAL, DETECT_ENGINE_TYPE_TENANT, DetectEngineGetCurrent(), DetectEngineThreadCtxDeinit(), RunmodeIsUnittests(), SCCalloc, TM_ECODE_FAILED, tv, DetectEngineThreadCtx_::tv, DetectEngineCtx_::type, and unlikely.
Referenced by UTHMatchPackets(), UTHMatchPacketsWithResults(), UTHPacketMatchSig(), and UTHPacketMatchSigMpm().


| DetectEngineThreadCtx* DetectEngineThreadCtxInitForReload | ( | ThreadVars * | tv, |
| DetectEngineCtx * | new_de_ctx, | ||
| int | mt | ||
| ) |
alert counter setup
Definition at line 3773 of file detect-engine.c.
References DetectEngineThreadCtx_::de_ctx, DETECT_ENGINE_TYPE_NORMAL, DETECT_ENGINE_TYPE_TENANT, DetectEngineReference(), SCCalloc, SCFree, DetectEngineCtx_::tenant_id, DetectEngineThreadCtx_::tenant_id, tv, DetectEngineThreadCtx_::tv, DetectEngineCtx_::type, and unlikely.

| void DetectEngineUnsetParseMetadata | ( | void | ) |
Definition at line 5429 of file detect-engine.c.
| InspectionBuffer* DetectGetMultiData | ( | struct DetectEngineThreadCtx_ * | det_ctx, |
| const DetectEngineTransforms * | transforms, | ||
| Flow * | f, | ||
| const uint8_t | flow_flags, | ||
| void * | txv, | ||
| const int | list_id, | ||
| uint32_t | index, | ||
| InspectionMultiBufferGetDataPtr | GetBuf | ||
| ) |
Definition at line 2357 of file detect-engine.c.
References DETECT_CI_FLAGS_SINGLE, InspectionBuffer::flags, InspectionBuffer::initialized, InspectionBufferMultipleForListGet(), InspectionBufferSetupMulti(), and InspectionBufferSetupMultiEmpty().
Referenced by DetectEngineInspectMultiBufferGeneric().


| InspectionBuffer* DetectGetSingleData | ( | struct DetectEngineThreadCtx_ * | det_ctx, |
| const DetectEngineTransforms * | transforms, | ||
| Flow * | f, | ||
| const uint8_t | flow_flags, | ||
| void * | txv, | ||
| const int | list_id, | ||
| InspectionSingleBufferGetDataPtr | GetBuf | ||
| ) |
Definition at line 2340 of file detect-engine.c.
References InspectionBuffer::inspect, SCInspectionBufferGet(), and SCInspectionBufferSetupAndApplyTransforms().

| void DetectLowerSetupCallback | ( | const DetectEngineCtx * | de_ctx, |
| Signature * | s, | ||
| const DetectBufferType * | map | ||
| ) |
Definition at line 5515 of file detect-engine.c.
References SignatureInitData_::buffer_index, SignatureInitData_::buffers, DetectContentData_::content, DetectContentData_::content_len, SigMatch_::ctx, de_ctx, DETECT_CONTENT, SignatureInitDataBuffer_::head, DetectBufferType_::id, SignatureInitDataBuffer_::id, Signature_::init_data, SigMatch_::next, DetectContentData_::spm_ctx, DetectEngineCtx_::spm_global_thread_ctx, SpmDestroyCtx(), SpmInitCtx(), SigMatch_::type, and u8_tolower.
Referenced by SCDetectRegisterBufferLowerMd5Callbacks().


| bool DetectMd5ValidateCallback | ( | const Signature * | s, |
| const char ** | sigerror, | ||
| const DetectBufferType * | map | ||
| ) |
Definition at line 5474 of file detect-engine.c.
References SignatureInitData_::buffer_index, SignatureInitData_::buffers, DetectContentData_::content, DetectContentData_::content_len, SigMatch_::ctx, DETECT_CONTENT, DETECT_CONTENT_NOCASE, DetectContentData_::flags, SignatureInitDataBuffer_::head, DetectBufferType_::id, SignatureInitDataBuffer_::id, Signature_::id, Signature_::init_data, DetectBufferType_::name, SigMatch_::next, SCLogError, SCLogWarning, and SigMatch_::type.
Referenced by SCDetectRegisterBufferLowerMd5Callbacks().

| void DetectPktInspectEngineRegister | ( | const char * | name, |
| InspectionBufferGetPktDataPtr | GetPktData, | ||
| InspectionBufferPktInspectFunc | Callback | ||
| ) |
register inspect engine at start up time
Definition at line 159 of file detect-engine.c.
References BUG_ON, DetectEnginePktInspectionEngine::Callback, DETECT_SM_LIST_MATCH, DetectBufferTypeGetByName(), DetectBufferTypeRegister(), FatalError, DetectEnginePktInspectionEngine::GetData, name, SCCalloc, SCLogError, DetectEnginePktInspectionEngine::sm_list, DetectEnginePktInspectionEngine::sm_list_base, unlikely, and DetectEnginePktInspectionEngine::v1.

| const char* DetectSigmatchListEnumToString | ( | enum DetectSigmatchListEnum | type | ) |
Definition at line 5439 of file detect-engine.c.
References DETECT_SM_LIST_BASE64_DATA, DETECT_SM_LIST_MATCH, DETECT_SM_LIST_MAX, DETECT_SM_LIST_PMATCH, DETECT_SM_LIST_POSTMATCH, DETECT_SM_LIST_SUPPRESS, DETECT_SM_LIST_THRESHOLD, DETECT_SM_LIST_TMATCH, and type.
| const char* DetectTableToString | ( | enum DetectTable | table | ) |
Definition at line 134 of file detect-engine.c.
References DETECT_TABLE_APP_FILTER, DETECT_TABLE_APP_TD, DETECT_TABLE_NOT_SET, DETECT_TABLE_PACKET_FILTER, DETECT_TABLE_PACKET_PRE_FLOW, DETECT_TABLE_PACKET_PRE_STREAM, and DETECT_TABLE_PACKET_TD.