#ifndef CURLINC_CURL_H1#define CURLINC_CURL_H2/***************************************************************************3* _ _ ____ _4* Project ___| | | | _ \| |5* / __| | | | |_) | |6* | (__| |_| | _ <| |___7* \___|\___/|_| \_\_____|8*9* Copyright (C) Daniel Stenberg, <[email protected]>, et al.10*11* This software is licensed as described in the file COPYING, which12* you should have received as part of this distribution. The terms13* are also available at https://curl.se/docs/copyright.html.14*15* You may opt to use, copy, modify, merge, publish, distribute and/or sell16* copies of the Software, and permit persons to whom the Software is17* furnished to do so, under the terms of the COPYING file.18*19* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY20* KIND, either express or implied.21*22* SPDX-License-Identifier: curl23*24***************************************************************************/2526/*27* If you have libcurl problems, all docs and details are found here:28* https://curl.se/libcurl/29*/3031#ifdef CURL_NO_OLDIES32#define CURL_STRICTER /* not used since 8.11.0 */33#endif3435/* Compile-time deprecation macros. */36#if (defined(__GNUC__) && \37((__GNUC__ > 12) || ((__GNUC__ == 12) && (__GNUC_MINOR__ >= 1))) || \38(defined(__clang__) && __clang_major__ >= 3) || \39defined(__IAR_SYSTEMS_ICC__)) && \40!defined(__INTEL_COMPILER) && \41!defined(CURL_DISABLE_DEPRECATION) && !defined(BUILDING_LIBCURL)42#define CURL_DEPRECATED(version, message) \43__attribute__((deprecated("since " # version ". " message)))44#ifdef __IAR_SYSTEMS_ICC__45#define CURL_IGNORE_DEPRECATION(statements) \46_Pragma("diag_suppress=Pe1444") \47statements \48_Pragma("diag_default=Pe1444")49#else50#define CURL_IGNORE_DEPRECATION(statements) \51_Pragma("GCC diagnostic push") \52_Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") \53statements \54_Pragma("GCC diagnostic pop")55#endif56#else57#define CURL_DEPRECATED(version, message)58#define CURL_IGNORE_DEPRECATION(statements) statements59#endif6061#include "curlver.h" /* libcurl version defines */62#include "system.h" /* determine things runtime */6364#include <stdio.h>65#include <limits.h>6667#if defined(__FreeBSD__) || defined(__MidnightBSD__)68/* Needed for __FreeBSD_version or __MidnightBSD_version symbol definition */69#include <sys/param.h>70#endif7172/* The include stuff here below is mainly for time_t! */73#include <sys/types.h>74#include <time.h>7576#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__CYGWIN__)77#if !(defined(_WINSOCKAPI_) || defined(_WINSOCK_H) || \78defined(__LWIP_OPT_H__) || defined(LWIP_HDR_OPT_H))79/* The check above prevents the winsock2.h inclusion if winsock.h already was80included, since they cannot co-exist without problems */81#include <winsock2.h>82#include <ws2tcpip.h>83#endif84#endif8586/* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish87libc5-based Linux systems. Only include it on systems that are known to88require it! */89#if defined(_AIX) || defined(__NOVELL_LIBC__) || defined(__NetBSD__) || \90defined(__minix) || defined(__INTEGRITY) || \91defined(ANDROID) || defined(__ANDROID__) || defined(__OpenBSD__) || \92defined(__CYGWIN__) || defined(AMIGA) || defined(__NuttX__) || \93(defined(__FreeBSD_version) && (__FreeBSD_version < 800000)) || \94(defined(__MidnightBSD_version) && (__MidnightBSD_version < 100000)) || \95defined(__sun__) || defined(__serenity__) || defined(__vxworks__)96#include <sys/select.h>97#endif9899#ifndef _WIN32100#include <sys/socket.h>101#include <sys/time.h>102#endif103104#ifdef __cplusplus105extern "C" {106#endif107108typedef void CURL;109typedef void CURLSH;110111/*112* libcurl external API function linkage decorations.113*/114115#ifdef __has_declspec_attribute116#define CURL_HAS_DECLSPEC_ATTRIBUTE(x) __has_declspec_attribute(x)117#else118#define CURL_HAS_DECLSPEC_ATTRIBUTE(x) 0119#endif120121#ifdef CURL_STATICLIB122# define CURL_EXTERN123#elif defined(_WIN32) || \124(CURL_HAS_DECLSPEC_ATTRIBUTE(dllexport) && \125CURL_HAS_DECLSPEC_ATTRIBUTE(dllimport))126# ifdef BUILDING_LIBCURL127# define CURL_EXTERN __declspec(dllexport)128# else129# define CURL_EXTERN __declspec(dllimport)130# endif131#elif defined(BUILDING_LIBCURL) && defined(CURL_HIDDEN_SYMBOLS)132# define CURL_EXTERN CURL_EXTERN_SYMBOL133#else134# define CURL_EXTERN135#endif136137#ifndef curl_socket_typedef138/* socket typedef */139#if defined(_WIN32) && !defined(__LWIP_OPT_H__) && !defined(LWIP_HDR_OPT_H)140typedef SOCKET curl_socket_t;141#define CURL_SOCKET_BAD INVALID_SOCKET142#else143typedef int curl_socket_t;144#define CURL_SOCKET_BAD -1145#endif146#define curl_socket_typedef147#endif /* curl_socket_typedef */148149/* enum for the different supported SSL backends */150typedef enum {151CURLSSLBACKEND_NONE = 0,152CURLSSLBACKEND_OPENSSL = 1,153CURLSSLBACKEND_GNUTLS = 2,154CURLSSLBACKEND_NSS CURL_DEPRECATED(8.3.0, "") = 3,155CURLSSLBACKEND_OBSOLETE4 = 4, /* Was QSOSSL. */156CURLSSLBACKEND_GSKIT CURL_DEPRECATED(8.3.0, "") = 5,157CURLSSLBACKEND_POLARSSL CURL_DEPRECATED(7.69.0, "") = 6,158CURLSSLBACKEND_WOLFSSL = 7,159CURLSSLBACKEND_SCHANNEL = 8,160CURLSSLBACKEND_SECURETRANSPORT CURL_DEPRECATED(8.15.0, "") = 9,161CURLSSLBACKEND_AXTLS CURL_DEPRECATED(7.61.0, "") = 10,162CURLSSLBACKEND_MBEDTLS = 11,163CURLSSLBACKEND_MESALINK CURL_DEPRECATED(7.82.0, "") = 12,164CURLSSLBACKEND_BEARSSL CURL_DEPRECATED(8.15.0, "") = 13,165CURLSSLBACKEND_RUSTLS = 14166} curl_sslbackend;167168/* aliases for library clones and renames */169#define CURLSSLBACKEND_AWSLC CURLSSLBACKEND_OPENSSL170#define CURLSSLBACKEND_BORINGSSL CURLSSLBACKEND_OPENSSL171#define CURLSSLBACKEND_LIBRESSL CURLSSLBACKEND_OPENSSL172173/* deprecated names: */174#define CURLSSLBACKEND_CYASSL CURLSSLBACKEND_WOLFSSL175#define CURLSSLBACKEND_DARWINSSL CURLSSLBACKEND_SECURETRANSPORT176177/* bits for the CURLOPT_FOLLOWLOCATION option */178#define CURLFOLLOW_ALL 1L /* generic follow redirects */179180/* Do not use the custom method in the follow-up request if the HTTP code181instructs so (301, 302, 303). */182#define CURLFOLLOW_OBEYCODE 2L183184/* Only use the custom method in the first request, always reset in the next */185#define CURLFOLLOW_FIRSTONLY 3L186187struct curl_httppost {188struct curl_httppost *next; /* next entry in the list */189char *name; /* pointer to allocated name */190long namelength; /* length of name length */191char *contents; /* pointer to allocated data contents */192long contentslength; /* length of contents field, see also193CURL_HTTPPOST_LARGE */194char *buffer; /* pointer to allocated buffer contents */195long bufferlength; /* length of buffer field */196char *contenttype; /* Content-Type */197struct curl_slist *contentheader; /* list of extra headers for this form */198struct curl_httppost *more; /* if one field name has more than one199file, this link should link to following200files */201long flags; /* as defined below */202203/* specified content is a filename */204#define CURL_HTTPPOST_FILENAME (1 << 0)205/* specified content is a filename */206#define CURL_HTTPPOST_READFILE (1 << 1)207/* name is only stored pointer do not free in formfree */208#define CURL_HTTPPOST_PTRNAME (1 << 2)209/* contents is only stored pointer do not free in formfree */210#define CURL_HTTPPOST_PTRCONTENTS (1 << 3)211/* upload file from buffer */212#define CURL_HTTPPOST_BUFFER (1 << 4)213/* upload file from pointer contents */214#define CURL_HTTPPOST_PTRBUFFER (1 << 5)215/* upload file contents by using the regular read callback to get the data and216pass the given pointer as custom pointer */217#define CURL_HTTPPOST_CALLBACK (1 << 6)218/* use size in 'contentlen', added in 7.46.0 */219#define CURL_HTTPPOST_LARGE (1 << 7)220221char *showfilename; /* The filename to show. If not set, the222actual filename will be used (if this223is a file part) */224void *userp; /* custom pointer used for225HTTPPOST_CALLBACK posts */226curl_off_t contentlen; /* alternative length of contents227field. Used if CURL_HTTPPOST_LARGE is228set. Added in 7.46.0 */229};230231/* This is a return code for the progress callback that, when returned, will232signal libcurl to continue executing the default progress function */233#define CURL_PROGRESSFUNC_CONTINUE 0x10000001234235/* This is the CURLOPT_PROGRESSFUNCTION callback prototype. It is now236considered deprecated but was the only choice up until 7.31.0 */237typedef int (*curl_progress_callback)(void *clientp,238double dltotal,239double dlnow,240double ultotal,241double ulnow);242243/* This is the CURLOPT_XFERINFOFUNCTION callback prototype. It was introduced244in 7.32.0, avoids the use of floating point numbers and provides more245detailed information. */246typedef int (*curl_xferinfo_callback)(void *clientp,247curl_off_t dltotal,248curl_off_t dlnow,249curl_off_t ultotal,250curl_off_t ulnow);251252#ifndef CURL_MAX_READ_SIZE253/* The maximum receive buffer size configurable via CURLOPT_BUFFERSIZE. */254#define CURL_MAX_READ_SIZE (10*1024*1024)255#endif256257#ifndef CURL_MAX_WRITE_SIZE258/* Tests have proven that 20K is a bad buffer size for uploads on Windows,259while 16K for some odd reason performed a lot better. We do the ifndef260check to allow this value to easier be changed at build time for those261who feel adventurous. The practical minimum is about 400 bytes since262libcurl uses a buffer of this size as a scratch area (unrelated to263network send operations). */264#define CURL_MAX_WRITE_SIZE 16384265#endif266267#ifndef CURL_MAX_HTTP_HEADER268/* The only reason to have a max limit for this is to avoid the risk of a bad269server feeding libcurl with a never-ending header that will cause reallocs270infinitely */271#define CURL_MAX_HTTP_HEADER (100*1024)272#endif273274/* This is a magic return code for the write callback that, when returned,275will signal libcurl to pause receiving on the current transfer. */276#define CURL_WRITEFUNC_PAUSE 0x10000001277278/* This is a magic return code for the write callback that, when returned,279will signal an error from the callback. */280#define CURL_WRITEFUNC_ERROR 0xFFFFFFFF281282typedef size_t (*curl_write_callback)(char *buffer,283size_t size,284size_t nitems,285void *outstream);286287/* This callback will be called when a new resolver request is made */288typedef int (*curl_resolver_start_callback)(void *resolver_state,289void *reserved, void *userdata);290291/* enumeration of file types */292typedef enum {293CURLFILETYPE_FILE = 0,294CURLFILETYPE_DIRECTORY,295CURLFILETYPE_SYMLINK,296CURLFILETYPE_DEVICE_BLOCK,297CURLFILETYPE_DEVICE_CHAR,298CURLFILETYPE_NAMEDPIPE,299CURLFILETYPE_SOCKET,300CURLFILETYPE_DOOR, /* is possible only on Sun Solaris now */301302CURLFILETYPE_UNKNOWN /* should never occur */303} curlfiletype;304305#define CURLFINFOFLAG_KNOWN_FILENAME (1 << 0)306#define CURLFINFOFLAG_KNOWN_FILETYPE (1 << 1)307#define CURLFINFOFLAG_KNOWN_TIME (1 << 2)308#define CURLFINFOFLAG_KNOWN_PERM (1 << 3)309#define CURLFINFOFLAG_KNOWN_UID (1 << 4)310#define CURLFINFOFLAG_KNOWN_GID (1 << 5)311#define CURLFINFOFLAG_KNOWN_SIZE (1 << 6)312#define CURLFINFOFLAG_KNOWN_HLINKCOUNT (1 << 7)313314/* Information about a single file, used when doing FTP wildcard matching */315struct curl_fileinfo {316char *filename;317curlfiletype filetype;318time_t time; /* always zero! */319unsigned int perm;320int uid;321int gid;322curl_off_t size;323long int hardlinks;324325struct {326/* If some of these fields is not NULL, it is a pointer to b_data. */327char *time;328char *perm;329char *user;330char *group;331char *target; /* pointer to the target filename of a symlink */332} strings;333334unsigned int flags;335336/* These are libcurl private struct fields. Previously used by libcurl, so337they must never be interfered with. */338char *b_data;339size_t b_size;340size_t b_used;341};342343/* return codes for CURLOPT_CHUNK_BGN_FUNCTION */344#define CURL_CHUNK_BGN_FUNC_OK 0345#define CURL_CHUNK_BGN_FUNC_FAIL 1 /* tell the lib to end the task */346#define CURL_CHUNK_BGN_FUNC_SKIP 2 /* skip this chunk over */347348/* if splitting of data transfer is enabled, this callback is called before349download of an individual chunk started. Note that parameter "remains" works350only for FTP wildcard downloading (for now), otherwise is not used */351typedef long (*curl_chunk_bgn_callback)(const void *transfer_info,352void *ptr,353int remains);354355/* return codes for CURLOPT_CHUNK_END_FUNCTION */356#define CURL_CHUNK_END_FUNC_OK 0357#define CURL_CHUNK_END_FUNC_FAIL 1 /* tell the lib to end the task */358359/* If splitting of data transfer is enabled this callback is called after360download of an individual chunk finished.361Note! After this callback was set then it have to be called FOR ALL chunks.362Even if downloading of this chunk was skipped in CHUNK_BGN_FUNC.363This is the reason why we do not need "transfer_info" parameter in this364callback and we are not interested in "remains" parameter too. */365typedef long (*curl_chunk_end_callback)(void *ptr);366367/* return codes for FNMATCHFUNCTION */368#define CURL_FNMATCHFUNC_MATCH 0 /* string corresponds to the pattern */369#define CURL_FNMATCHFUNC_NOMATCH 1 /* pattern does not match the string */370#define CURL_FNMATCHFUNC_FAIL 2 /* an error occurred */371372/* callback type for wildcard downloading pattern matching. If the373string matches the pattern, return CURL_FNMATCHFUNC_MATCH value, etc. */374typedef int (*curl_fnmatch_callback)(void *ptr,375const char *pattern,376const char *string);377378/* These are the return codes for the seek callbacks */379#define CURL_SEEKFUNC_OK 0380#define CURL_SEEKFUNC_FAIL 1 /* fail the entire transfer */381#define CURL_SEEKFUNC_CANTSEEK 2 /* tell libcurl seeking cannot be done, so382libcurl might try other means instead */383typedef int (*curl_seek_callback)(void *instream,384curl_off_t offset,385int origin); /* 'whence' */386387/* This is a return code for the read callback that, when returned, will388signal libcurl to immediately abort the current transfer. */389#define CURL_READFUNC_ABORT 0x10000000390/* This is a return code for the read callback that, when returned, will391signal libcurl to pause sending data on the current transfer. */392#define CURL_READFUNC_PAUSE 0x10000001393394/* Return code for when the trailing headers' callback has terminated395without any errors */396#define CURL_TRAILERFUNC_OK 0397/* Return code for when was an error in the trailing header's list and we398want to abort the request */399#define CURL_TRAILERFUNC_ABORT 1400401typedef size_t (*curl_read_callback)(char *buffer,402size_t size,403size_t nitems,404void *instream);405406typedef int (*curl_trailer_callback)(struct curl_slist **list,407void *userdata);408409typedef enum {410CURLSOCKTYPE_IPCXN, /* socket created for a specific IP connection */411CURLSOCKTYPE_ACCEPT, /* socket created by accept() call */412CURLSOCKTYPE_LAST /* never use */413} curlsocktype;414415/* The return code from the sockopt_callback can signal information back416to libcurl: */417#define CURL_SOCKOPT_OK 0418#define CURL_SOCKOPT_ERROR 1 /* causes libcurl to abort and return419CURLE_ABORTED_BY_CALLBACK */420#define CURL_SOCKOPT_ALREADY_CONNECTED 2421422typedef int (*curl_sockopt_callback)(void *clientp,423curl_socket_t curlfd,424curlsocktype purpose);425426struct curl_sockaddr {427int family;428int socktype;429int protocol;430unsigned int addrlen; /* addrlen was a socklen_t type before 7.18.0 but it431turned really ugly and painful on the systems that432lack this type */433struct sockaddr addr;434};435436typedef curl_socket_t437(*curl_opensocket_callback)(void *clientp,438curlsocktype purpose,439struct curl_sockaddr *address);440441typedef int442(*curl_closesocket_callback)(void *clientp, curl_socket_t item);443444typedef enum {445CURLIOE_OK, /* I/O operation successful */446CURLIOE_UNKNOWNCMD, /* command was unknown to callback */447CURLIOE_FAILRESTART, /* failed to restart the read */448CURLIOE_LAST /* never use */449} curlioerr;450451typedef enum {452CURLIOCMD_NOP, /* no operation */453CURLIOCMD_RESTARTREAD, /* restart the read stream from start */454CURLIOCMD_LAST /* never use */455} curliocmd;456457typedef curlioerr (*curl_ioctl_callback)(CURL *handle,458int cmd,459void *clientp);460461#ifndef CURL_DID_MEMORY_FUNC_TYPEDEFS462/*463* The following typedef's are signatures of malloc, free, realloc, strdup and464* calloc respectively. Function pointers of these types can be passed to the465* curl_global_init_mem() function to set user defined memory management466* callback routines.467*/468typedef void *(*curl_malloc_callback)(size_t size);469typedef void (*curl_free_callback)(void *ptr);470typedef void *(*curl_realloc_callback)(void *ptr, size_t size);471typedef char *(*curl_strdup_callback)(const char *str);472typedef void *(*curl_calloc_callback)(size_t nmemb, size_t size);473474#define CURL_DID_MEMORY_FUNC_TYPEDEFS475#endif476477/* the kind of data that is passed to information_callback */478typedef enum {479CURLINFO_TEXT = 0,480CURLINFO_HEADER_IN, /* 1 */481CURLINFO_HEADER_OUT, /* 2 */482CURLINFO_DATA_IN, /* 3 */483CURLINFO_DATA_OUT, /* 4 */484CURLINFO_SSL_DATA_IN, /* 5 */485CURLINFO_SSL_DATA_OUT, /* 6 */486CURLINFO_END487} curl_infotype;488489typedef int (*curl_debug_callback)490(CURL *handle, /* the handle/transfer this concerns */491curl_infotype type, /* what kind of data */492char *data, /* points to the data */493size_t size, /* size of the data pointed to */494void *userptr); /* whatever the user please */495496/* This is the CURLOPT_PREREQFUNCTION callback prototype. */497typedef int (*curl_prereq_callback)(void *clientp,498char *conn_primary_ip,499char *conn_local_ip,500int conn_primary_port,501int conn_local_port);502503/* Return code for when the pre-request callback has terminated without504any errors */505#define CURL_PREREQFUNC_OK 0506/* Return code for when the pre-request callback wants to abort the507request */508#define CURL_PREREQFUNC_ABORT 1509510/* All possible error codes from all sorts of curl functions. Future versions511may return other values, stay prepared.512513Always add new return codes last. Never *EVER* remove any. The return514codes must remain the same!515*/516517typedef enum {518CURLE_OK = 0,519CURLE_UNSUPPORTED_PROTOCOL, /* 1 */520CURLE_FAILED_INIT, /* 2 */521CURLE_URL_MALFORMAT, /* 3 */522CURLE_NOT_BUILT_IN, /* 4 - [was obsoleted in August 2007 for5237.17.0, reused in April 2011 for 7.21.5] */524CURLE_COULDNT_RESOLVE_PROXY, /* 5 */525CURLE_COULDNT_RESOLVE_HOST, /* 6 */526CURLE_COULDNT_CONNECT, /* 7 */527CURLE_WEIRD_SERVER_REPLY, /* 8 */528CURLE_REMOTE_ACCESS_DENIED, /* 9 a service was denied by the server529due to lack of access - when login fails530this is not returned. */531CURLE_FTP_ACCEPT_FAILED, /* 10 - [was obsoleted in April 2006 for5327.15.4, reused in Dec 2011 for 7.24.0]*/533CURLE_FTP_WEIRD_PASS_REPLY, /* 11 */534CURLE_FTP_ACCEPT_TIMEOUT, /* 12 - timeout occurred accepting server535[was obsoleted in August 2007 for 7.17.0,536reused in Dec 2011 for 7.24.0]*/537CURLE_FTP_WEIRD_PASV_REPLY, /* 13 */538CURLE_FTP_WEIRD_227_FORMAT, /* 14 */539CURLE_FTP_CANT_GET_HOST, /* 15 */540CURLE_HTTP2, /* 16 - A problem in the http2 framing layer.541[was obsoleted in August 2007 for 7.17.0,542reused in July 2014 for 7.38.0] */543CURLE_FTP_COULDNT_SET_TYPE, /* 17 */544CURLE_PARTIAL_FILE, /* 18 */545CURLE_FTP_COULDNT_RETR_FILE, /* 19 */546CURLE_OBSOLETE20, /* 20 - NOT USED */547CURLE_QUOTE_ERROR, /* 21 - quote command failure */548CURLE_HTTP_RETURNED_ERROR, /* 22 */549CURLE_WRITE_ERROR, /* 23 */550CURLE_OBSOLETE24, /* 24 - NOT USED */551CURLE_UPLOAD_FAILED, /* 25 - failed upload "command" */552CURLE_READ_ERROR, /* 26 - could not open/read from file */553CURLE_OUT_OF_MEMORY, /* 27 */554CURLE_OPERATION_TIMEDOUT, /* 28 - the timeout time was reached */555CURLE_OBSOLETE29, /* 29 - NOT USED */556CURLE_FTP_PORT_FAILED, /* 30 - FTP PORT operation failed */557CURLE_FTP_COULDNT_USE_REST, /* 31 - the REST command failed */558CURLE_OBSOLETE32, /* 32 - NOT USED */559CURLE_RANGE_ERROR, /* 33 - RANGE "command" did not work */560CURLE_OBSOLETE34, /* 34 */561CURLE_SSL_CONNECT_ERROR, /* 35 - wrong when connecting with SSL */562CURLE_BAD_DOWNLOAD_RESUME, /* 36 - could not resume download */563CURLE_FILE_COULDNT_READ_FILE, /* 37 */564CURLE_LDAP_CANNOT_BIND, /* 38 */565CURLE_LDAP_SEARCH_FAILED, /* 39 */566CURLE_OBSOLETE40, /* 40 - NOT USED */567CURLE_OBSOLETE41, /* 41 - NOT USED starting with 7.53.0 */568CURLE_ABORTED_BY_CALLBACK, /* 42 */569CURLE_BAD_FUNCTION_ARGUMENT, /* 43 */570CURLE_OBSOLETE44, /* 44 - NOT USED */571CURLE_INTERFACE_FAILED, /* 45 - CURLOPT_INTERFACE failed */572CURLE_OBSOLETE46, /* 46 - NOT USED */573CURLE_TOO_MANY_REDIRECTS, /* 47 - catch endless re-direct loops */574CURLE_UNKNOWN_OPTION, /* 48 - User specified an unknown option */575CURLE_SETOPT_OPTION_SYNTAX, /* 49 - Malformed setopt option */576CURLE_OBSOLETE50, /* 50 - NOT USED */577CURLE_OBSOLETE51, /* 51 - NOT USED */578CURLE_GOT_NOTHING, /* 52 - when this is a specific error */579CURLE_SSL_ENGINE_NOTFOUND, /* 53 - SSL crypto engine not found */580CURLE_SSL_ENGINE_SETFAILED, /* 54 - can not set SSL crypto engine as581default */582CURLE_SEND_ERROR, /* 55 - failed sending network data */583CURLE_RECV_ERROR, /* 56 - failure in receiving network data */584CURLE_OBSOLETE57, /* 57 - NOT IN USE */585CURLE_SSL_CERTPROBLEM, /* 58 - problem with the local certificate */586CURLE_SSL_CIPHER, /* 59 - could not use specified cipher */587CURLE_PEER_FAILED_VERIFICATION, /* 60 - peer's certificate or fingerprint588was not verified fine */589CURLE_BAD_CONTENT_ENCODING, /* 61 - Unrecognized/bad encoding */590CURLE_OBSOLETE62, /* 62 - NOT IN USE since 7.82.0 */591CURLE_FILESIZE_EXCEEDED, /* 63 - Maximum file size exceeded */592CURLE_USE_SSL_FAILED, /* 64 - Requested FTP SSL level failed */593CURLE_SEND_FAIL_REWIND, /* 65 - Sending the data requires a rewind594that failed */595CURLE_SSL_ENGINE_INITFAILED, /* 66 - failed to initialise ENGINE */596CURLE_LOGIN_DENIED, /* 67 - user, password or similar was not597accepted and we failed to login */598CURLE_TFTP_NOTFOUND, /* 68 - file not found on server */599CURLE_TFTP_PERM, /* 69 - permission problem on server */600CURLE_REMOTE_DISK_FULL, /* 70 - out of disk space on server */601CURLE_TFTP_ILLEGAL, /* 71 - Illegal TFTP operation */602CURLE_TFTP_UNKNOWNID, /* 72 - Unknown transfer ID */603CURLE_REMOTE_FILE_EXISTS, /* 73 - File already exists */604CURLE_TFTP_NOSUCHUSER, /* 74 - No such user */605CURLE_OBSOLETE75, /* 75 - NOT IN USE since 7.82.0 */606CURLE_OBSOLETE76, /* 76 - NOT IN USE since 7.82.0 */607CURLE_SSL_CACERT_BADFILE, /* 77 - could not load CACERT file, missing608or wrong format */609CURLE_REMOTE_FILE_NOT_FOUND, /* 78 - remote file not found */610CURLE_SSH, /* 79 - error from the SSH layer, somewhat611generic so the error message will be of612interest when this has happened */613614CURLE_SSL_SHUTDOWN_FAILED, /* 80 - Failed to shut down the SSL615connection */616CURLE_AGAIN, /* 81 - socket is not ready for send/recv,617wait till it is ready and try again (Added618in 7.18.2) */619CURLE_SSL_CRL_BADFILE, /* 82 - could not load CRL file, missing or620wrong format (Added in 7.19.0) */621CURLE_SSL_ISSUER_ERROR, /* 83 - Issuer check failed. (Added in6227.19.0) */623CURLE_FTP_PRET_FAILED, /* 84 - a PRET command failed */624CURLE_RTSP_CSEQ_ERROR, /* 85 - mismatch of RTSP CSeq numbers */625CURLE_RTSP_SESSION_ERROR, /* 86 - mismatch of RTSP Session Ids */626CURLE_FTP_BAD_FILE_LIST, /* 87 - unable to parse FTP file list */627CURLE_CHUNK_FAILED, /* 88 - chunk callback reported error */628CURLE_NO_CONNECTION_AVAILABLE, /* 89 - No connection available, the629session will be queued */630CURLE_SSL_PINNEDPUBKEYNOTMATCH, /* 90 - specified pinned public key did not631match */632CURLE_SSL_INVALIDCERTSTATUS, /* 91 - invalid certificate status */633CURLE_HTTP2_STREAM, /* 92 - stream error in HTTP/2 framing layer634*/635CURLE_RECURSIVE_API_CALL, /* 93 - an api function was called from636inside a callback */637CURLE_AUTH_ERROR, /* 94 - an authentication function returned an638error */639CURLE_HTTP3, /* 95 - An HTTP/3 layer problem */640CURLE_QUIC_CONNECT_ERROR, /* 96 - QUIC connection error */641CURLE_PROXY, /* 97 - proxy handshake error */642CURLE_SSL_CLIENTCERT, /* 98 - client-side certificate required */643CURLE_UNRECOVERABLE_POLL, /* 99 - poll/select returned fatal error */644CURLE_TOO_LARGE, /* 100 - a value/data met its maximum */645CURLE_ECH_REQUIRED, /* 101 - ECH tried but failed */646CURL_LAST /* never use! */647} CURLcode;648649#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all650the obsolete stuff removed! */651652/* removed in 7.53.0 */653#define CURLE_FUNCTION_NOT_FOUND CURLE_OBSOLETE41654655/* removed in 7.56.0 */656#define CURLE_HTTP_POST_ERROR CURLE_OBSOLETE34657658/* Previously obsolete error code reused in 7.38.0 */659#define CURLE_OBSOLETE16 CURLE_HTTP2660661/* Previously obsolete error codes reused in 7.24.0 */662#define CURLE_OBSOLETE10 CURLE_FTP_ACCEPT_FAILED663#define CURLE_OBSOLETE12 CURLE_FTP_ACCEPT_TIMEOUT664665/* compatibility with older names */666#define CURLOPT_ENCODING CURLOPT_ACCEPT_ENCODING667#define CURLE_FTP_WEIRD_SERVER_REPLY CURLE_WEIRD_SERVER_REPLY668669/* The following were added in 7.62.0 */670#define CURLE_SSL_CACERT CURLE_PEER_FAILED_VERIFICATION671672/* The following were added in 7.21.5, April 2011 */673#define CURLE_UNKNOWN_TELNET_OPTION CURLE_UNKNOWN_OPTION674675/* Added for 7.78.0 */676#define CURLE_TELNET_OPTION_SYNTAX CURLE_SETOPT_OPTION_SYNTAX677678/* The following were added in 7.17.1 */679/* These are scheduled to disappear by 2009 */680#define CURLE_SSL_PEER_CERTIFICATE CURLE_PEER_FAILED_VERIFICATION681682/* The following were added in 7.17.0 */683/* These are scheduled to disappear by 2009 */684#define CURLE_OBSOLETE CURLE_OBSOLETE50 /* no one should be using this! */685#define CURLE_BAD_PASSWORD_ENTERED CURLE_OBSOLETE46686#define CURLE_BAD_CALLING_ORDER CURLE_OBSOLETE44687#define CURLE_FTP_USER_PASSWORD_INCORRECT CURLE_OBSOLETE10688#define CURLE_FTP_CANT_RECONNECT CURLE_OBSOLETE16689#define CURLE_FTP_COULDNT_GET_SIZE CURLE_OBSOLETE32690#define CURLE_FTP_COULDNT_SET_ASCII CURLE_OBSOLETE29691#define CURLE_FTP_WEIRD_USER_REPLY CURLE_OBSOLETE12692#define CURLE_FTP_WRITE_ERROR CURLE_OBSOLETE20693#define CURLE_LIBRARY_NOT_FOUND CURLE_OBSOLETE40694#define CURLE_MALFORMAT_USER CURLE_OBSOLETE24695#define CURLE_SHARE_IN_USE CURLE_OBSOLETE57696#define CURLE_URL_MALFORMAT_USER CURLE_NOT_BUILT_IN697698#define CURLE_FTP_ACCESS_DENIED CURLE_REMOTE_ACCESS_DENIED699#define CURLE_FTP_COULDNT_SET_BINARY CURLE_FTP_COULDNT_SET_TYPE700#define CURLE_FTP_QUOTE_ERROR CURLE_QUOTE_ERROR701#define CURLE_TFTP_DISKFULL CURLE_REMOTE_DISK_FULL702#define CURLE_TFTP_EXISTS CURLE_REMOTE_FILE_EXISTS703#define CURLE_HTTP_RANGE_ERROR CURLE_RANGE_ERROR704#define CURLE_FTP_SSL_FAILED CURLE_USE_SSL_FAILED705706/* The following were added earlier */707708#define CURLE_OPERATION_TIMEOUTED CURLE_OPERATION_TIMEDOUT709#define CURLE_HTTP_NOT_FOUND CURLE_HTTP_RETURNED_ERROR710#define CURLE_HTTP_PORT_FAILED CURLE_INTERFACE_FAILED711#define CURLE_FTP_COULDNT_STOR_FILE CURLE_UPLOAD_FAILED712#define CURLE_FTP_PARTIAL_FILE CURLE_PARTIAL_FILE713#define CURLE_FTP_BAD_DOWNLOAD_RESUME CURLE_BAD_DOWNLOAD_RESUME714#define CURLE_LDAP_INVALID_URL CURLE_OBSOLETE62715#define CURLE_CONV_REQD CURLE_OBSOLETE76716#define CURLE_CONV_FAILED CURLE_OBSOLETE75717718/* This was the error code 50 in 7.7.3 and a few earlier versions, this719is no longer used by libcurl but is instead #defined here only to not720make programs break */721#define CURLE_ALREADY_COMPLETE 99999722723/* Provide defines for really old option names */724#define CURLOPT_FILE CURLOPT_WRITEDATA /* name changed in 7.9.7 */725#define CURLOPT_INFILE CURLOPT_READDATA /* name changed in 7.9.7 */726#define CURLOPT_WRITEHEADER CURLOPT_HEADERDATA727728/* Since long deprecated options with no code in the lib that does anything729with them. */730#define CURLOPT_WRITEINFO CURLOPT_OBSOLETE40731#define CURLOPT_CLOSEPOLICY CURLOPT_OBSOLETE72732#define CURLOPT_OBSOLETE72 9999733#define CURLOPT_OBSOLETE40 9999734735#endif /* !CURL_NO_OLDIES */736737/*738* Proxy error codes. Returned in CURLINFO_PROXY_ERROR if CURLE_PROXY was739* return for the transfers.740*/741typedef enum {742CURLPX_OK,743CURLPX_BAD_ADDRESS_TYPE,744CURLPX_BAD_VERSION,745CURLPX_CLOSED,746CURLPX_GSSAPI,747CURLPX_GSSAPI_PERMSG,748CURLPX_GSSAPI_PROTECTION,749CURLPX_IDENTD,750CURLPX_IDENTD_DIFFER,751CURLPX_LONG_HOSTNAME,752CURLPX_LONG_PASSWD,753CURLPX_LONG_USER,754CURLPX_NO_AUTH,755CURLPX_RECV_ADDRESS,756CURLPX_RECV_AUTH,757CURLPX_RECV_CONNECT,758CURLPX_RECV_REQACK,759CURLPX_REPLY_ADDRESS_TYPE_NOT_SUPPORTED,760CURLPX_REPLY_COMMAND_NOT_SUPPORTED,761CURLPX_REPLY_CONNECTION_REFUSED,762CURLPX_REPLY_GENERAL_SERVER_FAILURE,763CURLPX_REPLY_HOST_UNREACHABLE,764CURLPX_REPLY_NETWORK_UNREACHABLE,765CURLPX_REPLY_NOT_ALLOWED,766CURLPX_REPLY_TTL_EXPIRED,767CURLPX_REPLY_UNASSIGNED,768CURLPX_REQUEST_FAILED,769CURLPX_RESOLVE_HOST,770CURLPX_SEND_AUTH,771CURLPX_SEND_CONNECT,772CURLPX_SEND_REQUEST,773CURLPX_UNKNOWN_FAIL,774CURLPX_UNKNOWN_MODE,775CURLPX_USER_REJECTED,776CURLPX_LAST /* never use */777} CURLproxycode;778779/* This prototype applies to all conversion callbacks */780typedef CURLcode (*curl_conv_callback)(char *buffer, size_t length);781782typedef CURLcode (*curl_ssl_ctx_callback)(CURL *curl, /* easy handle */783void *ssl_ctx, /* actually an OpenSSL784or wolfSSL SSL_CTX,785or an mbedTLS786mbedtls_ssl_config */787void *userptr);788789#define CURLPROXY_HTTP 0L /* added in 7.10, new in 7.19.4 default is790to use CONNECT HTTP/1.1 */791#define CURLPROXY_HTTP_1_0 1L /* force to use CONNECT HTTP/1.0792added in 7.19.4 */793#define CURLPROXY_HTTPS 2L /* HTTPS but stick to HTTP/1794added in 7.52.0 */795#define CURLPROXY_HTTPS2 3L /* HTTPS and attempt HTTP/2796added in 8.2.0 */797#define CURLPROXY_SOCKS4 4L /* support added in 7.15.2, enum existed798already in 7.10 */799#define CURLPROXY_SOCKS5 5L /* added in 7.10 */800#define CURLPROXY_SOCKS4A 6L /* added in 7.18.0 */801#define CURLPROXY_SOCKS5_HOSTNAME 7L /* Use the SOCKS5 protocol but pass along802the hostname rather than the IP803address. added in 7.18.0 */804805typedef enum {806CURLPROXY_LAST = 8 /* never use */807} curl_proxytype; /* this enum was added in 7.10 */808809/*810* Bitmasks for CURLOPT_HTTPAUTH and CURLOPT_PROXYAUTH options:811*812* CURLAUTH_NONE - No HTTP authentication813* CURLAUTH_BASIC - HTTP Basic authentication (default)814* CURLAUTH_DIGEST - HTTP Digest authentication815* CURLAUTH_NEGOTIATE - HTTP Negotiate (SPNEGO) authentication816* CURLAUTH_GSSNEGOTIATE - Alias for CURLAUTH_NEGOTIATE (deprecated)817* CURLAUTH_NTLM - HTTP NTLM authentication818* CURLAUTH_DIGEST_IE - HTTP Digest authentication with IE flavour819* CURLAUTH_NTLM_WB - HTTP NTLM authentication delegated to winbind helper820* CURLAUTH_BEARER - HTTP Bearer token authentication821* CURLAUTH_ONLY - Use together with a single other type to force no822* authentication or just that single type823* CURLAUTH_ANY - All fine types set824* CURLAUTH_ANYSAFE - All fine types except Basic825*/826827#define CURLAUTH_NONE ((unsigned long)0)828#define CURLAUTH_BASIC (((unsigned long)1) << 0)829#define CURLAUTH_DIGEST (((unsigned long)1) << 1)830#define CURLAUTH_NEGOTIATE (((unsigned long)1) << 2)831/* Deprecated since the advent of CURLAUTH_NEGOTIATE */832#define CURLAUTH_GSSNEGOTIATE CURLAUTH_NEGOTIATE833/* Used for CURLOPT_SOCKS5_AUTH to stay terminologically correct */834#define CURLAUTH_GSSAPI CURLAUTH_NEGOTIATE835#define CURLAUTH_NTLM (((unsigned long)1) << 3)836#define CURLAUTH_DIGEST_IE (((unsigned long)1) << 4)837#ifndef CURL_NO_OLDIES838/* functionality removed since 8.8.0 */839#define CURLAUTH_NTLM_WB (((unsigned long)1) << 5)840#endif841#define CURLAUTH_BEARER (((unsigned long)1) << 6)842#define CURLAUTH_AWS_SIGV4 (((unsigned long)1) << 7)843#define CURLAUTH_ONLY (((unsigned long)1) << 31)844#define CURLAUTH_ANY (~CURLAUTH_DIGEST_IE)845#define CURLAUTH_ANYSAFE (~(CURLAUTH_BASIC | CURLAUTH_DIGEST_IE))846847#define CURLSSH_AUTH_ANY ~0L /* all types supported by server */848#define CURLSSH_AUTH_NONE 0L /* none allowed, silly but complete */849#define CURLSSH_AUTH_PUBLICKEY (1L << 0) /* public/private key files */850#define CURLSSH_AUTH_PASSWORD (1L << 1) /* password */851#define CURLSSH_AUTH_HOST (1L << 2) /* host key files */852#define CURLSSH_AUTH_KEYBOARD (1L << 3) /* keyboard interactive */853#define CURLSSH_AUTH_AGENT (1L << 4) /* agent (ssh-agent, pageant...) */854#define CURLSSH_AUTH_GSSAPI (1L << 5) /* gssapi (kerberos, ...) */855#define CURLSSH_AUTH_DEFAULT CURLSSH_AUTH_ANY856857#define CURLGSSAPI_DELEGATION_NONE 0L /* no delegation (default) */858#define CURLGSSAPI_DELEGATION_POLICY_FLAG (1L<<0) /* if permitted by policy */859#define CURLGSSAPI_DELEGATION_FLAG (1L<<1) /* delegate always */860861#define CURL_ERROR_SIZE 256862863enum curl_khtype {864CURLKHTYPE_UNKNOWN,865CURLKHTYPE_RSA1,866CURLKHTYPE_RSA,867CURLKHTYPE_DSS,868CURLKHTYPE_ECDSA,869CURLKHTYPE_ED25519870};871872struct curl_khkey {873const char *key; /* points to a null-terminated string encoded with base64874if len is zero, otherwise to the "raw" data */875size_t len;876enum curl_khtype keytype;877};878879/* this is the set of return values expected from the curl_sshkeycallback880callback */881enum curl_khstat {882CURLKHSTAT_FINE_ADD_TO_FILE,883CURLKHSTAT_FINE,884CURLKHSTAT_REJECT, /* reject the connection, return an error */885CURLKHSTAT_DEFER, /* do not accept it, but we cannot answer right now.886Causes a CURLE_PEER_FAILED_VERIFICATION error but the887connection will be left intact etc */888CURLKHSTAT_FINE_REPLACE, /* accept and replace the wrong key */889CURLKHSTAT_LAST /* not for use, only a marker for last-in-list */890};891892/* this is the set of status codes pass in to the callback */893enum curl_khmatch {894CURLKHMATCH_OK, /* match */895CURLKHMATCH_MISMATCH, /* host found, key mismatch! */896CURLKHMATCH_MISSING, /* no matching host/key found */897CURLKHMATCH_LAST /* not for use, only a marker for last-in-list */898};899900typedef int901(*curl_sshkeycallback) (CURL *easy, /* easy handle */902const struct curl_khkey *knownkey, /* known */903const struct curl_khkey *foundkey, /* found */904enum curl_khmatch, /* libcurl's view on the keys */905void *clientp); /* custom pointer passed with */906/* CURLOPT_SSH_KEYDATA */907908typedef int909(*curl_sshhostkeycallback) (void *clientp,/* custom pointer passed */910/* with CURLOPT_SSH_HOSTKEYDATA */911int keytype, /* CURLKHTYPE */912const char *key, /* hostkey to check */913size_t keylen); /* length of the key */914/* return CURLE_OK to accept */915/* or something else to refuse */916917/* parameter for the CURLOPT_USE_SSL option */918#define CURLUSESSL_NONE 0L /* do not attempt to use SSL */919#define CURLUSESSL_TRY 1L /* try using SSL, proceed anyway otherwise */920#define CURLUSESSL_CONTROL 2L /* SSL for the control connection or fail */921#define CURLUSESSL_ALL 3L /* SSL for all communication or fail */922923typedef enum {924CURLUSESSL_LAST = 4 /* not an option, never use */925} curl_usessl;926927/* Definition of bits for the CURLOPT_SSL_OPTIONS argument: */928929/* - ALLOW_BEAST tells libcurl to allow the BEAST SSL vulnerability in the930name of improving interoperability with older servers. Some SSL libraries931have introduced work-arounds for this flaw but those work-arounds sometimes932make the SSL communication fail. To regain functionality with those broken933servers, a user can this way allow the vulnerability back. */934#define CURLSSLOPT_ALLOW_BEAST (1L << 0)935936/* - NO_REVOKE tells libcurl to disable certificate revocation checks for those937SSL backends where such behavior is present. */938#define CURLSSLOPT_NO_REVOKE (1L << 1)939940/* - NO_PARTIALCHAIN tells libcurl to *NOT* accept a partial certificate chain941if possible. The OpenSSL backend has this ability. */942#define CURLSSLOPT_NO_PARTIALCHAIN (1L << 2)943944/* - REVOKE_BEST_EFFORT tells libcurl to ignore certificate revocation offline945checks and ignore missing revocation list for those SSL backends where such946behavior is present. */947#define CURLSSLOPT_REVOKE_BEST_EFFORT (1L << 3)948949/* - CURLSSLOPT_NATIVE_CA tells libcurl to use standard certificate store of950operating system. Currently implemented under MS-Windows. */951#define CURLSSLOPT_NATIVE_CA (1L << 4)952953/* - CURLSSLOPT_AUTO_CLIENT_CERT tells libcurl to automatically locate and use954a client certificate for authentication. (Schannel) */955#define CURLSSLOPT_AUTO_CLIENT_CERT (1L << 5)956957/* If possible, send data using TLS 1.3 early data */958#define CURLSSLOPT_EARLYDATA (1L << 6)959960/* The default connection attempt delay in milliseconds for happy eyeballs.961CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS.3 and happy-eyeballs-timeout-ms.d document962this value, keep them in sync. */963#define CURL_HET_DEFAULT 200L964965/* The default connection upkeep interval in milliseconds. */966#define CURL_UPKEEP_INTERVAL_DEFAULT 60000L967968#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all969the obsolete stuff removed! */970971/* Backwards compatibility with older names */972/* These are scheduled to disappear by 2009 */973974#define CURLFTPSSL_NONE CURLUSESSL_NONE975#define CURLFTPSSL_TRY CURLUSESSL_TRY976#define CURLFTPSSL_CONTROL CURLUSESSL_CONTROL977#define CURLFTPSSL_ALL CURLUSESSL_ALL978#define CURLFTPSSL_LAST CURLUSESSL_LAST979#define curl_ftpssl curl_usessl980#endif /* !CURL_NO_OLDIES */981982/* parameter for the CURLOPT_FTP_SSL_CCC option */983#define CURLFTPSSL_CCC_NONE 0L /* do not send CCC */984#define CURLFTPSSL_CCC_PASSIVE 1L /* Let the server initiate the shutdown */985#define CURLFTPSSL_CCC_ACTIVE 2L /* Initiate the shutdown */986987typedef enum {988CURLFTPSSL_CCC_LAST = 3 /* not an option, never use */989} curl_ftpccc;990991/* parameter for the CURLOPT_FTPSSLAUTH option */992#define CURLFTPAUTH_DEFAULT 0L /* let libcurl decide */993#define CURLFTPAUTH_SSL 1L /* use "AUTH SSL" */994#define CURLFTPAUTH_TLS 2L /* use "AUTH TLS" */995996typedef enum {997CURLFTPAUTH_LAST = 3 /* not an option, never use */998} curl_ftpauth;9991000/* parameter for the CURLOPT_FTP_CREATE_MISSING_DIRS option */1001#define CURLFTP_CREATE_DIR_NONE 0L /* do NOT create missing dirs! */1002#define CURLFTP_CREATE_DIR 1L /* (FTP/SFTP) if CWD fails, try MKD and1003then CWD again if MKD succeeded, for1004SFTP this does similar magic */1005#define CURLFTP_CREATE_DIR_RETRY 2L /* (FTP only) if CWD fails, try MKD and1006then CWD again even if MKD failed! */10071008typedef enum {1009CURLFTP_CREATE_DIR_LAST = 3 /* not an option, never use */1010} curl_ftpcreatedir;10111012/* parameter for the CURLOPT_FTP_FILEMETHOD option */1013#define CURLFTPMETHOD_DEFAULT 0L /* let libcurl pick */1014#define CURLFTPMETHOD_MULTICWD 1L /* single CWD operation for each path1015part */1016#define CURLFTPMETHOD_NOCWD 2L /* no CWD at all */1017#define CURLFTPMETHOD_SINGLECWD 3L /* one CWD to full dir, then work on file */10181019typedef enum {1020CURLFTPMETHOD_LAST = 4 /* not an option, never use */1021} curl_ftpmethod;10221023/* bitmask defines for CURLOPT_HEADEROPT */1024#define CURLHEADER_UNIFIED 0L1025#define CURLHEADER_SEPARATE (1L << 0)10261027/* CURLALTSVC_* are bits for the CURLOPT_ALTSVC_CTRL option */1028#define CURLALTSVC_READONLYFILE (1L << 2)1029#define CURLALTSVC_H1 (1L << 3)1030#define CURLALTSVC_H2 (1L << 4)1031#define CURLALTSVC_H3 (1L << 5)10321033/* bitmask values for CURLOPT_UPLOAD_FLAGS */1034#define CURLULFLAG_ANSWERED (1L << 0)1035#define CURLULFLAG_DELETED (1L << 1)1036#define CURLULFLAG_DRAFT (1L << 2)1037#define CURLULFLAG_FLAGGED (1L << 3)1038#define CURLULFLAG_SEEN (1L << 4)10391040struct curl_hstsentry {1041char *name;1042size_t namelen;1043unsigned int includeSubDomains:1;1044char expire[18]; /* YYYYMMDD HH:MM:SS [null-terminated] */1045};10461047struct curl_index {1048size_t index; /* the provided entry's "index" or count */1049size_t total; /* total number of entries to save */1050};10511052typedef enum {1053CURLSTS_OK,1054CURLSTS_DONE,1055CURLSTS_FAIL1056} CURLSTScode;10571058typedef CURLSTScode (*curl_hstsread_callback)(CURL *easy,1059struct curl_hstsentry *e,1060void *userp);1061typedef CURLSTScode (*curl_hstswrite_callback)(CURL *easy,1062struct curl_hstsentry *e,1063struct curl_index *i,1064void *userp);10651066/* CURLHSTS_* are bits for the CURLOPT_HSTS option */1067#define CURLHSTS_ENABLE (1L << 0)1068#define CURLHSTS_READONLYFILE (1L << 1)10691070/* The CURLPROTO_ defines below are for the **deprecated** CURLOPT_*PROTOCOLS1071options. Do not use. */1072#define CURLPROTO_HTTP (1L << 0)1073#define CURLPROTO_HTTPS (1L << 1)1074#define CURLPROTO_FTP (1L << 2)1075#define CURLPROTO_FTPS (1L << 3)1076#define CURLPROTO_SCP (1L << 4)1077#define CURLPROTO_SFTP (1L << 5)1078#define CURLPROTO_TELNET (1L << 6)1079#define CURLPROTO_LDAP (1L << 7)1080#define CURLPROTO_LDAPS (1L << 8)1081#define CURLPROTO_DICT (1L << 9)1082#define CURLPROTO_FILE (1L << 10)1083#define CURLPROTO_TFTP (1L << 11)1084#define CURLPROTO_IMAP (1L << 12)1085#define CURLPROTO_IMAPS (1L << 13)1086#define CURLPROTO_POP3 (1L << 14)1087#define CURLPROTO_POP3S (1L << 15)1088#define CURLPROTO_SMTP (1L << 16)1089#define CURLPROTO_SMTPS (1L << 17)1090#define CURLPROTO_RTSP (1L << 18)1091#define CURLPROTO_RTMP (1L << 19)1092#define CURLPROTO_RTMPT (1L << 20)1093#define CURLPROTO_RTMPE (1L << 21)1094#define CURLPROTO_RTMPTE (1L << 22)1095#define CURLPROTO_RTMPS (1L << 23)1096#define CURLPROTO_RTMPTS (1L << 24)1097#define CURLPROTO_GOPHER (1L << 25)1098#define CURLPROTO_SMB (1L << 26)1099#define CURLPROTO_SMBS (1L << 27)1100#define CURLPROTO_MQTT (1L << 28)1101#define CURLPROTO_GOPHERS (1L << 29)1102#define CURLPROTO_ALL (~0L) /* enable everything */11031104/* long may be 32 or 64 bits, but we should never depend on anything else1105but 32 */1106#define CURLOPTTYPE_LONG 01107#define CURLOPTTYPE_OBJECTPOINT 100001108#define CURLOPTTYPE_FUNCTIONPOINT 200001109#define CURLOPTTYPE_OFF_T 300001110#define CURLOPTTYPE_BLOB 4000011111112/* *STRINGPOINT is an alias for OBJECTPOINT to allow tools to extract the1113string options from the header file */11141115#define CURLOPT(na,t,nu) na = t + nu1116#define CURLOPTDEPRECATED(na,t,nu,v,m) na CURL_DEPRECATED(v,m) = t + nu11171118/* CURLOPT aliases that make no runtime difference */11191120/* 'char *' argument to a string with a trailing zero */1121#define CURLOPTTYPE_STRINGPOINT CURLOPTTYPE_OBJECTPOINT11221123/* 'struct curl_slist *' argument */1124#define CURLOPTTYPE_SLISTPOINT CURLOPTTYPE_OBJECTPOINT11251126/* 'void *' argument passed untouched to callback */1127#define CURLOPTTYPE_CBPOINT CURLOPTTYPE_OBJECTPOINT11281129/* 'long' argument with a set of values/bitmask */1130#define CURLOPTTYPE_VALUES CURLOPTTYPE_LONG11311132/*1133* All CURLOPT_* values.1134*/11351136typedef enum {1137/* This is the FILE * or void * the regular output should be written to. */1138CURLOPT(CURLOPT_WRITEDATA, CURLOPTTYPE_CBPOINT, 1),11391140/* The full URL to get/put */1141CURLOPT(CURLOPT_URL, CURLOPTTYPE_STRINGPOINT, 2),11421143/* Port number to connect to, if other than default. */1144CURLOPT(CURLOPT_PORT, CURLOPTTYPE_LONG, 3),11451146/* Name of proxy to use. */1147CURLOPT(CURLOPT_PROXY, CURLOPTTYPE_STRINGPOINT, 4),11481149/* "user:password;options" to use when fetching. */1150CURLOPT(CURLOPT_USERPWD, CURLOPTTYPE_STRINGPOINT, 5),11511152/* "user:password" to use with proxy. */1153CURLOPT(CURLOPT_PROXYUSERPWD, CURLOPTTYPE_STRINGPOINT, 6),11541155/* Range to get, specified as an ASCII string. */1156CURLOPT(CURLOPT_RANGE, CURLOPTTYPE_STRINGPOINT, 7),11571158/* not used */11591160/* Specified file stream to upload from (use as input): */1161CURLOPT(CURLOPT_READDATA, CURLOPTTYPE_CBPOINT, 9),11621163/* Buffer to receive error messages in, must be at least CURL_ERROR_SIZE1164* bytes big. */1165CURLOPT(CURLOPT_ERRORBUFFER, CURLOPTTYPE_OBJECTPOINT, 10),11661167/* Function that will be called to store the output (instead of fwrite). The1168* parameters will use fwrite() syntax, make sure to follow them. */1169CURLOPT(CURLOPT_WRITEFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 11),11701171/* Function that will be called to read the input (instead of fread). The1172* parameters will use fread() syntax, make sure to follow them. */1173CURLOPT(CURLOPT_READFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 12),11741175/* Time-out the read operation after this amount of seconds */1176CURLOPT(CURLOPT_TIMEOUT, CURLOPTTYPE_LONG, 13),11771178/* If CURLOPT_READDATA is used, this can be used to inform libcurl about1179* how large the file being sent really is. That allows better error1180* checking and better verifies that the upload was successful. -1 means1181* unknown size.1182*1183* For large file support, there is also a _LARGE version of the key1184* which takes an off_t type, allowing platforms with larger off_t1185* sizes to handle larger files. See below for INFILESIZE_LARGE.1186*/1187CURLOPT(CURLOPT_INFILESIZE, CURLOPTTYPE_LONG, 14),11881189/* POST static input fields. */1190CURLOPT(CURLOPT_POSTFIELDS, CURLOPTTYPE_OBJECTPOINT, 15),11911192/* Set the referrer page (needed by some CGIs) */1193CURLOPT(CURLOPT_REFERER, CURLOPTTYPE_STRINGPOINT, 16),11941195/* Set the FTP PORT string (interface name, named or numerical IP address)1196Use i.e '-' to use default address. */1197CURLOPT(CURLOPT_FTPPORT, CURLOPTTYPE_STRINGPOINT, 17),11981199/* Set the User-Agent string (examined by some CGIs) */1200CURLOPT(CURLOPT_USERAGENT, CURLOPTTYPE_STRINGPOINT, 18),12011202/* If the download receives less than "low speed limit" bytes/second1203* during "low speed time" seconds, the operations is aborted.1204* You could i.e if you have a pretty high speed connection, abort if1205* it is less than 2000 bytes/sec during 20 seconds.1206*/12071208/* Set the "low speed limit" */1209CURLOPT(CURLOPT_LOW_SPEED_LIMIT, CURLOPTTYPE_LONG, 19),12101211/* Set the "low speed time" */1212CURLOPT(CURLOPT_LOW_SPEED_TIME, CURLOPTTYPE_LONG, 20),12131214/* Set the continuation offset.1215*1216* Note there is also a _LARGE version of this key which uses1217* off_t types, allowing for large file offsets on platforms which1218* use larger-than-32-bit off_t's. Look below for RESUME_FROM_LARGE.1219*/1220CURLOPT(CURLOPT_RESUME_FROM, CURLOPTTYPE_LONG, 21),12211222/* Set cookie in request: */1223CURLOPT(CURLOPT_COOKIE, CURLOPTTYPE_STRINGPOINT, 22),12241225/* This points to a linked list of headers, struct curl_slist kind. This1226list is also used for RTSP (in spite of its name) */1227CURLOPT(CURLOPT_HTTPHEADER, CURLOPTTYPE_SLISTPOINT, 23),12281229/* This points to a linked list of post entries, struct curl_httppost */1230CURLOPTDEPRECATED(CURLOPT_HTTPPOST, CURLOPTTYPE_OBJECTPOINT, 24,12317.56.0, "Use CURLOPT_MIMEPOST"),12321233/* name of the file keeping your private SSL-certificate */1234CURLOPT(CURLOPT_SSLCERT, CURLOPTTYPE_STRINGPOINT, 25),12351236/* password for the SSL or SSH private key */1237CURLOPT(CURLOPT_KEYPASSWD, CURLOPTTYPE_STRINGPOINT, 26),12381239/* send TYPE parameter? */1240CURLOPT(CURLOPT_CRLF, CURLOPTTYPE_LONG, 27),12411242/* send linked-list of QUOTE commands */1243CURLOPT(CURLOPT_QUOTE, CURLOPTTYPE_SLISTPOINT, 28),12441245/* send FILE * or void * to store headers to, if you use a callback it1246is simply passed to the callback unmodified */1247CURLOPT(CURLOPT_HEADERDATA, CURLOPTTYPE_CBPOINT, 29),12481249/* point to a file to read the initial cookies from, also enables1250"cookie awareness" */1251CURLOPT(CURLOPT_COOKIEFILE, CURLOPTTYPE_STRINGPOINT, 31),12521253/* What version to specifically try to use.1254See CURL_SSLVERSION defines below. */1255CURLOPT(CURLOPT_SSLVERSION, CURLOPTTYPE_VALUES, 32),12561257/* What kind of HTTP time condition to use, see defines */1258CURLOPT(CURLOPT_TIMECONDITION, CURLOPTTYPE_VALUES, 33),12591260/* Time to use with the above condition. Specified in number of seconds1261since 1 Jan 1970 */1262CURLOPT(CURLOPT_TIMEVALUE, CURLOPTTYPE_LONG, 34),12631264/* 35 = OBSOLETE */12651266/* Custom request, for customizing the get command like1267HTTP: DELETE, TRACE and others1268FTP: to use a different list command1269*/1270CURLOPT(CURLOPT_CUSTOMREQUEST, CURLOPTTYPE_STRINGPOINT, 36),12711272/* FILE handle to use instead of stderr */1273CURLOPT(CURLOPT_STDERR, CURLOPTTYPE_OBJECTPOINT, 37),12741275/* 38 is not used */12761277/* send linked-list of post-transfer QUOTE commands */1278CURLOPT(CURLOPT_POSTQUOTE, CURLOPTTYPE_SLISTPOINT, 39),12791280/* 40 is not used */12811282/* talk a lot */1283CURLOPT(CURLOPT_VERBOSE, CURLOPTTYPE_LONG, 41),12841285/* throw the header out too */1286CURLOPT(CURLOPT_HEADER, CURLOPTTYPE_LONG, 42),12871288/* shut off the progress meter */1289CURLOPT(CURLOPT_NOPROGRESS, CURLOPTTYPE_LONG, 43),12901291/* use HEAD to get http document */1292CURLOPT(CURLOPT_NOBODY, CURLOPTTYPE_LONG, 44),12931294/* no output on http error codes >= 400 */1295CURLOPT(CURLOPT_FAILONERROR, CURLOPTTYPE_LONG, 45),12961297/* this is an upload */1298CURLOPT(CURLOPT_UPLOAD, CURLOPTTYPE_LONG, 46),12991300/* HTTP POST method */1301CURLOPT(CURLOPT_POST, CURLOPTTYPE_LONG, 47),13021303/* bare names when listing directories */1304CURLOPT(CURLOPT_DIRLISTONLY, CURLOPTTYPE_LONG, 48),13051306/* Append instead of overwrite on upload! */1307CURLOPT(CURLOPT_APPEND, CURLOPTTYPE_LONG, 50),13081309/* Specify whether to read the user+password from the .netrc or the URL.1310* This must be one of the CURL_NETRC_* enums below. */1311CURLOPT(CURLOPT_NETRC, CURLOPTTYPE_VALUES, 51),13121313/* use Location: Luke! */1314CURLOPT(CURLOPT_FOLLOWLOCATION, CURLOPTTYPE_LONG, 52),13151316/* transfer data in text/ASCII format */1317CURLOPT(CURLOPT_TRANSFERTEXT, CURLOPTTYPE_LONG, 53),13181319/* HTTP PUT */1320CURLOPTDEPRECATED(CURLOPT_PUT, CURLOPTTYPE_LONG, 54,13217.12.1, "Use CURLOPT_UPLOAD"),13221323/* 55 = OBSOLETE */13241325/* DEPRECATED1326* Function that will be called instead of the internal progress display1327* function. This function should be defined as the curl_progress_callback1328* prototype defines. */1329CURLOPTDEPRECATED(CURLOPT_PROGRESSFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 56,13307.32.0, "Use CURLOPT_XFERINFOFUNCTION"),13311332/* Data passed to the CURLOPT_PROGRESSFUNCTION and CURLOPT_XFERINFOFUNCTION1333callbacks */1334CURLOPT(CURLOPT_XFERINFODATA, CURLOPTTYPE_CBPOINT, 57),1335#define CURLOPT_PROGRESSDATA CURLOPT_XFERINFODATA13361337/* We want the referrer field set automatically when following locations */1338CURLOPT(CURLOPT_AUTOREFERER, CURLOPTTYPE_LONG, 58),13391340/* Port of the proxy, can be set in the proxy string as well with:1341"[host]:[port]" */1342CURLOPT(CURLOPT_PROXYPORT, CURLOPTTYPE_LONG, 59),13431344/* size of the POST input data, if strlen() is not good to use */1345CURLOPT(CURLOPT_POSTFIELDSIZE, CURLOPTTYPE_LONG, 60),13461347/* tunnel non-http operations through an HTTP proxy */1348CURLOPT(CURLOPT_HTTPPROXYTUNNEL, CURLOPTTYPE_LONG, 61),13491350/* Set the interface string to use as outgoing network interface */1351CURLOPT(CURLOPT_INTERFACE, CURLOPTTYPE_STRINGPOINT, 62),13521353/* Set the krb4/5 security level, this also enables krb4/5 awareness. This1354* is a string, 'clear', 'safe', 'confidential' or 'private'. If the string1355* is set but does not match one of these, 'private' will be used. */1356CURLOPTDEPRECATED(CURLOPT_KRBLEVEL, CURLOPTTYPE_STRINGPOINT, 63,13578.17.0, "removed"),13581359/* Set if we should verify the peer in ssl handshake, set 1 to verify. */1360CURLOPT(CURLOPT_SSL_VERIFYPEER, CURLOPTTYPE_LONG, 64),13611362/* The CApath or CAfile used to validate the peer certificate1363this option is used only if SSL_VERIFYPEER is true */1364CURLOPT(CURLOPT_CAINFO, CURLOPTTYPE_STRINGPOINT, 65),13651366/* 66 = OBSOLETE */1367/* 67 = OBSOLETE */13681369/* Maximum number of http redirects to follow */1370CURLOPT(CURLOPT_MAXREDIRS, CURLOPTTYPE_LONG, 68),13711372/* Pass a long set to 1 to get the date of the requested document (if1373possible)! Pass a zero to shut it off. */1374CURLOPT(CURLOPT_FILETIME, CURLOPTTYPE_LONG, 69),13751376/* This points to a linked list of telnet options */1377CURLOPT(CURLOPT_TELNETOPTIONS, CURLOPTTYPE_SLISTPOINT, 70),13781379/* Max amount of cached alive connections */1380CURLOPT(CURLOPT_MAXCONNECTS, CURLOPTTYPE_LONG, 71),13811382/* 72 = OBSOLETE */1383/* 73 = OBSOLETE */13841385/* Set to explicitly use a new connection for the upcoming transfer.1386Do not use this unless you are absolutely sure of this, as it makes the1387operation slower and is less friendly for the network. */1388CURLOPT(CURLOPT_FRESH_CONNECT, CURLOPTTYPE_LONG, 74),13891390/* Set to explicitly forbid the upcoming transfer's connection to be reused1391when done. Do not use this unless you are absolutely sure of this, as it1392makes the operation slower and is less friendly for the network. */1393CURLOPT(CURLOPT_FORBID_REUSE, CURLOPTTYPE_LONG, 75),13941395/* Set to a filename that contains random data for libcurl to use to1396seed the random engine when doing SSL connects. */1397CURLOPTDEPRECATED(CURLOPT_RANDOM_FILE, CURLOPTTYPE_STRINGPOINT, 76,13987.84.0, "Serves no purpose anymore"),13991400/* Set to the Entropy Gathering Daemon socket pathname */1401CURLOPTDEPRECATED(CURLOPT_EGDSOCKET, CURLOPTTYPE_STRINGPOINT, 77,14027.84.0, "Serves no purpose anymore"),14031404/* Time-out connect operations after this amount of seconds, if connects are1405OK within this time, then fine... This only aborts the connect phase. */1406CURLOPT(CURLOPT_CONNECTTIMEOUT, CURLOPTTYPE_LONG, 78),14071408/* Function that will be called to store headers (instead of fwrite). The1409* parameters will use fwrite() syntax, make sure to follow them. */1410CURLOPT(CURLOPT_HEADERFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 79),14111412/* Set this to force the HTTP request to get back to GET. Only really usable1413if POST, PUT or a custom request have been used first.1414*/1415CURLOPT(CURLOPT_HTTPGET, CURLOPTTYPE_LONG, 80),14161417/* Set if we should verify the Common name from the peer certificate in ssl1418* handshake, set 1 to check existence, 2 to ensure that it matches the1419* provided hostname. */1420CURLOPT(CURLOPT_SSL_VERIFYHOST, CURLOPTTYPE_LONG, 81),14211422/* Specify which filename to write all known cookies in after completed1423operation. Set filename to "-" (dash) to make it go to stdout. */1424CURLOPT(CURLOPT_COOKIEJAR, CURLOPTTYPE_STRINGPOINT, 82),14251426/* Specify which TLS 1.2 (1.1, 1.0) ciphers to use */1427CURLOPT(CURLOPT_SSL_CIPHER_LIST, CURLOPTTYPE_STRINGPOINT, 83),14281429/* Specify which HTTP version to use! This must be set to one of the1430CURL_HTTP_VERSION* enums set below. */1431CURLOPT(CURLOPT_HTTP_VERSION, CURLOPTTYPE_VALUES, 84),14321433/* Specifically switch on or off the FTP engine's use of the EPSV command. By1434default, that one will always be attempted before the more traditional1435PASV command. */1436CURLOPT(CURLOPT_FTP_USE_EPSV, CURLOPTTYPE_LONG, 85),14371438/* type of the file keeping your SSL-certificate ("DER", "PEM", "ENG") */1439CURLOPT(CURLOPT_SSLCERTTYPE, CURLOPTTYPE_STRINGPOINT, 86),14401441/* name of the file keeping your private SSL-key */1442CURLOPT(CURLOPT_SSLKEY, CURLOPTTYPE_STRINGPOINT, 87),14431444/* type of the file keeping your private SSL-key ("DER", "PEM", "ENG") */1445CURLOPT(CURLOPT_SSLKEYTYPE, CURLOPTTYPE_STRINGPOINT, 88),14461447/* crypto engine for the SSL-sub system */1448CURLOPT(CURLOPT_SSLENGINE, CURLOPTTYPE_STRINGPOINT, 89),14491450/* set the crypto engine for the SSL-sub system as default1451the param has no meaning...1452*/1453CURLOPT(CURLOPT_SSLENGINE_DEFAULT, CURLOPTTYPE_LONG, 90),14541455/* Non-zero value means to use the global dns cache */1456/* DEPRECATED, do not use! */1457CURLOPTDEPRECATED(CURLOPT_DNS_USE_GLOBAL_CACHE, CURLOPTTYPE_LONG, 91,14587.11.1, "Use CURLOPT_SHARE"),14591460/* DNS cache timeout */1461CURLOPT(CURLOPT_DNS_CACHE_TIMEOUT, CURLOPTTYPE_LONG, 92),14621463/* send linked-list of pre-transfer QUOTE commands */1464CURLOPT(CURLOPT_PREQUOTE, CURLOPTTYPE_SLISTPOINT, 93),14651466/* set the debug function */1467CURLOPT(CURLOPT_DEBUGFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 94),14681469/* set the data for the debug function */1470CURLOPT(CURLOPT_DEBUGDATA, CURLOPTTYPE_CBPOINT, 95),14711472/* mark this as start of a cookie session */1473CURLOPT(CURLOPT_COOKIESESSION, CURLOPTTYPE_LONG, 96),14741475/* The CApath directory used to validate the peer certificate1476this option is used only if SSL_VERIFYPEER is true */1477CURLOPT(CURLOPT_CAPATH, CURLOPTTYPE_STRINGPOINT, 97),14781479/* Instruct libcurl to use a smaller receive buffer */1480CURLOPT(CURLOPT_BUFFERSIZE, CURLOPTTYPE_LONG, 98),14811482/* Instruct libcurl to not use any signal/alarm handlers, even when using1483timeouts. This option is useful for multi-threaded applications.1484See libcurl-the-guide for more background information. */1485CURLOPT(CURLOPT_NOSIGNAL, CURLOPTTYPE_LONG, 99),14861487/* Provide a CURLShare for mutexing non-ts data */1488CURLOPT(CURLOPT_SHARE, CURLOPTTYPE_OBJECTPOINT, 100),14891490/* indicates type of proxy. accepted values are CURLPROXY_HTTP (default),1491CURLPROXY_HTTPS, CURLPROXY_SOCKS4, CURLPROXY_SOCKS4A and1492CURLPROXY_SOCKS5. */1493CURLOPT(CURLOPT_PROXYTYPE, CURLOPTTYPE_VALUES, 101),14941495/* Set the Accept-Encoding string. Use this to tell a server you would like1496the response to be compressed. Before 7.21.6, this was known as1497CURLOPT_ENCODING */1498CURLOPT(CURLOPT_ACCEPT_ENCODING, CURLOPTTYPE_STRINGPOINT, 102),14991500/* Set pointer to private data */1501CURLOPT(CURLOPT_PRIVATE, CURLOPTTYPE_OBJECTPOINT, 103),15021503/* Set aliases for HTTP 200 in the HTTP Response header */1504CURLOPT(CURLOPT_HTTP200ALIASES, CURLOPTTYPE_SLISTPOINT, 104),15051506/* Continue to send authentication (user+password) when following locations,1507even when hostname changed. This can potentially send off the name1508and password to whatever host the server decides. */1509CURLOPT(CURLOPT_UNRESTRICTED_AUTH, CURLOPTTYPE_LONG, 105),15101511/* Specifically switch on or off the FTP engine's use of the EPRT command (1512it also disables the LPRT attempt). By default, those ones will always be1513attempted before the good old traditional PORT command. */1514CURLOPT(CURLOPT_FTP_USE_EPRT, CURLOPTTYPE_LONG, 106),15151516/* Set this to a bitmask value to enable the particular authentications1517methods you like. Use this in combination with CURLOPT_USERPWD.1518Note that setting multiple bits may cause extra network round-trips. */1519CURLOPT(CURLOPT_HTTPAUTH, CURLOPTTYPE_VALUES, 107),15201521/* Set the ssl context callback function, currently only for OpenSSL or1522wolfSSL ssl_ctx, or mbedTLS mbedtls_ssl_config in the second argument.1523The function must match the curl_ssl_ctx_callback prototype. */1524CURLOPT(CURLOPT_SSL_CTX_FUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 108),15251526/* Set the userdata for the ssl context callback function's third1527argument */1528CURLOPT(CURLOPT_SSL_CTX_DATA, CURLOPTTYPE_CBPOINT, 109),15291530/* FTP Option that causes missing dirs to be created on the remote server.1531In 7.19.4 we introduced the convenience enums for this option using the1532CURLFTP_CREATE_DIR prefix.1533*/1534CURLOPT(CURLOPT_FTP_CREATE_MISSING_DIRS, CURLOPTTYPE_LONG, 110),15351536/* Set this to a bitmask value to enable the particular authentications1537methods you like. Use this in combination with CURLOPT_PROXYUSERPWD.1538Note that setting multiple bits may cause extra network round-trips. */1539CURLOPT(CURLOPT_PROXYAUTH, CURLOPTTYPE_VALUES, 111),15401541/* Option that changes the timeout, in seconds, associated with getting a1542response. This is different from transfer timeout time and essentially1543places a demand on the server to acknowledge commands in a timely1544manner. For FTP, SMTP, IMAP and POP3. */1545CURLOPT(CURLOPT_SERVER_RESPONSE_TIMEOUT, CURLOPTTYPE_LONG, 112),15461547/* Set this option to one of the CURL_IPRESOLVE_* defines (see below) to1548tell libcurl to use those IP versions only. This only has effect on1549systems with support for more than one, i.e IPv4 _and_ IPv6. */1550CURLOPT(CURLOPT_IPRESOLVE, CURLOPTTYPE_VALUES, 113),15511552/* Set this option to limit the size of a file that will be downloaded from1553an HTTP or FTP server.15541555Note there is also _LARGE version which adds large file support for1556platforms which have larger off_t sizes. See MAXFILESIZE_LARGE below. */1557CURLOPT(CURLOPT_MAXFILESIZE, CURLOPTTYPE_LONG, 114),15581559/* See the comment for INFILESIZE above, but in short, specifies1560* the size of the file being uploaded. -1 means unknown.1561*/1562CURLOPT(CURLOPT_INFILESIZE_LARGE, CURLOPTTYPE_OFF_T, 115),15631564/* Sets the continuation offset. There is also a CURLOPTTYPE_LONG version1565* of this; look above for RESUME_FROM.1566*/1567CURLOPT(CURLOPT_RESUME_FROM_LARGE, CURLOPTTYPE_OFF_T, 116),15681569/* Sets the maximum size of data that will be downloaded from1570* an HTTP or FTP server. See MAXFILESIZE above for the LONG version.1571*/1572CURLOPT(CURLOPT_MAXFILESIZE_LARGE, CURLOPTTYPE_OFF_T, 117),15731574/* Set this option to the filename of your .netrc file you want libcurl1575to parse (using the CURLOPT_NETRC option). If not set, libcurl will do1576a poor attempt to find the user's home directory and check for a .netrc1577file in there. */1578CURLOPT(CURLOPT_NETRC_FILE, CURLOPTTYPE_STRINGPOINT, 118),15791580/* Enable SSL/TLS for FTP, pick one of:1581CURLUSESSL_TRY - try using SSL, proceed anyway otherwise1582CURLUSESSL_CONTROL - SSL for the control connection or fail1583CURLUSESSL_ALL - SSL for all communication or fail1584*/1585CURLOPT(CURLOPT_USE_SSL, CURLOPTTYPE_VALUES, 119),15861587/* The _LARGE version of the standard POSTFIELDSIZE option */1588CURLOPT(CURLOPT_POSTFIELDSIZE_LARGE, CURLOPTTYPE_OFF_T, 120),15891590/* Enable/disable the TCP Nagle algorithm */1591CURLOPT(CURLOPT_TCP_NODELAY, CURLOPTTYPE_LONG, 121),15921593/* 122 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */1594/* 123 OBSOLETE. Gone in 7.16.0 */1595/* 124 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */1596/* 125 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */1597/* 126 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */1598/* 127 OBSOLETE. Gone in 7.16.0 */1599/* 128 OBSOLETE. Gone in 7.16.0 */16001601/* When FTP over SSL/TLS is selected (with CURLOPT_USE_SSL), this option1602can be used to change libcurl's default action which is to first try1603"AUTH SSL" and then "AUTH TLS" in this order, and proceed when a OK1604response has been received.16051606Available parameters are:1607CURLFTPAUTH_DEFAULT - let libcurl decide1608CURLFTPAUTH_SSL - try "AUTH SSL" first, then TLS1609CURLFTPAUTH_TLS - try "AUTH TLS" first, then SSL1610*/1611CURLOPT(CURLOPT_FTPSSLAUTH, CURLOPTTYPE_VALUES, 129),16121613CURLOPTDEPRECATED(CURLOPT_IOCTLFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 130,16147.18.0, "Use CURLOPT_SEEKFUNCTION"),1615CURLOPTDEPRECATED(CURLOPT_IOCTLDATA, CURLOPTTYPE_CBPOINT, 131,16167.18.0, "Use CURLOPT_SEEKDATA"),16171618/* 132 OBSOLETE. Gone in 7.16.0 */1619/* 133 OBSOLETE. Gone in 7.16.0 */16201621/* null-terminated string for pass on to the FTP server when asked for1622"account" info */1623CURLOPT(CURLOPT_FTP_ACCOUNT, CURLOPTTYPE_STRINGPOINT, 134),16241625/* feed cookie into cookie engine */1626CURLOPT(CURLOPT_COOKIELIST, CURLOPTTYPE_STRINGPOINT, 135),16271628/* ignore Content-Length */1629CURLOPT(CURLOPT_IGNORE_CONTENT_LENGTH, CURLOPTTYPE_LONG, 136),16301631/* Set to non-zero to skip the IP address received in a 227 PASV FTP server1632response. Typically used for FTP-SSL purposes but is not restricted to1633that. libcurl will then instead use the same IP address it used for the1634control connection. */1635CURLOPT(CURLOPT_FTP_SKIP_PASV_IP, CURLOPTTYPE_LONG, 137),16361637/* Select "file method" to use when doing FTP, see the curl_ftpmethod1638above. */1639CURLOPT(CURLOPT_FTP_FILEMETHOD, CURLOPTTYPE_VALUES, 138),16401641/* Local port number to bind the socket to */1642CURLOPT(CURLOPT_LOCALPORT, CURLOPTTYPE_LONG, 139),16431644/* Number of ports to try, including the first one set with LOCALPORT.1645Thus, setting it to 1 will make no additional attempts but the first.1646*/1647CURLOPT(CURLOPT_LOCALPORTRANGE, CURLOPTTYPE_LONG, 140),16481649/* no transfer, set up connection and let application use the socket by1650extracting it with CURLINFO_LASTSOCKET */1651CURLOPT(CURLOPT_CONNECT_ONLY, CURLOPTTYPE_LONG, 141),16521653/* Function that will be called to convert from the1654network encoding (instead of using the iconv calls in libcurl) */1655CURLOPTDEPRECATED(CURLOPT_CONV_FROM_NETWORK_FUNCTION,1656CURLOPTTYPE_FUNCTIONPOINT, 142,16577.82.0, "Serves no purpose anymore"),16581659/* Function that will be called to convert to the1660network encoding (instead of using the iconv calls in libcurl) */1661CURLOPTDEPRECATED(CURLOPT_CONV_TO_NETWORK_FUNCTION,1662CURLOPTTYPE_FUNCTIONPOINT, 143,16637.82.0, "Serves no purpose anymore"),16641665/* Function that will be called to convert from UTF81666(instead of using the iconv calls in libcurl)1667Note that this is used only for SSL certificate processing */1668CURLOPTDEPRECATED(CURLOPT_CONV_FROM_UTF8_FUNCTION,1669CURLOPTTYPE_FUNCTIONPOINT, 144,16707.82.0, "Serves no purpose anymore"),16711672/* if the connection proceeds too quickly then need to slow it down */1673/* limit-rate: maximum number of bytes per second to send or receive */1674CURLOPT(CURLOPT_MAX_SEND_SPEED_LARGE, CURLOPTTYPE_OFF_T, 145),1675CURLOPT(CURLOPT_MAX_RECV_SPEED_LARGE, CURLOPTTYPE_OFF_T, 146),16761677/* Pointer to command string to send if USER/PASS fails. */1678CURLOPT(CURLOPT_FTP_ALTERNATIVE_TO_USER, CURLOPTTYPE_STRINGPOINT, 147),16791680/* callback function for setting socket options */1681CURLOPT(CURLOPT_SOCKOPTFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 148),1682CURLOPT(CURLOPT_SOCKOPTDATA, CURLOPTTYPE_CBPOINT, 149),16831684/* set to 0 to disable session ID reuse for this transfer, default is1685enabled (== 1) */1686CURLOPT(CURLOPT_SSL_SESSIONID_CACHE, CURLOPTTYPE_LONG, 150),16871688/* allowed SSH authentication methods */1689CURLOPT(CURLOPT_SSH_AUTH_TYPES, CURLOPTTYPE_VALUES, 151),16901691/* Used by scp/sftp to do public/private key authentication */1692CURLOPT(CURLOPT_SSH_PUBLIC_KEYFILE, CURLOPTTYPE_STRINGPOINT, 152),1693CURLOPT(CURLOPT_SSH_PRIVATE_KEYFILE, CURLOPTTYPE_STRINGPOINT, 153),16941695/* Send CCC (Clear Command Channel) after authentication */1696CURLOPT(CURLOPT_FTP_SSL_CCC, CURLOPTTYPE_LONG, 154),16971698/* Same as TIMEOUT and CONNECTTIMEOUT, but with ms resolution */1699CURLOPT(CURLOPT_TIMEOUT_MS, CURLOPTTYPE_LONG, 155),1700CURLOPT(CURLOPT_CONNECTTIMEOUT_MS, CURLOPTTYPE_LONG, 156),17011702/* set to zero to disable the libcurl's decoding and thus pass the raw body1703data to the application even when it is encoded/compressed */1704CURLOPT(CURLOPT_HTTP_TRANSFER_DECODING, CURLOPTTYPE_LONG, 157),1705CURLOPT(CURLOPT_HTTP_CONTENT_DECODING, CURLOPTTYPE_LONG, 158),17061707/* Permission used when creating new files and directories on the remote1708server for protocols that support it, SFTP/SCP/FILE */1709CURLOPT(CURLOPT_NEW_FILE_PERMS, CURLOPTTYPE_LONG, 159),1710CURLOPT(CURLOPT_NEW_DIRECTORY_PERMS, CURLOPTTYPE_LONG, 160),17111712/* Set the behavior of POST when redirecting. Values must be set to one1713of CURL_REDIR* defines below. This used to be called CURLOPT_POST301 */1714CURLOPT(CURLOPT_POSTREDIR, CURLOPTTYPE_VALUES, 161),17151716/* used by scp/sftp to verify the host's public key */1717CURLOPT(CURLOPT_SSH_HOST_PUBLIC_KEY_MD5, CURLOPTTYPE_STRINGPOINT, 162),17181719/* Callback function for opening socket (instead of socket(2)). Optionally,1720callback is able change the address or refuse to connect returning1721CURL_SOCKET_BAD. The callback should have type1722curl_opensocket_callback */1723CURLOPT(CURLOPT_OPENSOCKETFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 163),1724CURLOPT(CURLOPT_OPENSOCKETDATA, CURLOPTTYPE_CBPOINT, 164),17251726/* POST volatile input fields. */1727CURLOPT(CURLOPT_COPYPOSTFIELDS, CURLOPTTYPE_OBJECTPOINT, 165),17281729/* set transfer mode (;type=<a|i>) when doing FTP via an HTTP proxy */1730CURLOPT(CURLOPT_PROXY_TRANSFER_MODE, CURLOPTTYPE_LONG, 166),17311732/* Callback function for seeking in the input stream */1733CURLOPT(CURLOPT_SEEKFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 167),1734CURLOPT(CURLOPT_SEEKDATA, CURLOPTTYPE_CBPOINT, 168),17351736/* CRL file */1737CURLOPT(CURLOPT_CRLFILE, CURLOPTTYPE_STRINGPOINT, 169),17381739/* Issuer certificate */1740CURLOPT(CURLOPT_ISSUERCERT, CURLOPTTYPE_STRINGPOINT, 170),17411742/* (IPv6) Address scope */1743CURLOPT(CURLOPT_ADDRESS_SCOPE, CURLOPTTYPE_LONG, 171),17441745/* Collect certificate chain info and allow it to get retrievable with1746CURLINFO_CERTINFO after the transfer is complete. */1747CURLOPT(CURLOPT_CERTINFO, CURLOPTTYPE_LONG, 172),17481749/* "name" and "pwd" to use when fetching. */1750CURLOPT(CURLOPT_USERNAME, CURLOPTTYPE_STRINGPOINT, 173),1751CURLOPT(CURLOPT_PASSWORD, CURLOPTTYPE_STRINGPOINT, 174),17521753/* "name" and "pwd" to use with Proxy when fetching. */1754CURLOPT(CURLOPT_PROXYUSERNAME, CURLOPTTYPE_STRINGPOINT, 175),1755CURLOPT(CURLOPT_PROXYPASSWORD, CURLOPTTYPE_STRINGPOINT, 176),17561757/* Comma separated list of hostnames defining no-proxy zones. These should1758match both hostnames directly, and hostnames within a domain. For1759example, local.com will match local.com and www.local.com, but NOT1760notlocal.com or www.notlocal.com. For compatibility with other1761implementations of this, .local.com will be considered to be the same as1762local.com. A single * is the only valid wildcard, and effectively1763disables the use of proxy. */1764CURLOPT(CURLOPT_NOPROXY, CURLOPTTYPE_STRINGPOINT, 177),17651766/* block size for TFTP transfers */1767CURLOPT(CURLOPT_TFTP_BLKSIZE, CURLOPTTYPE_LONG, 178),17681769/* Socks Service */1770/* DEPRECATED, do not use! */1771CURLOPTDEPRECATED(CURLOPT_SOCKS5_GSSAPI_SERVICE,1772CURLOPTTYPE_STRINGPOINT, 179,17737.49.0, "Use CURLOPT_PROXY_SERVICE_NAME"),17741775/* Socks Service */1776CURLOPT(CURLOPT_SOCKS5_GSSAPI_NEC, CURLOPTTYPE_LONG, 180),17771778/* set the bitmask for the protocols that are allowed to be used for the1779transfer, which thus helps the app which takes URLs from users or other1780external inputs and want to restrict what protocol(s) to deal1781with. Defaults to CURLPROTO_ALL. */1782CURLOPTDEPRECATED(CURLOPT_PROTOCOLS, CURLOPTTYPE_LONG, 181,17837.85.0, "Use CURLOPT_PROTOCOLS_STR"),17841785/* set the bitmask for the protocols that libcurl is allowed to follow to,1786as a subset of the CURLOPT_PROTOCOLS ones. That means the protocol needs1787to be set in both bitmasks to be allowed to get redirected to. */1788CURLOPTDEPRECATED(CURLOPT_REDIR_PROTOCOLS, CURLOPTTYPE_LONG, 182,17897.85.0, "Use CURLOPT_REDIR_PROTOCOLS_STR"),17901791/* set the SSH knownhost filename to use */1792CURLOPT(CURLOPT_SSH_KNOWNHOSTS, CURLOPTTYPE_STRINGPOINT, 183),17931794/* set the SSH host key callback, must point to a curl_sshkeycallback1795function */1796CURLOPT(CURLOPT_SSH_KEYFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 184),17971798/* set the SSH host key callback custom pointer */1799CURLOPT(CURLOPT_SSH_KEYDATA, CURLOPTTYPE_CBPOINT, 185),18001801/* set the SMTP mail originator */1802CURLOPT(CURLOPT_MAIL_FROM, CURLOPTTYPE_STRINGPOINT, 186),18031804/* set the list of SMTP mail receiver(s) */1805CURLOPT(CURLOPT_MAIL_RCPT, CURLOPTTYPE_SLISTPOINT, 187),18061807/* FTP: send PRET before PASV */1808CURLOPT(CURLOPT_FTP_USE_PRET, CURLOPTTYPE_LONG, 188),18091810/* RTSP request method (OPTIONS, SETUP, PLAY, etc...) */1811CURLOPT(CURLOPT_RTSP_REQUEST, CURLOPTTYPE_VALUES, 189),18121813/* The RTSP session identifier */1814CURLOPT(CURLOPT_RTSP_SESSION_ID, CURLOPTTYPE_STRINGPOINT, 190),18151816/* The RTSP stream URI */1817CURLOPT(CURLOPT_RTSP_STREAM_URI, CURLOPTTYPE_STRINGPOINT, 191),18181819/* The Transport: header to use in RTSP requests */1820CURLOPT(CURLOPT_RTSP_TRANSPORT, CURLOPTTYPE_STRINGPOINT, 192),18211822/* Manually initialize the client RTSP CSeq for this handle */1823CURLOPT(CURLOPT_RTSP_CLIENT_CSEQ, CURLOPTTYPE_LONG, 193),18241825/* Manually initialize the server RTSP CSeq for this handle */1826CURLOPT(CURLOPT_RTSP_SERVER_CSEQ, CURLOPTTYPE_LONG, 194),18271828/* The stream to pass to INTERLEAVEFUNCTION. */1829CURLOPT(CURLOPT_INTERLEAVEDATA, CURLOPTTYPE_CBPOINT, 195),18301831/* Let the application define a custom write method for RTP data */1832CURLOPT(CURLOPT_INTERLEAVEFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 196),18331834/* Turn on wildcard matching */1835CURLOPT(CURLOPT_WILDCARDMATCH, CURLOPTTYPE_LONG, 197),18361837/* Directory matching callback called before downloading of an1838individual file (chunk) started */1839CURLOPT(CURLOPT_CHUNK_BGN_FUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 198),18401841/* Directory matching callback called after the file (chunk)1842was downloaded, or skipped */1843CURLOPT(CURLOPT_CHUNK_END_FUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 199),18441845/* Change match (fnmatch-like) callback for wildcard matching */1846CURLOPT(CURLOPT_FNMATCH_FUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 200),18471848/* Let the application define custom chunk data pointer */1849CURLOPT(CURLOPT_CHUNK_DATA, CURLOPTTYPE_CBPOINT, 201),18501851/* FNMATCH_FUNCTION user pointer */1852CURLOPT(CURLOPT_FNMATCH_DATA, CURLOPTTYPE_CBPOINT, 202),18531854/* send linked-list of name:port:address sets */1855CURLOPT(CURLOPT_RESOLVE, CURLOPTTYPE_SLISTPOINT, 203),18561857/* Set a username for authenticated TLS */1858CURLOPT(CURLOPT_TLSAUTH_USERNAME, CURLOPTTYPE_STRINGPOINT, 204),18591860/* Set a password for authenticated TLS */1861CURLOPT(CURLOPT_TLSAUTH_PASSWORD, CURLOPTTYPE_STRINGPOINT, 205),18621863/* Set authentication type for authenticated TLS */1864CURLOPT(CURLOPT_TLSAUTH_TYPE, CURLOPTTYPE_STRINGPOINT, 206),18651866/* Set to 1 to enable the "TE:" header in HTTP requests to ask for1867compressed transfer-encoded responses. Set to 0 to disable the use of TE:1868in outgoing requests. The current default is 0, but it might change in a1869future libcurl release.18701871libcurl will ask for the compressed methods it knows of, and if that1872is not any, it will not ask for transfer-encoding at all even if this1873option is set to 1. */1874CURLOPT(CURLOPT_TRANSFER_ENCODING, CURLOPTTYPE_LONG, 207),18751876/* Callback function for closing socket (instead of close(2)). The callback1877should have type curl_closesocket_callback */1878CURLOPT(CURLOPT_CLOSESOCKETFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 208),1879CURLOPT(CURLOPT_CLOSESOCKETDATA, CURLOPTTYPE_CBPOINT, 209),18801881/* allow GSSAPI credential delegation */1882CURLOPT(CURLOPT_GSSAPI_DELEGATION, CURLOPTTYPE_VALUES, 210),18831884/* Set the name servers to use for DNS resolution.1885* Only supported by the c-ares DNS backend */1886CURLOPT(CURLOPT_DNS_SERVERS, CURLOPTTYPE_STRINGPOINT, 211),18871888/* Time-out accept operations (currently for FTP only) after this amount1889of milliseconds. */1890CURLOPT(CURLOPT_ACCEPTTIMEOUT_MS, CURLOPTTYPE_LONG, 212),18911892/* Set TCP keepalive */1893CURLOPT(CURLOPT_TCP_KEEPALIVE, CURLOPTTYPE_LONG, 213),18941895/* non-universal keepalive knobs (Linux, AIX, HP-UX, more) */1896CURLOPT(CURLOPT_TCP_KEEPIDLE, CURLOPTTYPE_LONG, 214),1897CURLOPT(CURLOPT_TCP_KEEPINTVL, CURLOPTTYPE_LONG, 215),18981899/* Enable/disable specific SSL features with a bitmask, see CURLSSLOPT_* */1900CURLOPT(CURLOPT_SSL_OPTIONS, CURLOPTTYPE_VALUES, 216),19011902/* Set the SMTP auth originator */1903CURLOPT(CURLOPT_MAIL_AUTH, CURLOPTTYPE_STRINGPOINT, 217),19041905/* Enable/disable SASL initial response */1906CURLOPT(CURLOPT_SASL_IR, CURLOPTTYPE_LONG, 218),19071908/* Function that will be called instead of the internal progress display1909* function. This function should be defined as the curl_xferinfo_callback1910* prototype defines. (Deprecates CURLOPT_PROGRESSFUNCTION) */1911CURLOPT(CURLOPT_XFERINFOFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 219),19121913/* The XOAUTH2 bearer token */1914CURLOPT(CURLOPT_XOAUTH2_BEARER, CURLOPTTYPE_STRINGPOINT, 220),19151916/* Set the interface string to use as outgoing network1917* interface for DNS requests.1918* Only supported by the c-ares DNS backend */1919CURLOPT(CURLOPT_DNS_INTERFACE, CURLOPTTYPE_STRINGPOINT, 221),19201921/* Set the local IPv4 address to use for outgoing DNS requests.1922* Only supported by the c-ares DNS backend */1923CURLOPT(CURLOPT_DNS_LOCAL_IP4, CURLOPTTYPE_STRINGPOINT, 222),19241925/* Set the local IPv6 address to use for outgoing DNS requests.1926* Only supported by the c-ares DNS backend */1927CURLOPT(CURLOPT_DNS_LOCAL_IP6, CURLOPTTYPE_STRINGPOINT, 223),19281929/* Set authentication options directly */1930CURLOPT(CURLOPT_LOGIN_OPTIONS, CURLOPTTYPE_STRINGPOINT, 224),19311932/* Enable/disable TLS NPN extension (http2 over ssl might fail without) */1933CURLOPTDEPRECATED(CURLOPT_SSL_ENABLE_NPN, CURLOPTTYPE_LONG, 225,19347.86.0, "Has no function"),19351936/* Enable/disable TLS ALPN extension (http2 over ssl might fail without) */1937CURLOPT(CURLOPT_SSL_ENABLE_ALPN, CURLOPTTYPE_LONG, 226),19381939/* Time to wait for a response to an HTTP request containing an1940* Expect: 100-continue header before sending the data anyway. */1941CURLOPT(CURLOPT_EXPECT_100_TIMEOUT_MS, CURLOPTTYPE_LONG, 227),19421943/* This points to a linked list of headers used for proxy requests only,1944struct curl_slist kind */1945CURLOPT(CURLOPT_PROXYHEADER, CURLOPTTYPE_SLISTPOINT, 228),19461947/* Pass in a bitmask of "header options" */1948CURLOPT(CURLOPT_HEADEROPT, CURLOPTTYPE_VALUES, 229),19491950/* The public key used to validate the peer public key */1951CURLOPT(CURLOPT_PINNEDPUBLICKEY, CURLOPTTYPE_STRINGPOINT, 230),19521953/* Path to Unix domain socket */1954CURLOPT(CURLOPT_UNIX_SOCKET_PATH, CURLOPTTYPE_STRINGPOINT, 231),19551956/* Set if we should verify the certificate status. */1957CURLOPT(CURLOPT_SSL_VERIFYSTATUS, CURLOPTTYPE_LONG, 232),19581959/* Set if we should enable TLS false start. */1960CURLOPTDEPRECATED(CURLOPT_SSL_FALSESTART, CURLOPTTYPE_LONG, 233,19618.15.0, "Has no function"),19621963/* Do not squash dot-dot sequences */1964CURLOPT(CURLOPT_PATH_AS_IS, CURLOPTTYPE_LONG, 234),19651966/* Proxy Service Name */1967CURLOPT(CURLOPT_PROXY_SERVICE_NAME, CURLOPTTYPE_STRINGPOINT, 235),19681969/* Service Name */1970CURLOPT(CURLOPT_SERVICE_NAME, CURLOPTTYPE_STRINGPOINT, 236),19711972/* Wait/do not wait for pipe/mutex to clarify */1973CURLOPT(CURLOPT_PIPEWAIT, CURLOPTTYPE_LONG, 237),19741975/* Set the protocol used when curl is given a URL without a protocol */1976CURLOPT(CURLOPT_DEFAULT_PROTOCOL, CURLOPTTYPE_STRINGPOINT, 238),19771978/* Set stream weight, 1 - 256 (default is 16) */1979CURLOPT(CURLOPT_STREAM_WEIGHT, CURLOPTTYPE_LONG, 239),19801981/* Set stream dependency on another curl handle */1982CURLOPT(CURLOPT_STREAM_DEPENDS, CURLOPTTYPE_OBJECTPOINT, 240),19831984/* Set E-xclusive stream dependency on another curl handle */1985CURLOPT(CURLOPT_STREAM_DEPENDS_E, CURLOPTTYPE_OBJECTPOINT, 241),19861987/* Do not send any tftp option requests to the server */1988CURLOPT(CURLOPT_TFTP_NO_OPTIONS, CURLOPTTYPE_LONG, 242),19891990/* Linked-list of host:port:connect-to-host:connect-to-port,1991overrides the URL's host:port (only for the network layer) */1992CURLOPT(CURLOPT_CONNECT_TO, CURLOPTTYPE_SLISTPOINT, 243),19931994/* Set TCP Fast Open */1995CURLOPT(CURLOPT_TCP_FASTOPEN, CURLOPTTYPE_LONG, 244),19961997/* Continue to send data if the server responds early with an1998* HTTP status code >= 300 */1999CURLOPT(CURLOPT_KEEP_SENDING_ON_ERROR, CURLOPTTYPE_LONG, 245),20002001/* The CApath or CAfile used to validate the proxy certificate2002this option is used only if PROXY_SSL_VERIFYPEER is true */2003CURLOPT(CURLOPT_PROXY_CAINFO, CURLOPTTYPE_STRINGPOINT, 246),20042005/* The CApath directory used to validate the proxy certificate2006this option is used only if PROXY_SSL_VERIFYPEER is true */2007CURLOPT(CURLOPT_PROXY_CAPATH, CURLOPTTYPE_STRINGPOINT, 247),20082009/* Set if we should verify the proxy in ssl handshake,2010set 1 to verify. */2011CURLOPT(CURLOPT_PROXY_SSL_VERIFYPEER, CURLOPTTYPE_LONG, 248),20122013/* Set if we should verify the Common name from the proxy certificate in ssl2014* handshake, set 1 to check existence, 2 to ensure that it matches2015* the provided hostname. */2016CURLOPT(CURLOPT_PROXY_SSL_VERIFYHOST, CURLOPTTYPE_LONG, 249),20172018/* What version to specifically try to use for proxy.2019See CURL_SSLVERSION defines below. */2020CURLOPT(CURLOPT_PROXY_SSLVERSION, CURLOPTTYPE_VALUES, 250),20212022/* Set a username for authenticated TLS for proxy */2023CURLOPT(CURLOPT_PROXY_TLSAUTH_USERNAME, CURLOPTTYPE_STRINGPOINT, 251),20242025/* Set a password for authenticated TLS for proxy */2026CURLOPT(CURLOPT_PROXY_TLSAUTH_PASSWORD, CURLOPTTYPE_STRINGPOINT, 252),20272028/* Set authentication type for authenticated TLS for proxy */2029CURLOPT(CURLOPT_PROXY_TLSAUTH_TYPE, CURLOPTTYPE_STRINGPOINT, 253),20302031/* name of the file keeping your private SSL-certificate for proxy */2032CURLOPT(CURLOPT_PROXY_SSLCERT, CURLOPTTYPE_STRINGPOINT, 254),20332034/* type of the file keeping your SSL-certificate ("DER", "PEM", "ENG") for2035proxy */2036CURLOPT(CURLOPT_PROXY_SSLCERTTYPE, CURLOPTTYPE_STRINGPOINT, 255),20372038/* name of the file keeping your private SSL-key for proxy */2039CURLOPT(CURLOPT_PROXY_SSLKEY, CURLOPTTYPE_STRINGPOINT, 256),20402041/* type of the file keeping your private SSL-key ("DER", "PEM", "ENG") for2042proxy */2043CURLOPT(CURLOPT_PROXY_SSLKEYTYPE, CURLOPTTYPE_STRINGPOINT, 257),20442045/* password for the SSL private key for proxy */2046CURLOPT(CURLOPT_PROXY_KEYPASSWD, CURLOPTTYPE_STRINGPOINT, 258),20472048/* Specify which TLS 1.2 (1.1, 1.0) ciphers to use for proxy */2049CURLOPT(CURLOPT_PROXY_SSL_CIPHER_LIST, CURLOPTTYPE_STRINGPOINT, 259),20502051/* CRL file for proxy */2052CURLOPT(CURLOPT_PROXY_CRLFILE, CURLOPTTYPE_STRINGPOINT, 260),20532054/* Enable/disable specific SSL features with a bitmask for proxy, see2055CURLSSLOPT_* */2056CURLOPT(CURLOPT_PROXY_SSL_OPTIONS, CURLOPTTYPE_LONG, 261),20572058/* Name of pre proxy to use. */2059CURLOPT(CURLOPT_PRE_PROXY, CURLOPTTYPE_STRINGPOINT, 262),20602061/* The public key in DER form used to validate the proxy public key2062this option is used only if PROXY_SSL_VERIFYPEER is true */2063CURLOPT(CURLOPT_PROXY_PINNEDPUBLICKEY, CURLOPTTYPE_STRINGPOINT, 263),20642065/* Path to an abstract Unix domain socket */2066CURLOPT(CURLOPT_ABSTRACT_UNIX_SOCKET, CURLOPTTYPE_STRINGPOINT, 264),20672068/* Suppress proxy CONNECT response headers from user callbacks */2069CURLOPT(CURLOPT_SUPPRESS_CONNECT_HEADERS, CURLOPTTYPE_LONG, 265),20702071/* The request target, instead of extracted from the URL */2072CURLOPT(CURLOPT_REQUEST_TARGET, CURLOPTTYPE_STRINGPOINT, 266),20732074/* bitmask of allowed auth methods for connections to SOCKS5 proxies */2075CURLOPT(CURLOPT_SOCKS5_AUTH, CURLOPTTYPE_LONG, 267),20762077/* Enable/disable SSH compression */2078CURLOPT(CURLOPT_SSH_COMPRESSION, CURLOPTTYPE_LONG, 268),20792080/* Post MIME data. */2081CURLOPT(CURLOPT_MIMEPOST, CURLOPTTYPE_OBJECTPOINT, 269),20822083/* Time to use with the CURLOPT_TIMECONDITION. Specified in number of2084seconds since 1 Jan 1970. */2085CURLOPT(CURLOPT_TIMEVALUE_LARGE, CURLOPTTYPE_OFF_T, 270),20862087/* Head start in milliseconds to give happy eyeballs. */2088CURLOPT(CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS, CURLOPTTYPE_LONG, 271),20892090/* Function that will be called before a resolver request is made */2091CURLOPT(CURLOPT_RESOLVER_START_FUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 272),20922093/* User data to pass to the resolver start callback. */2094CURLOPT(CURLOPT_RESOLVER_START_DATA, CURLOPTTYPE_CBPOINT, 273),20952096/* send HAProxy PROXY protocol header? */2097CURLOPT(CURLOPT_HAPROXYPROTOCOL, CURLOPTTYPE_LONG, 274),20982099/* shuffle addresses before use when DNS returns multiple */2100CURLOPT(CURLOPT_DNS_SHUFFLE_ADDRESSES, CURLOPTTYPE_LONG, 275),21012102/* Specify which TLS 1.3 ciphers suites to use */2103CURLOPT(CURLOPT_TLS13_CIPHERS, CURLOPTTYPE_STRINGPOINT, 276),2104CURLOPT(CURLOPT_PROXY_TLS13_CIPHERS, CURLOPTTYPE_STRINGPOINT, 277),21052106/* Disallow specifying username/login in URL. */2107CURLOPT(CURLOPT_DISALLOW_USERNAME_IN_URL, CURLOPTTYPE_LONG, 278),21082109/* DNS-over-HTTPS URL */2110CURLOPT(CURLOPT_DOH_URL, CURLOPTTYPE_STRINGPOINT, 279),21112112/* Preferred buffer size to use for uploads */2113CURLOPT(CURLOPT_UPLOAD_BUFFERSIZE, CURLOPTTYPE_LONG, 280),21142115/* Time in ms between connection upkeep calls for long-lived connections. */2116CURLOPT(CURLOPT_UPKEEP_INTERVAL_MS, CURLOPTTYPE_LONG, 281),21172118/* Specify URL using CURL URL API. */2119CURLOPT(CURLOPT_CURLU, CURLOPTTYPE_OBJECTPOINT, 282),21202121/* add trailing data just after no more data is available */2122CURLOPT(CURLOPT_TRAILERFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 283),21232124/* pointer to be passed to HTTP_TRAILER_FUNCTION */2125CURLOPT(CURLOPT_TRAILERDATA, CURLOPTTYPE_CBPOINT, 284),21262127/* set this to 1L to allow HTTP/0.9 responses or 0L to disallow */2128CURLOPT(CURLOPT_HTTP09_ALLOWED, CURLOPTTYPE_LONG, 285),21292130/* alt-svc control bitmask */2131CURLOPT(CURLOPT_ALTSVC_CTRL, CURLOPTTYPE_LONG, 286),21322133/* alt-svc cache filename to possibly read from/write to */2134CURLOPT(CURLOPT_ALTSVC, CURLOPTTYPE_STRINGPOINT, 287),21352136/* maximum age (idle time) of a connection to consider it for reuse2137* (in seconds) */2138CURLOPT(CURLOPT_MAXAGE_CONN, CURLOPTTYPE_LONG, 288),21392140/* SASL authorization identity */2141CURLOPT(CURLOPT_SASL_AUTHZID, CURLOPTTYPE_STRINGPOINT, 289),21422143/* allow RCPT TO command to fail for some recipients */2144CURLOPT(CURLOPT_MAIL_RCPT_ALLOWFAILS, CURLOPTTYPE_LONG, 290),21452146/* the private SSL-certificate as a "blob" */2147CURLOPT(CURLOPT_SSLCERT_BLOB, CURLOPTTYPE_BLOB, 291),2148CURLOPT(CURLOPT_SSLKEY_BLOB, CURLOPTTYPE_BLOB, 292),2149CURLOPT(CURLOPT_PROXY_SSLCERT_BLOB, CURLOPTTYPE_BLOB, 293),2150CURLOPT(CURLOPT_PROXY_SSLKEY_BLOB, CURLOPTTYPE_BLOB, 294),2151CURLOPT(CURLOPT_ISSUERCERT_BLOB, CURLOPTTYPE_BLOB, 295),21522153/* Issuer certificate for proxy */2154CURLOPT(CURLOPT_PROXY_ISSUERCERT, CURLOPTTYPE_STRINGPOINT, 296),2155CURLOPT(CURLOPT_PROXY_ISSUERCERT_BLOB, CURLOPTTYPE_BLOB, 297),21562157/* the EC curves requested by the TLS client (RFC 8422, 5.1);2158* OpenSSL support via 'set_groups'/'set_curves':2159* https://docs.openssl.org/master/man3/SSL_CTX_set1_curves/2160*/2161CURLOPT(CURLOPT_SSL_EC_CURVES, CURLOPTTYPE_STRINGPOINT, 298),21622163/* HSTS bitmask */2164CURLOPT(CURLOPT_HSTS_CTRL, CURLOPTTYPE_LONG, 299),2165/* HSTS filename */2166CURLOPT(CURLOPT_HSTS, CURLOPTTYPE_STRINGPOINT, 300),21672168/* HSTS read callback */2169CURLOPT(CURLOPT_HSTSREADFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 301),2170CURLOPT(CURLOPT_HSTSREADDATA, CURLOPTTYPE_CBPOINT, 302),21712172/* HSTS write callback */2173CURLOPT(CURLOPT_HSTSWRITEFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 303),2174CURLOPT(CURLOPT_HSTSWRITEDATA, CURLOPTTYPE_CBPOINT, 304),21752176/* Parameters for V4 signature */2177CURLOPT(CURLOPT_AWS_SIGV4, CURLOPTTYPE_STRINGPOINT, 305),21782179/* Same as CURLOPT_SSL_VERIFYPEER but for DoH (DNS-over-HTTPS) servers. */2180CURLOPT(CURLOPT_DOH_SSL_VERIFYPEER, CURLOPTTYPE_LONG, 306),21812182/* Same as CURLOPT_SSL_VERIFYHOST but for DoH (DNS-over-HTTPS) servers. */2183CURLOPT(CURLOPT_DOH_SSL_VERIFYHOST, CURLOPTTYPE_LONG, 307),21842185/* Same as CURLOPT_SSL_VERIFYSTATUS but for DoH (DNS-over-HTTPS) servers. */2186CURLOPT(CURLOPT_DOH_SSL_VERIFYSTATUS, CURLOPTTYPE_LONG, 308),21872188/* The CA certificates as "blob" used to validate the peer certificate2189this option is used only if SSL_VERIFYPEER is true */2190CURLOPT(CURLOPT_CAINFO_BLOB, CURLOPTTYPE_BLOB, 309),21912192/* The CA certificates as "blob" used to validate the proxy certificate2193this option is used only if PROXY_SSL_VERIFYPEER is true */2194CURLOPT(CURLOPT_PROXY_CAINFO_BLOB, CURLOPTTYPE_BLOB, 310),21952196/* used by scp/sftp to verify the host's public key */2197CURLOPT(CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256, CURLOPTTYPE_STRINGPOINT, 311),21982199/* Function that will be called immediately before the initial request2200is made on a connection (after any protocol negotiation step). */2201CURLOPT(CURLOPT_PREREQFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 312),22022203/* Data passed to the CURLOPT_PREREQFUNCTION callback */2204CURLOPT(CURLOPT_PREREQDATA, CURLOPTTYPE_CBPOINT, 313),22052206/* maximum age (since creation) of a connection to consider it for reuse2207* (in seconds) */2208CURLOPT(CURLOPT_MAXLIFETIME_CONN, CURLOPTTYPE_LONG, 314),22092210/* Set MIME option flags. */2211CURLOPT(CURLOPT_MIME_OPTIONS, CURLOPTTYPE_LONG, 315),22122213/* set the SSH host key callback, must point to a curl_sshkeycallback2214function */2215CURLOPT(CURLOPT_SSH_HOSTKEYFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 316),22162217/* set the SSH host key callback custom pointer */2218CURLOPT(CURLOPT_SSH_HOSTKEYDATA, CURLOPTTYPE_CBPOINT, 317),22192220/* specify which protocols that are allowed to be used for the transfer,2221which thus helps the app which takes URLs from users or other external2222inputs and want to restrict what protocol(s) to deal with. Defaults to2223all built-in protocols. */2224CURLOPT(CURLOPT_PROTOCOLS_STR, CURLOPTTYPE_STRINGPOINT, 318),22252226/* specify which protocols that libcurl is allowed to follow directs to */2227CURLOPT(CURLOPT_REDIR_PROTOCOLS_STR, CURLOPTTYPE_STRINGPOINT, 319),22282229/* WebSockets options */2230CURLOPT(CURLOPT_WS_OPTIONS, CURLOPTTYPE_LONG, 320),22312232/* CA cache timeout */2233CURLOPT(CURLOPT_CA_CACHE_TIMEOUT, CURLOPTTYPE_LONG, 321),22342235/* Can leak things, gonna exit() soon */2236CURLOPT(CURLOPT_QUICK_EXIT, CURLOPTTYPE_LONG, 322),22372238/* set a specific client IP for HAProxy PROXY protocol header? */2239CURLOPT(CURLOPT_HAPROXY_CLIENT_IP, CURLOPTTYPE_STRINGPOINT, 323),22402241/* millisecond version */2242CURLOPT(CURLOPT_SERVER_RESPONSE_TIMEOUT_MS, CURLOPTTYPE_LONG, 324),22432244/* set ECH configuration */2245CURLOPT(CURLOPT_ECH, CURLOPTTYPE_STRINGPOINT, 325),22462247/* maximum number of keepalive probes (Linux, *BSD, macOS, etc.) */2248CURLOPT(CURLOPT_TCP_KEEPCNT, CURLOPTTYPE_LONG, 326),22492250CURLOPT(CURLOPT_UPLOAD_FLAGS, CURLOPTTYPE_LONG, 327),22512252/* set TLS supported signature algorithms */2253CURLOPT(CURLOPT_SSL_SIGNATURE_ALGORITHMS, CURLOPTTYPE_STRINGPOINT, 328),22542255CURLOPT_LASTENTRY /* the last unused */2256} CURLoption;22572258#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all2259the obsolete stuff removed! */22602261/* Backwards compatibility with older names */2262/* These are scheduled to disappear by 2011 */22632264/* This was added in version 7.19.1 */2265#define CURLOPT_POST301 CURLOPT_POSTREDIR22662267/* These are scheduled to disappear by 2009 */22682269/* The following were added in 7.17.0 */2270#define CURLOPT_SSLKEYPASSWD CURLOPT_KEYPASSWD2271#define CURLOPT_FTPAPPEND CURLOPT_APPEND2272#define CURLOPT_FTPLISTONLY CURLOPT_DIRLISTONLY2273#define CURLOPT_FTP_SSL CURLOPT_USE_SSL22742275/* The following were added earlier */22762277#define CURLOPT_SSLCERTPASSWD CURLOPT_KEYPASSWD2278#define CURLOPT_KRB4LEVEL CURLOPT_KRBLEVEL22792280/* */2281#define CURLOPT_FTP_RESPONSE_TIMEOUT CURLOPT_SERVER_RESPONSE_TIMEOUT22822283/* Added in 8.2.0 */2284#define CURLOPT_MAIL_RCPT_ALLLOWFAILS CURLOPT_MAIL_RCPT_ALLOWFAILS22852286#else2287/* This is set if CURL_NO_OLDIES is defined at compile-time */2288#undef CURLOPT_DNS_USE_GLOBAL_CACHE /* soon obsolete */2289#endif22902291/* Below here follows defines for the CURLOPT_IPRESOLVE option. If a host2292name resolves addresses using more than one IP protocol version, this2293option might be handy to force libcurl to use a specific IP version. */2294#define CURL_IPRESOLVE_WHATEVER 0L /* default, uses addresses to all IP2295versions that your system allows */2296#define CURL_IPRESOLVE_V4 1L /* uses only IPv4 addresses/connections */2297#define CURL_IPRESOLVE_V6 2L /* uses only IPv6 addresses/connections */22982299/* Convenient "aliases" */2300#define CURLOPT_RTSPHEADER CURLOPT_HTTPHEADER23012302/* These constants are for use with the CURLOPT_HTTP_VERSION option. */2303#define CURL_HTTP_VERSION_NONE 0L /* setting this means we do not care, and2304that we would like the library to choose2305the best possible for us! */2306#define CURL_HTTP_VERSION_1_0 1L /* please use HTTP 1.0 in the request */2307#define CURL_HTTP_VERSION_1_1 2L /* please use HTTP 1.1 in the request */2308#define CURL_HTTP_VERSION_2_0 3L /* please use HTTP 2 in the request */2309#define CURL_HTTP_VERSION_2TLS 4L /* use version 2 for HTTPS, version 1.1 for2310HTTP */2311#define CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE 5L /* please use HTTP 2 without2312HTTP/1.1 Upgrade */2313#define CURL_HTTP_VERSION_3 30L /* Use HTTP/3, fallback to HTTP/2 or2314HTTP/1 if needed. For HTTPS only. For2315HTTP, this option makes libcurl2316return error. */2317#define CURL_HTTP_VERSION_3ONLY 31L /* Use HTTP/3 without fallback. For2318HTTPS only. For HTTP, this makes2319libcurl return error. */2320#define CURL_HTTP_VERSION_LAST 32L /* *ILLEGAL* http version */23212322/* Convenience definition simple because the name of the version is HTTP/2 and2323not 2.0. The 2_0 version of the enum name was set while the version was2324still planned to be 2.0 and we stick to it for compatibility. */2325#define CURL_HTTP_VERSION_2 CURL_HTTP_VERSION_2_023262327/*2328* Public API enums for RTSP requests2329*/23302331#define CURL_RTSPREQ_NONE 0L2332#define CURL_RTSPREQ_OPTIONS 1L2333#define CURL_RTSPREQ_DESCRIBE 2L2334#define CURL_RTSPREQ_ANNOUNCE 3L2335#define CURL_RTSPREQ_SETUP 4L2336#define CURL_RTSPREQ_PLAY 5L2337#define CURL_RTSPREQ_PAUSE 6L2338#define CURL_RTSPREQ_TEARDOWN 7L2339#define CURL_RTSPREQ_GET_PARAMETER 8L2340#define CURL_RTSPREQ_SET_PARAMETER 9L2341#define CURL_RTSPREQ_RECORD 10L2342#define CURL_RTSPREQ_RECEIVE 11L2343#define CURL_RTSPREQ_LAST 12L /* not used */23442345/* These enums are for use with the CURLOPT_NETRC option. */2346#define CURL_NETRC_IGNORED 0L /* The .netrc will never be read.2347This is the default. */2348#define CURL_NETRC_OPTIONAL 1L /* A user:password in the URL will be preferred2349to one in the .netrc. */2350#define CURL_NETRC_REQUIRED 2L /* A user:password in the URL will be ignored.2351Unless one is set programmatically, the2352.netrc will be queried. */2353enum CURL_NETRC_OPTION {2354/* we set a single member here, just to make sure we still provide the enum,2355but the values to use are defined above with L suffixes */2356CURL_NETRC_LAST = 32357};23582359#define CURL_SSLVERSION_DEFAULT 0L2360#define CURL_SSLVERSION_TLSv1 1L /* TLS 1.x */2361#define CURL_SSLVERSION_SSLv2 2L2362#define CURL_SSLVERSION_SSLv3 3L2363#define CURL_SSLVERSION_TLSv1_0 4L2364#define CURL_SSLVERSION_TLSv1_1 5L2365#define CURL_SSLVERSION_TLSv1_2 6L2366#define CURL_SSLVERSION_TLSv1_3 7L23672368#define CURL_SSLVERSION_LAST 8L /* never use, keep last */23692370#define CURL_SSLVERSION_MAX_NONE 0L2371#define CURL_SSLVERSION_MAX_DEFAULT (CURL_SSLVERSION_TLSv1 << 16)2372#define CURL_SSLVERSION_MAX_TLSv1_0 (CURL_SSLVERSION_TLSv1_0 << 16)2373#define CURL_SSLVERSION_MAX_TLSv1_1 (CURL_SSLVERSION_TLSv1_1 << 16)2374#define CURL_SSLVERSION_MAX_TLSv1_2 (CURL_SSLVERSION_TLSv1_2 << 16)2375#define CURL_SSLVERSION_MAX_TLSv1_3 (CURL_SSLVERSION_TLSv1_3 << 16)23762377/* never use, keep last */2378#define CURL_SSLVERSION_MAX_LAST (CURL_SSLVERSION_LAST << 16)23792380#define CURL_TLSAUTH_NONE 0L2381#define CURL_TLSAUTH_SRP 1L23822383enum CURL_TLSAUTH {2384/* we set a single member here, just to make sure we still provide the enum,2385but the values to use are defined above with L suffixes */2386CURL_TLSAUTH_LAST = 22387};23882389/* symbols to use with CURLOPT_POSTREDIR.2390CURL_REDIR_POST_301, CURL_REDIR_POST_302 and CURL_REDIR_POST_3032391can be bitwise ORed so that CURL_REDIR_POST_301 | CURL_REDIR_POST_3022392| CURL_REDIR_POST_303 == CURL_REDIR_POST_ALL */23932394#define CURL_REDIR_GET_ALL 0L2395#define CURL_REDIR_POST_301 1L2396#define CURL_REDIR_POST_302 2L2397#define CURL_REDIR_POST_303 4L2398#define CURL_REDIR_POST_ALL \2399(CURL_REDIR_POST_301 | CURL_REDIR_POST_302 | CURL_REDIR_POST_303)24002401#define CURL_TIMECOND_NONE 0L2402#define CURL_TIMECOND_IFMODSINCE 1L2403#define CURL_TIMECOND_IFUNMODSINCE 2L2404#define CURL_TIMECOND_LASTMOD 3L24052406typedef enum {2407/* we set a single member here, just to make sure we still provide2408the enum typedef, but the values to use are defined above with L2409suffixes */2410CURL_TIMECOND_LAST = 42411} curl_TimeCond;24122413/* Special size_t value signaling a null-terminated string. */2414#define CURL_ZERO_TERMINATED ((size_t)-1)24152416/* curl_strequal() and curl_strnequal() are subject for removal in a future2417release */2418CURL_EXTERN int curl_strequal(const char *s1, const char *s2);2419CURL_EXTERN int curl_strnequal(const char *s1, const char *s2, size_t n);24202421/* Mime/form handling support. */2422typedef struct curl_mime curl_mime; /* Mime context. */2423typedef struct curl_mimepart curl_mimepart; /* Mime part context. */24242425/* CURLMIMEOPT_ defines are for the CURLOPT_MIME_OPTIONS option. */2426#define CURLMIMEOPT_FORMESCAPE (1L << 0) /* Use backslash-escaping for forms */24272428/*2429* NAME curl_mime_init()2430*2431* DESCRIPTION2432*2433* Create a mime context and return its handle. The easy parameter is the2434* target handle.2435*/2436CURL_EXTERN curl_mime *curl_mime_init(CURL *easy);24372438/*2439* NAME curl_mime_free()2440*2441* DESCRIPTION2442*2443* release a mime handle and its substructures.2444*/2445CURL_EXTERN void curl_mime_free(curl_mime *mime);24462447/*2448* NAME curl_mime_addpart()2449*2450* DESCRIPTION2451*2452* Append a new empty part to the given mime context and return a handle to2453* the created part.2454*/2455CURL_EXTERN curl_mimepart *curl_mime_addpart(curl_mime *mime);24562457/*2458* NAME curl_mime_name()2459*2460* DESCRIPTION2461*2462* Set mime/form part name.2463*/2464CURL_EXTERN CURLcode curl_mime_name(curl_mimepart *part, const char *name);24652466/*2467* NAME curl_mime_filename()2468*2469* DESCRIPTION2470*2471* Set mime part remote filename.2472*/2473CURL_EXTERN CURLcode curl_mime_filename(curl_mimepart *part,2474const char *filename);24752476/*2477* NAME curl_mime_type()2478*2479* DESCRIPTION2480*2481* Set mime part type.2482*/2483CURL_EXTERN CURLcode curl_mime_type(curl_mimepart *part, const char *mimetype);24842485/*2486* NAME curl_mime_encoder()2487*2488* DESCRIPTION2489*2490* Set mime data transfer encoder.2491*/2492CURL_EXTERN CURLcode curl_mime_encoder(curl_mimepart *part,2493const char *encoding);24942495/*2496* NAME curl_mime_data()2497*2498* DESCRIPTION2499*2500* Set mime part data source from memory data,2501*/2502CURL_EXTERN CURLcode curl_mime_data(curl_mimepart *part,2503const char *data, size_t datasize);25042505/*2506* NAME curl_mime_filedata()2507*2508* DESCRIPTION2509*2510* Set mime part data source from named file.2511*/2512CURL_EXTERN CURLcode curl_mime_filedata(curl_mimepart *part,2513const char *filename);25142515/*2516* NAME curl_mime_data_cb()2517*2518* DESCRIPTION2519*2520* Set mime part data source from callback function.2521*/2522CURL_EXTERN CURLcode curl_mime_data_cb(curl_mimepart *part,2523curl_off_t datasize,2524curl_read_callback readfunc,2525curl_seek_callback seekfunc,2526curl_free_callback freefunc,2527void *arg);25282529/*2530* NAME curl_mime_subparts()2531*2532* DESCRIPTION2533*2534* Set mime part data source from subparts.2535*/2536CURL_EXTERN CURLcode curl_mime_subparts(curl_mimepart *part,2537curl_mime *subparts);2538/*2539* NAME curl_mime_headers()2540*2541* DESCRIPTION2542*2543* Set mime part headers.2544*/2545CURL_EXTERN CURLcode curl_mime_headers(curl_mimepart *part,2546struct curl_slist *headers,2547int take_ownership);25482549typedef enum {2550/********* the first one is unused ************/2551CURLFORM_NOTHING CURL_DEPRECATED(7.56.0, ""),2552CURLFORM_COPYNAME CURL_DEPRECATED(7.56.0, "Use curl_mime_name()"),2553CURLFORM_PTRNAME CURL_DEPRECATED(7.56.0, "Use curl_mime_name()"),2554CURLFORM_NAMELENGTH CURL_DEPRECATED(7.56.0, ""),2555CURLFORM_COPYCONTENTS CURL_DEPRECATED(7.56.0, "Use curl_mime_data()"),2556CURLFORM_PTRCONTENTS CURL_DEPRECATED(7.56.0, "Use curl_mime_data()"),2557CURLFORM_CONTENTSLENGTH CURL_DEPRECATED(7.56.0, "Use curl_mime_data()"),2558CURLFORM_FILECONTENT CURL_DEPRECATED(7.56.0, "Use curl_mime_data_cb()"),2559CURLFORM_ARRAY CURL_DEPRECATED(7.56.0, ""),2560CURLFORM_OBSOLETE,2561CURLFORM_FILE CURL_DEPRECATED(7.56.0, "Use curl_mime_filedata()"),25622563CURLFORM_BUFFER CURL_DEPRECATED(7.56.0, "Use curl_mime_filename()"),2564CURLFORM_BUFFERPTR CURL_DEPRECATED(7.56.0, "Use curl_mime_data()"),2565CURLFORM_BUFFERLENGTH CURL_DEPRECATED(7.56.0, "Use curl_mime_data()"),25662567CURLFORM_CONTENTTYPE CURL_DEPRECATED(7.56.0, "Use curl_mime_type()"),2568CURLFORM_CONTENTHEADER CURL_DEPRECATED(7.56.0, "Use curl_mime_headers()"),2569CURLFORM_FILENAME CURL_DEPRECATED(7.56.0, "Use curl_mime_filename()"),2570CURLFORM_END,2571CURLFORM_OBSOLETE2,25722573CURLFORM_STREAM CURL_DEPRECATED(7.56.0, "Use curl_mime_data_cb()"),2574CURLFORM_CONTENTLEN /* added in 7.46.0, provide a curl_off_t length */2575CURL_DEPRECATED(7.56.0, "Use curl_mime_data()"),25762577CURLFORM_LASTENTRY /* the last unused */2578} CURLformoption;25792580/* structure to be used as parameter for CURLFORM_ARRAY */2581struct curl_forms {2582CURLformoption option;2583const char *value;2584};25852586/* use this for multipart formpost building */2587/* Returns code for curl_formadd()2588*2589* Returns:2590* CURL_FORMADD_OK on success2591* CURL_FORMADD_MEMORY if the FormInfo allocation fails2592* CURL_FORMADD_OPTION_TWICE if one option is given twice for one Form2593* CURL_FORMADD_NULL if a null pointer was given for a char2594* CURL_FORMADD_MEMORY if the allocation of a FormInfo struct failed2595* CURL_FORMADD_UNKNOWN_OPTION if an unknown option was used2596* CURL_FORMADD_INCOMPLETE if the some FormInfo is not complete (or error)2597* CURL_FORMADD_MEMORY if a curl_httppost struct cannot be allocated2598* CURL_FORMADD_MEMORY if some allocation for string copying failed.2599* CURL_FORMADD_ILLEGAL_ARRAY if an illegal option is used in an array2600*2601***************************************************************************/2602typedef enum {2603CURL_FORMADD_OK CURL_DEPRECATED(7.56.0, ""), /* 1st, no error */26042605CURL_FORMADD_MEMORY CURL_DEPRECATED(7.56.0, ""),2606CURL_FORMADD_OPTION_TWICE CURL_DEPRECATED(7.56.0, ""),2607CURL_FORMADD_NULL CURL_DEPRECATED(7.56.0, ""),2608CURL_FORMADD_UNKNOWN_OPTION CURL_DEPRECATED(7.56.0, ""),2609CURL_FORMADD_INCOMPLETE CURL_DEPRECATED(7.56.0, ""),2610CURL_FORMADD_ILLEGAL_ARRAY CURL_DEPRECATED(7.56.0, ""),2611/* libcurl was built with form api disabled */2612CURL_FORMADD_DISABLED CURL_DEPRECATED(7.56.0, ""),26132614CURL_FORMADD_LAST /* last */2615} CURLFORMcode;26162617/*2618* NAME curl_formadd()2619*2620* DESCRIPTION2621*2622* Pretty advanced function for building multi-part formposts. Each invoke2623* adds one part that together construct a full post. Then use2624* CURLOPT_HTTPPOST to send it off to libcurl.2625*/2626CURL_EXTERN CURLFORMcode CURL_DEPRECATED(7.56.0, "Use curl_mime_init()")2627curl_formadd(struct curl_httppost **httppost,2628struct curl_httppost **last_post,2629...);26302631/*2632* callback function for curl_formget()2633* The void *arg pointer will be the one passed as second argument to2634* curl_formget().2635* The character buffer passed to it must not be freed.2636* Should return the buffer length passed to it as the argument "len" on2637* success.2638*/2639typedef size_t (*curl_formget_callback)(void *arg, const char *buf,2640size_t len);26412642/*2643* NAME curl_formget()2644*2645* DESCRIPTION2646*2647* Serialize a curl_httppost struct built with curl_formadd().2648* Accepts a void pointer as second argument which will be passed to2649* the curl_formget_callback function.2650* Returns 0 on success.2651*/2652CURL_EXTERN int CURL_DEPRECATED(7.56.0, "")2653curl_formget(struct curl_httppost *form, void *arg,2654curl_formget_callback append);2655/*2656* NAME curl_formfree()2657*2658* DESCRIPTION2659*2660* Free a multipart formpost previously built with curl_formadd().2661*/2662CURL_EXTERN void CURL_DEPRECATED(7.56.0, "Use curl_mime_free()")2663curl_formfree(struct curl_httppost *form);26642665/*2666* NAME curl_getenv()2667*2668* DESCRIPTION2669*2670* Returns a malloc()'ed string that MUST be curl_free()ed after usage is2671* complete. DEPRECATED - see lib/README.curlx2672*/2673CURL_EXTERN char *curl_getenv(const char *variable);26742675/*2676* NAME curl_version()2677*2678* DESCRIPTION2679*2680* Returns a static ASCII string of the libcurl version.2681*/2682CURL_EXTERN char *curl_version(void);26832684/*2685* NAME curl_easy_escape()2686*2687* DESCRIPTION2688*2689* Escapes URL strings (converts all letters consider illegal in URLs to their2690* %XX versions). This function returns a new allocated string or NULL if an2691* error occurred.2692*/2693CURL_EXTERN char *curl_easy_escape(CURL *handle,2694const char *string,2695int length);26962697/* the previous version: */2698CURL_EXTERN char *curl_escape(const char *string,2699int length);27002701/*2702* NAME curl_easy_unescape()2703*2704* DESCRIPTION2705*2706* Unescapes URL encoding in strings (converts all %XX codes to their 8bit2707* versions). This function returns a new allocated string or NULL if an error2708* occurred.2709* Conversion Note: On non-ASCII platforms the ASCII %XX codes are2710* converted into the host encoding.2711*/2712CURL_EXTERN char *curl_easy_unescape(CURL *handle,2713const char *string,2714int length,2715int *outlength);27162717/* the previous version */2718CURL_EXTERN char *curl_unescape(const char *string,2719int length);27202721/*2722* NAME curl_free()2723*2724* DESCRIPTION2725*2726* Provided for de-allocation in the same translation unit that did the2727* allocation. Added in libcurl 7.102728*/2729CURL_EXTERN void curl_free(void *p);27302731/*2732* NAME curl_global_init()2733*2734* DESCRIPTION2735*2736* curl_global_init() should be invoked exactly once for each application that2737* uses libcurl and before any call of other libcurl functions.2738*2739* This function is thread-safe if CURL_VERSION_THREADSAFE is set in the2740* curl_version_info_data.features flag (fetch by curl_version_info()).2741*/2742CURL_EXTERN CURLcode curl_global_init(long flags);27432744/*2745* NAME curl_global_init_mem()2746*2747* DESCRIPTION2748*2749* curl_global_init() or curl_global_init_mem() should be invoked exactly once2750* for each application that uses libcurl. This function can be used to2751* initialize libcurl and set user defined memory management callback2752* functions. Users can implement memory management routines to check for2753* memory leaks, check for misuse of the curl library etc. User registered2754* callback routines will be invoked by this library instead of the system2755* memory management routines like malloc, free etc.2756*/2757CURL_EXTERN CURLcode curl_global_init_mem(long flags,2758curl_malloc_callback m,2759curl_free_callback f,2760curl_realloc_callback r,2761curl_strdup_callback s,2762curl_calloc_callback c);27632764/*2765* NAME curl_global_cleanup()2766*2767* DESCRIPTION2768*2769* curl_global_cleanup() should be invoked exactly once for each application2770* that uses libcurl2771*/2772CURL_EXTERN void curl_global_cleanup(void);27732774/*2775* NAME curl_global_trace()2776*2777* DESCRIPTION2778*2779* curl_global_trace() can be invoked at application start to2780* configure which components in curl should participate in tracing.2781*2782* This function is thread-safe if CURL_VERSION_THREADSAFE is set in the2783* curl_version_info_data.features flag (fetch by curl_version_info()).2784*/2785CURL_EXTERN CURLcode curl_global_trace(const char *config);27862787/* linked-list structure for the CURLOPT_QUOTE option (and other) */2788struct curl_slist {2789char *data;2790struct curl_slist *next;2791};27922793/*2794* NAME curl_global_sslset()2795*2796* DESCRIPTION2797*2798* When built with multiple SSL backends, curl_global_sslset() allows to2799* choose one. This function can only be called once, and it must be called2800* *before* curl_global_init().2801*2802* The backend can be identified by the id (e.g. CURLSSLBACKEND_OPENSSL). The2803* backend can also be specified via the name parameter (passing -1 as id). If2804* both id and name are specified, the name will be ignored. If neither id nor2805* name are specified, the function will fail with CURLSSLSET_UNKNOWN_BACKEND2806* and set the "avail" pointer to the NULL-terminated list of available2807* backends.2808*2809* Upon success, the function returns CURLSSLSET_OK.2810*2811* If the specified SSL backend is not available, the function returns2812* CURLSSLSET_UNKNOWN_BACKEND and sets the "avail" pointer to a2813* NULL-terminated list of available SSL backends.2814*2815* The SSL backend can be set only once. If it has already been set, a2816* subsequent attempt to change it will result in a CURLSSLSET_TOO_LATE.2817*/28182819struct curl_ssl_backend {2820curl_sslbackend id;2821const char *name;2822};2823typedef struct curl_ssl_backend curl_ssl_backend;28242825typedef enum {2826CURLSSLSET_OK = 0,2827CURLSSLSET_UNKNOWN_BACKEND,2828CURLSSLSET_TOO_LATE,2829CURLSSLSET_NO_BACKENDS /* libcurl was built without any SSL support */2830} CURLsslset;28312832CURL_EXTERN CURLsslset curl_global_sslset(curl_sslbackend id, const char *name,2833const curl_ssl_backend ***avail);28342835/*2836* NAME curl_slist_append()2837*2838* DESCRIPTION2839*2840* Appends a string to a linked list. If no list exists, it will be created2841* first. Returns the new list, after appending.2842*/2843CURL_EXTERN struct curl_slist *curl_slist_append(struct curl_slist *list,2844const char *data);28452846/*2847* NAME curl_slist_free_all()2848*2849* DESCRIPTION2850*2851* free a previously built curl_slist.2852*/2853CURL_EXTERN void curl_slist_free_all(struct curl_slist *list);28542855/*2856* NAME curl_getdate()2857*2858* DESCRIPTION2859*2860* Returns the time, in seconds since 1 Jan 1970 of the time string given in2861* the first argument. The time argument in the second parameter is unused2862* and should be set to NULL.2863*/2864CURL_EXTERN time_t curl_getdate(const char *p, const time_t *unused);28652866/* info about the certificate chain, for SSL backends that support it. Asked2867for with CURLOPT_CERTINFO / CURLINFO_CERTINFO */2868struct curl_certinfo {2869int num_of_certs; /* number of certificates with information */2870struct curl_slist **certinfo; /* for each index in this array, there is a2871linked list with textual information for a2872certificate in the format "name:content".2873eg "Subject:foo", "Issuer:bar", etc. */2874};28752876/* Information about the SSL library used and the respective internal SSL2877handle, which can be used to obtain further information regarding the2878connection. Asked for with CURLINFO_TLS_SSL_PTR or CURLINFO_TLS_SESSION. */2879struct curl_tlssessioninfo {2880curl_sslbackend backend;2881void *internals;2882};28832884#define CURLINFO_STRING 0x1000002885#define CURLINFO_LONG 0x2000002886#define CURLINFO_DOUBLE 0x3000002887#define CURLINFO_SLIST 0x4000002888#define CURLINFO_PTR 0x400000 /* same as SLIST */2889#define CURLINFO_SOCKET 0x5000002890#define CURLINFO_OFF_T 0x6000002891#define CURLINFO_MASK 0x0fffff2892#define CURLINFO_TYPEMASK 0xf0000028932894typedef enum {2895CURLINFO_NONE, /* first, never use this */2896CURLINFO_EFFECTIVE_URL = CURLINFO_STRING + 1,2897CURLINFO_RESPONSE_CODE = CURLINFO_LONG + 2,2898CURLINFO_TOTAL_TIME = CURLINFO_DOUBLE + 3,2899CURLINFO_NAMELOOKUP_TIME = CURLINFO_DOUBLE + 4,2900CURLINFO_CONNECT_TIME = CURLINFO_DOUBLE + 5,2901CURLINFO_PRETRANSFER_TIME = CURLINFO_DOUBLE + 6,2902CURLINFO_SIZE_UPLOAD CURL_DEPRECATED(7.55.0, "Use CURLINFO_SIZE_UPLOAD_T")2903= CURLINFO_DOUBLE + 7,2904CURLINFO_SIZE_UPLOAD_T = CURLINFO_OFF_T + 7,2905CURLINFO_SIZE_DOWNLOAD2906CURL_DEPRECATED(7.55.0, "Use CURLINFO_SIZE_DOWNLOAD_T")2907= CURLINFO_DOUBLE + 8,2908CURLINFO_SIZE_DOWNLOAD_T = CURLINFO_OFF_T + 8,2909CURLINFO_SPEED_DOWNLOAD2910CURL_DEPRECATED(7.55.0, "Use CURLINFO_SPEED_DOWNLOAD_T")2911= CURLINFO_DOUBLE + 9,2912CURLINFO_SPEED_DOWNLOAD_T = CURLINFO_OFF_T + 9,2913CURLINFO_SPEED_UPLOAD2914CURL_DEPRECATED(7.55.0, "Use CURLINFO_SPEED_UPLOAD_T")2915= CURLINFO_DOUBLE + 10,2916CURLINFO_SPEED_UPLOAD_T = CURLINFO_OFF_T + 10,2917CURLINFO_HEADER_SIZE = CURLINFO_LONG + 11,2918CURLINFO_REQUEST_SIZE = CURLINFO_LONG + 12,2919CURLINFO_SSL_VERIFYRESULT = CURLINFO_LONG + 13,2920CURLINFO_FILETIME = CURLINFO_LONG + 14,2921CURLINFO_FILETIME_T = CURLINFO_OFF_T + 14,2922CURLINFO_CONTENT_LENGTH_DOWNLOAD2923CURL_DEPRECATED(7.55.0,2924"Use CURLINFO_CONTENT_LENGTH_DOWNLOAD_T")2925= CURLINFO_DOUBLE + 15,2926CURLINFO_CONTENT_LENGTH_DOWNLOAD_T = CURLINFO_OFF_T + 15,2927CURLINFO_CONTENT_LENGTH_UPLOAD2928CURL_DEPRECATED(7.55.0,2929"Use CURLINFO_CONTENT_LENGTH_UPLOAD_T")2930= CURLINFO_DOUBLE + 16,2931CURLINFO_CONTENT_LENGTH_UPLOAD_T = CURLINFO_OFF_T + 16,2932CURLINFO_STARTTRANSFER_TIME = CURLINFO_DOUBLE + 17,2933CURLINFO_CONTENT_TYPE = CURLINFO_STRING + 18,2934CURLINFO_REDIRECT_TIME = CURLINFO_DOUBLE + 19,2935CURLINFO_REDIRECT_COUNT = CURLINFO_LONG + 20,2936CURLINFO_PRIVATE = CURLINFO_STRING + 21,2937CURLINFO_HTTP_CONNECTCODE = CURLINFO_LONG + 22,2938CURLINFO_HTTPAUTH_AVAIL = CURLINFO_LONG + 23,2939CURLINFO_PROXYAUTH_AVAIL = CURLINFO_LONG + 24,2940CURLINFO_OS_ERRNO = CURLINFO_LONG + 25,2941CURLINFO_NUM_CONNECTS = CURLINFO_LONG + 26,2942CURLINFO_SSL_ENGINES = CURLINFO_SLIST + 27,2943CURLINFO_COOKIELIST = CURLINFO_SLIST + 28,2944CURLINFO_LASTSOCKET CURL_DEPRECATED(7.45.0, "Use CURLINFO_ACTIVESOCKET")2945= CURLINFO_LONG + 29,2946CURLINFO_FTP_ENTRY_PATH = CURLINFO_STRING + 30,2947CURLINFO_REDIRECT_URL = CURLINFO_STRING + 31,2948CURLINFO_PRIMARY_IP = CURLINFO_STRING + 32,2949CURLINFO_APPCONNECT_TIME = CURLINFO_DOUBLE + 33,2950CURLINFO_CERTINFO = CURLINFO_PTR + 34,2951CURLINFO_CONDITION_UNMET = CURLINFO_LONG + 35,2952CURLINFO_RTSP_SESSION_ID = CURLINFO_STRING + 36,2953CURLINFO_RTSP_CLIENT_CSEQ = CURLINFO_LONG + 37,2954CURLINFO_RTSP_SERVER_CSEQ = CURLINFO_LONG + 38,2955CURLINFO_RTSP_CSEQ_RECV = CURLINFO_LONG + 39,2956CURLINFO_PRIMARY_PORT = CURLINFO_LONG + 40,2957CURLINFO_LOCAL_IP = CURLINFO_STRING + 41,2958CURLINFO_LOCAL_PORT = CURLINFO_LONG + 42,2959CURLINFO_TLS_SESSION CURL_DEPRECATED(7.48.0, "Use CURLINFO_TLS_SSL_PTR")2960= CURLINFO_PTR + 43,2961CURLINFO_ACTIVESOCKET = CURLINFO_SOCKET + 44,2962CURLINFO_TLS_SSL_PTR = CURLINFO_PTR + 45,2963CURLINFO_HTTP_VERSION = CURLINFO_LONG + 46,2964CURLINFO_PROXY_SSL_VERIFYRESULT = CURLINFO_LONG + 47,2965CURLINFO_PROTOCOL CURL_DEPRECATED(7.85.0, "Use CURLINFO_SCHEME")2966= CURLINFO_LONG + 48,2967CURLINFO_SCHEME = CURLINFO_STRING + 49,2968CURLINFO_TOTAL_TIME_T = CURLINFO_OFF_T + 50,2969CURLINFO_NAMELOOKUP_TIME_T = CURLINFO_OFF_T + 51,2970CURLINFO_CONNECT_TIME_T = CURLINFO_OFF_T + 52,2971CURLINFO_PRETRANSFER_TIME_T = CURLINFO_OFF_T + 53,2972CURLINFO_STARTTRANSFER_TIME_T = CURLINFO_OFF_T + 54,2973CURLINFO_REDIRECT_TIME_T = CURLINFO_OFF_T + 55,2974CURLINFO_APPCONNECT_TIME_T = CURLINFO_OFF_T + 56,2975CURLINFO_RETRY_AFTER = CURLINFO_OFF_T + 57,2976CURLINFO_EFFECTIVE_METHOD = CURLINFO_STRING + 58,2977CURLINFO_PROXY_ERROR = CURLINFO_LONG + 59,2978CURLINFO_REFERER = CURLINFO_STRING + 60,2979CURLINFO_CAINFO = CURLINFO_STRING + 61,2980CURLINFO_CAPATH = CURLINFO_STRING + 62,2981CURLINFO_XFER_ID = CURLINFO_OFF_T + 63,2982CURLINFO_CONN_ID = CURLINFO_OFF_T + 64,2983CURLINFO_QUEUE_TIME_T = CURLINFO_OFF_T + 65,2984CURLINFO_USED_PROXY = CURLINFO_LONG + 66,2985CURLINFO_POSTTRANSFER_TIME_T = CURLINFO_OFF_T + 67,2986CURLINFO_EARLYDATA_SENT_T = CURLINFO_OFF_T + 68,2987CURLINFO_HTTPAUTH_USED = CURLINFO_LONG + 69,2988CURLINFO_PROXYAUTH_USED = CURLINFO_LONG + 70,2989CURLINFO_LASTONE = 702990} CURLINFO;29912992/* CURLINFO_RESPONSE_CODE is the new name for the option previously known as2993CURLINFO_HTTP_CODE */2994#define CURLINFO_HTTP_CODE CURLINFO_RESPONSE_CODE29952996typedef enum {2997CURLCLOSEPOLICY_NONE, /* first, never use this */29982999CURLCLOSEPOLICY_OLDEST,3000CURLCLOSEPOLICY_LEAST_RECENTLY_USED,3001CURLCLOSEPOLICY_LEAST_TRAFFIC,3002CURLCLOSEPOLICY_SLOWEST,3003CURLCLOSEPOLICY_CALLBACK,30043005CURLCLOSEPOLICY_LAST /* last, never use this */3006} curl_closepolicy;30073008#define CURL_GLOBAL_SSL (1 << 0) /* no purpose since 7.57.0 */3009#define CURL_GLOBAL_WIN32 (1 << 1)3010#define CURL_GLOBAL_ALL (CURL_GLOBAL_SSL | CURL_GLOBAL_WIN32)3011#define CURL_GLOBAL_NOTHING 03012#define CURL_GLOBAL_DEFAULT CURL_GLOBAL_ALL3013#define CURL_GLOBAL_ACK_EINTR (1 << 2)30143015/*****************************************************************************3016* Setup defines, protos etc for the sharing stuff.3017*/30183019/* Different data locks for a single share */3020typedef enum {3021CURL_LOCK_DATA_NONE = 0,3022/* CURL_LOCK_DATA_SHARE is used internally to say that3023* the locking is just made to change the internal state of the share3024* itself.3025*/3026CURL_LOCK_DATA_SHARE,3027CURL_LOCK_DATA_COOKIE,3028CURL_LOCK_DATA_DNS,3029CURL_LOCK_DATA_SSL_SESSION,3030CURL_LOCK_DATA_CONNECT,3031CURL_LOCK_DATA_PSL,3032CURL_LOCK_DATA_HSTS,3033CURL_LOCK_DATA_LAST3034} curl_lock_data;30353036/* Different lock access types */3037typedef enum {3038CURL_LOCK_ACCESS_NONE = 0, /* unspecified action */3039CURL_LOCK_ACCESS_SHARED = 1, /* for read perhaps */3040CURL_LOCK_ACCESS_SINGLE = 2, /* for write perhaps */3041CURL_LOCK_ACCESS_LAST /* never use */3042} curl_lock_access;30433044typedef void (*curl_lock_function)(CURL *handle,3045curl_lock_data data,3046curl_lock_access locktype,3047void *userptr);3048typedef void (*curl_unlock_function)(CURL *handle,3049curl_lock_data data,3050void *userptr);30513052typedef enum {3053CURLSHE_OK, /* all is fine */3054CURLSHE_BAD_OPTION, /* 1 */3055CURLSHE_IN_USE, /* 2 */3056CURLSHE_INVALID, /* 3 */3057CURLSHE_NOMEM, /* 4 out of memory */3058CURLSHE_NOT_BUILT_IN, /* 5 feature not present in lib */3059CURLSHE_LAST /* never use */3060} CURLSHcode;30613062typedef enum {3063CURLSHOPT_NONE, /* do not use */3064CURLSHOPT_SHARE, /* specify a data type to share */3065CURLSHOPT_UNSHARE, /* specify which data type to stop sharing */3066CURLSHOPT_LOCKFUNC, /* pass in a 'curl_lock_function' pointer */3067CURLSHOPT_UNLOCKFUNC, /* pass in a 'curl_unlock_function' pointer */3068CURLSHOPT_USERDATA, /* pass in a user data pointer used in the lock/unlock3069callback functions */3070CURLSHOPT_LAST /* never use */3071} CURLSHoption;30723073CURL_EXTERN CURLSH *curl_share_init(void);3074CURL_EXTERN CURLSHcode curl_share_setopt(CURLSH *share, CURLSHoption option,3075...);3076CURL_EXTERN CURLSHcode curl_share_cleanup(CURLSH *share);30773078/****************************************************************************3079* Structures for querying information about the curl library at runtime.3080*/30813082typedef enum {3083CURLVERSION_FIRST, /* 7.10 */3084CURLVERSION_SECOND, /* 7.11.1 */3085CURLVERSION_THIRD, /* 7.12.0 */3086CURLVERSION_FOURTH, /* 7.16.1 */3087CURLVERSION_FIFTH, /* 7.57.0 */3088CURLVERSION_SIXTH, /* 7.66.0 */3089CURLVERSION_SEVENTH, /* 7.70.0 */3090CURLVERSION_EIGHTH, /* 7.72.0 */3091CURLVERSION_NINTH, /* 7.75.0 */3092CURLVERSION_TENTH, /* 7.77.0 */3093CURLVERSION_ELEVENTH, /* 7.87.0 */3094CURLVERSION_TWELFTH, /* 8.8.0 */3095CURLVERSION_LAST /* never actually use this */3096} CURLversion;30973098/* The 'CURLVERSION_NOW' is the symbolic name meant to be used by3099basically all programs ever that want to get version information. It is3100meant to be a built-in version number for what kind of struct the caller3101expects. If the struct ever changes, we redefine the NOW to another enum3102from above. */3103#define CURLVERSION_NOW CURLVERSION_TWELFTH31043105struct curl_version_info_data {3106CURLversion age; /* age of the returned struct */3107const char *version; /* LIBCURL_VERSION */3108unsigned int version_num; /* LIBCURL_VERSION_NUM */3109const char *host; /* OS/host/cpu/machine when configured */3110int features; /* bitmask, see defines below */3111const char *ssl_version; /* human readable string */3112long ssl_version_num; /* not used anymore, always 0 */3113const char *libz_version; /* human readable string */3114/* protocols is terminated by an entry with a NULL protoname */3115const char * const *protocols;31163117/* The fields below this were added in CURLVERSION_SECOND */3118const char *ares;3119int ares_num;31203121/* This field was added in CURLVERSION_THIRD */3122const char *libidn;31233124/* These field were added in CURLVERSION_FOURTH */31253126/* Same as '_libiconv_version' if built with HAVE_ICONV */3127int iconv_ver_num;31283129const char *libssh_version; /* human readable string */31303131/* These fields were added in CURLVERSION_FIFTH */3132unsigned int brotli_ver_num; /* Numeric Brotli version3133(MAJOR << 24) | (MINOR << 12) | PATCH */3134const char *brotli_version; /* human readable string. */31353136/* These fields were added in CURLVERSION_SIXTH */3137unsigned int nghttp2_ver_num; /* Numeric nghttp2 version3138(MAJOR << 16) | (MINOR << 8) | PATCH */3139const char *nghttp2_version; /* human readable string. */3140const char *quic_version; /* human readable quic (+ HTTP/3) library +3141version or NULL */31423143/* These fields were added in CURLVERSION_SEVENTH */3144const char *cainfo; /* the built-in default CURLOPT_CAINFO, might3145be NULL */3146const char *capath; /* the built-in default CURLOPT_CAPATH, might3147be NULL */31483149/* These fields were added in CURLVERSION_EIGHTH */3150unsigned int zstd_ver_num; /* Numeric Zstd version3151(MAJOR << 24) | (MINOR << 12) | PATCH */3152const char *zstd_version; /* human readable string. */31533154/* These fields were added in CURLVERSION_NINTH */3155const char *hyper_version; /* human readable string. */31563157/* These fields were added in CURLVERSION_TENTH */3158const char *gsasl_version; /* human readable string. */31593160/* These fields were added in CURLVERSION_ELEVENTH */3161/* feature_names is terminated by an entry with a NULL feature name */3162const char * const *feature_names;31633164/* These fields were added in CURLVERSION_TWELFTH */3165const char *rtmp_version; /* human readable string. */3166};3167typedef struct curl_version_info_data curl_version_info_data;31683169#define CURL_VERSION_IPV6 (1<<0) /* IPv6-enabled */3170#define CURL_VERSION_KERBEROS4 (1<<1) /* Kerberos V4 auth is supported3171(deprecated) */3172#define CURL_VERSION_SSL (1<<2) /* SSL options are present */3173#define CURL_VERSION_LIBZ (1<<3) /* libz features are present */3174#define CURL_VERSION_NTLM (1<<4) /* NTLM auth is supported */3175#define CURL_VERSION_GSSNEGOTIATE (1<<5) /* Negotiate auth is supported3176(deprecated) */3177#define CURL_VERSION_DEBUG (1<<6) /* Built with debug capabilities */3178#define CURL_VERSION_ASYNCHDNS (1<<7) /* Asynchronous DNS resolves */3179#define CURL_VERSION_SPNEGO (1<<8) /* SPNEGO auth is supported */3180#define CURL_VERSION_LARGEFILE (1<<9) /* Supports files larger than 2GB */3181#define CURL_VERSION_IDN (1<<10) /* Internationized Domain Names are3182supported */3183#define CURL_VERSION_SSPI (1<<11) /* Built against Windows SSPI */3184#define CURL_VERSION_CONV (1<<12) /* Character conversions supported */3185#define CURL_VERSION_CURLDEBUG (1<<13) /* Debug memory tracking supported */3186#define CURL_VERSION_TLSAUTH_SRP (1<<14) /* TLS-SRP auth is supported */3187#define CURL_VERSION_NTLM_WB (1<<15) /* NTLM delegation to winbind helper3188is supported */3189#define CURL_VERSION_HTTP2 (1<<16) /* HTTP2 support built-in */3190#define CURL_VERSION_GSSAPI (1<<17) /* Built against a GSS-API library */3191#define CURL_VERSION_KERBEROS5 (1<<18) /* Kerberos V5 auth is supported */3192#define CURL_VERSION_UNIX_SOCKETS (1<<19) /* Unix domain sockets support */3193#define CURL_VERSION_PSL (1<<20) /* Mozilla's Public Suffix List, used3194for cookie domain verification */3195#define CURL_VERSION_HTTPS_PROXY (1<<21) /* HTTPS-proxy support built-in */3196#define CURL_VERSION_MULTI_SSL (1<<22) /* Multiple SSL backends available */3197#define CURL_VERSION_BROTLI (1<<23) /* Brotli features are present. */3198#define CURL_VERSION_ALTSVC (1<<24) /* Alt-Svc handling built-in */3199#define CURL_VERSION_HTTP3 (1<<25) /* HTTP3 support built-in */3200#define CURL_VERSION_ZSTD (1<<26) /* zstd features are present */3201#define CURL_VERSION_UNICODE (1<<27) /* Unicode support on Windows */3202#define CURL_VERSION_HSTS (1<<28) /* HSTS is supported */3203#define CURL_VERSION_GSASL (1<<29) /* libgsasl is supported */3204#define CURL_VERSION_THREADSAFE (1<<30) /* libcurl API is thread-safe */32053206/*3207* NAME curl_version_info()3208*3209* DESCRIPTION3210*3211* This function returns a pointer to a static copy of the version info3212* struct. See above.3213*/3214CURL_EXTERN curl_version_info_data *curl_version_info(CURLversion);32153216/*3217* NAME curl_easy_strerror()3218*3219* DESCRIPTION3220*3221* The curl_easy_strerror function may be used to turn a CURLcode value3222* into the equivalent human readable error string. This is useful3223* for printing meaningful error messages.3224*/3225CURL_EXTERN const char *curl_easy_strerror(CURLcode);32263227/*3228* NAME curl_share_strerror()3229*3230* DESCRIPTION3231*3232* The curl_share_strerror function may be used to turn a CURLSHcode value3233* into the equivalent human readable error string. This is useful3234* for printing meaningful error messages.3235*/3236CURL_EXTERN const char *curl_share_strerror(CURLSHcode);32373238/*3239* NAME curl_easy_pause()3240*3241* DESCRIPTION3242*3243* The curl_easy_pause function pauses or unpauses transfers. Select the new3244* state by setting the bitmask, use the convenience defines below.3245*3246*/3247CURL_EXTERN CURLcode curl_easy_pause(CURL *handle, int bitmask);32483249#define CURLPAUSE_RECV (1 << 0)3250#define CURLPAUSE_RECV_CONT (0)32513252#define CURLPAUSE_SEND (1 << 2)3253#define CURLPAUSE_SEND_CONT (0)32543255#define CURLPAUSE_ALL (CURLPAUSE_RECV | CURLPAUSE_SEND)3256#define CURLPAUSE_CONT (CURLPAUSE_RECV_CONT | CURLPAUSE_SEND_CONT)32573258/*3259* NAME curl_easy_ssls_import()3260*3261* DESCRIPTION3262*3263* The curl_easy_ssls_import function adds a previously exported SSL session3264* to the SSL session cache of the easy handle (or the underlying share).3265*/3266CURL_EXTERN CURLcode curl_easy_ssls_import(CURL *handle,3267const char *session_key,3268const unsigned char *shmac,3269size_t shmac_len,3270const unsigned char *sdata,3271size_t sdata_len);32723273/* This is the curl_ssls_export_cb callback prototype. It3274* is passed to curl_easy_ssls_export() to extract SSL sessions/tickets. */3275typedef CURLcode curl_ssls_export_cb(CURL *handle,3276void *userptr,3277const char *session_key,3278const unsigned char *shmac,3279size_t shmac_len,3280const unsigned char *sdata,3281size_t sdata_len,3282curl_off_t valid_until,3283int ietf_tls_id,3284const char *alpn,3285size_t earlydata_max);32863287/*3288* NAME curl_easy_ssls_export()3289*3290* DESCRIPTION3291*3292* The curl_easy_ssls_export function iterates over all SSL sessions stored3293* in the easy handle (or underlying share) and invokes the passed3294* callback.3295*3296*/3297CURL_EXTERN CURLcode curl_easy_ssls_export(CURL *handle,3298curl_ssls_export_cb *export_fn,3299void *userptr);33003301#ifdef __cplusplus3302} /* end of extern "C" */3303#endif33043305/* unfortunately, the easy.h and multi.h include files need options and info3306stuff before they can be included! */3307#include "easy.h" /* nothing in curl is fun without the easy stuff */3308#include "multi.h"3309#include "urlapi.h"3310#include "options.h"3311#include "header.h"3312#include "websockets.h"3313#include "mprintf.h"33143315/* the typechecker does not work in C++ (yet) */3316#if ((defined(__GNUC__) && defined(__GNUC_MINOR__) && \3317((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))) || \3318(defined(__clang__) && __clang_major__ >= 14)) && \3319!defined(__cplusplus) && !defined(CURL_DISABLE_TYPECHECK)3320#include "typecheck-gcc.h"3321#else3322#if defined(__STDC__) && (__STDC__ >= 1)3323#if 0 /* Triggers clang -Wdisabled-macro-expansion, skip for CMake. */3324/* This preprocessor magic that replaces a call with the exact same call is3325only done to make sure application authors pass exactly three arguments3326to these functions. */3327#define curl_easy_setopt(handle,opt,param) curl_easy_setopt(handle,opt,param)3328#define curl_easy_getinfo(handle,info,arg) curl_easy_getinfo(handle,info,arg)3329#define curl_share_setopt(share,opt,param) curl_share_setopt(share,opt,param)3330#define curl_multi_setopt(handle,opt,param) curl_multi_setopt(handle,opt,param)3331#endif3332#endif /* __STDC__ >= 1 */3333#endif /* gcc >= 4.3 && !__cplusplus && !CURL_DISABLE_TYPECHECK */33343335#endif /* CURLINC_CURL_H */333633373338