1 /*
2    BAREOS® - Backup Archiving REcovery Open Sourced
3 
4    Copyright (C) 2018-2019 Bareos GmbH & Co. KG
5 
6    This program is Free Software; you can redistribute it and/or
7    modify it under the terms of version three of the GNU Affero General Public
8    License as published by the Free Software Foundation and included
9    in the file LICENSE.
10 
11    This program is distributed in the hope that it will be useful, but
12    WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14    Affero General Public License for more details.
15 
16    You should have received a copy of the GNU Affero General Public License
17    along with this program; if not, write to the Free Software
18    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19    02110-1301, USA.
20 */
21 
22 #ifndef BAREOS_DIRD_NDMP_DMA_STORAGE_H_
23 #define BAREOS_DIRD_NDMP_DMA_STORAGE_H_
24 
25 struct ndm_job_param;
26 class dlist;
27 
28 namespace directordaemon {
29 
30 void DoNdmpStorageStatus(UaContext* ua, StorageResource* store, char* cmd);
31 dlist* ndmp_get_vol_list(UaContext* ua,
32                          StorageResource* store,
33                          bool listall,
34                          bool scan);
35 slot_number_t NdmpGetNumSlots(UaContext* ua, StorageResource* store);
36 drive_number_t NdmpGetNumDrives(UaContext* ua, StorageResource* store);
37 bool NdmpTransferVolume(UaContext* ua,
38                         StorageResource* store,
39                         slot_number_t src_slot,
40                         slot_number_t dst_slot);
41 bool NdmpAutochangerVolumeOperation(UaContext* ua,
42                                     StorageResource* store,
43                                     const char* operation,
44                                     drive_number_t drive,
45                                     slot_number_t slot);
46 bool NdmpSendLabelRequest(UaContext* ua,
47                           StorageResource* store,
48                           MediaDbRecord* mr,
49                           MediaDbRecord* omr,
50                           PoolDbRecord* pr,
51                           bool relabel,
52                           drive_number_t drive,
53                           slot_number_t slot);
54 char* lookup_ndmp_drive(StorageResource* store, drive_number_t drive);
55 bool NdmpUpdateStorageMappings(JobControlRecord* jcr, StorageResource* store);
56 bool ndmp_native_setup_robot_and_tape_for_native_backup_job(
57     JobControlRecord* jcr,
58     StorageResource* store,
59     ndm_job_param& ndmp_job);
60 bool unreserve_ndmp_tapedevice_for_job(StorageResource* store,
61                                        JobControlRecord* jcr);
62 } /* namespace directordaemon */
63 #endif  // BAREOS_DIRD_NDMP_DMA_STORAGE_H_
64