Minimize usage of structs from libmetalink
[platform/upstream/curl.git] / src / tool_cfgable.h
1 #ifndef HEADER_CURL_TOOL_CFGABLE_H
2 #define HEADER_CURL_TOOL_CFGABLE_H
3 /***************************************************************************
4  *                                  _   _ ____  _
5  *  Project                     ___| | | |  _ \| |
6  *                             / __| | | | |_) | |
7  *                            | (__| |_| |  _ <| |___
8  *                             \___|\___/|_| \_\_____|
9  *
10  * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
11  *
12  * This software is licensed as described in the file COPYING, which
13  * you should have received as part of this distribution. The terms
14  * are also available at http://curl.haxx.se/docs/copyright.html.
15  *
16  * You may opt to use, copy, modify, merge, publish, distribute and/or sell
17  * copies of the Software, and permit persons to whom the Software is
18  * furnished to do so, under the terms of the COPYING file.
19  *
20  * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21  * KIND, either express or implied.
22  *
23  ***************************************************************************/
24 #include "tool_setup.h"
25
26 #include "tool_sdecls.h"
27
28 #ifdef HAVE_LIBMETALINK
29 #include "tool_metalink.h"
30 #endif /* HAVE_LIBMETALINK */
31
32 struct Configurable {
33   CURL *easy;               /* once we have one, we keep it here */
34   bool remote_time;
35   char *random_file;
36   char *egd_file;
37   char *useragent;
38   char *cookie;             /* single line with specified cookies */
39   char *cookiejar;          /* write to this file */
40   char *cookiefile;         /* read from this file */
41   bool cookiesession;       /* new session? */
42   bool encoding;            /* Accept-Encoding please */
43   bool tr_encoding;         /* Transfer-Encoding please */
44   unsigned long authtype;   /* auth bitmask */
45   bool use_resume;
46   bool resume_from_current;
47   bool disable_epsv;
48   bool disable_eprt;
49   bool ftp_pret;
50   long proto;
51   bool proto_present;
52   long proto_redir;
53   bool proto_redir_present;
54   curl_off_t resume_from;
55   char *postfields;
56   curl_off_t postfieldsize;
57   char *referer;
58   long timeout;
59   long connecttimeout;
60   long maxredirs;
61   curl_off_t max_filesize;
62   char *headerfile;
63   char *ftpport;
64   char *iface;
65   int localport;
66   int localportrange;
67   unsigned short porttouse;
68   char *range;
69   long low_speed_limit;
70   long low_speed_time;
71   int showerror; /* -1 == unset, default => show errors
72                     0 => -s is used to NOT show errors
73                     1 => -S has been used to show errors */
74   char *userpwd;
75   char *tls_username;
76   char *tls_password;
77   char *tls_authtype;
78   char *proxyuserpwd;
79   char *proxy;
80   int proxyver;             /* set to CURLPROXY_HTTP* define */
81   char *noproxy;
82   char *mail_from;
83   struct curl_slist *mail_rcpt;
84   char *mail_auth;
85   bool proxytunnel;
86   bool ftp_append;          /* APPE on ftp */
87   bool mute;                /* don't show messages, --silent given */
88   bool use_ascii;           /* select ascii or text transfer */
89   bool autoreferer;         /* automatically set referer */
90   bool failonerror;         /* fail on (HTTP) errors */
91   bool include_headers;     /* send headers to data output */
92   bool no_body;             /* don't get the body */
93   bool dirlistonly;         /* only get the FTP dir list */
94   bool followlocation;      /* follow http redirects */
95   bool unrestricted_auth;   /* Continue to send authentication (user+password)
96                                when following ocations, even when hostname
97                                changed */
98   bool netrc_opt;
99   bool netrc;
100   char *netrc_file;
101   bool noprogress;          /* don't show progress meter, --silent given */
102   bool isatty;              /* updated internally only if output is a tty */
103   struct getout *url_list;  /* point to the first node */
104   struct getout *url_last;  /* point to the last/current node */
105   struct getout *url_get;   /* point to the node to fill in URL */
106   struct getout *url_out;   /* point to the node to fill in outfile */
107   char *cipher_list;
108   char *cert;
109   char *cert_type;
110   char *cacert;
111   char *capath;
112   char *crlfile;
113   char *key;
114   char *key_type;
115   char *key_passwd;
116   char *pubkey;
117   char *hostpubmd5;
118   char *engine;
119   bool list_engines;
120   bool crlf;
121   char *customrequest;
122   char *krblevel;
123   char *trace_dump;         /* file to dump the network trace to, or NULL */
124   FILE *trace_stream;
125   bool trace_fopened;
126   trace tracetype;
127   bool tracetime;           /* include timestamp? */
128   long httpversion;
129   int progressmode;         /* CURL_PROGRESS_BAR or CURL_PROGRESS_STATS */
130   bool nobuffer;
131   bool readbusy;            /* set when reading input returns EAGAIN */
132   bool globoff;
133   bool use_httpget;
134   bool insecure_ok;         /* set TRUE to allow insecure SSL connects */
135   bool create_dirs;
136   bool ftp_create_dirs;
137   bool ftp_skip_ip;
138   bool proxynegotiate;
139   bool proxyntlm;
140   bool proxydigest;
141   bool proxybasic;
142   bool proxyanyauth;
143   char *writeout;           /* %-styled format string to output */
144   bool writeenv;            /* write results to environment, if available */
145   FILE *errors;             /* errors stream, defaults to stderr */
146   bool errors_fopened;      /* whether errors stream isn't stderr */
147   struct curl_slist *quote;
148   struct curl_slist *postquote;
149   struct curl_slist *prequote;
150   long ssl_version;
151   long ip_version;
152   curl_TimeCond timecond;
153   time_t condtime;
154   struct curl_slist *headers;
155   struct curl_httppost *httppost;
156   struct curl_httppost *last_post;
157   struct curl_slist *telnet_options;
158   struct curl_slist *resolve;
159   HttpReq httpreq;
160
161   /* for bandwidth limiting features: */
162   curl_off_t sendpersecond; /* send to peer */
163   curl_off_t recvpersecond; /* receive from peer */
164
165   bool ftp_ssl;
166   bool ftp_ssl_reqd;
167   bool ftp_ssl_control;
168   bool ftp_ssl_ccc;
169   int ftp_ssl_ccc_mode;
170
171   char *socksproxy;         /* set to server string */
172   int socksver;             /* set to CURLPROXY_SOCKS* define */
173   char *socks5_gssapi_service;  /* set service name for gssapi principal
174                                  * default rcmd */
175   int socks5_gssapi_nec ;   /* The NEC reference server does not protect
176                              * the encryption type exchange */
177
178   bool tcp_nodelay;
179   long req_retry;           /* number of retries */
180   long retry_delay;         /* delay between retries (in seconds) */
181   long retry_maxtime;       /* maximum time to keep retrying */
182
183   char *ftp_account;        /* for ACCT */
184   char *ftp_alternative_to_user;  /* send command if USER/PASS fails */
185   int ftp_filemethod;
186   long tftp_blksize;        /* TFTP BLKSIZE option */
187   bool ignorecl;            /* --ignore-content-length */
188   bool disable_sessionid;
189
190   char *libcurl;            /* output libcurl code to this file name */
191   bool raw;
192   bool post301;
193   bool post302;
194   bool post303;
195   bool nokeepalive;         /* for keepalive needs */
196   long alivetime;
197   bool content_disposition; /* use Content-disposition filename */
198
199   int default_node_flags;   /* default flags to search for each 'node', which
200                                is basically each given URL to transfer */
201
202   bool xattr;               /* store metadata in extended attributes */
203   long gssapi_delegation;
204   bool ssl_allow_beast;     /* allow this SSL vulnerability */
205 #ifdef HAVE_LIBMETALINK
206   metalinkfile *metalinkfile_list; /* point to the first node */
207   metalinkfile *metalinkfile_last; /* point to the last/current node */
208 #endif /* HAVE_LIBMETALINK */
209 }; /* struct Configurable */
210
211 void free_config_fields(struct Configurable *config);
212
213 #endif /* HEADER_CURL_TOOL_CFGABLE_H */
214