517b5d2f6aa1c8fa8bf335d1f530028efa251275
[debian/amanda] / docs / vtape-api.txt
1
2          Chapter 26. Virtual Tape API
3 Prev  Part V. Technical Background  Next
4
5 -------------------------------------------------------------------------------
6
7 Chapter 26. Virtual Tape API
8
9
10 Stefan G. Weichinger
11
12 XML-conversion
13 AMANDA Core Team
14 <sgw@amanda.org>
15
16 Note
17
18 Refer to http://www.amanda.org/docs/vtape-api.html for the current version of
19 this document.
20 The upper level AMANDA code (including some of the other tape_xxx routines)
21 calls the following routines which implement a virtual tape table:
22
23 * int tape_access(filename, mode) Acts like access(2) on possibly virtual
24   devices
25 * int tape_open(filename, mode) Acts like open(2) on possibly virtual devices
26 * int tape_stat(filename, buf) Acts like stat(2) on possibly virtual devices
27 * int tapefd_close(tapefd) Acts like close(2) on possibly virtual devices
28 * int tapefd_fsf(tapefd, count) Forward skips the (possibly virtual) device.
29 * int tapefd_read(tapefd, buffer, count) Reads a block from the (possibly
30   virtual) device.
31 * int tapefd_rewind(tapefd) Reads a block from a (possibly virtual) device.
32 * void tapefd_resetofs(tapefd) Uses lseek() tricks to reset the write/read
33   offset counter on a virtual tape device.
34 * int tapefd_unload(tapefd) Unloads the media from a (possibly virtual) device.
35 * int tapefd_status(tapefd) pr- ints status of the (possibly virtual) device to
36   standard output.
37 * int tapefd_weof(tapefd, count) writes a filemark/moves to the next file on a
38   device for writing.
39 * int tapefd_write(tapefd, buffer, count) writes a block of data to a (possibly
40   virtual) device.
41
42 For a tape type xxx, the following routines must be provided, and entered -
43 into the table "vtable" in tape-src/tapeio.c:
44
45 * int xxx_tape_access(filename, mode)
46 * int xxx_tape_open(filename, mode)
47 * int xxx_tape_stat(filename, buf)
48 * int xxx_tapefd_close(xxx_tapefd)
49 * int xxx_tapefd_fsf(xxx_tapefd, count)
50 * int xxx_tapefd_read(xxx_tapefd, buffer, count)
51 * int xxx_tapefd_rewind(xxx_tapefd)
52 * void xxx_tapefd_resetofs(xxx_tapefd)
53 * int xxx_tapefd_unload(xxx_tapefd)
54 * int xxx_tapefd_status(xxx_tapefd)
55 * int xxx_tapefd_weof(xxx_tapefd, count)
56 * int xxx_tapefd_write(xxx_tapefd, buffer, count)
57
58 Along with a prefix string which will identify the type. The initial vtape
59 layer has two types "plain" and "rait" (Redundant Array of Inexpensive Tapes)
60 but we hope to add a "rmt" (remote tape client), and possibly "dvd" types soon.
61 -------------------------------------------------------------------------------
62
63 Prev                              Up                                     Next
64 Chapter 25. AMANDA Security API  Home  Chapter 27. Using Kerberos with AMANDA
65