suricata
util-rule-vars.c File Reference
#include "suricata-common.h"
#include "conf.h"
#include "conf-yaml-loader.h"
#include "detect.h"
#include "detect-content.h"
#include "detect-parse.h"
#include "detect-engine.h"
#include "detect-engine-mpm.h"
#include "util-rule-vars.h"
#include "util-enum.h"
#include "util-debug.h"
#include "util-unittest.h"
Include dependency graph for util-rule-vars.c:

Go to the source code of this file.

Functions

const char * SCRuleVarsGetConfVar (const DetectEngineCtx *de_ctx, const char *conf_var_name, SCRuleVarsType conf_vars_type)
 
void SCRuleVarsRegisterTests (void)
 

Variables

SCEnumCharMap sc_rule_vars_type_map []
 

Detailed Description

Author
Anoop Saldanha anoop.nosp@m.sald.nosp@m.anha@.nosp@m.gmai.nosp@m.l.com

Rule variable utility functions

Definition in file util-rule-vars.c.

Function Documentation

◆ SCRuleVarsGetConfVar()

const char* SCRuleVarsGetConfVar ( const DetectEngineCtx de_ctx,
const char *  conf_var_name,
SCRuleVarsType  conf_vars_type 
)

Definition at line 65 of file util-rule-vars.c.

References ConfGet(), DetectEngineCtx_::config_prefix, de_ctx, sc_rule_vars_type_map, SCEnter, SCLogDebug, SCLogError, SCMapEnumValueToName(), and SCReturnCharPtr.

Here is the call graph for this function:

◆ SCRuleVarsRegisterTests()

void SCRuleVarsRegisterTests ( void  )

Definition at line 400 of file util-rule-vars.c.

References UtRegisterTest().

Here is the call graph for this function:

Variable Documentation

◆ sc_rule_vars_type_map

SCEnumCharMap sc_rule_vars_type_map[]
Initial value:
= {
{ "vars.address-groups", SC_RULE_VARS_ADDRESS_GROUPS },
{ "vars.port-groups", SC_RULE_VARS_PORT_GROUPS }
}

An enum-string map, that maps the different vars type in the yaml conf type with the mapping path in the yaml conf file

Definition at line 43 of file util-rule-vars.c.

Referenced by SCRuleVarsGetConfVar().

SC_RULE_VARS_ADDRESS_GROUPS
@ SC_RULE_VARS_ADDRESS_GROUPS
Definition: util-rule-vars.h:31
SC_RULE_VARS_PORT_GROUPS
@ SC_RULE_VARS_PORT_GROUPS
Definition: util-rule-vars.h:32