VirtualBox

source: vbox/trunk/src/libs/curl-7.64.0/include/curl/curl.h@ 87173

Last change on this file since 87173 was 85671, checked in by vboxsync, 4 years ago

Export out internal curl copy to make it a lot simpler to build VBox (OSE) on Windows. bugref:9814

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

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette