syslog-ng source
cfg.h File Reference
#include "syslog-ng.h"
#include "cfg-tree.h"
#include "cfg-lexer.h"
#include "cfg-parser.h"
#include "cfg-persist.h"
#include "plugin.h"
#include "persist-state.h"
#include "template/templates.h"
#include "host-resolve.h"
#include "logmsg/type-hinting.h"
#include "stats/stats.h"
#include "healthcheck/healthcheck-stats.h"
#include "dnscache.h"
#include "file-perms.h"
#include <sys/types.h>
#include <regex.h>
Include dependency graph for cfg.h:

Go to the source code of this file.

Classes

struct  GlobalConfig
 

Macros

#define cfg_is_config_version_older(__cfg, __req)
 
#define __cfg_is_feature_enabled(cfg, min_version)
 
#define cfg_is_feature_enabled(cfg, topic)   __cfg_is_feature_enabled(cfg, FEATURE_ ## topic ## _MIN_VERSION)
 
#define cfg_is_typing_feature_enabled(cfg)   cfg_is_feature_enabled(cfg, TYPING)
 
#define cfg_is_experimental_feature_enabled(cfg)   0
 

Typedefs

typedef gboolean(* mangle_callback) (GlobalConfig *cfg, LogMessage *msg, gpointer user_data)
 

Enumerations

enum  {
  MM_INTERNAL = 1 , MM_DST_IDLE , MM_HOST_IDLE , MM_PERIODICAL ,
  MM_NONE , MM_GLOBAL
}
 

Functions

gboolean cfg_load_module_with_args (GlobalConfig *cfg, const gchar *module_name, CfgArgs *args)
 
gboolean cfg_load_module (GlobalConfig *cfg, const gchar *module_name)
 
gboolean cfg_is_module_available (GlobalConfig *self, const gchar *module_name)
 
void cfg_discover_candidate_modules (GlobalConfig *self)
 
Plugin * cfg_find_plugin (GlobalConfig *cfg, gint plugin_type, const gchar *plugin_name)
 
gpointer cfg_parse_plugin (GlobalConfig *cfg, Plugin *plugin, CFG_LTYPE *yylloc, gpointer arg)
 
gboolean cfg_allow_config_dups (GlobalConfig *self)
 
void cfg_bad_hostname_set (GlobalConfig *self, gchar *bad_hostname_re)
 
gint cfg_lookup_mark_mode (const gchar *mark_mode)
 
void cfg_set_mark_mode (GlobalConfig *self, const gchar *mark_mode)
 
gboolean cfg_set_log_level (GlobalConfig *self, const gchar *log_level)
 
gint cfg_tz_convert_value (gchar *convert)
 
gint cfg_ts_format_value (gchar *format)
 
void cfg_set_version_without_validation (GlobalConfig *self, gint version)
 
gboolean cfg_set_version (GlobalConfig *self, gint version)
 
gboolean cfg_set_current_version (GlobalConfig *self)
 
void cfg_set_user_config_id (GlobalConfig *self, const gchar *id)
 
void cfg_format_id (GlobalConfig *self, GString *id)
 
void cfg_set_global_paths (GlobalConfig *self)
 
GlobalConfig * cfg_new (gint version)
 
GlobalConfig * cfg_new_snippet (void)
 
GlobalConfig * cfg_new_subordinate (GlobalConfig *master)
 
gboolean cfg_run_parser (GlobalConfig *self, CfgLexer *lexer, CfgParser *parser, gpointer *result, gpointer arg)
 
gboolean cfg_run_parser_with_main_context (GlobalConfig *self, CfgLexer *lexer, CfgParser *parser, gpointer *result, gpointer arg, const gchar *desc)
 
gboolean cfg_read_config (GlobalConfig *cfg, const gchar *fname, gchar *preprocess_into)
 
void cfg_load_forced_modules (GlobalConfig *self)
 
void cfg_shutdown (GlobalConfig *self)
 
gboolean cfg_is_shutting_down (GlobalConfig *cfg)
 
void cfg_free (GlobalConfig *self)
 
gboolean cfg_init (GlobalConfig *cfg)
 
gboolean cfg_deinit (GlobalConfig *cfg)
 
PersistConfigpersist_config_new (void)
 
