1#ifndef __CURL_CURL_H
2#define __CURL_CURL_H
3/***************************************************************************
4 * _ _ ____ _
5 * Project ___| | | | _ \| |
6 * / __| | | | |_) | |
7 * | (__| |_| | _ <| |___
8 * \___|\___/|_| \_\_____|
9 *
10 * Copyright (C) 1998 - 2018, 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 https://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
25/*
26 * If you have libcurl problems, all docs and details are found here:
27 * https://curl.haxx.se/libcurl/
28 *
29 * curl-library mailing list subscription and unsubscription web interface:
30 * https://cool.haxx.se/mailman/listinfo/curl-library/
31 */
32
33#ifdef CURL_NO_OLDIES
34#define CURL_STRICTER
35#endif
36
37#include "curlver.h" /* libcurl version defines */
38#include "system.h" /* determine things run-time */
39
40/*
41 * Define WIN32 when build target is Win32 API
42 */
43
44#if (defined(_WIN32) || defined(__WIN32__)) && \
45 !defined(WIN32) && !defined(__SYMBIAN32__)
46#define WIN32
47#endif
48
49#include <stdio.h>
50#include <limits.h>
51
52#if defined(__FreeBSD__) && (__FreeBSD__ >= 2)
53/* Needed for __FreeBSD_version symbol definition */
54#include <osreldate.h>
55#endif
56
57/* The include stuff here below is mainly for time_t! */
58#include <sys/types.h>
59#include <time.h>
60
61#if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__CYGWIN__)
62#if !(defined(_WINSOCKAPI_) || defined(_WINSOCK_H) || \
63 defined(__LWIP_OPT_H__) || defined(LWIP_HDR_OPT_H))
64/* The check above prevents the winsock2 inclusion if winsock.h already was
65 included, since they can't co-exist without problems */
66#include <winsock2.h>
67#include <ws2tcpip.h>
68#endif
69#endif
70
71/* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish
72 libc5-based Linux systems. Only include it on systems that are known to
73 require it! */
74#if defined(_AIX) || defined(__NOVELL_LIBC__) || defined(__NetBSD__) || \
75 defined(__minix) || defined(__SYMBIAN32__) || defined(__INTEGRITY) || \
76 defined(ANDROID) || defined(__ANDROID__) || defined(__OpenBSD__) || \
77 defined(__CYGWIN__) || \
78 (defined(__FreeBSD_version) && (__FreeBSD_version < 800000))
79#include <sys/select.h>
80#endif
81
82#if !defined(WIN32) && !defined(_WIN32_WCE)
83#include <sys/socket.h>
84#endif
85
86#if !defined(WIN32) && !defined(__WATCOMC__) && !defined(__VXWORKS__)
87#include <sys/time.h>
88#endif
89
90#ifdef __BEOS__
91#include <support/SupportDefs.h>
92#endif
93
94#ifdef __cplusplus
95extern "C" {
96#endif
97
98#if defined(BUILDING_LIBCURL) || defined(CURL_STRICTER)
99typedef struct Curl_easy CURL;
100typedef struct Curl_share CURLSH;
101#else
102typedef void CURL;
103typedef void CURLSH;
104#endif
105
106/*
107 * libcurl external API function linkage decorations.
108 */
109
110#ifdef CURL_STATICLIB
111# define CURL_EXTERN
112#elif defined(WIN32) || defined(_WIN32) || defined(__SYMBIAN32__)
113# if defined(BUILDING_LIBCURL)
114# define CURL_EXTERN __declspec(dllexport)
115# else
116# define CURL_EXTERN __declspec(dllimport)
117# endif
118#elif defined(BUILDING_LIBCURL) && defined(CURL_HIDDEN_SYMBOLS)
119# define CURL_EXTERN CURL_EXTERN_SYMBOL
120#else
121# define CURL_EXTERN
122#endif
123
124#ifndef curl_socket_typedef
125/* socket typedef */
126#if defined(WIN32) && !defined(__LWIP_OPT_H__) && !defined(LWIP_HDR_OPT_H)
127typedef SOCKET curl_socket_t;
128#define CURL_SOCKET_BAD INVALID_SOCKET
129#else
130typedef int curl_socket_t;
131#define CURL_SOCKET_BAD -1
132#endif
133#define curl_socket_typedef
134#endif /* curl_socket_typedef */
135
136/* enum for the different supported SSL backends */
137typedef enum {
138 CURLSSLBACKEND_NONE = 0,
139 CURLSSLBACKEND_OPENSSL = 1,
140 CURLSSLBACKEND_GNUTLS = 2,
141 CURLSSLBACKEND_NSS = 3,
142 CURLSSLBACKEND_OBSOLETE4 = 4, /* Was QSOSSL. */
143 CURLSSLBACKEND_GSKIT = 5,
144 CURLSSLBACKEND_POLARSSL = 6,
145 CURLSSLBACKEND_WOLFSSL = 7,
146 CURLSSLBACKEND_SCHANNEL = 8,
147 CURLSSLBACKEND_DARWINSSL = 9,
148 CURLSSLBACKEND_AXTLS = 10, /* never used since 7.63.0 */
149 CURLSSLBACKEND_MBEDTLS = 11,
150 CURLSSLBACKEND_MESALINK = 12
151} curl_sslbackend;
152
153/* aliases for library clones and renames */
154#define CURLSSLBACKEND_LIBRESSL CURLSSLBACKEND_OPENSSL
155#define CURLSSLBACKEND_BORINGSSL CURLSSLBACKEND_OPENSSL
156#define CURLSSLBACKEND_CYASSL CURLSSLBACKEND_WOLFSSL
157
158struct curl_httppost {
159 struct curl_httppost *next; /* next entry in the list */
160 char *name; /* pointer to allocated name */
161 long namelength; /* length of name length */
162 char *contents; /* pointer to allocated data contents */
163 long contentslength; /* length of contents field, see also
164 CURL_HTTPPOST_LARGE */
165 char *buffer; /* pointer to allocated buffer contents */
166 long bufferlength; /* length of buffer field */
167 char *contenttype; /* Content-Type */
168 struct curl_slist *contentheader; /* list of extra headers for this form */
169 struct curl_httppost *more; /* if one field name has more than one
170 file, this link should link to following
171 files */
172 long flags; /* as defined below */
173
174/* specified content is a file name */
175#define CURL_HTTPPOST_FILENAME (1<<0)
176/* specified content is a file name */
177#define CURL_HTTPPOST_READFILE (1<<1)
178/* name is only stored pointer do not free in formfree */
179#define CURL_HTTPPOST_PTRNAME (1<<2)
180/* contents is only stored pointer do not free in formfree */
181#define CURL_HTTPPOST_PTRCONTENTS (1<<3)
182/* upload file from buffer */
183#define CURL_HTTPPOST_BUFFER (1<<4)
184/* upload file from pointer contents */
185#define CURL_HTTPPOST_PTRBUFFER (1<<5)
186/* upload file contents by using the regular read callback to get the data and
187 pass the given pointer as custom pointer */
188#define CURL_HTTPPOST_CALLBACK (1<<6)
189/* use size in 'contentlen', added in 7.46.0 */
190#define CURL_HTTPPOST_LARGE (1<<7)
191
192 char *showfilename; /* The file name to show. If not set, the
193 actual file name will be used (if this
194 is a file part) */
195 void *userp; /* custom pointer used for
196 HTTPPOST_CALLBACK posts */
197 curl_off_t contentlen; /* alternative length of contents
198 field. Used if CURL_HTTPPOST_LARGE is
199 set. Added in 7.46.0 */
200};
201
202/* This is the CURLOPT_PROGRESSFUNCTION callback proto. It is now considered
203 deprecated but was the only choice up until 7.31.0 */
204typedef int (*curl_progress_callback)(void *clientp,
205 double dltotal,
206 double dlnow,
207 double ultotal,
208 double ulnow);
209
210/* This is the CURLOPT_XFERINFOFUNCTION callback proto. It was introduced in
211 7.32.0, it avoids floating point and provides more detailed information. */
212typedef int (*curl_xferinfo_callback)(void *clientp,
213 curl_off_t dltotal,
214 curl_off_t dlnow,
215 curl_off_t ultotal,
216 curl_off_t ulnow);
217
218#ifndef CURL_MAX_READ_SIZE
219 /* The maximum receive buffer size configurable via CURLOPT_BUFFERSIZE. */
220#define CURL_MAX_READ_SIZE 524288
221#endif
222
223#ifndef CURL_MAX_WRITE_SIZE
224 /* Tests have proven that 20K is a very bad buffer size for uploads on
225 Windows, while 16K for some odd reason performed a lot better.
226 We do the ifndef check to allow this value to easier be changed at build
227 time for those who feel adventurous. The practical minimum is about
228 400 bytes since libcurl uses a buffer of this size as a scratch area
229 (unrelated to network send operations). */
230#define CURL_MAX_WRITE_SIZE 16384
231#endif
232
233#ifndef CURL_MAX_HTTP_HEADER
234/* The only reason to have a max limit for this is to avoid the risk of a bad
235 server feeding libcurl with a never-ending header that will cause reallocs
236 infinitely */
237#define CURL_MAX_HTTP_HEADER (100*1024)
238#endif
239
240/* This is a magic return code for the write callback that, when returned,
241 will signal libcurl to pause receiving on the current transfer. */
242#define CURL_WRITEFUNC_PAUSE 0x10000001
243
244typedef size_t (*curl_write_callback)(char *buffer,
245 size_t size,
246 size_t nitems,
247 void *outstream);
248
249/* This callback will be called when a new resolver request is made */
250typedef int (*curl_resolver_start_callback)(void *resolver_state,
251 void *reserved, void *userdata);
252
253/* enumeration of file types */
254typedef enum {
255 CURLFILETYPE_FILE = 0,
256 CURLFILETYPE_DIRECTORY,
257 CURLFILETYPE_SYMLINK,
258 CURLFILETYPE_DEVICE_BLOCK,
259 CURLFILETYPE_DEVICE_CHAR,
260 CURLFILETYPE_NAMEDPIPE,
261 CURLFILETYPE_SOCKET,
262 CURLFILETYPE_DOOR, /* is possible only on Sun Solaris now */
263
264 CURLFILETYPE_UNKNOWN /* should never occur */
265} curlfiletype;
266
267#define CURLFINFOFLAG_KNOWN_FILENAME (1<<0)
268#define CURLFINFOFLAG_KNOWN_FILETYPE (1<<1)
269#define CURLFINFOFLAG_KNOWN_TIME (1<<2)
270#define CURLFINFOFLAG_KNOWN_PERM (1<<3)
271#define CURLFINFOFLAG_KNOWN_UID (1<<4)
272#define CURLFINFOFLAG_KNOWN_GID (1<<5)
273#define CURLFINFOFLAG_KNOWN_SIZE (1<<6)
274#define CURLFINFOFLAG_KNOWN_HLINKCOUNT (1<<7)
275
276/* Content of this structure depends on information which is known and is
277 achievable (e.g. by FTP LIST parsing). Please see the url_easy_setopt(3) man
278 page for callbacks returning this structure -- some fields are mandatory,
279 some others are optional. The FLAG field has special meaning. */
280struct curl_fileinfo {
281 char *filename;
282 curlfiletype filetype;
283 time_t time;
284 unsigned int perm;
285 int uid;
286 int gid;
287 curl_off_t size;
288 long int hardlinks;
289
290 struct {
291 /* If some of these fields is not NULL, it is a pointer to b_data. */
292 char *time;
293 char *perm;
294 char *user;
295 char *group;
296 char *target; /* pointer to the target filename of a symlink */
297 } strings;
298
299 unsigned int flags;
300
301 /* used internally */
302 char *b_data;
303 size_t b_size;
304 size_t b_used;
305};
306
307/* return codes for CURLOPT_CHUNK_BGN_FUNCTION */
308#define CURL_CHUNK_BGN_FUNC_OK 0
309#define CURL_CHUNK_BGN_FUNC_FAIL 1 /* tell the lib to end the task */
310#define CURL_CHUNK_BGN_FUNC_SKIP 2 /* skip this chunk over */
311
312/* if splitting of data transfer is enabled, this callback is called before
313 download of an individual chunk started. Note that parameter "remains" works
314 only for FTP wildcard downloading (for now), otherwise is not used */
315typedef long (*curl_chunk_bgn_callback)(const void *transfer_info,
316 void *ptr,
317 int remains);
318
319/* return codes for CURLOPT_CHUNK_END_FUNCTION */
320#define CURL_CHUNK_END_FUNC_OK 0
321#define CURL_CHUNK_END_FUNC_FAIL 1 /* tell the lib to end the task */
322
323/* If splitting of data transfer is enabled this callback is called after
324 download of an individual chunk finished.
325 Note! After this callback was set then it have to be called FOR ALL chunks.
326 Even if downloading of this chunk was skipped in CHUNK_BGN_FUNC.
327 This is the reason why we don't need "transfer_info" parameter in this
328 callback and we are not interested in "remains" parameter too. */
329typedef long (*curl_chunk_end_callback)(void *ptr);
330
331/* return codes for FNMATCHFUNCTION */
332#define CURL_FNMATCHFUNC_MATCH 0 /* string corresponds to the pattern */
333#define CURL_FNMATCHFUNC_NOMATCH 1 /* pattern doesn't match the string */
334#define CURL_FNMATCHFUNC_FAIL 2 /* an error occurred */
335
336/* callback type for wildcard downloading pattern matching. If the
337 string matches the pattern, return CURL_FNMATCHFUNC_MATCH value, etc. */
338typedef int (*curl_fnmatch_callback)(void *ptr,
339 const char *pattern,
340 const char *string);
341
342/* These are the return codes for the seek callbacks */
343#define CURL_SEEKFUNC_OK 0
344#define CURL_SEEKFUNC_FAIL 1 /* fail the entire transfer */
345#define CURL_SEEKFUNC_CANTSEEK 2 /* tell libcurl seeking can't be done, so
346 libcurl might try other means instead */
347typedef int (*curl_seek_callback)(void *instream,
348 curl_off_t offset,
349 int origin); /* 'whence' */
350
351/* This is a return code for the read callback that, when returned, will
352 signal libcurl to immediately abort the current transfer. */
353#define CURL_READFUNC_ABORT 0x10000000
354/* This is a return code for the read callback that, when returned, will
355 signal libcurl to pause sending data on the current transfer. */
356#define CURL_READFUNC_PAUSE 0x10000001
357
358/* Return code for when the trailing headers' callback has terminated
359 without any errors*/
360#define CURL_TRAILERFUNC_OK 0
361/* Return code for when was an error in the trailing header's list and we
362 want to abort the request */
363#define CURL_TRAILERFUNC_ABORT 1
364
365typedef size_t (*curl_read_callback)(char *buffer,
366 size_t size,
367 size_t nitems,
368 void *instream);
369
370typedef int (*curl_trailer_callback)(struct curl_slist **list,
371 void *userdata);
372
373typedef enum {
374 CURLSOCKTYPE_IPCXN, /* socket created for a specific IP connection */
375 CURLSOCKTYPE_ACCEPT, /* socket created by accept() call */
376 CURLSOCKTYPE_LAST /* never use */
377} curlsocktype;
378
379/* The return code from the sockopt_callback can signal information back
380 to libcurl: */
381#define CURL_SOCKOPT_OK 0
382#define CURL_SOCKOPT_ERROR 1 /* causes libcurl to abort and return
383 CURLE_ABORTED_BY_CALLBACK */
384#define CURL_SOCKOPT_ALREADY_CONNECTED 2
385
386typedef int (*curl_sockopt_callback)(void *clientp,
387 curl_socket_t curlfd,
388 curlsocktype purpose);
389
390struct curl_sockaddr {
391 int family;
392 int socktype;
393 int protocol;
394 unsigned int addrlen; /* addrlen was a socklen_t type before 7.18.0 but it
395 turned really ugly and painful on the systems that
396 lack this type */
397 struct sockaddr addr;
398};
399
400typedef curl_socket_t
401(*curl_opensocket_callback)(void *clientp,
402 curlsocktype purpose,
403 struct curl_sockaddr *address);
404
405typedef int
406(*curl_closesocket_callback)(void *clientp, curl_socket_t item);
407
408typedef enum {
409 CURLIOE_OK, /* I/O operation successful */
410 CURLIOE_UNKNOWNCMD, /* command was unknown to callback */
411 CURLIOE_FAILRESTART, /* failed to restart the read */
412 CURLIOE_LAST /* never use */
413} curlioerr;
414
415typedef enum {
416 CURLIOCMD_NOP, /* no operation */
417 CURLIOCMD_RESTARTREAD, /* restart the read stream from start */
418 CURLIOCMD_LAST /* never use */
419} curliocmd;
420
421typedef curlioerr (*curl_ioctl_callback)(CURL *handle,
422 int cmd,
423 void *clientp);
424
425#ifndef CURL_DID_MEMORY_FUNC_TYPEDEFS
426/*
427 * The following typedef's are signatures of malloc, free, realloc, strdup and
428 * calloc respectively. Function pointers of these types can be passed to the
429 * curl_global_init_mem() function to set user defined memory management
430 * callback routines.
431 */
432typedef void *(*curl_malloc_callback)(size_t size);
433typedef void (*curl_free_callback)(void *ptr);
434typedef void *(*curl_realloc_callback)(void *ptr, size_t size);
435typedef char *(*curl_strdup_callback)(const char *str);
436typedef void *(*curl_calloc_callback)(size_t nmemb, size_t size);
437
438#define CURL_DID_MEMORY_FUNC_TYPEDEFS
439#endif
440
441/* the kind of data that is passed to information_callback*/
442typedef enum {
443 CURLINFO_TEXT = 0,
444 CURLINFO_HEADER_IN, /* 1 */
445 CURLINFO_HEADER_OUT, /* 2 */
446 CURLINFO_DATA_IN, /* 3 */
447 CURLINFO_DATA_OUT, /* 4 */
448 CURLINFO_SSL_DATA_IN, /* 5 */
449 CURLINFO_SSL_DATA_OUT, /* 6 */
450 CURLINFO_END
451} curl_infotype;
452
453typedef int (*curl_debug_callback)
454 (CURL *handle, /* the handle/transfer this concerns */
455 curl_infotype type, /* what kind of data */
456 char *data, /* points to the data */
457 size_t size, /* size of the data pointed to */
458 void *userptr); /* whatever the user please */
459
460/* All possible error codes from all sorts of curl functions. Future versions
461 may return other values, stay prepared.
462
463 Always add new return codes last. Never *EVER* remove any. The return
464 codes must remain the same!
465 */
466
467typedef enum {
468 CURLE_OK = 0,
469 CURLE_UNSUPPORTED_PROTOCOL, /* 1 */
470 CURLE_FAILED_INIT, /* 2 */
471 CURLE_URL_MALFORMAT, /* 3 */
472 CURLE_NOT_BUILT_IN, /* 4 - [was obsoleted in August 2007 for
473 7.17.0, reused in April 2011 for 7.21.5] */
474 CURLE_COULDNT_RESOLVE_PROXY, /* 5 */
475 CURLE_COULDNT_RESOLVE_HOST, /* 6 */
476 CURLE_COULDNT_CONNECT, /* 7 */
477 CURLE_WEIRD_SERVER_REPLY, /* 8 */
478 CURLE_REMOTE_ACCESS_DENIED, /* 9 a service was denied by the server
479 due to lack of access - when login fails
480 this is not returned. */
481 CURLE_FTP_ACCEPT_FAILED, /* 10 - [was obsoleted in April 2006 for
482 7.15.4, reused in Dec 2011 for 7.24.0]*/
483 CURLE_FTP_WEIRD_PASS_REPLY, /* 11 */
484 CURLE_FTP_ACCEPT_TIMEOUT, /* 12 - timeout occurred accepting server
485 [was obsoleted in August 2007 for 7.17.0,
486 reused in Dec 2011 for 7.24.0]*/
487 CURLE_FTP_WEIRD_PASV_REPLY, /* 13 */
488 CURLE_FTP_WEIRD_227_FORMAT, /* 14 */
489 CURLE_FTP_CANT_GET_HOST, /* 15 */
490 CURLE_HTTP2, /* 16 - A problem in the http2 framing layer.
491 [was obsoleted in August 2007 for 7.17.0,
492 reused in July 2014 for 7.38.0] */
493 CURLE_FTP_COULDNT_SET_TYPE, /* 17 */
494 CURLE_PARTIAL_FILE, /* 18 */
495 CURLE_FTP_COULDNT_RETR_FILE, /* 19 */
496 CURLE_OBSOLETE20, /* 20 - NOT USED */
497 CURLE_QUOTE_ERROR, /* 21 - quote command failure */
498 CURLE_HTTP_RETURNED_ERROR, /* 22 */
499 CURLE_WRITE_ERROR, /* 23 */
500 CURLE_OBSOLETE24, /* 24 - NOT USED */
501 CURLE_UPLOAD_FAILED, /* 25 - failed upload "command" */
502 CURLE_READ_ERROR, /* 26 - couldn't open/read from file */
503 CURLE_OUT_OF_MEMORY, /* 27 */
504 /* Note: CURLE_OUT_OF_MEMORY may sometimes indicate a conversion error
505 instead of a memory allocation error if CURL_DOES_CONVERSIONS
506 is defined
507 */
508 CURLE_OPERATION_TIMEDOUT, /* 28 - the timeout time was reached */
509 CURLE_OBSOLETE29, /* 29 - NOT USED */
510 CURLE_FTP_PORT_FAILED, /* 30 - FTP PORT operation failed */
511 CURLE_FTP_COULDNT_USE_REST, /* 31 - the REST command failed */
512 CURLE_OBSOLETE32, /* 32 - NOT USED */
513 CURLE_RANGE_ERROR, /* 33 - RANGE "command" didn't work */
514 CURLE_HTTP_POST_ERROR, /* 34 */
515 CURLE_SSL_CONNECT_ERROR, /* 35 - wrong when connecting with SSL */
516 CURLE_BAD_DOWNLOAD_RESUME, /* 36 - couldn't resume download */
517 CURLE_FILE_COULDNT_READ_FILE, /* 37 */
518 CURLE_LDAP_CANNOT_BIND, /* 38 */
519 CURLE_LDAP_SEARCH_FAILED, /* 39 */
520 CURLE_OBSOLETE40, /* 40 - NOT USED */
521 CURLE_FUNCTION_NOT_FOUND, /* 41 - NOT USED starting with 7.53.0 */
522 CURLE_ABORTED_BY_CALLBACK, /* 42 */
523 CURLE_BAD_FUNCTION_ARGUMENT, /* 43 */
524 CURLE_OBSOLETE44, /* 44 - NOT USED */
525 CURLE_INTERFACE_FAILED, /* 45 - CURLOPT_INTERFACE failed */
526 CURLE_OBSOLETE46, /* 46 - NOT USED */
527 CURLE_TOO_MANY_REDIRECTS, /* 47 - catch endless re-direct loops */
528 CURLE_UNKNOWN_OPTION, /* 48 - User specified an unknown option */
529 CURLE_TELNET_OPTION_SYNTAX, /* 49 - Malformed telnet option */
530 CURLE_OBSOLETE50, /* 50 - NOT USED */
531 CURLE_OBSOLETE51, /* 51 - NOT USED */
532 CURLE_GOT_NOTHING, /* 52 - when this is a specific error */
533 CURLE_SSL_ENGINE_NOTFOUND, /* 53 - SSL crypto engine not found */
534 CURLE_SSL_ENGINE_SETFAILED, /* 54 - can not set SSL crypto engine as
535 default */
536 CURLE_SEND_ERROR, /* 55 - failed sending network data */
537 CURLE_RECV_ERROR, /* 56 - failure in receiving network data */
538 CURLE_OBSOLETE57, /* 57 - NOT IN USE */
539 CURLE_SSL_CERTPROBLEM, /* 58 - problem with the local certificate */
540 CURLE_SSL_CIPHER, /* 59 - couldn't use specified cipher */
541 CURLE_PEER_FAILED_VERIFICATION, /* 60 - peer's certificate or fingerprint
542 wasn't verified fine */
543 CURLE_BAD_CONTENT_ENCODING, /* 61 - Unrecognized/bad encoding */
544 CURLE_LDAP_INVALID_URL, /* 62 - Invalid LDAP URL */
545 CURLE_FILESIZE_EXCEEDED, /* 63 - Maximum file size exceeded */
546 CURLE_USE_SSL_FAILED, /* 64 - Requested FTP SSL level failed */
547 CURLE_SEND_FAIL_REWIND, /* 65 - Sending the data requires a rewind
548 that failed */
549 CURLE_SSL_ENGINE_INITFAILED, /* 66 - failed to initialise ENGINE */
550 CURLE_LOGIN_DENIED, /* 67 - user, password or similar was not
551 accepted and we failed to login */
552 CURLE_TFTP_NOTFOUND, /* 68 - file not found on server */
553 CURLE_TFTP_PERM, /* 69 - permission problem on server */
554 CURLE_REMOTE_DISK_FULL, /* 70 - out of disk space on server */
555 CURLE_TFTP_ILLEGAL, /* 71 - Illegal TFTP operation */
556 CURLE_TFTP_UNKNOWNID, /* 72 - Unknown transfer ID */
557 CURLE_REMOTE_FILE_EXISTS, /* 73 - File already exists */
558 CURLE_TFTP_NOSUCHUSER, /* 74 - No such user */
559 CURLE_CONV_FAILED, /* 75 - conversion failed */
560 CURLE_CONV_REQD, /* 76 - caller must register conversion
561 callbacks using curl_easy_setopt options
562 CURLOPT_CONV_FROM_NETWORK_FUNCTION,
563 CURLOPT_CONV_TO_NETWORK_FUNCTION, and
564 CURLOPT_CONV_FROM_UTF8_FUNCTION */
565 CURLE_SSL_CACERT_BADFILE, /* 77 - could not load CACERT file, missing
566 or wrong format */
567 CURLE_REMOTE_FILE_NOT_FOUND, /* 78 - remote file not found */
568 CURLE_SSH, /* 79 - error from the SSH layer, somewhat
569 generic so the error message will be of
570 interest when this has happened */
571
572 CURLE_SSL_SHUTDOWN_FAILED, /* 80 - Failed to shut down the SSL
573 connection */
574 CURLE_AGAIN, /* 81 - socket is not ready for send/recv,
575 wait till it's ready and try again (Added
576 in 7.18.2) */
577 CURLE_SSL_CRL_BADFILE, /* 82 - could not load CRL file, missing or
578 wrong format (Added in 7.19.0) */
579 CURLE_SSL_ISSUER_ERROR, /* 83 - Issuer check failed. (Added in
580 7.19.0) */
581 CURLE_FTP_PRET_FAILED, /* 84 - a PRET command failed */
582 CURLE_RTSP_CSEQ_ERROR, /* 85 - mismatch of RTSP CSeq numbers */
583 CURLE_RTSP_SESSION_ERROR, /* 86 - mismatch of RTSP Session Ids */
584 CURLE_FTP_BAD_FILE_LIST, /* 87 - unable to parse FTP file list */
585 CURLE_CHUNK_FAILED, /* 88 - chunk callback reported error */
586 CURLE_NO_CONNECTION_AVAILABLE, /* 89 - No connection available, the
587 session will be queued */
588 CURLE_SSL_PINNEDPUBKEYNOTMATCH, /* 90 - specified pinned public key did not
589 match */
590 CURLE_SSL_INVALIDCERTSTATUS, /* 91 - invalid certificate status */
591 CURLE_HTTP2_STREAM, /* 92 - stream error in HTTP/2 framing layer
592 */
593 CURLE_RECURSIVE_API_CALL, /* 93 - an api function was called from
594 inside a callback */
595 CURL_LAST /* never use! */
596} CURLcode;
597
598#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all
599 the obsolete stuff removed! */
600
601/* Previously obsolete error code re-used in 7.38.0 */
602#define CURLE_OBSOLETE16 CURLE_HTTP2
603
604/* Previously obsolete error codes re-used in 7.24.0 */
605#define CURLE_OBSOLETE10 CURLE_FTP_ACCEPT_FAILED
606#define CURLE_OBSOLETE12 CURLE_FTP_ACCEPT_TIMEOUT
607
608/* compatibility with older names */
609#define CURLOPT_ENCODING CURLOPT_ACCEPT_ENCODING
610#define CURLE_FTP_WEIRD_SERVER_REPLY CURLE_WEIRD_SERVER_REPLY
611
612/* The following were added in 7.62.0 */
613#define CURLE_SSL_CACERT CURLE_PEER_FAILED_VERIFICATION
614
615/* The following were added in 7.21.5, April 2011 */
616#define CURLE_UNKNOWN_TELNET_OPTION CURLE_UNKNOWN_OPTION
617
618/* The following were added in 7.17.1 */
619/* These are scheduled to disappear by 2009 */
620#define CURLE_SSL_PEER_CERTIFICATE CURLE_PEER_FAILED_VERIFICATION
621
622/* The following were added in 7.17.0 */
623/* These are scheduled to disappear by 2009 */
624#define CURLE_OBSOLETE CURLE_OBSOLETE50 /* no one should be using this! */
625#define CURLE_BAD_PASSWORD_ENTERED CURLE_OBSOLETE46
626#define CURLE_BAD_CALLING_ORDER CURLE_OBSOLETE44
627#define CURLE_FTP_USER_PASSWORD_INCORRECT CURLE_OBSOLETE10
628#define CURLE_FTP_CANT_RECONNECT CURLE_OBSOLETE16
629#define CURLE_FTP_COULDNT_GET_SIZE CURLE_OBSOLETE32
630#define CURLE_FTP_COULDNT_SET_ASCII CURLE_OBSOLETE29
631#define CURLE_FTP_WEIRD_USER_REPLY CURLE_OBSOLETE12
632#define CURLE_FTP_WRITE_ERROR CURLE_OBSOLETE20
633#define CURLE_LIBRARY_NOT_FOUND CURLE_OBSOLETE40
634#define CURLE_MALFORMAT_USER CURLE_OBSOLETE24
635#define CURLE_SHARE_IN_USE CURLE_OBSOLETE57
636#define CURLE_URL_MALFORMAT_USER CURLE_NOT_BUILT_IN
637
638#define CURLE_FTP_ACCESS_DENIED CURLE_REMOTE_ACCESS_DENIED
639#define CURLE_FTP_COULDNT_SET_BINARY CURLE_FTP_COULDNT_SET_TYPE
640#define CURLE_FTP_QUOTE_ERROR CURLE_QUOTE_ERROR
641#define CURLE_TFTP_DISKFULL CURLE_REMOTE_DISK_FULL
642#define CURLE_TFTP_EXISTS CURLE_REMOTE_FILE_EXISTS
643#define CURLE_HTTP_RANGE_ERROR CURLE_RANGE_ERROR
644#define CURLE_FTP_SSL_FAILED CURLE_USE_SSL_FAILED
645
646/* The following were added earlier */
647
648#define CURLE_OPERATION_TIMEOUTED CURLE_OPERATION_TIMEDOUT
649
650#define CURLE_HTTP_NOT_FOUND CURLE_HTTP_RETURNED_ERROR
651#define CURLE_HTTP_PORT_FAILED CURLE_INTERFACE_FAILED
652#define CURLE_FTP_COULDNT_STOR_FILE CURLE_UPLOAD_FAILED
653
654#define CURLE_FTP_PARTIAL_FILE CURLE_PARTIAL_FILE
655#define CURLE_FTP_BAD_DOWNLOAD_RESUME CURLE_BAD_DOWNLOAD_RESUME
656
657/* This was the error code 50 in 7.7.3 and a few earlier versions, this
658 is no longer used by libcurl but is instead #defined here only to not
659 make programs break */
660#define CURLE_ALREADY_COMPLETE 99999
661
662/* Provide defines for really old option names */
663#define CURLOPT_FILE CURLOPT_WRITEDATA /* name changed in 7.9.7 */
664#define CURLOPT_INFILE CURLOPT_READDATA /* name changed in 7.9.7 */
665#define CURLOPT_WRITEHEADER CURLOPT_HEADERDATA
666
667/* Since long deprecated options with no code in the lib that does anything
668 with them. */
669#define CURLOPT_WRITEINFO CURLOPT_OBSOLETE40
670#define CURLOPT_CLOSEPOLICY CURLOPT_OBSOLETE72
671
672#endif /*!CURL_NO_OLDIES*/
673
674/* This prototype applies to all conversion callbacks */
675typedef CURLcode (*curl_conv_callback)(char *buffer, size_t length);
676
677typedef CURLcode (*curl_ssl_ctx_callback)(CURL *curl, /* easy handle */
678 void *ssl_ctx, /* actually an
679 OpenSSL SSL_CTX */
680 void *userptr);
681
682typedef enum {
683 CURLPROXY_HTTP = 0, /* added in 7.10, new in 7.19.4 default is to use
684 CONNECT HTTP/1.1 */
685 CURLPROXY_HTTP_1_0 = 1, /* added in 7.19.4, force to use CONNECT
686 HTTP/1.0 */
687 CURLPROXY_HTTPS = 2, /* added in 7.52.0 */
688 CURLPROXY_SOCKS4 = 4, /* support added in 7.15.2, enum existed already
689 in 7.10 */
690 CURLPROXY_SOCKS5 = 5, /* added in 7.10 */
691 CURLPROXY_SOCKS4A = 6, /* added in 7.18.0 */
692 CURLPROXY_SOCKS5_HOSTNAME = 7 /* Use the SOCKS5 protocol but pass along the
693 host name rather than the IP address. added
694 in 7.18.0 */
695} curl_proxytype; /* this enum was added in 7.10 */
696
697/*
698 * Bitmasks for CURLOPT_HTTPAUTH and CURLOPT_PROXYAUTH options:
699 *
700 * CURLAUTH_NONE - No HTTP authentication
701 * CURLAUTH_BASIC - HTTP Basic authentication (default)
702 * CURLAUTH_DIGEST - HTTP Digest authentication
703 * CURLAUTH_NEGOTIATE - HTTP Negotiate (SPNEGO) authentication
704 * CURLAUTH_GSSNEGOTIATE - Alias for CURLAUTH_NEGOTIATE (deprecated)
705 * CURLAUTH_NTLM - HTTP NTLM authentication
706 * CURLAUTH_DIGEST_IE - HTTP Digest authentication with IE flavour
707 * CURLAUTH_NTLM_WB - HTTP NTLM authentication delegated to winbind helper
708 * CURLAUTH_BEARER - HTTP Bearer token authentication
709 * CURLAUTH_ONLY - Use together with a single other type to force no
710 * authentication or just that single type
711 * CURLAUTH_ANY - All fine types set
712 * CURLAUTH_ANYSAFE - All fine types except Basic
713 */
714
715#define CURLAUTH_NONE ((unsigned long)0)
716#define CURLAUTH_BASIC (((unsigned long)1)<<0)
717#define CURLAUTH_DIGEST (((unsigned long)1)<<1)
718#define CURLAUTH_NEGOTIATE (((unsigned long)1)<<2)
719/* Deprecated since the advent of CURLAUTH_NEGOTIATE */
720#define CURLAUTH_GSSNEGOTIATE CURLAUTH_NEGOTIATE
721/* Used for CURLOPT_SOCKS5_AUTH to stay terminologically correct */
722#define CURLAUTH_GSSAPI CURLAUTH_NEGOTIATE
723#define CURLAUTH_NTLM (((unsigned long)1)<<3)
724#define CURLAUTH_DIGEST_IE (((unsigned long)1)<<4)
725#define CURLAUTH_NTLM_WB (((unsigned long)1)<<5)
726#define CURLAUTH_BEARER (((unsigned long)1)<<6)
727#define CURLAUTH_ONLY (((unsigned long)1)<<31)
728#define CURLAUTH_ANY (~CURLAUTH_DIGEST_IE)
729#define CURLAUTH_ANYSAFE (~(CURLAUTH_BASIC|CURLAUTH_DIGEST_IE))
730
731#define CURLSSH_AUTH_ANY ~0 /* all types supported by the server */
732#define CURLSSH_AUTH_NONE 0 /* none allowed, silly but complete */
733#define CURLSSH_AUTH_PUBLICKEY (1<<0) /* public/private key files */
734#define CURLSSH_AUTH_PASSWORD (1<<1) /* password */
735#define CURLSSH_AUTH_HOST (1<<2) /* host key files */
736#define CURLSSH_AUTH_KEYBOARD (1<<3) /* keyboard interactive */
737#define CURLSSH_AUTH_AGENT (1<<4) /* agent (ssh-agent, pageant...) */
738#define CURLSSH_AUTH_GSSAPI (1<<5) /* gssapi (kerberos, ...) */
739#define CURLSSH_AUTH_DEFAULT CURLSSH_AUTH_ANY
740
741#define CURLGSSAPI_DELEGATION_NONE 0 /* no delegation (default) */
742#define CURLGSSAPI_DELEGATION_POLICY_FLAG (1<<0) /* if permitted by policy */
743#define CURLGSSAPI_DELEGATION_FLAG (1<<1) /* delegate always */
744
745#define CURL_ERROR_SIZE 256
746
747enum curl_khtype {
748 CURLKHTYPE_UNKNOWN,
749 CURLKHTYPE_RSA1,
750 CURLKHTYPE_RSA,
751 CURLKHTYPE_DSS,
752 CURLKHTYPE_ECDSA,
753 CURLKHTYPE_ED25519
754};
755
756struct curl_khkey {
757 const char *key; /* points to a zero-terminated string encoded with base64
758 if len is zero, otherwise to the "raw" data */
759 size_t len;
760 enum curl_khtype keytype;
761};
762
763/* this is the set of return values expected from the curl_sshkeycallback
764 callback */
765enum curl_khstat {
766 CURLKHSTAT_FINE_ADD_TO_FILE,
767 CURLKHSTAT_FINE,
768 CURLKHSTAT_REJECT, /* reject the connection, return an error */
769 CURLKHSTAT_DEFER, /* do not accept it, but we can't answer right now so
770 this causes a CURLE_DEFER error but otherwise the
771 connection will be left intact etc */
772 CURLKHSTAT_LAST /* not for use, only a marker for last-in-list */
773};
774
775/* this is the set of status codes pass in to the callback */
776enum curl_khmatch {
777 CURLKHMATCH_OK, /* match */
778 CURLKHMATCH_MISMATCH, /* host found, key mismatch! */
779 CURLKHMATCH_MISSING, /* no matching host/key found */
780 CURLKHMATCH_LAST /* not for use, only a marker for last-in-list */
781};
782
783typedef int
784 (*curl_sshkeycallback) (CURL *easy, /* easy handle */
785 const struct curl_khkey *knownkey, /* known */
786 const struct curl_khkey *foundkey, /* found */
787 enum curl_khmatch, /* libcurl's view on the keys */
788 void *clientp); /* custom pointer passed from app */
789
790/* parameter for the CURLOPT_USE_SSL option */
791typedef enum {
792 CURLUSESSL_NONE, /* do not attempt to use SSL */
793 CURLUSESSL_TRY, /* try using SSL, proceed anyway otherwise */
794 CURLUSESSL_CONTROL, /* SSL for the control connection or fail */
795 CURLUSESSL_ALL, /* SSL for all communication or fail */
796 CURLUSESSL_LAST /* not an option, never use */
797} curl_usessl;
798
799/* Definition of bits for the CURLOPT_SSL_OPTIONS argument: */
800
801/* - ALLOW_BEAST tells libcurl to allow the BEAST SSL vulnerability in the
802 name of improving interoperability with older servers. Some SSL libraries
803 have introduced work-arounds for this flaw but those work-arounds sometimes
804 make the SSL communication fail. To regain functionality with those broken
805 servers, a user can this way allow the vulnerability back. */
806#define CURLSSLOPT_ALLOW_BEAST (1<<0)
807
808/* - NO_REVOKE tells libcurl to disable certificate revocation checks for those
809 SSL backends where such behavior is present. */
810#define CURLSSLOPT_NO_REVOKE (1<<1)
811
812/* The default connection attempt delay in milliseconds for happy eyeballs.
813 CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS.3 and happy-eyeballs-timeout-ms.d document
814 this value, keep them in sync. */
815#define CURL_HET_DEFAULT 200L
816
817/* The default connection upkeep interval in milliseconds. */
818#define CURL_UPKEEP_INTERVAL_DEFAULT 60000L
819
820#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all
821 the obsolete stuff removed! */
822
823/* Backwards compatibility with older names */
824/* These are scheduled to disappear by 2009 */
825
826#define CURLFTPSSL_NONE CURLUSESSL_NONE
827#define CURLFTPSSL_TRY CURLUSESSL_TRY
828#define CURLFTPSSL_CONTROL CURLUSESSL_CONTROL
829#define CURLFTPSSL_ALL CURLUSESSL_ALL
830#define CURLFTPSSL_LAST CURLUSESSL_LAST
831#define curl_ftpssl curl_usessl
832#endif /*!CURL_NO_OLDIES*/
833
834/* parameter for the CURLOPT_FTP_SSL_CCC option */
835typedef enum {
836 CURLFTPSSL_CCC_NONE, /* do not send CCC */
837 CURLFTPSSL_CCC_PASSIVE, /* Let the server initiate the shutdown */
838 CURLFTPSSL_CCC_ACTIVE, /* Initiate the shutdown */
839 CURLFTPSSL_CCC_LAST /* not an option, never use */
840} curl_ftpccc;
841
842/* parameter for the CURLOPT_FTPSSLAUTH option */
843typedef enum {
844 CURLFTPAUTH_DEFAULT, /* let libcurl decide */
845 CURLFTPAUTH_SSL, /* use "AUTH SSL" */
846 CURLFTPAUTH_TLS, /* use "AUTH TLS" */
847 CURLFTPAUTH_LAST /* not an option, never use */
848} curl_ftpauth;
849
850/* parameter for the CURLOPT_FTP_CREATE_MISSING_DIRS option */
851typedef enum {
852 CURLFTP_CREATE_DIR_NONE, /* do NOT create missing dirs! */
853 CURLFTP_CREATE_DIR, /* (FTP/SFTP) if CWD fails, try MKD and then CWD
854 again if MKD succeeded, for SFTP this does
855 similar magic */
856 CURLFTP_CREATE_DIR_RETRY, /* (FTP only) if CWD fails, try MKD and then CWD
857 again even if MKD failed! */
858 CURLFTP_CREATE_DIR_LAST /* not an option, never use */
859} curl_ftpcreatedir;
860
861/* parameter for the CURLOPT_FTP_FILEMETHOD option */
862typedef enum {
863 CURLFTPMETHOD_DEFAULT, /* let libcurl pick */
864 CURLFTPMETHOD_MULTICWD, /* single CWD operation for each path part */
865 CURLFTPMETHOD_NOCWD, /* no CWD at all */
866 CURLFTPMETHOD_SINGLECWD, /* one CWD to full dir, then work on file */
867 CURLFTPMETHOD_LAST /* not an option, never use */
868} curl_ftpmethod;
869
870/* bitmask defines for CURLOPT_HEADEROPT */
871#define CURLHEADER_UNIFIED 0
872#define CURLHEADER_SEPARATE (1<<0)
873
874/* CURLPROTO_ defines are for the CURLOPT_*PROTOCOLS options */
875#define CURLPROTO_HTTP (1<<0)
876#define CURLPROTO_HTTPS (1<<1)
877#define CURLPROTO_FTP (1<<2)
878#define CURLPROTO_FTPS (1<<3)
879#define CURLPROTO_SCP (1<<4)
880#define CURLPROTO_SFTP (1<<5)
881#define CURLPROTO_TELNET (1<<6)
882#define CURLPROTO_LDAP (1<<7)
883#define CURLPROTO_LDAPS (1<<8)
884#define CURLPROTO_DICT (1<<9)
885#define CURLPROTO_FILE (1<<10)
886#define CURLPROTO_TFTP (1<<11)
887#define CURLPROTO_IMAP (1<<12)
888#define CURLPROTO_IMAPS (1<<13)
889#define CURLPROTO_POP3 (1<<14)
890#define CURLPROTO_POP3S (1<<15)
891#define CURLPROTO_SMTP (1<<16)
892#define CURLPROTO_SMTPS (1<<17)
893#define CURLPROTO_RTSP (1<<18)
894#define CURLPROTO_RTMP (1<<19)
895#define CURLPROTO_RTMPT (1<<20)
896#define CURLPROTO_RTMPE (1<<21)
897#define CURLPROTO_RTMPTE (1<<22)
898#define CURLPROTO_RTMPS (1<<23)
899#define CURLPROTO_RTMPTS (1<<24)
900#define CURLPROTO_GOPHER (1<<25)
901#define CURLPROTO_SMB (1<<26)
902#define CURLPROTO_SMBS (1<<27)
903#define CURLPROTO_ALL (~0) /* enable everything */
904
905/* long may be 32 or 64 bits, but we should never depend on anything else
906 but 32 */
907#define CURLOPTTYPE_LONG 0
908#define CURLOPTTYPE_OBJECTPOINT 10000
909#define CURLOPTTYPE_STRINGPOINT 10000
910#define CURLOPTTYPE_FUNCTIONPOINT 20000
911#define CURLOPTTYPE_OFF_T 30000
912
913/* *STRINGPOINT is an alias for OBJECTPOINT to allow tools to extract the
914 string options from the header file */
915
916/* name is uppercase CURLOPT_<name>,
917 type is one of the defined CURLOPTTYPE_<type>
918 number is unique identifier */
919#ifdef CINIT
920#undef CINIT
921#endif
922
923#ifdef CURL_ISOCPP
924#define CINIT(na,t,nu) CURLOPT_ ## na = CURLOPTTYPE_ ## t + nu
925#else
926/* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */
927#define LONG CURLOPTTYPE_LONG
928#define OBJECTPOINT CURLOPTTYPE_OBJECTPOINT
929#define STRINGPOINT CURLOPTTYPE_OBJECTPOINT
930#define FUNCTIONPOINT CURLOPTTYPE_FUNCTIONPOINT
931#define OFF_T CURLOPTTYPE_OFF_T
932#define CINIT(name,type,number) CURLOPT_/**/name = type + number
933#endif
934
935/*
936 * This macro-mania below setups the CURLOPT_[what] enum, to be used with
937 * curl_easy_setopt(). The first argument in the CINIT() macro is the [what]
938 * word.
939 */
940
941typedef enum {
942 /* This is the FILE * or void * the regular output should be written to. */
943 CINIT(WRITEDATA, OBJECTPOINT, 1),
944
945 /* The full URL to get/put */
946 CINIT(URL, STRINGPOINT, 2),
947
948 /* Port number to connect to, if other than default. */
949 CINIT(PORT, LONG, 3),
950
951 /* Name of proxy to use. */
952 CINIT(PROXY, STRINGPOINT, 4),
953
954 /* "user:password;options" to use when fetching. */
955 CINIT(USERPWD, STRINGPOINT, 5),
956
957 /* "user:password" to use with proxy. */
958 CINIT(PROXYUSERPWD, STRINGPOINT, 6),
959
960 /* Range to get, specified as an ASCII string. */
961 CINIT(RANGE, STRINGPOINT, 7),
962
963 /* not used */
964
965 /* Specified file stream to upload from (use as input): */
966 CINIT(READDATA, OBJECTPOINT, 9),
967
968 /* Buffer to receive error messages in, must be at least CURL_ERROR_SIZE
969 * bytes big. */
970 CINIT(ERRORBUFFER, OBJECTPOINT, 10),
971
972 /* Function that will be called to store the output (instead of fwrite). The
973 * parameters will use fwrite() syntax, make sure to follow them. */
974 CINIT(WRITEFUNCTION, FUNCTIONPOINT, 11),
975
976 /* Function that will be called to read the input (instead of fread). The
977 * parameters will use fread() syntax, make sure to follow them. */
978 CINIT(READFUNCTION, FUNCTIONPOINT, 12),
979
980 /* Time-out the read operation after this amount of seconds */
981 CINIT(TIMEOUT, LONG, 13),
982
983 /* If the CURLOPT_INFILE is used, this can be used to inform libcurl about
984 * how large the file being sent really is. That allows better error
985 * checking and better verifies that the upload was successful. -1 means
986 * unknown size.
987 *
988 * For large file support, there is also a _LARGE version of the key
989 * which takes an off_t type, allowing platforms with larger off_t
990 * sizes to handle larger files. See below for INFILESIZE_LARGE.
991 */
992 CINIT(INFILESIZE, LONG, 14),
993
994 /* POST static input fields. */
995 CINIT(POSTFIELDS, OBJECTPOINT, 15),
996
997 /* Set the referrer page (needed by some CGIs) */
998 CINIT(REFERER, STRINGPOINT, 16),
999
1000 /* Set the FTP PORT string (interface name, named or numerical IP address)
1001 Use i.e '-' to use default address. */
1002 CINIT(FTPPORT, STRINGPOINT, 17),
1003
1004 /* Set the User-Agent string (examined by some CGIs) */
1005 CINIT(USERAGENT, STRINGPOINT, 18),
1006
1007 /* If the download receives less than "low speed limit" bytes/second
1008 * during "low speed time" seconds, the operations is aborted.
1009 * You could i.e if you have a pretty high speed connection, abort if
1010 * it is less than 2000 bytes/sec during 20 seconds.
1011 */
1012
1013 /* Set the "low speed limit" */
1014 CINIT(LOW_SPEED_LIMIT, LONG, 19),
1015
1016 /* Set the "low speed time" */
1017 CINIT(LOW_SPEED_TIME, LONG, 20),
1018
1019 /* Set the continuation offset.
1020 *
1021 * Note there is also a _LARGE version of this key which uses
1022 * off_t types, allowing for large file offsets on platforms which
1023 * use larger-than-32-bit off_t's. Look below for RESUME_FROM_LARGE.
1024 */
1025 CINIT(RESUME_FROM, LONG, 21),
1026
1027 /* Set cookie in request: */
1028 CINIT(COOKIE, STRINGPOINT, 22),
1029
1030 /* This points to a linked list of headers, struct curl_slist kind. This
1031 list is also used for RTSP (in spite of its name) */
1032 CINIT(HTTPHEADER, OBJECTPOINT, 23),
1033
1034 /* This points to a linked list of post entries, struct curl_httppost */
1035 CINIT(HTTPPOST, OBJECTPOINT, 24),
1036
1037 /* name of the file keeping your private SSL-certificate */
1038 CINIT(SSLCERT, STRINGPOINT, 25),
1039
1040 /* password for the SSL or SSH private key */
1041 CINIT(KEYPASSWD, STRINGPOINT, 26),
1042
1043 /* send TYPE parameter? */
1044 CINIT(CRLF, LONG, 27),
1045
1046 /* send linked-list of QUOTE commands */
1047 CINIT(QUOTE, OBJECTPOINT, 28),
1048
1049 /* send FILE * or void * to store headers to, if you use a callback it
1050 is simply passed to the callback unmodified */
1051 CINIT(HEADERDATA, OBJECTPOINT, 29),
1052
1053 /* point to a file to read the initial cookies from, also enables
1054 "cookie awareness" */
1055 CINIT(COOKIEFILE, STRINGPOINT, 31),
1056
1057 /* What version to specifically try to use.
1058 See CURL_SSLVERSION defines below. */
1059 CINIT(SSLVERSION, LONG, 32),
1060
1061 /* What kind of HTTP time condition to use, see defines */
1062 CINIT(TIMECONDITION, LONG, 33),
1063
1064 /* Time to use with the above condition. Specified in number of seconds
1065 since 1 Jan 1970 */
1066 CINIT(TIMEVALUE, LONG, 34),
1067
1068 /* 35 = OBSOLETE */
1069
1070 /* Custom request, for customizing the get command like
1071 HTTP: DELETE, TRACE and others
1072 FTP: to use a different list command
1073 */
1074 CINIT(CUSTOMREQUEST, STRINGPOINT, 36),
1075
1076 /* FILE handle to use instead of stderr */
1077 CINIT(STDERR, OBJECTPOINT, 37),
1078
1079 /* 38 is not used */
1080
1081 /* send linked-list of post-transfer QUOTE commands */
1082 CINIT(POSTQUOTE, OBJECTPOINT, 39),
1083
1084 CINIT(OBSOLETE40, OBJECTPOINT, 40), /* OBSOLETE, do not use! */
1085
1086 CINIT(VERBOSE, LONG, 41), /* talk a lot */
1087 CINIT(HEADER, LONG, 42), /* throw the header out too */
1088 CINIT(NOPROGRESS, LONG, 43), /* shut off the progress meter */
1089 CINIT(NOBODY, LONG, 44), /* use HEAD to get http document */
1090 CINIT(FAILONERROR, LONG, 45), /* no output on http error codes >= 400 */
1091 CINIT(UPLOAD, LONG, 46), /* this is an upload */
1092 CINIT(POST, LONG, 47), /* HTTP POST method */
1093 CINIT(DIRLISTONLY, LONG, 48), /* bare names when listing directories */
1094
1095 CINIT(APPEND, LONG, 50), /* Append instead of overwrite on upload! */
1096
1097 /* Specify whether to read the user+password from the .netrc or the URL.
1098 * This must be one of the CURL_NETRC_* enums below. */
1099 CINIT(NETRC, LONG, 51),
1100
1101 CINIT(FOLLOWLOCATION, LONG, 52), /* use Location: Luke! */
1102
1103 CINIT(TRANSFERTEXT, LONG, 53), /* transfer data in text/ASCII format */
1104 CINIT(PUT, LONG, 54), /* HTTP PUT */
1105
1106 /* 55 = OBSOLETE */
1107
1108 /* DEPRECATED
1109 * Function that will be called instead of the internal progress display
1110 * function. This function should be defined as the curl_progress_callback
1111 * prototype defines. */
1112 CINIT(PROGRESSFUNCTION, FUNCTIONPOINT, 56),
1113
1114 /* Data passed to the CURLOPT_PROGRESSFUNCTION and CURLOPT_XFERINFOFUNCTION
1115 callbacks */
1116 CINIT(PROGRESSDATA, OBJECTPOINT, 57),
1117#define CURLOPT_XFERINFODATA CURLOPT_PROGRESSDATA
1118
1119 /* We want the referrer field set automatically when following locations */
1120 CINIT(AUTOREFERER, LONG, 58),
1121
1122 /* Port of the proxy, can be set in the proxy string as well with:
1123 "[host]:[port]" */
1124 CINIT(PROXYPORT, LONG, 59),
1125
1126 /* size of the POST input data, if strlen() is not good to use */
1127 CINIT(POSTFIELDSIZE, LONG, 60),
1128
1129 /* tunnel non-http operations through a HTTP proxy */
1130 CINIT(HTTPPROXYTUNNEL, LONG, 61),
1131
1132 /* Set the interface string to use as outgoing network interface */
1133 CINIT(INTERFACE, STRINGPOINT, 62),
1134
1135 /* Set the krb4/5 security level, this also enables krb4/5 awareness. This
1136 * is a string, 'clear', 'safe', 'confidential' or 'private'. If the string
1137 * is set but doesn't match one of these, 'private' will be used. */
1138 CINIT(KRBLEVEL, STRINGPOINT, 63),
1139
1140 /* Set if we should verify the peer in ssl handshake, set 1 to verify. */
1141 CINIT(SSL_VERIFYPEER, LONG, 64),
1142
1143 /* The CApath or CAfile used to validate the peer certificate
1144 this option is used only if SSL_VERIFYPEER is true */
1145 CINIT(CAINFO, STRINGPOINT, 65),
1146
1147 /* 66 = OBSOLETE */
1148 /* 67 = OBSOLETE */
1149
1150 /* Maximum number of http redirects to follow */
1151 CINIT(MAXREDIRS, LONG, 68),
1152
1153 /* Pass a long set to 1 to get the date of the requested document (if
1154 possible)! Pass a zero to shut it off. */
1155 CINIT(FILETIME, LONG, 69),
1156
1157 /* This points to a linked list of telnet options */
1158 CINIT(TELNETOPTIONS, OBJECTPOINT, 70),
1159
1160 /* Max amount of cached alive connections */
1161 CINIT(MAXCONNECTS, LONG, 71),
1162
1163 CINIT(OBSOLETE72, LONG, 72), /* OBSOLETE, do not use! */
1164
1165 /* 73 = OBSOLETE */
1166
1167 /* Set to explicitly use a new connection for the upcoming transfer.
1168 Do not use this unless you're absolutely sure of this, as it makes the
1169 operation slower and is less friendly for the network. */
1170 CINIT(FRESH_CONNECT, LONG, 74),
1171
1172 /* Set to explicitly forbid the upcoming transfer's connection to be re-used
1173 when done. Do not use this unless you're absolutely sure of this, as it
1174 makes the operation slower and is less friendly for the network. */
1175 CINIT(FORBID_REUSE, LONG, 75),
1176
1177 /* Set to a file name that contains random data for libcurl to use to
1178 seed the random engine when doing SSL connects. */
1179 CINIT(RANDOM_FILE, STRINGPOINT, 76),
1180
1181 /* Set to the Entropy Gathering Daemon socket pathname */
1182 CINIT(EGDSOCKET, STRINGPOINT, 77),
1183
1184 /* Time-out connect operations after this amount of seconds, if connects are
1185 OK within this time, then fine... This only aborts the connect phase. */
1186 CINIT(CONNECTTIMEOUT, LONG, 78),
1187
1188 /* Function that will be called to store headers (instead of fwrite). The
1189 * parameters will use fwrite() syntax, make sure to follow them. */
1190 CINIT(HEADERFUNCTION, FUNCTIONPOINT, 79),
1191
1192 /* Set this to force the HTTP request to get back to GET. Only really usable
1193 if POST, PUT or a custom request have been used first.
1194 */
1195 CINIT(HTTPGET, LONG, 80),
1196
1197 /* Set if we should verify the Common name from the peer certificate in ssl
1198 * handshake, set 1 to check existence, 2 to ensure that it matches the
1199 * provided hostname. */
1200 CINIT(SSL_VERIFYHOST, LONG, 81),
1201
1202 /* Specify which file name to write all known cookies in after completed
1203 operation. Set file name to "-" (dash) to make it go to stdout. */
1204 CINIT(COOKIEJAR, STRINGPOINT, 82),
1205
1206 /* Specify which SSL ciphers to use */
1207 CINIT(SSL_CIPHER_LIST, STRINGPOINT, 83),
1208
1209 /* Specify which HTTP version to use! This must be set to one of the
1210 CURL_HTTP_VERSION* enums set below. */
1211 CINIT(HTTP_VERSION, LONG, 84),
1212
1213 /* Specifically switch on or off the FTP engine's use of the EPSV command. By
1214 default, that one will always be attempted before the more traditional
1215 PASV command. */
1216 CINIT(FTP_USE_EPSV, LONG, 85),
1217
1218 /* type of the file keeping your SSL-certificate ("DER", "PEM", "ENG") */
1219 CINIT(SSLCERTTYPE, STRINGPOINT, 86),
1220
1221 /* name of the file keeping your private SSL-key */
1222 CINIT(SSLKEY, STRINGPOINT, 87),
1223
1224 /* type of the file keeping your private SSL-key ("DER", "PEM", "ENG") */
1225 CINIT(SSLKEYTYPE, STRINGPOINT, 88),
1226
1227 /* crypto engine for the SSL-sub system */
1228 CINIT(SSLENGINE, STRINGPOINT, 89),
1229
1230 /* set the crypto engine for the SSL-sub system as default
1231 the param has no meaning...
1232 */
1233 CINIT(SSLENGINE_DEFAULT, LONG, 90),
1234
1235 /* Non-zero value means to use the global dns cache */
1236 CINIT(DNS_USE_GLOBAL_CACHE, LONG, 91), /* DEPRECATED, do not use! */
1237
1238 /* DNS cache timeout */
1239 CINIT(DNS_CACHE_TIMEOUT, LONG, 92),
1240
1241 /* send linked-list of pre-transfer QUOTE commands */
1242 CINIT(PREQUOTE, OBJECTPOINT, 93),
1243
1244 /* set the debug function */
1245 CINIT(DEBUGFUNCTION, FUNCTIONPOINT, 94),
1246
1247 /* set the data for the debug function */
1248 CINIT(DEBUGDATA, OBJECTPOINT, 95),
1249
1250 /* mark this as start of a cookie session */
1251 CINIT(COOKIESESSION, LONG, 96),
1252
1253 /* The CApath directory used to validate the peer certificate
1254 this option is used only if SSL_VERIFYPEER is true */
1255 CINIT(CAPATH, STRINGPOINT, 97),
1256
1257 /* Instruct libcurl to use a smaller receive buffer */
1258 CINIT(BUFFERSIZE, LONG, 98),
1259
1260 /* Instruct libcurl to not use any signal/alarm handlers, even when using
1261 timeouts. This option is useful for multi-threaded applications.
1262 See libcurl-the-guide for more background information. */
1263 CINIT(NOSIGNAL, LONG, 99),
1264
1265 /* Provide a CURLShare for mutexing non-ts data */
1266 CINIT(SHARE, OBJECTPOINT, 100),
1267
1268 /* indicates type of proxy. accepted values are CURLPROXY_HTTP (default),
1269 CURLPROXY_HTTPS, CURLPROXY_SOCKS4, CURLPROXY_SOCKS4A and
1270 CURLPROXY_SOCKS5. */
1271 CINIT(PROXYTYPE, LONG, 101),
1272
1273 /* Set the Accept-Encoding string. Use this to tell a server you would like
1274 the response to be compressed. Before 7.21.6, this was known as
1275 CURLOPT_ENCODING */
1276 CINIT(ACCEPT_ENCODING, STRINGPOINT, 102),
1277
1278 /* Set pointer to private data */
1279 CINIT(PRIVATE, OBJECTPOINT, 103),
1280
1281 /* Set aliases for HTTP 200 in the HTTP Response header */
1282 CINIT(HTTP200ALIASES, OBJECTPOINT, 104),
1283
1284 /* Continue to send authentication (user+password) when following locations,
1285 even when hostname changed. This can potentially send off the name
1286 and password to whatever host the server decides. */
1287 CINIT(UNRESTRICTED_AUTH, LONG, 105),
1288
1289 /* Specifically switch on or off the FTP engine's use of the EPRT command (
1290 it also disables the LPRT attempt). By default, those ones will always be
1291 attempted before the good old traditional PORT command. */
1292 CINIT(FTP_USE_EPRT, LONG, 106),
1293
1294 /* Set this to a bitmask value to enable the particular authentications
1295 methods you like. Use this in combination with CURLOPT_USERPWD.
1296 Note that setting multiple bits may cause extra network round-trips. */
1297 CINIT(HTTPAUTH, LONG, 107),
1298
1299 /* Set the ssl context callback function, currently only for OpenSSL ssl_ctx
1300 in second argument. The function must be matching the
1301 curl_ssl_ctx_callback proto. */
1302 CINIT(SSL_CTX_FUNCTION, FUNCTIONPOINT, 108),
1303
1304 /* Set the userdata for the ssl context callback function's third
1305 argument */
1306 CINIT(SSL_CTX_DATA, OBJECTPOINT, 109),
1307
1308 /* FTP Option that causes missing dirs to be created on the remote server.
1309 In 7.19.4 we introduced the convenience enums for this option using the
1310 CURLFTP_CREATE_DIR prefix.
1311 */
1312 CINIT(FTP_CREATE_MISSING_DIRS, LONG, 110),
1313
1314 /* Set this to a bitmask value to enable the particular authentications
1315 methods you like. Use this in combination with CURLOPT_PROXYUSERPWD.
1316 Note that setting multiple bits may cause extra network round-trips. */
1317 CINIT(PROXYAUTH, LONG, 111),
1318
1319 /* FTP option that changes the timeout, in seconds, associated with
1320 getting a response. This is different from transfer timeout time and
1321 essentially places a demand on the FTP server to acknowledge commands
1322 in a timely manner. */
1323 CINIT(FTP_RESPONSE_TIMEOUT, LONG, 112),
1324#define CURLOPT_SERVER_RESPONSE_TIMEOUT CURLOPT_FTP_RESPONSE_TIMEOUT
1325
1326 /* Set this option to one of the CURL_IPRESOLVE_* defines (see below) to
1327 tell libcurl to resolve names to those IP versions only. This only has
1328 affect on systems with support for more than one, i.e IPv4 _and_ IPv6. */
1329 CINIT(IPRESOLVE, LONG, 113),
1330
1331 /* Set this option to limit the size of a file that will be downloaded from
1332 an HTTP or FTP server.
1333
1334 Note there is also _LARGE version which adds large file support for
1335 platforms which have larger off_t sizes. See MAXFILESIZE_LARGE below. */
1336 CINIT(MAXFILESIZE, LONG, 114),
1337
1338 /* See the comment for INFILESIZE above, but in short, specifies
1339 * the size of the file being uploaded. -1 means unknown.
1340 */
1341 CINIT(INFILESIZE_LARGE, OFF_T, 115),
1342
1343 /* Sets the continuation offset. There is also a LONG version of this;
1344 * look above for RESUME_FROM.
1345 */
1346 CINIT(RESUME_FROM_LARGE, OFF_T, 116),
1347
1348 /* Sets the maximum size of data that will be downloaded from
1349 * an HTTP or FTP server. See MAXFILESIZE above for the LONG version.
1350 */
1351 CINIT(MAXFILESIZE_LARGE, OFF_T, 117),
1352
1353 /* Set this option to the file name of your .netrc file you want libcurl
1354 to parse (using the CURLOPT_NETRC option). If not set, libcurl will do
1355 a poor attempt to find the user's home directory and check for a .netrc
1356 file in there. */
1357 CINIT(NETRC_FILE, STRINGPOINT, 118),
1358
1359 /* Enable SSL/TLS for FTP, pick one of:
1360 CURLUSESSL_TRY - try using SSL, proceed anyway otherwise
1361 CURLUSESSL_CONTROL - SSL for the control connection or fail
1362 CURLUSESSL_ALL - SSL for all communication or fail
1363 */
1364 CINIT(USE_SSL, LONG, 119),
1365
1366 /* The _LARGE version of the standard POSTFIELDSIZE option */
1367 CINIT(POSTFIELDSIZE_LARGE, OFF_T, 120),
1368
1369 /* Enable/disable the TCP Nagle algorithm */
1370 CINIT(TCP_NODELAY, LONG, 121),
1371
1372 /* 122 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
1373 /* 123 OBSOLETE. Gone in 7.16.0 */
1374 /* 124 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
1375 /* 125 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
1376 /* 126 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
1377 /* 127 OBSOLETE. Gone in 7.16.0 */
1378 /* 128 OBSOLETE. Gone in 7.16.0 */
1379
1380 /* When FTP over SSL/TLS is selected (with CURLOPT_USE_SSL), this option
1381 can be used to change libcurl's default action which is to first try
1382 "AUTH SSL" and then "AUTH TLS" in this order, and proceed when a OK
1383 response has been received.
1384
1385 Available parameters are:
1386 CURLFTPAUTH_DEFAULT - let libcurl decide
1387 CURLFTPAUTH_SSL - try "AUTH SSL" first, then TLS
1388 CURLFTPAUTH_TLS - try "AUTH TLS" first, then SSL
1389 */
1390 CINIT(FTPSSLAUTH, LONG, 129),
1391
1392 CINIT(IOCTLFUNCTION, FUNCTIONPOINT, 130),
1393 CINIT(IOCTLDATA, OBJECTPOINT, 131),
1394
1395 /* 132 OBSOLETE. Gone in 7.16.0 */
1396 /* 133 OBSOLETE. Gone in 7.16.0 */
1397
1398 /* zero terminated string for pass on to the FTP server when asked for
1399 "account" info */
1400 CINIT(FTP_ACCOUNT, STRINGPOINT, 134),
1401
1402 /* feed cookie into cookie engine */
1403 CINIT(COOKIELIST, STRINGPOINT, 135),
1404
1405 /* ignore Content-Length */
1406 CINIT(IGNORE_CONTENT_LENGTH, LONG, 136),
1407
1408 /* Set to non-zero to skip the IP address received in a 227 PASV FTP server
1409 response. Typically used for FTP-SSL purposes but is not restricted to
1410 that. libcurl will then instead use the same IP address it used for the
1411 control connection. */
1412 CINIT(FTP_SKIP_PASV_IP, LONG, 137),
1413
1414 /* Select "file method" to use when doing FTP, see the curl_ftpmethod
1415 above. */
1416 CINIT(FTP_FILEMETHOD, LONG, 138),
1417
1418 /* Local port number to bind the socket to */
1419 CINIT(LOCALPORT, LONG, 139),
1420
1421 /* Number of ports to try, including the first one set with LOCALPORT.
1422 Thus, setting it to 1 will make no additional attempts but the first.
1423 */
1424 CINIT(LOCALPORTRANGE, LONG, 140),
1425
1426 /* no transfer, set up connection and let application use the socket by
1427 extracting it with CURLINFO_LASTSOCKET */
1428 CINIT(CONNECT_ONLY, LONG, 141),
1429
1430 /* Function that will be called to convert from the
1431 network encoding (instead of using the iconv calls in libcurl) */
1432 CINIT(CONV_FROM_NETWORK_FUNCTION, FUNCTIONPOINT, 142),
1433
1434 /* Function that will be called to convert to the
1435 network encoding (instead of using the iconv calls in libcurl) */
1436 CINIT(CONV_TO_NETWORK_FUNCTION, FUNCTIONPOINT, 143),
1437
1438 /* Function that will be called to convert from UTF8
1439 (instead of using the iconv calls in libcurl)
1440 Note that this is used only for SSL certificate processing */
1441 CINIT(CONV_FROM_UTF8_FUNCTION, FUNCTIONPOINT, 144),
1442
1443 /* if the connection proceeds too quickly then need to slow it down */
1444 /* limit-rate: maximum number of bytes per second to send or receive */
1445 CINIT(MAX_SEND_SPEED_LARGE, OFF_T, 145),
1446 CINIT(MAX_RECV_SPEED_LARGE, OFF_T, 146),
1447
1448 /* Pointer to command string to send if USER/PASS fails. */
1449 CINIT(FTP_ALTERNATIVE_TO_USER, STRINGPOINT, 147),
1450
1451 /* callback function for setting socket options */
1452 CINIT(SOCKOPTFUNCTION, FUNCTIONPOINT, 148),
1453 CINIT(SOCKOPTDATA, OBJECTPOINT, 149),
1454
1455 /* set to 0 to disable session ID re-use for this transfer, default is
1456 enabled (== 1) */
1457 CINIT(SSL_SESSIONID_CACHE, LONG, 150),
1458
1459 /* allowed SSH authentication methods */
1460 CINIT(SSH_AUTH_TYPES, LONG, 151),
1461
1462 /* Used by scp/sftp to do public/private key authentication */
1463 CINIT(SSH_PUBLIC_KEYFILE, STRINGPOINT, 152),
1464 CINIT(SSH_PRIVATE_KEYFILE, STRINGPOINT, 153),
1465
1466 /* Send CCC (Clear Command Channel) after authentication */
1467 CINIT(FTP_SSL_CCC, LONG, 154),
1468
1469 /* Same as TIMEOUT and CONNECTTIMEOUT, but with ms resolution */
1470 CINIT(TIMEOUT_MS, LONG, 155),
1471 CINIT(CONNECTTIMEOUT_MS, LONG, 156),
1472
1473 /* set to zero to disable the libcurl's decoding and thus pass the raw body
1474 data to the application even when it is encoded/compressed */
1475 CINIT(HTTP_TRANSFER_DECODING, LONG, 157),
1476 CINIT(HTTP_CONTENT_DECODING, LONG, 158),
1477
1478 /* Permission used when creating new files and directories on the remote
1479 server for protocols that support it, SFTP/SCP/FILE */
1480 CINIT(NEW_FILE_PERMS, LONG, 159),
1481 CINIT(NEW_DIRECTORY_PERMS, LONG, 160),
1482
1483 /* Set the behaviour of POST when redirecting. Values must be set to one
1484 of CURL_REDIR* defines below. This used to be called CURLOPT_POST301 */
1485 CINIT(POSTREDIR, LONG, 161),
1486
1487 /* used by scp/sftp to verify the host's public key */
1488 CINIT(SSH_HOST_PUBLIC_KEY_MD5, STRINGPOINT, 162),
1489
1490 /* Callback function for opening socket (instead of socket(2)). Optionally,
1491 callback is able change the address or refuse to connect returning
1492 CURL_SOCKET_BAD. The callback should have type
1493 curl_opensocket_callback */
1494 CINIT(OPENSOCKETFUNCTION, FUNCTIONPOINT, 163),
1495 CINIT(OPENSOCKETDATA, OBJECTPOINT, 164),
1496
1497 /* POST volatile input fields. */
1498 CINIT(COPYPOSTFIELDS, OBJECTPOINT, 165),
1499
1500 /* set transfer mode (;type=<a|i>) when doing FTP via an HTTP proxy */
1501 CINIT(PROXY_TRANSFER_MODE, LONG, 166),
1502
1503 /* Callback function for seeking in the input stream */
1504 CINIT(SEEKFUNCTION, FUNCTIONPOINT, 167),
1505 CINIT(SEEKDATA, OBJECTPOINT, 168),
1506
1507 /* CRL file */
1508 CINIT(CRLFILE, STRINGPOINT, 169),
1509
1510 /* Issuer certificate */
1511 CINIT(ISSUERCERT, STRINGPOINT, 170),
1512
1513 /* (IPv6) Address scope */
1514 CINIT(ADDRESS_SCOPE, LONG, 171),
1515
1516 /* Collect certificate chain info and allow it to get retrievable with
1517 CURLINFO_CERTINFO after the transfer is complete. */
1518 CINIT(CERTINFO, LONG, 172),
1519
1520 /* "name" and "pwd" to use when fetching. */
1521 CINIT(USERNAME, STRINGPOINT, 173),
1522 CINIT(PASSWORD, STRINGPOINT, 174),
1523
1524 /* "name" and "pwd" to use with Proxy when fetching. */
1525 CINIT(PROXYUSERNAME, STRINGPOINT, 175),
1526 CINIT(PROXYPASSWORD, STRINGPOINT, 176),
1527
1528 /* Comma separated list of hostnames defining no-proxy zones. These should
1529 match both hostnames directly, and hostnames within a domain. For
1530 example, local.com will match local.com and www.local.com, but NOT
1531 notlocal.com or www.notlocal.com. For compatibility with other
1532 implementations of this, .local.com will be considered to be the same as
1533 local.com. A single * is the only valid wildcard, and effectively
1534 disables the use of proxy. */
1535 CINIT(NOPROXY, STRINGPOINT, 177),
1536
1537 /* block size for TFTP transfers */
1538 CINIT(TFTP_BLKSIZE, LONG, 178),
1539
1540 /* Socks Service */
1541 CINIT(SOCKS5_GSSAPI_SERVICE, STRINGPOINT, 179), /* DEPRECATED, do not use! */
1542
1543 /* Socks Service */
1544 CINIT(SOCKS5_GSSAPI_NEC, LONG, 180),
1545
1546 /* set the bitmask for the protocols that are allowed to be used for the
1547 transfer, which thus helps the app which takes URLs from users or other
1548 external inputs and want to restrict what protocol(s) to deal
1549 with. Defaults to CURLPROTO_ALL. */
1550 CINIT(PROTOCOLS, LONG, 181),
1551
1552 /* set the bitmask for the protocols that libcurl is allowed to follow to,
1553 as a subset of the CURLOPT_PROTOCOLS ones. That means the protocol needs
1554 to be set in both bitmasks to be allowed to get redirected to. Defaults
1555 to all protocols except FILE and SCP. */
1556 CINIT(REDIR_PROTOCOLS, LONG, 182),
1557
1558 /* set the SSH knownhost file name to use */
1559 CINIT(SSH_KNOWNHOSTS, STRINGPOINT, 183),
1560
1561 /* set the SSH host key callback, must point to a curl_sshkeycallback
1562 function */
1563 CINIT(SSH_KEYFUNCTION, FUNCTIONPOINT, 184),
1564
1565 /* set the SSH host key callback custom pointer */
1566 CINIT(SSH_KEYDATA, OBJECTPOINT, 185),
1567
1568 /* set the SMTP mail originator */
1569 CINIT(MAIL_FROM, STRINGPOINT, 186),
1570
1571 /* set the list of SMTP mail receiver(s) */
1572 CINIT(MAIL_RCPT, OBJECTPOINT, 187),
1573
1574 /* FTP: send PRET before PASV */
1575 CINIT(FTP_USE_PRET, LONG, 188),
1576
1577 /* RTSP request method (OPTIONS, SETUP, PLAY, etc...) */
1578 CINIT(RTSP_REQUEST, LONG, 189),
1579
1580 /* The RTSP session identifier */
1581 CINIT(RTSP_SESSION_ID, STRINGPOINT, 190),
1582
1583 /* The RTSP stream URI */
1584 CINIT(RTSP_STREAM_URI, STRINGPOINT, 191),
1585
1586 /* The Transport: header to use in RTSP requests */
1587 CINIT(RTSP_TRANSPORT, STRINGPOINT, 192),
1588
1589 /* Manually initialize the client RTSP CSeq for this handle */
1590 CINIT(RTSP_CLIENT_CSEQ, LONG, 193),
1591
1592 /* Manually initialize the server RTSP CSeq for this handle */
1593 CINIT(RTSP_SERVER_CSEQ, LONG, 194),
1594
1595 /* The stream to pass to INTERLEAVEFUNCTION. */
1596 CINIT(INTERLEAVEDATA, OBJECTPOINT, 195),
1597
1598 /* Let the application define a custom write method for RTP data */
1599 CINIT(INTERLEAVEFUNCTION, FUNCTIONPOINT, 196),
1600
1601 /* Turn on wildcard matching */
1602 CINIT(WILDCARDMATCH, LONG, 197),
1603
1604 /* Directory matching callback called before downloading of an
1605 individual file (chunk) started */
1606 CINIT(CHUNK_BGN_FUNCTION, FUNCTIONPOINT, 198),
1607
1608 /* Directory matching callback called after the file (chunk)
1609 was downloaded, or skipped */
1610 CINIT(CHUNK_END_FUNCTION, FUNCTIONPOINT, 199),
1611
1612 /* Change match (fnmatch-like) callback for wildcard matching */
1613 CINIT(FNMATCH_FUNCTION, FUNCTIONPOINT, 200),
1614
1615 /* Let the application define custom chunk data pointer */
1616 CINIT(CHUNK_DATA, OBJECTPOINT, 201),
1617
1618 /* FNMATCH_FUNCTION user pointer */
1619 CINIT(FNMATCH_DATA, OBJECTPOINT, 202),
1620
1621 /* send linked-list of name:port:address sets */
1622 CINIT(RESOLVE, OBJECTPOINT, 203),
1623
1624 /* Set a username for authenticated TLS */
1625 CINIT(TLSAUTH_USERNAME, STRINGPOINT, 204),
1626
1627 /* Set a password for authenticated TLS */
1628 CINIT(TLSAUTH_PASSWORD, STRINGPOINT, 205),
1629
1630 /* Set authentication type for authenticated TLS */
1631 CINIT(TLSAUTH_TYPE, STRINGPOINT, 206),
1632
1633 /* Set to 1 to enable the "TE:" header in HTTP requests to ask for
1634 compressed transfer-encoded responses. Set to 0 to disable the use of TE:
1635 in outgoing requests. The current default is 0, but it might change in a
1636 future libcurl release.
1637
1638 libcurl will ask for the compressed methods it knows of, and if that
1639 isn't any, it will not ask for transfer-encoding at all even if this
1640 option is set to 1.
1641
1642 */
1643 CINIT(TRANSFER_ENCODING, LONG, 207),
1644
1645 /* Callback function for closing socket (instead of close(2)). The callback
1646 should have type curl_closesocket_callback */
1647 CINIT(CLOSESOCKETFUNCTION, FUNCTIONPOINT, 208),
1648 CINIT(CLOSESOCKETDATA, OBJECTPOINT, 209),
1649
1650 /* allow GSSAPI credential delegation */
1651 CINIT(GSSAPI_DELEGATION, LONG, 210),
1652
1653 /* Set the name servers to use for DNS resolution */
1654 CINIT(DNS_SERVERS, STRINGPOINT, 211),
1655
1656 /* Time-out accept operations (currently for FTP only) after this amount
1657 of milliseconds. */
1658 CINIT(ACCEPTTIMEOUT_MS, LONG, 212),
1659
1660 /* Set TCP keepalive */
1661 CINIT(TCP_KEEPALIVE, LONG, 213),
1662
1663 /* non-universal keepalive knobs (Linux, AIX, HP-UX, more) */
1664 CINIT(TCP_KEEPIDLE, LONG, 214),
1665 CINIT(TCP_KEEPINTVL, LONG, 215),
1666
1667 /* Enable/disable specific SSL features with a bitmask, see CURLSSLOPT_* */
1668 CINIT(SSL_OPTIONS, LONG, 216),
1669
1670 /* Set the SMTP auth originator */
1671 CINIT(MAIL_AUTH, STRINGPOINT, 217),
1672
1673 /* Enable/disable SASL initial response */
1674 CINIT(SASL_IR, LONG, 218),
1675
1676 /* Function that will be called instead of the internal progress display
1677 * function. This function should be defined as the curl_xferinfo_callback
1678 * prototype defines. (Deprecates CURLOPT_PROGRESSFUNCTION) */
1679 CINIT(XFERINFOFUNCTION, FUNCTIONPOINT, 219),
1680
1681 /* The XOAUTH2 bearer token */
1682 CINIT(XOAUTH2_BEARER, STRINGPOINT, 220),
1683
1684 /* Set the interface string to use as outgoing network
1685 * interface for DNS requests.
1686 * Only supported by the c-ares DNS backend */
1687 CINIT(DNS_INTERFACE, STRINGPOINT, 221),
1688
1689 /* Set the local IPv4 address to use for outgoing DNS requests.
1690 * Only supported by the c-ares DNS backend */
1691 CINIT(DNS_LOCAL_IP4, STRINGPOINT, 222),
1692
1693 /* Set the local IPv6 address to use for outgoing DNS requests.
1694 * Only supported by the c-ares DNS backend */
1695 CINIT(DNS_LOCAL_IP6, STRINGPOINT, 223),
1696
1697 /* Set authentication options directly */
1698 CINIT(LOGIN_OPTIONS, STRINGPOINT, 224),
1699
1700 /* Enable/disable TLS NPN extension (http2 over ssl might fail without) */
1701 CINIT(SSL_ENABLE_NPN, LONG, 225),
1702
1703 /* Enable/disable TLS ALPN extension (http2 over ssl might fail without) */
1704 CINIT(SSL_ENABLE_ALPN, LONG, 226),
1705
1706 /* Time to wait for a response to a HTTP request containing an
1707 * Expect: 100-continue header before sending the data anyway. */
1708 CINIT(EXPECT_100_TIMEOUT_MS, LONG, 227),
1709
1710 /* This points to a linked list of headers used for proxy requests only,
1711 struct curl_slist kind */
1712 CINIT(PROXYHEADER, OBJECTPOINT, 228),
1713
1714 /* Pass in a bitmask of "header options" */
1715 CINIT(HEADEROPT, LONG, 229),
1716
1717 /* The public key in DER form used to validate the peer public key
1718 this option is used only if SSL_VERIFYPEER is true */
1719 CINIT(PINNEDPUBLICKEY, STRINGPOINT, 230),
1720
1721 /* Path to Unix domain socket */
1722 CINIT(UNIX_SOCKET_PATH, STRINGPOINT, 231),
1723
1724 /* Set if we should verify the certificate status. */
1725 CINIT(SSL_VERIFYSTATUS, LONG, 232),
1726
1727 /* Set if we should enable TLS false start. */
1728 CINIT(SSL_FALSESTART, LONG, 233),
1729
1730 /* Do not squash dot-dot sequences */
1731 CINIT(PATH_AS_IS, LONG, 234),
1732
1733 /* Proxy Service Name */
1734 CINIT(PROXY_SERVICE_NAME, STRINGPOINT, 235),
1735
1736 /* Service Name */
1737 CINIT(SERVICE_NAME, STRINGPOINT, 236),
1738
1739 /* Wait/don't wait for pipe/mutex to clarify */
1740 CINIT(PIPEWAIT, LONG, 237),
1741
1742 /* Set the protocol used when curl is given a URL without a protocol */
1743 CINIT(DEFAULT_PROTOCOL, STRINGPOINT, 238),
1744
1745 /* Set stream weight, 1 - 256 (default is 16) */
1746 CINIT(STREAM_WEIGHT, LONG, 239),
1747
1748 /* Set stream dependency on another CURL handle */
1749 CINIT(STREAM_DEPENDS, OBJECTPOINT, 240),
1750
1751 /* Set E-xclusive stream dependency on another CURL handle */
1752 CINIT(STREAM_DEPENDS_E, OBJECTPOINT, 241),
1753
1754 /* Do not send any tftp option requests to the server */
1755 CINIT(TFTP_NO_OPTIONS, LONG, 242),
1756
1757 /* Linked-list of host:port:connect-to-host:connect-to-port,
1758 overrides the URL's host:port (only for the network layer) */
1759 CINIT(CONNECT_TO, OBJECTPOINT, 243),
1760
1761 /* Set TCP Fast Open */
1762 CINIT(TCP_FASTOPEN, LONG, 244),
1763
1764 /* Continue to send data if the server responds early with an
1765 * HTTP status code >= 300 */
1766 CINIT(KEEP_SENDING_ON_ERROR, LONG, 245),
1767
1768 /* The CApath or CAfile used to validate the proxy certificate
1769 this option is used only if PROXY_SSL_VERIFYPEER is true */
1770 CINIT(PROXY_CAINFO, STRINGPOINT, 246),
1771
1772 /* The CApath directory used to validate the proxy certificate
1773 this option is used only if PROXY_SSL_VERIFYPEER is true */
1774 CINIT(PROXY_CAPATH, STRINGPOINT, 247),
1775
1776 /* Set if we should verify the proxy in ssl handshake,
1777 set 1 to verify. */
1778 CINIT(PROXY_SSL_VERIFYPEER, LONG, 248),
1779
1780 /* Set if we should verify the Common name from the proxy certificate in ssl
1781 * handshake, set 1 to check existence, 2 to ensure that it matches
1782 * the provided hostname. */
1783 CINIT(PROXY_SSL_VERIFYHOST, LONG, 249),
1784
1785 /* What version to specifically try to use for proxy.
1786 See CURL_SSLVERSION defines below. */
1787 CINIT(PROXY_SSLVERSION, LONG, 250),
1788
1789 /* Set a username for authenticated TLS for proxy */
1790 CINIT(PROXY_TLSAUTH_USERNAME, STRINGPOINT, 251),
1791
1792 /* Set a password for authenticated TLS for proxy */
1793 CINIT(PROXY_TLSAUTH_PASSWORD, STRINGPOINT, 252),
1794
1795 /* Set authentication type for authenticated TLS for proxy */
1796 CINIT(PROXY_TLSAUTH_TYPE, STRINGPOINT, 253),
1797
1798 /* name of the file keeping your private SSL-certificate for proxy */
1799 CINIT(PROXY_SSLCERT, STRINGPOINT, 254),
1800
1801 /* type of the file keeping your SSL-certificate ("DER", "PEM", "ENG") for
1802 proxy */
1803 CINIT(PROXY_SSLCERTTYPE, STRINGPOINT, 255),
1804
1805 /* name of the file keeping your private SSL-key for proxy */
1806 CINIT(PROXY_SSLKEY, STRINGPOINT, 256),
1807
1808 /* type of the file keeping your private SSL-key ("DER", "PEM", "ENG") for
1809 proxy */
1810 CINIT(PROXY_SSLKEYTYPE, STRINGPOINT, 257),
1811
1812 /* password for the SSL private key for proxy */
1813 CINIT(PROXY_KEYPASSWD, STRINGPOINT, 258),
1814
1815 /* Specify which SSL ciphers to use for proxy */
1816 CINIT(PROXY_SSL_CIPHER_LIST, STRINGPOINT, 259),
1817
1818 /* CRL file for proxy */
1819 CINIT(PROXY_CRLFILE, STRINGPOINT, 260),
1820
1821 /* Enable/disable specific SSL features with a bitmask for proxy, see
1822 CURLSSLOPT_* */
1823 CINIT(PROXY_SSL_OPTIONS, LONG, 261),
1824
1825 /* Name of pre proxy to use. */
1826 CINIT(PRE_PROXY, STRINGPOINT, 262),
1827
1828 /* The public key in DER form used to validate the proxy public key
1829 this option is used only if PROXY_SSL_VERIFYPEER is true */
1830 CINIT(PROXY_PINNEDPUBLICKEY, STRINGPOINT, 263),
1831
1832 /* Path to an abstract Unix domain socket */
1833 CINIT(ABSTRACT_UNIX_SOCKET, STRINGPOINT, 264),
1834
1835 /* Suppress proxy CONNECT response headers from user callbacks */
1836 CINIT(SUPPRESS_CONNECT_HEADERS, LONG, 265),
1837
1838 /* The request target, instead of extracted from the URL */
1839 CINIT(REQUEST_TARGET, STRINGPOINT, 266),
1840
1841 /* bitmask of allowed auth methods for connections to SOCKS5 proxies */
1842 CINIT(SOCKS5_AUTH, LONG, 267),
1843
1844 /* Enable/disable SSH compression */
1845 CINIT(SSH_COMPRESSION, LONG, 268),
1846
1847 /* Post MIME data. */
1848 CINIT(MIMEPOST, OBJECTPOINT, 269),
1849
1850 /* Time to use with the CURLOPT_TIMECONDITION. Specified in number of
1851 seconds since 1 Jan 1970. */
1852 CINIT(TIMEVALUE_LARGE, OFF_T, 270),
1853
1854 /* Head start in milliseconds to give happy eyeballs. */
1855 CINIT(HAPPY_EYEBALLS_TIMEOUT_MS, LONG, 271),
1856
1857 /* Function that will be called before a resolver request is made */
1858 CINIT(RESOLVER_START_FUNCTION, FUNCTIONPOINT, 272),
1859
1860 /* User data to pass to the resolver start callback. */
1861 CINIT(RESOLVER_START_DATA, OBJECTPOINT, 273),
1862
1863 /* send HAProxy PROXY protocol header? */
1864 CINIT(HAPROXYPROTOCOL, LONG, 274),
1865
1866 /* shuffle addresses before use when DNS returns multiple */
1867 CINIT(DNS_SHUFFLE_ADDRESSES, LONG, 275),
1868
1869 /* Specify which TLS 1.3 ciphers suites to use */
1870 CINIT(TLS13_CIPHERS, STRINGPOINT, 276),
1871 CINIT(PROXY_TLS13_CIPHERS, STRINGPOINT, 277),
1872
1873 /* Disallow specifying username/login in URL. */
1874 CINIT(DISALLOW_USERNAME_IN_URL, LONG, 278),
1875
1876 /* DNS-over-HTTPS URL */
1877 CINIT(DOH_URL, STRINGPOINT, 279),
1878
1879 /* Preferred buffer size to use for uploads */
1880 CINIT(UPLOAD_BUFFERSIZE, LONG, 280),
1881
1882 /* Time in ms between connection upkeep calls for long-lived connections. */
1883 CINIT(UPKEEP_INTERVAL_MS, LONG, 281),
1884
1885 /* Specify URL using CURL URL API. */
1886 CINIT(CURLU, OBJECTPOINT, 282),
1887
1888 /* add trailing data just after no more data is available */
1889 CINIT(TRAILERFUNCTION, FUNCTIONPOINT, 283),
1890
1891 /* pointer to be passed to HTTP_TRAILER_FUNCTION */
1892 CINIT(TRAILERDATA, OBJECTPOINT, 284),
1893
1894 /* set this to 1L to allow HTTP/0.9 responses or 0L to disallow */
1895 CINIT(HTTP09_ALLOWED, LONG, 285),
1896
1897 CURLOPT_LASTENTRY /* the last unused */
1898} CURLoption;
1899
1900#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all
1901 the obsolete stuff removed! */
1902
1903/* Backwards compatibility with older names */
1904/* These are scheduled to disappear by 2011 */
1905
1906/* This was added in version 7.19.1 */
1907#define CURLOPT_POST301 CURLOPT_POSTREDIR
1908
1909/* These are scheduled to disappear by 2009 */
1910
1911/* The following were added in 7.17.0 */
1912#define CURLOPT_SSLKEYPASSWD CURLOPT_KEYPASSWD
1913#define CURLOPT_FTPAPPEND CURLOPT_APPEND
1914#define CURLOPT_FTPLISTONLY CURLOPT_DIRLISTONLY
1915#define CURLOPT_FTP_SSL CURLOPT_USE_SSL
1916
1917/* The following were added earlier */
1918
1919#define CURLOPT_SSLCERTPASSWD CURLOPT_KEYPASSWD
1920#define CURLOPT_KRB4LEVEL CURLOPT_KRBLEVEL
1921
1922#else
1923/* This is set if CURL_NO_OLDIES is defined at compile-time */
1924#undef CURLOPT_DNS_USE_GLOBAL_CACHE /* soon obsolete */
1925#endif
1926
1927
1928 /* Below here follows defines for the CURLOPT_IPRESOLVE option. If a host
1929 name resolves addresses using more than one IP protocol version, this
1930 option might be handy to force libcurl to use a specific IP version. */
1931#define CURL_IPRESOLVE_WHATEVER 0 /* default, resolves addresses to all IP
1932 versions that your system allows */
1933#define CURL_IPRESOLVE_V4 1 /* resolve to IPv4 addresses */
1934#define CURL_IPRESOLVE_V6 2 /* resolve to IPv6 addresses */
1935
1936 /* three convenient "aliases" that follow the name scheme better */
1937#define CURLOPT_RTSPHEADER CURLOPT_HTTPHEADER
1938
1939 /* These enums are for use with the CURLOPT_HTTP_VERSION option. */
1940enum {
1941 CURL_HTTP_VERSION_NONE, /* setting this means we don't care, and that we'd
1942 like the library to choose the best possible
1943 for us! */
1944 CURL_HTTP_VERSION_1_0, /* please use HTTP 1.0 in the request */
1945 CURL_HTTP_VERSION_1_1, /* please use HTTP 1.1 in the request */
1946 CURL_HTTP_VERSION_2_0, /* please use HTTP 2 in the request */
1947 CURL_HTTP_VERSION_2TLS, /* use version 2 for HTTPS, version 1.1 for HTTP */
1948 CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE, /* please use HTTP 2 without HTTP/1.1
1949 Upgrade */
1950
1951 CURL_HTTP_VERSION_LAST /* *ILLEGAL* http version */
1952};
1953
1954/* Convenience definition simple because the name of the version is HTTP/2 and
1955 not 2.0. The 2_0 version of the enum name was set while the version was
1956 still planned to be 2.0 and we stick to it for compatibility. */
1957#define CURL_HTTP_VERSION_2 CURL_HTTP_VERSION_2_0
1958
1959/*
1960 * Public API enums for RTSP requests
1961 */
1962enum {
1963 CURL_RTSPREQ_NONE, /* first in list */
1964 CURL_RTSPREQ_OPTIONS,
1965 CURL_RTSPREQ_DESCRIBE,
1966 CURL_RTSPREQ_ANNOUNCE,
1967 CURL_RTSPREQ_SETUP,
1968 CURL_RTSPREQ_PLAY,
1969 CURL_RTSPREQ_PAUSE,
1970 CURL_RTSPREQ_TEARDOWN,
1971 CURL_RTSPREQ_GET_PARAMETER,
1972 CURL_RTSPREQ_SET_PARAMETER,
1973 CURL_RTSPREQ_RECORD,
1974 CURL_RTSPREQ_RECEIVE,
1975 CURL_RTSPREQ_LAST /* last in list */
1976};
1977
1978 /* These enums are for use with the CURLOPT_NETRC option. */
1979enum CURL_NETRC_OPTION {
1980 CURL_NETRC_IGNORED, /* The .netrc will never be read.
1981 * This is the default. */
1982 CURL_NETRC_OPTIONAL, /* A user:password in the URL will be preferred
1983 * to one in the .netrc. */
1984 CURL_NETRC_REQUIRED, /* A user:password in the URL will be ignored.
1985 * Unless one is set programmatically, the .netrc
1986 * will be queried. */
1987 CURL_NETRC_LAST
1988};
1989
1990enum {
1991 CURL_SSLVERSION_DEFAULT,
1992 CURL_SSLVERSION_TLSv1, /* TLS 1.x */
1993 CURL_SSLVERSION_SSLv2,
1994 CURL_SSLVERSION_SSLv3,
1995 CURL_SSLVERSION_TLSv1_0,
1996 CURL_SSLVERSION_TLSv1_1,
1997 CURL_SSLVERSION_TLSv1_2,
1998 CURL_SSLVERSION_TLSv1_3,
1999
2000 CURL_SSLVERSION_LAST /* never use, keep last */
2001};
2002
2003enum {
2004 CURL_SSLVERSION_MAX_NONE = 0,
2005 CURL_SSLVERSION_MAX_DEFAULT = (CURL_SSLVERSION_TLSv1 << 16),
2006 CURL_SSLVERSION_MAX_TLSv1_0 = (CURL_SSLVERSION_TLSv1_0 << 16),
2007 CURL_SSLVERSION_MAX_TLSv1_1 = (CURL_SSLVERSION_TLSv1_1 << 16),
2008 CURL_SSLVERSION_MAX_TLSv1_2 = (CURL_SSLVERSION_TLSv1_2 << 16),
2009 CURL_SSLVERSION_MAX_TLSv1_3 = (CURL_SSLVERSION_TLSv1_3 << 16),
2010
2011 /* never use, keep last */
2012 CURL_SSLVERSION_MAX_LAST = (CURL_SSLVERSION_LAST << 16)
2013};
2014
2015enum CURL_TLSAUTH {
2016 CURL_TLSAUTH_NONE,
2017 CURL_TLSAUTH_SRP,
2018 CURL_TLSAUTH_LAST /* never use, keep last */
2019};
2020
2021/* symbols to use with CURLOPT_POSTREDIR.
2022 CURL_REDIR_POST_301, CURL_REDIR_POST_302 and CURL_REDIR_POST_303
2023 can be bitwise ORed so that CURL_REDIR_POST_301 | CURL_REDIR_POST_302
2024 | CURL_REDIR_POST_303 == CURL_REDIR_POST_ALL */
2025
2026#define CURL_REDIR_GET_ALL 0
2027#define CURL_REDIR_POST_301 1
2028#define CURL_REDIR_POST_302 2
2029#define CURL_REDIR_POST_303 4
2030#define CURL_REDIR_POST_ALL \
2031 (CURL_REDIR_POST_301|CURL_REDIR_POST_302|CURL_REDIR_POST_303)
2032
2033typedef enum {
2034 CURL_TIMECOND_NONE,
2035
2036 CURL_TIMECOND_IFMODSINCE,
2037 CURL_TIMECOND_IFUNMODSINCE,
2038 CURL_TIMECOND_LASTMOD,
2039
2040 CURL_TIMECOND_LAST
2041} curl_TimeCond;
2042
2043/* Special size_t value signaling a zero-terminated string. */
2044#define CURL_ZERO_TERMINATED ((size_t) -1)
2045
2046/* curl_strequal() and curl_strnequal() are subject for removal in a future
2047 release */
2048CURL_EXTERN int curl_strequal(const char *s1, const char *s2);
2049CURL_EXTERN int curl_strnequal(const char *s1, const char *s2, size_t n);
2050
2051/* Mime/form handling support. */
2052typedef struct curl_mime_s curl_mime; /* Mime context. */
2053typedef struct curl_mimepart_s curl_mimepart; /* Mime part context. */
2054
2055/*
2056 * NAME curl_mime_init()
2057 *
2058 * DESCRIPTION
2059 *
2060 * Create a mime context and return its handle. The easy parameter is the
2061 * target handle.
2062 */
2063CURL_EXTERN curl_mime *curl_mime_init(CURL *easy);
2064
2065/*
2066 * NAME curl_mime_free()
2067 *
2068 * DESCRIPTION
2069 *
2070 * release a mime handle and its substructures.
2071 */
2072CURL_EXTERN void curl_mime_free(curl_mime *mime);
2073
2074/*
2075 * NAME curl_mime_addpart()
2076 *
2077 * DESCRIPTION
2078 *
2079 * Append a new empty part to the given mime context and return a handle to
2080 * the created part.
2081 */
2082CURL_EXTERN curl_mimepart *curl_mime_addpart(curl_mime *mime);
2083
2084/*
2085 * NAME curl_mime_name()
2086 *
2087 * DESCRIPTION
2088 *
2089 * Set mime/form part name.
2090 */
2091CURL_EXTERN CURLcode curl_mime_name(curl_mimepart *part, const char *name);
2092
2093/*
2094 * NAME curl_mime_filename()
2095 *
2096 * DESCRIPTION
2097 *
2098 * Set mime part remote file name.
2099 */
2100CURL_EXTERN CURLcode curl_mime_filename(curl_mimepart *part,
2101 const char *filename);
2102
2103/*
2104 * NAME curl_mime_type()
2105 *
2106 * DESCRIPTION
2107 *
2108 * Set mime part type.
2109 */
2110CURL_EXTERN CURLcode curl_mime_type(curl_mimepart *part, const char *mimetype);
2111
2112/*
2113 * NAME curl_mime_encoder()
2114 *
2115 * DESCRIPTION
2116 *
2117 * Set mime data transfer encoder.
2118 */
2119CURL_EXTERN CURLcode curl_mime_encoder(curl_mimepart *part,
2120 const char *encoding);
2121
2122/*
2123 * NAME curl_mime_data()
2124 *
2125 * DESCRIPTION
2126 *
2127 * Set mime part data source from memory data,
2128 */
2129CURL_EXTERN CURLcode curl_mime_data(curl_mimepart *part,
2130 const char *data, size_t datasize);
2131
2132/*
2133 * NAME curl_mime_filedata()
2134 *
2135 * DESCRIPTION
2136 *
2137 * Set mime part data source from named file.
2138 */
2139CURL_EXTERN CURLcode curl_mime_filedata(curl_mimepart *part,
2140 const char *filename);
2141
2142/*
2143 * NAME curl_mime_data_cb()
2144 *
2145 * DESCRIPTION
2146 *
2147 * Set mime part data source from callback function.
2148 */
2149CURL_EXTERN CURLcode curl_mime_data_cb(curl_mimepart *part,
2150 curl_off_t datasize,
2151 curl_read_callback readfunc,
2152 curl_seek_callback seekfunc,
2153 curl_free_callback freefunc,
2154 void *arg);
2155
2156/*
2157 * NAME curl_mime_subparts()
2158 *
2159 * DESCRIPTION
2160 *
2161 * Set mime part data source from subparts.
2162 */
2163CURL_EXTERN CURLcode curl_mime_subparts(curl_mimepart *part,
2164 curl_mime *subparts);
2165/*
2166 * NAME curl_mime_headers()
2167 *
2168 * DESCRIPTION
2169 *
2170 * Set mime part headers.
2171 */
2172CURL_EXTERN CURLcode curl_mime_headers(curl_mimepart *part,
2173 struct curl_slist *headers,
2174 int take_ownership);
2175
2176/* Old form API. */
2177/* name is uppercase CURLFORM_<name> */
2178#ifdef CFINIT
2179#undef CFINIT
2180#endif
2181
2182#ifdef CURL_ISOCPP
2183#define CFINIT(name) CURLFORM_ ## name
2184#else
2185/* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */
2186#define CFINIT(name) CURLFORM_/**/name
2187#endif
2188
2189typedef enum {
2190 CFINIT(NOTHING), /********* the first one is unused ************/
2191
2192 /* */
2193 CFINIT(COPYNAME),
2194 CFINIT(PTRNAME),
2195 CFINIT(NAMELENGTH),
2196 CFINIT(COPYCONTENTS),
2197 CFINIT(PTRCONTENTS),
2198 CFINIT(CONTENTSLENGTH),
2199 CFINIT(FILECONTENT),
2200 CFINIT(ARRAY),
2201 CFINIT(OBSOLETE),
2202 CFINIT(FILE),
2203
2204 CFINIT(BUFFER),
2205 CFINIT(BUFFERPTR),
2206 CFINIT(BUFFERLENGTH),
2207
2208 CFINIT(CONTENTTYPE),
2209 CFINIT(CONTENTHEADER),
2210 CFINIT(FILENAME),
2211 CFINIT(END),
2212 CFINIT(OBSOLETE2),
2213
2214 CFINIT(STREAM),
2215 CFINIT(CONTENTLEN), /* added in 7.46.0, provide a curl_off_t length */
2216
2217 CURLFORM_LASTENTRY /* the last unused */
2218} CURLformoption;
2219
2220#undef CFINIT /* done */
2221
2222/* structure to be used as parameter for CURLFORM_ARRAY */
2223struct curl_forms {
2224 CURLformoption option;
2225 const char *value;
2226};
2227
2228/* use this for multipart formpost building */
2229/* Returns code for curl_formadd()
2230 *
2231 * Returns:
2232 * CURL_FORMADD_OK on success
2233 * CURL_FORMADD_MEMORY if the FormInfo allocation fails
2234 * CURL_FORMADD_OPTION_TWICE if one option is given twice for one Form
2235 * CURL_FORMADD_NULL if a null pointer was given for a char
2236 * CURL_FORMADD_MEMORY if the allocation of a FormInfo struct failed
2237 * CURL_FORMADD_UNKNOWN_OPTION if an unknown option was used
2238 * CURL_FORMADD_INCOMPLETE if the some FormInfo is not complete (or error)
2239 * CURL_FORMADD_MEMORY if a curl_httppost struct cannot be allocated
2240 * CURL_FORMADD_MEMORY if some allocation for string copying failed.
2241 * CURL_FORMADD_ILLEGAL_ARRAY if an illegal option is used in an array
2242 *
2243 ***************************************************************************/
2244typedef enum {
2245 CURL_FORMADD_OK, /* first, no error */
2246
2247 CURL_FORMADD_MEMORY,
2248 CURL_FORMADD_OPTION_TWICE,
2249 CURL_FORMADD_NULL,
2250 CURL_FORMADD_UNKNOWN_OPTION,
2251 CURL_FORMADD_INCOMPLETE,
2252 CURL_FORMADD_ILLEGAL_ARRAY,
2253 CURL_FORMADD_DISABLED, /* libcurl was built with this disabled */
2254
2255 CURL_FORMADD_LAST /* last */
2256} CURLFORMcode;
2257
2258/*
2259 * NAME curl_formadd()
2260 *
2261 * DESCRIPTION
2262 *
2263 * Pretty advanced function for building multi-part formposts. Each invoke
2264 * adds one part that together construct a full post. Then use
2265 * CURLOPT_HTTPPOST to send it off to libcurl.
2266 */
2267CURL_EXTERN CURLFORMcode curl_formadd(struct curl_httppost **httppost,
2268 struct curl_httppost **last_post,
2269 ...);
2270
2271/*
2272 * callback function for curl_formget()
2273 * The void *arg pointer will be the one passed as second argument to
2274 * curl_formget().
2275 * The character buffer passed to it must not be freed.
2276 * Should return the buffer length passed to it as the argument "len" on
2277 * success.
2278 */
2279typedef size_t (*curl_formget_callback)(void *arg, const char *buf,
2280 size_t len);
2281
2282/*
2283 * NAME curl_formget()
2284 *
2285 * DESCRIPTION
2286 *
2287 * Serialize a curl_httppost struct built with curl_formadd().
2288 * Accepts a void pointer as second argument which will be passed to
2289 * the curl_formget_callback function.
2290 * Returns 0 on success.
2291 */
2292CURL_EXTERN int curl_formget(struct curl_httppost *form, void *arg,
2293 curl_formget_callback append);
2294/*
2295 * NAME curl_formfree()
2296 *
2297 * DESCRIPTION
2298 *
2299 * Free a multipart formpost previously built with curl_formadd().
2300 */
2301CURL_EXTERN void curl_formfree(struct curl_httppost *form);
2302
2303/*
2304 * NAME curl_getenv()
2305 *
2306 * DESCRIPTION
2307 *
2308 * Returns a malloc()'ed string that MUST be curl_free()ed after usage is
2309 * complete. DEPRECATED - see lib/README.curlx
2310 */
2311CURL_EXTERN char *curl_getenv(const char *variable);
2312
2313/*
2314 * NAME curl_version()
2315 *
2316 * DESCRIPTION
2317 *
2318 * Returns a static ascii string of the libcurl version.
2319 */
2320CURL_EXTERN char *curl_version(void);
2321
2322/*
2323 * NAME curl_easy_escape()
2324 *
2325 * DESCRIPTION
2326 *
2327 * Escapes URL strings (converts all letters consider illegal in URLs to their
2328 * %XX versions). This function returns a new allocated string or NULL if an
2329 * error occurred.
2330 */
2331CURL_EXTERN char *curl_easy_escape(CURL *handle,
2332 const char *string,
2333 int length);
2334
2335/* the previous version: */
2336CURL_EXTERN char *curl_escape(const char *string,
2337 int length);
2338
2339
2340/*
2341 * NAME curl_easy_unescape()
2342 *
2343 * DESCRIPTION
2344 *
2345 * Unescapes URL encoding in strings (converts all %XX codes to their 8bit
2346 * versions). This function returns a new allocated string or NULL if an error
2347 * occurred.
2348 * Conversion Note: On non-ASCII platforms the ASCII %XX codes are
2349 * converted into the host encoding.
2350 */
2351CURL_EXTERN char *curl_easy_unescape(CURL *handle,
2352 const char *string,
2353 int length,
2354 int *outlength);
2355
2356/* the previous version */
2357CURL_EXTERN char *curl_unescape(const char *string,
2358 int length);
2359
2360/*
2361 * NAME curl_free()
2362 *
2363 * DESCRIPTION
2364 *
2365 * Provided for de-allocation in the same translation unit that did the
2366 * allocation. Added in libcurl 7.10
2367 */
2368CURL_EXTERN void curl_free(void *p);
2369
2370/*
2371 * NAME curl_global_init()
2372 *
2373 * DESCRIPTION
2374 *
2375 * curl_global_init() should be invoked exactly once for each application that
2376 * uses libcurl and before any call of other libcurl functions.
2377 *
2378 * This function is not thread-safe!
2379 */
2380CURL_EXTERN CURLcode curl_global_init(long flags);
2381
2382/*
2383 * NAME curl_global_init_mem()
2384 *
2385 * DESCRIPTION
2386 *
2387 * curl_global_init() or curl_global_init_mem() should be invoked exactly once
2388 * for each application that uses libcurl. This function can be used to
2389 * initialize libcurl and set user defined memory management callback
2390 * functions. Users can implement memory management routines to check for
2391 * memory leaks, check for mis-use of the curl library etc. User registered
2392 * callback routines with be invoked by this library instead of the system
2393 * memory management routines like malloc, free etc.
2394 */
2395CURL_EXTERN CURLcode curl_global_init_mem(long flags,
2396 curl_malloc_callback m,
2397 curl_free_callback f,
2398 curl_realloc_callback r,
2399 curl_strdup_callback s,
2400 curl_calloc_callback c);
2401
2402/*
2403 * NAME curl_global_cleanup()
2404 *
2405 * DESCRIPTION
2406 *
2407 * curl_global_cleanup() should be invoked exactly once for each application
2408 * that uses libcurl
2409 */
2410CURL_EXTERN void curl_global_cleanup(void);
2411
2412/* linked-list structure for the CURLOPT_QUOTE option (and other) */
2413struct curl_slist {
2414 char *data;
2415 struct curl_slist *next;
2416};
2417
2418/*
2419 * NAME curl_global_sslset()
2420 *
2421 * DESCRIPTION
2422 *
2423 * When built with multiple SSL backends, curl_global_sslset() allows to
2424 * choose one. This function can only be called once, and it must be called
2425 * *before* curl_global_init().
2426 *
2427 * The backend can be identified by the id (e.g. CURLSSLBACKEND_OPENSSL). The
2428 * backend can also be specified via the name parameter (passing -1 as id).
2429 * If both id and name are specified, the name will be ignored. If neither id
2430 * nor name are specified, the function will fail with
2431 * CURLSSLSET_UNKNOWN_BACKEND and set the "avail" pointer to the
2432 * NULL-terminated list of available backends.
2433 *
2434 * Upon success, the function returns CURLSSLSET_OK.
2435 *
2436 * If the specified SSL backend is not available, the function returns
2437 * CURLSSLSET_UNKNOWN_BACKEND and sets the "avail" pointer to a NULL-terminated
2438 * list of available SSL backends.
2439 *
2440 * The SSL backend can be set only once. If it has already been set, a
2441 * subsequent attempt to change it will result in a CURLSSLSET_TOO_LATE.
2442 */
2443
2444typedef struct {
2445 curl_sslbackend id;
2446 const char *name;
2447} curl_ssl_backend;
2448
2449typedef enum {
2450 CURLSSLSET_OK = 0,
2451 CURLSSLSET_UNKNOWN_BACKEND,
2452 CURLSSLSET_TOO_LATE,
2453 CURLSSLSET_NO_BACKENDS /* libcurl was built without any SSL support */
2454} CURLsslset;
2455
2456CURL_EXTERN CURLsslset curl_global_sslset(curl_sslbackend id, const char *name,
2457 const curl_ssl_backend ***avail);
2458
2459/*
2460 * NAME curl_slist_append()
2461 *
2462 * DESCRIPTION
2463 *
2464 * Appends a string to a linked list. If no list exists, it will be created
2465 * first. Returns the new list, after appending.
2466 */
2467CURL_EXTERN struct curl_slist *curl_slist_append(struct curl_slist *,
2468 const char *);
2469
2470/*
2471 * NAME curl_slist_free_all()
2472 *
2473 * DESCRIPTION
2474 *
2475 * free a previously built curl_slist.
2476 */
2477CURL_EXTERN void curl_slist_free_all(struct curl_slist *);
2478
2479/*
2480 * NAME curl_getdate()
2481 *
2482 * DESCRIPTION
2483 *
2484 * Returns the time, in seconds since 1 Jan 1970 of the time string given in
2485 * the first argument. The time argument in the second parameter is unused
2486 * and should be set to NULL.
2487 */
2488CURL_EXTERN time_t curl_getdate(const char *p, const time_t *unused);
2489
2490/* info about the certificate chain, only for OpenSSL builds. Asked
2491 for with CURLOPT_CERTINFO / CURLINFO_CERTINFO */
2492struct curl_certinfo {
2493 int num_of_certs; /* number of certificates with information */
2494 struct curl_slist **certinfo; /* for each index in this array, there's a
2495 linked list with textual information in the
2496 format "name: value" */
2497};
2498
2499/* Information about the SSL library used and the respective internal SSL
2500 handle, which can be used to obtain further information regarding the
2501 connection. Asked for with CURLINFO_TLS_SSL_PTR or CURLINFO_TLS_SESSION. */
2502struct curl_tlssessioninfo {
2503 curl_sslbackend backend;
2504 void *internals;
2505};
2506
2507#define CURLINFO_STRING 0x100000
2508#define CURLINFO_LONG 0x200000
2509#define CURLINFO_DOUBLE 0x300000
2510#define CURLINFO_SLIST 0x400000
2511#define CURLINFO_PTR 0x400000 /* same as SLIST */
2512#define CURLINFO_SOCKET 0x500000
2513#define CURLINFO_OFF_T 0x600000
2514#define CURLINFO_MASK 0x0fffff
2515#define CURLINFO_TYPEMASK 0xf00000
2516
2517typedef enum {
2518 CURLINFO_NONE, /* first, never use this */
2519 CURLINFO_EFFECTIVE_URL = CURLINFO_STRING + 1,
2520 CURLINFO_RESPONSE_CODE = CURLINFO_LONG + 2,
2521 CURLINFO_TOTAL_TIME = CURLINFO_DOUBLE + 3,
2522 CURLINFO_NAMELOOKUP_TIME = CURLINFO_DOUBLE + 4,
2523 CURLINFO_CONNECT_TIME = CURLINFO_DOUBLE + 5,
2524 CURLINFO_PRETRANSFER_TIME = CURLINFO_DOUBLE + 6,
2525 CURLINFO_SIZE_UPLOAD = CURLINFO_DOUBLE + 7,
2526 CURLINFO_SIZE_UPLOAD_T = CURLINFO_OFF_T + 7,
2527 CURLINFO_SIZE_DOWNLOAD = CURLINFO_DOUBLE + 8,
2528 CURLINFO_SIZE_DOWNLOAD_T = CURLINFO_OFF_T + 8,
2529 CURLINFO_SPEED_DOWNLOAD = CURLINFO_DOUBLE + 9,
2530 CURLINFO_SPEED_DOWNLOAD_T = CURLINFO_OFF_T + 9,
2531 CURLINFO_SPEED_UPLOAD = CURLINFO_DOUBLE + 10,
2532 CURLINFO_SPEED_UPLOAD_T = CURLINFO_OFF_T + 10,
2533 CURLINFO_HEADER_SIZE = CURLINFO_LONG + 11,
2534 CURLINFO_REQUEST_SIZE = CURLINFO_LONG + 12,
2535 CURLINFO_SSL_VERIFYRESULT = CURLINFO_LONG + 13,
2536 CURLINFO_FILETIME = CURLINFO_LONG + 14,
2537 CURLINFO_FILETIME_T = CURLINFO_OFF_T + 14,
2538 CURLINFO_CONTENT_LENGTH_DOWNLOAD = CURLINFO_DOUBLE + 15,
2539 CURLINFO_CONTENT_LENGTH_DOWNLOAD_T = CURLINFO_OFF_T + 15,
2540 CURLINFO_CONTENT_LENGTH_UPLOAD = CURLINFO_DOUBLE + 16,
2541 CURLINFO_CONTENT_LENGTH_UPLOAD_T = CURLINFO_OFF_T + 16,
2542 CURLINFO_STARTTRANSFER_TIME = CURLINFO_DOUBLE + 17,
2543 CURLINFO_CONTENT_TYPE = CURLINFO_STRING + 18,
2544 CURLINFO_REDIRECT_TIME = CURLINFO_DOUBLE + 19,
2545 CURLINFO_REDIRECT_COUNT = CURLINFO_LONG + 20,
2546 CURLINFO_PRIVATE = CURLINFO_STRING + 21,
2547 CURLINFO_HTTP_CONNECTCODE = CURLINFO_LONG + 22,
2548 CURLINFO_HTTPAUTH_AVAIL = CURLINFO_LONG + 23,
2549 CURLINFO_PROXYAUTH_AVAIL = CURLINFO_LONG + 24,
2550 CURLINFO_OS_ERRNO = CURLINFO_LONG + 25,
2551 CURLINFO_NUM_CONNECTS = CURLINFO_LONG + 26,
2552 CURLINFO_SSL_ENGINES = CURLINFO_SLIST + 27,
2553 CURLINFO_COOKIELIST = CURLINFO_SLIST + 28,
2554 CURLINFO_LASTSOCKET = CURLINFO_LONG + 29,
2555 CURLINFO_FTP_ENTRY_PATH = CURLINFO_STRING + 30,
2556 CURLINFO_REDIRECT_URL = CURLINFO_STRING + 31,
2557 CURLINFO_PRIMARY_IP = CURLINFO_STRING + 32,
2558 CURLINFO_APPCONNECT_TIME = CURLINFO_DOUBLE + 33,
2559 CURLINFO_CERTINFO = CURLINFO_PTR + 34,
2560 CURLINFO_CONDITION_UNMET = CURLINFO_LONG + 35,
2561 CURLINFO_RTSP_SESSION_ID = CURLINFO_STRING + 36,
2562 CURLINFO_RTSP_CLIENT_CSEQ = CURLINFO_LONG + 37,
2563 CURLINFO_RTSP_SERVER_CSEQ = CURLINFO_LONG + 38,
2564 CURLINFO_RTSP_CSEQ_RECV = CURLINFO_LONG + 39,
2565 CURLINFO_PRIMARY_PORT = CURLINFO_LONG + 40,
2566 CURLINFO_LOCAL_IP = CURLINFO_STRING + 41,
2567 CURLINFO_LOCAL_PORT = CURLINFO_LONG + 42,
2568 CURLINFO_TLS_SESSION = CURLINFO_PTR + 43,
2569 CURLINFO_ACTIVESOCKET = CURLINFO_SOCKET + 44,
2570 CURLINFO_TLS_SSL_PTR = CURLINFO_PTR + 45,
2571 CURLINFO_HTTP_VERSION = CURLINFO_LONG + 46,
2572 CURLINFO_PROXY_SSL_VERIFYRESULT = CURLINFO_LONG + 47,
2573 CURLINFO_PROTOCOL = CURLINFO_LONG + 48,
2574 CURLINFO_SCHEME = CURLINFO_STRING + 49,
2575 /* Fill in new entries below here! */
2576
2577 /* Preferably these would be defined conditionally based on the
2578 sizeof curl_off_t being 64-bits */
2579 CURLINFO_TOTAL_TIME_T = CURLINFO_OFF_T + 50,
2580 CURLINFO_NAMELOOKUP_TIME_T = CURLINFO_OFF_T + 51,
2581 CURLINFO_CONNECT_TIME_T = CURLINFO_OFF_T + 52,
2582 CURLINFO_PRETRANSFER_TIME_T = CURLINFO_OFF_T + 53,
2583 CURLINFO_STARTTRANSFER_TIME_T = CURLINFO_OFF_T + 54,
2584 CURLINFO_REDIRECT_TIME_T = CURLINFO_OFF_T + 55,
2585 CURLINFO_APPCONNECT_TIME_T = CURLINFO_OFF_T + 56,
2586
2587 CURLINFO_LASTONE = 56
2588} CURLINFO;
2589
2590/* CURLINFO_RESPONSE_CODE is the new name for the option previously known as
2591 CURLINFO_HTTP_CODE */
2592#define CURLINFO_HTTP_CODE CURLINFO_RESPONSE_CODE
2593
2594typedef enum {
2595 CURLCLOSEPOLICY_NONE, /* first, never use this */
2596
2597 CURLCLOSEPOLICY_OLDEST,
2598 CURLCLOSEPOLICY_LEAST_RECENTLY_USED,
2599 CURLCLOSEPOLICY_LEAST_TRAFFIC,
2600 CURLCLOSEPOLICY_SLOWEST,
2601 CURLCLOSEPOLICY_CALLBACK,
2602
2603 CURLCLOSEPOLICY_LAST /* last, never use this */
2604} curl_closepolicy;
2605
2606#define CURL_GLOBAL_SSL (1<<0) /* no purpose since since 7.57.0 */
2607#define CURL_GLOBAL_WIN32 (1<<1)
2608#define CURL_GLOBAL_ALL (CURL_GLOBAL_SSL|CURL_GLOBAL_WIN32)
2609#define CURL_GLOBAL_NOTHING 0
2610#define CURL_GLOBAL_DEFAULT CURL_GLOBAL_ALL
2611#define CURL_GLOBAL_ACK_EINTR (1<<2)
2612
2613
2614/*****************************************************************************
2615 * Setup defines, protos etc for the sharing stuff.
2616 */
2617
2618/* Different data locks for a single share */
2619typedef enum {
2620 CURL_LOCK_DATA_NONE = 0,
2621 /* CURL_LOCK_DATA_SHARE is used internally to say that
2622 * the locking is just made to change the internal state of the share
2623 * itself.
2624 */
2625 CURL_LOCK_DATA_SHARE,
2626 CURL_LOCK_DATA_COOKIE,
2627 CURL_LOCK_DATA_DNS,
2628 CURL_LOCK_DATA_SSL_SESSION,
2629 CURL_LOCK_DATA_CONNECT,
2630 CURL_LOCK_DATA_PSL,
2631 CURL_LOCK_DATA_LAST
2632} curl_lock_data;
2633
2634/* Different lock access types */
2635typedef enum {
2636 CURL_LOCK_ACCESS_NONE = 0, /* unspecified action */
2637 CURL_LOCK_ACCESS_SHARED = 1, /* for read perhaps */
2638 CURL_LOCK_ACCESS_SINGLE = 2, /* for write perhaps */
2639 CURL_LOCK_ACCESS_LAST /* never use */
2640} curl_lock_access;
2641
2642typedef void (*curl_lock_function)(CURL *handle,
2643 curl_lock_data data,
2644 curl_lock_access locktype,
2645 void *userptr);
2646typedef void (*curl_unlock_function)(CURL *handle,
2647 curl_lock_data data,
2648 void *userptr);
2649
2650
2651typedef enum {
2652 CURLSHE_OK, /* all is fine */
2653 CURLSHE_BAD_OPTION, /* 1 */
2654 CURLSHE_IN_USE, /* 2 */
2655 CURLSHE_INVALID, /* 3 */
2656 CURLSHE_NOMEM, /* 4 out of memory */
2657 CURLSHE_NOT_BUILT_IN, /* 5 feature not present in lib */
2658 CURLSHE_LAST /* never use */
2659} CURLSHcode;
2660
2661typedef enum {
2662 CURLSHOPT_NONE, /* don't use */
2663 CURLSHOPT_SHARE, /* specify a data type to share */
2664 CURLSHOPT_UNSHARE, /* specify which data type to stop sharing */
2665 CURLSHOPT_LOCKFUNC, /* pass in a 'curl_lock_function' pointer */
2666 CURLSHOPT_UNLOCKFUNC, /* pass in a 'curl_unlock_function' pointer */
2667 CURLSHOPT_USERDATA, /* pass in a user data pointer used in the lock/unlock
2668 callback functions */
2669 CURLSHOPT_LAST /* never use */
2670} CURLSHoption;
2671
2672CURL_EXTERN CURLSH *curl_share_init(void);
2673CURL_EXTERN CURLSHcode curl_share_setopt(CURLSH *, CURLSHoption option, ...);
2674CURL_EXTERN CURLSHcode curl_share_cleanup(CURLSH *);
2675
2676/****************************************************************************
2677 * Structures for querying information about the curl library at runtime.
2678 */
2679
2680typedef enum {
2681 CURLVERSION_FIRST,
2682 CURLVERSION_SECOND,
2683 CURLVERSION_THIRD,
2684 CURLVERSION_FOURTH,
2685 CURLVERSION_FIFTH,
2686 CURLVERSION_LAST /* never actually use this */
2687} CURLversion;
2688
2689/* The 'CURLVERSION_NOW' is the symbolic name meant to be used by
2690 basically all programs ever that want to get version information. It is
2691 meant to be a built-in version number for what kind of struct the caller
2692 expects. If the struct ever changes, we redefine the NOW to another enum
2693 from above. */
2694#define CURLVERSION_NOW CURLVERSION_FIFTH
2695
2696typedef struct {
2697 CURLversion age; /* age of the returned struct */
2698 const char *version; /* LIBCURL_VERSION */
2699 unsigned int version_num; /* LIBCURL_VERSION_NUM */
2700 const char *host; /* OS/host/cpu/machine when configured */
2701 int features; /* bitmask, see defines below */
2702 const char *ssl_version; /* human readable string */
2703 long ssl_version_num; /* not used anymore, always 0 */
2704 const char *libz_version; /* human readable string */
2705 /* protocols is terminated by an entry with a NULL protoname */
2706 const char * const *protocols;
2707
2708 /* The fields below this were added in CURLVERSION_SECOND */
2709 const char *ares;
2710 int ares_num;
2711
2712 /* This field was added in CURLVERSION_THIRD */
2713 const char *libidn;
2714
2715 /* These field were added in CURLVERSION_FOURTH */
2716
2717 /* Same as '_libiconv_version' if built with HAVE_ICONV */
2718 int iconv_ver_num;
2719
2720 const char *libssh_version; /* human readable string */
2721
2722 /* These fields were added in CURLVERSION_FIFTH */
2723
2724 unsigned int brotli_ver_num; /* Numeric Brotli version
2725 (MAJOR << 24) | (MINOR << 12) | PATCH */
2726 const char *brotli_version; /* human readable string. */
2727
2728} curl_version_info_data;
2729
2730#define CURL_VERSION_IPV6 (1<<0) /* IPv6-enabled */
2731#define CURL_VERSION_KERBEROS4 (1<<1) /* Kerberos V4 auth is supported
2732 (deprecated) */
2733#define CURL_VERSION_SSL (1<<2) /* SSL options are present */
2734#define CURL_VERSION_LIBZ (1<<3) /* libz features are present */
2735#define CURL_VERSION_NTLM (1<<4) /* NTLM auth is supported */
2736#define CURL_VERSION_GSSNEGOTIATE (1<<5) /* Negotiate auth is supported
2737 (deprecated) */
2738#define CURL_VERSION_DEBUG (1<<6) /* Built with debug capabilities */
2739#define CURL_VERSION_ASYNCHDNS (1<<7) /* Asynchronous DNS resolves */
2740#define CURL_VERSION_SPNEGO (1<<8) /* SPNEGO auth is supported */
2741#define CURL_VERSION_LARGEFILE (1<<9) /* Supports files larger than 2GB */
2742#define CURL_VERSION_IDN (1<<10) /* Internationized Domain Names are
2743 supported */
2744#define CURL_VERSION_SSPI (1<<11) /* Built against Windows SSPI */
2745#define CURL_VERSION_CONV (1<<12) /* Character conversions supported */
2746#define CURL_VERSION_CURLDEBUG (1<<13) /* Debug memory tracking supported */
2747#define CURL_VERSION_TLSAUTH_SRP (1<<14) /* TLS-SRP auth is supported */
2748#define CURL_VERSION_NTLM_WB (1<<15) /* NTLM delegation to winbind helper
2749 is supported */
2750#define CURL_VERSION_HTTP2 (1<<16) /* HTTP2 support built-in */
2751#define CURL_VERSION_GSSAPI (1<<17) /* Built against a GSS-API library */
2752#define CURL_VERSION_KERBEROS5 (1<<18) /* Kerberos V5 auth is supported */
2753#define CURL_VERSION_UNIX_SOCKETS (1<<19) /* Unix domain sockets support */
2754#define CURL_VERSION_PSL (1<<20) /* Mozilla's Public Suffix List, used
2755 for cookie domain verification */
2756#define CURL_VERSION_HTTPS_PROXY (1<<21) /* HTTPS-proxy support built-in */
2757#define CURL_VERSION_MULTI_SSL (1<<22) /* Multiple SSL backends available */
2758#define CURL_VERSION_BROTLI (1<<23) /* Brotli features are present. */
2759
2760 /*
2761 * NAME curl_version_info()
2762 *
2763 * DESCRIPTION
2764 *
2765 * This function returns a pointer to a static copy of the version info
2766 * struct. See above.
2767 */
2768CURL_EXTERN curl_version_info_data *curl_version_info(CURLversion);
2769
2770/*
2771 * NAME curl_easy_strerror()
2772 *
2773 * DESCRIPTION
2774 *
2775 * The curl_easy_strerror function may be used to turn a CURLcode value
2776 * into the equivalent human readable error string. This is useful
2777 * for printing meaningful error messages.
2778 */
2779CURL_EXTERN const char *curl_easy_strerror(CURLcode);
2780
2781/*
2782 * NAME curl_share_strerror()
2783 *
2784 * DESCRIPTION
2785 *
2786 * The curl_share_strerror function may be used to turn a CURLSHcode value
2787 * into the equivalent human readable error string. This is useful
2788 * for printing meaningful error messages.
2789 */
2790CURL_EXTERN const char *curl_share_strerror(CURLSHcode);
2791
2792/*
2793 * NAME curl_easy_pause()
2794 *
2795 * DESCRIPTION
2796 *
2797 * The curl_easy_pause function pauses or unpauses transfers. Select the new
2798 * state by setting the bitmask, use the convenience defines below.
2799 *
2800 */
2801CURL_EXTERN CURLcode curl_easy_pause(CURL *handle, int bitmask);
2802
2803#define CURLPAUSE_RECV (1<<0)
2804#define CURLPAUSE_RECV_CONT (0)
2805
2806#define CURLPAUSE_SEND (1<<2)
2807#define CURLPAUSE_SEND_CONT (0)
2808
2809#define CURLPAUSE_ALL (CURLPAUSE_RECV|CURLPAUSE_SEND)
2810#define CURLPAUSE_CONT (CURLPAUSE_RECV_CONT|CURLPAUSE_SEND_CONT)
2811
2812#ifdef __cplusplus
2813}
2814#endif
2815
2816/* unfortunately, the easy.h and multi.h include files need options and info
2817 stuff before they can be included! */
2818#include "easy.h" /* nothing in curl is fun without the easy stuff */
2819#include "multi.h"
2820#include "urlapi.h"
2821
2822/* the typechecker doesn't work in C++ (yet) */
2823#if defined(__GNUC__) && defined(__GNUC_MINOR__) && \
2824 ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) && \
2825 !defined(__cplusplus) && !defined(CURL_DISABLE_TYPECHECK)
2826#include "typecheck-gcc.h"
2827#else
2828#if defined(__STDC__) && (__STDC__ >= 1)
2829/* This preprocessor magic that replaces a call with the exact same call is
2830 only done to make sure application authors pass exactly three arguments
2831 to these functions. */
2832#define curl_easy_setopt(handle,opt,param) curl_easy_setopt(handle,opt,param)
2833#define curl_easy_getinfo(handle,info,arg) curl_easy_getinfo(handle,info,arg)
2834#define curl_share_setopt(share,opt,param) curl_share_setopt(share,opt,param)
2835#define curl_multi_setopt(handle,opt,param) curl_multi_setopt(handle,opt,param)
2836#endif /* __STDC__ >= 1 */
2837#endif /* gcc >= 4.3 && !__cplusplus */
2838
2839#endif /* __CURL_CURL_H */
2840