tool_cfgable: For consistency renamed init_config() to config_init()
[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 - 2014, 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 #include "tool_metalink.h"
29
30 struct Configurable {
31   CURL *easy;               /* once we have one, we keep it here */
32   bool remote_time;
33   char *random_file;
34   char *egd_file;
35   char *useragent;
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 */
43   bool use_resume;
44   bool resume_from_current;
45   bool disable_epsv;
46   bool disable_eprt;
47   bool ftp_pret;
48   long proto;
49   bool proto_present;
50   long proto_redir;
51   bool proto_redir_present;
52   curl_off_t resume_from;
53   char *postfields;
54   curl_off_t postfieldsize;
55   char *referer;
56   double timeout;
57   double connecttimeout;
58   long maxredirs;
59   curl_off_t max_filesize;
60   char *headerfile;
61   char *ftpport;
62   char *iface;
63   int localport;
64   int localportrange;
65   unsigned short porttouse;
66   char *range;
67   long low_speed_limit;
68   long low_speed_time;
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 */
73   int showerror; /* -1 == unset, default => show errors
74                     0 => -s is used to NOT show errors
75                     1 => -S has been used to show errors */
76   char *userpwd;
77   char *login_options;
78   char *tls_username;
79   char *tls_password;
80   char *tls_authtype;
81   char *proxyuserpwd;
82   char *proxy;
83   int proxyver;             /* set to CURLPROXY_HTTP* define */
84   char *noproxy;
85   char *mail_from;
86   struct curl_slist *mail_rcpt;
87   char *mail_auth;
88   bool sasl_ir;             /* Enable/disable SASL initial response */
89   bool proxytunnel;
90   bool ftp_append;          /* APPE on ftp */
91   bool mute;                /* don't show messages, --silent given */
92   bool use_ascii;           /* select ascii or text transfer */
93   bool autoreferer;         /* automatically set referer */
94   bool failonerror;         /* fail on (HTTP) errors */
95   bool include_headers;     /* send headers to data output */
96   bool no_body;             /* don't get the body */
97   bool dirlistonly;         /* only get the FTP dir list */
98   bool followlocation;      /* follow http redirects */
99   bool unrestricted_auth;   /* Continue to send authentication (user+password)
100                                when following ocations, even when hostname
101                                changed */
102   bool netrc_opt;
103   bool netrc;
104   char *netrc_file;
105   bool noprogress;          /* don't show progress meter, --silent given */
106   bool isatty;              /* updated internally only if output is a tty */
107   struct getout *url_list;  /* point to the first node */
108   struct getout *url_last;  /* point to the last/current node */
109   struct getout *url_get;   /* point to the node to fill in URL */
110   struct getout *url_out;   /* point to the node to fill in outfile */
111   char *cipher_list;
112   char *cert;
113   char *cert_type;
114   char *cacert;
115   char *capath;
116   char *crlfile;
117   char *key;
118   char *key_type;
119   char *key_passwd;
120   char *pubkey;
121   char *hostpubmd5;
122   char *engine;
123   bool list_engines;
124   bool crlf;
125   char *customrequest;
126   char *krblevel;
127   char *trace_dump;         /* file to dump the network trace to, or NULL */
128   FILE *trace_stream;
129   bool trace_fopened;
130   trace tracetype;
131   bool tracetime;           /* include timestamp? */
132   long httpversion;
133   int progressmode;         /* CURL_PROGRESS_BAR or CURL_PROGRESS_STATS */
134   bool nobuffer;
135   bool readbusy;            /* set when reading input returns EAGAIN */
136   bool globoff;
137   bool use_httpget;
138   bool insecure_ok;         /* set TRUE to allow insecure SSL connects */
139   bool create_dirs;
140   bool ftp_create_dirs;
141   bool ftp_skip_ip;
142   bool proxynegotiate;
143   bool proxyntlm;
144   bool proxydigest;
145   bool proxybasic;
146   bool proxyanyauth;
147   char *writeout;           /* %-styled format string to output */
148   bool writeenv;            /* write results to environment, if available */
149   FILE *errors;             /* errors stream, defaults to stderr */
150   bool errors_fopened;      /* whether errors stream isn't stderr */
151   struct curl_slist *quote;
152   struct curl_slist *postquote;
153   struct curl_slist *prequote;
154   long ssl_version;
155   long ip_version;
156   curl_TimeCond timecond;
157   time_t condtime;
158   struct curl_slist *headers;
159   struct curl_httppost *httppost;
160   struct curl_httppost *last_post;
161   struct curl_slist *telnet_options;
162   struct curl_slist *resolve;
163   HttpReq httpreq;
164
165   /* for bandwidth limiting features: */
166   curl_off_t sendpersecond; /* send to peer */
167   curl_off_t recvpersecond; /* receive from peer */
168
169   bool ftp_ssl;
170   bool ftp_ssl_reqd;
171   bool ftp_ssl_control;
172   bool ftp_ssl_ccc;
173   int ftp_ssl_ccc_mode;
174
175   char *socksproxy;         /* set to server string */
176   int socksver;             /* set to CURLPROXY_SOCKS* define */
177   char *socks5_gssapi_service;  /* set service name for gssapi principal
178                                  * default rcmd */
179   int socks5_gssapi_nec ;   /* The NEC reference server does not protect
180                              * the encryption type exchange */
181
182   bool tcp_nodelay;
183   long req_retry;           /* number of retries */
184   long retry_delay;         /* delay between retries (in seconds) */
185   long retry_maxtime;       /* maximum time to keep retrying */
186
187   char *ftp_account;        /* for ACCT */
188   char *ftp_alternative_to_user;  /* send command if USER/PASS fails */
189   int ftp_filemethod;
190   long tftp_blksize;        /* TFTP BLKSIZE option */
191   bool ignorecl;            /* --ignore-content-length */
192   bool disable_sessionid;
193
194   char *libcurl;            /* output libcurl code to this file name */
195   bool raw;
196   bool post301;
197   bool post302;
198   bool post303;
199   bool nokeepalive;         /* for keepalive needs */
200   long alivetime;
201   bool content_disposition; /* use Content-disposition filename */
202
203   int default_node_flags;   /* default flags to search for each 'node', which
204                                is basically each given URL to transfer */
205
206   bool xattr;               /* store metadata in extended attributes */
207   long gssapi_delegation;
208   bool ssl_allow_beast;     /* allow this SSL vulnerability */
209
210   bool use_metalink;        /* process given URLs as metalink XML file */
211   metalinkfile *metalinkfile_list; /* point to the first node */
212   metalinkfile *metalinkfile_last; /* point to the last/current node */
213 #ifdef CURLDEBUG
214   bool test_event_based;
215 #endif
216   char *xoauth2_bearer;     /* XOAUTH2 bearer token */
217 }; /* struct Configurable */
218
219 void config_init(struct Configurable* config);
220 void config_free(struct Configurable* config);
221
222 #endif /* HEADER_CURL_TOOL_CFGABLE_H */