2 Bacula(R) - The Network Backup Solution
4 Copyright (C) 2000-2017 Kern Sibbald
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.
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.
14 This notice must be preserved when any source code is
15 conveyed and/or propagated.
17 Bacula(R) is a registered trademark of Kern Sibbald.
20 * Generic routines for writing Cloud Volumes
22 * Written by Kern Sibbald, May MMXVI
30 #include "cloud_driver.h"
32 class cloud_dev: public file_dev {
38 cloud_dev(JCR *jcr, DEVRES *device);
43 /* DEVICE virtual interfaces that we redefine */
44 boffset_t lseek(DCR *dcr, off_t offset, int whence);
45 bool rewind(DCR *dcr);
46 bool reposition(DCR *dcr, uint64_t raddr);
47 bool open_device(DCR *dcr, int omode);
48 bool open_next_part(DCR *dcr);
49 bool truncate(DCR *dcr);
50 int truncate_cache(DCR *dcr, const char *VolName, int64_t *size);
51 bool upload_cache(DCR *dcr, const char *VolName, POOLMEM *&err);
53 bool update_pos(DCR *dcr);
54 bool is_eod_valid(DCR *dcr);
56 int read_dev_volume_label(DCR *dcr);
57 const char *print_type();
58 DEVICE *get_dev(DCR *dcr);
59 uint32_t get_hi_addr();
60 uint32_t get_low_addr();
61 uint64_t get_full_addr();
62 uint64_t get_full_addr(boffset_t addr);
63 char *print_addr(char *buf, int32_t buf_len);
64 char *print_addr(char *buf, int32_t maxlen, boffset_t addr);
65 bool do_size_checks(DCR *dcr, DEV_BLOCK *block);
66 bool write_volume_label(DCR *dcr,
67 const char *VolName, const char *PoolName,
68 bool relabel, bool no_prelabel);
69 bool rewrite_volume_label(DCR *dcr, bool recycle);
70 bool start_of_job(DCR *dcr);
71 bool end_of_job(DCR *dcr);
72 bool get_cloud_volumes_list(DCR* dcr, alist *volumes, POOLMEM *&err) { return driver->get_cloud_volumes_list(dcr, volumes, err); };
73 bool get_cloud_volume_parts_list(DCR *dcr, const char *VolumeName, ilist *parts, POOLMEM *&err) { return driver->get_cloud_volume_parts_list(dcr, VolumeName, parts, err);};
74 uint32_t get_cloud_upload_transfer_status(POOL_MEM &msg, bool verbose);
75 uint32_t get_cloud_download_transfer_status(POOL_MEM &msg, bool verbose);
78 #endif /* _CLOUD_DEV_H_ */