VirtualBox

source: vbox/trunk/src/libs/curl-7.87.0/include/curl/curl.h@ 99223

Last change on this file since 99223 was 98326, checked in by vboxsync, 2 years ago

curl-7.87.0: Applied and adjusted our curl changes to 7.83.1. bugref:10356

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

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette