Code

Attempt at fixing check_snmp multiline output:
[nagiosplug.git] / lib / utils_base.h
index c34f0445c9f515b314711eee37fb857ea50ea1a5..49e40a63b4d6747b672ce0e0b02ff4a1b0d8d26d 100644 (file)
@@ -35,6 +35,9 @@ void print_thresholds(const char *, thresholds *);
 int check_range(double, range *);
 int get_status(double, thresholds *);
 
+/* All possible characters in a threshold range */
+#define NP_THRESHOLDS_CHARS "0123456789.:@~"
+
 char *np_escaped_string (const char *);
 
 void die (int, const char *, ...) __attribute__((noreturn,format(printf, 2, 3)));
@@ -56,6 +59,12 @@ int np_warn_if_not_root(void);
  * This function can be used to parse NTP control packet data and performance
  * data strings.
  */
-char *np_extract_value(const char*, const char*);
+char *np_extract_value(const char*, const char*, char);
+
+/*
+ * Same as np_extract_value with separator suitable for NTP control packet
+ * payloads (comma)
+ */
+#define np_extract_ntpvar(l, n) np_extract_value(l, n, ',')
 
 #endif /* _UTILS_BASE_ */