]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/stored/tape_dev.h
Apply patches from bugs #2325 and #2326 to fix FIFO bugs
[bacula/bacula] / bacula / src / stored / tape_dev.h
1 /*
2    Bacula(R) - The Network Backup Solution
3
4    Copyright (C) 2000-2017 Kern Sibbald
5
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.
8
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.
13
14    This notice must be preserved when any source code is
15    conveyed and/or propagated.
16
17    Bacula(R) is a registered trademark of Kern Sibbald.
18 */
19 /*
20  * Inspired by vtape.h
21  */
22
23 #ifndef __TAPE_DEV_
24 #define __TAPE_DEV_
25
26 struct ALERT {
27    char *Volume;
28    utime_t alert_time;
29    char alerts[10];
30 };
31
32 class tape_dev : public DEVICE {
33 public:
34
35    tape_dev() { };
36    ~tape_dev() { };
37
38    /* DEVICE virtual functions that we redefine with our tape code */
39    bool fsf(int num);
40    bool offline(DCR *dcr);
41    bool rewind(DCR *dcr);
42    bool bsf(int num);
43    void lock_door();
44    void unlock_door();
45    bool reposition(DCR *dcr, uint64_t raddr);
46    bool mount(int timeout);
47    bool unmount(int timeout);
48    bool mount_tape(int mount, int dotimeout);
49    bool weof(DCR *dcr, int num);
50    bool eod(DCR *dcr);
51    bool is_eod_valid(DCR *dcr);
52    void set_ateof();
53    bool open_device(DCR *dcr, int omode);
54    void term(DCR *dcr);
55    const char *print_type();
56    DEVICE *get_dev(DCR *dcr);
57    uint32_t get_hi_addr();
58    uint32_t get_low_addr();
59    uint64_t get_full_addr();
60    bool end_of_volume(DCR *dcr);
61    char *print_addr(char *buf, int32_t buf_len);
62    char *print_addr(char *buf, int32_t maxlen, boffset_t addr);
63    bool get_tape_alerts(DCR *dcr);
64    void show_tape_alerts(DCR *dcr, alert_list_type type,
65       alert_list_which which, alert_cb alert_callback);
66    int delete_alerts();
67
68    alist *alert_list;
69 };
70
71 #endif /* __TAPE_DEV_ */