]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/filed/restore.h
Add LZO compression support in bacula-fd.
[bacula/bacula] / bacula / src / filed / restore.h
1 /*
2    Bacula® - The Network Backup Solution
3
4    Copyright (C) 2009 Free Software Foundation Europe e.V.
5
6    The main author of Bacula is Kern Sibbald, with contributions from
7    many others, a complete list can be found in the file AUTHORS.
8    This program is Free Software; you can redistribute it and/or
9    modify it under the terms of version three of the GNU Affero General Public
10    License as published by the Free Software Foundation and included
11    in the file LICENSE.
12
13    This program is distributed in the hope that it will be useful, but
14    WITHOUT ANY WARRANTY; without even the implied warranty of
15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16    General Public License for more details.
17
18    You should have received a copy of the GNU Affero General Public License
19    along with this program; if not, write to the Free Software
20    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21    02110-1301, USA.
22
23    Bacula® is a registered trademark of Kern Sibbald.
24    The licensor of Bacula is the Free Software Foundation Europe
25    (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
26    Switzerland, email:ftf@fsfeurope.org.
27 */
28
29 #ifndef __RESTORE_H
30 #define __RESTORE_H
31
32 struct RESTORE_CIPHER_CTX {
33    CIPHER_CONTEXT *cipher;
34    uint32_t block_size;
35
36    POOLMEM *buf;       /* Pointer to descryption buffer */
37    int32_t buf_len;    /* Count of bytes currently in buf */ 
38    int32_t packet_len; /* Total bytes in packet */
39 };
40
41 struct r_ctx {
42    JCR *jcr;
43    int32_t stream;                     /* stream less new bits */
44    int32_t prev_stream;                /* previous stream */
45    int32_t full_stream;                /* full stream including new bits */
46    int32_t comp_stream;                /* last compressed stream found. needed only to restore encrypted compressed backup */
47    BFILE bfd;                          /* File content */
48    uint64_t fileAddr;                  /* file write address */
49    uint32_t size;                      /* Size of file */
50    int flags;                          /* Options for extract_data() */
51    BFILE forkbfd;                      /* Alternative data stream */
52    uint64_t fork_addr;                 /* Write address for alternative stream */
53    intmax_t fork_size;                 /* Size of alternate stream */
54    int fork_flags;                     /* Options for extract_data() */
55    int32_t type;                       /* file type FT_ */
56    ATTR *attr;                         /* Pointer to attributes */
57    bool extract;                       /* set when extracting */
58
59    SIGNATURE *sig;                     /* Cryptographic signature (if any) for file */
60    CRYPTO_SESSION *cs;                 /* Cryptographic session data (if any) for file */
61    RESTORE_CIPHER_CTX cipher_ctx;      /* Cryptographic restore context (if any) for file */
62    RESTORE_CIPHER_CTX fork_cipher_ctx; /* Cryptographic restore context (if any) for alternative stream */
63 };
64
65 #endif