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