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