]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/qt-console/bat_conf.h
Big backport from Enterprise
[bacula/bacula] / bacula / src / qt-console / bat_conf.h
1 /*
2    Bacula(R) - The Network Backup Solution
3
4    Copyright (C) 2000-2017 Kern Sibbald
5
6    The original author of Bacula is Kern Sibbald, with contributions
7    from many others, a complete list can be found in the file AUTHORS.
8
9    You may use this file and others of this release according to the
10    license defined in the LICENSE file, which includes the Affero General
11    Public License, v3.0 ("AGPLv3") and some additional permissions and
12    terms pursuant to its AGPLv3 Section 7.
13
14    This notice must be preserved when any source code is
15    conveyed and/or propagated.
16
17    Bacula(R) is a registered trademark of Kern Sibbald.
18 */
19 /*
20  * Bacula Adminstration Tool (bat) 
21  *
22  *     Kern Sibbald, March 2002
23  */
24
25 #ifndef _BAT_CONF_H_
26 #define _BAT_CONF_H_
27
28 /*
29  * Resource codes -- they must be sequential for indexing
30  */
31
32 enum {
33    R_DIRECTOR = 1001,
34    R_CONSOLE,
35    R_CONSOLE_FONT,
36    R_FIRST = R_DIRECTOR,
37    R_LAST = R_CONSOLE_FONT            /* Keep this updated */
38 };
39
40 /*
41  * Some resource attributes
42  */
43 enum {
44    R_NAME = 1020,
45    R_ADDRESS,
46    R_PASSWORD,
47    R_TYPE,
48    R_BACKUP
49 };
50
51
52 /* Definition of the contents of each Resource */
53 class DIRRES {
54 public:
55    RES   hdr;
56    uint32_t DIRport;                  /* UA server port */
57    char *address;                     /* UA server address */
58    char *password;                    /* UA server password */
59    bool tls_authenticate;             /* Authenticate with tls */
60    bool tls_enable;                   /* Enable TLS */
61    bool tls_require;                  /* Require TLS */
62    char *tls_ca_certfile;             /* TLS CA Certificate File */
63    char *tls_ca_certdir;              /* TLS CA Certificate Directory */
64    char *tls_certfile;                /* TLS Client Certificate File */
65    char *tls_keyfile;                 /* TLS Client Key File */
66    utime_t heartbeat_interval;        /* Dir heartbeat interval */
67
68    TLS_CONTEXT *tls_ctx;              /* Shared TLS Context */
69
70    /* Methods */
71    char *name() const;
72 };
73
74 inline char *DIRRES::name() const { return hdr.name; }
75
76
77 struct CONFONTRES {
78    RES   hdr;
79    char *fontface;                    /* Console Font specification */
80 };
81
82 class CONRES {
83 public:
84    RES   hdr;
85    char *password;                    /* UA server password */
86    bool comm_compression;             /* Enable comm line compression */
87    bool tls_authenticate;             /* Authenticate with tls */
88    bool tls_enable;                   /* Enable TLS on all connections */
89    bool tls_require;                  /* Require TLS on all connections */
90    char *tls_ca_certfile;             /* TLS CA Certificate File */
91    char *tls_ca_certdir;              /* TLS CA Certificate Directory */
92    char *tls_certfile;                /* TLS Client Certificate File */
93    char *tls_keyfile;                 /* TLS Client Key File */
94    char *director;                    /* bind to director */
95    utime_t heartbeat_interval;        /* Cons heartbeat interval */
96
97    TLS_CONTEXT *tls_ctx;              /* Shared TLS Context */
98
99    /* Methods */
100    char *name() const;
101 };
102
103 inline char *CONRES::name() const { return hdr.name; }
104
105
106 /* Define the Union of all the above
107  * resource structure definitions.
108  */
109 union u_res {
110    DIRRES dir_res;
111    CONRES con_res;
112    CONFONTRES con_font;
113    RES hdr;
114 };
115
116 typedef union u_res URES;
117
118 #define GetConsoleResWithName(x) ((CONRES *)GetResWithName(R_CONSOLE, (x)))
119 #define GetDirResWithName(x) ((DIRRES *)GetResWithName(R_DIRECTOR, (x)))
120
121
122 #endif /* _BAT_CONF_H_ */