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"
30 struct OperationConfig {
31 CURL *easy; /* A copy of the handle from GlobalConfig */
36 char *cookie; /* single line with specified cookies */
37 char *cookiejar; /* write to this file */
38 char *cookiefile; /* read from this file */
39 bool cookiesession; /* new session? */
40 bool encoding; /* Accept-Encoding please */
41 bool tr_encoding; /* Transfer-Encoding please */
42 unsigned long authtype; /* auth bitmask */
44 bool resume_from_current;
51 bool proto_redir_present;
52 curl_off_t resume_from;
54 curl_off_t postfieldsize;
57 double connecttimeout;
59 curl_off_t max_filesize;
65 unsigned short porttouse;
69 char *dns_servers; /* dot notation: 1.1.1.1;2.2.2.2 */
70 char *dns_interface; /* interface name */
71 char *dns_ipv4_addr; /* dot notation */
72 char *dns_ipv6_addr; /* dot notation */
80 int proxyver; /* set to CURLPROXY_HTTP* define */
83 struct curl_slist *mail_rcpt;
85 bool sasl_ir; /* Enable/disable SASL initial response */
87 bool ftp_append; /* APPE on ftp */
88 bool mute; /* don't show messages, --silent given */
89 bool use_ascii; /* select ascii or text transfer */
90 bool autoreferer; /* automatically set referer */
91 bool failonerror; /* fail on (HTTP) errors */
92 bool include_headers; /* send headers to data output */
93 bool no_body; /* don't get the body */
94 bool dirlistonly; /* only get the FTP dir list */
95 bool followlocation; /* follow http redirects */
96 bool unrestricted_auth; /* Continue to send authentication (user+password)
97 when following ocations, even when hostname
102 bool noprogress; /* don't show progress meter, --silent given */
103 bool isatty; /* updated internally only if output is a tty */
104 struct getout *url_list; /* point to the first node */
105 struct getout *url_last; /* point to the last/current node */
106 struct getout *url_get; /* point to the node to fill in URL */
107 struct getout *url_out; /* point to the node to fill in outfile */
123 char *trace_dump; /* file to dump the network trace to, or NULL */
127 bool tracetime; /* include timestamp? */
129 int progressmode; /* CURL_PROGRESS_BAR or CURL_PROGRESS_STATS */
131 bool readbusy; /* set when reading input returns EAGAIN */
134 bool insecure_ok; /* set TRUE to allow insecure SSL connects */
136 bool ftp_create_dirs;
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;
152 curl_TimeCond timecond;
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;
161 /* for bandwidth limiting features: */
162 curl_off_t sendpersecond; /* send to peer */
163 curl_off_t recvpersecond; /* receive from peer */
167 bool ftp_ssl_control;
169 int ftp_ssl_ccc_mode;
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
175 int socks5_gssapi_nec ; /* The NEC reference server does not protect
176 * the encryption type exchange */
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 */
183 char *ftp_account; /* for ACCT */
184 char *ftp_alternative_to_user; /* send command if USER/PASS fails */
186 long tftp_blksize; /* TFTP BLKSIZE option */
187 bool ignorecl; /* --ignore-content-length */
188 bool disable_sessionid;
190 char *libcurl; /* output libcurl code to this file name */
195 bool nokeepalive; /* for keepalive needs */
197 bool content_disposition; /* use Content-disposition filename */
199 int default_node_flags; /* default flags to search for each 'node', which
200 is basically each given URL to transfer */
202 bool xattr; /* store metadata in extended attributes */
203 long gssapi_delegation;
204 bool ssl_allow_beast; /* allow this SSL vulnerability */
206 bool use_metalink; /* process given URLs as metalink XML file */
207 metalinkfile *metalinkfile_list; /* point to the first node */
208 metalinkfile *metalinkfile_last; /* point to the last/current node */
210 bool test_event_based;
212 char *xoauth2_bearer; /* XOAUTH2 bearer token */
213 bool nonpn; /* enable/disable TLS NPN extension */
214 bool noalpn; /* enable/disable TLS ALPN extension */
216 struct OperationConfig* prev;
217 struct OperationConfig* next; /* Always last in the struct */
220 struct GlobalConfig {
221 CURL *easy; /* Once we have one, we keep it here */
222 int showerror; /* -1 == unset, default => show errors
223 0 => -s is used to NOT show errors
224 1 => -S has been used to show errors */
226 struct OperationConfig *first;
227 struct OperationConfig *current;
228 struct OperationConfig *last; /* Always last in the struct */
231 void config_init(struct OperationConfig* config);
232 void config_free(struct OperationConfig* config);
234 #endif /* HEADER_CURL_TOOL_CFGABLE_H */