void persist_config_free (PersistConfig *self)
 
void cfg_persist_config_move (GlobalConfig *src, GlobalConfig *dest)
 
void cfg_persist_config_add (GlobalConfig *cfg, const gchar *name, gpointer value, GDestroyNotify destroy)
 
gpointer cfg_persist_config_fetch (GlobalConfig *cfg, const gchar *name)
 
void register_source_mangle_callback (GlobalConfig *src, mangle_callback cb)
 
gboolean is_source_mangle_callback_registered (GlobalConfig *src, mangle_callback cb)
 
void uregister_source_mangle_callback (GlobalConfig *src, mangle_callback cb)
 
gint cfg_get_user_version (const GlobalConfig *cfg)
 
guint cfg_get_parsed_version (const GlobalConfig *cfg)
 
const gchar * cfg_get_filename (const GlobalConfig *cfg)
 

Macro Definition Documentation

◆ __cfg_is_feature_enabled

#define __cfg_is_feature_enabled (   cfg,
  min_version 
)
Value:
({ \
/* the flip-over for min_version reached, set min_version to 0 */ G_STATIC_ASSERT(min_version == 0 || VERSION_VALUE_CURRENT < ((min_version) - 1)); \
version_convert_from_user(cfg->user_version) >= (min_version) - 1; \
})
G_STATIC_ASSERT(sizeof(gssize)==sizeof(gpointer))
GlobalConfig * cfg
Definition: test_batched_ack_tracker.c:34
#define VERSION_VALUE_CURRENT
Definition: versioning.h:206

◆ cfg_is_config_version_older

#define cfg_is_config_version_older (   __cfg,
  __req 
)
Value:
({ \
/* check that VERSION_VALUE_LAST_SEMANTIC_CHANGE is set correctly */ G_STATIC_ASSERT((__req) <= VERSION_VALUE_LAST_SEMANTIC_CHANGE || (__req) == VERSION_VALUE_NEXT_MAJOR); \
__cfg_is_config_version_older(__cfg, __req); \
})
#define VERSION_VALUE_LAST_SEMANTIC_CHANGE
Definition: versioning.h:214
#define VERSION_VALUE_NEXT_MAJOR
Definition: versioning.h:220

◆ cfg_is_experimental_feature_enabled

#define cfg_is_experimental_feature_enabled (   cfg)    0

◆ cfg_is_feature_enabled

