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