1 #ifndef HEADER_CURL_TOOL_CFGABLE_H
2 #define HEADER_CURL_TOOL_CFGABLE_H
3 /***************************************************************************
5 * Project ___| | | | _ \| |
7 * | (__| |_| | _ <| |___
8 * \___|\___/|_| \_\_____|
10 * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
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 https://curl.haxx.se/docs/copyright.html.
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.
20 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21 * KIND, either express or implied.
23 ***************************************************************************/
24 #include "tool_setup.h"
26 #include "tool_sdecls.h"
28 #include "tool_metalink.h"
32 ERR_BINARY_TERMINAL = 1, /* binary to terminal detected */
38 struct OperationConfig {
39 CURL *easy; /* A copy of the handle from GlobalConfig */
44 char *cookie; /* single line with specified cookies */
45 char *cookiejar; /* write to this file */
46 char *cookiefile; /* read from this file */
47 bool cookiesession; /* new session? */
48 bool encoding; /* Accept-Encoding please */
49 bool tr_encoding; /* Transfer-Encoding please */
50 unsigned long authtype; /* auth bitmask */
52 bool resume_from_current;
59 bool proto_redir_present;
61 curl_off_t resume_from;
63 curl_off_t postfieldsize;
66 double connecttimeout;
68 curl_off_t max_filesize;
74 unsigned short porttouse;
78 char *dns_servers; /* dot notation: 1.1.1.1;2.2.2.2 */
79 char *dns_interface; /* interface name */
80 char *dns_ipv4_addr; /* dot notation */
81 char *dns_ipv6_addr; /* dot notation */
87 char *proxy_tls_username;
88 char *proxy_tls_password;
89 char *proxy_tls_authtype;
92 int proxyver; /* set to CURLPROXY_HTTP* define */
95 struct curl_slist *mail_rcpt;
97 bool sasl_ir; /* Enable/disable SASL initial response */
99 bool ftp_append; /* APPE on ftp */
100 bool use_ascii; /* select ascii or text transfer */
101 bool autoreferer; /* automatically set referer */
102 bool failonerror; /* fail on (HTTP) errors */
103 bool include_headers; /* send headers to data output */
104 bool no_body; /* don't get the body */
105 bool dirlistonly; /* only get the FTP dir list */
106 bool followlocation; /* follow http redirects */
107 bool unrestricted_auth; /* Continue to send authentication (user+password)
108 when following ocations, even when hostname
113 struct getout *url_list; /* point to the first node */
114 struct getout *url_last; /* point to the last/current node */
115 struct getout *url_get; /* point to the node to fill in URL */
116 struct getout *url_out; /* point to the node to fill in outfile */
118 char *proxy_cipher_list;
122 char *proxy_cert_type;
133 char *proxy_key_type;
135 char *proxy_key_passwd;
142 char *request_target;
145 bool readbusy; /* set when reading input returns EAGAIN */
148 bool insecure_ok; /* set TRUE to allow insecure SSL connects */
149 bool proxy_insecure_ok; /* set TRUE to allow insecure SSL connects
151 bool terminal_binary_ok;
154 bool ftp_create_dirs;
161 char *writeout; /* %-styled format string to output */
162 struct curl_slist *quote;
163 struct curl_slist *postquote;
164 struct curl_slist *prequote;
166 long ssl_version_max;
167 long proxy_ssl_version;
169 curl_TimeCond timecond;
171 struct curl_slist *headers;
172 struct curl_slist *proxyheaders;
174 curl_mime *mimecurrent;
175 struct curl_slist *telnet_options;
176 struct curl_slist *resolve;
177 struct curl_slist *connect_to;
180 /* for bandwidth limiting features: */
181 curl_off_t sendpersecond; /* send to peer */
182 curl_off_t recvpersecond; /* receive from peer */
186 bool ftp_ssl_control;
188 int ftp_ssl_ccc_mode;
190 int socks5_gssapi_nec; /* The NEC reference server does not protect the
191 encryption type exchange */
192 unsigned long socks5_auth;/* auth bitmask for socks5 proxies */
193 char *proxy_service_name; /* set authentication service name for HTTP and
195 char *service_name; /* set authentication service name for DIGEST-MD5,
196 Kerberos 5 and SPNEGO */
200 long req_retry; /* number of retries */
201 bool retry_connrefused; /* set connection refused as a transient error */
202 long retry_delay; /* delay between retries (in seconds) */
203 long retry_maxtime; /* maximum time to keep retrying */
205 char *ftp_account; /* for ACCT */
206 char *ftp_alternative_to_user; /* send command if USER/PASS fails */
208 long tftp_blksize; /* TFTP BLKSIZE option */
209 bool tftp_no_options; /* do not send TFTP options requests */
210 bool ignorecl; /* --ignore-content-length */
211 bool disable_sessionid;
217 bool nokeepalive; /* for keepalive needs */
219 bool content_disposition; /* use Content-disposition filename */
221 int default_node_flags; /* default flags to search for each 'node', which
222 is basically each given URL to transfer */
224 bool xattr; /* store metadata in extended attributes */
225 long gssapi_delegation;
226 bool ssl_allow_beast; /* allow this SSL vulnerability */
227 bool proxy_ssl_allow_beast; /* allow this SSL vulnerability for proxy*/
229 bool ssl_no_revoke; /* disable SSL certificate revocation checks */
230 /*bool proxy_ssl_no_revoke; */
232 bool use_metalink; /* process given URLs as metalink XML file */
233 metalinkfile *metalinkfile_list; /* point to the first node */
234 metalinkfile *metalinkfile_last; /* point to the last/current node */
236 bool test_event_based;
238 char *oauth_bearer; /* OAuth 2.0 bearer token */
239 bool nonpn; /* enable/disable TLS NPN extension */
240 bool noalpn; /* enable/disable TLS ALPN extension */
241 char *unix_socket_path; /* path to Unix domain socket */
242 bool abstract_unix_socket; /* path to an abstract Unix domain socket */
245 double expect100timeout;
246 bool suppress_connect_headers; /* suppress proxy CONNECT response headers
247 from user callbacks */
248 curl_error synthetic_error; /* if non-zero, it overrides any libcurl
250 bool ssh_compression; /* enable/disable SSH compression */
251 struct GlobalConfig *global;
252 struct OperationConfig *prev;
253 struct OperationConfig *next; /* Always last in the struct */
256 struct GlobalConfig {
257 CURL *easy; /* Once we have one, we keep it here */
258 int showerror; /* -1 == unset, default => show errors
259 0 => -s is used to NOT show errors
260 1 => -S has been used to show errors */
261 bool mute; /* don't show messages, --silent given */
262 bool noprogress; /* don't show progress bar --silent given */
263 bool isatty; /* Updated internally if output is a tty */
264 FILE *errors; /* Error stream, defaults to stderr */
265 bool errors_fopened; /* Whether error stream isn't stderr */
266 char *trace_dump; /* file to dump the network trace to */
270 bool tracetime; /* include timestamp? */
271 int progressmode; /* CURL_PROGRESS_BAR / CURL_PROGRESS_STATS */
272 char *libcurl; /* Output libcurl code to this file name */
273 bool fail_early; /* exit on first transfer error */
274 struct OperationConfig *first;
275 struct OperationConfig *current;
276 struct OperationConfig *last; /* Always last in the struct */
279 void config_init(struct OperationConfig *config);
280 void config_free(struct OperationConfig *config);
282 #endif /* HEADER_CURL_TOOL_CFGABLE_H */