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