#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# if defined(BUILDING_LIBCURL)127# 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};230231232/* This is a return code for the progress callback that, when returned, will233signal libcurl to continue executing the default progress function */234#define CURL_PROGRESSFUNC_CONTINUE 0x10000001235236/* This is the CURLOPT_PROGRESSFUNCTION callback prototype. It is now237considered deprecated but was the only choice up until 7.31.0 */238typedef int (*curl_progress_callback)(void *clientp,239double dltotal,240double dlnow,241double ultotal,242double ulnow);243244/* This is the CURLOPT_XFERINFOFUNCTION callback prototype. It was introduced245in 7.32.0, avoids the use of floating point numbers and provides more246detailed information. */247typedef int (*curl_xferinfo_callback)(void *clientp,248curl_off_t dltotal,249curl_off_t dlnow,250curl_off_t ultotal,251curl_off_t ulnow);252253#ifndef CURL_MAX_READ_SIZE254/* The maximum receive buffer size configurable via CURLOPT_BUFFERSIZE. */255#define CURL_MAX_READ_SIZE (10*1024*1024)256#endif257258#ifndef CURL_MAX_WRITE_SIZE259/* Tests have proven that 20K is a bad buffer size for uploads on Windows,260while 16K for some odd reason performed a lot better. We do the ifndef261check to allow this value to easier be changed at build time for those262who feel adventurous. The practical minimum is about 400 bytes since263libcurl uses a buffer of this size as a scratch area (unrelated to264network send operations). */265#define CURL_MAX_WRITE_SIZE 16384266#endif267268#ifndef CURL_MAX_HTTP_HEADER269/* The only reason to have a max limit for this is to avoid the risk of a bad270server feeding libcurl with a never-ending header that will cause reallocs271infinitely */272#define CURL_MAX_HTTP_HEADER (100*1024)273#endif274275/* This is a magic return code for the write callback that, when returned,276will signal libcurl to pause receiving on the current transfer. */277#define CURL_WRITEFUNC_PAUSE 0x10000001278279/* This is a magic return code for the write callback that, when returned,280will signal an error from the callback. */281#define CURL_WRITEFUNC_ERROR 0xFFFFFFFF282283typedef size_t (*curl_write_callback)(char *buffer,284size_t size,285size_t nitems,286void *outstream);287288/* This callback will be called when a new resolver request is made */289typedef int (*curl_resolver_start_callback)(void *resolver_state,290void *reserved, void *userdata);291292/* enumeration of file types */293typedef enum {294CURLFILETYPE_FILE = 0,295CURLFILETYPE_DIRECTORY,296CURLFILETYPE_SYMLINK,297CURLFILETYPE_DEVICE_BLOCK,298CURLFILETYPE_DEVICE_CHAR,299CURLFILETYPE_NAMEDPIPE,300CURLFILETYPE_SOCKET,301CURLFILETYPE_DOOR, /* is possible only on Sun Solaris now */302303CURLFILETYPE_UNKNOWN /* should never occur */304} curlfiletype;305306#define CURLFINFOFLAG_KNOWN_FILENAME (1<<0)307#define CURLFINFOFLAG_KNOWN_FILETYPE (1<<1)308#define CURLFINFOFLAG_KNOWN_TIME (1<<2)309#define CURLFINFOFLAG_KNOWN_PERM (1<<3)310#define CURLFINFOFLAG_KNOWN_UID (1<<4)311#define CURLFINFOFLAG_KNOWN_GID (1<<5)312#define CURLFINFOFLAG_KNOWN_SIZE (1<<6)313#define CURLFINFOFLAG_KNOWN_HLINKCOUNT (1<<7)314315/* Information about a single file, used when doing FTP wildcard matching */316struct curl_fileinfo {317char *filename;318curlfiletype filetype;319time_t time; /* always zero! */320unsigned int perm;321int uid;322int gid;323curl_off_t size;324long int hardlinks;325326struct {327/* If some of these fields is not NULL, it is a pointer to b_data. */328char *time;329char *perm;330char *user;331char *group;332char *target; /* pointer to the target filename of a symlink */333} strings;334335unsigned int flags;336337/* These are libcurl private struct fields. Previously used by libcurl, so338they must never be interfered with. */339char *b_data;340size_t b_size;341size_t b_used;342};343344/* return codes for CURLOPT_CHUNK_BGN_FUNCTION */345#define CURL_CHUNK_BGN_FUNC_OK 0346#define CURL_CHUNK_BGN_FUNC_FAIL 1 /* tell the lib to end the task */347#define CURL_CHUNK_BGN_FUNC_SKIP 2 /* skip this chunk over */348349/* if splitting of data transfer is enabled, this callback is called before350download of an individual chunk started. Note that parameter "remains" works351only for FTP wildcard downloading (for now), otherwise is not used */352typedef long (*curl_chunk_bgn_callback)(const void *transfer_info,353void *ptr,354int remains);355356/* return codes for CURLOPT_CHUNK_END_FUNCTION */357#define CURL_CHUNK_END_FUNC_OK 0358#define CURL_CHUNK_END_FUNC_FAIL 1 /* tell the lib to end the task */359360/* If splitting of data transfer is enabled this callback is called after361download of an individual chunk finished.362Note! After this callback was set then it have to be called FOR ALL chunks.363Even if downloading of this chunk was skipped in CHUNK_BGN_FUNC.364This is the reason why we do not need "transfer_info" parameter in this365callback and we are not interested in "remains" parameter too. */366typedef long (*curl_chunk_end_callback)(void *ptr);367368/* return codes for FNMATCHFUNCTION */369#define CURL_FNMATCHFUNC_MATCH 0 /* string corresponds to the pattern */370#define CURL_FNMATCHFUNC_NOMATCH 1 /* pattern does not match the string */371#define CURL_FNMATCHFUNC_FAIL 2 /* an error occurred */372373/* callback type for wildcard downloading pattern matching. If the374string matches the pattern, return CURL_FNMATCHFUNC_MATCH value, etc. */375typedef int (*curl_fnmatch_callback)(void *ptr,376const char *pattern,377const char *string);378379/* These are the return codes for the seek callbacks */380#define CURL_SEEKFUNC_OK 0381#define CURL_SEEKFUNC_FAIL 1 /* fail the entire transfer */382#define CURL_SEEKFUNC_CANTSEEK 2 /* tell libcurl seeking cannot be done, so383libcurl might try other means instead */384typedef int (*curl_seek_callback)(void *instream,385curl_off_t offset,386int origin); /* 'whence' */387388/* This is a return code for the read callback that, when returned, will389signal libcurl to immediately abort the current transfer. */390#define CURL_READFUNC_ABORT 0x10000000391/* This is a return code for the read callback that, when returned, will392signal libcurl to pause sending data on the current transfer. */393#define CURL_READFUNC_PAUSE 0x10000001394395/* Return code for when the trailing headers' callback has terminated396without any errors */397#define CURL_TRAILERFUNC_OK 0398/* Return code for when was an error in the trailing header's list and we399want to abort the request */400#define CURL_TRAILERFUNC_ABORT 1401402typedef size_t (*curl_read_callback)(char *buffer,403size_t size,404size_t nitems,405void *instream);406407typedef int (*curl_trailer_callback)(struct curl_slist **list,408void *userdata);409410typedef enum {411CURLSOCKTYPE_IPCXN, /* socket created for a specific IP connection */412CURLSOCKTYPE_ACCEPT, /* socket created by accept() call */413CURLSOCKTYPE_LAST /* never use */414} curlsocktype;415416/* The return code from the sockopt_callback can signal information back417to libcurl: */418#define CURL_SOCKOPT_OK 0419#define CURL_SOCKOPT_ERROR 1 /* causes libcurl to abort and return420CURLE_ABORTED_BY_CALLBACK */421#define CURL_SOCKOPT_ALREADY_CONNECTED 2422423typedef int (*curl_sockopt_callback)(void *clientp,424curl_socket_t curlfd,425curlsocktype purpose);426427struct curl_sockaddr {428int family;429int socktype;430int protocol;431unsigned int addrlen; /* addrlen was a socklen_t type before 7.18.0 but it432turned really ugly and painful on the systems that433lack this type */434struct sockaddr addr;435};436437typedef curl_socket_t438(*curl_opensocket_callback)(void *clientp,439curlsocktype purpose,440struct curl_sockaddr *address);441442typedef int443(*curl_closesocket_callback)(void *clientp, curl_socket_t item);444445typedef enum {446CURLIOE_OK, /* I/O operation successful */447CURLIOE_UNKNOWNCMD, /* command was unknown to callback */448CURLIOE_FAILRESTART, /* failed to restart the read */449CURLIOE_LAST /* never use */450} curlioerr;451452typedef enum {453CURLIOCMD_NOP, /* no operation */454CURLIOCMD_RESTARTREAD, /* restart the read stream from start */455CURLIOCMD_LAST /* never use */456} curliocmd;457458typedef curlioerr (*curl_ioctl_callback)(CURL *handle,459int cmd,460void *clientp);461462#ifndef CURL_DID_MEMORY_FUNC_TYPEDEFS463/*464* The following typedef's are signatures of malloc, free, realloc, strdup and465* calloc respectively. Function pointers of these types can be passed to the466* curl_global_init_mem() function to set user defined memory management467* callback routines.468*/469typedef void *(*curl_malloc_callback)(size_t size);470typedef void (*curl_free_callback)(void *ptr);471typedef void *(*curl_realloc_callback)(void *ptr, size_t size);472typedef char *(*curl_strdup_callback)(const char *str);473typedef void *(*curl_calloc_callback)(size_t nmemb, size_t size);474475#define CURL_DID_MEMORY_FUNC_TYPEDEFS476#endif477478/* the kind of data that is passed to information_callback */479typedef enum {480CURLINFO_TEXT = 0,481CURLINFO_HEADER_IN, /* 1 */482CURLINFO_HEADER_OUT, /* 2 */483CURLINFO_DATA_IN, /* 3 */484CURLINFO_DATA_OUT, /* 4 */485CURLINFO_SSL_DATA_IN, /* 5 */486CURLINFO_SSL_DATA_OUT, /* 6 */487CURLINFO_END488} curl_infotype;489490typedef int (*curl_debug_callback)491(CURL *handle, /* the handle/transfer this concerns */492curl_infotype type, /* what kind of data */493char *data, /* points to the data */494size_t size, /* size of the data pointed to */495void *userptr); /* whatever the user please */496497/* This is the CURLOPT_PREREQFUNCTION callback prototype. */498typedef int (*curl_prereq_callback)(void *clientp,499char *conn_primary_ip,500char *conn_local_ip,501int conn_primary_port,502int conn_local_port);503504/* Return code for when the pre-request callback has terminated without505any errors */506#define CURL_PREREQFUNC_OK 0507/* Return code for when the pre-request callback wants to abort the508request */509#define CURL_PREREQFUNC_ABORT 1510511/* All possible error codes from all sorts of curl functions. Future versions512may return other values, stay prepared.513514Always add new return codes last. Never *EVER* remove any. The return515codes must remain the same!516*/517518typedef enum {519CURLE_OK = 0,520CURLE_UNSUPPORTED_PROTOCOL, /* 1 */521CURLE_FAILED_INIT, /* 2 */522CURLE_URL_MALFORMAT, /* 3 */523CURLE_NOT_BUILT_IN, /* 4 - [was obsoleted in August 2007 for5247.17.0, reused in April 2011 for 7.21.5] */525CURLE_COULDNT_RESOLVE_PROXY, /* 5 */526CURLE_COULDNT_RESOLVE_HOST, /* 6 */527CURLE_COULDNT_CONNECT, /* 7 */528CURLE_WEIRD_SERVER_REPLY, /* 8 */529CURLE_REMOTE_ACCESS_DENIED, /* 9 a service was denied by the server530due to lack of access - when login fails531this is not returned. */532CURLE_FTP_ACCEPT_FAILED, /* 10 - [was obsoleted in April 2006 for5337.15.4, reused in Dec 2011 for 7.24.0]*/534CURLE_FTP_WEIRD_PASS_REPLY, /* 11 */535CURLE_FTP_ACCEPT_TIMEOUT, /* 12 - timeout occurred accepting server536[was obsoleted in August 2007 for 7.17.0,537reused in Dec 2011 for 7.24.0]*/538CURLE_FTP_WEIRD_PASV_REPLY, /* 13 */539CURLE_FTP_WEIRD_227_FORMAT, /* 14 */540CURLE_FTP_CANT_GET_HOST, /* 15 */541CURLE_HTTP2, /* 16 - A problem in the http2 framing layer.542[was obsoleted in August 2007 for 7.17.0,543reused in July 2014 for 7.38.0] */544CURLE_FTP_COULDNT_SET_TYPE, /* 17 */545CURLE_PARTIAL_FILE, /* 18 */546CURLE_FTP_COULDNT_RETR_FILE, /* 19 */547CURLE_OBSOLETE20, /* 20 - NOT USED */548CURLE_QUOTE_ERROR, /* 21 - quote command failure */549CURLE_HTTP_RETURNED_ERROR, /* 22 */550CURLE_WRITE_ERROR, /* 23 */551CURLE_OBSOLETE24, /* 24 - NOT USED */552CURLE_UPLOAD_FAILED, /* 25 - failed upload "command" */553CURLE_READ_ERROR, /* 26 - could not open/read from file */554CURLE_OUT_OF_MEMORY, /* 27 */555CURLE_OPERATION_TIMEDOUT, /* 28 - the timeout time was reached */556CURLE_OBSOLETE29, /* 29 - NOT USED */557CURLE_FTP_PORT_FAILED, /* 30 - FTP PORT operation failed */558CURLE_FTP_COULDNT_USE_REST, /* 31 - the REST command failed */559CURLE_OBSOLETE32, /* 32 - NOT USED */560CURLE_RANGE_ERROR, /* 33 - RANGE "command" did not work */561CURLE_OBSOLETE34, /* 34 */562CURLE_SSL_CONNECT_ERROR, /* 35 - wrong when connecting with SSL */563CURLE_BAD_DOWNLOAD_RESUME, /* 36 - could not resume download */564CURLE_FILE_COULDNT_READ_FILE, /* 37 */565CURLE_LDAP_CANNOT_BIND, /* 38 */566CURLE_LDAP_SEARCH_FAILED, /* 39 */567CURLE_OBSOLETE40, /* 40 - NOT USED */568CURLE_OBSOLETE41, /* 41 - NOT USED starting with 7.53.0 */569CURLE_ABORTED_BY_CALLBACK, /* 42 */570CURLE_BAD_FUNCTION_ARGUMENT, /* 43 */571CURLE_OBSOLETE44, /* 44 - NOT USED */572CURLE_INTERFACE_FAILED, /* 45 - CURLOPT_INTERFACE failed */573CURLE_OBSOLETE46, /* 46 - NOT USED */574CURLE_TOO_MANY_REDIRECTS, /* 47 - catch endless re-direct loops */575CURLE_UNKNOWN_OPTION, /* 48 - User specified an unknown option */576CURLE_SETOPT_OPTION_SYNTAX, /* 49 - Malformed setopt option */577CURLE_OBSOLETE50, /* 50 - NOT USED */578CURLE_OBSOLETE51, /* 51 - NOT USED */579CURLE_GOT_NOTHING, /* 52 - when this is a specific error */580CURLE_SSL_ENGINE_NOTFOUND, /* 53 - SSL crypto engine not found */581CURLE_SSL_ENGINE_SETFAILED, /* 54 - can not set SSL crypto engine as582default */583CURLE_SEND_ERROR, /* 55 - failed sending network data */584CURLE_RECV_ERROR, /* 56 - failure in receiving network data */585CURLE_OBSOLETE57, /* 57 - NOT IN USE */586CURLE_SSL_CERTPROBLEM, /* 58 - problem with the local certificate */587CURLE_SSL_CIPHER, /* 59 - could not use specified cipher */588CURLE_PEER_FAILED_VERIFICATION, /* 60 - peer's certificate or fingerprint589was not verified fine */590CURLE_BAD_CONTENT_ENCODING, /* 61 - Unrecognized/bad encoding */591CURLE_OBSOLETE62, /* 62 - NOT IN USE since 7.82.0 */592CURLE_FILESIZE_EXCEEDED, /* 63 - Maximum file size exceeded */593CURLE_USE_SSL_FAILED, /* 64 - Requested FTP SSL level failed */594CURLE_SEND_FAIL_REWIND, /* 65 - Sending the data requires a rewind595that failed */596CURLE_SSL_ENGINE_INITFAILED, /* 66 - failed to initialise ENGINE */597CURLE_LOGIN_DENIED, /* 67 - user, password or similar was not598accepted and we failed to login */599CURLE_TFTP_NOTFOUND, /* 68 - file not found on server */600CURLE_TFTP_PERM, /* 69 - permission problem on server */601CURLE_REMOTE_DISK_FULL, /* 70 - out of disk space on server */602CURLE_TFTP_ILLEGAL, /* 71 - Illegal TFTP operation */603CURLE_TFTP_UNKNOWNID, /* 72 - Unknown transfer ID */604CURLE_REMOTE_FILE_EXISTS, /* 73 - File already exists */605CURLE_TFTP_NOSUCHUSER, /* 74 - No such user */606CURLE_OBSOLETE75, /* 75 - NOT IN USE since 7.82.0 */607CURLE_OBSOLETE76, /* 76 - NOT IN USE since 7.82.0 */608CURLE_SSL_CACERT_BADFILE, /* 77 - could not load CACERT file, missing609or wrong format */610CURLE_REMOTE_FILE_NOT_FOUND, /* 78 - remote file not found */611CURLE_SSH, /* 79 - error from the SSH layer, somewhat612generic so the error message will be of613interest when this has happened */614615CURLE_SSL_SHUTDOWN_FAILED, /* 80 - Failed to shut down the SSL616connection */617CURLE_AGAIN, /* 81 - socket is not ready for send/recv,618wait till it is ready and try again (Added619in 7.18.2) */620CURLE_SSL_CRL_BADFILE, /* 82 - could not load CRL file, missing or621wrong format (Added in 7.19.0) */622CURLE_SSL_ISSUER_ERROR, /* 83 - Issuer check failed. (Added in6237.19.0) */624CURLE_FTP_PRET_FAILED, /* 84 - a PRET command failed */625CURLE_RTSP_CSEQ_ERROR, /* 85 - mismatch of RTSP CSeq numbers */626CURLE_RTSP_SESSION_ERROR, /* 86 - mismatch of RTSP Session Ids */627CURLE_FTP_BAD_FILE_LIST, /* 87 - unable to parse FTP file list */628CURLE_CHUNK_FAILED, /* 88 - chunk callback reported error */629CURLE_NO_CONNECTION_AVAILABLE, /* 89 - No connection available, the630session will be queued */631CURLE_SSL_PINNEDPUBKEYNOTMATCH, /* 90 - specified pinned public key did not632match */633CURLE_SSL_INVALIDCERTSTATUS, /* 91 - invalid certificate status */634CURLE_HTTP2_STREAM, /* 92 - stream error in HTTP/2 framing layer635*/636CURLE_RECURSIVE_API_CALL, /* 93 - an api function was called from637inside a callback */638CURLE_AUTH_ERROR, /* 94 - an authentication function returned an639error */640CURLE_HTTP3, /* 95 - An HTTP/3 layer problem */641CURLE_QUIC_CONNECT_ERROR, /* 96 - QUIC connection error */642CURLE_PROXY, /* 97 - proxy handshake error */643CURLE_SSL_CLIENTCERT, /* 98 - client-side certificate required */644CURLE_UNRECOVERABLE_POLL, /* 99 - poll/select returned fatal error */645CURLE_TOO_LARGE, /* 100 - a value/data met its maximum */646CURLE_ECH_REQUIRED, /* 101 - ECH tried but failed */647CURL_LAST /* never use! */648} CURLcode;649650#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all651the obsolete stuff removed! */652653/* removed in 7.53.0 */654#define CURLE_FUNCTION_NOT_FOUND CURLE_OBSOLETE41655656/* removed in 7.56.0 */657#define CURLE_HTTP_POST_ERROR CURLE_OBSOLETE34658659/* Previously obsolete error code reused in 7.38.0 */660#define CURLE_OBSOLETE16 CURLE_HTTP2661662/* Previously obsolete error codes reused in 7.24.0 */663#define CURLE_OBSOLETE10 CURLE_FTP_ACCEPT_FAILED664#define CURLE_OBSOLETE12 CURLE_FTP_ACCEPT_TIMEOUT665666/* compatibility with older names */667#define CURLOPT_ENCODING CURLOPT_ACCEPT_ENCODING668#define CURLE_FTP_WEIRD_SERVER_REPLY CURLE_WEIRD_SERVER_REPLY669670/* The following were added in 7.62.0 */671#define CURLE_SSL_CACERT CURLE_PEER_FAILED_VERIFICATION672673/* The following were added in 7.21.5, April 2011 */674#define CURLE_UNKNOWN_TELNET_OPTION CURLE_UNKNOWN_OPTION675676/* Added for 7.78.0 */677#define CURLE_TELNET_OPTION_SYNTAX CURLE_SETOPT_OPTION_SYNTAX678679/* The following were added in 7.17.1 */680/* These are scheduled to disappear by 2009 */681#define CURLE_SSL_PEER_CERTIFICATE CURLE_PEER_FAILED_VERIFICATION682683/* The following were added in 7.17.0 */684/* These are scheduled to disappear by 2009 */685#define CURLE_OBSOLETE CURLE_OBSOLETE50 /* no one should be using this! */686#define CURLE_BAD_PASSWORD_ENTERED CURLE_OBSOLETE46687#define CURLE_BAD_CALLING_ORDER CURLE_OBSOLETE44688#define CURLE_FTP_USER_PASSWORD_INCORRECT CURLE_OBSOLETE10689#define CURLE_FTP_CANT_RECONNECT CURLE_OBSOLETE16690#define CURLE_FTP_COULDNT_GET_SIZE CURLE_OBSOLETE32691#define CURLE_FTP_COULDNT_SET_ASCII CURLE_OBSOLETE29692#define CURLE_FTP_WEIRD_USER_REPLY CURLE_OBSOLETE12693#define CURLE_FTP_WRITE_ERROR CURLE_OBSOLETE20694#define CURLE_LIBRARY_NOT_FOUND CURLE_OBSOLETE40695#define CURLE_MALFORMAT_USER CURLE_OBSOLETE24696#define CURLE_SHARE_IN_USE CURLE_OBSOLETE57697#define CURLE_URL_MALFORMAT_USER CURLE_NOT_BUILT_IN698699#define CURLE_FTP_ACCESS_DENIED CURLE_REMOTE_ACCESS_DENIED700#define CURLE_FTP_COULDNT_SET_BINARY CURLE_FTP_COULDNT_SET_TYPE701#define CURLE_FTP_QUOTE_ERROR CURLE_QUOTE_ERROR702#define CURLE_TFTP_DISKFULL CURLE_REMOTE_DISK_FULL703#define CURLE_TFTP_EXISTS CURLE_REMOTE_FILE_EXISTS704#define CURLE_HTTP_RANGE_ERROR CURLE_RANGE_ERROR705#define CURLE_FTP_SSL_FAILED CURLE_USE_SSL_FAILED706707/* The following were added earlier */708709#define CURLE_OPERATION_TIMEOUTED CURLE_OPERATION_TIMEDOUT710#define CURLE_HTTP_NOT_FOUND CURLE_HTTP_RETURNED_ERROR711#define CURLE_HTTP_PORT_FAILED CURLE_INTERFACE_FAILED712#define CURLE_FTP_COULDNT_STOR_FILE CURLE_UPLOAD_FAILED713#define CURLE_FTP_PARTIAL_FILE CURLE_PARTIAL_FILE714#define CURLE_FTP_BAD_DOWNLOAD_RESUME CURLE_BAD_DOWNLOAD_RESUME715#define CURLE_LDAP_INVALID_URL CURLE_OBSOLETE62716#define CURLE_CONV_REQD CURLE_OBSOLETE76717#define CURLE_CONV_FAILED CURLE_OBSOLETE75718719/* This was the error code 50 in 7.7.3 and a few earlier versions, this720is no longer used by libcurl but is instead #defined here only to not721make programs break */722#define CURLE_ALREADY_COMPLETE 99999723724/* Provide defines for really old option names */725#define CURLOPT_FILE CURLOPT_WRITEDATA /* name changed in 7.9.7 */726#define CURLOPT_INFILE CURLOPT_READDATA /* name changed in 7.9.7 */727#define CURLOPT_WRITEHEADER CURLOPT_HEADERDATA728729/* Since long deprecated options with no code in the lib that does anything730with them. */731#define CURLOPT_WRITEINFO CURLOPT_OBSOLETE40732#define CURLOPT_CLOSEPOLICY CURLOPT_OBSOLETE72733#define CURLOPT_OBSOLETE72 9999734#define CURLOPT_OBSOLETE40 9999735736#endif /* !CURL_NO_OLDIES */737738/*739* Proxy error codes. Returned in CURLINFO_PROXY_ERROR if CURLE_PROXY was740* return for the transfers.741*/742typedef enum {743CURLPX_OK,744CURLPX_BAD_ADDRESS_TYPE,745CURLPX_BAD_VERSION,746CURLPX_CLOSED,747CURLPX_GSSAPI,748CURLPX_GSSAPI_PERMSG,749CURLPX_GSSAPI_PROTECTION,750CURLPX_IDENTD,751CURLPX_IDENTD_DIFFER,752CURLPX_LONG_HOSTNAME,753CURLPX_LONG_PASSWD,754CURLPX_LONG_USER,755CURLPX_NO_AUTH,756CURLPX_RECV_ADDRESS,757CURLPX_RECV_AUTH,758CURLPX_RECV_CONNECT,759CURLPX_RECV_REQACK,760CURLPX_REPLY_ADDRESS_TYPE_NOT_SUPPORTED,761CURLPX_REPLY_COMMAND_NOT_SUPPORTED,762CURLPX_REPLY_CONNECTION_REFUSED,763CURLPX_REPLY_GENERAL_SERVER_FAILURE,764CURLPX_REPLY_HOST_UNREACHABLE,765CURLPX_REPLY_NETWORK_UNREACHABLE,766CURLPX_REPLY_NOT_ALLOWED,767CURLPX_REPLY_TTL_EXPIRED,768CURLPX_REPLY_UNASSIGNED,769CURLPX_REQUEST_FAILED,770CURLPX_RESOLVE_HOST,771CURLPX_SEND_AUTH,772CURLPX_SEND_CONNECT,773CURLPX_SEND_REQUEST,774CURLPX_UNKNOWN_FAIL,775CURLPX_UNKNOWN_MODE,776CURLPX_USER_REJECTED,777CURLPX_LAST /* never use */778} CURLproxycode;779780/* This prototype applies to all conversion callbacks */781typedef CURLcode (*curl_conv_callback)(char *buffer, size_t length);782783typedef CURLcode (*curl_ssl_ctx_callback)(CURL *curl, /* easy handle */784void *ssl_ctx, /* actually an OpenSSL785or wolfSSL SSL_CTX,786or an mbedTLS787mbedtls_ssl_config */788void *userptr);789790typedef enum {791CURLPROXY_HTTP = 0, /* added in 7.10, new in 7.19.4 default is to use792CONNECT HTTP/1.1 */793CURLPROXY_HTTP_1_0 = 1, /* added in 7.19.4, force to use CONNECT794HTTP/1.0 */795CURLPROXY_HTTPS = 2, /* HTTPS but stick to HTTP/1 added in 7.52.0 */796CURLPROXY_HTTPS2 = 3, /* HTTPS and attempt HTTP/2 added in 8.2.0 */797CURLPROXY_SOCKS4 = 4, /* support added in 7.15.2, enum existed already798in 7.10 */799CURLPROXY_SOCKS5 = 5, /* added in 7.10 */800CURLPROXY_SOCKS4A = 6, /* added in 7.18.0 */801CURLPROXY_SOCKS5_HOSTNAME = 7 /* Use the SOCKS5 protocol but pass along the802hostname rather than the IP address. added803in 7.18.0 */804} curl_proxytype; /* this enum was added in 7.10 */805806/*807* Bitmasks for CURLOPT_HTTPAUTH and CURLOPT_PROXYAUTH options:808*809* CURLAUTH_NONE - No HTTP authentication810* CURLAUTH_BASIC - HTTP Basic authentication (default)811* CURLAUTH_DIGEST - HTTP Digest authentication812* CURLAUTH_NEGOTIATE - HTTP Negotiate (SPNEGO) authentication813* CURLAUTH_GSSNEGOTIATE - Alias for CURLAUTH_NEGOTIATE (deprecated)814* CURLAUTH_NTLM - HTTP NTLM authentication815* CURLAUTH_DIGEST_IE - HTTP Digest authentication with IE flavour816* CURLAUTH_NTLM_WB - HTTP NTLM authentication delegated to winbind helper817* CURLAUTH_BEARER - HTTP Bearer token authentication818* CURLAUTH_ONLY - Use together with a single other type to force no819* authentication or just that single type820* CURLAUTH_ANY - All fine types set821* CURLAUTH_ANYSAFE - All fine types except Basic822*/823824#define CURLAUTH_NONE ((unsigned long)0)825#define CURLAUTH_BASIC (((unsigned long)1)<<0)826#define CURLAUTH_DIGEST (((unsigned long)1)<<1)827#define CURLAUTH_NEGOTIATE (((unsigned long)1)<<2)828/* Deprecated since the advent of CURLAUTH_NEGOTIATE */829#define CURLAUTH_GSSNEGOTIATE CURLAUTH_NEGOTIATE830/* Used for CURLOPT_SOCKS5_AUTH to stay terminologically correct */831#define CURLAUTH_GSSAPI CURLAUTH_NEGOTIATE832#define CURLAUTH_NTLM (((unsigned long)1)<<3)833#define CURLAUTH_DIGEST_IE (((unsigned long)1)<<4)834#ifndef CURL_NO_OLDIES835/* functionality removed since 8.8.0 */836#define CURLAUTH_NTLM_WB (((unsigned long)1)<<5)837#endif838#define CURLAUTH_BEARER (((unsigned long)1)<<6)839#define CURLAUTH_AWS_SIGV4 (((unsigned long)1)<<7)840#define CURLAUTH_ONLY (((unsigned long)1)<<31)841#define CURLAUTH_ANY (~CURLAUTH_DIGEST_IE)842#define CURLAUTH_ANYSAFE (~(CURLAUTH_BASIC|CURLAUTH_DIGEST_IE))843844#define CURLSSH_AUTH_ANY ~0 /* all types supported by the server */845#define CURLSSH_AUTH_NONE 0 /* none allowed, silly but complete */846#define CURLSSH_AUTH_PUBLICKEY (1<<0) /* public/private key files */847#define CURLSSH_AUTH_PASSWORD (1<<1) /* password */848#define CURLSSH_AUTH_HOST (1<<2) /* host key files */849#define CURLSSH_AUTH_KEYBOARD (1<<3) /* keyboard interactive */850#define CURLSSH_AUTH_AGENT (1<<4) /* agent (ssh-agent, pageant...) */851#define CURLSSH_AUTH_GSSAPI (1<<5) /* gssapi (kerberos, ...) */852#define CURLSSH_AUTH_DEFAULT CURLSSH_AUTH_ANY853854#define CURLGSSAPI_DELEGATION_NONE 0 /* no delegation (default) */855#define CURLGSSAPI_DELEGATION_POLICY_FLAG (1<<0) /* if permitted by policy */856#define CURLGSSAPI_DELEGATION_FLAG (1<<1) /* delegate always */857858#define CURL_ERROR_SIZE 256859860enum curl_khtype {861CURLKHTYPE_UNKNOWN,862CURLKHTYPE_RSA1,863CURLKHTYPE_RSA,864CURLKHTYPE_DSS,865CURLKHTYPE_ECDSA,866CURLKHTYPE_ED25519867};868869struct curl_khkey {870const char *key; /* points to a null-terminated string encoded with base64871if len is zero, otherwise to the "raw" data */872size_t len;873enum curl_khtype keytype;874};875876/* this is the set of return values expected from the curl_sshkeycallback877callback */878enum curl_khstat {879CURLKHSTAT_FINE_ADD_TO_FILE,880CURLKHSTAT_FINE,881CURLKHSTAT_REJECT, /* reject the connection, return an error */882CURLKHSTAT_DEFER, /* do not accept it, but we cannot answer right now.883Causes a CURLE_PEER_FAILED_VERIFICATION error but the884connection will be left intact etc */885CURLKHSTAT_FINE_REPLACE, /* accept and replace the wrong key */886CURLKHSTAT_LAST /* not for use, only a marker for last-in-list */887};888889/* this is the set of status codes pass in to the callback */890enum curl_khmatch {891CURLKHMATCH_OK, /* match */892CURLKHMATCH_MISMATCH, /* host found, key mismatch! */893CURLKHMATCH_MISSING, /* no matching host/key found */894CURLKHMATCH_LAST /* not for use, only a marker for last-in-list */895};896897typedef int898(*curl_sshkeycallback) (CURL *easy, /* easy handle */899const struct curl_khkey *knownkey, /* known */900const struct curl_khkey *foundkey, /* found */901enum curl_khmatch, /* libcurl's view on the keys */902void *clientp); /* custom pointer passed with */903/* CURLOPT_SSH_KEYDATA */904905typedef int906(*curl_sshhostkeycallback) (void *clientp,/* custom pointer passed */907/* with CURLOPT_SSH_HOSTKEYDATA */908int keytype, /* CURLKHTYPE */909const char *key, /* hostkey to check */910size_t keylen); /* length of the key */911/* return CURLE_OK to accept */912/* or something else to refuse */913914915/* parameter for the CURLOPT_USE_SSL option */916#define CURLUSESSL_NONE 0L /* do not attempt to use SSL */917#define CURLUSESSL_TRY 1L /* try using SSL, proceed anyway otherwise */918#define CURLUSESSL_CONTROL 2L /* SSL for the control connection or fail */919#define CURLUSESSL_ALL 3L /* SSL for all communication or fail */920921typedef enum {922CURLUSESSL_LAST = 4 /* not an option, never use */923} curl_usessl;924925/* Definition of bits for the CURLOPT_SSL_OPTIONS argument: */926927/* - ALLOW_BEAST tells libcurl to allow the BEAST SSL vulnerability in the928name of improving interoperability with older servers. Some SSL libraries929have introduced work-arounds for this flaw but those work-arounds sometimes930make the SSL communication fail. To regain functionality with those broken931servers, a user can this way allow the vulnerability back. */932#define CURLSSLOPT_ALLOW_BEAST (1L<<0)933934/* - NO_REVOKE tells libcurl to disable certificate revocation checks for those935SSL backends where such behavior is present. */936#define CURLSSLOPT_NO_REVOKE (1L<<1)937938/* - NO_PARTIALCHAIN tells libcurl to *NOT* accept a partial certificate chain939if possible. The OpenSSL backend has this ability. */940#define CURLSSLOPT_NO_PARTIALCHAIN (1L<<2)941942/* - REVOKE_BEST_EFFORT tells libcurl to ignore certificate revocation offline943checks and ignore missing revocation list for those SSL backends where such944behavior is present. */945#define CURLSSLOPT_REVOKE_BEST_EFFORT (1L<<3)946947/* - CURLSSLOPT_NATIVE_CA tells libcurl to use standard certificate store of948operating system. Currently implemented under MS-Windows. */949#define CURLSSLOPT_NATIVE_CA (1L<<4)950951/* - CURLSSLOPT_AUTO_CLIENT_CERT tells libcurl to automatically locate and use952a client certificate for authentication. (Schannel) */953#define CURLSSLOPT_AUTO_CLIENT_CERT (1L<<5)954955/* If possible, send data using TLS 1.3 early data */956#define CURLSSLOPT_EARLYDATA (1L<<6)957958/* The default connection attempt delay in milliseconds for happy eyeballs.959CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS.3 and happy-eyeballs-timeout-ms.d document960this value, keep them in sync. */961#define CURL_HET_DEFAULT 200L962963/* The default connection upkeep interval in milliseconds. */964#define CURL_UPKEEP_INTERVAL_DEFAULT 60000L965966#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all967the obsolete stuff removed! */968969/* Backwards compatibility with older names */970/* These are scheduled to disappear by 2009 */971972#define CURLFTPSSL_NONE CURLUSESSL_NONE973#define CURLFTPSSL_TRY CURLUSESSL_TRY974#define CURLFTPSSL_CONTROL CURLUSESSL_CONTROL975#define CURLFTPSSL_ALL CURLUSESSL_ALL976#define CURLFTPSSL_LAST CURLUSESSL_LAST977#define curl_ftpssl curl_usessl978#endif /* !CURL_NO_OLDIES */979980/* parameter for the CURLOPT_FTP_SSL_CCC option */981typedef enum {982CURLFTPSSL_CCC_NONE, /* do not send CCC */983CURLFTPSSL_CCC_PASSIVE, /* Let the server initiate the shutdown */984CURLFTPSSL_CCC_ACTIVE, /* Initiate the shutdown */985CURLFTPSSL_CCC_LAST /* not an option, never use */986} curl_ftpccc;987988/* parameter for the CURLOPT_FTPSSLAUTH option */989typedef enum {990CURLFTPAUTH_DEFAULT, /* let libcurl decide */991CURLFTPAUTH_SSL, /* use "AUTH SSL" */992CURLFTPAUTH_TLS, /* use "AUTH TLS" */993CURLFTPAUTH_LAST /* not an option, never use */994} curl_ftpauth;995996/* parameter for the CURLOPT_FTP_CREATE_MISSING_DIRS option */997typedef enum {998CURLFTP_CREATE_DIR_NONE, /* do NOT create missing dirs! */999CURLFTP_CREATE_DIR, /* (FTP/SFTP) if CWD fails, try MKD and then CWD1000again if MKD succeeded, for SFTP this does1001similar magic */1002CURLFTP_CREATE_DIR_RETRY, /* (FTP only) if CWD fails, try MKD and then CWD1003again even if MKD failed! */1004CURLFTP_CREATE_DIR_LAST /* not an option, never use */1005} curl_ftpcreatedir;10061007/* parameter for the CURLOPT_FTP_FILEMETHOD option */1008typedef enum {1009CURLFTPMETHOD_DEFAULT, /* let libcurl pick */1010CURLFTPMETHOD_MULTICWD, /* single CWD operation for each path part */1011CURLFTPMETHOD_NOCWD, /* no CWD at all */1012CURLFTPMETHOD_SINGLECWD, /* one CWD to full dir, then work on file */1013CURLFTPMETHOD_LAST /* not an option, never use */1014} curl_ftpmethod;10151016/* bitmask defines for CURLOPT_HEADEROPT */1017#define CURLHEADER_UNIFIED 01018#define CURLHEADER_SEPARATE (1<<0)10191020/* CURLALTSVC_* are bits for the CURLOPT_ALTSVC_CTRL option */1021#define CURLALTSVC_READONLYFILE (1<<2)1022#define CURLALTSVC_H1 (1<<3)1023#define CURLALTSVC_H2 (1<<4)1024#define CURLALTSVC_H3 (1<<5)10251026/* bitmask values for CURLOPT_UPLOAD_FLAGS */1027#define CURLULFLAG_ANSWERED (1L<<0)1028#define CURLULFLAG_DELETED (1L<<1)1029#define CURLULFLAG_DRAFT (1L<<2)1030#define CURLULFLAG_FLAGGED (1L<<3)1031#define CURLULFLAG_SEEN (1L<<4)10321033struct curl_hstsentry {1034char *name;1035size_t namelen;1036unsigned int includeSubDomains:1;1037char expire[18]; /* YYYYMMDD HH:MM:SS [null-terminated] */1038};10391040struct curl_index {1041size_t index; /* the provided entry's "index" or count */1042size_t total; /* total number of entries to save */1043};10441045typedef enum {1046CURLSTS_OK,1047CURLSTS_DONE,1048CURLSTS_FAIL1049} CURLSTScode;10501051typedef CURLSTScode (*curl_hstsread_callback)(CURL *easy,1052struct curl_hstsentry *e,1053void *userp);1054typedef CURLSTScode (*curl_hstswrite_callback)(CURL *easy,1055struct curl_hstsentry *e,1056struct curl_index *i,1057void *userp);10581059/* CURLHSTS_* are bits for the CURLOPT_HSTS option */1060#define CURLHSTS_ENABLE (long)(1<<0)1061#define CURLHSTS_READONLYFILE (long)(1<<1)10621063/* The CURLPROTO_ defines below are for the **deprecated** CURLOPT_*PROTOCOLS1064options. Do not use. */1065#define CURLPROTO_HTTP (1<<0)1066#define CURLPROTO_HTTPS (1<<1)1067#define CURLPROTO_FTP (1<<2)1068#define CURLPROTO_FTPS (1<<3)1069#define CURLPROTO_SCP (1<<4)1070#define CURLPROTO_SFTP (1<<5)1071#define CURLPROTO_TELNET (1<<6)1072#define CURLPROTO_LDAP (1<<7)1073#define CURLPROTO_LDAPS (1<<8)1074#define CURLPROTO_DICT (1<<9)1075#define CURLPROTO_FILE (1<<10)1076#define CURLPROTO_TFTP (1<<11)1077#define CURLPROTO_IMAP (1<<12)1078#define CURLPROTO_IMAPS (1<<13)1079#define CURLPROTO_POP3 (1<<14)1080#define CURLPROTO_POP3S (1<<15)1081#define CURLPROTO_SMTP (1<<16)1082#define CURLPROTO_SMTPS (1<<17)1083#define CURLPROTO_RTSP (1<<18)1084#define CURLPROTO_RTMP (1<<19)1085#define CURLPROTO_RTMPT (1<<20)1086#define CURLPROTO_RTMPE (1<<21)1087#define CURLPROTO_RTMPTE (1<<22)1088#define CURLPROTO_RTMPS (1<<23)1089#define CURLPROTO_RTMPTS (1<<24)1090#define CURLPROTO_GOPHER (1<<25)1091#define CURLPROTO_SMB (1<<26)1092#define CURLPROTO_SMBS (1<<27)1093#define CURLPROTO_MQTT (1<<28)1094#define CURLPROTO_GOPHERS (1<<29)1095#define CURLPROTO_ALL (~0) /* enable everything */10961097/* long may be 32 or 64 bits, but we should never depend on anything else1098but 32 */1099#define CURLOPTTYPE_LONG 01100#define CURLOPTTYPE_OBJECTPOINT 100001101#define CURLOPTTYPE_FUNCTIONPOINT 200001102#define CURLOPTTYPE_OFF_T 300001103#define CURLOPTTYPE_BLOB 4000011041105/* *STRINGPOINT is an alias for OBJECTPOINT to allow tools to extract the1106string options from the header file */110711081109#define CURLOPT(na,t,nu) na = t + nu1110#define CURLOPTDEPRECATED(na,t,nu,v,m) na CURL_DEPRECATED(v,m) = t + nu11111112/* CURLOPT aliases that make no runtime difference */11131114/* 'char *' argument to a string with a trailing zero */1115#define CURLOPTTYPE_STRINGPOINT CURLOPTTYPE_OBJECTPOINT11161117/* 'struct curl_slist *' argument */1118#define CURLOPTTYPE_SLISTPOINT CURLOPTTYPE_OBJECTPOINT11191120/* 'void *' argument passed untouched to callback */1121#define CURLOPTTYPE_CBPOINT CURLOPTTYPE_OBJECTPOINT11221123/* 'long' argument with a set of values/bitmask */1124#define CURLOPTTYPE_VALUES CURLOPTTYPE_LONG11251126/*1127* All CURLOPT_* values.1128*/11291130typedef enum {1131/* This is the FILE * or void * the regular output should be written to. */1132CURLOPT(CURLOPT_WRITEDATA, CURLOPTTYPE_CBPOINT, 1),11331134/* The full URL to get/put */1135CURLOPT(CURLOPT_URL, CURLOPTTYPE_STRINGPOINT, 2),11361137/* Port number to connect to, if other than default. */1138CURLOPT(CURLOPT_PORT, CURLOPTTYPE_LONG, 3),11391140/* Name of proxy to use. */1141CURLOPT(CURLOPT_PROXY, CURLOPTTYPE_STRINGPOINT, 4),11421143/* "user:password;options" to use when fetching. */1144CURLOPT(CURLOPT_USERPWD, CURLOPTTYPE_STRINGPOINT, 5),11451146/* "user:password" to use with proxy. */1147CURLOPT(CURLOPT_PROXYUSERPWD, CURLOPTTYPE_STRINGPOINT, 6),11481149/* Range to get, specified as an ASCII string. */1150CURLOPT(CURLOPT_RANGE, CURLOPTTYPE_STRINGPOINT, 7),11511152/* not used */11531154/* Specified file stream to upload from (use as input): */1155CURLOPT(CURLOPT_READDATA, CURLOPTTYPE_CBPOINT, 9),11561157/* Buffer to receive error messages in, must be at least CURL_ERROR_SIZE1158* bytes big. */1159CURLOPT(CURLOPT_ERRORBUFFER, CURLOPTTYPE_OBJECTPOINT, 10),11601161/* Function that will be called to store the output (instead of fwrite). The1162* parameters will use fwrite() syntax, make sure to follow them. */1163CURLOPT(CURLOPT_WRITEFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 11),11641165/* Function that will be called to read the input (instead of fread). The1166* parameters will use fread() syntax, make sure to follow them. */1167CURLOPT(CURLOPT_READFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 12),11681169/* Time-out the read operation after this amount of seconds */1170CURLOPT(CURLOPT_TIMEOUT, CURLOPTTYPE_LONG, 13),11711172/* If CURLOPT_READDATA is used, this can be used to inform libcurl about1173* how large the file being sent really is. That allows better error1174* checking and better verifies that the upload was successful. -1 means1175* unknown size.1176*1177* For large file support, there is also a _LARGE version of the key1178* which takes an off_t type, allowing platforms with larger off_t1179* sizes to handle larger files. See below for INFILESIZE_LARGE.1180*/1181CURLOPT(CURLOPT_INFILESIZE, CURLOPTTYPE_LONG, 14),11821183/* POST static input fields. */1184CURLOPT(CURLOPT_POSTFIELDS, CURLOPTTYPE_OBJECTPOINT, 15),11851186/* Set the referrer page (needed by some CGIs) */1187CURLOPT(CURLOPT_REFERER, CURLOPTTYPE_STRINGPOINT, 16),11881189/* Set the FTP PORT string (interface name, named or numerical IP address)1190Use i.e '-' to use default address. */1191CURLOPT(CURLOPT_FTPPORT, CURLOPTTYPE_STRINGPOINT, 17),11921193/* Set the User-Agent string (examined by some CGIs) */1194CURLOPT(CURLOPT_USERAGENT, CURLOPTTYPE_STRINGPOINT, 18),11951196/* If the download receives less than "low speed limit" bytes/second1197* during "low speed time" seconds, the operations is aborted.1198* You could i.e if you have a pretty high speed connection, abort if1199* it is less than 2000 bytes/sec during 20 seconds.1200*/12011202/* Set the "low speed limit" */1203CURLOPT(CURLOPT_LOW_SPEED_LIMIT, CURLOPTTYPE_LONG, 19),12041205/* Set the "low speed time" */1206CURLOPT(CURLOPT_LOW_SPEED_TIME, CURLOPTTYPE_LONG, 20),12071208/* Set the continuation offset.1209*1210* Note there is also a _LARGE version of this key which uses1211* off_t types, allowing for large file offsets on platforms which1212* use larger-than-32-bit off_t's. Look below for RESUME_FROM_LARGE.1213*/1214CURLOPT(CURLOPT_RESUME_FROM, CURLOPTTYPE_LONG, 21),12151216/* Set cookie in request: */1217CURLOPT(CURLOPT_COOKIE, CURLOPTTYPE_STRINGPOINT, 22),12181219/* This points to a linked list of headers, struct curl_slist kind. This1220list is also used for RTSP (in spite of its name) */1221CURLOPT(CURLOPT_HTTPHEADER, CURLOPTTYPE_SLISTPOINT, 23),12221223/* This points to a linked list of post entries, struct curl_httppost */1224CURLOPTDEPRECATED(CURLOPT_HTTPPOST, CURLOPTTYPE_OBJECTPOINT, 24,12257.56.0, "Use CURLOPT_MIMEPOST"),12261227/* name of the file keeping your private SSL-certificate */1228CURLOPT(CURLOPT_SSLCERT, CURLOPTTYPE_STRINGPOINT, 25),12291230/* password for the SSL or SSH private key */1231CURLOPT(CURLOPT_KEYPASSWD, CURLOPTTYPE_STRINGPOINT, 26),12321233/* send TYPE parameter? */1234CURLOPT(CURLOPT_CRLF, CURLOPTTYPE_LONG, 27),12351236/* send linked-list of QUOTE commands */1237CURLOPT(CURLOPT_QUOTE, CURLOPTTYPE_SLISTPOINT, 28),12381239/* send FILE * or void * to store headers to, if you use a callback it1240is simply passed to the callback unmodified */1241CURLOPT(CURLOPT_HEADERDATA, CURLOPTTYPE_CBPOINT, 29),12421243/* point to a file to read the initial cookies from, also enables1244"cookie awareness" */1245CURLOPT(CURLOPT_COOKIEFILE, CURLOPTTYPE_STRINGPOINT, 31),12461247/* What version to specifically try to use.1248See CURL_SSLVERSION defines below. */1249CURLOPT(CURLOPT_SSLVERSION, CURLOPTTYPE_VALUES, 32),12501251/* What kind of HTTP time condition to use, see defines */1252CURLOPT(CURLOPT_TIMECONDITION, CURLOPTTYPE_VALUES, 33),12531254/* Time to use with the above condition. Specified in number of seconds1255since 1 Jan 1970 */1256CURLOPT(CURLOPT_TIMEVALUE, CURLOPTTYPE_LONG, 34),12571258/* 35 = OBSOLETE */12591260/* Custom request, for customizing the get command like1261HTTP: DELETE, TRACE and others1262FTP: to use a different list command1263*/1264CURLOPT(CURLOPT_CUSTOMREQUEST, CURLOPTTYPE_STRINGPOINT, 36),12651266/* FILE handle to use instead of stderr */1267CURLOPT(CURLOPT_STDERR, CURLOPTTYPE_OBJECTPOINT, 37),12681269/* 38 is not used */12701271/* send linked-list of post-transfer QUOTE commands */1272CURLOPT(CURLOPT_POSTQUOTE, CURLOPTTYPE_SLISTPOINT, 39),12731274/* 40 is not used */12751276/* talk a lot */1277CURLOPT(CURLOPT_VERBOSE, CURLOPTTYPE_LONG, 41),12781279/* throw the header out too */1280CURLOPT(CURLOPT_HEADER, CURLOPTTYPE_LONG, 42),12811282/* shut off the progress meter */1283CURLOPT(CURLOPT_NOPROGRESS, CURLOPTTYPE_LONG, 43),12841285/* use HEAD to get http document */1286CURLOPT(CURLOPT_NOBODY, CURLOPTTYPE_LONG, 44),12871288/* no output on http error codes >= 400 */1289CURLOPT(CURLOPT_FAILONERROR, CURLOPTTYPE_LONG, 45),12901291/* this is an upload */1292CURLOPT(CURLOPT_UPLOAD, CURLOPTTYPE_LONG, 46),12931294/* HTTP POST method */1295CURLOPT(CURLOPT_POST, CURLOPTTYPE_LONG, 47),12961297/* bare names when listing directories */1298CURLOPT(CURLOPT_DIRLISTONLY, CURLOPTTYPE_LONG, 48),12991300/* Append instead of overwrite on upload! */1301CURLOPT(CURLOPT_APPEND, CURLOPTTYPE_LONG, 50),13021303/* Specify whether to read the user+password from the .netrc or the URL.1304* This must be one of the CURL_NETRC_* enums below. */1305CURLOPT(CURLOPT_NETRC, CURLOPTTYPE_VALUES, 51),13061307/* use Location: Luke! */1308CURLOPT(CURLOPT_FOLLOWLOCATION, CURLOPTTYPE_LONG, 52),13091310/* transfer data in text/ASCII format */1311CURLOPT(CURLOPT_TRANSFERTEXT, CURLOPTTYPE_LONG, 53),13121313/* HTTP PUT */1314CURLOPTDEPRECATED(CURLOPT_PUT, CURLOPTTYPE_LONG, 54,13157.12.1, "Use CURLOPT_UPLOAD"),13161317/* 55 = OBSOLETE */13181319/* DEPRECATED1320* Function that will be called instead of the internal progress display1321* function. This function should be defined as the curl_progress_callback1322* prototype defines. */1323CURLOPTDEPRECATED(CURLOPT_PROGRESSFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 56,13247.32.0, "Use CURLOPT_XFERINFOFUNCTION"),13251326/* Data passed to the CURLOPT_PROGRESSFUNCTION and CURLOPT_XFERINFOFUNCTION1327callbacks */1328CURLOPT(CURLOPT_XFERINFODATA, CURLOPTTYPE_CBPOINT, 57),1329#define CURLOPT_PROGRESSDATA CURLOPT_XFERINFODATA13301331/* We want the referrer field set automatically when following locations */1332CURLOPT(CURLOPT_AUTOREFERER, CURLOPTTYPE_LONG, 58),13331334/* Port of the proxy, can be set in the proxy string as well with:1335"[host]:[port]" */1336CURLOPT(CURLOPT_PROXYPORT, CURLOPTTYPE_LONG, 59),13371338/* size of the POST input data, if strlen() is not good to use */1339CURLOPT(CURLOPT_POSTFIELDSIZE, CURLOPTTYPE_LONG, 60),13401341/* tunnel non-http operations through an HTTP proxy */1342CURLOPT(CURLOPT_HTTPPROXYTUNNEL, CURLOPTTYPE_LONG, 61),13431344/* Set the interface string to use as outgoing network interface */1345CURLOPT(CURLOPT_INTERFACE, CURLOPTTYPE_STRINGPOINT, 62),13461347/* Set the krb4/5 security level, this also enables krb4/5 awareness. This1348* is a string, 'clear', 'safe', 'confidential' or 'private'. If the string1349* is set but does not match one of these, 'private' will be used. */1350CURLOPT(CURLOPT_KRBLEVEL, CURLOPTTYPE_STRINGPOINT, 63),13511352/* Set if we should verify the peer in ssl handshake, set 1 to verify. */1353CURLOPT(CURLOPT_SSL_VERIFYPEER, CURLOPTTYPE_LONG, 64),13541355/* The CApath or CAfile used to validate the peer certificate1356this option is used only if SSL_VERIFYPEER is true */1357CURLOPT(CURLOPT_CAINFO, CURLOPTTYPE_STRINGPOINT, 65),13581359/* 66 = OBSOLETE */1360/* 67 = OBSOLETE */13611362/* Maximum number of http redirects to follow */1363CURLOPT(CURLOPT_MAXREDIRS, CURLOPTTYPE_LONG, 68),13641365/* Pass a long set to 1 to get the date of the requested document (if1366possible)! Pass a zero to shut it off. */1367CURLOPT(CURLOPT_FILETIME, CURLOPTTYPE_LONG, 69),13681369/* This points to a linked list of telnet options */1370CURLOPT(CURLOPT_TELNETOPTIONS, CURLOPTTYPE_SLISTPOINT, 70),13711372/* Max amount of cached alive connections */1373CURLOPT(CURLOPT_MAXCONNECTS, CURLOPTTYPE_LONG, 71),13741375/* 72 = OBSOLETE */1376/* 73 = OBSOLETE */13771378/* Set to explicitly use a new connection for the upcoming transfer.1379Do not use this unless you are absolutely sure of this, as it makes the1380operation slower and is less friendly for the network. */1381CURLOPT(CURLOPT_FRESH_CONNECT, CURLOPTTYPE_LONG, 74),13821383/* Set to explicitly forbid the upcoming transfer's connection to be reused1384when done. Do not use this unless you are absolutely sure of this, as it1385makes the operation slower and is less friendly for the network. */1386CURLOPT(CURLOPT_FORBID_REUSE, CURLOPTTYPE_LONG, 75),13871388/* Set to a filename that contains random data for libcurl to use to1389seed the random engine when doing SSL connects. */1390CURLOPTDEPRECATED(CURLOPT_RANDOM_FILE, CURLOPTTYPE_STRINGPOINT, 76,13917.84.0, "Serves no purpose anymore"),13921393/* Set to the Entropy Gathering Daemon socket pathname */1394CURLOPTDEPRECATED(CURLOPT_EGDSOCKET, CURLOPTTYPE_STRINGPOINT, 77,13957.84.0, "Serves no purpose anymore"),13961397/* Time-out connect operations after this amount of seconds, if connects are1398OK within this time, then fine... This only aborts the connect phase. */1399CURLOPT(CURLOPT_CONNECTTIMEOUT, CURLOPTTYPE_LONG, 78),14001401/* Function that will be called to store headers (instead of fwrite). The1402* parameters will use fwrite() syntax, make sure to follow them. */1403CURLOPT(CURLOPT_HEADERFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 79),14041405/* Set this to force the HTTP request to get back to GET. Only really usable1406if POST, PUT or a custom request have been used first.1407*/1408CURLOPT(CURLOPT_HTTPGET, CURLOPTTYPE_LONG, 80),14091410/* Set if we should verify the Common name from the peer certificate in ssl1411* handshake, set 1 to check existence, 2 to ensure that it matches the1412* provided hostname. */1413CURLOPT(CURLOPT_SSL_VERIFYHOST, CURLOPTTYPE_LONG, 81),14141415/* Specify which filename to write all known cookies in after completed1416operation. Set filename to "-" (dash) to make it go to stdout. */1417CURLOPT(CURLOPT_COOKIEJAR, CURLOPTTYPE_STRINGPOINT, 82),14181419/* Specify which TLS 1.2 (1.1, 1.0) ciphers to use */1420CURLOPT(CURLOPT_SSL_CIPHER_LIST, CURLOPTTYPE_STRINGPOINT, 83),14211422/* Specify which HTTP version to use! This must be set to one of the1423CURL_HTTP_VERSION* enums set below. */1424CURLOPT(CURLOPT_HTTP_VERSION, CURLOPTTYPE_VALUES, 84),14251426/* Specifically switch on or off the FTP engine's use of the EPSV command. By1427default, that one will always be attempted before the more traditional1428PASV command. */1429CURLOPT(CURLOPT_FTP_USE_EPSV, CURLOPTTYPE_LONG, 85),14301431/* type of the file keeping your SSL-certificate ("DER", "PEM", "ENG") */1432CURLOPT(CURLOPT_SSLCERTTYPE, CURLOPTTYPE_STRINGPOINT, 86),14331434/* name of the file keeping your private SSL-key */1435CURLOPT(CURLOPT_SSLKEY, CURLOPTTYPE_STRINGPOINT, 87),14361437/* type of the file keeping your private SSL-key ("DER", "PEM", "ENG") */1438CURLOPT(CURLOPT_SSLKEYTYPE, CURLOPTTYPE_STRINGPOINT, 88),14391440/* crypto engine for the SSL-sub system */1441CURLOPT(CURLOPT_SSLENGINE, CURLOPTTYPE_STRINGPOINT, 89),14421443/* set the crypto engine for the SSL-sub system as default1444the param has no meaning...1445*/1446CURLOPT(CURLOPT_SSLENGINE_DEFAULT, CURLOPTTYPE_LONG, 90),14471448/* Non-zero value means to use the global dns cache */1449/* DEPRECATED, do not use! */1450CURLOPTDEPRECATED(CURLOPT_DNS_USE_GLOBAL_CACHE, CURLOPTTYPE_LONG, 91,14517.11.1, "Use CURLOPT_SHARE"),14521453/* DNS cache timeout */1454CURLOPT(CURLOPT_DNS_CACHE_TIMEOUT, CURLOPTTYPE_LONG, 92),14551456/* send linked-list of pre-transfer QUOTE commands */1457CURLOPT(CURLOPT_PREQUOTE, CURLOPTTYPE_SLISTPOINT, 93),14581459/* set the debug function */1460CURLOPT(CURLOPT_DEBUGFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 94),14611462/* set the data for the debug function */1463CURLOPT(CURLOPT_DEBUGDATA, CURLOPTTYPE_CBPOINT, 95),14641465/* mark this as start of a cookie session */1466CURLOPT(CURLOPT_COOKIESESSION, CURLOPTTYPE_LONG, 96),14671468/* The CApath directory used to validate the peer certificate1469this option is used only if SSL_VERIFYPEER is true */1470CURLOPT(CURLOPT_CAPATH, CURLOPTTYPE_STRINGPOINT, 97),14711472/* Instruct libcurl to use a smaller receive buffer */1473CURLOPT(CURLOPT_BUFFERSIZE, CURLOPTTYPE_LONG, 98),14741475/* Instruct libcurl to not use any signal/alarm handlers, even when using1476timeouts. This option is useful for multi-threaded applications.1477See libcurl-the-guide for more background information. */1478CURLOPT(CURLOPT_NOSIGNAL, CURLOPTTYPE_LONG, 99),14791480/* Provide a CURLShare for mutexing non-ts data */1481CURLOPT(CURLOPT_SHARE, CURLOPTTYPE_OBJECTPOINT, 100),14821483/* indicates type of proxy. accepted values are CURLPROXY_HTTP (default),1484CURLPROXY_HTTPS, CURLPROXY_SOCKS4, CURLPROXY_SOCKS4A and1485CURLPROXY_SOCKS5. */1486CURLOPT(CURLOPT_PROXYTYPE, CURLOPTTYPE_VALUES, 101),14871488/* Set the Accept-Encoding string. Use this to tell a server you would like1489the response to be compressed. Before 7.21.6, this was known as1490CURLOPT_ENCODING */1491CURLOPT(CURLOPT_ACCEPT_ENCODING, CURLOPTTYPE_STRINGPOINT, 102),14921493/* Set pointer to private data */1494CURLOPT(CURLOPT_PRIVATE, CURLOPTTYPE_OBJECTPOINT, 103),14951496/* Set aliases for HTTP 200 in the HTTP Response header */1497CURLOPT(CURLOPT_HTTP200ALIASES, CURLOPTTYPE_SLISTPOINT, 104),14981499/* Continue to send authentication (user+password) when following locations,1500even when hostname changed. This can potentially send off the name1501and password to whatever host the server decides. */1502CURLOPT(CURLOPT_UNRESTRICTED_AUTH, CURLOPTTYPE_LONG, 105),15031504/* Specifically switch on or off the FTP engine's use of the EPRT command (1505it also disables the LPRT attempt). By default, those ones will always be1506attempted before the good old traditional PORT command. */1507CURLOPT(CURLOPT_FTP_USE_EPRT, CURLOPTTYPE_LONG, 106),15081509/* Set this to a bitmask value to enable the particular authentications1510methods you like. Use this in combination with CURLOPT_USERPWD.1511Note that setting multiple bits may cause extra network round-trips. */1512CURLOPT(CURLOPT_HTTPAUTH, CURLOPTTYPE_VALUES, 107),15131514/* Set the ssl context callback function, currently only for OpenSSL or1515wolfSSL ssl_ctx, or mbedTLS mbedtls_ssl_config in the second argument.1516The function must match the curl_ssl_ctx_callback prototype. */1517CURLOPT(CURLOPT_SSL_CTX_FUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 108),15181519/* Set the userdata for the ssl context callback function's third1520argument */1521CURLOPT(CURLOPT_SSL_CTX_DATA, CURLOPTTYPE_CBPOINT, 109),15221523/* FTP Option that causes missing dirs to be created on the remote server.1524In 7.19.4 we introduced the convenience enums for this option using the1525CURLFTP_CREATE_DIR prefix.1526*/1527CURLOPT(CURLOPT_FTP_CREATE_MISSING_DIRS, CURLOPTTYPE_LONG, 110),15281529/* Set this to a bitmask value to enable the particular authentications1530methods you like. Use this in combination with CURLOPT_PROXYUSERPWD.1531Note that setting multiple bits may cause extra network round-trips. */1532CURLOPT(CURLOPT_PROXYAUTH, CURLOPTTYPE_VALUES, 111),15331534/* Option that changes the timeout, in seconds, associated with getting a1535response. This is different from transfer timeout time and essentially1536places a demand on the server to acknowledge commands in a timely1537manner. For FTP, SMTP, IMAP and POP3. */1538CURLOPT(CURLOPT_SERVER_RESPONSE_TIMEOUT, CURLOPTTYPE_LONG, 112),15391540/* Set this option to one of the CURL_IPRESOLVE_* defines (see below) to1541tell libcurl to use those IP versions only. This only has effect on1542systems with support for more than one, i.e IPv4 _and_ IPv6. */1543CURLOPT(CURLOPT_IPRESOLVE, CURLOPTTYPE_VALUES, 113),15441545/* Set this option to limit the size of a file that will be downloaded from1546an HTTP or FTP server.15471548Note there is also _LARGE version which adds large file support for1549platforms which have larger off_t sizes. See MAXFILESIZE_LARGE below. */1550CURLOPT(CURLOPT_MAXFILESIZE, CURLOPTTYPE_LONG, 114),15511552/* See the comment for INFILESIZE above, but in short, specifies1553* the size of the file being uploaded. -1 means unknown.1554*/1555CURLOPT(CURLOPT_INFILESIZE_LARGE, CURLOPTTYPE_OFF_T, 115),15561557/* Sets the continuation offset. There is also a CURLOPTTYPE_LONG version1558* of this; look above for RESUME_FROM.1559*/1560CURLOPT(CURLOPT_RESUME_FROM_LARGE, CURLOPTTYPE_OFF_T, 116),15611562/* Sets the maximum size of data that will be downloaded from1563* an HTTP or FTP server. See MAXFILESIZE above for the LONG version.1564*/1565CURLOPT(CURLOPT_MAXFILESIZE_LARGE, CURLOPTTYPE_OFF_T, 117),15661567/* Set this option to the filename of your .netrc file you want libcurl1568to parse (using the CURLOPT_NETRC option). If not set, libcurl will do1569a poor attempt to find the user's home directory and check for a .netrc1570file in there. */1571CURLOPT(CURLOPT_NETRC_FILE, CURLOPTTYPE_STRINGPOINT, 118),15721573/* Enable SSL/TLS for FTP, pick one of:1574CURLUSESSL_TRY - try using SSL, proceed anyway otherwise1575CURLUSESSL_CONTROL - SSL for the control connection or fail1576CURLUSESSL_ALL - SSL for all communication or fail1577*/1578CURLOPT(CURLOPT_USE_SSL, CURLOPTTYPE_VALUES, 119),15791580/* The _LARGE version of the standard POSTFIELDSIZE option */1581CURLOPT(CURLOPT_POSTFIELDSIZE_LARGE, CURLOPTTYPE_OFF_T, 120),15821583/* Enable/disable the TCP Nagle algorithm */1584CURLOPT(CURLOPT_TCP_NODELAY, CURLOPTTYPE_LONG, 121),15851586/* 122 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */1587/* 123 OBSOLETE. Gone in 7.16.0 */1588/* 124 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */1589/* 125 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */1590/* 126 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */1591/* 127 OBSOLETE. Gone in 7.16.0 */1592/* 128 OBSOLETE. Gone in 7.16.0 */15931594/* When FTP over SSL/TLS is selected (with CURLOPT_USE_SSL), this option1595can be used to change libcurl's default action which is to first try1596"AUTH SSL" and then "AUTH TLS" in this order, and proceed when a OK1597response has been received.15981599Available parameters are:1600CURLFTPAUTH_DEFAULT - let libcurl decide1601CURLFTPAUTH_SSL - try "AUTH SSL" first, then TLS1602CURLFTPAUTH_TLS - try "AUTH TLS" first, then SSL1603*/1604CURLOPT(CURLOPT_FTPSSLAUTH, CURLOPTTYPE_VALUES, 129),16051606CURLOPTDEPRECATED(CURLOPT_IOCTLFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 130,16077.18.0, "Use CURLOPT_SEEKFUNCTION"),1608CURLOPTDEPRECATED(CURLOPT_IOCTLDATA, CURLOPTTYPE_CBPOINT, 131,16097.18.0, "Use CURLOPT_SEEKDATA"),16101611/* 132 OBSOLETE. Gone in 7.16.0 */1612/* 133 OBSOLETE. Gone in 7.16.0 */16131614/* null-terminated string for pass on to the FTP server when asked for1615"account" info */1616CURLOPT(CURLOPT_FTP_ACCOUNT, CURLOPTTYPE_STRINGPOINT, 134),16171618/* feed cookie into cookie engine */1619CURLOPT(CURLOPT_COOKIELIST, CURLOPTTYPE_STRINGPOINT, 135),16201621/* ignore Content-Length */1622CURLOPT(CURLOPT_IGNORE_CONTENT_LENGTH, CURLOPTTYPE_LONG, 136),16231624/* Set to non-zero to skip the IP address received in a 227 PASV FTP server1625response. Typically used for FTP-SSL purposes but is not restricted to1626that. libcurl will then instead use the same IP address it used for the1627control connection. */1628CURLOPT(CURLOPT_FTP_SKIP_PASV_IP, CURLOPTTYPE_LONG, 137),16291630/* Select "file method" to use when doing FTP, see the curl_ftpmethod1631above. */1632CURLOPT(CURLOPT_FTP_FILEMETHOD, CURLOPTTYPE_VALUES, 138),16331634/* Local port number to bind the socket to */1635CURLOPT(CURLOPT_LOCALPORT, CURLOPTTYPE_LONG, 139),16361637/* Number of ports to try, including the first one set with LOCALPORT.1638Thus, setting it to 1 will make no additional attempts but the first.1639*/1640CURLOPT(CURLOPT_LOCALPORTRANGE, CURLOPTTYPE_LONG, 140),16411642/* no transfer, set up connection and let application use the socket by1643extracting it with CURLINFO_LASTSOCKET */1644CURLOPT(CURLOPT_CONNECT_ONLY, CURLOPTTYPE_LONG, 141),16451646/* Function that will be called to convert from the1647network encoding (instead of using the iconv calls in libcurl) */1648CURLOPTDEPRECATED(CURLOPT_CONV_FROM_NETWORK_FUNCTION,1649CURLOPTTYPE_FUNCTIONPOINT, 142,16507.82.0, "Serves no purpose anymore"),16511652/* Function that will be called to convert to the1653network encoding (instead of using the iconv calls in libcurl) */1654CURLOPTDEPRECATED(CURLOPT_CONV_TO_NETWORK_FUNCTION,1655CURLOPTTYPE_FUNCTIONPOINT, 143,16567.82.0, "Serves no purpose anymore"),16571658/* Function that will be called to convert from UTF81659(instead of using the iconv calls in libcurl)1660Note that this is used only for SSL certificate processing */1661CURLOPTDEPRECATED(CURLOPT_CONV_FROM_UTF8_FUNCTION,1662CURLOPTTYPE_FUNCTIONPOINT, 144,16637.82.0, "Serves no purpose anymore"),16641665/* if the connection proceeds too quickly then need to slow it down */1666/* limit-rate: maximum number of bytes per second to send or receive */1667CURLOPT(CURLOPT_MAX_SEND_SPEED_LARGE, CURLOPTTYPE_OFF_T, 145),1668CURLOPT(CURLOPT_MAX_RECV_SPEED_LARGE, CURLOPTTYPE_OFF_T, 146),16691670/* Pointer to command string to send if USER/PASS fails. */1671CURLOPT(CURLOPT_FTP_ALTERNATIVE_TO_USER, CURLOPTTYPE_STRINGPOINT, 147),16721673/* callback function for setting socket options */1674CURLOPT(CURLOPT_SOCKOPTFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 148),1675CURLOPT(CURLOPT_SOCKOPTDATA, CURLOPTTYPE_CBPOINT, 149),16761677/* set to 0 to disable session ID reuse for this transfer, default is1678enabled (== 1) */1679CURLOPT(CURLOPT_SSL_SESSIONID_CACHE, CURLOPTTYPE_LONG, 150),16801681/* allowed SSH authentication methods */1682CURLOPT(CURLOPT_SSH_AUTH_TYPES, CURLOPTTYPE_VALUES, 151),16831684/* Used by scp/sftp to do public/private key authentication */1685CURLOPT(CURLOPT_SSH_PUBLIC_KEYFILE, CURLOPTTYPE_STRINGPOINT, 152),1686CURLOPT(CURLOPT_SSH_PRIVATE_KEYFILE, CURLOPTTYPE_STRINGPOINT, 153),16871688/* Send CCC (Clear Command Channel) after authentication */1689CURLOPT(CURLOPT_FTP_SSL_CCC, CURLOPTTYPE_LONG, 154),16901691/* Same as TIMEOUT and CONNECTTIMEOUT, but with ms resolution */1692CURLOPT(CURLOPT_TIMEOUT_MS, CURLOPTTYPE_LONG, 155),1693CURLOPT(CURLOPT_CONNECTTIMEOUT_MS, CURLOPTTYPE_LONG, 156),16941695/* set to zero to disable the libcurl's decoding and thus pass the raw body1696data to the application even when it is encoded/compressed */1697CURLOPT(CURLOPT_HTTP_TRANSFER_DECODING, CURLOPTTYPE_LONG, 157),1698CURLOPT(CURLOPT_HTTP_CONTENT_DECODING, CURLOPTTYPE_LONG, 158),16991700/* Permission used when creating new files and directories on the remote1701server for protocols that support it, SFTP/SCP/FILE */1702CURLOPT(CURLOPT_NEW_FILE_PERMS, CURLOPTTYPE_LONG, 159),1703CURLOPT(CURLOPT_NEW_DIRECTORY_PERMS, CURLOPTTYPE_LONG, 160),17041705/* Set the behavior of POST when redirecting. Values must be set to one1706of CURL_REDIR* defines below. This used to be called CURLOPT_POST301 */1707CURLOPT(CURLOPT_POSTREDIR, CURLOPTTYPE_VALUES, 161),17081709/* used by scp/sftp to verify the host's public key */1710CURLOPT(CURLOPT_SSH_HOST_PUBLIC_KEY_MD5, CURLOPTTYPE_STRINGPOINT, 162),17111712/* Callback function for opening socket (instead of socket(2)). Optionally,1713callback is able change the address or refuse to connect returning1714CURL_SOCKET_BAD. The callback should have type1715curl_opensocket_callback */1716CURLOPT(CURLOPT_OPENSOCKETFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 163),1717CURLOPT(CURLOPT_OPENSOCKETDATA, CURLOPTTYPE_CBPOINT, 164),17181719/* POST volatile input fields. */1720CURLOPT(CURLOPT_COPYPOSTFIELDS, CURLOPTTYPE_OBJECTPOINT, 165),17211722/* set transfer mode (;type=<a|i>) when doing FTP via an HTTP proxy */1723CURLOPT(CURLOPT_PROXY_TRANSFER_MODE, CURLOPTTYPE_LONG, 166),17241725/* Callback function for seeking in the input stream */1726CURLOPT(CURLOPT_SEEKFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 167),1727CURLOPT(CURLOPT_SEEKDATA, CURLOPTTYPE_CBPOINT, 168),17281729/* CRL file */1730CURLOPT(CURLOPT_CRLFILE, CURLOPTTYPE_STRINGPOINT, 169),17311732/* Issuer certificate */1733CURLOPT(CURLOPT_ISSUERCERT, CURLOPTTYPE_STRINGPOINT, 170),17341735/* (IPv6) Address scope */1736CURLOPT(CURLOPT_ADDRESS_SCOPE, CURLOPTTYPE_LONG, 171),17371738/* Collect certificate chain info and allow it to get retrievable with1739CURLINFO_CERTINFO after the transfer is complete. */1740CURLOPT(CURLOPT_CERTINFO, CURLOPTTYPE_LONG, 172),17411742/* "name" and "pwd" to use when fetching. */1743CURLOPT(CURLOPT_USERNAME, CURLOPTTYPE_STRINGPOINT, 173),1744CURLOPT(CURLOPT_PASSWORD, CURLOPTTYPE_STRINGPOINT, 174),17451746/* "name" and "pwd" to use with Proxy when fetching. */1747CURLOPT(CURLOPT_PROXYUSERNAME, CURLOPTTYPE_STRINGPOINT, 175),1748CURLOPT(CURLOPT_PROXYPASSWORD, CURLOPTTYPE_STRINGPOINT, 176),17491750/* Comma separated list of hostnames defining no-proxy zones. These should1751match both hostnames directly, and hostnames within a domain. For1752example, local.com will match local.com and www.local.com, but NOT1753notlocal.com or www.notlocal.com. For compatibility with other1754implementations of this, .local.com will be considered to be the same as1755local.com. A single * is the only valid wildcard, and effectively1756disables the use of proxy. */1757CURLOPT(CURLOPT_NOPROXY, CURLOPTTYPE_STRINGPOINT, 177),17581759/* block size for TFTP transfers */1760CURLOPT(CURLOPT_TFTP_BLKSIZE, CURLOPTTYPE_LONG, 178),17611762/* Socks Service */1763/* DEPRECATED, do not use! */1764CURLOPTDEPRECATED(CURLOPT_SOCKS5_GSSAPI_SERVICE,1765CURLOPTTYPE_STRINGPOINT, 179,17667.49.0, "Use CURLOPT_PROXY_SERVICE_NAME"),17671768/* Socks Service */1769CURLOPT(CURLOPT_SOCKS5_GSSAPI_NEC, CURLOPTTYPE_LONG, 180),17701771/* set the bitmask for the protocols that are allowed to be used for the1772transfer, which thus helps the app which takes URLs from users or other1773external inputs and want to restrict what protocol(s) to deal1774with. Defaults to CURLPROTO_ALL. */1775CURLOPTDEPRECATED(CURLOPT_PROTOCOLS, CURLOPTTYPE_LONG, 181,17767.85.0, "Use CURLOPT_PROTOCOLS_STR"),17771778/* set the bitmask for the protocols that libcurl is allowed to follow to,1779as a subset of the CURLOPT_PROTOCOLS ones. That means the protocol needs1780to be set in both bitmasks to be allowed to get redirected to. */1781CURLOPTDEPRECATED(CURLOPT_REDIR_PROTOCOLS, CURLOPTTYPE_LONG, 182,17827.85.0, "Use CURLOPT_REDIR_PROTOCOLS_STR"),17831784/* set the SSH knownhost filename to use */1785CURLOPT(CURLOPT_SSH_KNOWNHOSTS, CURLOPTTYPE_STRINGPOINT, 183),17861787/* set the SSH host key callback, must point to a curl_sshkeycallback1788function */1789CURLOPT(CURLOPT_SSH_KEYFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 184),17901791/* set the SSH host key callback custom pointer */1792CURLOPT(CURLOPT_SSH_KEYDATA, CURLOPTTYPE_CBPOINT, 185),17931794/* set the SMTP mail originator */1795CURLOPT(CURLOPT_MAIL_FROM, CURLOPTTYPE_STRINGPOINT, 186),17961797/* set the list of SMTP mail receiver(s) */1798CURLOPT(CURLOPT_MAIL_RCPT, CURLOPTTYPE_SLISTPOINT, 187),17991800/* FTP: send PRET before PASV */1801CURLOPT(CURLOPT_FTP_USE_PRET, CURLOPTTYPE_LONG, 188),18021803/* RTSP request method (OPTIONS, SETUP, PLAY, etc...) */1804CURLOPT(CURLOPT_RTSP_REQUEST, CURLOPTTYPE_VALUES, 189),18051806/* The RTSP session identifier */1807CURLOPT(CURLOPT_RTSP_SESSION_ID, CURLOPTTYPE_STRINGPOINT, 190),18081809/* The RTSP stream URI */1810CURLOPT(CURLOPT_RTSP_STREAM_URI, CURLOPTTYPE_STRINGPOINT, 191),18111812/* The Transport: header to use in RTSP requests */1813CURLOPT(CURLOPT_RTSP_TRANSPORT, CURLOPTTYPE_STRINGPOINT, 192),18141815/* Manually initialize the client RTSP CSeq for this handle */1816CURLOPT(CURLOPT_RTSP_CLIENT_CSEQ, CURLOPTTYPE_LONG, 193),18171818/* Manually initialize the server RTSP CSeq for this handle */1819CURLOPT(CURLOPT_RTSP_SERVER_CSEQ, CURLOPTTYPE_LONG, 194),18201821/* The stream to pass to INTERLEAVEFUNCTION. */1822CURLOPT(CURLOPT_INTERLEAVEDATA, CURLOPTTYPE_CBPOINT, 195),18231824/* Let the application define a custom write method for RTP data */1825CURLOPT(CURLOPT_INTERLEAVEFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 196),18261827/* Turn on wildcard matching */1828CURLOPT(CURLOPT_WILDCARDMATCH, CURLOPTTYPE_LONG, 197),18291830/* Directory matching callback called before downloading of an1831individual file (chunk) started */1832CURLOPT(CURLOPT_CHUNK_BGN_FUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 198),18331834/* Directory matching callback called after the file (chunk)1835was downloaded, or skipped */1836CURLOPT(CURLOPT_CHUNK_END_FUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 199),18371838/* Change match (fnmatch-like) callback for wildcard matching */1839CURLOPT(CURLOPT_FNMATCH_FUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 200),18401841/* Let the application define custom chunk data pointer */1842CURLOPT(CURLOPT_CHUNK_DATA, CURLOPTTYPE_CBPOINT, 201),18431844/* FNMATCH_FUNCTION user pointer */1845CURLOPT(CURLOPT_FNMATCH_DATA, CURLOPTTYPE_CBPOINT, 202),18461847/* send linked-list of name:port:address sets */1848CURLOPT(CURLOPT_RESOLVE, CURLOPTTYPE_SLISTPOINT, 203),18491850/* Set a username for authenticated TLS */1851CURLOPT(CURLOPT_TLSAUTH_USERNAME, CURLOPTTYPE_STRINGPOINT, 204),18521853/* Set a password for authenticated TLS */1854CURLOPT(CURLOPT_TLSAUTH_PASSWORD, CURLOPTTYPE_STRINGPOINT, 205),18551856/* Set authentication type for authenticated TLS */1857CURLOPT(CURLOPT_TLSAUTH_TYPE, CURLOPTTYPE_STRINGPOINT, 206),18581859/* Set to 1 to enable the "TE:" header in HTTP requests to ask for1860compressed transfer-encoded responses. Set to 0 to disable the use of TE:1861in outgoing requests. The current default is 0, but it might change in a1862future libcurl release.18631864libcurl will ask for the compressed methods it knows of, and if that1865is not any, it will not ask for transfer-encoding at all even if this1866option is set to 1.18671868*/1869CURLOPT(CURLOPT_TRANSFER_ENCODING, CURLOPTTYPE_LONG, 207),18701871/* Callback function for closing socket (instead of close(2)). The callback1872should have type curl_closesocket_callback */1873CURLOPT(CURLOPT_CLOSESOCKETFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 208),1874CURLOPT(CURLOPT_CLOSESOCKETDATA, CURLOPTTYPE_CBPOINT, 209),18751876/* allow GSSAPI credential delegation */1877CURLOPT(CURLOPT_GSSAPI_DELEGATION, CURLOPTTYPE_VALUES, 210),18781879/* Set the name servers to use for DNS resolution.1880* Only supported by the c-ares DNS backend */1881CURLOPT(CURLOPT_DNS_SERVERS, CURLOPTTYPE_STRINGPOINT, 211),18821883/* Time-out accept operations (currently for FTP only) after this amount1884of milliseconds. */1885CURLOPT(CURLOPT_ACCEPTTIMEOUT_MS, CURLOPTTYPE_LONG, 212),18861887/* Set TCP keepalive */1888CURLOPT(CURLOPT_TCP_KEEPALIVE, CURLOPTTYPE_LONG, 213),18891890/* non-universal keepalive knobs (Linux, AIX, HP-UX, more) */1891CURLOPT(CURLOPT_TCP_KEEPIDLE, CURLOPTTYPE_LONG, 214),1892CURLOPT(CURLOPT_TCP_KEEPINTVL, CURLOPTTYPE_LONG, 215),18931894/* Enable/disable specific SSL features with a bitmask, see CURLSSLOPT_* */1895CURLOPT(CURLOPT_SSL_OPTIONS, CURLOPTTYPE_VALUES, 216),18961897/* Set the SMTP auth originator */1898CURLOPT(CURLOPT_MAIL_AUTH, CURLOPTTYPE_STRINGPOINT, 217),18991900/* Enable/disable SASL initial response */1901CURLOPT(CURLOPT_SASL_IR, CURLOPTTYPE_LONG, 218),19021903/* Function that will be called instead of the internal progress display1904* function. This function should be defined as the curl_xferinfo_callback1905* prototype defines. (Deprecates CURLOPT_PROGRESSFUNCTION) */1906CURLOPT(CURLOPT_XFERINFOFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 219),19071908/* The XOAUTH2 bearer token */1909CURLOPT(CURLOPT_XOAUTH2_BEARER, CURLOPTTYPE_STRINGPOINT, 220),19101911/* Set the interface string to use as outgoing network1912* interface for DNS requests.1913* Only supported by the c-ares DNS backend */1914CURLOPT(CURLOPT_DNS_INTERFACE, CURLOPTTYPE_STRINGPOINT, 221),19151916/* Set the local IPv4 address to use for outgoing DNS requests.1917* Only supported by the c-ares DNS backend */1918CURLOPT(CURLOPT_DNS_LOCAL_IP4, CURLOPTTYPE_STRINGPOINT, 222),19191920/* Set the local IPv6 address to use for outgoing DNS requests.1921* Only supported by the c-ares DNS backend */1922CURLOPT(CURLOPT_DNS_LOCAL_IP6, CURLOPTTYPE_STRINGPOINT, 223),19231924/* Set authentication options directly */1925CURLOPT(CURLOPT_LOGIN_OPTIONS, CURLOPTTYPE_STRINGPOINT, 224),19261927/* Enable/disable TLS NPN extension (http2 over ssl might fail without) */1928CURLOPTDEPRECATED(CURLOPT_SSL_ENABLE_NPN, CURLOPTTYPE_LONG, 225,19297.86.0, "Has no function"),19301931/* Enable/disable TLS ALPN extension (http2 over ssl might fail without) */1932CURLOPT(CURLOPT_SSL_ENABLE_ALPN, CURLOPTTYPE_LONG, 226),19331934/* Time to wait for a response to an HTTP request containing an1935* Expect: 100-continue header before sending the data anyway. */1936CURLOPT(CURLOPT_EXPECT_100_TIMEOUT_MS, CURLOPTTYPE_LONG, 227),19371938/* This points to a linked list of headers used for proxy requests only,1939struct curl_slist kind */1940CURLOPT(CURLOPT_PROXYHEADER, CURLOPTTYPE_SLISTPOINT, 228),19411942/* Pass in a bitmask of "header options" */1943CURLOPT(CURLOPT_HEADEROPT, CURLOPTTYPE_VALUES, 229),19441945/* The public key in DER form used to validate the peer public key1946this option is used only if SSL_VERIFYPEER is true */1947CURLOPT(CURLOPT_PINNEDPUBLICKEY, CURLOPTTYPE_STRINGPOINT, 230),19481949/* Path to Unix domain socket */1950CURLOPT(CURLOPT_UNIX_SOCKET_PATH, CURLOPTTYPE_STRINGPOINT, 231),19511952/* Set if we should verify the certificate status. */1953CURLOPT(CURLOPT_SSL_VERIFYSTATUS, CURLOPTTYPE_LONG, 232),19541955/* Set if we should enable TLS false start. */1956CURLOPTDEPRECATED(CURLOPT_SSL_FALSESTART, CURLOPTTYPE_LONG, 233,19578.15.0, "Has no function"),19581959/* Do not squash dot-dot sequences */1960CURLOPT(CURLOPT_PATH_AS_IS, CURLOPTTYPE_LONG, 234),19611962/* Proxy Service Name */1963CURLOPT(CURLOPT_PROXY_SERVICE_NAME, CURLOPTTYPE_STRINGPOINT, 235),19641965/* Service Name */1966CURLOPT(CURLOPT_SERVICE_NAME, CURLOPTTYPE_STRINGPOINT, 236),19671968/* Wait/do not wait for pipe/mutex to clarify */1969CURLOPT(CURLOPT_PIPEWAIT, CURLOPTTYPE_LONG, 237),19701971/* Set the protocol used when curl is given a URL without a protocol */1972CURLOPT(CURLOPT_DEFAULT_PROTOCOL, CURLOPTTYPE_STRINGPOINT, 238),19731974/* Set stream weight, 1 - 256 (default is 16) */1975CURLOPT(CURLOPT_STREAM_WEIGHT, CURLOPTTYPE_LONG, 239),19761977/* Set stream dependency on another curl handle */1978CURLOPT(CURLOPT_STREAM_DEPENDS, CURLOPTTYPE_OBJECTPOINT, 240),19791980/* Set E-xclusive stream dependency on another curl handle */1981CURLOPT(CURLOPT_STREAM_DEPENDS_E, CURLOPTTYPE_OBJECTPOINT, 241),19821983/* Do not send any tftp option requests to the server */1984CURLOPT(CURLOPT_TFTP_NO_OPTIONS, CURLOPTTYPE_LONG, 242),19851986/* Linked-list of host:port:connect-to-host:connect-to-port,1987overrides the URL's host:port (only for the network layer) */1988CURLOPT(CURLOPT_CONNECT_TO, CURLOPTTYPE_SLISTPOINT, 243),19891990/* Set TCP Fast Open */1991CURLOPT(CURLOPT_TCP_FASTOPEN, CURLOPTTYPE_LONG, 244),19921993/* Continue to send data if the server responds early with an1994* HTTP status code >= 300 */1995CURLOPT(CURLOPT_KEEP_SENDING_ON_ERROR, CURLOPTTYPE_LONG, 245),19961997/* The CApath or CAfile used to validate the proxy certificate1998this option is used only if PROXY_SSL_VERIFYPEER is true */1999CURLOPT(CURLOPT_PROXY_CAINFO, CURLOPTTYPE_STRINGPOINT, 246),20002001/* The CApath directory used to validate the proxy certificate2002this option is used only if PROXY_SSL_VERIFYPEER is true */2003CURLOPT(CURLOPT_PROXY_CAPATH, CURLOPTTYPE_STRINGPOINT, 247),20042005/* Set if we should verify the proxy in ssl handshake,2006set 1 to verify. */2007CURLOPT(CURLOPT_PROXY_SSL_VERIFYPEER, CURLOPTTYPE_LONG, 248),20082009/* Set if we should verify the Common name from the proxy certificate in ssl2010* handshake, set 1 to check existence, 2 to ensure that it matches2011* the provided hostname. */2012CURLOPT(CURLOPT_PROXY_SSL_VERIFYHOST, CURLOPTTYPE_LONG, 249),20132014/* What version to specifically try to use for proxy.2015See CURL_SSLVERSION defines below. */2016CURLOPT(CURLOPT_PROXY_SSLVERSION, CURLOPTTYPE_VALUES, 250),20172018/* Set a username for authenticated TLS for proxy */2019CURLOPT(CURLOPT_PROXY_TLSAUTH_USERNAME, CURLOPTTYPE_STRINGPOINT, 251),20202021/* Set a password for authenticated TLS for proxy */2022CURLOPT(CURLOPT_PROXY_TLSAUTH_PASSWORD, CURLOPTTYPE_STRINGPOINT, 252),20232024/* Set authentication type for authenticated TLS for proxy */2025CURLOPT(CURLOPT_PROXY_TLSAUTH_TYPE, CURLOPTTYPE_STRINGPOINT, 253),20262027/* name of the file keeping your private SSL-certificate for proxy */2028CURLOPT(CURLOPT_PROXY_SSLCERT, CURLOPTTYPE_STRINGPOINT, 254),20292030/* type of the file keeping your SSL-certificate ("DER", "PEM", "ENG") for2031proxy */2032CURLOPT(CURLOPT_PROXY_SSLCERTTYPE, CURLOPTTYPE_STRINGPOINT, 255),20332034/* name of the file keeping your private SSL-key for proxy */2035CURLOPT(CURLOPT_PROXY_SSLKEY, CURLOPTTYPE_STRINGPOINT, 256),20362037/* type of the file keeping your private SSL-key ("DER", "PEM", "ENG") for2038proxy */2039CURLOPT(CURLOPT_PROXY_SSLKEYTYPE, CURLOPTTYPE_STRINGPOINT, 257),20402041/* password for the SSL private key for proxy */2042CURLOPT(CURLOPT_PROXY_KEYPASSWD, CURLOPTTYPE_STRINGPOINT, 258),20432044/* Specify which TLS 1.2 (1.1, 1.0) ciphers to use for proxy */2045CURLOPT(CURLOPT_PROXY_SSL_CIPHER_LIST, CURLOPTTYPE_STRINGPOINT, 259),20462047/* CRL file for proxy */2048CURLOPT(CURLOPT_PROXY_CRLFILE, CURLOPTTYPE_STRINGPOINT, 260),20492050/* Enable/disable specific SSL features with a bitmask for proxy, see2051CURLSSLOPT_* */2052CURLOPT(CURLOPT_PROXY_SSL_OPTIONS, CURLOPTTYPE_LONG, 261),20532054/* Name of pre proxy to use. */2055CURLOPT(CURLOPT_PRE_PROXY, CURLOPTTYPE_STRINGPOINT, 262),20562057/* The public key in DER form used to validate the proxy public key2058this option is used only if PROXY_SSL_VERIFYPEER is true */2059CURLOPT(CURLOPT_PROXY_PINNEDPUBLICKEY, CURLOPTTYPE_STRINGPOINT, 263),20602061/* Path to an abstract Unix domain socket */2062CURLOPT(CURLOPT_ABSTRACT_UNIX_SOCKET, CURLOPTTYPE_STRINGPOINT, 264),20632064/* Suppress proxy CONNECT response headers from user callbacks */2065CURLOPT(CURLOPT_SUPPRESS_CONNECT_HEADERS, CURLOPTTYPE_LONG, 265),20662067/* The request target, instead of extracted from the URL */2068CURLOPT(CURLOPT_REQUEST_TARGET, CURLOPTTYPE_STRINGPOINT, 266),20692070/* bitmask of allowed auth methods for connections to SOCKS5 proxies */2071CURLOPT(CURLOPT_SOCKS5_AUTH, CURLOPTTYPE_LONG, 267),20722073/* Enable/disable SSH compression */2074CURLOPT(CURLOPT_SSH_COMPRESSION, CURLOPTTYPE_LONG, 268),20752076/* Post MIME data. */2077CURLOPT(CURLOPT_MIMEPOST, CURLOPTTYPE_OBJECTPOINT, 269),20782079/* Time to use with the CURLOPT_TIMECONDITION. Specified in number of2080seconds since 1 Jan 1970. */2081CURLOPT(CURLOPT_TIMEVALUE_LARGE, CURLOPTTYPE_OFF_T, 270),20822083/* Head start in milliseconds to give happy eyeballs. */2084CURLOPT(CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS, CURLOPTTYPE_LONG, 271),20852086/* Function that will be called before a resolver request is made */2087CURLOPT(CURLOPT_RESOLVER_START_FUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 272),20882089/* User data to pass to the resolver start callback. */2090CURLOPT(CURLOPT_RESOLVER_START_DATA, CURLOPTTYPE_CBPOINT, 273),20912092/* send HAProxy PROXY protocol header? */2093CURLOPT(CURLOPT_HAPROXYPROTOCOL, CURLOPTTYPE_LONG, 274),20942095/* shuffle addresses before use when DNS returns multiple */2096CURLOPT(CURLOPT_DNS_SHUFFLE_ADDRESSES, CURLOPTTYPE_LONG, 275),20972098/* Specify which TLS 1.3 ciphers suites to use */2099CURLOPT(CURLOPT_TLS13_CIPHERS, CURLOPTTYPE_STRINGPOINT, 276),2100CURLOPT(CURLOPT_PROXY_TLS13_CIPHERS, CURLOPTTYPE_STRINGPOINT, 277),21012102/* Disallow specifying username/login in URL. */2103CURLOPT(CURLOPT_DISALLOW_USERNAME_IN_URL, CURLOPTTYPE_LONG, 278),21042105/* DNS-over-HTTPS URL */2106CURLOPT(CURLOPT_DOH_URL, CURLOPTTYPE_STRINGPOINT, 279),21072108/* Preferred buffer size to use for uploads */2109CURLOPT(CURLOPT_UPLOAD_BUFFERSIZE, CURLOPTTYPE_LONG, 280),21102111/* Time in ms between connection upkeep calls for long-lived connections. */2112CURLOPT(CURLOPT_UPKEEP_INTERVAL_MS, CURLOPTTYPE_LONG, 281),21132114/* Specify URL using CURL URL API. */2115CURLOPT(CURLOPT_CURLU, CURLOPTTYPE_OBJECTPOINT, 282),21162117/* add trailing data just after no more data is available */2118CURLOPT(CURLOPT_TRAILERFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 283),21192120/* pointer to be passed to HTTP_TRAILER_FUNCTION */2121CURLOPT(CURLOPT_TRAILERDATA, CURLOPTTYPE_CBPOINT, 284),21222123/* set this to 1L to allow HTTP/0.9 responses or 0L to disallow */2124CURLOPT(CURLOPT_HTTP09_ALLOWED, CURLOPTTYPE_LONG, 285),21252126/* alt-svc control bitmask */2127CURLOPT(CURLOPT_ALTSVC_CTRL, CURLOPTTYPE_LONG, 286),21282129/* alt-svc cache filename to possibly read from/write to */2130CURLOPT(CURLOPT_ALTSVC, CURLOPTTYPE_STRINGPOINT, 287),21312132/* maximum age (idle time) of a connection to consider it for reuse2133* (in seconds) */2134CURLOPT(CURLOPT_MAXAGE_CONN, CURLOPTTYPE_LONG, 288),21352136/* SASL authorization identity */2137CURLOPT(CURLOPT_SASL_AUTHZID, CURLOPTTYPE_STRINGPOINT, 289),21382139/* allow RCPT TO command to fail for some recipients */2140CURLOPT(CURLOPT_MAIL_RCPT_ALLOWFAILS, CURLOPTTYPE_LONG, 290),21412142/* the private SSL-certificate as a "blob" */2143CURLOPT(CURLOPT_SSLCERT_BLOB, CURLOPTTYPE_BLOB, 291),2144CURLOPT(CURLOPT_SSLKEY_BLOB, CURLOPTTYPE_BLOB, 292),2145CURLOPT(CURLOPT_PROXY_SSLCERT_BLOB, CURLOPTTYPE_BLOB, 293),2146CURLOPT(CURLOPT_PROXY_SSLKEY_BLOB, CURLOPTTYPE_BLOB, 294),2147CURLOPT(CURLOPT_ISSUERCERT_BLOB, CURLOPTTYPE_BLOB, 295),21482149/* Issuer certificate for proxy */2150CURLOPT(CURLOPT_PROXY_ISSUERCERT, CURLOPTTYPE_STRINGPOINT, 296),2151CURLOPT(CURLOPT_PROXY_ISSUERCERT_BLOB, CURLOPTTYPE_BLOB, 297),21522153/* the EC curves requested by the TLS client (RFC 8422, 5.1);2154* OpenSSL support via 'set_groups'/'set_curves':2155* https://docs.openssl.org/master/man3/SSL_CTX_set1_curves/2156*/2157CURLOPT(CURLOPT_SSL_EC_CURVES, CURLOPTTYPE_STRINGPOINT, 298),21582159/* HSTS bitmask */2160CURLOPT(CURLOPT_HSTS_CTRL, CURLOPTTYPE_LONG, 299),2161/* HSTS filename */2162CURLOPT(CURLOPT_HSTS, CURLOPTTYPE_STRINGPOINT, 300),21632164/* HSTS read callback */2165CURLOPT(CURLOPT_HSTSREADFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 301),2166CURLOPT(CURLOPT_HSTSREADDATA, CURLOPTTYPE_CBPOINT, 302),21672168/* HSTS write callback */2169CURLOPT(CURLOPT_HSTSWRITEFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 303),2170CURLOPT(CURLOPT_HSTSWRITEDATA, CURLOPTTYPE_CBPOINT, 304),21712172/* Parameters for V4 signature */2173CURLOPT(CURLOPT_AWS_SIGV4, CURLOPTTYPE_STRINGPOINT, 305),21742175/* Same as CURLOPT_SSL_VERIFYPEER but for DoH (DNS-over-HTTPS) servers. */2176CURLOPT(CURLOPT_DOH_SSL_VERIFYPEER, CURLOPTTYPE_LONG, 306),21772178/* Same as CURLOPT_SSL_VERIFYHOST but for DoH (DNS-over-HTTPS) servers. */2179CURLOPT(CURLOPT_DOH_SSL_VERIFYHOST, CURLOPTTYPE_LONG, 307),21802181/* Same as CURLOPT_SSL_VERIFYSTATUS but for DoH (DNS-over-HTTPS) servers. */2182CURLOPT(CURLOPT_DOH_SSL_VERIFYSTATUS, CURLOPTTYPE_LONG, 308),21832184/* The CA certificates as "blob" used to validate the peer certificate2185this option is used only if SSL_VERIFYPEER is true */2186CURLOPT(CURLOPT_CAINFO_BLOB, CURLOPTTYPE_BLOB, 309),21872188/* The CA certificates as "blob" used to validate the proxy certificate2189this option is used only if PROXY_SSL_VERIFYPEER is true */2190CURLOPT(CURLOPT_PROXY_CAINFO_BLOB, CURLOPTTYPE_BLOB, 310),21912192/* used by scp/sftp to verify the host's public key */2193CURLOPT(CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256, CURLOPTTYPE_STRINGPOINT, 311),21942195/* Function that will be called immediately before the initial request2196is made on a connection (after any protocol negotiation step). */2197CURLOPT(CURLOPT_PREREQFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 312),21982199/* Data passed to the CURLOPT_PREREQFUNCTION callback */2200CURLOPT(CURLOPT_PREREQDATA, CURLOPTTYPE_CBPOINT, 313),22012202/* maximum age (since creation) of a connection to consider it for reuse2203* (in seconds) */2204CURLOPT(CURLOPT_MAXLIFETIME_CONN, CURLOPTTYPE_LONG, 314),22052206/* Set MIME option flags. */2207CURLOPT(CURLOPT_MIME_OPTIONS, CURLOPTTYPE_LONG, 315),22082209/* set the SSH host key callback, must point to a curl_sshkeycallback2210function */2211CURLOPT(CURLOPT_SSH_HOSTKEYFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 316),22122213/* set the SSH host key callback custom pointer */2214CURLOPT(CURLOPT_SSH_HOSTKEYDATA, CURLOPTTYPE_CBPOINT, 317),22152216/* specify which protocols that are allowed to be used for the transfer,2217which thus helps the app which takes URLs from users or other external2218inputs and want to restrict what protocol(s) to deal with. Defaults to2219all built-in protocols. */2220CURLOPT(CURLOPT_PROTOCOLS_STR, CURLOPTTYPE_STRINGPOINT, 318),22212222/* specify which protocols that libcurl is allowed to follow directs to */2223CURLOPT(CURLOPT_REDIR_PROTOCOLS_STR, CURLOPTTYPE_STRINGPOINT, 319),22242225/* WebSockets options */2226CURLOPT(CURLOPT_WS_OPTIONS, CURLOPTTYPE_LONG, 320),22272228/* CA cache timeout */2229CURLOPT(CURLOPT_CA_CACHE_TIMEOUT, CURLOPTTYPE_LONG, 321),22302231/* Can leak things, gonna exit() soon */2232CURLOPT(CURLOPT_QUICK_EXIT, CURLOPTTYPE_LONG, 322),22332234/* set a specific client IP for HAProxy PROXY protocol header? */2235CURLOPT(CURLOPT_HAPROXY_CLIENT_IP, CURLOPTTYPE_STRINGPOINT, 323),22362237/* millisecond version */2238CURLOPT(CURLOPT_SERVER_RESPONSE_TIMEOUT_MS, CURLOPTTYPE_LONG, 324),22392240/* set ECH configuration */2241CURLOPT(CURLOPT_ECH, CURLOPTTYPE_STRINGPOINT, 325),22422243/* maximum number of keepalive probes (Linux, *BSD, macOS, etc.) */2244CURLOPT(CURLOPT_TCP_KEEPCNT, CURLOPTTYPE_LONG, 326),22452246CURLOPT(CURLOPT_UPLOAD_FLAGS, CURLOPTTYPE_LONG, 327),22472248/* set TLS supported signature algorithms */2249CURLOPT(CURLOPT_SSL_SIGNATURE_ALGORITHMS, CURLOPTTYPE_STRINGPOINT, 328),22502251CURLOPT_LASTENTRY /* the last unused */2252} CURLoption;22532254#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all2255the obsolete stuff removed! */22562257/* Backwards compatibility with older names */2258/* These are scheduled to disappear by 2011 */22592260/* This was added in version 7.19.1 */2261#define CURLOPT_POST301 CURLOPT_POSTREDIR22622263/* These are scheduled to disappear by 2009 */22642265/* The following were added in 7.17.0 */2266#define CURLOPT_SSLKEYPASSWD CURLOPT_KEYPASSWD2267#define CURLOPT_FTPAPPEND CURLOPT_APPEND2268#define CURLOPT_FTPLISTONLY CURLOPT_DIRLISTONLY2269#define CURLOPT_FTP_SSL CURLOPT_USE_SSL22702271/* The following were added earlier */22722273#define CURLOPT_SSLCERTPASSWD CURLOPT_KEYPASSWD2274#define CURLOPT_KRB4LEVEL CURLOPT_KRBLEVEL22752276/* */2277#define CURLOPT_FTP_RESPONSE_TIMEOUT CURLOPT_SERVER_RESPONSE_TIMEOUT22782279/* Added in 8.2.0 */2280#define CURLOPT_MAIL_RCPT_ALLLOWFAILS CURLOPT_MAIL_RCPT_ALLOWFAILS22812282#else2283/* This is set if CURL_NO_OLDIES is defined at compile-time */2284#undef CURLOPT_DNS_USE_GLOBAL_CACHE /* soon obsolete */2285#endif228622872288/* Below here follows defines for the CURLOPT_IPRESOLVE option. If a host2289name resolves addresses using more than one IP protocol version, this2290option might be handy to force libcurl to use a specific IP version. */2291#define CURL_IPRESOLVE_WHATEVER 0L /* default, uses addresses to all IP2292versions that your system allows */2293#define CURL_IPRESOLVE_V4 1L /* uses only IPv4 addresses/connections */2294#define CURL_IPRESOLVE_V6 2L /* uses only IPv6 addresses/connections */22952296/* Convenient "aliases" */2297#define CURLOPT_RTSPHEADER CURLOPT_HTTPHEADER22982299/* These constants are for use with the CURLOPT_HTTP_VERSION option. */2300#define CURL_HTTP_VERSION_NONE 0L /* setting this means we do not care, and2301that we would like the library to choose2302the best possible for us! */2303#define CURL_HTTP_VERSION_1_0 1L /* please use HTTP 1.0 in the request */2304#define CURL_HTTP_VERSION_1_1 2L /* please use HTTP 1.1 in the request */2305#define CURL_HTTP_VERSION_2_0 3L /* please use HTTP 2 in the request */2306#define CURL_HTTP_VERSION_2TLS 4L /* use version 2 for HTTPS, version 1.1 for2307HTTP */2308#define CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE 5L /* please use HTTP 2 without2309HTTP/1.1 Upgrade */2310#define CURL_HTTP_VERSION_3 30L /* Use HTTP/3, fallback to HTTP/2 or2311HTTP/1 if needed. For HTTPS only. For2312HTTP, this option makes libcurl2313return error. */2314#define CURL_HTTP_VERSION_3ONLY 31L /* Use HTTP/3 without fallback. For2315HTTPS only. For HTTP, this makes2316libcurl return error. */2317#define CURL_HTTP_VERSION_LAST 32L /* *ILLEGAL* http version */23182319/* Convenience definition simple because the name of the version is HTTP/2 and2320not 2.0. The 2_0 version of the enum name was set while the version was2321still planned to be 2.0 and we stick to it for compatibility. */2322#define CURL_HTTP_VERSION_2 CURL_HTTP_VERSION_2_023232324/*2325* Public API enums for RTSP requests2326*/23272328#define CURL_RTSPREQ_NONE 0L2329#define CURL_RTSPREQ_OPTIONS 1L2330#define CURL_RTSPREQ_DESCRIBE 2L2331#define CURL_RTSPREQ_ANNOUNCE 3L2332#define CURL_RTSPREQ_SETUP 4L2333#define CURL_RTSPREQ_PLAY 5L2334#define CURL_RTSPREQ_PAUSE 6L2335#define CURL_RTSPREQ_TEARDOWN 7L2336#define CURL_RTSPREQ_GET_PARAMETER 8L2337#define CURL_RTSPREQ_SET_PARAMETER 9L2338#define CURL_RTSPREQ_RECORD 10L2339#define CURL_RTSPREQ_RECEIVE 11L2340#define CURL_RTSPREQ_LAST 12L /* not used */23412342/* These enums are for use with the CURLOPT_NETRC option. */2343#define CURL_NETRC_IGNORED 0L /* The .netrc will never be read.2344This is the default. */2345#define CURL_NETRC_OPTIONAL 1L /* A user:password in the URL will be preferred2346to one in the .netrc. */2347#define CURL_NETRC_REQUIRED 2L /* A user:password in the URL will be ignored.2348Unless one is set programmatically, the2349.netrc will be queried. */2350enum CURL_NETRC_OPTION {2351/* we set a single member here, just to make sure we still provide the enum,2352but the values to use are defined above with L suffixes */2353CURL_NETRC_LAST = 32354};23552356#define CURL_SSLVERSION_DEFAULT 02357#define CURL_SSLVERSION_TLSv1 1 /* TLS 1.x */2358#define CURL_SSLVERSION_SSLv2 22359#define CURL_SSLVERSION_SSLv3 32360#define CURL_SSLVERSION_TLSv1_0 42361#define CURL_SSLVERSION_TLSv1_1 52362#define CURL_SSLVERSION_TLSv1_2 62363#define CURL_SSLVERSION_TLSv1_3 723642365#define CURL_SSLVERSION_LAST 8 /* never use, keep last */23662367#define CURL_SSLVERSION_MAX_NONE 02368#define CURL_SSLVERSION_MAX_DEFAULT (CURL_SSLVERSION_TLSv1 << 16)2369#define CURL_SSLVERSION_MAX_TLSv1_0 (CURL_SSLVERSION_TLSv1_0 << 16)2370#define CURL_SSLVERSION_MAX_TLSv1_1 (CURL_SSLVERSION_TLSv1_1 << 16)2371#define CURL_SSLVERSION_MAX_TLSv1_2 (CURL_SSLVERSION_TLSv1_2 << 16)2372#define CURL_SSLVERSION_MAX_TLSv1_3 (CURL_SSLVERSION_TLSv1_3 << 16)23732374/* never use, keep last */2375#define CURL_SSLVERSION_MAX_LAST (CURL_SSLVERSION_LAST << 16)23762377#define CURL_TLSAUTH_NONE 0L2378#define CURL_TLSAUTH_SRP 1L23792380enum CURL_TLSAUTH {2381/* we set a single member here, just to make sure we still provide the enum,2382but the values to use are defined above with L suffixes */2383CURL_TLSAUTH_LAST = 22384};23852386/* symbols to use with CURLOPT_POSTREDIR.2387CURL_REDIR_POST_301, CURL_REDIR_POST_302 and CURL_REDIR_POST_3032388can be bitwise ORed so that CURL_REDIR_POST_301 | CURL_REDIR_POST_3022389| CURL_REDIR_POST_303 == CURL_REDIR_POST_ALL */23902391#define CURL_REDIR_GET_ALL 02392#define CURL_REDIR_POST_301 12393#define CURL_REDIR_POST_302 22394#define CURL_REDIR_POST_303 42395#define CURL_REDIR_POST_ALL \2396(CURL_REDIR_POST_301|CURL_REDIR_POST_302|CURL_REDIR_POST_303)23972398#define CURL_TIMECOND_NONE 0L2399#define CURL_TIMECOND_IFMODSINCE 1L2400#define CURL_TIMECOND_IFUNMODSINCE 2L2401#define CURL_TIMECOND_LASTMOD 3L24022403typedef enum {2404/* we set a single member here, just to make sure we still provide2405the enum typedef, but the values to use are defined above with L2406suffixes */2407CURL_TIMECOND_LAST = 42408} curl_TimeCond;24092410/* Special size_t value signaling a null-terminated string. */2411#define CURL_ZERO_TERMINATED ((size_t) -1)24122413/* curl_strequal() and curl_strnequal() are subject for removal in a future2414release */2415CURL_EXTERN int curl_strequal(const char *s1, const char *s2);2416CURL_EXTERN int curl_strnequal(const char *s1, const char *s2, size_t n);24172418/* Mime/form handling support. */2419typedef struct curl_mime curl_mime; /* Mime context. */2420typedef struct curl_mimepart curl_mimepart; /* Mime part context. */24212422/* CURLMIMEOPT_ defines are for the CURLOPT_MIME_OPTIONS option. */2423#define CURLMIMEOPT_FORMESCAPE (1<<0) /* Use backslash-escaping for forms. */24242425/*2426* NAME curl_mime_init()2427*2428* DESCRIPTION2429*2430* Create a mime context and return its handle. The easy parameter is the2431* target handle.2432*/2433CURL_EXTERN curl_mime *curl_mime_init(CURL *easy);24342435/*2436* NAME curl_mime_free()2437*2438* DESCRIPTION2439*2440* release a mime handle and its substructures.2441*/2442CURL_EXTERN void curl_mime_free(curl_mime *mime);24432444/*2445* NAME curl_mime_addpart()2446*2447* DESCRIPTION2448*2449* Append a new empty part to the given mime context and return a handle to2450* the created part.2451*/2452CURL_EXTERN curl_mimepart *curl_mime_addpart(curl_mime *mime);24532454/*2455* NAME curl_mime_name()2456*2457* DESCRIPTION2458*2459* Set mime/form part name.2460*/2461CURL_EXTERN CURLcode curl_mime_name(curl_mimepart *part, const char *name);24622463/*2464* NAME curl_mime_filename()2465*2466* DESCRIPTION2467*2468* Set mime part remote filename.2469*/2470CURL_EXTERN CURLcode curl_mime_filename(curl_mimepart *part,2471const char *filename);24722473/*2474* NAME curl_mime_type()2475*2476* DESCRIPTION2477*2478* Set mime part type.2479*/2480CURL_EXTERN CURLcode curl_mime_type(curl_mimepart *part, const char *mimetype);24812482/*2483* NAME curl_mime_encoder()2484*2485* DESCRIPTION2486*2487* Set mime data transfer encoder.2488*/2489CURL_EXTERN CURLcode curl_mime_encoder(curl_mimepart *part,2490const char *encoding);24912492/*2493* NAME curl_mime_data()2494*2495* DESCRIPTION2496*2497* Set mime part data source from memory data,2498*/2499CURL_EXTERN CURLcode curl_mime_data(curl_mimepart *part,2500const char *data, size_t datasize);25012502/*2503* NAME curl_mime_filedata()2504*2505* DESCRIPTION2506*2507* Set mime part data source from named file.2508*/2509CURL_EXTERN CURLcode curl_mime_filedata(curl_mimepart *part,2510const char *filename);25112512/*2513* NAME curl_mime_data_cb()2514*2515* DESCRIPTION2516*2517* Set mime part data source from callback function.2518*/2519CURL_EXTERN CURLcode curl_mime_data_cb(curl_mimepart *part,2520curl_off_t datasize,2521curl_read_callback readfunc,2522curl_seek_callback seekfunc,2523curl_free_callback freefunc,2524void *arg);25252526/*2527* NAME curl_mime_subparts()2528*2529* DESCRIPTION2530*2531* Set mime part data source from subparts.2532*/2533CURL_EXTERN CURLcode curl_mime_subparts(curl_mimepart *part,2534curl_mime *subparts);2535/*2536* NAME curl_mime_headers()2537*2538* DESCRIPTION2539*2540* Set mime part headers.2541*/2542CURL_EXTERN CURLcode curl_mime_headers(curl_mimepart *part,2543struct curl_slist *headers,2544int take_ownership);25452546typedef enum {2547/********* the first one is unused ************/2548CURLFORM_NOTHING CURL_DEPRECATED(7.56.0, ""),2549CURLFORM_COPYNAME CURL_DEPRECATED(7.56.0, "Use curl_mime_name()"),2550CURLFORM_PTRNAME CURL_DEPRECATED(7.56.0, "Use curl_mime_name()"),2551CURLFORM_NAMELENGTH CURL_DEPRECATED(7.56.0, ""),2552CURLFORM_COPYCONTENTS CURL_DEPRECATED(7.56.0, "Use curl_mime_data()"),2553CURLFORM_PTRCONTENTS CURL_DEPRECATED(7.56.0, "Use curl_mime_data()"),2554CURLFORM_CONTENTSLENGTH CURL_DEPRECATED(7.56.0, "Use curl_mime_data()"),2555CURLFORM_FILECONTENT CURL_DEPRECATED(7.56.0, "Use curl_mime_data_cb()"),2556CURLFORM_ARRAY CURL_DEPRECATED(7.56.0, ""),2557CURLFORM_OBSOLETE,2558CURLFORM_FILE CURL_DEPRECATED(7.56.0, "Use curl_mime_filedata()"),25592560CURLFORM_BUFFER CURL_DEPRECATED(7.56.0, "Use curl_mime_filename()"),2561CURLFORM_BUFFERPTR CURL_DEPRECATED(7.56.0, "Use curl_mime_data()"),2562CURLFORM_BUFFERLENGTH CURL_DEPRECATED(7.56.0, "Use curl_mime_data()"),25632564CURLFORM_CONTENTTYPE CURL_DEPRECATED(7.56.0, "Use curl_mime_type()"),2565CURLFORM_CONTENTHEADER CURL_DEPRECATED(7.56.0, "Use curl_mime_headers()"),2566CURLFORM_FILENAME CURL_DEPRECATED(7.56.0, "Use curl_mime_filename()"),2567CURLFORM_END,2568CURLFORM_OBSOLETE2,25692570CURLFORM_STREAM CURL_DEPRECATED(7.56.0, "Use curl_mime_data_cb()"),2571CURLFORM_CONTENTLEN /* added in 7.46.0, provide a curl_off_t length */2572CURL_DEPRECATED(7.56.0, "Use curl_mime_data()"),25732574CURLFORM_LASTENTRY /* the last unused */2575} CURLformoption;25762577/* structure to be used as parameter for CURLFORM_ARRAY */2578struct curl_forms {2579CURLformoption option;2580const char *value;2581};25822583/* use this for multipart formpost building */2584/* Returns code for curl_formadd()2585*2586* Returns:2587* CURL_FORMADD_OK on success2588* CURL_FORMADD_MEMORY if the FormInfo allocation fails2589* CURL_FORMADD_OPTION_TWICE if one option is given twice for one Form2590* CURL_FORMADD_NULL if a null pointer was given for a char2591* CURL_FORMADD_MEMORY if the allocation of a FormInfo struct failed2592* CURL_FORMADD_UNKNOWN_OPTION if an unknown option was used2593* CURL_FORMADD_INCOMPLETE if the some FormInfo is not complete (or error)2594* CURL_FORMADD_MEMORY if a curl_httppost struct cannot be allocated2595* CURL_FORMADD_MEMORY if some allocation for string copying failed.2596* CURL_FORMADD_ILLEGAL_ARRAY if an illegal option is used in an array2597*2598***************************************************************************/2599typedef enum {2600CURL_FORMADD_OK CURL_DEPRECATED(7.56.0, ""), /* 1st, no error */26012602CURL_FORMADD_MEMORY CURL_DEPRECATED(7.56.0, ""),2603CURL_FORMADD_OPTION_TWICE CURL_DEPRECATED(7.56.0, ""),2604CURL_FORMADD_NULL CURL_DEPRECATED(7.56.0, ""),2605CURL_FORMADD_UNKNOWN_OPTION CURL_DEPRECATED(7.56.0, ""),2606CURL_FORMADD_INCOMPLETE CURL_DEPRECATED(7.56.0, ""),2607CURL_FORMADD_ILLEGAL_ARRAY CURL_DEPRECATED(7.56.0, ""),2608/* libcurl was built with form api disabled */2609CURL_FORMADD_DISABLED CURL_DEPRECATED(7.56.0, ""),26102611CURL_FORMADD_LAST /* last */2612} CURLFORMcode;26132614/*2615* NAME curl_formadd()2616*2617* DESCRIPTION2618*2619* Pretty advanced function for building multi-part formposts. Each invoke2620* adds one part that together construct a full post. Then use2621* CURLOPT_HTTPPOST to send it off to libcurl.2622*/2623CURL_EXTERN CURLFORMcode CURL_DEPRECATED(7.56.0, "Use curl_mime_init()")2624curl_formadd(struct curl_httppost **httppost,2625struct curl_httppost **last_post,2626...);26272628/*2629* callback function for curl_formget()2630* The void *arg pointer will be the one passed as second argument to2631* curl_formget().2632* The character buffer passed to it must not be freed.2633* Should return the buffer length passed to it as the argument "len" on2634* success.2635*/2636typedef size_t (*curl_formget_callback)(void *arg, const char *buf,2637size_t len);26382639/*2640* NAME curl_formget()2641*2642* DESCRIPTION2643*2644* Serialize a curl_httppost struct built with curl_formadd().2645* Accepts a void pointer as second argument which will be passed to2646* the curl_formget_callback function.2647* Returns 0 on success.2648*/2649CURL_EXTERN int CURL_DEPRECATED(7.56.0, "")2650curl_formget(struct curl_httppost *form, void *arg,2651curl_formget_callback append);2652/*2653* NAME curl_formfree()2654*2655* DESCRIPTION2656*2657* Free a multipart formpost previously built with curl_formadd().2658*/2659CURL_EXTERN void CURL_DEPRECATED(7.56.0, "Use curl_mime_free()")2660curl_formfree(struct curl_httppost *form);26612662/*2663* NAME curl_getenv()2664*2665* DESCRIPTION2666*2667* Returns a malloc()'ed string that MUST be curl_free()ed after usage is2668* complete. DEPRECATED - see lib/README.curlx2669*/2670CURL_EXTERN char *curl_getenv(const char *variable);26712672/*2673* NAME curl_version()2674*2675* DESCRIPTION2676*2677* Returns a static ASCII string of the libcurl version.2678*/2679CURL_EXTERN char *curl_version(void);26802681/*2682* NAME curl_easy_escape()2683*2684* DESCRIPTION2685*2686* Escapes URL strings (converts all letters consider illegal in URLs to their2687* %XX versions). This function returns a new allocated string or NULL if an2688* error occurred.2689*/2690CURL_EXTERN char *curl_easy_escape(CURL *handle,2691const char *string,2692int length);26932694/* the previous version: */2695CURL_EXTERN char *curl_escape(const char *string,2696int length);269726982699/*2700* NAME curl_easy_unescape()2701*2702* DESCRIPTION2703*2704* Unescapes URL encoding in strings (converts all %XX codes to their 8bit2705* versions). This function returns a new allocated string or NULL if an error2706* occurred.2707* Conversion Note: On non-ASCII platforms the ASCII %XX codes are2708* converted into the host encoding.2709*/2710CURL_EXTERN char *curl_easy_unescape(CURL *handle,2711const char *string,2712int length,2713int *outlength);27142715/* the previous version */2716CURL_EXTERN char *curl_unescape(const char *string,2717int length);27182719/*2720* NAME curl_free()2721*2722* DESCRIPTION2723*2724* Provided for de-allocation in the same translation unit that did the2725* allocation. Added in libcurl 7.102726*/2727CURL_EXTERN void curl_free(void *p);27282729/*2730* NAME curl_global_init()2731*2732* DESCRIPTION2733*2734* curl_global_init() should be invoked exactly once for each application that2735* uses libcurl and before any call of other libcurl functions.27362737* This function is thread-safe if CURL_VERSION_THREADSAFE is set in the2738* curl_version_info_data.features flag (fetch by curl_version_info()).27392740*/2741CURL_EXTERN CURLcode curl_global_init(long flags);27422743/*2744* NAME curl_global_init_mem()2745*2746* DESCRIPTION2747*2748* curl_global_init() or curl_global_init_mem() should be invoked exactly once2749* for each application that uses libcurl. This function can be used to2750* initialize libcurl and set user defined memory management callback2751* functions. Users can implement memory management routines to check for2752* memory leaks, check for mis-use of the curl library etc. User registered2753* callback routines will be invoked by this library instead of the system2754* memory management routines like malloc, free etc.2755*/2756CURL_EXTERN CURLcode curl_global_init_mem(long flags,2757curl_malloc_callback m,2758curl_free_callback f,2759curl_realloc_callback r,2760curl_strdup_callback s,2761curl_calloc_callback c);27622763/*2764* NAME curl_global_cleanup()2765*2766* DESCRIPTION2767*2768* curl_global_cleanup() should be invoked exactly once for each application2769* that uses libcurl2770*/2771CURL_EXTERN void curl_global_cleanup(void);27722773/*2774* NAME curl_global_trace()2775*2776* DESCRIPTION2777*2778* curl_global_trace() can be invoked at application start to2779* configure which components in curl should participate in tracing.27802781* This function is thread-safe if CURL_VERSION_THREADSAFE is set in the2782* curl_version_info_data.features flag (fetch by curl_version_info()).27832784*/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)301430153016/*****************************************************************************3017* Setup defines, protos etc for the sharing stuff.3018*/30193020/* Different data locks for a single share */3021typedef enum {3022CURL_LOCK_DATA_NONE = 0,3023/* CURL_LOCK_DATA_SHARE is used internally to say that3024* the locking is just made to change the internal state of the share3025* itself.3026*/3027CURL_LOCK_DATA_SHARE,3028CURL_LOCK_DATA_COOKIE,3029CURL_LOCK_DATA_DNS,3030CURL_LOCK_DATA_SSL_SESSION,3031CURL_LOCK_DATA_CONNECT,3032CURL_LOCK_DATA_PSL,3033CURL_LOCK_DATA_HSTS,3034CURL_LOCK_DATA_LAST3035} curl_lock_data;30363037/* Different lock access types */3038typedef enum {3039CURL_LOCK_ACCESS_NONE = 0, /* unspecified action */3040CURL_LOCK_ACCESS_SHARED = 1, /* for read perhaps */3041CURL_LOCK_ACCESS_SINGLE = 2, /* for write perhaps */3042CURL_LOCK_ACCESS_LAST /* never use */3043} curl_lock_access;30443045typedef void (*curl_lock_function)(CURL *handle,3046curl_lock_data data,3047curl_lock_access locktype,3048void *userptr);3049typedef void (*curl_unlock_function)(CURL *handle,3050curl_lock_data data,3051void *userptr);305230533054typedef enum {3055CURLSHE_OK, /* all is fine */3056CURLSHE_BAD_OPTION, /* 1 */3057CURLSHE_IN_USE, /* 2 */3058CURLSHE_INVALID, /* 3 */3059CURLSHE_NOMEM, /* 4 out of memory */3060CURLSHE_NOT_BUILT_IN, /* 5 feature not present in lib */3061CURLSHE_LAST /* never use */3062} CURLSHcode;30633064typedef enum {3065CURLSHOPT_NONE, /* do not use */3066CURLSHOPT_SHARE, /* specify a data type to share */3067CURLSHOPT_UNSHARE, /* specify which data type to stop sharing */3068CURLSHOPT_LOCKFUNC, /* pass in a 'curl_lock_function' pointer */3069CURLSHOPT_UNLOCKFUNC, /* pass in a 'curl_unlock_function' pointer */3070CURLSHOPT_USERDATA, /* pass in a user data pointer used in the lock/unlock3071callback functions */3072CURLSHOPT_LAST /* never use */3073} CURLSHoption;30743075CURL_EXTERN CURLSH *curl_share_init(void);3076CURL_EXTERN CURLSHcode curl_share_setopt(CURLSH *share, CURLSHoption option,3077...);3078CURL_EXTERN CURLSHcode curl_share_cleanup(CURLSH *share);30793080/****************************************************************************3081* Structures for querying information about the curl library at runtime.3082*/30833084typedef enum {3085CURLVERSION_FIRST, /* 7.10 */3086CURLVERSION_SECOND, /* 7.11.1 */3087CURLVERSION_THIRD, /* 7.12.0 */3088CURLVERSION_FOURTH, /* 7.16.1 */3089CURLVERSION_FIFTH, /* 7.57.0 */3090CURLVERSION_SIXTH, /* 7.66.0 */3091CURLVERSION_SEVENTH, /* 7.70.0 */3092CURLVERSION_EIGHTH, /* 7.72.0 */3093CURLVERSION_NINTH, /* 7.75.0 */3094CURLVERSION_TENTH, /* 7.77.0 */3095CURLVERSION_ELEVENTH, /* 7.87.0 */3096CURLVERSION_TWELFTH, /* 8.8.0 */3097CURLVERSION_LAST /* never actually use this */3098} CURLversion;30993100/* The 'CURLVERSION_NOW' is the symbolic name meant to be used by3101basically all programs ever that want to get version information. It is3102meant to be a built-in version number for what kind of struct the caller3103expects. If the struct ever changes, we redefine the NOW to another enum3104from above. */3105#define CURLVERSION_NOW CURLVERSION_TWELFTH31063107struct curl_version_info_data {3108CURLversion age; /* age of the returned struct */3109const char *version; /* LIBCURL_VERSION */3110unsigned int version_num; /* LIBCURL_VERSION_NUM */3111const char *host; /* OS/host/cpu/machine when configured */3112int features; /* bitmask, see defines below */3113const char *ssl_version; /* human readable string */3114long ssl_version_num; /* not used anymore, always 0 */3115const char *libz_version; /* human readable string */3116/* protocols is terminated by an entry with a NULL protoname */3117const char * const *protocols;31183119/* The fields below this were added in CURLVERSION_SECOND */3120const char *ares;3121int ares_num;31223123/* This field was added in CURLVERSION_THIRD */3124const char *libidn;31253126/* These field were added in CURLVERSION_FOURTH */31273128/* Same as '_libiconv_version' if built with HAVE_ICONV */3129int iconv_ver_num;31303131const char *libssh_version; /* human readable string */31323133/* These fields were added in CURLVERSION_FIFTH */3134unsigned int brotli_ver_num; /* Numeric Brotli version3135(MAJOR << 24) | (MINOR << 12) | PATCH */3136const char *brotli_version; /* human readable string. */31373138/* These fields were added in CURLVERSION_SIXTH */3139unsigned int nghttp2_ver_num; /* Numeric nghttp2 version3140(MAJOR << 16) | (MINOR << 8) | PATCH */3141const char *nghttp2_version; /* human readable string. */3142const char *quic_version; /* human readable quic (+ HTTP/3) library +3143version or NULL */31443145/* These fields were added in CURLVERSION_SEVENTH */3146const char *cainfo; /* the built-in default CURLOPT_CAINFO, might3147be NULL */3148const char *capath; /* the built-in default CURLOPT_CAPATH, might3149be NULL */31503151/* These fields were added in CURLVERSION_EIGHTH */3152unsigned int zstd_ver_num; /* Numeric Zstd version3153(MAJOR << 24) | (MINOR << 12) | PATCH */3154const char *zstd_version; /* human readable string. */31553156/* These fields were added in CURLVERSION_NINTH */3157const char *hyper_version; /* human readable string. */31583159/* These fields were added in CURLVERSION_TENTH */3160const char *gsasl_version; /* human readable string. */31613162/* These fields were added in CURLVERSION_ELEVENTH */3163/* feature_names is terminated by an entry with a NULL feature name */3164const char * const *feature_names;31653166/* These fields were added in CURLVERSION_TWELFTH */3167const char *rtmp_version; /* human readable string. */3168};3169typedef struct curl_version_info_data curl_version_info_data;31703171#define CURL_VERSION_IPV6 (1<<0) /* IPv6-enabled */3172#define CURL_VERSION_KERBEROS4 (1<<1) /* Kerberos V4 auth is supported3173(deprecated) */3174#define CURL_VERSION_SSL (1<<2) /* SSL options are present */3175#define CURL_VERSION_LIBZ (1<<3) /* libz features are present */3176#define CURL_VERSION_NTLM (1<<4) /* NTLM auth is supported */3177#define CURL_VERSION_GSSNEGOTIATE (1<<5) /* Negotiate auth is supported3178(deprecated) */3179#define CURL_VERSION_DEBUG (1<<6) /* Built with debug capabilities */3180#define CURL_VERSION_ASYNCHDNS (1<<7) /* Asynchronous DNS resolves */3181#define CURL_VERSION_SPNEGO (1<<8) /* SPNEGO auth is supported */3182#define CURL_VERSION_LARGEFILE (1<<9) /* Supports files larger than 2GB */3183#define CURL_VERSION_IDN (1<<10) /* Internationized Domain Names are3184supported */3185#define CURL_VERSION_SSPI (1<<11) /* Built against Windows SSPI */3186#define CURL_VERSION_CONV (1<<12) /* Character conversions supported */3187#define CURL_VERSION_CURLDEBUG (1<<13) /* Debug memory tracking supported */3188#define CURL_VERSION_TLSAUTH_SRP (1<<14) /* TLS-SRP auth is supported */3189#define CURL_VERSION_NTLM_WB (1<<15) /* NTLM delegation to winbind helper3190is supported */3191#define CURL_VERSION_HTTP2 (1<<16) /* HTTP2 support built-in */3192#define CURL_VERSION_GSSAPI (1<<17) /* Built against a GSS-API library */3193#define CURL_VERSION_KERBEROS5 (1<<18) /* Kerberos V5 auth is supported */3194#define CURL_VERSION_UNIX_SOCKETS (1<<19) /* Unix domain sockets support */3195#define CURL_VERSION_PSL (1<<20) /* Mozilla's Public Suffix List, used3196for cookie domain verification */3197#define CURL_VERSION_HTTPS_PROXY (1<<21) /* HTTPS-proxy support built-in */3198#define CURL_VERSION_MULTI_SSL (1<<22) /* Multiple SSL backends available */3199#define CURL_VERSION_BROTLI (1<<23) /* Brotli features are present. */3200#define CURL_VERSION_ALTSVC (1<<24) /* Alt-Svc handling built-in */3201#define CURL_VERSION_HTTP3 (1<<25) /* HTTP3 support built-in */3202#define CURL_VERSION_ZSTD (1<<26) /* zstd features are present */3203#define CURL_VERSION_UNICODE (1<<27) /* Unicode support on Windows */3204#define CURL_VERSION_HSTS (1<<28) /* HSTS is supported */3205#define CURL_VERSION_GSASL (1<<29) /* libgsasl is supported */3206#define CURL_VERSION_THREADSAFE (1<<30) /* libcurl API is thread-safe */32073208/*3209* NAME curl_version_info()3210*3211* DESCRIPTION3212*3213* This function returns a pointer to a static copy of the version info3214* struct. See above.3215*/3216CURL_EXTERN curl_version_info_data *curl_version_info(CURLversion);32173218/*3219* NAME curl_easy_strerror()3220*3221* DESCRIPTION3222*3223* The curl_easy_strerror function may be used to turn a CURLcode value3224* into the equivalent human readable error string. This is useful3225* for printing meaningful error messages.3226*/3227CURL_EXTERN const char *curl_easy_strerror(CURLcode);32283229/*3230* NAME curl_share_strerror()3231*3232* DESCRIPTION3233*3234* The curl_share_strerror function may be used to turn a CURLSHcode value3235* into the equivalent human readable error string. This is useful3236* for printing meaningful error messages.3237*/3238CURL_EXTERN const char *curl_share_strerror(CURLSHcode);32393240/*3241* NAME curl_easy_pause()3242*3243* DESCRIPTION3244*3245* The curl_easy_pause function pauses or unpauses transfers. Select the new3246* state by setting the bitmask, use the convenience defines below.3247*3248*/3249CURL_EXTERN CURLcode curl_easy_pause(CURL *handle, int bitmask);32503251#define CURLPAUSE_RECV (1<<0)3252#define CURLPAUSE_RECV_CONT (0)32533254#define CURLPAUSE_SEND (1<<2)3255#define CURLPAUSE_SEND_CONT (0)32563257#define CURLPAUSE_ALL (CURLPAUSE_RECV|CURLPAUSE_SEND)3258#define CURLPAUSE_CONT (CURLPAUSE_RECV_CONT|CURLPAUSE_SEND_CONT)32593260/*3261* NAME curl_easy_ssls_import()3262*3263* DESCRIPTION3264*3265* The curl_easy_ssls_import function adds a previously exported SSL session3266* to the SSL session cache of the easy handle (or the underlying share).3267*/3268CURL_EXTERN CURLcode curl_easy_ssls_import(CURL *handle,3269const char *session_key,3270const unsigned char *shmac,3271size_t shmac_len,3272const unsigned char *sdata,3273size_t sdata_len);32743275/* This is the curl_ssls_export_cb callback prototype. It3276* is passed to curl_easy_ssls_export() to extract SSL sessions/tickets. */3277typedef CURLcode curl_ssls_export_cb(CURL *handle,3278void *userptr,3279const char *session_key,3280const unsigned char *shmac,3281size_t shmac_len,3282const unsigned char *sdata,3283size_t sdata_len,3284curl_off_t valid_until,3285int ietf_tls_id,3286const char *alpn,3287size_t earlydata_max);32883289/*3290* NAME curl_easy_ssls_export()3291*3292* DESCRIPTION3293*3294* The curl_easy_ssls_export function iterates over all SSL sessions stored3295* in the easy handle (or underlying share) and invokes the passed3296* callback.3297*3298*/3299CURL_EXTERN CURLcode curl_easy_ssls_export(CURL *handle,3300curl_ssls_export_cb *export_fn,3301void *userptr);330233033304#ifdef __cplusplus3305} /* end of extern "C" */3306#endif33073308/* unfortunately, the easy.h and multi.h include files need options and info3309stuff before they can be included! */3310#include "easy.h" /* nothing in curl is fun without the easy stuff */3311#include "multi.h"3312#include "urlapi.h"3313#include "options.h"3314#include "header.h"3315#include "websockets.h"3316#include "mprintf.h"33173318/* the typechecker does not work in C++ (yet) */3319#if defined(__GNUC__) && defined(__GNUC_MINOR__) && \3320((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) && \3321!defined(__cplusplus) && !defined(CURL_DISABLE_TYPECHECK)3322#include "typecheck-gcc.h"3323#else3324#if defined(__STDC__) && (__STDC__ >= 1)3325#if 0 /* Triggers clang -Wdisabled-macro-expansion, skip for CMake. */3326/* This preprocessor magic that replaces a call with the exact same call is3327only done to make sure application authors pass exactly three arguments3328to these functions. */3329#define curl_easy_setopt(handle,opt,param) curl_easy_setopt(handle,opt,param)3330#define curl_easy_getinfo(handle,info,arg) curl_easy_getinfo(handle,info,arg)3331#define curl_share_setopt(share,opt,param) curl_share_setopt(share,opt,param)3332#define curl_multi_setopt(handle,opt,param) curl_multi_setopt(handle,opt,param)3333#endif3334#endif /* __STDC__ >= 1 */3335#endif /* gcc >= 4.3 && !__cplusplus && !CURL_DISABLE_TYPECHECK */33363337#endif /* CURLINC_CURL_H */333833393340