1 /*
2    BAREOS® - Backup Archiving REcovery Open Sourced
3 
4    Copyright (C) 2013-2019 Bareos GmbH & Co. KG
5    Copyright (C) 2013-2014 Planets Communications B.V.
6 
7    This program is Free Software; you can redistribute it and/or
8    modify it under the terms of version three of the GNU Affero General Public
9    License as published by the Free Software Foundation, which is
10    listed in the file LICENSE.
11 
12    This program is distributed in the hope that it will be useful, but
13    WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15    Affero General Public License for more details.
16 
17    You should have received a copy of the GNU Affero General Public License
18    along with this program; if not, write to the Free Software
19    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20    02110-1301, USA.
21 */
22 /*
23  * Windows Tape API device abstraction.
24  *
25  * Marco van Wieringen, December 2013
26  */
27 
28 #ifndef BAREOS_WIN32_STORED_BACKENDS_WIN32_TAPE_DEVICE_H_
29 #define BAREOS_WIN32_STORED_BACKENDS_WIN32_TAPE_DEVICE_H_
30 
31 namespace storagedaemon {
32 
33 class win32_tape_device : public generic_tape_device {
34  public:
35   win32_tape_device();
~win32_tape_device()36   ~win32_tape_device() { close(nullptr); }
37 
38   int d_close(int) override;
39   int d_open(const char* pathname, int flags, int mode) override;
40   int d_ioctl(int fd, ioctl_req_t request, char* mt = NULL) override;
41   ssize_t d_read(int fd, void* buffer, size_t count) override;
42   ssize_t d_write(int fd, const void* buffer, size_t count) override;
43   int TapeOp(struct mtop* mt_com);
44   int TapeGet(struct mtget* mt_com);
45   int TapePos(struct mtpos* mt_com);
46 };
47 
48 } /* namespace storagedaemon */
49 #endif /* BAREOS_WIN32_STORED_BACKENDS_WIN32_TAPE_DEVICE_H_ */
50