2 * Copyright (c) 2009, 2010 Zmanda, Inc. All Rights Reserved.
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 2 as published
6 * by the Free Software Foundation.
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
10 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300
18 * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
25 Amanda::Feature - interface to Amanda feature bitfields
29 # set up features for this instance and print them
30 my $features = Amanda::Feature::Set->mine();
31 print "my features: $features\n";
33 # parse the other side's features
34 my $client_feat = Amanda::Feature::Set->from_string($feat_str);
36 # or assume the other side's features are old
37 my $client_feat = Amanda::Feature::Set->old()
40 if ($feat->has($Amanda::Feature::fe_options_bsd_auth)) {
41 print "has BSD auth\n";
46 C<Amanda::Feature::Set> objects are fairly simple. The three constructors are
47 shown in the SYNOPSIS: C<mine> (all currently-supported features), C<old> (only
48 the features present in versions of Amanda before features were invented), or
51 An object has three methods to address specific bits:
54 $feat->add($Amanda::Feature::fe_req_xml);
57 $feat->remove($Amanda::Feature::fe_req_xml);
60 if ($feat->has($Amanda::Feature::fe_req_xml)) ..
62 And C<as_string> which converts the feature into a string.
64 All features are available in scalars of the same name in the
65 C<Amanda::Feature> namespace.
67 =head1 FEATURE DOCUMENTATION
69 This section includes as much information as is available for each feature.
70 Each subsection begins with a description of the protocols in
71 which the feature is relevant, and the end on which the feature is relevant.
72 Any known dependencies for the feature are also mentioned. Assume that any
73 omissions in this section are due to limited information.
77 =item fe_recover_splits
82 If set, the recovery application supports a DATA connection on a separate TCP
85 Dependencies: this feature is always set when amidxtaped is invoked via
88 =item fe_amidxtaped_exchange_features
93 If set, amidxtaped can process the FEATURES= line in the command.
94 The flag is actually tested by amrecover on amindexd's feature matrix, due to
95 ordering constraints, so it assumes that amindexd and amidxtaped have the same
98 =item fe_amrecover_FEEDME
103 If set, amrecover understands FEEDME lines on the control connection.
105 Dependencies: this feature can only be set if fe_recover_splits is set.
107 =item fe_amrecover_timestamp
112 If set, the recovery application supports full timestamps; otherwise, it can
113 only process datestamps.
115 =item fe_amidxtaped_options_hostname
117 =item fe_amidxtaped_options_features
119 =item fe_amidxtaped_options_auth
124 These feature flags indicate what fields amidxtaped supports in the OPTIONS
125 line. Of course, the client would need to know these features before it
126 received the OPTIONS line, which would necessitate sending a NOOP request
127 first. In practice, they are completely unused.
129 =item fe_amrecover_message
134 If set, the recovery applications understands MESSAGE lines on the control connection.
136 Dependencies: a control connection only exists if amidxtaped is launched from
137 amandad or I<fe_recover_splits> is used.
139 =item fe_amrecover_feedme_tape
144 If set, amidxtaped recognizes the TAPE response to FEEDME.
146 =item fe_amrecover_dle_in_header
148 =item fe_amrecover_origsize_in_header
153 If set, amrecover can process a header containing the corresponding attribute.
154 If not set, the attribute should be stripped from any headers sent to
157 Feature Header Attribute
158 ------- ----------------
159 dle_in_header dle_str
160 origsize_in_header orig_size
162 =item fe_amidxtaped_abort
167 If set, amidxtaped can handle an ABORT message just before the datapath
170 =item fe_amidxtaped_datapath
173 FEATURE OF: client and server
175 If set on the client, then amrecover expects the server to start a DATAPATH
176 negotiation after the header is sent. If set on the server, then amrecover can
177 process a DATAPATH negotiation after the header is sent. In other words, the
178 feature must be present on both sides for this negotiation to take place. The
179 DATAPATH negotiation is a three-way handshake:
181 AVAIL-DATAPATH <datapath list> # to amidxtaped
182 USE-DATAPATH <datapath> [<ip:port> ..] # from amidxtaped
183 DATAPATH-OK # to amidxtaped
185 No data may be transmitted until the handshake is complete. See the wiki
186 article entitled "amidxtaped protocol" for more detail.
188 =item fe_amidxtaped_fsf
190 =item fe_amidxtaped_label
192 =item fe_amidxtaped_device
194 =item fe_amidxtaped_host
196 =item fe_amidxtaped_disk
198 =item fe_amidxtaped_datestamp
200 =item fe_amidxtaped_header
202 =item fe_amidxtaped_config
207 If set, each feature means that amidxtaped can process the corresponding
208 command line. Note that I<fe_amidxtaped_label> does not indicate whether that
209 field contains a label or a tapespec.
211 =item fe_amidxtaped_nargs
216 If set, then amidxtaped can handle the "nargs" form of a command: The first
217 line was the number of arguments, folloewd by one argument by line. Amidxtaped
218 forked amrestore with these arguments.
220 This feature is no longer supported.
222 =item fe_amrecover_correct_disk_quoting
225 FEATURE OF: amrecover
227 Amrecovers that do not have this flag may send incorrectly-quoted DISK lines, so
228 those DISK lines should be ignored.
230 =item fe_amindexd_quote_label
235 If set, amindexd quote the label (holdingdisk filename)
237 =item fe_amrecover_receive_unfiltered
242 If set, amidxtaped do not decompress/decrypt client compressed/decrypted stream.
244 =item fe_application_client_name
246 If set, add the 'client_name' for application in the xml code.
248 =item fe_script_client_name
250 If set, add the 'client_name' for script in the xml code.
252 =item fe_dumptype_property
254 If set, add the dumptype property in the xml code.