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