#define cfg_is_feature_enabled (   cfg,
  topic 
)    __cfg_is_feature_enabled(cfg, FEATURE_ ## topic ## _MIN_VERSION)

◆ cfg_is_typing_feature_enabled

#define cfg_is_typing_feature_enabled (   cfg)    cfg_is_feature_enabled(cfg, TYPING)

Typedef Documentation

◆ mangle_callback

typedef gboolean(* mangle_callback) (GlobalConfig *cfg, LogMessage *msg, gpointer user_data)

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
MM_INTERNAL 
MM_DST_IDLE 
MM_HOST_IDLE 
MM_PERIODICAL 
MM_NONE 
MM_GLOBAL 

Function Documentation

◆ cfg_allow_config_dups()

gboolean cfg_allow_config_dups ( GlobalConfig *  self)

◆ cfg_bad_hostname_set()

void cfg_bad_hostname_set ( GlobalConfig *  self,
gchar *  bad_hostname_re 
)

◆ cfg_deinit()

gboolean cfg_deinit ( GlobalConfig *  cfg)

◆ cfg_discover_candidate_modules()

void cfg_discover_candidate_modules ( GlobalConfig *  self)

◆ cfg_find_plugin()

Plugin* cfg_find_plugin ( GlobalConfig *  cfg,
gint  plugin_type,
const gchar *  plugin_name 
)

◆ cfg_format_id()

void cfg_format_id ( GlobalConfig *  self,
GString *  id 
)

◆ cfg_free()

void cfg_free ( GlobalConfig *  self)

◆ cfg_get_filename()

const gchar* cfg_get_filename ( const GlobalConfig *  cfg)

◆ cfg_get_parsed_version()

guint cfg_get_parsed_version ( const GlobalConfig *  cfg)

◆ cfg_get_user_version()

gint cfg_get_user_version ( const GlobalConfig *  cfg)

◆ cfg_init()

gboolean cfg_init ( GlobalConfig *  cfg)

◆ cfg_is_module_available()

gboolean cfg_is_module_available ( GlobalConfig *  self,
const gchar *  module_name 
)

◆ cfg_is_shutting_down()

gboolean cfg_is_shutting_down ( GlobalConfig *  cfg)

◆ cfg_load_forced_modules()

void cfg_load_forced_modules ( GlobalConfig *  self)

◆ cfg_load_module()

gboolean cfg_load_module ( GlobalConfig *  cfg,
const gchar *  module_name 
)

◆ cfg_load_module_with_args()

gboolean cfg_load_module_with_args ( GlobalConfig *  cfg,
const gchar *  module_name,
CfgArgs *  args 
)

◆ cfg_lookup_mark_mode()

gint cfg_lookup_mark_mode ( const gchar *  mark_mode)

◆ cfg_new()

GlobalConfig* cfg_new ( gint  version)

◆ cfg_new_snippet()

GlobalConfig* cfg_new_snippet ( void  )

◆ cfg_new_subordinate()

GlobalConfig* cfg_new_subordinate ( GlobalConfig *  master)

◆ cfg_parse_plugin()

gpointer cfg_parse_plugin ( GlobalConfig *  cfg,
Plugin *  plugin,
CFG_LTYPE yylloc,
gpointer  arg 
)

◆ cfg_persist_config_add()

void cfg_persist_config_add ( GlobalConfig *  cfg,
const gchar *  name,
gpointer  value,
GDestroyNotify  destroy 
)

◆ cfg_persist_config_fetch()

gpointer cfg_persist_config_fetch ( GlobalConfig *  cfg,
const gchar *  name 
)

◆ cfg_persist_config_move()

void cfg_persist_config_move ( GlobalConfig *  src,
GlobalConfig *  dest 
)

◆ cfg_read_config()

gboolean cfg_read_config ( GlobalConfig *  cfg,
const gchar *  fname,
gchar *  preprocess_into 
)

◆ cfg_run_parser()

gboolean cfg_run_parser ( GlobalConfig *  self,
CfgLexer *  lexer,
CfgParser parser,
gpointer *  result,
gpointer  arg 
)

◆ cfg_run_parser_with_main_context()

gboolean cfg_run_parser_with_main_context ( GlobalConfig *  self,
CfgLexer *  lexer,
CfgParser parser,
gpointer *  result,
gpointer  arg,
const gchar *  desc 
)

◆ cfg_set_current_version()

gboolean cfg_set_current_version ( GlobalConfig *  self)

◆ cfg_set_global_paths()

void cfg_set_global_paths ( GlobalConfig *  self)

◆ cfg_set_log_level()

gboolean cfg_set_log_level ( GlobalConfig *  self,
const gchar *  log_level 
)

◆ cfg_set_mark_mode()

void cfg_set_mark_mode ( GlobalConfig *  self,
const gchar *  mark_mode 
)

◆ cfg_set_user_config_id()

void cfg_set_user_config_id ( GlobalConfig *  self,
const gchar *  id 
)

◆ cfg_set_version()

gboolean cfg_set_version ( GlobalConfig *  self,
gint  version 
)

◆ cfg_set_version_without_validation()

void cfg_set_version_without_validation ( GlobalConfig *  self,
gint  version 
)

◆ cfg_shutdown()

void cfg_shutdown ( GlobalConfig *  self)

◆ cfg_ts_format_value()

gint cfg_ts_format_value ( gchar *  format)

◆ cfg_tz_convert_value()

gint cfg_tz_convert_value ( gchar *  convert)

◆ is_source_mangle_callback_registered()

gboolean is_source_mangle_callback_registered ( GlobalConfig *  src,
mangle_callback  cb 
)

◆ persist_config_free()

void persist_config_free ( PersistConfig self)

◆ persist_config_new()

PersistConfig* persist_config_new ( void  )

◆ register_source_mangle_callback()

void register_source_mangle_callback ( GlobalConfig *  src,
mangle_callback  cb 
)

◆ uregister_source_mangle_callback()

void uregister_source_mangle_callback ( GlobalConfig *  src,
mangle_callback  cb 
)