]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/filed/backup.h
Change copyright as per agreement with FSFE
[bacula/bacula] / bacula / src / filed / backup.h
1 /*
2    Bacula(R) - The Network Backup Solution
3
4    Copyright (C) 2000-2015 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 #ifndef __BACKUP_H
21 #define __BACKUP_H
22
23 #include "ch.h"
24
25 /*
26  * Define a backup context
27  */
28 struct bctx_t {
29    /* Global variables */
30    JCR *jcr;
31    FF_PKT *ff_pkt;                    /* find file packet */
32    int data_stream;
33    BSOCK *sd;
34    uint64_t fileAddr;
35    char *rbuf, *wbuf;
36    int32_t rsize;
37    POOLMEM *msgsave;
38
39    /* Crypto variables */
40    DIGEST *digest;
41    DIGEST *signing_digest;
42    int digest_stream;
43    SIGNATURE *sig;
44    CIPHER_CONTEXT *cipher_ctx;
45    const uint8_t *cipher_input;
46    uint32_t cipher_input_len;
47    uint32_t cipher_block_size;
48    uint32_t encrypted_len;
49
50    /* Compression variables */
51 #if defined(HAVE_LIBZ) || defined(HAVE_LZO)
52    uLong max_compress_len;
53    uLong compress_len;
54    Bytef *cbuf;
55    Bytef *cbuf2;
56 #else
57    uint64_t max_compress_len;
58 #endif
59 #ifdef HAVE_LZO
60    comp_stream_header ch;
61 #endif
62
63 };
64
65 bool crypto_setup_digests(bctx_t &bctx);
66 bool crypto_terminate_digests(bctx_t &bctx);
67 bool crypto_session_start(JCR *jcr);
68 void crypto_session_end(JCR *jcr);
69 bool crypto_session_send(JCR *jcr, BSOCK *sd);
70 bool crypto_allocate_ctx(bctx_t &bctx);
71 void crypto_free(bctx_t &bctx);
72
73 bool encode_and_send_attributes(bctx_t &bctx);
74
75 bool process_and_send_data(bctx_t &bctx);
76
77 #ifdef HAVE_WIN32
78 DWORD WINAPI read_efs_data_cb(PBYTE pbData, PVOID pvCallbackContext, ULONG ulLength);
79 #endif
80
81 #endif