summaryrefslogtreecommitdiffstats
path: root/plugins/check_apt.d/config.h
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/check_apt.d/config.h')
-rw-r--r--plugins/check_apt.d/config.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/plugins/check_apt.d/config.h b/plugins/check_apt.d/config.h
new file mode 100644
index 00000000..981f4f42
--- /dev/null
+++ b/plugins/check_apt.d/config.h
@@ -0,0 +1,41 @@
1#pragma once
2
3#include "../../config.h"
4#include <stddef.h>
5
6/* some constants */
7typedef enum {
8 UPGRADE,
9 DIST_UPGRADE,
10 NO_UPGRADE
11} upgrade_type;
12
13typedef struct {
14 bool do_update; /* whether to call apt-get update */
15 upgrade_type upgrade; /* which type of upgrade to do */
16 bool only_critical; /* whether to warn about non-critical updates */
17 bool list; /* list packages available for upgrade */
18 /* number of packages available for upgrade to return WARNING status */
19 int packages_warning;
20
21 char *upgrade_opts; /* options to override defaults for upgrade */
22 char *update_opts; /* options to override defaults for update */
23 char *do_include; /* regexp to only include certain packages */
24 char *do_exclude; /* regexp to only exclude certain packages */
25 char *do_critical; /* regexp specifying critical packages */
26 char *input_filename; /* input filename for testing */
27} check_apt_config;
28
29check_apt_config check_apt_config_init() {
30 check_apt_config tmp = {.do_update = false,
31 .upgrade = UPGRADE,
32 .only_critical = false,
33 .list = false,
34 .packages_warning = 1,
35 .update_opts = NULL,
36 .do_include = NULL,
37 .do_exclude = NULL,
38 .do_critical = NULL,
39 .input_filename = NULL};
40 return tmp;
41}