Imported Upstream version 3.2.0
[debian/amanda] / common-src / amfeatures.h
1 /*
2  * Amanda, The Advanced Maryland Automatic Network Disk Archiver
3  * Copyright (c) 1991-1998 University of Maryland at College Park
4  * All Rights Reserved.
5  *
6  * Permission to use, copy, modify, distribute, and sell this software and its
7  * documentation for any purpose is hereby granted without fee, provided that
8  * the above copyright notice appear in all copies and that both that
9  * copyright notice and this permission notice appear in supporting
10  * documentation, and that the name of U.M. not be used in advertising or
11  * publicity pertaining to distribution of the software without specific,
12  * written prior permission.  U.M. makes no representations about the
13  * suitability of this software for any purpose.  It is provided "as is"
14  * without express or implied warranty.
15  *
16  * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
17  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
18  * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
19  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
20  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
21  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22  *
23  * Authors: the Amanda Development Team.  Its members are listed in a
24  * file named AUTHORS, in the root directory of this distribution.
25  */
26
27 /*
28  * $Id: amfeatures.h,v 1.21 2006/07/19 17:46:07 martinea Exp $
29  *
30  * Define feature test related items.
31  */
32
33 #ifndef AMFEATURES_H
34 #define AMFEATURES_H
35
36 /*
37  * !!!WARNING!!!    !!!WARNING!!!    !!!WARNING!!!    !!!WARNING!!!
38  *
39  * No matter **WHAT**, you **MUST** enter new features at the **END**
40  * of this list (just before "last_feature").  If you do not, mass
41  * confusion will ensue.
42  *
43  * And features must **NEVER** be removed (that is, their code number
44  * must remain).  The bits are cheap.
45  *
46  * If you add a feature here, you probably also need to add a line to
47  * am_init_feature_set() in features.c unless it is dynamic in some way.
48  *
49  * !!!WARNING!!!    !!!WARNING!!!    !!!WARNING!!!    !!!WARNING!!!
50  */
51 typedef enum {
52     /*
53      * This bit will be set if the feature test code is supported.  It
54      * will only be off for "old" (2.4.2p2 and earlier) systems.
55      */
56     have_feature_support = 0,
57
58     /*
59      * Amanda used to send authorization type information around like
60      * this in the OPTIONS string:
61      *
62      *  bsd-auth
63      *  krb4-auth
64      *
65      * To make it easier to add new authorization methods and parse,
66      * this was changed to a keyword=value syntax:
67      *
68      *  auth=BSD
69      *  auth=RSH
70      *  auth=krb5
71      *
72      * and so on.
73      */
74
75     fe_options_auth, /* amanda_feature_auth_keyword */
76
77     fe_selfcheck_req,
78     fe_selfcheck_req_device,
79     fe_selfcheck_rep,
80
81     fe_sendsize_req_no_options,
82     fe_sendsize_req_options,
83     fe_sendsize_req_device,             /* require fe_sendsize_req_options */
84     fe_sendsize_rep,
85
86     fe_sendbackup_req,
87     fe_sendbackup_req_device,
88     fe_sendbackup_rep,
89
90     fe_noop_req,
91     fe_noop_rep,
92
93     fe_program_dump,
94     fe_program_gnutar,
95     fe_program_application_api,         /* require fe_sendsize_req_options */
96
97     fe_options_compress_fast,
98     fe_options_compress_best,
99     fe_options_srvcomp_fast,
100     fe_options_srvcomp_best,
101     fe_options_no_record,
102     fe_options_index,
103     fe_options_exclude_file,
104     fe_options_exclude_list,
105     fe_options_multiple_exclude,        /* require fe_sendsize_req_options */
106     fe_options_optional_exclude,        /* require fe_sendsize_req_options */
107     fe_options_include_file,            /* require fe_sendsize_req_options */
108     fe_options_include_list,            /* require fe_sendsize_req_options */
109     fe_options_multiple_include,        /* require fe_sendsize_req_options */
110     fe_options_optional_include,        /* require fe_sendsize_req_options */
111     fe_options_bsd_auth,
112     fe_options_krb4_auth,
113     fe_options_kencrypt,
114
115     fe_req_options_maxdumps,
116     fe_req_options_hostname,
117     fe_req_options_features,
118
119     fe_rep_options_maxdumps,
120     fe_rep_options_hostname,
121     fe_rep_options_features,
122     fe_rep_options_sendbackup_options,
123
124     fe_amindexd_fileno_in_OLSD,
125     fe_amindexd_fileno_in_ORLD,
126     fe_amidxtaped_fsf,
127     fe_amidxtaped_label,
128     fe_amidxtaped_device,
129     fe_amidxtaped_host,
130     fe_amidxtaped_disk,
131     fe_amidxtaped_datestamp,
132     fe_amidxtaped_header,
133     fe_amidxtaped_nargs,
134     fe_amidxtaped_config,
135
136     fe_partial_estimate,
137     fe_calcsize_estimate,
138     fe_selfcheck_calcsize,
139
140     fe_recover_splits,
141     fe_amidxtaped_exchange_features,
142
143     fe_options_compress_cust,
144     fe_options_srvcomp_cust,
145     fe_options_encrypt_cust,
146     fe_options_encrypt_serv_cust,
147     fe_options_client_decrypt_option,
148     fe_options_server_decrypt_option,
149
150     fe_amindexd_marshall_in_OLSD,
151     fe_amindexd_marshall_in_ORLD,
152     fe_amindexd_marshall_in_DHST,
153     fe_amrecover_FEEDME,
154     fe_amrecover_timestamp,
155
156     fe_interface_quoted_text,
157
158     fe_program_star,
159
160     fe_amindexd_options_hostname,
161     fe_amindexd_options_features,
162     fe_amindexd_options_auth,
163
164     fe_amidxtaped_options_hostname,
165     fe_amidxtaped_options_features,
166     fe_amidxtaped_options_auth,
167
168     fe_amrecover_message,
169     fe_amrecover_feedme_tape,
170
171     fe_req_options_config,
172
173     fe_rep_sendsize_quoted_error,
174     fe_req_xml,
175     fe_pp_script,       // only in XML
176     fe_amindexd_DLE,
177     fe_amrecover_dle_in_header,
178     fe_xml_estimate,
179     fe_xml_property_priority,
180     fe_sendsize_rep_warning,
181     fe_xml_estimatelist,
182     fe_xml_level_server,
183     fe_xml_data_path,
184     fe_xml_directtcp_list,
185     fe_amidxtaped_datapath,
186     fe_sendbackup_noop,
187     fe_amrecover_origsize_in_header,
188     fe_amidxtaped_abort,
189     fe_amrecover_correct_disk_quoting,
190     fe_amindexd_quote_label,
191
192     /*
193      * All new features must be inserted immediately *before* this entry.
194      */
195     last_feature
196 } am_feature_e;
197
198 /* don't include this struct or the subsequent functions in Amanda::Feature SWIG */
199 #ifndef AMANDA_FEATURE_SWG
200
201 typedef struct am_feature_s {
202     size_t              size;
203     unsigned char       *bytes;
204 } am_feature_t;
205
206 /*
207  * Functions.
208  */
209
210 extern am_feature_t *am_init_feature_set(void);
211 extern am_feature_t *am_set_default_feature_set(void);
212 extern am_feature_t *am_allocate_feature_set(void);
213 extern void am_release_feature_set(am_feature_t *);
214 extern int am_add_feature(am_feature_t *f, am_feature_e n);
215 extern int am_remove_feature(am_feature_t *f, am_feature_e n);
216 extern int am_has_feature(am_feature_t *f, am_feature_e n);
217 extern char *am_feature_to_string(am_feature_t *f);
218 extern am_feature_t *am_string_to_feature(char *s);
219
220 #endif
221
222 #endif  /* !AMFEATURES_H */