/
console_conf.h
105 lines (86 loc) · 3.13 KB
/
console_conf.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
/*
BAREOS® - Backup Archiving REcovery Open Sourced
Copyright (C) 2000-2008 Free Software Foundation Europe e.V.
Copyright (C) 2011-2012 Planets Communications B.V.
Copyright (C) 2013-2016 Bareos GmbH & Co. KG
This program is Free Software; you can redistribute it and/or
modify it under the terms of version three of the GNU Affero General Public
License as published by the Free Software Foundation and included
in the file LICENSE.
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
Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
*/
/*
* Kern Sibbald, Sep MM
*/
/**
* @file
* Bareos User Agent specific configuration and defines
*/
#ifndef BAREOS_CONSOLE_CONSOLE_CONF_H_
#define BAREOS_CONSOLE_CONSOLE_CONF_H_ 1
class ConfigurationParser;
extern ConfigurationParser *my_config; /* Our Global config */
namespace console {
static const std::string default_config_filename("bconsole.conf");
/**
* Resource codes -- they must be sequential for indexing
*/
enum {
R_CONSOLE = 1001,
R_DIRECTOR,
R_FIRST = R_CONSOLE,
R_LAST = R_DIRECTOR /* Keep this updated */
};
/**
* Some resource attributes
*/
enum {
R_NAME = 1020,
R_ADDRESS,
R_PASSWORD,
R_TYPE,
R_BACKUP
};
/* Definition of the contents of each Resource */
/* Console "globals" */
class ConsoleResource : public TlsResource {
public:
char *rc_file; /**< startup file */
char *history_file; /**< command history file */
s_password password; /**< UA server password */
uint32_t history_length; /**< readline history length */
char *director; /**< bind to director */
utime_t heartbeat_interval; /**< Interval to send heartbeats to Dir */
bool use_pam_authentication_; /**< Use this console as a PAM console */
ConsoleResource() : TlsResource() {}
};
/* Director */
class DirectorResource : public TlsResource {
public:
uint32_t DIRport; /**< UA server port */
char *address; /**< UA server address */
utime_t heartbeat_interval; /**< Interval to send heartbeats to Dir */
DirectorResource() : TlsResource() {}
};
/* Define the Union of all the above
* resource structure definitions.
*/
union UnionOfResources {
DirectorResource res_dir;
ConsoleResource res_cons;
CommonResourceHeader hdr;
UnionOfResources() {new(&hdr) CommonResourceHeader();}
~UnionOfResources() {}
};
extern ConsoleResource *me; /* "Global" Client resource */
ConfigurationParser *InitConsConfig(const char *configfile, int exit_code);
bool PrintConfigSchemaJson(PoolMem &buffer);
} /* namespace console */
#endif /* BAREOS_CONSOLE_CONSOLE_CONF_H_ */