a8d40456b72c6cf46bf6323c1d85261db283ba61
[debian/amanda] / common-src / amxml.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: amxml.h 5151 2007-02-06 15:41:53Z martineau $
29  *
30  * xml parsing of amanda protocol packet
31  */
32
33 #ifndef AMXML_H
34 #define AMXML_H
35
36 #include "conffile.h"
37
38 typedef struct script_s {
39     char                          *plugin;
40     execute_on_t                   execute_on;
41     int                            execute_where;
42     proplist_t                     property;
43     char                          *client_name;
44     struct client_script_result_s *result;
45 } script_t;
46
47 typedef GSList *scriptlist_t;
48
49 typedef struct level_s {
50     int level;
51     int server;                 /* if server can do the estimate */
52 } level_t;
53 typedef GSList *levellist_t;    /* A list where each element is a (level_t *) */
54
55 typedef struct a_dle_s {
56     char   *disk;
57     char   *device;
58     int     program_is_application_api;
59     char   *program;
60     estimatelist_t estimatelist;
61     int     spindle;
62     int     compress;
63     int     encrypt;
64     int     kencrypt;
65     levellist_t levellist;
66     int     nb_level;
67     char   *dumpdate;
68     char   *compprog;
69     char   *srv_encrypt;
70     char   *clnt_encrypt;
71     char   *srv_decrypt_opt;
72     char   *clnt_decrypt_opt;
73     int     record;
74     int     create_index;
75     char   *auth;
76     sl_t   *exclude_file;
77     sl_t   *exclude_list;
78     sl_t   *include_file;
79     sl_t   *include_list;
80     int     exclude_optional;
81     int     include_optional;
82     proplist_t property;
83     proplist_t application_property;
84     char        *application_client_name;
85     scriptlist_t scriptlist;
86     data_path_t  data_path;
87     GSList      *directtcp_list;
88     struct a_dle_s *next;
89 } dle_t;
90
91 dle_t *alloc_dle(void);
92 void   init_dle(dle_t *dle);
93 void   free_dle(dle_t *dle);
94 void   free_script_data(script_t *script);
95 dle_t *amxml_parse_node_CHAR(char *txt, char **errmsg);
96 dle_t *amxml_parse_node_FILE(FILE *file, char **errmsg);
97 char  *amxml_format_tag(char *tag, char *value);
98 #endif