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