summaryrefslogtreecommitdiffstats
path: root/plugins/utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/utils.h')
-rw-r--r--plugins/utils.h54
1 files changed, 21 insertions, 33 deletions
diff --git a/plugins/utils.h b/plugins/utils.h
index 4c4aacc..cb979ce 100644
--- a/plugins/utils.h
+++ b/plugins/utils.h
@@ -7,7 +7,7 @@
7/* The purpose of this package is to provide safer alternatives to C 7/* The purpose of this package is to provide safer alternatives to C
8functions that might otherwise be vulnerable to hacking. This 8functions that might otherwise be vulnerable to hacking. This
9currently includes a standard suite of validation routines to be sure 9currently includes a standard suite of validation routines to be sure
10that an string argument acually converts to its intended type and a 10that an string argument actually converts to its intended type and a
11suite of string handling routine that do their own memory management 11suite of string handling routine that do their own memory management
12in order to resist overflow attacks. In addition, a few functions are 12in order to resist overflow attacks. In addition, a few functions are
13provided to standardize version and error reporting across the entire 13provided to standardize version and error reporting across the entire
@@ -16,6 +16,7 @@ suite of plugins. */
16/* now some functions etc are being defined in ../lib/utils_base.c */ 16/* now some functions etc are being defined in ../lib/utils_base.c */
17#include "utils_base.h" 17#include "utils_base.h"
18 18
19
19#ifdef NP_EXTRA_OPTS 20#ifdef NP_EXTRA_OPTS
20/* Include extra-opts functions if compiled in */ 21/* Include extra-opts functions if compiled in */
21#include "extra_opts.h" 22#include "extra_opts.h"
@@ -29,13 +30,6 @@ suite of plugins. */
29void support (void); 30void support (void);
30void print_revision (const char *, const char *); 31void print_revision (const char *, const char *);
31 32
32/* Handle timeouts */
33
34extern unsigned int timeout_state;
35extern unsigned int timeout_interval;
36
37RETSIGTYPE timeout_alarm_handler (int);
38
39extern time_t start_time, end_time; 33extern time_t start_time, end_time;
40 34
41/* Test input types */ 35/* Test input types */
@@ -45,6 +39,8 @@ int is_intpos (char *);
45int is_intneg (char *); 39int is_intneg (char *);
46int is_intnonneg (char *); 40int is_intnonneg (char *);
47int is_intpercent (char *); 41int is_intpercent (char *);
42int is_uint64(char *number, uint64_t *target);
43int is_int64(char *number, int64_t *target);
48 44
49int is_numeric (char *); 45int is_numeric (char *);
50int is_positive (char *); 46int is_positive (char *);
@@ -89,34 +85,26 @@ void usage4(const char *) __attribute__((noreturn));
89void usage5(void) __attribute__((noreturn)); 85void usage5(void) __attribute__((noreturn));
90void usage_va(const char *fmt, ...) __attribute__((noreturn)); 86void usage_va(const char *fmt, ...) __attribute__((noreturn));
91 87
92const char *state_text (int);
93
94#define max(a,b) (((a)>(b))?(a):(b)) 88#define max(a,b) (((a)>(b))?(a):(b))
95#define min(a,b) (((a)<(b))?(a):(b)) 89#define min(a,b) (((a)<(b))?(a):(b))
96 90
97char *perfdata (const char *, 91char *perfdata (const char *, long int, const char *, int, long int,
98 long int, 92 int, long int, int, long int, int, long int);
99 const char *, 93
100 int, 94char *perfdata_uint64 (const char *, uint64_t , const char *, int, uint64_t,
101 long int, 95 int, uint64_t, int, uint64_t, int, uint64_t);
102 int, 96
103 long int, 97char *perfdata_int64 (const char *, int64_t, const char *, int, int64_t,
104 int, 98 int, int64_t, int, int64_t, int, int64_t);
105 long int, 99
106 int, 100char *fperfdata (const char *, double, const char *, int, double,
107 long int); 101 int, double, int, double, int, double);
108 102
109char *fperfdata (const char *, 103char *sperfdata (const char *, double, const char *, char *, char *,
110 double, 104 int, double, int, double);
111 const char *, 105
112 int, 106char *sperfdata_int (const char *, int, const char *, char *, char *,
113 double, 107 int, int, int, int);
114 int,
115 double,
116 int,
117 double,
118 int,
119 double);
120 108
121/* The idea here is that, although not every plugin will use all of these, 109/* The idea here is that, although not every plugin will use all of these,
122 most will or should. Therefore, for consistency, these very common 110 most will or should. Therefore, for consistency, these very common