X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=bacula%2Fsrc%2Ffiled%2Frestore.h;h=91aae066faa24cbc220aa7ea66cb101fb8a05286;hb=10cfd798ced2d27f61ead2de6fe9b1bcc8e3468d;hp=5a9e809b3351d166ef19076f57facb2f923d370a;hpb=337e18d3fbe049bdfdfa3400716e2656152578e8;p=bacula%2Fbacula diff --git a/bacula/src/filed/restore.h b/bacula/src/filed/restore.h index 5a9e809b33..91aae066fa 100644 --- a/bacula/src/filed/restore.h +++ b/bacula/src/filed/restore.h @@ -1,58 +1,60 @@ /* - Bacula® - The Network Backup Solution - - Copyright (C) 2009 Free Software Foundation Europe e.V. - - The main author of Bacula is Kern Sibbald, with contributions from - many others, a complete list can be found in the file AUTHORS. - This program is Free Software; you can redistribute it and/or - modify it under the terms of version two of the GNU General Public - License as published by the Free Software Foundation and included - in the file LICENSE. - - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. - - Bacula® is a registered trademark of Kern Sibbald. - The licensor of Bacula is the Free Software Foundation Europe - (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich, - Switzerland, email:ftf@fsfeurope.org. + Bacula(R) - The Network Backup Solution + + Copyright (C) 2000-2017 Kern Sibbald + + The original author of Bacula is Kern Sibbald, with contributions + from many others, a complete list can be found in the file AUTHORS. + + You may use this file and others of this release according to the + license defined in the LICENSE file, which includes the Affero General + Public License, v3.0 ("AGPLv3") and some additional permissions and + terms pursuant to its AGPLv3 Section 7. + + This notice must be preserved when any source code is + conveyed and/or propagated. + + Bacula(R) is a registered trademark of Kern Sibbald. */ -#ifndef _BACULA_RESTORE_H -#define _BACULA_RESTORE_H +#ifndef __RESTORE_H +#define __RESTORE_H + +struct RESTORE_DATA_STREAM { + int32_t stream; /* stream less new bits */ + char *content; /* stream data */ + uint32_t content_length; /* stream length */ +}; struct RESTORE_CIPHER_CTX { CIPHER_CONTEXT *cipher; uint32_t block_size; - POOLMEM *buf; /* Pointer to descryption buffer */ - int32_t buf_len; /* Count of bytes currently in buf */ - int32_t packet_len; /* Total bytes in packet */ + POOLMEM *buf; /* Pointer to descryption buffer */ + int32_t buf_len; /* Count of bytes currently in buf */ + int32_t packet_len; /* Total bytes in packet */ }; struct r_ctx { JCR *jcr; - int32_t stream; - int32_t prev_stream; + int32_t stream; /* stream less new bits */ + int32_t prev_stream; /* previous stream */ + int32_t full_stream; /* full stream including new bits */ + int32_t comp_stream; /* last compressed stream found. needed only to restore encrypted compressed backup */ BFILE bfd; /* File content */ uint64_t fileAddr; /* file write address */ uint32_t size; /* Size of file */ int flags; /* Options for extract_data() */ BFILE forkbfd; /* Alternative data stream */ uint64_t fork_addr; /* Write address for alternative stream */ - intmax_t fork_size; /* Size of alternate stream */ + int64_t fork_size; /* Size of alternate stream */ int fork_flags; /* Options for extract_data() */ int32_t type; /* file type FT_ */ ATTR *attr; /* Pointer to attributes */ bool extract; /* set when extracting */ + alist *delayed_streams; /* streams that should be restored as last */ + worker *efs; /* Windows EFS worker thread */ + int32_t count; /* Debug count */ SIGNATURE *sig; /* Cryptographic signature (if any) for file */ CRYPTO_SESSION *cs; /* Cryptographic session data (if any) for file */ @@ -61,3 +63,11 @@ struct r_ctx { }; #endif + +#ifdef TEST_WORKER +bool test_write_efs_data(r_ctx &rctx, char *data, const int32_t length); +#endif + +#ifdef HAVE_WIN32 +bool win_write_efs_data(r_ctx &rctx, char *data, const int32_t length); +#endif