-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathconfig.h
69 lines (53 loc) · 1.96 KB
/
config.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*
SIA-HS Alarm Monitoring Service
Copyright (C) Wilco Baan Hofman <[email protected]> 2012
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#define CONFIGFILE "/etc/siahsd.conf"
typedef STATUS (*event_function)(TALLOC_CTX *mem_ctx, const char *prom, const char *code, const char *description);
typedef struct {
/* Global configuration */
char *log_file;
gint log_level;
gboolean foreground;
char *pid_file; /* FIXME Apparently the same for siahs and secip.. for now */
/* Alphatronics SIA-HS configuration */
gint siahs_port;
/* Vebon SecIP configuration */
gint secip_port;
char *rsa_key_file;
/* Database client configuration */
char *database_host;
char *database_username;
char *database_password;
char *database_name;
char *database_driver;
/* JSONbot client configuration */
char *jsonbot_address;
gint jsonbot_port;
char *jsonbot_aeskey;
char *jsonbot_password;
char *jsonbot_privmsg_to;
char *hook_script_path;
/* Global configuration based state */
GKeyFile *keyfile;
uint8_t event_handler_cnt;
event_function *event_handlers;
struct rsa_public_key *public_key;
struct rsa_private_key *private_key;
} configuration;
const configuration *get_conf(void);
configuration *get_modifiable_conf(void);
STATUS read_rsa_keys(void);
const char *get_process_name(void);
STATUS set_process_name(const char *name);
STATUS read_configuration_file(TALLOC_CTX *mem_ctx);