]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/qt-console/bat_conf.h
143168c4bdd1b943ee1c124652f413704342da64
[bacula/bacula] / bacula / src / qt-console / bat_conf.h
1 /*
2    Bacula(R) - The Network Backup Solution
3
4    Copyright (C) 2000-2015 Kern Sibbald
5    Copyright (C) 2002-2014 Free Software Foundation Europe e.V.
6
7    The original author of Bacula is Kern Sibbald, with contributions
8    from many others, a complete list can be found in the file AUTHORS.
9
10    You may use this file and others of this release according to the
11    license defined in the LICENSE file, which includes the Affero General
12    Public License, v3.0 ("AGPLv3") and some additional permissions and
13    terms pursuant to its AGPLv3 Section 7.
14
15    This notice must be preserved when any source code is 
16    conveyed and/or propagated.
17
18    Bacula(R) is a registered trademark of Kern Sibbald.
19 */
20 /*
21  * Bacula Adminstration Tool (bat)
22  *
23  *     Kern Sibbald, March 2002
24  */
25
26 #ifndef _BAT_CONF_H_
27 #define _BAT_CONF_H_
28
29 /*
30  * Resource codes -- they must be sequential for indexing
31  */
32
33 enum {
34    R_DIRECTOR = 1001,
35    R_CONSOLE,
36    R_CONSOLE_FONT,
37    R_FIRST = R_DIRECTOR,
38    R_LAST = R_CONSOLE_FONT            /* Keep this updated */
39 };
40
41 /*
42  * Some resource attributes
43  */
44 enum {
45    R_NAME = 1020,
46    R_ADDRESS,
47    R_PASSWORD,
48    R_TYPE,
49    R_BACKUP
50 };
51
52
53 /* Definition of the contents of each Resource */
54 class DIRRES {
55 public:
56    RES   hdr;
57    uint32_t DIRport;                  /* UA server port */
58    char *address;                     /* UA server address */
59    char *password;                    /* UA server password */
60    bool tls_authenticate;             /* Authenticate with tls */
61    bool tls_enable;                   /* Enable TLS */
62    bool tls_require;                  /* Require TLS */
63    char *tls_ca_certfile;             /* TLS CA Certificate File */
64    char *tls_ca_certdir;              /* TLS CA Certificate Directory */
65    char *tls_certfile;                /* TLS Client Certificate File */
66    char *tls_keyfile;                 /* TLS Client Key File */
67    utime_t heartbeat_interval;        /* Dir heartbeat interval */
68
69    TLS_CONTEXT *tls_ctx;              /* Shared TLS Context */
70
71    /* Methods */
72    char *name() const;
73 };
74
75 inline char *DIRRES::name() const { return hdr.name; }
76
77
78 struct CONFONTRES {
79    RES   hdr;
80    char *fontface;                    /* Console Font specification */
81 };
82
83 class CONRES {
84 public:
85    RES   hdr;
86    char *password;                    /* UA server password */
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_ */