Go to the documentation of this file.
41 static const char *ConfigGetCwdFallback(
void)
46 char *
p = _getcwd(NULL, 0);
63 const char *log_dir = NULL;
67 log_dir = ConfigGetCwdFallback();
68 if (log_dir == NULL) {
91 size_t name_len = strlen(
name);
95 if (name_len > PATH_MAX) {
96 SCLogError(
"Too long name for data directory");
99 size_t size = strlen(
name) + 1;
102 if (size > 2 && tmp[size - 2] ==
'/')
103 tmp[size - 2] =
'\0';
110 const char *data_dir = NULL;
114 data_dir = ConfigGetCwdFallback();
115 if (data_dir == NULL) {
131 if (
SCStatFn(data_dir, &buf) != 0) {
154 if (strcmp(item->
name,
"interface") == 0 &&
155 strcmp(item->
val, iface) == 0) {
168 if (
SCConfGet(
"unix-command.enabled", &value) != 1) {
173 SCLogError(
"malformed value for unix-command.enabled: NULL");
177 if (!strcmp(value,
"auto")) {
182 SCLogInfo(
"Running in live mode, activating unix socket");
int SCConfValIsTrue(const char *val)
Check if a value is true.
bool IsRunModeOffline(enum SCRunModes run_mode_to_check)
struct HtpBodyChunk_ * next
int SCConfGet(const char *name, const char **vptr)
Retrieve the value of a configuration node.
#define TAILQ_FOREACH(var, head, field)
#define SC_ATOMIC_CAS(name, cmpval, newval)
atomic Compare and Switch
const char * ConfigGetDataDirectory(void)
size_t strlcpy(char *dst, const char *src, size_t siz)
SCRunMode SCRunmodeGet(void)
Get the current run mode.
int SCConfGetNonNull(const char *name, const char **vptr)
Retrieve the non-null value of a configuration node.
#define SC_ATOMIC_DECLARE(type, name)
wrapper for declaring atomic variables.
const char * SCConfigGetLogDirectory(void)
TmEcode ConfigSetDataDirectory(char *name)
#define SCLogInfo(...)
Macro used to log INFORMATIONAL messages.
int SCConfSetFinal(const char *name, const char *val)
Set a final configuration value.
TmEcode ConfigSetLogDirectory(const char *name)
int ConfUnixSocketIsEnable(void)
TmEcode ConfigCheckDataDirectory(const char *data_dir)
#define SCLogError(...)
Macro used to log ERROR messages.
TmEcode ConfigCheckLogDirectoryExists(const char *log_dir)
SCConfNode * ConfFindDeviceConfig(SCConfNode *node, const char *iface)
Find the configuration node for a specific device.
#define SCStatFn(pathname, statbuf)
#define SC_ATOMIC_GET(name)
Get the value from the atomic variable.