]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
Introduce generic utility API to log message on invalid config entry.
authorAnoop Saldanha <anoopsaldanha@gmail.com>
Fri, 6 Sep 2013 16:26:35 +0000 (21:56 +0530)
committerVictor Julien <victor@inliniac.net>
Mon, 9 Sep 2013 15:55:10 +0000 (17:55 +0200)
src/util-misc.h

index 3c139db5d4ce46feae9cbe108d76fc9c113f7931..f7dc48d6662ce6965d1b2b8ef1787927980ffb5d 100644 (file)
 #ifndef __UTIL_MISC_H__
 #define __UTIL_MISC_H__
 
+#include "util-error.h"
+
+/**
+ * \brief Generic API that can be used by all to log an
+ *        invalid conf entry.
+ * \param param_name A string specifying the param name.
+ * \param format Format for the below value.  For example "%s", "%"PRIu32,
+                 etc.
+ * \param value Default value to be printed.
+ */
+#define WarnInvalidConfEntry(param_name, format, value) do {            \
+        SCLogWarning(SC_ERR_INVALID_YAML_CONF_ENTRY,                    \
+                     "Invalid conf entry found for "                    \
+                     "\"%s\".  Using default value of \"" format "\".", \
+                     param_name, value);                                \
+    } while (0)
+
 /* size string parsing API */
 
 int ParseSizeStringU8(const char *, uint8_t *);