suricata
|
#include "suricata-common.h"
#include "conf.h"
#include "conf-yaml-loader.h"
#include <yaml.h>
#include "util-path.h"
#include "util-debug.h"
#include "util-unittest.h"
Go to the source code of this file.
Macros | |
#define | YAML_VERSION_MAJOR 1 |
#define | YAML_VERSION_MINOR 1 |
#define | RECURSION_LIMIT 128 |
#define | DEFAULT_NAME_LEN 16 |
#define | MANGLE_ERRORS_MAX 10 |
Enumerations | |
enum | conf_state { CONF_KEY = 0, CONF_VAL, CONF_INCLUDE } |
Functions | |
int | ConfYamlHandleInclude (ConfNode *parent, const char *filename) |
Include a file in the configuration. More... | |
int | ConfYamlLoadFile (const char *filename) |
Load configuration from a YAML file. More... | |
int | ConfYamlLoadString (const char *string, size_t len) |
Load configuration from a YAML string. More... | |
int | ConfYamlLoadFileWithPrefix (const char *filename, const char *prefix) |
Load configuration from a YAML file, insert in tree at 'prefix'. More... | |
void | ConfYamlRegisterTests (void) |
YAML configuration loader.
Definition in file conf-yaml-loader.c.
#define DEFAULT_NAME_LEN 16 |
Definition at line 45 of file conf-yaml-loader.c.
#define MANGLE_ERRORS_MAX 10 |
Definition at line 47 of file conf-yaml-loader.c.
#define RECURSION_LIMIT 128 |
Definition at line 40 of file conf-yaml-loader.c.
#define YAML_VERSION_MAJOR 1 |
Definition at line 35 of file conf-yaml-loader.c.
#define YAML_VERSION_MINOR 1 |
Definition at line 36 of file conf-yaml-loader.c.
enum conf_state |
Enumerator | |
---|---|
CONF_KEY | |
CONF_VAL | |
CONF_INCLUDE |
Definition at line 54 of file conf-yaml-loader.c.
int ConfYamlHandleInclude | ( | ConfNode * | parent, |
const char * | filename | ||
) |
Include a file in the configuration.
parent | The configuration node the included configuration will be placed at. |
filename | The filename to include. |
0 | on success, -1 on failure. |
Definition at line 114 of file conf-yaml-loader.c.
References PathIsAbsolute(), SCLogError, and strlcpy().
Referenced by SCLoadYamlConfig().
int ConfYamlLoadFile | ( | const char * | filename | ) |
Load configuration from a YAML file.
This function will load a configuration file. On failure -1 will be returned and it is suggested that the program then exit. Any errors while loading the configuration file will have already been logged.
filename | Filename of configuration file to load. |
0 | on success, -1 on failure. |
Definition at line 476 of file conf-yaml-loader.c.
Referenced by ListAppLayerProtocols(), and SCLoadYamlConfig().
int ConfYamlLoadFileWithPrefix | ( | const char * | filename, |
const char * | prefix | ||
) |
Load configuration from a YAML file, insert in tree at 'prefix'.
This function will load a configuration file and insert it into the config tree at 'prefix'. This means that if this is called with prefix "abc" and the file contains a parameter "def", it will be loaded as "abc.def".
filename | Filename of configuration file to load. |
prefix | Name prefix to use. |
0 | on success, -1 on failure. |
Definition at line 554 of file conf-yaml-loader.c.
int ConfYamlLoadString | ( | const char * | string, |
size_t | len | ||
) |
Load configuration from a YAML string.
Definition at line 523 of file conf-yaml-loader.c.
Referenced by LLVMFuzzerTestOneInput().
void ConfYamlRegisterTests | ( | void | ) |
Definition at line 1057 of file conf-yaml-loader.c.
References UtRegisterTest().