suricata-common.h threadvars.h util-binsearch.h \
util-atomic.h util-validate.h
bin_PROGRAMS = suricata
+
+AM_CPPFLAGS = -DCONFIG_DIR=\"$(sysconfdir)\"
+
suricata_SOURCES = suricata.c suricata.h \
runmodes.c runmodes.h \
runmode-pcap.c runmode-pcap.h \
/* load the pattern matchers */
MpmTableSetup();
+ if (run_mode != RUNMODE_UNITTEST &&
+ !list_keywords &&
+ !list_app_layer_protocols) {
+ conf_filename = DEFAULT_CONF_FILE;
+ }
+
/** \todo we need an api for these */
/* Load yaml configuration file if provided. */
if (conf_filename != NULL) {
}
}
}
-
- } else if (run_mode != RUNMODE_UNITTEST &&
- !list_keywords &&
- !list_app_layer_protocols) {
- SCLogError(SC_ERR_OPENING_FILE, "Configuration file has not been provided");
- usage(argv[0]);
- exit(EXIT_FAILURE);
}
AppLayerDetectProtoThreadInit();
#define PROG_NAME "Suricata"
#define PROG_VER "1.3dev"
+/* workaround SPlint error (don't know __gnuc_va_list) */
+#ifdef S_SPLINT_S
+# include <err.h>
+# define CONFIG_DIR "/etc/suricata"
+#endif
+
+#define DEFAULT_CONF_FILE CONFIG_DIR "/suricata.yaml"
+
+
/* runtime engine control flags */
#define SURICATA_STOP 0x01 /**< gracefully stop the engine: process all
outstanding packets first */
#define DETECT_CLASSCONFIG_REGEX "^\\s*config\\s*classification\\s*:\\s*([a-zA-Z][a-zA-Z0-9-_]*)\\s*,\\s*(.+)\\s*,\\s*(\\d+)\\s*$"
/* Default path for the classification.config file */
-#define SC_CLASS_CONF_DEF_CONF_FILEPATH "classification.config"
+#define SC_CLASS_CONF_DEF_CONF_FILEPATH CONFIG_DIR "/classification.config"
/* Holds a pointer to the default path for the classification.config file */
static const char *default_file_path = SC_CLASS_CONF_DEF_CONF_FILEPATH;
#define SC_RCONF_REGEX "^\\s*config\\s+reference\\s*:\\s*([a-zA-Z][a-zA-Z0-9-_]*)\\s+(.+)\\s*$"
/* Default path for the reference.conf file */
-#define SC_RCONF_DEFAULT_FILE_PATH "reference.config"
+#define SC_RCONF_DEFAULT_FILE_PATH CONFIG_DIR "/reference.config"
/* Holds a pointer to the default path for the reference.config file */
static const char *file_path = SC_RCONF_DEFAULT_FILE_PATH;
#define DETECT_SUPPRESS_REGEX "^,\\s*track\\s*(by_dst|by_src)\\s*,\\s*ip\\s*([\\d.:/]+)*\\s*$"
/* Default path for the threshold.config file */
-#define THRESHOLD_CONF_DEF_CONF_FILEPATH "threshold.config"
+#define THRESHOLD_CONF_DEF_CONF_FILEPATH CONFIG_DIR "/threshold.config"
static pcre *regex_base = NULL;
static pcre_extra *regex_base_study = NULL;