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