Go to the documentation of this file.
40 const char *log_dir = NULL;
42 if (
SCConfGet(
"default-log-dir", &log_dir) != 1) {
44 log_dir = _getcwd(NULL, 0);
45 if (log_dir == NULL) {
68 size_t name_len = strlen(
name);
72 if (name_len > PATH_MAX) {
73 SCLogError(
"Too long name for data directory");
76 size_t size = strlen(
name) + 1;
79 if (size > 2 && tmp[size - 2] ==
'/')
87 const char *data_dir = NULL;
89 if (
SCConfGet(
"default-data-dir", &data_dir) != 1) {
91 data_dir = _getcwd(NULL, 0);
92 if (data_dir == NULL) {
108 if (
SCStatFn(data_dir, &buf) != 0) {
131 if (strcmp(item->
name,
"interface") == 0 &&
132 strcmp(item->
val, iface) == 0) {
145 if (
SCConfGet(
"unix-command.enabled", &value) != 1) {
150 SCLogError(
"malformed value for unix-command.enabled: NULL");
154 if (!strcmp(value,
"auto")) {
159 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)
const char * ConfigGetDataDirectory(void)
size_t strlcpy(char *dst, const char *src, size_t siz)
SCRunMode SCRunmodeGet(void)
Get the current run mode.
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)