1 # Copyright (c) 2009-2012 Zmanda Inc. All Rights Reserved.
3 # This program is free software; you can redistribute it and/or modify it
4 # under the terms of the GNU General Public License version 2 as published
5 # by the Free Software Foundation.
7 # This program is distributed in the hope that it will be useful, but
8 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
9 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 # You should have received a copy of the GNU General Public License along
13 # with this program; if not, write to the Free Software Foundation, Inc.,
14 # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 # Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300
17 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
21 Amanda::Taper::Protocol
25 This package is a component of the Amanda taper, and is not intended for use by
26 other scripts or applications.
28 This package define the protocol between the taper and the driver, it is
29 used by L<Amanda::Taper::Controller> and L<Amanda::Taper::Worker>
33 use lib '@amperldir@';
37 package Amanda::Taper::Protocol;
39 use Amanda::IPC::LineProtocol;
40 use base "Amanda::IPC::LineProtocol";
42 use constant START_TAPER => message("START-TAPER",
43 format => [ qw( worker_name timestamp ) ],
46 use constant PORT_WRITE => message("PORT-WRITE",
47 format => [ qw( worker_name handle hostname diskname level datestamp
48 dle_tape_splitsize dle_split_diskbuffer dle_fallback_splitsize dle_allow_split
49 part_size part_cache_type part_cache_dir part_cache_max_size
53 use constant FILE_WRITE => message("FILE-WRITE",
54 format => [ qw( worker_name handle filename hostname diskname level datestamp
55 dle_tape_splitsize dle_split_diskbuffer dle_fallback_splitsize dle_allow_split
56 part_size part_cache_type part_cache_dir part_cache_max_size
60 use constant START_SCAN => message("START-SCAN",
61 format => [ qw( worker_name handle ) ],
64 use constant NEW_TAPE => message("NEW-TAPE",
66 in => [ qw( worker_name handle ) ],
67 out => [ qw( handle label ) ],
71 use constant NO_NEW_TAPE => message("NO-NEW-TAPE",
73 in => [ qw( worker_name handle reason ) ],
74 out => [ qw( handle ) ],
78 use constant FAILED => message("FAILED",
80 in => [ qw( worker_name handle ) ],
81 out => [ qw( handle input taper inputerr tapererr ) ],
85 use constant DONE => message("DONE",
87 in => [ qw( worker_name handle orig_kb ) ],
88 out => [ qw( handle input taper stats inputerr tapererr ) ],
92 use constant QUIT => message("QUIT",
96 use constant TAPER_OK => message("TAPER-OK",
97 format => [ qw( worker_name ) ],
100 use constant TAPE_ERROR => message("TAPE-ERROR",
101 format => [ qw( worker_name message ) ],
104 use constant PARTIAL => message("PARTIAL",
105 format => [ qw( handle input taper stats inputerr tapererr ) ],
108 use constant PARTDONE => message("PARTDONE",
109 format => [ qw( handle label fileno kb stats ) ],
112 use constant REQUEST_NEW_TAPE => message("REQUEST-NEW-TAPE",
113 format => [ qw( handle ) ],
116 use constant PORT => message("PORT",
117 format => [ qw( worker_name handle port ipports ) ],
120 use constant BAD_COMMAND => message("BAD-COMMAND",
121 format => [ qw( message ) ],
124 use constant TAKE_SCRIBE_FROM => message("TAKE-SCRIBE-FROM",
125 format => [ qw( worker_name handle from_worker_name) ],
128 use constant DUMPER_STATUS => message("DUMPER-STATUS",
129 format => [ qw( handle ) ],
132 use constant CLOSE_VOLUME => message("CLOSE-VOLUME",
133 format => [ qw( worker_name ) ],