1 # This file was automatically generated by SWIG (http://www.swig.org).
4 # Do not make changes to this file unless you know what you are doing--modify
5 # the SWIG interface file instead.
7 package Amanda::Feature;
9 use base qw(DynaLoader);
10 package Amanda::Featurec;
11 bootstrap Amanda::Feature;
12 package Amanda::Feature;
15 # ---------- BASE METHODS -------------
17 package Amanda::Feature;
20 my ($classname,$obj) = @_;
21 return bless $obj, $classname;
31 my ($self,$field) = @_;
32 my $member_func = "swig_${field}_get";
33 $self->$member_func();
37 my ($self,$field,$newval) = @_;
38 my $member_func = "swig_${field}_set";
39 $self->$member_func($newval);
48 # ------- FUNCTION WRAPPERS --------
50 package Amanda::Feature;
52 *am_string_to_feature = *Amanda::Featurec::am_string_to_feature;
53 *am_set_default_feature_set = *Amanda::Featurec::am_set_default_feature_set;
54 *am_init_feature_set = *Amanda::Featurec::am_init_feature_set;
56 ############# Class : Amanda::Feature::Set ##############
58 package Amanda::Feature::Set;
59 use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
60 @ISA = qw( Amanda::Feature );
64 return unless $_[0]->isa('HASH');
65 my $self = tied(%{$_[0]});
66 return unless defined $self;
67 delete $ITERATORS{$self};
68 if (exists $OWNER{$self}) {
69 Amanda::Featurec::delete_Set($self);
74 *add = *Amanda::Featurec::Set_add;
75 *remove = *Amanda::Featurec::Set_remove;
76 *has = *Amanda::Featurec::Set_has;
77 *as_string = *Amanda::Featurec::Set_as_string;
80 my $self = Amanda::Featurec::new_Set(@_);
81 bless $self, $pkg if defined($self);
86 my $ptr = tied(%$self);
92 my $ptr = tied(%$self);
97 # ------- VARIABLE STUBS --------
99 package Amanda::Feature;
101 *have_feature_support = *Amanda::Featurec::have_feature_support;
102 *fe_options_auth = *Amanda::Featurec::fe_options_auth;
103 *fe_selfcheck_req = *Amanda::Featurec::fe_selfcheck_req;
104 *fe_selfcheck_req_device = *Amanda::Featurec::fe_selfcheck_req_device;
105 *fe_selfcheck_rep = *Amanda::Featurec::fe_selfcheck_rep;
106 *fe_sendsize_req_no_options = *Amanda::Featurec::fe_sendsize_req_no_options;
107 *fe_sendsize_req_options = *Amanda::Featurec::fe_sendsize_req_options;
108 *fe_sendsize_req_device = *Amanda::Featurec::fe_sendsize_req_device;
109 *fe_sendsize_rep = *Amanda::Featurec::fe_sendsize_rep;
110 *fe_sendbackup_req = *Amanda::Featurec::fe_sendbackup_req;
111 *fe_sendbackup_req_device = *Amanda::Featurec::fe_sendbackup_req_device;
112 *fe_sendbackup_rep = *Amanda::Featurec::fe_sendbackup_rep;
113 *fe_noop_req = *Amanda::Featurec::fe_noop_req;
114 *fe_noop_rep = *Amanda::Featurec::fe_noop_rep;
115 *fe_program_dump = *Amanda::Featurec::fe_program_dump;
116 *fe_program_gnutar = *Amanda::Featurec::fe_program_gnutar;
117 *fe_program_application_api = *Amanda::Featurec::fe_program_application_api;
118 *fe_options_compress_fast = *Amanda::Featurec::fe_options_compress_fast;
119 *fe_options_compress_best = *Amanda::Featurec::fe_options_compress_best;
120 *fe_options_srvcomp_fast = *Amanda::Featurec::fe_options_srvcomp_fast;
121 *fe_options_srvcomp_best = *Amanda::Featurec::fe_options_srvcomp_best;
122 *fe_options_no_record = *Amanda::Featurec::fe_options_no_record;
123 *fe_options_index = *Amanda::Featurec::fe_options_index;
124 *fe_options_exclude_file = *Amanda::Featurec::fe_options_exclude_file;
125 *fe_options_exclude_list = *Amanda::Featurec::fe_options_exclude_list;
126 *fe_options_multiple_exclude = *Amanda::Featurec::fe_options_multiple_exclude;
127 *fe_options_optional_exclude = *Amanda::Featurec::fe_options_optional_exclude;
128 *fe_options_include_file = *Amanda::Featurec::fe_options_include_file;
129 *fe_options_include_list = *Amanda::Featurec::fe_options_include_list;
130 *fe_options_multiple_include = *Amanda::Featurec::fe_options_multiple_include;
131 *fe_options_optional_include = *Amanda::Featurec::fe_options_optional_include;
132 *fe_options_bsd_auth = *Amanda::Featurec::fe_options_bsd_auth;
133 *fe_options_krb4_auth = *Amanda::Featurec::fe_options_krb4_auth;
134 *fe_options_kencrypt = *Amanda::Featurec::fe_options_kencrypt;
135 *fe_req_options_maxdumps = *Amanda::Featurec::fe_req_options_maxdumps;
136 *fe_req_options_hostname = *Amanda::Featurec::fe_req_options_hostname;
137 *fe_req_options_features = *Amanda::Featurec::fe_req_options_features;
138 *fe_rep_options_maxdumps = *Amanda::Featurec::fe_rep_options_maxdumps;
139 *fe_rep_options_hostname = *Amanda::Featurec::fe_rep_options_hostname;
140 *fe_rep_options_features = *Amanda::Featurec::fe_rep_options_features;
141 *fe_rep_options_sendbackup_options = *Amanda::Featurec::fe_rep_options_sendbackup_options;
142 *fe_amindexd_fileno_in_OLSD = *Amanda::Featurec::fe_amindexd_fileno_in_OLSD;
143 *fe_amindexd_fileno_in_ORLD = *Amanda::Featurec::fe_amindexd_fileno_in_ORLD;
144 *fe_amidxtaped_fsf = *Amanda::Featurec::fe_amidxtaped_fsf;
145 *fe_amidxtaped_label = *Amanda::Featurec::fe_amidxtaped_label;
146 *fe_amidxtaped_device = *Amanda::Featurec::fe_amidxtaped_device;
147 *fe_amidxtaped_host = *Amanda::Featurec::fe_amidxtaped_host;
148 *fe_amidxtaped_disk = *Amanda::Featurec::fe_amidxtaped_disk;
149 *fe_amidxtaped_datestamp = *Amanda::Featurec::fe_amidxtaped_datestamp;
150 *fe_amidxtaped_header = *Amanda::Featurec::fe_amidxtaped_header;
151 *fe_amidxtaped_nargs = *Amanda::Featurec::fe_amidxtaped_nargs;
152 *fe_amidxtaped_config = *Amanda::Featurec::fe_amidxtaped_config;
153 *fe_partial_estimate = *Amanda::Featurec::fe_partial_estimate;
154 *fe_calcsize_estimate = *Amanda::Featurec::fe_calcsize_estimate;
155 *fe_selfcheck_calcsize = *Amanda::Featurec::fe_selfcheck_calcsize;
156 *fe_recover_splits = *Amanda::Featurec::fe_recover_splits;
157 *fe_amidxtaped_exchange_features = *Amanda::Featurec::fe_amidxtaped_exchange_features;
158 *fe_options_compress_cust = *Amanda::Featurec::fe_options_compress_cust;
159 *fe_options_srvcomp_cust = *Amanda::Featurec::fe_options_srvcomp_cust;
160 *fe_options_encrypt_cust = *Amanda::Featurec::fe_options_encrypt_cust;
161 *fe_options_encrypt_serv_cust = *Amanda::Featurec::fe_options_encrypt_serv_cust;
162 *fe_options_client_decrypt_option = *Amanda::Featurec::fe_options_client_decrypt_option;
163 *fe_options_server_decrypt_option = *Amanda::Featurec::fe_options_server_decrypt_option;
164 *fe_amindexd_marshall_in_OLSD = *Amanda::Featurec::fe_amindexd_marshall_in_OLSD;
165 *fe_amindexd_marshall_in_ORLD = *Amanda::Featurec::fe_amindexd_marshall_in_ORLD;
166 *fe_amindexd_marshall_in_DHST = *Amanda::Featurec::fe_amindexd_marshall_in_DHST;
167 *fe_amrecover_FEEDME = *Amanda::Featurec::fe_amrecover_FEEDME;
168 *fe_amrecover_timestamp = *Amanda::Featurec::fe_amrecover_timestamp;
169 *fe_interface_quoted_text = *Amanda::Featurec::fe_interface_quoted_text;
170 *fe_program_star = *Amanda::Featurec::fe_program_star;
171 *fe_amindexd_options_hostname = *Amanda::Featurec::fe_amindexd_options_hostname;
172 *fe_amindexd_options_features = *Amanda::Featurec::fe_amindexd_options_features;
173 *fe_amindexd_options_auth = *Amanda::Featurec::fe_amindexd_options_auth;
174 *fe_amidxtaped_options_hostname = *Amanda::Featurec::fe_amidxtaped_options_hostname;
175 *fe_amidxtaped_options_features = *Amanda::Featurec::fe_amidxtaped_options_features;
176 *fe_amidxtaped_options_auth = *Amanda::Featurec::fe_amidxtaped_options_auth;
177 *fe_amrecover_message = *Amanda::Featurec::fe_amrecover_message;
178 *fe_amrecover_feedme_tape = *Amanda::Featurec::fe_amrecover_feedme_tape;
179 *fe_req_options_config = *Amanda::Featurec::fe_req_options_config;
180 *fe_rep_sendsize_quoted_error = *Amanda::Featurec::fe_rep_sendsize_quoted_error;
181 *fe_req_xml = *Amanda::Featurec::fe_req_xml;
182 *fe_pp_script = *Amanda::Featurec::fe_pp_script;
183 *fe_amindexd_DLE = *Amanda::Featurec::fe_amindexd_DLE;
184 *fe_amrecover_dle_in_header = *Amanda::Featurec::fe_amrecover_dle_in_header;
185 *fe_xml_estimate = *Amanda::Featurec::fe_xml_estimate;
186 *fe_xml_property_priority = *Amanda::Featurec::fe_xml_property_priority;
187 *fe_sendsize_rep_warning = *Amanda::Featurec::fe_sendsize_rep_warning;
188 *fe_xml_estimatelist = *Amanda::Featurec::fe_xml_estimatelist;
189 *fe_xml_level_server = *Amanda::Featurec::fe_xml_level_server;
190 *fe_xml_data_path = *Amanda::Featurec::fe_xml_data_path;
191 *fe_xml_directtcp_list = *Amanda::Featurec::fe_xml_directtcp_list;
192 *fe_amidxtaped_datapath = *Amanda::Featurec::fe_amidxtaped_datapath;
193 *fe_sendbackup_noop = *Amanda::Featurec::fe_sendbackup_noop;
194 *fe_amrecover_origsize_in_header = *Amanda::Featurec::fe_amrecover_origsize_in_header;
195 *fe_amidxtaped_abort = *Amanda::Featurec::fe_amidxtaped_abort;
196 *fe_amrecover_correct_disk_quoting = *Amanda::Featurec::fe_amrecover_correct_disk_quoting;
197 *last_feature = *Amanda::Featurec::last_feature;
205 Amanda::Feature - interface to Amanda feature bitfields
209 # set up features for this instance and print them
210 my $features = Amanda::Feature::Set->mine();
211 print "my features: $features\n";
213 # parse the other side's features
214 my $client_feat = Amanda::Feature::Set->from_string($feat_str);
216 # or assume the other side's features are old
217 my $client_feat = Amanda::Feature::Set->old()
220 if ($feat->has($Amanda::Feature::fe_options_bsd_auth)) {
221 print "has BSD auth\n";
226 C<Amanda::Feature::Set> objects are fairly simple. The three constructors are
227 shown in the SYNOPSIS: C<mine> (all currently-supported features), C<old> (only
228 the features present in versions of Amanda before features were invented), or
231 An object has three methods to address specific bits:
234 $feat->add($Amanda::Feature::fe_req_xml);
237 $feat->remove($Amanda::Feature::fe_req_xml);
240 if ($feat->has($Amanda::Feature::fe_req_xml)) ..
242 And C<as_string> which converts the feature into a string.
244 All features are available in scalars of the same name in the
245 C<Amanda::Feature> namespace.
247 =head1 FEATURE DOCUMENTATION
249 This section includes as much information as is available for each feature.
250 Each subsection begins with a description of the protocols in
251 which the feature is relevant, and the end on which the feature is relevant.
252 Any known dependencies for the feature are also mentioned. Assume that any
253 omissions in this section are due to limited information.
257 =item fe_recover_splits
262 If set, the recovery application supports a DATA connection on a separate TCP
265 Dependencies: this feature is always set when amidxtaped is invoked via
268 =item fe_amidxtaped_exchange_features
273 If set, amidxtaped can process the FEATURES= line in the command.
274 The flag is actually tested by amrecover on amindexd's feature matrix, due to
275 ordering constraints, so it assumes that amindexd and amidxtaped have the same
278 =item fe_amrecover_FEEDME
283 If set, amrecover understands FEEDME lines on the control connection.
285 Dependencies: this feature can only be set if fe_recover_splits is set.
287 =item fe_amrecover_timestamp
292 If set, the recovery application supports full timestamps; otherwise, it can
293 only process datestamps.
295 =item fe_amidxtaped_options_hostname
297 =item fe_amidxtaped_options_features
299 =item fe_amidxtaped_options_auth
304 These feature flags indicate what fields amidxtaped supports in the OPTIONS
305 line. Of course, the client would need to know these features before it
306 received the OPTIONS line, which would necessitate sending a NOOP request
307 first. In practice, they are completely unused.
309 =item fe_amrecover_message
314 If set, the recovery applications understands MESSAGE lines on the control connection.
316 Dependencies: a control connection only exists if amidxtaped is launched from
317 amandad or I<fe_recover_splits> is used.
319 =item fe_amrecover_feedme_tape
324 If set, amidxtaped recognizes the TAPE response to FEEDME.
326 =item fe_amrecover_dle_in_header
328 =item fe_amrecover_origsize_in_header
333 If set, amrecover can process a header containing the corresponding attribute.
334 If not set, the attribute should be stripped from any headers sent to
337 Feature Header Attribute
338 ------- ----------------
339 dle_in_header dle_str
340 origsize_in_header orig_size
342 =item fe_amidxtaped_abort
347 If set, amidxtaped can handle an ABORT message just before the datapath
350 =item fe_amidxtaped_datapath
353 FEATURE OF: client and server
355 If set on the client, then amrecover expects the server to start a DATAPATH
356 negotiation after the header is sent. If set on the server, then amrecover can
357 process a DATAPATH negotiation after the header is sent. In other words, the
358 feature must be present on both sides for this negotiation to take place. The
359 DATAPATH negotiation is a three-way handshake:
361 AVAIL-DATAPATH <datapath list> # to amidxtaped
362 USE-DATAPATH <datapath> [<ip:port> ..] # from amidxtaped
363 DATAPATH-OK # to amidxtaped
365 No data may be transmitted until the handshake is complete. See the wiki
366 article entitled "amidxtaped protocol" for more detail.
368 =item fe_amidxtaped_fsf
370 =item fe_amidxtaped_label
372 =item fe_amidxtaped_device
374 =item fe_amidxtaped_host
376 =item fe_amidxtaped_disk
378 =item fe_amidxtaped_datestamp
380 =item fe_amidxtaped_header
382 =item fe_amidxtaped_config
387 If set, each feature means that amidxtaped can process the corresponding
388 command line. Note that I<fe_amidxtaped_label> does not indicate whether that
389 field contains a label or a tapespec.
391 =item fe_amidxtaped_nargs
396 If set, then amidxtaped can handle the "nargs" form of a command: The first
397 line was the number of arguments, folloewd by one argument by line. Amidxtaped
398 forked amrestore with these arguments.
400 This feature is no longer supported.
402 =item fe_amrecover_correct_disk_quoting
405 FEATURE OF: amrecover
407 Amrecovers that do not have this flag may send incorrectly-quoted DISK lines, so
408 those DISK lines should be ignored.
416 package Amanda::Feature::Set;
418 # this does not work, because SWIG uses the string value of objects as a hash key
419 # even after calling their destructor, which leads to a segfault.
421 # use overload '""' => sub { $_[0]->as_string(); };
423 sub Amanda::Feature::Set::from_string {
425 return Amanda::Feature::am_string_to_feature(@_);
428 sub Amanda::Feature::Set::old {
430 return Amanda::Feature::am_set_default_feature_set();
433 sub Amanda::Feature::Set::mine {
435 return Amanda::Feature::am_init_feature_set();
438 package Amanda::Feature;