2011-09-16 15:44:45 -04:00
|
|
|
#ifndef HEADER_CURL_TOOL_CFGABLE_H
|
|
|
|
#define HEADER_CURL_TOOL_CFGABLE_H
|
|
|
|
/***************************************************************************
|
|
|
|
* _ _ ____ _
|
|
|
|
* Project ___| | | | _ \| |
|
|
|
|
* / __| | | | |_) | |
|
|
|
|
* | (__| |_| | _ <| |___
|
|
|
|
* \___|\___/|_| \_\_____|
|
|
|
|
*
|
2017-05-03 08:28:40 -04:00
|
|
|
* Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
|
2011-09-16 15:44:45 -04:00
|
|
|
*
|
|
|
|
* This software is licensed as described in the file COPYING, which
|
|
|
|
* you should have received as part of this distribution. The terms
|
2016-02-02 18:19:02 -05:00
|
|
|
* are also available at https://curl.haxx.se/docs/copyright.html.
|
2011-09-16 15:44:45 -04:00
|
|
|
*
|
|
|
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
|
|
|
* copies of the Software, and permit persons to whom the Software is
|
|
|
|
* furnished to do so, under the terms of the COPYING file.
|
|
|
|
*
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
* KIND, either express or implied.
|
|
|
|
*
|
|
|
|
***************************************************************************/
|
2012-04-06 17:35:15 -04:00
|
|
|
#include "tool_setup.h"
|
2011-09-16 15:44:45 -04:00
|
|
|
|
2011-09-20 09:58:35 -04:00
|
|
|
#include "tool_sdecls.h"
|
2011-09-16 15:44:45 -04:00
|
|
|
|
2012-04-26 09:59:52 -04:00
|
|
|
#include "tool_metalink.h"
|
|
|
|
|
2017-06-16 05:30:36 -04:00
|
|
|
typedef enum {
|
|
|
|
ERR_NONE,
|
|
|
|
ERR_BINARY_TERMINAL = 1, /* binary to terminal detected */
|
|
|
|
ERR_LAST
|
|
|
|
} curl_error;
|
|
|
|
|
2014-02-26 16:02:53 -05:00
|
|
|
struct GlobalConfig;
|
|
|
|
|
2014-02-23 07:59:59 -05:00
|
|
|
struct OperationConfig {
|
2014-02-23 08:15:31 -05:00
|
|
|
CURL *easy; /* A copy of the handle from GlobalConfig */
|
2011-09-16 15:44:45 -04:00
|
|
|
bool remote_time;
|
|
|
|
char *random_file;
|
|
|
|
char *egd_file;
|
|
|
|
char *useragent;
|
|
|
|
char *cookie; /* single line with specified cookies */
|
|
|
|
char *cookiejar; /* write to this file */
|
|
|
|
char *cookiefile; /* read from this file */
|
|
|
|
bool cookiesession; /* new session? */
|
|
|
|
bool encoding; /* Accept-Encoding please */
|
|
|
|
bool tr_encoding; /* Transfer-Encoding please */
|
2012-04-18 17:04:35 -04:00
|
|
|
unsigned long authtype; /* auth bitmask */
|
2011-09-16 15:44:45 -04:00
|
|
|
bool use_resume;
|
|
|
|
bool resume_from_current;
|
|
|
|
bool disable_epsv;
|
|
|
|
bool disable_eprt;
|
|
|
|
bool ftp_pret;
|
|
|
|
long proto;
|
|
|
|
bool proto_present;
|
|
|
|
long proto_redir;
|
|
|
|
bool proto_redir_present;
|
2015-08-22 21:49:26 -04:00
|
|
|
char *proto_default;
|
2011-09-16 15:44:45 -04:00
|
|
|
curl_off_t resume_from;
|
|
|
|
char *postfields;
|
|
|
|
curl_off_t postfieldsize;
|
|
|
|
char *referer;
|
2013-04-30 10:23:39 -04:00
|
|
|
double timeout;
|
|
|
|
double connecttimeout;
|
2011-09-16 15:44:45 -04:00
|
|
|
long maxredirs;
|
|
|
|
curl_off_t max_filesize;
|
|
|
|
char *headerfile;
|
|
|
|
char *ftpport;
|
|
|
|
char *iface;
|
|
|
|
int localport;
|
|
|
|
int localportrange;
|
|
|
|
unsigned short porttouse;
|
|
|
|
char *range;
|
|
|
|
long low_speed_limit;
|
|
|
|
long low_speed_time;
|
2013-09-13 13:50:11 -04:00
|
|
|
char *dns_servers; /* dot notation: 1.1.1.1;2.2.2.2 */
|
|
|
|
char *dns_interface; /* interface name */
|
|
|
|
char *dns_ipv4_addr; /* dot notation */
|
|
|
|
char *dns_ipv6_addr; /* dot notation */
|
2011-09-16 15:44:45 -04:00
|
|
|
char *userpwd;
|
2013-12-14 16:39:27 -05:00
|
|
|
char *login_options;
|
2011-09-16 15:44:45 -04:00
|
|
|
char *tls_username;
|
|
|
|
char *tls_password;
|
|
|
|
char *tls_authtype;
|
2016-11-16 12:49:15 -05:00
|
|
|
char *proxy_tls_username;
|
|
|
|
char *proxy_tls_password;
|
|
|
|
char *proxy_tls_authtype;
|
2011-09-16 15:44:45 -04:00
|
|
|
char *proxyuserpwd;
|
|
|
|
char *proxy;
|
|
|
|
int proxyver; /* set to CURLPROXY_HTTP* define */
|
|
|
|
char *noproxy;
|
|
|
|
char *mail_from;
|
|
|
|
struct curl_slist *mail_rcpt;
|
2012-02-16 07:19:47 -05:00
|
|
|
char *mail_auth;
|
2013-04-27 04:54:14 -04:00
|
|
|
bool sasl_ir; /* Enable/disable SASL initial response */
|
2011-09-16 15:44:45 -04:00
|
|
|
bool proxytunnel;
|
|
|
|
bool ftp_append; /* APPE on ftp */
|
|
|
|
bool use_ascii; /* select ascii or text transfer */
|
|
|
|
bool autoreferer; /* automatically set referer */
|
|
|
|
bool failonerror; /* fail on (HTTP) errors */
|
|
|
|
bool include_headers; /* send headers to data output */
|
|
|
|
bool no_body; /* don't get the body */
|
|
|
|
bool dirlistonly; /* only get the FTP dir list */
|
|
|
|
bool followlocation; /* follow http redirects */
|
|
|
|
bool unrestricted_auth; /* Continue to send authentication (user+password)
|
|
|
|
when following ocations, even when hostname
|
|
|
|
changed */
|
|
|
|
bool netrc_opt;
|
|
|
|
bool netrc;
|
|
|
|
char *netrc_file;
|
|
|
|
struct getout *url_list; /* point to the first node */
|
|
|
|
struct getout *url_last; /* point to the last/current node */
|
|
|
|
struct getout *url_get; /* point to the node to fill in URL */
|
|
|
|
struct getout *url_out; /* point to the node to fill in outfile */
|
|
|
|
char *cipher_list;
|
2016-11-16 12:49:15 -05:00
|
|
|
char *proxy_cipher_list;
|
2011-09-16 15:44:45 -04:00
|
|
|
char *cert;
|
2016-11-16 12:49:15 -05:00
|
|
|
char *proxy_cert;
|
2011-09-16 15:44:45 -04:00
|
|
|
char *cert_type;
|
2016-11-16 12:49:15 -05:00
|
|
|
char *proxy_cert_type;
|
2011-09-16 15:44:45 -04:00
|
|
|
char *cacert;
|
2016-11-16 12:49:15 -05:00
|
|
|
char *proxy_cacert;
|
2011-09-16 15:44:45 -04:00
|
|
|
char *capath;
|
2016-11-16 12:49:15 -05:00
|
|
|
char *proxy_capath;
|
2011-09-16 15:44:45 -04:00
|
|
|
char *crlfile;
|
2016-11-16 12:49:15 -05:00
|
|
|
char *proxy_crlfile;
|
2014-09-30 22:31:17 -04:00
|
|
|
char *pinnedpubkey;
|
2011-09-16 15:44:45 -04:00
|
|
|
char *key;
|
2016-11-16 12:49:15 -05:00
|
|
|
char *proxy_key;
|
2011-09-16 15:44:45 -04:00
|
|
|
char *key_type;
|
2016-11-16 12:49:15 -05:00
|
|
|
char *proxy_key_type;
|
2011-09-16 15:44:45 -04:00
|
|
|
char *key_passwd;
|
2016-11-16 12:49:15 -05:00
|
|
|
char *proxy_key_passwd;
|
2011-09-16 15:44:45 -04:00
|
|
|
char *pubkey;
|
|
|
|
char *hostpubmd5;
|
|
|
|
char *engine;
|
|
|
|
bool crlf;
|
|
|
|
char *customrequest;
|
|
|
|
char *krblevel;
|
2017-06-21 17:35:08 -04:00
|
|
|
char *request_target;
|
2011-09-16 15:44:45 -04:00
|
|
|
long httpversion;
|
|
|
|
bool nobuffer;
|
|
|
|
bool readbusy; /* set when reading input returns EAGAIN */
|
|
|
|
bool globoff;
|
|
|
|
bool use_httpget;
|
|
|
|
bool insecure_ok; /* set TRUE to allow insecure SSL connects */
|
2016-11-16 12:49:15 -05:00
|
|
|
bool proxy_insecure_ok; /* set TRUE to allow insecure SSL connects
|
|
|
|
for proxy */
|
2017-06-16 05:30:36 -04:00
|
|
|
bool terminal_binary_ok;
|
2014-06-16 14:47:26 -04:00
|
|
|
bool verifystatus;
|
2011-09-16 15:44:45 -04:00
|
|
|
bool create_dirs;
|
|
|
|
bool ftp_create_dirs;
|
|
|
|
bool ftp_skip_ip;
|
|
|
|
bool proxynegotiate;
|
|
|
|
bool proxyntlm;
|
|
|
|
bool proxydigest;
|
|
|
|
bool proxybasic;
|
|
|
|
bool proxyanyauth;
|
|
|
|
char *writeout; /* %-styled format string to output */
|
|
|
|
struct curl_slist *quote;
|
|
|
|
struct curl_slist *postquote;
|
|
|
|
struct curl_slist *prequote;
|
|
|
|
long ssl_version;
|
2016-12-13 15:10:00 -05:00
|
|
|
long ssl_version_max;
|
2016-11-16 12:49:15 -05:00
|
|
|
long proxy_ssl_version;
|
2011-09-16 15:44:45 -04:00
|
|
|
long ip_version;
|
|
|
|
curl_TimeCond timecond;
|
|
|
|
time_t condtime;
|
|
|
|
struct curl_slist *headers;
|
2014-02-04 17:48:16 -05:00
|
|
|
struct curl_slist *proxyheaders;
|
2017-09-02 13:17:33 -04:00
|
|
|
curl_mime *mimepost;
|
|
|
|
curl_mime *mimecurrent;
|
2011-09-16 15:44:45 -04:00
|
|
|
struct curl_slist *telnet_options;
|
|
|
|
struct curl_slist *resolve;
|
2016-01-25 08:37:24 -05:00
|
|
|
struct curl_slist *connect_to;
|
2011-09-16 15:44:45 -04:00
|
|
|
HttpReq httpreq;
|
|
|
|
|
|
|
|
/* for bandwidth limiting features: */
|
|
|
|
curl_off_t sendpersecond; /* send to peer */
|
|
|
|
curl_off_t recvpersecond; /* receive from peer */
|
|
|
|
|
|
|
|
bool ftp_ssl;
|
|
|
|
bool ftp_ssl_reqd;
|
|
|
|
bool ftp_ssl_control;
|
|
|
|
bool ftp_ssl_ccc;
|
|
|
|
int ftp_ssl_ccc_mode;
|
2016-12-16 10:02:08 -05:00
|
|
|
char *preproxy;
|
2016-04-09 15:47:05 -04:00
|
|
|
int socks5_gssapi_nec; /* The NEC reference server does not protect the
|
|
|
|
encryption type exchange */
|
2017-05-19 12:11:47 -04:00
|
|
|
unsigned long socks5_auth;/* auth bitmask for socks5 proxies */
|
2016-04-09 15:47:05 -04:00
|
|
|
char *proxy_service_name; /* set authentication service name for HTTP and
|
|
|
|
SOCKS5 proxies */
|
2016-04-09 00:33:03 -04:00
|
|
|
char *service_name; /* set authentication service name for DIGEST-MD5,
|
|
|
|
Kerberos 5 and SPNEGO */
|
2011-09-16 15:44:45 -04:00
|
|
|
|
|
|
|
bool tcp_nodelay;
|
2016-02-16 07:21:34 -05:00
|
|
|
bool tcp_fastopen;
|
2011-09-16 15:44:45 -04:00
|
|
|
long req_retry; /* number of retries */
|
2016-10-09 19:00:25 -04:00
|
|
|
bool retry_connrefused; /* set connection refused as a transient error */
|
2011-09-16 15:44:45 -04:00
|
|
|
long retry_delay; /* delay between retries (in seconds) */
|
|
|
|
long retry_maxtime; /* maximum time to keep retrying */
|
|
|
|
|
|
|
|
char *ftp_account; /* for ACCT */
|
|
|
|
char *ftp_alternative_to_user; /* send command if USER/PASS fails */
|
|
|
|
int ftp_filemethod;
|
|
|
|
long tftp_blksize; /* TFTP BLKSIZE option */
|
2015-08-24 00:15:01 -04:00
|
|
|
bool tftp_no_options; /* do not send TFTP options requests */
|
2011-09-16 15:44:45 -04:00
|
|
|
bool ignorecl; /* --ignore-content-length */
|
|
|
|
bool disable_sessionid;
|
|
|
|
|
|
|
|
bool raw;
|
|
|
|
bool post301;
|
|
|
|
bool post302;
|
2012-04-05 17:34:12 -04:00
|
|
|
bool post303;
|
2011-09-16 15:44:45 -04:00
|
|
|
bool nokeepalive; /* for keepalive needs */
|
|
|
|
long alivetime;
|
|
|
|
bool content_disposition; /* use Content-disposition filename */
|
|
|
|
|
|
|
|
int default_node_flags; /* default flags to search for each 'node', which
|
|
|
|
is basically each given URL to transfer */
|
2011-09-30 14:56:56 -04:00
|
|
|
|
2011-09-16 15:44:45 -04:00
|
|
|
bool xattr; /* store metadata in extended attributes */
|
|
|
|
long gssapi_delegation;
|
2012-02-06 16:25:04 -05:00
|
|
|
bool ssl_allow_beast; /* allow this SSL vulnerability */
|
2016-11-16 12:49:15 -05:00
|
|
|
bool proxy_ssl_allow_beast; /* allow this SSL vulnerability for proxy*/
|
|
|
|
|
2015-07-17 02:40:16 -04:00
|
|
|
bool ssl_no_revoke; /* disable SSL certificate revocation checks */
|
2016-11-16 12:49:15 -05:00
|
|
|
/*bool proxy_ssl_no_revoke; */
|
2012-05-26 09:51:03 -04:00
|
|
|
|
2012-06-20 11:51:06 -04:00
|
|
|
bool use_metalink; /* process given URLs as metalink XML file */
|
2012-05-25 06:24:32 -04:00
|
|
|
metalinkfile *metalinkfile_list; /* point to the first node */
|
|
|
|
metalinkfile *metalinkfile_last; /* point to the last/current node */
|
2013-08-10 16:55:59 -04:00
|
|
|
#ifdef CURLDEBUG
|
|
|
|
bool test_event_based;
|
|
|
|
#endif
|
2015-09-04 02:11:09 -04:00
|
|
|
char *oauth_bearer; /* OAuth 2.0 bearer token */
|
2014-12-26 15:45:21 -05:00
|
|
|
bool nonpn; /* enable/disable TLS NPN extension */
|
|
|
|
bool noalpn; /* enable/disable TLS ALPN extension */
|
|
|
|
char *unix_socket_path; /* path to Unix domain socket */
|
2017-01-08 17:51:08 -05:00
|
|
|
bool abstract_unix_socket; /* path to an abstract Unix domain socket */
|
2015-02-14 12:17:04 -05:00
|
|
|
bool falsestart;
|
2015-03-23 05:51:49 -04:00
|
|
|
bool path_as_is;
|
2015-12-14 07:29:13 -05:00
|
|
|
double expect100timeout;
|
2016-04-28 05:33:25 -04:00
|
|
|
bool suppress_connect_headers; /* suppress proxy CONNECT response headers
|
|
|
|
from user callbacks */
|
2017-06-16 05:30:36 -04:00
|
|
|
curl_error synthetic_error; /* if non-zero, it overrides any libcurl
|
|
|
|
error */
|
2017-08-05 05:26:04 -04:00
|
|
|
bool ssh_compression; /* enable/disable SSH compression */
|
2014-02-26 16:02:53 -05:00
|
|
|
struct GlobalConfig *global;
|
2014-02-27 15:59:15 -05:00
|
|
|
struct OperationConfig *prev;
|
2014-12-26 15:45:21 -05:00
|
|
|
struct OperationConfig *next; /* Always last in the struct */
|
2014-02-07 16:14:43 -05:00
|
|
|
};
|
2011-09-16 15:44:45 -04:00
|
|
|
|
2014-02-23 08:15:31 -05:00
|
|
|
struct GlobalConfig {
|
|
|
|
CURL *easy; /* Once we have one, we keep it here */
|
2014-02-23 11:37:28 -05:00
|
|
|
int showerror; /* -1 == unset, default => show errors
|
|
|
|
0 => -s is used to NOT show errors
|
|
|
|
1 => -S has been used to show errors */
|
2014-02-27 15:21:23 -05:00
|
|
|
bool mute; /* don't show messages, --silent given */
|
2014-03-01 08:20:20 -05:00
|
|
|
bool noprogress; /* don't show progress bar --silent given */
|
2014-03-01 08:49:28 -05:00
|
|
|
bool isatty; /* Updated internally if output is a tty */
|
2014-03-01 08:00:31 -05:00
|
|
|
FILE *errors; /* Error stream, defaults to stderr */
|
|
|
|
bool errors_fopened; /* Whether error stream isn't stderr */
|
2014-02-27 15:51:49 -05:00
|
|
|
char *trace_dump; /* file to dump the network trace to */
|
|
|
|
FILE *trace_stream;
|
|
|
|
bool trace_fopened;
|
|
|
|
trace tracetype;
|
|
|
|
bool tracetime; /* include timestamp? */
|
2014-03-01 08:20:20 -05:00
|
|
|
int progressmode; /* CURL_PROGRESS_BAR / CURL_PROGRESS_STATS */
|
2014-03-01 08:38:00 -05:00
|
|
|
char *libcurl; /* Output libcurl code to this file name */
|
2016-11-12 08:19:29 -05:00
|
|
|
bool fail_early; /* exit on first transfer error */
|
2014-02-23 08:15:31 -05:00
|
|
|
struct OperationConfig *first;
|
2014-02-23 10:30:24 -05:00
|
|
|
struct OperationConfig *current;
|
2014-02-23 08:15:31 -05:00
|
|
|
struct OperationConfig *last; /* Always last in the struct */
|
|
|
|
};
|
|
|
|
|
2014-02-27 15:59:15 -05:00
|
|
|
void config_init(struct OperationConfig *config);
|
|
|
|
void config_free(struct OperationConfig *config);
|
2011-09-16 15:44:45 -04:00
|
|
|
|
|
|
|
#endif /* HEADER_CURL_TOOL_CFGABLE_H */
|