1 #ifndef HEADER_CURL_TOOL_CFGABLE_H
2 #define HEADER_CURL_TOOL_CFGABLE_H
3 /***************************************************************************
5 * Project ___| | | | _ \| |
7 * | (__| |_| | _ <| |___
8 * \___|\___/|_| \_\_____|
10 * Copyright (C) 1998 - 2014, 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 http://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 struct OperationConfig {
33 CURL *easy; /* A copy of the handle from GlobalConfig */
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 */
46 bool resume_from_current;
53 bool proto_redir_present;
54 curl_off_t resume_from;
56 curl_off_t postfieldsize;
59 double connecttimeout;
61 curl_off_t max_filesize;
67 unsigned short porttouse;
71 char *dns_servers; /* dot notation: 1.1.1.1;2.2.2.2 */
72 char *dns_interface; /* interface name */
73 char *dns_ipv4_addr; /* dot notation */
74 char *dns_ipv6_addr; /* dot notation */
82 int proxyver; /* set to CURLPROXY_HTTP* define */
85 struct curl_slist *mail_rcpt;
87 bool sasl_ir; /* Enable/disable SASL initial response */
89 bool ftp_append; /* APPE on ftp */
90 bool use_ascii; /* select ascii or text transfer */
91 bool autoreferer; /* automatically set referer */
92 bool failonerror; /* fail on (HTTP) errors */
93 bool include_headers; /* send headers to data output */
94 bool no_body; /* don't get the body */
95 bool dirlistonly; /* only get the FTP dir list */
96 bool followlocation; /* follow http redirects */
97 bool unrestricted_auth; /* Continue to send authentication (user+password)
98 when following ocations, even when hostname
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 */
125 bool readbusy; /* set when reading input returns EAGAIN */
128 bool insecure_ok; /* set TRUE to allow insecure SSL connects */
131 bool ftp_create_dirs;
138 char *writeout; /* %-styled format string to output */
139 bool writeenv; /* write results to environment, if available */
140 struct curl_slist *quote;
141 struct curl_slist *postquote;
142 struct curl_slist *prequote;
145 curl_TimeCond timecond;
147 struct curl_slist *headers;
148 struct curl_slist *proxyheaders;
149 struct curl_httppost *httppost;
150 struct curl_httppost *last_post;
151 struct curl_slist *telnet_options;
152 struct curl_slist *resolve;
155 /* for bandwidth limiting features: */
156 curl_off_t sendpersecond; /* send to peer */
157 curl_off_t recvpersecond; /* receive from peer */
161 bool ftp_ssl_control;
163 int ftp_ssl_ccc_mode;
165 char *socksproxy; /* set to server string */
166 int socksver; /* set to CURLPROXY_SOCKS* define */
167 char *socks5_gssapi_service; /* set service name for gssapi principal
169 int socks5_gssapi_nec ; /* The NEC reference server does not protect
170 * the encryption type exchange */
173 long req_retry; /* number of retries */
174 long retry_delay; /* delay between retries (in seconds) */
175 long retry_maxtime; /* maximum time to keep retrying */
177 char *ftp_account; /* for ACCT */
178 char *ftp_alternative_to_user; /* send command if USER/PASS fails */
180 long tftp_blksize; /* TFTP BLKSIZE option */
181 bool ignorecl; /* --ignore-content-length */
182 bool disable_sessionid;
188 bool nokeepalive; /* for keepalive needs */
190 bool content_disposition; /* use Content-disposition filename */
192 int default_node_flags; /* default flags to search for each 'node', which
193 is basically each given URL to transfer */
195 bool xattr; /* store metadata in extended attributes */
196 long gssapi_delegation;
197 bool ssl_allow_beast; /* allow this SSL vulnerability */
199 bool use_metalink; /* process given URLs as metalink XML file */
200 metalinkfile *metalinkfile_list; /* point to the first node */
201 metalinkfile *metalinkfile_last; /* point to the last/current node */
203 bool test_event_based;
205 char *xoauth2_bearer; /* XOAUTH2 bearer token */
206 bool nonpn; /* enable/disable TLS NPN extension */
207 bool noalpn; /* enable/disable TLS ALPN extension */
208 char *unix_socket_path; /* path to Unix domain socket */
210 struct GlobalConfig *global;
211 struct OperationConfig *prev;
212 struct OperationConfig *next; /* Always last in the struct */
215 struct GlobalConfig {
216 CURL *easy; /* Once we have one, we keep it here */
217 int showerror; /* -1 == unset, default => show errors
218 0 => -s is used to NOT show errors
219 1 => -S has been used to show errors */
220 bool mute; /* don't show messages, --silent given */
221 bool noprogress; /* don't show progress bar --silent given */
222 bool isatty; /* Updated internally if output is a tty */
223 FILE *errors; /* Error stream, defaults to stderr */
224 bool errors_fopened; /* Whether error stream isn't stderr */
225 char *trace_dump; /* file to dump the network trace to */
229 bool tracetime; /* include timestamp? */
230 int progressmode; /* CURL_PROGRESS_BAR / CURL_PROGRESS_STATS */
231 char *libcurl; /* Output libcurl code to this file name */
233 struct OperationConfig *first;
234 struct OperationConfig *current;
235 struct OperationConfig *last; /* Always last in the struct */
238 void config_init(struct OperationConfig *config);
239 void config_free(struct OperationConfig *config);
241 #endif /* HEADER_CURL_TOOL_CFGABLE_H */