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.h46
1 files changed, 46 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..e4d622f1
--- /dev/null
+++ b/plugins/check_apt.d/config.h
@@ -0,0 +1,46 @@
1#pragma once
2
3#include "../../config.h"
4#include <stddef.h>
5#include "../lib/output.h"
6
7/* some constants */
8typedef enum {
9 UPGRADE,
10 DIST_UPGRADE,
11 NO_UPGRADE
12} upgrade_type;
13
14typedef struct {
15 bool do_update; /* whether to call apt-get update */
16 upgrade_type upgrade; /* which type of upgrade to do */
17 bool only_critical; /* whether to warn about non-critical updates */
18 bool list; /* list packages available for upgrade */
19 /* number of packages available for upgrade to return WARNING status */
20 size_t packages_warning;
21
22 char *upgrade_opts; /* options to override defaults for upgrade */
23 char *update_opts; /* options to override defaults for update */
24 char *do_include; /* regexp to only include certain packages */
25 char *do_exclude; /* regexp to only exclude certain packages */
26 char *do_critical; /* regexp specifying critical packages */
27 char *input_filename; /* input filename for testing */
28
29 bool output_format_is_set;
30 mp_output_format output_format;
31} check_apt_config;
32
33check_apt_config check_apt_config_init() {
34 check_apt_config tmp = {.do_update = false,
35 .upgrade = UPGRADE,
36 .only_critical = false,
37 .list = false,
38 .packages_warning = 1,
39 .update_opts = NULL,
40 .do_include = NULL,
41 .do_exclude = NULL,
42 .do_critical = NULL,
43 .input_filename = NULL,
44 .output_format_is_set = false};
45 return tmp;
46}