]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/qt-console/bat_conf.h
Backport from BEE
[bacula/bacula] / bacula / src / qt-console / bat_conf.h
1 /*
2    Bacula® - The Network Backup Solution
3
4    Copyright (C) 2002-2014 Free Software Foundation Europe e.V.
5
6    The main author of Bacula is Kern Sibbald, with contributions from many
7    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    Bacula® is a registered trademark of Kern Sibbald.
15 */
16 /*
17  * Bacula Adminstration Tool (bat)
18  *
19  *     Kern Sibbald, March 2002
20  *
21  *     Version $Id$
22  */
23
24 #ifndef _BAT_CONF_H_
25 #define _BAT_CONF_H_
26
27 /*
28  * Resource codes -- they must be sequential for indexing
29  */
30
31 enum {
32    R_DIRECTOR = 1001,
33    R_CONSOLE,
34    R_CONSOLE_FONT,
35    R_FIRST = R_DIRECTOR,
36    R_LAST = R_CONSOLE_FONT            /* Keep this updated */
37 };
38
39 /*
40  * Some resource attributes
41  */
42 enum {
43    R_NAME = 1020,
44    R_ADDRESS,
45    R_PASSWORD,
46    R_TYPE,
47    R_BACKUP
48 };
49
50
51 /* Definition of the contents of each Resource */
52 class DIRRES {
53 public:
54    RES   hdr;
55    uint32_t DIRport;                  /* UA server port */
56    char *address;                     /* UA server address */
57    char *password;                    /* UA server password */
58    bool tls_authenticate;             /* Authenticate with tls */
59    bool tls_enable;                   /* Enable TLS */
60    bool tls_require;                  /* Require TLS */
61    char *tls_ca_certfile;             /* TLS CA Certificate File */
62    char *tls_ca_certdir;              /* TLS CA Certificate Directory */
63    char *tls_certfile;                /* TLS Client Certificate File */
64    char *tls_keyfile;                 /* TLS Client Key File */
65    utime_t heartbeat_interval;        /* Dir heartbeat interval */
66
67    TLS_CONTEXT *tls_ctx;              /* Shared TLS Context */
68
69    /* Methods */
70    char *name() const;
71 };
72
73 inline char *DIRRES::name() const { return hdr.name; }
74
75
76 struct CONFONTRES {
77    RES   hdr;
78    char *fontface;                    /* Console Font specification */
79 };
80
81 class CONRES {
82 public:
83    RES   hdr;
84    char *password;                    /* UA server password */
85    bool tls_authenticate;             /* Authenticate with tls */
86    bool tls_enable;                   /* Enable TLS on all connections */
87    bool tls_require;                  /* Require TLS on all connections */
88    char *tls_ca_certfile;             /* TLS CA Certificate File */
89    char *tls_ca_certdir;              /* TLS CA Certificate Directory */
90    char *tls_certfile;                /* TLS Client Certificate File */
91    char *tls_keyfile;                 /* TLS Client Key File */
92    char *director;                    /* bind to director */
93    utime_t heartbeat_interval;        /* Cons heartbeat interval */
94
95    TLS_CONTEXT *tls_ctx;              /* Shared TLS Context */
96
97    /* Methods */
98    char *name() const;
99 };
100
101 inline char *CONRES::name() const { return hdr.name; }
102
103
104 /* Define the Union of all the above
105  * resource structure definitions.
106  */
107 union u_res {
108    DIRRES dir_res;
109    CONRES con_res;
110    CONFONTRES con_font;
111    RES hdr;
112 };
113
114 typedef union u_res URES;
115
116 #define GetConsoleResWithName(x) ((CONRES *)GetResWithName(R_CONSOLE, (x)))
117 #define GetDirResWithName(x) ((DIRRES *)GetResWithName(R_DIRECTOR, (x)))
118
119
120 #endif /* _BAT_CONF_H_ */