suricata
|
#include "queue.h"
Go to the source code of this file.
Data Structures | |
struct | ConfNode_ |
Macros | |
#define | DEFAULT_LOG_DIR "/var/log/suricata" |
Typedefs | |
typedef struct ConfNode_ | ConfNode |
Functions | |
void | ConfInit (void) |
Initialize the configuration system. More... | |
void | ConfDeInit (void) |
De-initializes the configuration system. More... | |
ConfNode * | ConfGetRootNode (void) |
Get the root configuration node. More... | |
int | ConfGet (const char *name, const char **vptr) |
Retrieve the value of a configuration node. More... | |
int | ConfGetValue (const char *name, const char **vptr) |
Retrieve the value of a configuration node. More... | |
int | ConfGetInt (const char *name, intmax_t *val) |
Retrieve a configuration value as an integer. More... | |
int | ConfGetBool (const char *name, int *val) |
Retrieve a configuration value as an boolen. More... | |
int | ConfGetDouble (const char *name, double *val) |
Retrieve a configuration value as a double. More... | |
int | ConfGetFloat (const char *name, float *val) |
Retrieve a configuration value as a float. More... | |
int | ConfSet (const char *name, const char *val) |
Set a configuration value. More... | |
int | ConfSetFromString (const char *input, int final) |
Set a configuration parameter from a string. More... | |
int | ConfSetFinal (const char *name, const char *val) |
Set a final configuration value. More... | |
void | ConfDump (void) |
Dump configuration to stdout. More... | |
void | ConfNodeDump (const ConfNode *node, const char *prefix) |
Dump a configuration node and all its children. More... | |
ConfNode * | ConfNodeNew (void) |
Allocate a new configuration node. More... | |
void | ConfNodeFree (ConfNode *) |
Free a ConfNode and all of its children. More... | |
ConfNode * | ConfGetNode (const char *key) |
Get a ConfNode by name. More... | |
void | ConfCreateContextBackup (void) |
Creates a backup of the conf_hash hash_table used by the conf API. More... | |
void | ConfRestoreContextBackup (void) |
Restores the backup of the hash_table present in backup_conf_hash back to conf_hash. More... | |
ConfNode * | ConfNodeLookupChild (const ConfNode *node, const char *key) |
Lookup a child configuration node by name. More... | |
const char * | ConfNodeLookupChildValue (const ConfNode *node, const char *key) |
Lookup the value of a child configuration node by name. More... | |
void | ConfNodeRemove (ConfNode *) |
Remove (and SCFree) the provided configuration node. More... | |
void | ConfRegisterTests (void) |
int | ConfNodeChildValueIsTrue (const ConfNode *node, const char *key) |
Test if a configuration node has a true value. More... | |
int | ConfValIsTrue (const char *val) |
Check if a value is true. More... | |
int | ConfValIsFalse (const char *val) |
Check if a value is false. More... | |
void | ConfNodePrune (ConfNode *node) |
Prune a configuration node. More... | |
int | ConfRemove (const char *name) |
Remove a configuration parameter from the configuration db. More... | |
bool | ConfNodeHasChildren (const ConfNode *node) |
Check if a node has any children. More... | |
ConfNode * | ConfGetChildWithDefault (const ConfNode *base, const ConfNode *dflt, const char *name) |
ConfNode * | ConfNodeLookupKeyValue (const ConfNode *base, const char *key, const char *value) |
Lookup for a key value under a specific node. More... | |
int | ConfGetChildValue (const ConfNode *base, const char *name, const char **vptr) |
int | ConfGetChildValueInt (const ConfNode *base, const char *name, intmax_t *val) |
int | ConfGetChildValueBool (const ConfNode *base, const char *name, int *val) |
int | ConfGetChildValueWithDefault (const ConfNode *base, const ConfNode *dflt, const char *name, const char **vptr) |
int | ConfGetChildValueIntWithDefault (const ConfNode *base, const ConfNode *dflt, const char *name, intmax_t *val) |
int | ConfGetChildValueBoolWithDefault (const ConfNode *base, const ConfNode *dflt, const char *name, int *val) |
char * | ConfLoadCompleteIncludePath (const char *) |
Create the path for an include entry. More... | |
int | ConfNodeIsSequence (const ConfNode *node) |
Check if a node is a sequence or node. More... | |
Definition in file conf.h.
#define DEFAULT_LOG_DIR "/var/log/suricata" |
The default log directory.
Definition at line 53 of file conf.h.
Referenced by ConfigGetLogDirectory().
void ConfCreateContextBackup | ( | void | ) |
Creates a backup of the conf_hash hash_table used by the conf API.
Definition at line 699 of file conf.c.
Referenced by ActionInitConfig(), ConfNodeIsSequence(), ConfYamlLoadFileWithPrefix(), DetectEngineGetEventInfo(), HtpConfigRestoreBackup(), SCHInfoLoadFromConfig(), and SCRuleVarsGetConfVar().
void ConfDeInit | ( | void | ) |
De-initializes the configuration system.
Definition at line 722 of file conf.c.
References ConfNodeFree(), SCLogDebug, and strlcat().
Referenced by ConfNodeIsSequence(), ConfYamlLoadFileWithPrefix(), DetectEngineGetEventInfo(), GlobalsInitPreConfig(), HtpConfigRestoreBackup(), SCHInfoLoadFromConfig(), and SCRuleVarsGetConfVar().
void ConfDump | ( | void | ) |
Dump configuration to stdout.
Definition at line 780 of file conf.c.
References ConfNodeDump().
Referenced by DetectEngineCtxFree(), DetectEngineReload(), and main().
int ConfGet | ( | const char * | name, |
const char ** | vptr | ||
) |
Retrieve the value of a configuration node.
This function will return the value for a configuration node based on the full name of the node. It is possible that the value returned could be NULL, this could happen if the requested node does exist but is not a node that contains a value, but contains children ConfNodes instead.
name | Name of configuration parameter to get. |
vptr | Pointer that will be set to the configuration value parameter. Note that this is just a reference to the actual value, not a copy. |
1 | will be returned if the name is found, otherwise 0 will be returned. |
Definition at line 331 of file conf.c.
References ConfGetNode(), SCLogDebug, and ConfNode_::val.
Referenced by ConfGetDouble(), ConfGetFloat(), ConfGetInt(), ConfigGetLogDirectory(), ConfLoadCompleteIncludePath(), ConfNodeIsSequence(), ConfUnixSocketIsEnable(), ConfYamlLoadFileWithPrefix(), CoredumpLoadConfig(), Daemonize(), DefragInitConfig(), DetectEngineCtxFree(), DetectEngineMultiTenantSetup(), DetectFilemagicRegister(), DetectLoadCompleteSigPath(), DetectUricontentRegister(), FlowInitConfig(), HTPParseMemcap(), IPPairInitConfig(), NFQInitConfig(), OutputJsonRegister(), PatternMatchDefaultMatcher(), PcapFileGlobalInit(), PostRunDeinit(), RegisterAllModules(), RunModeDispatch(), RunModeErfFileAutoFp(), RunModeErfFileSingle(), RunModeFilePcapAutoFp(), RunModeFilePcapSingle(), RunModeIdsAFPAutoFp(), RunModeIdsAFPRegister(), RunModeIdsAFPSingle(), RunModeIdsAFPWorkers(), RunModeIdsNetmapAutoFp(), RunModeIdsNetmapRegister(), RunModeIdsNetmapSingle(), RunModeIdsNetmapWorkers(), RunModeIdsPcapAutoFp(), RunModeIdsPcapRegister(), RunModeIdsPcapSingle(), RunModeIdsPcapWorkers(), RunModeIdsPfringRegister(), RunModeTileMpipeRegister(), SCClassConfDeinit(), SCLogLoadConfig(), SCReferenceConfDeinit(), SCRuleVarsGetConfVar(), SCThresholdConfGlobalFree(), SinglePatternMatchDefaultMatcher(), SRepInit(), SRepLoadFileFromFD(), StatsSetUI64(), and TmqhFlowRegister().
int ConfGetBool | ( | const char * | name, |
int * | val | ||
) |
Retrieve a configuration value as an boolen.
name | Name of configuration parameter to get. |
val | Pointer to an int that will be set to 1 for true, or 0 for false. |
1 | will be returned if the name is found and was properly converted to a boolean, otherwise 0 will be returned. |
Definition at line 517 of file conf.c.
References ConfGetValue(), and ConfValIsTrue().
Referenced by ConfNodeIsSequence(), DecodeTeredoConfig(), DecodeThreadVarsAlloc(), DetectEngineInspectBufferGeneric(), DetectEngineMultiTenantSetup(), DetectMpmPrepareAppMpms(), DetectMpmSetupAppMpms(), Ja3IsDisabled(), NapatechGetStreamConfig(), NFQInitConfig(), PcapFileGlobalInit(), PostRunDeinit(), ReceiveAFPThreadInit(), ReceivePfringThreadInit(), RegisterSSLParsers(), RunModeFilePcapSingle(), RunModeInitialize(), RunModeNapatechRegister(), SetupFPAnalyzer(), SigAddressPrepareStage4(), StreamTcpAppLayerIsDisabled(), and StreamTcpInitConfig().
int ConfGetChildValue | ( | const ConfNode * | base, |
const char * | name, | ||
const char ** | vptr | ||
) |
Definition at line 388 of file conf.c.
References ConfNodeLookupChild(), SCLogDebug, and ConfNode_::val.
Referenced by ConfGetChildValueBool(), ConfGetChildValueInt(), ConfGetChildValueWithDefault(), and RunModeTileMpipeRegister().
int ConfGetChildValueBool | ( | const ConfNode * | base, |
const char * | name, | ||
int * | val | ||
) |
Definition at line 530 of file conf.c.
References ConfGetChildValue(), and ConfValIsTrue().
Referenced by ConfGetChildValueBoolWithDefault(), PostRunDeinit(), StatsSetUI64(), and Unified2AlertInitCtx().
int ConfGetChildValueBoolWithDefault | ( | const ConfNode * | base, |
const ConfNode * | dflt, | ||
const char * | name, | ||
int * | val | ||
) |
Definition at line 543 of file conf.c.
References ConfGetChildValueBool().
Referenced by ConfNodeIsSequence(), RunModeIdsAFPRegister(), RunModeIdsNetmapRegister(), RunModeIdsPcapRegister(), and RunModeIdsPfringRegister().
int ConfGetChildValueInt | ( | const ConfNode * | base, |
const char * | name, | ||
intmax_t * | val | ||
) |
Definition at line 469 of file conf.c.
References ConfGetChildValue(), ConfNode_::name, SC_ERR_INVALID_YAML_CONF_ENTRY, and SCLogError.
Referenced by ConfGetChildValueIntWithDefault().
int ConfGetChildValueIntWithDefault | ( | const ConfNode * | base, |
const ConfNode * | dflt, | ||
const char * | name, | ||
intmax_t * | val | ||
) |
Definition at line 495 of file conf.c.
References ConfGetChildValueInt().
Referenced by ConfNodeIsSequence(), RunModeIdsAFPRegister(), RunModeIdsNflogRegister(), and RunModeIdsPcapRegister().
int ConfGetChildValueWithDefault | ( | const ConfNode * | base, |
const ConfNode * | dflt, | ||
const char * | name, | ||
const char ** | vptr | ||
) |
Definition at line 416 of file conf.c.
References ConfGetChildValue().
Referenced by AFPRunModeIsIPS(), ConfNodeIsSequence(), RunModeIdsAFPRegister(), RunModeIdsNetmapRegister(), RunModeIdsPcapRegister(), and RunModeIdsPfringRegister().
ConfNode* ConfGetChildWithDefault | ( | const ConfNode * | base, |
const ConfNode * | dflt, | ||
const char * | name | ||
) |
Definition at line 402 of file conf.c.
References ConfNodeLookupChild().
Referenced by RunModeIdsAFPRegister().
int ConfGetDouble | ( | const char * | name, |
double * | val | ||
) |
Retrieve a configuration value as a double.
name | Name of configuration parameter to get. |
val | Pointer to an double that will be set the configuration value. |
1 | will be returned if the name is found and was properly converted to a double, otherwise 0 will be returned. |
Definition at line 615 of file conf.c.
References ConfGet().
int ConfGetFloat | ( | const char * | name, |
float * | val | ||
) |
Retrieve a configuration value as a float.
name | Name of configuration parameter to get. |
val | Pointer to an float that will be set the configuration value. |
1 | will be returned if the name is found and was properly converted to a double, otherwise 0 will be returned. |
Definition at line 645 of file conf.c.
References ConfGet().
Referenced by RunModeInitialize().
int ConfGetInt | ( | const char * | name, |
intmax_t * | val | ||
) |
Retrieve a configuration value as an integer.
name | Name of configuration parameter to get. |
val | Pointer to an intmax_t that will be set the configuration value. |
1 | will be returned if the name is found and was properly converted to an interger, otherwise 0 will be returned. |
Definition at line 437 of file conf.c.
References ConfGet(), SC_ERR_INVALID_YAML_CONF_ENTRY, and SCLogError.
Referenced by ConfNodeIsSequence(), DefragInit(), DefragTrackerFreeFrags(), DetectEngineCtxFree(), DetectLoadersInit(), DetectPcreRegister(), FlowInitConfig(), FlowManagerThreadSpawn(), FlowRecyclerThreadSpawn(), NFQInitConfig(), PcapFileGlobalInit(), PostRunDeinit(), RunModeIdsPcapRegister(), RunModeNapatechRegister(), RunModeTileMpipeRegister(), SCAsn1LoadConfig(), SCProfilingInit(), SigGroupBuild(), and StreamTcpInitConfig().
ConfNode* ConfGetNode | ( | const char * | name | ) |
Get a ConfNode by name.
name | The full name of the configuration node to lookup. |
A | pointer to ConfNode is found or NULL if the configuration node does not exist. |
Definition at line 176 of file conf.c.
References ConfNodeLookupChild(), next, NODE_NAME_MAX, SC_ERR_CONF_NAME_TOO_LONG, SCLogError, and strlcpy().
Referenced by ActionInitConfig(), AffinitySetupLoadFromConfig(), AFPRunModeIsIPS(), AppLayerParserConfParserEnabled(), AppLayerProtoDetectConfProtoDetectionEnabled(), AppLayerProtoDetectPPParseConfPorts(), ConfGet(), ConfGetValue(), ConfNodeIsSequence(), ConfRemove(), ConfYamlLoadFileWithPrefix(), DefragPolicyLoadFromConfig(), DetectAddressTestConfVars(), DetectEngineCtxFree(), DetectEngineMultiTenantEnabled(), DetectEngineMultiTenantSetup(), DetectEngineReload(), DetectPortTestConfVars(), DetectTemplateBufferRegister(), DetectTemplateRustBufferRegister(), FlowInitFlowProto(), HtpConfigRestoreBackup(), HTPConfigure(), LiveBuildDeviceListCustom(), NapatechGetStreamConfig(), OutputRegisterFiledataLogger(), PcapLogProfileSetup(), PostRunDeinit(), RegisterModbusParsers(), RegisterSSLParsers(), RegisterTemplateParsers(), RegisterTemplateRustParsers(), RunModeIdsAFPRegister(), RunModeIdsNetmapRegister(), RunModeIdsNflogRegister(), RunModeIdsPcapRegister(), RunModeIdsPfringRegister(), RunModeInitialize(), RunModeInitializeOutputs(), RunModeTileMpipeRegister(), SCHInfoLoadFromConfig(), SCLogLoadConfig(), SCProfilingInit(), SCProfilingKeywordsGlobalInit(), SCProfilingPrefilterGlobalInit(), SCProfilingRulesGlobalInit(), SCProfilingSghsGlobalInit(), SetupRuleAnalyzer(), SigLoadSignatures(), SRepInit(), StatsSetUI64(), StreamTcpAppLayerIsDisabled(), and StreamTcpInitConfig().
ConfNode* ConfGetRootNode | ( | void | ) |
Get the root configuration node.
Definition at line 203 of file conf.c.
Referenced by ConfYamlLoadFile(), and ConfYamlLoadString().
int ConfGetValue | ( | const char * | name, |
const char ** | vptr | ||
) |
Retrieve the value of a configuration node.
This function will return the value for a configuration node based on the full name of the node. This function notifies if vptr returns NULL or if name is set to NULL.
name | Name of configuration parameter to get. |
vptr | Pointer that will be set to the configuration value parameter. Note that this is just a reference to the actual value, not a copy. |
0 | will be returned if name was not found, 1 will be returned if the name and it's value was found, -1 if the value returns NULL, -2 if name is NULL. |
Definition at line 360 of file conf.c.
References ConfGetNode(), SC_ERR_INVALID_ARGUMENT, SCLogDebug, SCLogError, and ConfNode_::val.
Referenced by ConfGetBool(), HostInitConfig(), PostRunDeinit(), and StreamTcpInitConfig().
void ConfInit | ( | void | ) |
Initialize the configuration system.
Definition at line 113 of file conf.c.
References ConfNodeNew(), SC_ERR_MEM_ALLOC, SCLogDebug, and SCLogError.
Referenced by ActionInitConfig(), ConfNodeIsSequence(), ConfYamlLoadFileWithPrefix(), DetectEngineGetEventInfo(), HtpConfigRestoreBackup(), main(), SCHInfoLoadFromConfig(), and SCRuleVarsGetConfVar().
char* ConfLoadCompleteIncludePath | ( | const char * | file | ) |
Create the path for an include entry.
file | The name of the file |
str | Pointer to the string path + sig_file |
Definition at line 902 of file conf.c.
References ConfGet(), PathIsRelative(), SCLogDebug, SCMalloc, SCStrdup, strlcat(), strlcpy(), and unlikely.
int ConfNodeChildValueIsTrue | ( | const ConfNode * | node, |
const char * | key | ||
) |
Test if a configuration node has a true value.
node | The parent configuration node. |
name | The name of the child node to test. |
1 | if the child node has a true value, otherwise 0 is returned, even if the child node does not exist. |
Definition at line 888 of file conf.c.
References ConfNodeLookupChildValue(), and ConfValIsTrue().
Referenced by HttpXFFGetCfg(), PcapLogProfileSetup(), SCProfilingInit(), SCProfilingKeywordsGlobalInit(), SCProfilingPrefilterGlobalInit(), SCProfilingRulesGlobalInit(), and SCProfilingSghsGlobalInit().
void ConfNodeDump | ( | const ConfNode * | node, |
const char * | prefix | ||
) |
Dump a configuration node and all its children.
Definition at line 750 of file conf.c.
References ConfNodeDump(), ConfNode_::name, next, SCFree, SCStrdup, TAILQ_FOREACH, unlikely, and ConfNode_::val.
Referenced by ConfDump(), and ConfNodeDump().
void ConfNodeFree | ( | ConfNode * | node | ) |
Free a ConfNode and all of its children.
node | The configuration node to SCFree. |
Definition at line 152 of file conf.c.
References ConfNodeFree(), ConfNode_::name, next, SCFree, TAILQ_FIRST, TAILQ_REMOVE, and ConfNode_::val.
Referenced by ConfDeInit(), ConfNodeFree(), ConfNodeIsSequence(), and ConfNodeRemove().
bool ConfNodeHasChildren | ( | const ConfNode * | node | ) |
Check if a node has any children.
Checks if the provided node has any children. Any node that is a YAML map or array will have children.
node | The node to check. |
true | if node has children |
false | if node does not have children |
Definition at line 796 of file conf.c.
References TAILQ_EMPTY.
Referenced by ConfNodeIsSequence().
int ConfNodeIsSequence | ( | const ConfNode * | node | ) |
Check if a node is a sequence or node.
node | the node to check. |
Definition at line 975 of file conf.c.
References ConfCreateContextBackup(), ConfDeInit(), ConfGet(), ConfGetBool(), ConfGetChildValueBoolWithDefault(), ConfGetChildValueIntWithDefault(), ConfGetChildValueWithDefault(), ConfGetInt(), ConfGetNode(), ConfInit(), ConfNodeFree(), ConfNodeHasChildren(), ConfNodeIsSequence(), ConfNodeLookupChild(), ConfNodeLookupChildValue(), ConfNodeNew(), ConfNodePrune(), ConfNodeRemove(), ConfRemove(), ConfRestoreContextBackup(), ConfSet(), ConfSetFinal(), ConfSetFromString(), FAIL_IF, FAIL_IF_NOT, FAIL_IF_NULL, ConfNode_::is_seq, ConfNode_::name, next, ConfNode_::parent, PASS, SCStrdup, TAILQ_INSERT_TAIL, and ConfNode_::val.
Referenced by ConfNodeIsSequence(), ConfYamlLoadFileWithPrefix(), and SigLoadSignatures().
Lookup a child configuration node by name.
Given a ConfNode this function will lookup an immediate child ConfNode by name and return the child ConfNode.
node | The parent configuration node. |
name | The name of the child node to lookup. |
A | pointer the child ConfNode if found otherwise NULL. |
Definition at line 815 of file conf.c.
References ConfNode_::name, next, and TAILQ_FOREACH.
Referenced by AffinitySetupLoadFromConfig(), AppLayerProtoDetectPPParseConfPorts(), ConfGetChildValue(), ConfGetChildWithDefault(), ConfGetNode(), ConfNodeIsSequence(), ConfNodeLookupChildValue(), ConfYamlLoadFileWithPrefix(), DetectEngineCtxFree(), DetectEngineMultiTenantSetup(), DetectEngineReloadTenantBlocking(), FileForceHashParseCfg(), FlowInitFlowProto(), HtpConfigRestoreBackup(), HttpXFFGetCfg(), OutputJsonRegister(), OutputRegisterFiledataLogger(), RunModeInitializeOutputs(), RunModeShutDown(), SCConfLogOpenGeneric(), and SCLogLoadConfig().
const char* ConfNodeLookupChildValue | ( | const ConfNode * | node, |
const char * | name | ||
) |
Lookup the value of a child configuration node by name.
Given a parent ConfNode this function will return the value of a child configuration node by name returning a reference to that value.
node | The parent configuration node. |
name | The name of the child node to lookup. |
A | pointer the child ConfNodes value if found otherwise NULL. |
Definition at line 843 of file conf.c.
References ConfNodeLookupChild(), and ConfNode_::val.
Referenced by ConfNodeChildValueIsTrue(), ConfNodeIsSequence(), DetectEngineCtxFree(), FileForceHashParseCfg(), FlowInitFlowProto(), HttpXFFGetCfg(), LogHttpLogInitCtx(), LogStatsLogThreadDeinit(), LogTcpDataLogInitCtx(), OutputJsonRegister(), PcapLogProfileSetup(), RunModeInitializeOutputs(), RunModeShutDown(), SCConfLogOpenGeneric(), SCLogLoadConfig(), SCProfilingInit(), SCProfilingKeywordsGlobalInit(), SCProfilingPrefilterGlobalInit(), SCProfilingRulesGlobalInit(), SCProfilingSghsGlobalInit(), SetupRuleAnalyzer(), StatsSetUI64(), TLSGetIPInformations(), and Unified2AlertInitCtx().
Lookup for a key value under a specific node.
Definition at line 860 of file conf.c.
References ConfNode_::name, next, TAILQ_FOREACH, and ConfNode_::val.
Referenced by AFPRunModeIsIPS(), RunModeIdsNetmapRegister(), RunModeIdsNflogRegister(), and RunModeTileMpipeRegister().
ConfNode* ConfNodeNew | ( | void | ) |
Allocate a new configuration node.
An | allocated configuration node on success, NULL on failure. |
Definition at line 134 of file conf.c.
References SCCalloc, TAILQ_INIT, and unlikely.
Referenced by ConfInit(), and ConfNodeIsSequence().
void ConfNodePrune | ( | ConfNode * | node | ) |
Prune a configuration node.
Pruning a configuration is similar to freeing, but only fields that may be overridden are, leaving final type parameters. Additional the value of the provided node is also free'd, but the node itself is left.
node | The configuration node to prune. |
Definition at line 943 of file conf.c.
References ConfNodePrune(), ConfNode_::final, ConfNode_::name, next, SCFree, TAILQ_EMPTY, TAILQ_FIRST, TAILQ_NEXT, TAILQ_REMOVE, and ConfNode_::val.
Referenced by ConfNodeIsSequence(), and ConfNodePrune().
void ConfNodeRemove | ( | ConfNode * | ) |
Remove (and SCFree) the provided configuration node.
Definition at line 668 of file conf.c.
References ConfNodeFree(), next, ConfNode_::parent, and TAILQ_REMOVE.
Referenced by ConfNodeIsSequence(), ConfRemove(), and DetectEngineCtxFree().
void ConfRegisterTests | ( | void | ) |
Definition at line 1467 of file conf.c.
References UtRegisterTest().
int ConfRemove | ( | const char * | name | ) |
Remove a configuration parameter from the configuration db.
name | The name of the configuration parameter to remove. |
Returns | 1 if the parameter was removed, otherwise 0 is returned most likely indicating the parameter was not set. |
Definition at line 683 of file conf.c.
References ConfGetNode(), and ConfNodeRemove().
Referenced by ConfNodeIsSequence().
void ConfRestoreContextBackup | ( | void | ) |
Restores the backup of the hash_table present in backup_conf_hash back to conf_hash.
Definition at line 711 of file conf.c.
Referenced by ActionInitConfig(), ConfNodeIsSequence(), ConfYamlLoadFileWithPrefix(), DetectEngineGetEventInfo(), HtpConfigRestoreBackup(), SCHInfoLoadFromConfig(), and SCRuleVarsGetConfVar().
int ConfSet | ( | const char * | name, |
const char * | val | ||
) |
Set a configuration value.
Configuration values set with this function may be overridden by subsequent calls, or if the value appears multiple times in a configuration file.
name | The name of the configuration parameter to set. |
val | The value of the configuration parameter. |
1 | if the value was set otherwise 0. |
Definition at line 220 of file conf.c.
References ConfNode_::final, SCFree, SCStrdup, unlikely, and ConfNode_::val.
Referenced by ConfNodeIsSequence(), ConfSetFromString(), ConfYamlLoadFileWithPrefix(), and PostRunDeinit().
int ConfSetFinal | ( | const char * | name, |
const char * | val | ||
) |
Set a final configuration value.
A final configuration value is a value that cannot be overridden by the configuration file. Its mainly useful for setting values that are supplied on the command line prior to the configuration file being loaded. However, a subsequent call to this function can override a previously set value.
name | The name of the configuration parameter to set. |
val | The value of the configuration parameter. |
1 | if the value was set otherwise 0. |
Definition at line 299 of file conf.c.
References ConfNode_::final, SCFree, SCStrdup, unlikely, and ConfNode_::val.
Referenced by ConfigSetLogDirectory(), ConfNodeIsSequence(), ConfSetFromString(), ConfYamlLoadFileWithPrefix(), EngineDone(), PostRunDeinit(), RegisterAllModules(), and RunModeUnixSocketGetDefaultMode().
int ConfSetFromString | ( | const char * | input, |
int | final | ||
) |
Set a configuration parameter from a string.
Where the input string is something like: stream.midstream=true
input | the input string to be parsed. |
1 | if the value of set, otherwise 0. |
Definition at line 245 of file conf.c.
References ConfSet(), ConfSetFinal(), SCFree, SCStrdup, and unlikely.
Referenced by ConfNodeIsSequence(), and RegisterAllModules().
int ConfValIsFalse | ( | const char * | val | ) |
Check if a value is false.
The value is considered false if it is a string with the value of 0, no, false or off. The test is not case sensitive, any other value is not false.
val | The string to test for a false value. |
1 | If the value is false, 0 if not. |
Definition at line 591 of file conf.c.
Referenced by AppLayerParserConfParserEnabled(), AppLayerProtoDetectConfProtoDetectionEnabled(), HTPFreeConfig(), LogStatsLogThreadDeinit(), OutputJsonRegister(), PcapFileGlobalInit(), RunModeIdsAFPRegister(), RunModeIdsNetmapRegister(), RunModeIdsPcapRegister(), RunModeIdsPfringRegister(), SCConfLogOpenGeneric(), SCLogLoadConfig(), StatsSetUI64(), and Unified2AlertInitCtx().
int ConfValIsTrue | ( | const char * | val | ) |
Check if a value is true.
The value is considered true if it is a string with the value of 1, yes, true or on. The test is not case sensitive, any other value is false.
val | The string to test for a true value. |
1 | If the value is true, 0 if not. |
Definition at line 566 of file conf.c.
Referenced by AppLayerParserConfParserEnabled(), AppLayerProtoDetectConfProtoDetectionEnabled(), ConfGetBool(), ConfGetChildValueBool(), ConfNodeChildValueIsTrue(), ConfUnixSocketIsEnable(), DefragInitConfig(), FileForceHashParseCfg(), HTPFreeConfig(), LogHttpLogInitCtx(), LogStatsLogThreadDeinit(), OutputJsonRegister(), PcapFileGlobalInit(), PcapLogProfileSetup(), RunModeIdsAFPRegister(), RunModeIdsNetmapRegister(), RunModeIdsPcapRegister(), RunModeIdsPfringRegister(), RunModeInitializeOutputs(), RunModeShutDown(), SCProfilingInit(), SCProfilingKeywordsGlobalInit(), SCProfilingPrefilterGlobalInit(), SCProfilingRulesGlobalInit(), SCProfilingSghsGlobalInit(), SetupRuleAnalyzer(), TLSGetIPInformations(), and Unified2AlertInitCtx().