1#ifndef CURLINC_CURL_H
2#define CURLINC_CURL_H
3/***************************************************************************
4 * _ _ ____ _
5 * Project ___| | | | _ \| |
6 * / __| | | | |_) | |
7 * | (__| |_| | _ <| |___
8 * \___|\___/|_| \_\_____|
9 *
10 * Copyright (C) 1998 - 2019, 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.haxx.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.haxx.se/libcurl/
28 *
29 * curl-library mailing list subscription and unsubscription web interface:
30 * https://cool.haxx.se/mailman/listinfo/curl-library/
31 */
32
33#ifdef CURL_NO_OLDIES
34#define CURL_STRICTER
35#endif
36
37#include "curlver.h" /* libcurl version defines */
38#include "system.h" /* determine things run-time */
39
40/*
41 * Define WIN32 when build target is Win32 API
42 */
43
44#if (defined(_WIN32) || defined(__WIN32__)) && \
45 !defined(WIN32) && !defined(__SYMBIAN32__)
46#define WIN32
47#endif
48
49#include <stdio.h>
50#include <limits.h>
51
52#if defined(__FreeBSD__) && (__FreeBSD__ >= 2)
53/* Needed for __FreeBSD_version symbol definition */
54#include <osreldate.h>
55#endif
56
57/* The include stuff here below is mainly for time_t! */
58#include <sys/types.h>
59#include <time.h>
60
61#if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__CYGWIN__)
62#if !(defined(_WINSOCKAPI_) || defined(_WINSOCK_H) || \
63 defined(__LWIP_OPT_H__) || defined(LWIP_HDR_OPT_H))
64/* The check above prevents the winsock2 inclusion if winsock.h already was
65 included, since they can't co-exist without problems */
66#include <winsock2.h>
67#include <ws2tcpip.h>
68#endif
69#endif
70
71/* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish
72 libc5-based Linux systems. Only include it on systems that are known to
73 require it! */
74#if defined(_AIX) || defined(__NOVELL_LIBC__) || defined(__NetBSD__) || \
75 defined(__minix) || defined(__SYMBIAN32__) || defined(__INTEGRITY) || \
76 defined(ANDROID) || defined(__ANDROID__) || defined(__OpenBSD__) || \
77 defined(__CYGWIN__) || \
78 (defined(__FreeBSD_version) && (__FreeBSD_version < 800000))
79#include <sys/select.h>
80#endif
81
82#if !defined(WIN32) && !defined(_WIN32_WCE)
83#include <sys/socket.h>
84#endif
85
86#if !defined(WIN32) && !defined(__WATCOMC__) && !defined(__VXWORKS__)
87#include <sys/time.h>
88#endif
89
90#ifdef __BEOS__
91#include <support/SupportDefs.h>
92#endif
93
94/* Compatibility for non-Clang compilers */
95#ifndef __has_declspec_attribute
96# define __has_declspec_attribute(x) 0
97#endif
98
99#ifdef __cplusplus
100extern "C" {
101#endif
102
103#if defined(BUILDING_LIBCURL) || defined(CURL_STRICTER)
104typedef struct Curl_easy CURL;
105typedef struct Curl_share CURLSH;
106#else
107typedef void CURL;
108typedef void CURLSH;
109#endif
110
111/*
112 * libcurl external API function linkage decorations.
113 */
114
115#ifdef CURL_STATICLIB
116# define CURL_EXTERN
117#elif defined(WIN32) || defined(__SYMBIAN32__) || \
118 (__has_declspec_attribute(dllexport) && \
119 __has_declspec_attribute(dllimport))
120# if defined(BUILDING_LIBCURL)
121# define CURL_EXTERN __declspec(dllexport)
122# else
123# define CURL_EXTERN __declspec(dllimport)
124# endif
125#elif defined(BUILDING_LIBCURL) && defined(CURL_HIDDEN_SYMBOLS)
126# define CURL_EXTERN CURL_EXTERN_SYMBOL
127#else
128# define CURL_EXTERN
129#endif
130
131#ifndef curl_socket_typedef
132/* socket typedef */
133#if defined(WIN32) && !defined(__LWIP_OPT_H__) && !defined(LWIP_HDR_OPT_H)
134typedef SOCKET curl_socket_t;
135#define CURL_SOCKET_BAD INVALID_SOCKET
136#else
137typedef int curl_socket_t;
138#define CURL_SOCKET_BAD -1
139#endif
140#define curl_socket_typedef
141#endif /* curl_socket_typedef */
142
143/* enum for the different supported SSL backends */
144typedef enum {
145 CURLSSLBACKEND_NONE = 0,
146 CURLSSLBACKEND_OPENSSL = 1,
147 CURLSSLBACKEND_GNUTLS = 2,
148 CURLSSLBACKEND_NSS = 3,
149 CURLSSLBACKEND_OBSOLETE4 = 4, /* Was QSOSSL. */
150 CURLSSLBACKEND_GSKIT = 5,
151 CURLSSLBACKEND_POLARSSL = 6,
152 CURLSSLBACKEND_WOLFSSL = 7,
153 CURLSSLBACKEND_SCHANNEL = 8,
154 CURLSSLBACKEND_SECURETRANSPORT = 9,
155 CURLSSLBACKEND_AXTLS = 10, /* never used since 7.63.0 */
156 CURLSSLBACKEND_MBEDTLS = 11,
157 CURLSSLBACKEND_MESALINK = 12,
158 CURLSSLBACKEND_BEARSSL = 13
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
169struct 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 */
220typedef 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. */
229typedef 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
261typedef 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 */
267typedef int (*curl_resolver_start_callback)(void *resolver_state,
268 void *reserved, void *userdata);
269
270/* enumeration of file types */
271typedef 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 */
294struct 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 */
329typedef 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. */
343typedef 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. */
352typedef 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 */
361typedef 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
379typedef size_t (*curl_read_callback)(char *buffer,
380 size_t size,
381 size_t nitems,
382 void *instream);
383
384typedef int (*curl_trailer_callback)(struct curl_slist **list,
385 void *userdata);
386
387typedef 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
400typedef int (*curl_sockopt_callback)(void *clientp,
401 curl_socket_t curlfd,
402 curlsocktype purpose);
403
404struct 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
414typedef curl_socket_t
415(*curl_opensocket_callback)(void *clientp,
416 curlsocktype purpose,
417 struct curl_sockaddr *address);
418
419typedef int
420(*curl_closesocket_callback)(void *clientp, curl_socket_t item);
421
422typedef 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
429typedef enum {
430 CURLIOCMD_NOP, /* no operation */
431 CURLIOCMD_RESTARTREAD, /* restart the read stream from start */
432 CURLIOCMD_LAST /* never use */
433} curliocmd;
434
435typedef 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 */
446typedef void *(*curl_malloc_callback)(size_t size);
447typedef void (*curl_free_callback)(void *ptr);
448typedef void *(*curl_realloc_callback)(void *ptr, size_t size);
449typedef char *(*curl_strdup_callback)(const char *str);
450typedef 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*/
456typedef 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
467typedef 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/* All possible error codes from all sorts of curl functions. Future versions
475 may return other values, stay prepared.
476
477 Always add new return codes last. Never *EVER* remove any. The return
478 codes must remain the same!
479 */
480
481typedef enum {
482 CURLE_OK = 0,
483 CURLE_UNSUPPORTED_PROTOCOL, /* 1 */
484 CURLE_FAILED_INIT, /* 2 */
485 CURLE_URL_MALFORMAT, /* 3 */
486 CURLE_NOT_BUILT_IN, /* 4 - [was obsoleted in August 2007 for
487 7.17.0, reused in April 2011 for 7.21.5] */
488 CURLE_COULDNT_RESOLVE_PROXY, /* 5 */
489 CURLE_COULDNT_RESOLVE_HOST, /* 6 */
490 CURLE_COULDNT_CONNECT, /* 7 */
491 CURLE_WEIRD_SERVER_REPLY, /* 8 */
492 CURLE_REMOTE_ACCESS_DENIED, /* 9 a service was denied by the server
493 due to lack of access - when login fails
494 this is not returned. */
495 CURLE_FTP_ACCEPT_FAILED, /* 10 - [was obsoleted in April 2006 for
496 7.15.4, reused in Dec 2011 for 7.24.0]*/
497 CURLE_FTP_WEIRD_PASS_REPLY, /* 11 */
498 CURLE_FTP_ACCEPT_TIMEOUT, /* 12 - timeout occurred accepting server
499 [was obsoleted in August 2007 for 7.17.0,
500 reused in Dec 2011 for 7.24.0]*/
501 CURLE_FTP_WEIRD_PASV_REPLY, /* 13 */
502 CURLE_FTP_WEIRD_227_FORMAT, /* 14 */
503 CURLE_FTP_CANT_GET_HOST, /* 15 */
504 CURLE_HTTP2, /* 16 - A problem in the http2 framing layer.
505 [was obsoleted in August 2007 for 7.17.0,
506 reused in July 2014 for 7.38.0] */
507 CURLE_FTP_COULDNT_SET_TYPE, /* 17 */
508 CURLE_PARTIAL_FILE, /* 18 */
509 CURLE_FTP_COULDNT_RETR_FILE, /* 19 */
510 CURLE_OBSOLETE20, /* 20 - NOT USED */
511 CURLE_QUOTE_ERROR, /* 21 - quote command failure */
512 CURLE_HTTP_RETURNED_ERROR, /* 22 */
513 CURLE_WRITE_ERROR, /* 23 */
514 CURLE_OBSOLETE24, /* 24 - NOT USED */
515 CURLE_UPLOAD_FAILED, /* 25 - failed upload "command" */
516 CURLE_READ_ERROR, /* 26 - couldn't open/read from file */
517 CURLE_OUT_OF_MEMORY, /* 27 */
518 /* Note: CURLE_OUT_OF_MEMORY may sometimes indicate a conversion error
519 instead of a memory allocation error if CURL_DOES_CONVERSIONS
520 is defined
521 */
522 CURLE_OPERATION_TIMEDOUT, /* 28 - the timeout time was reached */
523 CURLE_OBSOLETE29, /* 29 - NOT USED */
524 CURLE_FTP_PORT_FAILED, /* 30 - FTP PORT operation failed */
525 CURLE_FTP_COULDNT_USE_REST, /* 31 - the REST command failed */
526 CURLE_OBSOLETE32, /* 32 - NOT USED */
527 CURLE_RANGE_ERROR, /* 33 - RANGE "command" didn't work */
528 CURLE_HTTP_POST_ERROR, /* 34 */
529 CURLE_SSL_CONNECT_ERROR, /* 35 - wrong when connecting with SSL */
530 CURLE_BAD_DOWNLOAD_RESUME, /* 36 - couldn't resume download */
531 CURLE_FILE_COULDNT_READ_FILE, /* 37 */
532 CURLE_LDAP_CANNOT_BIND, /* 38 */
533 CURLE_LDAP_SEARCH_FAILED, /* 39 */
534 CURLE_OBSOLETE40, /* 40 - NOT USED */
535 CURLE_FUNCTION_NOT_FOUND, /* 41 - NOT USED starting with 7.53.0 */
536 CURLE_ABORTED_BY_CALLBACK, /* 42 */
537 CURLE_BAD_FUNCTION_ARGUMENT, /* 43 */
538 CURLE_OBSOLETE44, /* 44 - NOT USED */
539 CURLE_INTERFACE_FAILED, /* 45 - CURLOPT_INTERFACE failed */
540 CURLE_OBSOLETE46, /* 46 - NOT USED */
541 CURLE_TOO_MANY_REDIRECTS, /* 47 - catch endless re-direct loops */
542 CURLE_UNKNOWN_OPTION, /* 48 - User specified an unknown option */
543 CURLE_TELNET_OPTION_SYNTAX, /* 49 - Malformed telnet option */
544 CURLE_OBSOLETE50, /* 50 - NOT USED */
545 CURLE_OBSOLETE51, /* 51 - NOT USED */
546 CURLE_GOT_NOTHING, /* 52 - when this is a specific error */
547 CURLE_SSL_ENGINE_NOTFOUND, /* 53 - SSL crypto engine not found */
548 CURLE_SSL_ENGINE_SETFAILED, /* 54 - can not set SSL crypto engine as
549 default */
550 CURLE_SEND_ERROR, /* 55 - failed sending network data */
551 CURLE_RECV_ERROR, /* 56 - failure in receiving network data */
552 CURLE_OBSOLETE57, /* 57 - NOT IN USE */
553 CURLE_SSL_CERTPROBLEM, /* 58 - problem with the local certificate */
554 CURLE_SSL_CIPHER, /* 59 - couldn't use specified cipher */
555 CURLE_PEER_FAILED_VERIFICATION, /* 60 - peer's certificate or fingerprint
556 wasn't verified fine */
557 CURLE_BAD_CONTENT_ENCODING, /* 61 - Unrecognized/bad encoding */
558 CURLE_LDAP_INVALID_URL, /* 62 - Invalid LDAP URL */
559 CURLE_FILESIZE_EXCEEDED, /* 63 - Maximum file size exceeded */
560 CURLE_USE_SSL_FAILED, /* 64 - Requested FTP SSL level failed */
561 CURLE_SEND_FAIL_REWIND, /* 65 - Sending the data requires a rewind
562 that failed */
563 CURLE_SSL_ENGINE_INITFAILED, /* 66 - failed to initialise ENGINE */
564 CURLE_LOGIN_DENIED, /* 67 - user, password or similar was not
565 accepted and we failed to login */
566 CURLE_TFTP_NOTFOUND, /* 68 - file not found on server */
567 CURLE_TFTP_PERM, /* 69 - permission problem on server */
568 CURLE_REMOTE_DISK_FULL, /* 70 - out of disk space on server */
569 CURLE_TFTP_ILLEGAL, /* 71 - Illegal TFTP operation */
570 CURLE_TFTP_UNKNOWNID, /* 72 - Unknown transfer ID */
571 CURLE_REMOTE_FILE_EXISTS, /* 73 - File already exists */
572 CURLE_TFTP_NOSUCHUSER, /* 74 - No such user */
573 CURLE_CONV_FAILED, /* 75 - conversion failed */
574 CURLE_CONV_REQD, /* 76 - caller must register conversion
575 callbacks using curl_easy_setopt options
576 CURLOPT_CONV_FROM_NETWORK_FUNCTION,
577 CURLOPT_CONV_TO_NETWORK_FUNCTION, and
578 CURLOPT_CONV_FROM_UTF8_FUNCTION */
579 CURLE_SSL_CACERT_BADFILE, /* 77 - could not load CACERT file, missing
580 or wrong format */
581 CURLE_REMOTE_FILE_NOT_FOUND, /* 78 - remote file not found */
582 CURLE_SSH, /* 79 - error from the SSH layer, somewhat
583 generic so the error message will be of
584 interest when this has happened */
585
586 CURLE_SSL_SHUTDOWN_FAILED, /* 80 - Failed to shut down the SSL
587 connection */
588 CURLE_AGAIN, /* 81 - socket is not ready for send/recv,
589 wait till it's ready and try again (Added
590 in 7.18.2) */
591 CURLE_SSL_CRL_BADFILE, /* 82 - could not load CRL file, missing or
592 wrong format (Added in 7.19.0) */
593 CURLE_SSL_ISSUER_ERROR, /* 83 - Issuer check failed. (Added in
594 7.19.0) */
595 CURLE_FTP_PRET_FAILED, /* 84 - a PRET command failed */
596 CURLE_RTSP_CSEQ_ERROR, /* 85 - mismatch of RTSP CSeq numbers */
597 CURLE_RTSP_SESSION_ERROR, /* 86 - mismatch of RTSP Session Ids */
598 CURLE_FTP_BAD_FILE_LIST, /* 87 - unable to parse FTP file list */
599 CURLE_CHUNK_FAILED, /* 88 - chunk callback reported error */
600 CURLE_NO_CONNECTION_AVAILABLE, /* 89 - No connection available, the
601 session will be queued */
602 CURLE_SSL_PINNEDPUBKEYNOTMATCH, /* 90 - specified pinned public key did not
603 match */
604 CURLE_SSL_INVALIDCERTSTATUS, /* 91 - invalid certificate status */
605 CURLE_HTTP2_STREAM, /* 92 - stream error in HTTP/2 framing layer
606 */
607 CURLE_RECURSIVE_API_CALL, /* 93 - an api function was called from
608 inside a callback */
609 CURLE_AUTH_ERROR, /* 94 - an authentication function returned an
610 error */
611 CURLE_HTTP3, /* 95 - An HTTP/3 layer problem */
612 CURL_LAST /* never use! */
613} CURLcode;
614
615#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all
616 the obsolete stuff removed! */
617
618/* Previously obsolete error code re-used in 7.38.0 */
619#define CURLE_OBSOLETE16 CURLE_HTTP2
620
621/* Previously obsolete error codes re-used in 7.24.0 */
622#define CURLE_OBSOLETE10 CURLE_FTP_ACCEPT_FAILED
623#define CURLE_OBSOLETE12 CURLE_FTP_ACCEPT_TIMEOUT
624
625/* compatibility with older names */
626#define CURLOPT_ENCODING CURLOPT_ACCEPT_ENCODING
627#define CURLE_FTP_WEIRD_SERVER_REPLY CURLE_WEIRD_SERVER_REPLY
628
629/* The following were added in 7.62.0 */
630#define CURLE_SSL_CACERT CURLE_PEER_FAILED_VERIFICATION
631
632/* The following were added in 7.21.5, April 2011 */
633#define CURLE_UNKNOWN_TELNET_OPTION CURLE_UNKNOWN_OPTION
634
635/* The following were added in 7.17.1 */
636/* These are scheduled to disappear by 2009 */
637#define CURLE_SSL_PEER_CERTIFICATE CURLE_PEER_FAILED_VERIFICATION
638
639/* The following were added in 7.17.0 */
640/* These are scheduled to disappear by 2009 */
641#define CURLE_OBSOLETE CURLE_OBSOLETE50 /* no one should be using this! */
642#define CURLE_BAD_PASSWORD_ENTERED CURLE_OBSOLETE46
643#define CURLE_BAD_CALLING_ORDER CURLE_OBSOLETE44
644#define CURLE_FTP_USER_PASSWORD_INCORRECT CURLE_OBSOLETE10
645#define CURLE_FTP_CANT_RECONNECT CURLE_OBSOLETE16
646#define CURLE_FTP_COULDNT_GET_SIZE CURLE_OBSOLETE32
647#define CURLE_FTP_COULDNT_SET_ASCII CURLE_OBSOLETE29
648#define CURLE_FTP_WEIRD_USER_REPLY CURLE_OBSOLETE12
649#define CURLE_FTP_WRITE_ERROR CURLE_OBSOLETE20
650#define CURLE_LIBRARY_NOT_FOUND CURLE_OBSOLETE40
651#define CURLE_MALFORMAT_USER CURLE_OBSOLETE24
652#define CURLE_SHARE_IN_USE CURLE_OBSOLETE57
653#define CURLE_URL_MALFORMAT_USER CURLE_NOT_BUILT_IN
654
655#define CURLE_FTP_ACCESS_DENIED CURLE_REMOTE_ACCESS_DENIED
656#define CURLE_FTP_COULDNT_SET_BINARY CURLE_FTP_COULDNT_SET_TYPE
657#define CURLE_FTP_QUOTE_ERROR CURLE_QUOTE_ERROR
658#define CURLE_TFTP_DISKFULL CURLE_REMOTE_DISK_FULL
659#define CURLE_TFTP_EXISTS CURLE_REMOTE_FILE_EXISTS
660#define CURLE_HTTP_RANGE_ERROR CURLE_RANGE_ERROR
661#define CURLE_FTP_SSL_FAILED CURLE_USE_SSL_FAILED
662
663/* The following were added earlier */
664
665#define CURLE_OPERATION_TIMEOUTED CURLE_OPERATION_TIMEDOUT
666
667#define CURLE_HTTP_NOT_FOUND CURLE_HTTP_RETURNED_ERROR
668#define CURLE_HTTP_PORT_FAILED CURLE_INTERFACE_FAILED
669#define CURLE_FTP_COULDNT_STOR_FILE CURLE_UPLOAD_FAILED
670
671#define CURLE_FTP_PARTIAL_FILE CURLE_PARTIAL_FILE
672#define CURLE_FTP_BAD_DOWNLOAD_RESUME CURLE_BAD_DOWNLOAD_RESUME
673
674/* This was the error code 50 in 7.7.3 and a few earlier versions, this
675 is no longer used by libcurl but is instead #defined here only to not
676 make programs break */
677#define CURLE_ALREADY_COMPLETE 99999
678
679/* Provide defines for really old option names */
680#define CURLOPT_FILE CURLOPT_WRITEDATA /* name changed in 7.9.7 */
681#define CURLOPT_INFILE CURLOPT_READDATA /* name changed in 7.9.7 */
682#define CURLOPT_WRITEHEADER CURLOPT_HEADERDATA
683
684/* Since long deprecated options with no code in the lib that does anything
685 with them. */
686#define CURLOPT_WRITEINFO CURLOPT_OBSOLETE40
687#define CURLOPT_CLOSEPOLICY CURLOPT_OBSOLETE72
688
689#endif /*!CURL_NO_OLDIES*/
690
691/* This prototype applies to all conversion callbacks */
692typedef CURLcode (*curl_conv_callback)(char *buffer, size_t length);
693
694typedef CURLcode (*curl_ssl_ctx_callback)(CURL *curl, /* easy handle */
695 void *ssl_ctx, /* actually an OpenSSL
696 or WolfSSL SSL_CTX,
697 or an mbedTLS
698 mbedtls_ssl_config */
699 void *userptr);
700
701typedef enum {
702 CURLPROXY_HTTP = 0, /* added in 7.10, new in 7.19.4 default is to use
703 CONNECT HTTP/1.1 */
704 CURLPROXY_HTTP_1_0 = 1, /* added in 7.19.4, force to use CONNECT
705 HTTP/1.0 */
706 CURLPROXY_HTTPS = 2, /* added in 7.52.0 */
707 CURLPROXY_SOCKS4 = 4, /* support added in 7.15.2, enum existed already
708 in 7.10 */
709 CURLPROXY_SOCKS5 = 5, /* added in 7.10 */
710 CURLPROXY_SOCKS4A = 6, /* added in 7.18.0 */
711 CURLPROXY_SOCKS5_HOSTNAME = 7 /* Use the SOCKS5 protocol but pass along the
712 host name rather than the IP address. added
713 in 7.18.0 */
714} curl_proxytype; /* this enum was added in 7.10 */
715
716/*
717 * Bitmasks for CURLOPT_HTTPAUTH and CURLOPT_PROXYAUTH options:
718 *
719 * CURLAUTH_NONE - No HTTP authentication
720 * CURLAUTH_BASIC - HTTP Basic authentication (default)
721 * CURLAUTH_DIGEST - HTTP Digest authentication
722 * CURLAUTH_NEGOTIATE - HTTP Negotiate (SPNEGO) authentication
723 * CURLAUTH_GSSNEGOTIATE - Alias for CURLAUTH_NEGOTIATE (deprecated)
724 * CURLAUTH_NTLM - HTTP NTLM authentication
725 * CURLAUTH_DIGEST_IE - HTTP Digest authentication with IE flavour
726 * CURLAUTH_NTLM_WB - HTTP NTLM authentication delegated to winbind helper
727 * CURLAUTH_BEARER - HTTP Bearer token authentication
728 * CURLAUTH_ONLY - Use together with a single other type to force no
729 * authentication or just that single type
730 * CURLAUTH_ANY - All fine types set
731 * CURLAUTH_ANYSAFE - All fine types except Basic
732 */
733
734#define CURLAUTH_NONE ((unsigned long)0)
735#define CURLAUTH_BASIC (((unsigned long)1)<<0)
736#define CURLAUTH_DIGEST (((unsigned long)1)<<1)
737#define CURLAUTH_NEGOTIATE (((unsigned long)1)<<2)
738/* Deprecated since the advent of CURLAUTH_NEGOTIATE */
739#define CURLAUTH_GSSNEGOTIATE CURLAUTH_NEGOTIATE
740/* Used for CURLOPT_SOCKS5_AUTH to stay terminologically correct */
741#define CURLAUTH_GSSAPI CURLAUTH_NEGOTIATE
742#define CURLAUTH_NTLM (((unsigned long)1)<<3)
743#define CURLAUTH_DIGEST_IE (((unsigned long)1)<<4)
744#define CURLAUTH_NTLM_WB (((unsigned long)1)<<5)
745#define CURLAUTH_BEARER (((unsigned long)1)<<6)
746#define CURLAUTH_ONLY (((unsigned long)1)<<31)
747#define CURLAUTH_ANY (~CURLAUTH_DIGEST_IE)
748#define CURLAUTH_ANYSAFE (~(CURLAUTH_BASIC|CURLAUTH_DIGEST_IE))
749
750#define CURLSSH_AUTH_ANY ~0 /* all types supported by the server */
751#define CURLSSH_AUTH_NONE 0 /* none allowed, silly but complete */
752#define CURLSSH_AUTH_PUBLICKEY (1<<0) /* public/private key files */
753#define CURLSSH_AUTH_PASSWORD (1<<1) /* password */
754#define CURLSSH_AUTH_HOST (1<<2) /* host key files */
755#define CURLSSH_AUTH_KEYBOARD (1<<3) /* keyboard interactive */
756#define CURLSSH_AUTH_AGENT (1<<4) /* agent (ssh-agent, pageant...) */
757#define CURLSSH_AUTH_GSSAPI (1<<5) /* gssapi (kerberos, ...) */
758#define CURLSSH_AUTH_DEFAULT CURLSSH_AUTH_ANY
759
760#define CURLGSSAPI_DELEGATION_NONE 0 /* no delegation (default) */
761#define CURLGSSAPI_DELEGATION_POLICY_FLAG (1<<0) /* if permitted by policy */
762#define CURLGSSAPI_DELEGATION_FLAG (1<<1) /* delegate always */
763
764#define CURL_ERROR_SIZE 256
765
766enum curl_khtype {
767 CURLKHTYPE_UNKNOWN,
768 CURLKHTYPE_RSA1,
769 CURLKHTYPE_RSA,
770 CURLKHTYPE_DSS,
771 CURLKHTYPE_ECDSA,
772 CURLKHTYPE_ED25519
773};
774
775struct curl_khkey {
776 const char *key; /* points to a zero-terminated string encoded with base64
777 if len is zero, otherwise to the "raw" data */
778 size_t len;
779 enum curl_khtype keytype;
780};
781
782/* this is the set of return values expected from the curl_sshkeycallback
783 callback */
784enum curl_khstat {
785 CURLKHSTAT_FINE_ADD_TO_FILE,
786 CURLKHSTAT_FINE,
787 CURLKHSTAT_REJECT, /* reject the connection, return an error */
788 CURLKHSTAT_DEFER, /* do not accept it, but we can't answer right now so
789 this causes a CURLE_DEFER error but otherwise the
790 connection will be left intact etc */
791 CURLKHSTAT_LAST /* not for use, only a marker for last-in-list */
792};
793
794/* this is the set of status codes pass in to the callback */
795enum curl_khmatch {
796 CURLKHMATCH_OK, /* match */
797 CURLKHMATCH_MISMATCH, /* host found, key mismatch! */
798 CURLKHMATCH_MISSING, /* no matching host/key found */
799 CURLKHMATCH_LAST /* not for use, only a marker for last-in-list */
800};
801
802typedef int
803 (*curl_sshkeycallback) (CURL *easy, /* easy handle */
804 const struct curl_khkey *knownkey, /* known */
805 const struct curl_khkey *foundkey, /* found */
806 enum curl_khmatch, /* libcurl's view on the keys */
807 void *clientp); /* custom pointer passed from app */
808
809/* parameter for the CURLOPT_USE_SSL option */
810typedef enum {
811 CURLUSESSL_NONE, /* do not attempt to use SSL */
812 CURLUSESSL_TRY, /* try using SSL, proceed anyway otherwise */
813 CURLUSESSL_CONTROL, /* SSL for the control connection or fail */
814 CURLUSESSL_ALL, /* SSL for all communication or fail */
815 CURLUSESSL_LAST /* not an option, never use */
816} curl_usessl;
817
818/* Definition of bits for the CURLOPT_SSL_OPTIONS argument: */
819
820/* - ALLOW_BEAST tells libcurl to allow the BEAST SSL vulnerability in the
821 name of improving interoperability with older servers. Some SSL libraries
822 have introduced work-arounds for this flaw but those work-arounds sometimes
823 make the SSL communication fail. To regain functionality with those broken
824 servers, a user can this way allow the vulnerability back. */
825#define CURLSSLOPT_ALLOW_BEAST (1<<0)
826
827/* - NO_REVOKE tells libcurl to disable certificate revocation checks for those
828 SSL backends where such behavior is present. */
829#define CURLSSLOPT_NO_REVOKE (1<<1)
830
831/* The default connection attempt delay in milliseconds for happy eyeballs.
832 CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS.3 and happy-eyeballs-timeout-ms.d document
833 this value, keep them in sync. */
834#define CURL_HET_DEFAULT 200L
835
836/* The default connection upkeep interval in milliseconds. */
837#define CURL_UPKEEP_INTERVAL_DEFAULT 60000L
838
839#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all
840 the obsolete stuff removed! */
841
842/* Backwards compatibility with older names */
843/* These are scheduled to disappear by 2009 */
844
845#define CURLFTPSSL_NONE CURLUSESSL_NONE
846#define CURLFTPSSL_TRY CURLUSESSL_TRY
847#define CURLFTPSSL_CONTROL CURLUSESSL_CONTROL
848#define CURLFTPSSL_ALL CURLUSESSL_ALL
849#define CURLFTPSSL_LAST CURLUSESSL_LAST
850#define curl_ftpssl curl_usessl
851#endif /*!CURL_NO_OLDIES*/
852
853/* parameter for the CURLOPT_FTP_SSL_CCC option */
854typedef enum {
855 CURLFTPSSL_CCC_NONE, /* do not send CCC */
856 CURLFTPSSL_CCC_PASSIVE, /* Let the server initiate the shutdown */
857 CURLFTPSSL_CCC_ACTIVE, /* Initiate the shutdown */
858 CURLFTPSSL_CCC_LAST /* not an option, never use */
859} curl_ftpccc;
860
861/* parameter for the CURLOPT_FTPSSLAUTH option */
862typedef enum {
863 CURLFTPAUTH_DEFAULT, /* let libcurl decide */
864 CURLFTPAUTH_SSL, /* use "AUTH SSL" */
865 CURLFTPAUTH_TLS, /* use "AUTH TLS" */
866 CURLFTPAUTH_LAST /* not an option, never use */
867} curl_ftpauth;
868
869/* parameter for the CURLOPT_FTP_CREATE_MISSING_DIRS option */
870typedef enum {
871 CURLFTP_CREATE_DIR_NONE, /* do NOT create missing dirs! */
872 CURLFTP_CREATE_DIR, /* (FTP/SFTP) if CWD fails, try MKD and then CWD
873 again if MKD succeeded, for SFTP this does
874 similar magic */
875 CURLFTP_CREATE_DIR_RETRY, /* (FTP only) if CWD fails, try MKD and then CWD
876 again even if MKD failed! */
877 CURLFTP_CREATE_DIR_LAST /* not an option, never use */
878} curl_ftpcreatedir;
879
880/* parameter for the CURLOPT_FTP_FILEMETHOD option */
881typedef enum {
882 CURLFTPMETHOD_DEFAULT, /* let libcurl pick */
883 CURLFTPMETHOD_MULTICWD, /* single CWD operation for each path part */
884 CURLFTPMETHOD_NOCWD, /* no CWD at all */
885 CURLFTPMETHOD_SINGLECWD, /* one CWD to full dir, then work on file */
886 CURLFTPMETHOD_LAST /* not an option, never use */
887} curl_ftpmethod;
888
889/* bitmask defines for CURLOPT_HEADEROPT */
890#define CURLHEADER_UNIFIED 0
891#define CURLHEADER_SEPARATE (1<<0)
892
893/* CURLALTSVC_* are bits for the CURLOPT_ALTSVC_CTRL option */
894#define CURLALTSVC_IMMEDIATELY (1<<0)
895
896#define CURLALTSVC_READONLYFILE (1<<2)
897#define CURLALTSVC_H1 (1<<3)
898#define CURLALTSVC_H2 (1<<4)
899#define CURLALTSVC_H3 (1<<5)
900
901/* CURLPROTO_ defines are for the CURLOPT_*PROTOCOLS options */
902#define CURLPROTO_HTTP (1<<0)
903#define CURLPROTO_HTTPS (1<<1)
904#define CURLPROTO_FTP (1<<2)
905#define CURLPROTO_FTPS (1<<3)
906#define CURLPROTO_SCP (1<<4)
907#define CURLPROTO_SFTP (1<<5)
908#define CURLPROTO_TELNET (1<<6)
909#define CURLPROTO_LDAP (1<<7)
910#define CURLPROTO_LDAPS (1<<8)
911#define CURLPROTO_DICT (1<<9)
912#define CURLPROTO_FILE (1<<10)
913#define CURLPROTO_TFTP (1<<11)
914#define CURLPROTO_IMAP (1<<12)
915#define CURLPROTO_IMAPS (1<<13)
916#define CURLPROTO_POP3 (1<<14)
917#define CURLPROTO_POP3S (1<<15)
918#define CURLPROTO_SMTP (1<<16)
919#define CURLPROTO_SMTPS (1<<17)
920#define CURLPROTO_RTSP (1<<18)
921#define CURLPROTO_RTMP (1<<19)
922#define CURLPROTO_RTMPT (1<<20)
923#define CURLPROTO_RTMPE (1<<21)
924#define CURLPROTO_RTMPTE (1<<22)
925#define CURLPROTO_RTMPS (1<<23)
926#define CURLPROTO_RTMPTS (1<<24)
927#define CURLPROTO_GOPHER (1<<25)
928#define CURLPROTO_SMB (1<<26)
929#define CURLPROTO_SMBS (1<<27)
930#define CURLPROTO_ALL (~0) /* enable everything */
931
932/* long may be 32 or 64 bits, but we should never depend on anything else
933 but 32 */
934#define CURLOPTTYPE_LONG 0
935#define CURLOPTTYPE_OBJECTPOINT 10000
936#define CURLOPTTYPE_FUNCTIONPOINT 20000
937#define CURLOPTTYPE_OFF_T 30000
938
939/* *STRINGPOINT is an alias for OBJECTPOINT to allow tools to extract the
940 string options from the header file */
941
942/* name is uppercase CURLOPT_<name>,
943 type is one of the defined CURLOPTTYPE_<type>
944 number is unique identifier */
945#ifdef CINIT
946#undef CINIT
947#endif
948
949#ifdef CURL_ISOCPP
950#define CINIT(na,t,nu) CURLOPT_ ## na = CURLOPTTYPE_ ## t + nu
951#else
952/* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */
953#define LONG CURLOPTTYPE_LONG
954#define OBJECTPOINT CURLOPTTYPE_OBJECTPOINT
955#define FUNCTIONPOINT CURLOPTTYPE_FUNCTIONPOINT
956#define OFF_T CURLOPTTYPE_OFF_T
957#define CINIT(name,type,number) CURLOPT_/**/name = type + number
958#endif
959
960/* handy aliases that make no run-time difference */
961#define CURLOPTTYPE_STRINGPOINT CURLOPTTYPE_OBJECTPOINT
962#define CURLOPTTYPE_SLISTPOINT CURLOPTTYPE_OBJECTPOINT
963
964/*
965 * This macro-mania below setups the CURLOPT_[what] enum, to be used with
966 * curl_easy_setopt(). The first argument in the CINIT() macro is the [what]
967 * word.
968 */
969
970typedef enum {
971 /* This is the FILE * or void * the regular output should be written to. */
972 CINIT(WRITEDATA, OBJECTPOINT, 1),
973
974 /* The full URL to get/put */
975 CINIT(URL, STRINGPOINT, 2),
976
977 /* Port number to connect to, if other than default. */
978 CINIT(PORT, LONG, 3),
979
980 /* Name of proxy to use. */
981 CINIT(PROXY, STRINGPOINT, 4),
982
983 /* "user:password;options" to use when fetching. */
984 CINIT(USERPWD, STRINGPOINT, 5),
985
986 /* "user:password" to use with proxy. */
987 CINIT(PROXYUSERPWD, STRINGPOINT, 6),
988
989 /* Range to get, specified as an ASCII string. */
990 CINIT(RANGE, STRINGPOINT, 7),
991
992 /* not used */
993
994 /* Specified file stream to upload from (use as input): */
995 CINIT(READDATA, OBJECTPOINT, 9),
996
997 /* Buffer to receive error messages in, must be at least CURL_ERROR_SIZE
998 * bytes big. */
999 CINIT(ERRORBUFFER, OBJECTPOINT, 10),
1000
1001 /* Function that will be called to store the output (instead of fwrite). The
1002 * parameters will use fwrite() syntax, make sure to follow them. */
1003 CINIT(WRITEFUNCTION, FUNCTIONPOINT, 11),
1004
1005 /* Function that will be called to read the input (instead of fread). The
1006 * parameters will use fread() syntax, make sure to follow them. */
1007 CINIT(READFUNCTION, FUNCTIONPOINT, 12),
1008
1009 /* Time-out the read operation after this amount of seconds */
1010 CINIT(TIMEOUT, LONG, 13),
1011
1012 /* If the CURLOPT_INFILE is used, this can be used to inform libcurl about
1013 * how large the file being sent really is. That allows better error
1014 * checking and better verifies that the upload was successful. -1 means
1015 * unknown size.
1016 *
1017 * For large file support, there is also a _LARGE version of the key
1018 * which takes an off_t type, allowing platforms with larger off_t
1019 * sizes to handle larger files. See below for INFILESIZE_LARGE.
1020 */
1021 CINIT(INFILESIZE, LONG, 14),
1022
1023 /* POST static input fields. */
1024 CINIT(POSTFIELDS, OBJECTPOINT, 15),
1025
1026 /* Set the referrer page (needed by some CGIs) */
1027 CINIT(REFERER, STRINGPOINT, 16),
1028
1029 /* Set the FTP PORT string (interface name, named or numerical IP address)
1030 Use i.e '-' to use default address. */
1031 CINIT(FTPPORT, STRINGPOINT, 17),
1032
1033 /* Set the User-Agent string (examined by some CGIs) */
1034 CINIT(USERAGENT, STRINGPOINT, 18),
1035
1036 /* If the download receives less than "low speed limit" bytes/second
1037 * during "low speed time" seconds, the operations is aborted.
1038 * You could i.e if you have a pretty high speed connection, abort if
1039 * it is less than 2000 bytes/sec during 20 seconds.
1040 */
1041
1042 /* Set the "low speed limit" */
1043 CINIT(LOW_SPEED_LIMIT, LONG, 19),
1044
1045 /* Set the "low speed time" */
1046 CINIT(LOW_SPEED_TIME, LONG, 20),
1047
1048 /* Set the continuation offset.
1049 *
1050 * Note there is also a _LARGE version of this key which uses
1051 * off_t types, allowing for large file offsets on platforms which
1052 * use larger-than-32-bit off_t's. Look below for RESUME_FROM_LARGE.
1053 */
1054 CINIT(RESUME_FROM, LONG, 21),
1055
1056 /* Set cookie in request: */
1057 CINIT(COOKIE, STRINGPOINT, 22),
1058
1059 /* This points to a linked list of headers, struct curl_slist kind. This
1060 list is also used for RTSP (in spite of its name) */
1061 CINIT(HTTPHEADER, SLISTPOINT, 23),
1062
1063 /* This points to a linked list of post entries, struct curl_httppost */
1064 CINIT(HTTPPOST, OBJECTPOINT, 24),
1065
1066 /* name of the file keeping your private SSL-certificate */
1067 CINIT(SSLCERT, STRINGPOINT, 25),
1068
1069 /* password for the SSL or SSH private key */
1070 CINIT(KEYPASSWD, STRINGPOINT, 26),
1071
1072 /* send TYPE parameter? */
1073 CINIT(CRLF, LONG, 27),
1074
1075 /* send linked-list of QUOTE commands */
1076 CINIT(QUOTE, SLISTPOINT, 28),
1077
1078 /* send FILE * or void * to store headers to, if you use a callback it
1079 is simply passed to the callback unmodified */
1080 CINIT(HEADERDATA, OBJECTPOINT, 29),
1081
1082 /* point to a file to read the initial cookies from, also enables
1083 "cookie awareness" */
1084 CINIT(COOKIEFILE, STRINGPOINT, 31),
1085
1086 /* What version to specifically try to use.
1087 See CURL_SSLVERSION defines below. */
1088 CINIT(SSLVERSION, LONG, 32),
1089
1090 /* What kind of HTTP time condition to use, see defines */
1091 CINIT(TIMECONDITION, LONG, 33),
1092
1093 /* Time to use with the above condition. Specified in number of seconds
1094 since 1 Jan 1970 */
1095 CINIT(TIMEVALUE, LONG, 34),
1096
1097 /* 35 = OBSOLETE */
1098
1099 /* Custom request, for customizing the get command like
1100 HTTP: DELETE, TRACE and others
1101 FTP: to use a different list command
1102 */
1103 CINIT(CUSTOMREQUEST, STRINGPOINT, 36),
1104
1105 /* FILE handle to use instead of stderr */
1106 CINIT(STDERR, OBJECTPOINT, 37),
1107
1108 /* 38 is not used */
1109
1110 /* send linked-list of post-transfer QUOTE commands */
1111 CINIT(POSTQUOTE, SLISTPOINT, 39),
1112
1113 CINIT(OBSOLETE40, OBJECTPOINT, 40), /* OBSOLETE, do not use! */
1114
1115 CINIT(VERBOSE, LONG, 41), /* talk a lot */
1116 CINIT(HEADER, LONG, 42), /* throw the header out too */
1117 CINIT(NOPROGRESS, LONG, 43), /* shut off the progress meter */
1118 CINIT(NOBODY, LONG, 44), /* use HEAD to get http document */
1119 CINIT(FAILONERROR, LONG, 45), /* no output on http error codes >= 400 */
1120 CINIT(UPLOAD, LONG, 46), /* this is an upload */
1121 CINIT(POST, LONG, 47), /* HTTP POST method */
1122 CINIT(DIRLISTONLY, LONG, 48), /* bare names when listing directories */
1123
1124 CINIT(APPEND, LONG, 50), /* Append instead of overwrite on upload! */
1125
1126 /* Specify whether to read the user+password from the .netrc or the URL.
1127 * This must be one of the CURL_NETRC_* enums below. */
1128 CINIT(NETRC, LONG, 51),
1129
1130 CINIT(FOLLOWLOCATION, LONG, 52), /* use Location: Luke! */
1131
1132 CINIT(TRANSFERTEXT, LONG, 53), /* transfer data in text/ASCII format */
1133 CINIT(PUT, LONG, 54), /* HTTP PUT */
1134
1135 /* 55 = OBSOLETE */
1136
1137 /* DEPRECATED
1138 * Function that will be called instead of the internal progress display
1139 * function. This function should be defined as the curl_progress_callback
1140 * prototype defines. */
1141 CINIT(PROGRESSFUNCTION, FUNCTIONPOINT, 56),
1142
1143 /* Data passed to the CURLOPT_PROGRESSFUNCTION and CURLOPT_XFERINFOFUNCTION
1144 callbacks */
1145 CINIT(PROGRESSDATA, OBJECTPOINT, 57),
1146#define CURLOPT_XFERINFODATA CURLOPT_PROGRESSDATA
1147
1148 /* We want the referrer field set automatically when following locations */
1149 CINIT(AUTOREFERER, LONG, 58),
1150
1151 /* Port of the proxy, can be set in the proxy string as well with:
1152 "[host]:[port]" */
1153 CINIT(PROXYPORT, LONG, 59),
1154
1155 /* size of the POST input data, if strlen() is not good to use */
1156 CINIT(POSTFIELDSIZE, LONG, 60),
1157
1158 /* tunnel non-http operations through a HTTP proxy */
1159 CINIT(HTTPPROXYTUNNEL, LONG, 61),
1160
1161 /* Set the interface string to use as outgoing network interface */
1162 CINIT(INTERFACE, STRINGPOINT, 62),
1163
1164 /* Set the krb4/5 security level, this also enables krb4/5 awareness. This
1165 * is a string, 'clear', 'safe', 'confidential' or 'private'. If the string
1166 * is set but doesn't match one of these, 'private' will be used. */
1167 CINIT(KRBLEVEL, STRINGPOINT, 63),
1168
1169 /* Set if we should verify the peer in ssl handshake, set 1 to verify. */
1170 CINIT(SSL_VERIFYPEER, LONG, 64),
1171
1172 /* The CApath or CAfile used to validate the peer certificate
1173 this option is used only if SSL_VERIFYPEER is true */
1174 CINIT(CAINFO, STRINGPOINT, 65),
1175
1176 /* 66 = OBSOLETE */
1177 /* 67 = OBSOLETE */
1178
1179 /* Maximum number of http redirects to follow */
1180 CINIT(MAXREDIRS, LONG, 68),
1181
1182 /* Pass a long set to 1 to get the date of the requested document (if
1183 possible)! Pass a zero to shut it off. */
1184 CINIT(FILETIME, LONG, 69),
1185
1186 /* This points to a linked list of telnet options */
1187 CINIT(TELNETOPTIONS, SLISTPOINT, 70),
1188
1189 /* Max amount of cached alive connections */
1190 CINIT(MAXCONNECTS, LONG, 71),
1191
1192 CINIT(OBSOLETE72, LONG, 72), /* OBSOLETE, do not use! */
1193
1194 /* 73 = OBSOLETE */
1195
1196 /* Set to explicitly use a new connection for the upcoming transfer.
1197 Do not use this unless you're absolutely sure of this, as it makes the
1198 operation slower and is less friendly for the network. */
1199 CINIT(FRESH_CONNECT, LONG, 74),
1200
1201 /* Set to explicitly forbid the upcoming transfer's connection to be re-used
1202 when done. Do not use this unless you're absolutely sure of this, as it
1203 makes the operation slower and is less friendly for the network. */
1204 CINIT(FORBID_REUSE, LONG, 75),
1205
1206 /* Set to a file name that contains random data for libcurl to use to
1207 seed the random engine when doing SSL connects. */
1208 CINIT(RANDOM_FILE, STRINGPOINT, 76),
1209
1210 /* Set to the Entropy Gathering Daemon socket pathname */
1211 CINIT(EGDSOCKET, STRINGPOINT, 77),
1212
1213 /* Time-out connect operations after this amount of seconds, if connects are
1214 OK within this time, then fine... This only aborts the connect phase. */
1215 CINIT(CONNECTTIMEOUT, LONG, 78),
1216
1217 /* Function that will be called to store headers (instead of fwrite). The
1218 * parameters will use fwrite() syntax, make sure to follow them. */
1219 CINIT(HEADERFUNCTION, FUNCTIONPOINT, 79),
1220
1221 /* Set this to force the HTTP request to get back to GET. Only really usable
1222 if POST, PUT or a custom request have been used first.
1223 */
1224 CINIT(HTTPGET, LONG, 80),
1225
1226 /* Set if we should verify the Common name from the peer certificate in ssl
1227 * handshake, set 1 to check existence, 2 to ensure that it matches the
1228 * provided hostname. */
1229 CINIT(SSL_VERIFYHOST, LONG, 81),
1230
1231 /* Specify which file name to write all known cookies in after completed
1232 operation. Set file name to "-" (dash) to make it go to stdout. */
1233 CINIT(COOKIEJAR, STRINGPOINT, 82),
1234
1235 /* Specify which SSL ciphers to use */
1236 CINIT(SSL_CIPHER_LIST, STRINGPOINT, 83),
1237
1238 /* Specify which HTTP version to use! This must be set to one of the
1239 CURL_HTTP_VERSION* enums set below. */
1240 CINIT(HTTP_VERSION, LONG, 84),
1241
1242 /* Specifically switch on or off the FTP engine's use of the EPSV command. By
1243 default, that one will always be attempted before the more traditional
1244 PASV command. */
1245 CINIT(FTP_USE_EPSV, LONG, 85),
1246
1247 /* type of the file keeping your SSL-certificate ("DER", "PEM", "ENG") */
1248 CINIT(SSLCERTTYPE, STRINGPOINT, 86),
1249
1250 /* name of the file keeping your private SSL-key */
1251 CINIT(SSLKEY, STRINGPOINT, 87),
1252
1253 /* type of the file keeping your private SSL-key ("DER", "PEM", "ENG") */
1254 CINIT(SSLKEYTYPE, STRINGPOINT, 88),
1255
1256 /* crypto engine for the SSL-sub system */
1257 CINIT(SSLENGINE, STRINGPOINT, 89),
1258
1259 /* set the crypto engine for the SSL-sub system as default
1260 the param has no meaning...
1261 */
1262 CINIT(SSLENGINE_DEFAULT, LONG, 90),
1263
1264 /* Non-zero value means to use the global dns cache */
1265 CINIT(DNS_USE_GLOBAL_CACHE, LONG, 91), /* DEPRECATED, do not use! */
1266
1267 /* DNS cache timeout */
1268 CINIT(DNS_CACHE_TIMEOUT, LONG, 92),
1269
1270 /* send linked-list of pre-transfer QUOTE commands */
1271 CINIT(PREQUOTE, SLISTPOINT, 93),
1272
1273 /* set the debug function */
1274 CINIT(DEBUGFUNCTION, FUNCTIONPOINT, 94),
1275
1276 /* set the data for the debug function */
1277 CINIT(DEBUGDATA, OBJECTPOINT, 95),
1278
1279 /* mark this as start of a cookie session */
1280 CINIT(COOKIESESSION, LONG, 96),
1281
1282 /* The CApath directory used to validate the peer certificate
1283 this option is used only if SSL_VERIFYPEER is true */
1284 CINIT(CAPATH, STRINGPOINT, 97),
1285
1286 /* Instruct libcurl to use a smaller receive buffer */
1287 CINIT(BUFFERSIZE, LONG, 98),
1288
1289 /* Instruct libcurl to not use any signal/alarm handlers, even when using
1290 timeouts. This option is useful for multi-threaded applications.
1291 See libcurl-the-guide for more background information. */
1292 CINIT(NOSIGNAL, LONG, 99),
1293
1294 /* Provide a CURLShare for mutexing non-ts data */
1295 CINIT(SHARE, OBJECTPOINT, 100),
1296
1297 /* indicates type of proxy. accepted values are CURLPROXY_HTTP (default),
1298 CURLPROXY_HTTPS, CURLPROXY_SOCKS4, CURLPROXY_SOCKS4A and
1299 CURLPROXY_SOCKS5. */
1300 CINIT(PROXYTYPE, LONG, 101),
1301
1302 /* Set the Accept-Encoding string. Use this to tell a server you would like
1303 the response to be compressed. Before 7.21.6, this was known as
1304 CURLOPT_ENCODING */
1305 CINIT(ACCEPT_ENCODING, STRINGPOINT, 102),
1306
1307 /* Set pointer to private data */
1308 CINIT(PRIVATE, OBJECTPOINT, 103),
1309
1310 /* Set aliases for HTTP 200 in the HTTP Response header */
1311 CINIT(HTTP200ALIASES, SLISTPOINT, 104),
1312
1313 /* Continue to send authentication (user+password) when following locations,
1314 even when hostname changed. This can potentially send off the name
1315 and password to whatever host the server decides. */
1316 CINIT(UNRESTRICTED_AUTH, LONG, 105),
1317
1318 /* Specifically switch on or off the FTP engine's use of the EPRT command (
1319 it also disables the LPRT attempt). By default, those ones will always be
1320 attempted before the good old traditional PORT command. */
1321 CINIT(FTP_USE_EPRT, LONG, 106),
1322
1323 /* Set this to a bitmask value to enable the particular authentications
1324 methods you like. Use this in combination with CURLOPT_USERPWD.
1325 Note that setting multiple bits may cause extra network round-trips. */
1326 CINIT(HTTPAUTH, LONG, 107),
1327
1328 /* Set the ssl context callback function, currently only for OpenSSL or
1329 WolfSSL ssl_ctx, or mbedTLS mbedtls_ssl_config in the second argument.
1330 The function must match the curl_ssl_ctx_callback prototype. */
1331 CINIT(SSL_CTX_FUNCTION, FUNCTIONPOINT, 108),
1332
1333 /* Set the userdata for the ssl context callback function's third
1334 argument */
1335 CINIT(SSL_CTX_DATA, OBJECTPOINT, 109),
1336
1337 /* FTP Option that causes missing dirs to be created on the remote server.
1338 In 7.19.4 we introduced the convenience enums for this option using the
1339 CURLFTP_CREATE_DIR prefix.
1340 */
1341 CINIT(FTP_CREATE_MISSING_DIRS, LONG, 110),
1342
1343 /* Set this to a bitmask value to enable the particular authentications
1344 methods you like. Use this in combination with CURLOPT_PROXYUSERPWD.
1345 Note that setting multiple bits may cause extra network round-trips. */
1346 CINIT(PROXYAUTH, LONG, 111),
1347
1348 /* FTP option that changes the timeout, in seconds, associated with
1349 getting a response. This is different from transfer timeout time and
1350 essentially places a demand on the FTP server to acknowledge commands
1351 in a timely manner. */
1352 CINIT(FTP_RESPONSE_TIMEOUT, LONG, 112),
1353#define CURLOPT_SERVER_RESPONSE_TIMEOUT CURLOPT_FTP_RESPONSE_TIMEOUT
1354
1355 /* Set this option to one of the CURL_IPRESOLVE_* defines (see below) to
1356 tell libcurl to resolve names to those IP versions only. This only has
1357 affect on systems with support for more than one, i.e IPv4 _and_ IPv6. */
1358 CINIT(IPRESOLVE, LONG, 113),
1359
1360 /* Set this option to limit the size of a file that will be downloaded from
1361 an HTTP or FTP server.
1362
1363 Note there is also _LARGE version which adds large file support for
1364 platforms which have larger off_t sizes. See MAXFILESIZE_LARGE below. */
1365 CINIT(MAXFILESIZE, LONG, 114),
1366
1367 /* See the comment for INFILESIZE above, but in short, specifies
1368 * the size of the file being uploaded. -1 means unknown.
1369 */
1370 CINIT(INFILESIZE_LARGE, OFF_T, 115),
1371
1372 /* Sets the continuation offset. There is also a LONG version of this;
1373 * look above for RESUME_FROM.
1374 */
1375 CINIT(RESUME_FROM_LARGE, OFF_T, 116),
1376
1377 /* Sets the maximum size of data that will be downloaded from
1378 * an HTTP or FTP server. See MAXFILESIZE above for the LONG version.
1379 */
1380 CINIT(MAXFILESIZE_LARGE, OFF_T, 117),
1381
1382 /* Set this option to the file name of your .netrc file you want libcurl
1383 to parse (using the CURLOPT_NETRC option). If not set, libcurl will do
1384 a poor attempt to find the user's home directory and check for a .netrc
1385 file in there. */
1386 CINIT(NETRC_FILE, STRINGPOINT, 118),
1387
1388 /* Enable SSL/TLS for FTP, pick one of:
1389 CURLUSESSL_TRY - try using SSL, proceed anyway otherwise
1390 CURLUSESSL_CONTROL - SSL for the control connection or fail
1391 CURLUSESSL_ALL - SSL for all communication or fail
1392 */
1393 CINIT(USE_SSL, LONG, 119),
1394
1395 /* The _LARGE version of the standard POSTFIELDSIZE option */
1396 CINIT(POSTFIELDSIZE_LARGE, OFF_T, 120),
1397
1398 /* Enable/disable the TCP Nagle algorithm */
1399 CINIT(TCP_NODELAY, LONG, 121),
1400
1401 /* 122 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
1402 /* 123 OBSOLETE. Gone in 7.16.0 */
1403 /* 124 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
1404 /* 125 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
1405 /* 126 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
1406 /* 127 OBSOLETE. Gone in 7.16.0 */
1407 /* 128 OBSOLETE. Gone in 7.16.0 */
1408
1409 /* When FTP over SSL/TLS is selected (with CURLOPT_USE_SSL), this option
1410 can be used to change libcurl's default action which is to first try
1411 "AUTH SSL" and then "AUTH TLS" in this order, and proceed when a OK
1412 response has been received.
1413
1414 Available parameters are:
1415 CURLFTPAUTH_DEFAULT - let libcurl decide
1416 CURLFTPAUTH_SSL - try "AUTH SSL" first, then TLS
1417 CURLFTPAUTH_TLS - try "AUTH TLS" first, then SSL
1418 */
1419 CINIT(FTPSSLAUTH, LONG, 129),
1420
1421 CINIT(IOCTLFUNCTION, FUNCTIONPOINT, 130),
1422 CINIT(IOCTLDATA, OBJECTPOINT, 131),
1423
1424 /* 132 OBSOLETE. Gone in 7.16.0 */
1425 /* 133 OBSOLETE. Gone in 7.16.0 */
1426
1427 /* zero terminated string for pass on to the FTP server when asked for
1428 "account" info */
1429 CINIT(FTP_ACCOUNT, STRINGPOINT, 134),
1430
1431 /* feed cookie into cookie engine */
1432 CINIT(COOKIELIST, STRINGPOINT, 135),
1433
1434 /* ignore Content-Length */
1435 CINIT(IGNORE_CONTENT_LENGTH, LONG, 136),
1436
1437 /* Set to non-zero to skip the IP address received in a 227 PASV FTP server
1438 response. Typically used for FTP-SSL purposes but is not restricted to
1439 that. libcurl will then instead use the same IP address it used for the
1440 control connection. */
1441 CINIT(FTP_SKIP_PASV_IP, LONG, 137),
1442
1443 /* Select "file method" to use when doing FTP, see the curl_ftpmethod
1444 above. */
1445 CINIT(FTP_FILEMETHOD, LONG, 138),
1446
1447 /* Local port number to bind the socket to */
1448 CINIT(LOCALPORT, LONG, 139),
1449
1450 /* Number of ports to try, including the first one set with LOCALPORT.
1451 Thus, setting it to 1 will make no additional attempts but the first.
1452 */
1453 CINIT(LOCALPORTRANGE, LONG, 140),
1454
1455 /* no transfer, set up connection and let application use the socket by
1456 extracting it with CURLINFO_LASTSOCKET */
1457 CINIT(CONNECT_ONLY, LONG, 141),
1458
1459 /* Function that will be called to convert from the
1460 network encoding (instead of using the iconv calls in libcurl) */
1461 CINIT(CONV_FROM_NETWORK_FUNCTION, FUNCTIONPOINT, 142),
1462
1463 /* Function that will be called to convert to the
1464 network encoding (instead of using the iconv calls in libcurl) */
1465 CINIT(CONV_TO_NETWORK_FUNCTION, FUNCTIONPOINT, 143),
1466
1467 /* Function that will be called to convert from UTF8
1468 (instead of using the iconv calls in libcurl)
1469 Note that this is used only for SSL certificate processing */
1470 CINIT(CONV_FROM_UTF8_FUNCTION, FUNCTIONPOINT, 144),
1471
1472 /* if the connection proceeds too quickly then need to slow it down */
1473 /* limit-rate: maximum number of bytes per second to send or receive */
1474 CINIT(MAX_SEND_SPEED_LARGE, OFF_T, 145),
1475 CINIT(MAX_RECV_SPEED_LARGE, OFF_T, 146),
1476
1477 /* Pointer to command string to send if USER/PASS fails. */
1478 CINIT(FTP_ALTERNATIVE_TO_USER, STRINGPOINT, 147),
1479
1480 /* callback function for setting socket options */
1481 CINIT(SOCKOPTFUNCTION, FUNCTIONPOINT, 148),
1482 CINIT(SOCKOPTDATA, OBJECTPOINT, 149),
1483
1484 /* set to 0 to disable session ID re-use for this transfer, default is
1485 enabled (== 1) */
1486 CINIT(SSL_SESSIONID_CACHE, LONG, 150),
1487
1488 /* allowed SSH authentication methods */
1489 CINIT(SSH_AUTH_TYPES, LONG, 151),
1490
1491 /* Used by scp/sftp to do public/private key authentication */
1492 CINIT(SSH_PUBLIC_KEYFILE, STRINGPOINT, 152),
1493 CINIT(SSH_PRIVATE_KEYFILE, STRINGPOINT, 153),
1494
1495 /* Send CCC (Clear Command Channel) after authentication */
1496 CINIT(FTP_SSL_CCC, LONG, 154),
1497
1498 /* Same as TIMEOUT and CONNECTTIMEOUT, but with ms resolution */
1499 CINIT(TIMEOUT_MS, LONG, 155),
1500 CINIT(CONNECTTIMEOUT_MS, LONG, 156),
1501
1502 /* set to zero to disable the libcurl's decoding and thus pass the raw body
1503 data to the application even when it is encoded/compressed */
1504 CINIT(HTTP_TRANSFER_DECODING, LONG, 157),
1505 CINIT(HTTP_CONTENT_DECODING, LONG, 158),
1506
1507 /* Permission used when creating new files and directories on the remote
1508 server for protocols that support it, SFTP/SCP/FILE */
1509 CINIT(NEW_FILE_PERMS, LONG, 159),
1510 CINIT(NEW_DIRECTORY_PERMS, LONG, 160),
1511
1512 /* Set the behaviour of POST when redirecting. Values must be set to one
1513 of CURL_REDIR* defines below. This used to be called CURLOPT_POST301 */
1514 CINIT(POSTREDIR, LONG, 161),
1515
1516 /* used by scp/sftp to verify the host's public key */
1517 CINIT(SSH_HOST_PUBLIC_KEY_MD5, STRINGPOINT, 162),
1518
1519 /* Callback function for opening socket (instead of socket(2)). Optionally,
1520 callback is able change the address or refuse to connect returning
1521 CURL_SOCKET_BAD. The callback should have type
1522 curl_opensocket_callback */
1523 CINIT(OPENSOCKETFUNCTION, FUNCTIONPOINT, 163),
1524 CINIT(OPENSOCKETDATA, OBJECTPOINT, 164),
1525
1526 /* POST volatile input fields. */
1527 CINIT(COPYPOSTFIELDS, OBJECTPOINT, 165),
1528
1529 /* set transfer mode (;type=<a|i>) when doing FTP via an HTTP proxy */
1530 CINIT(PROXY_TRANSFER_MODE, LONG, 166),
1531
1532 /* Callback function for seeking in the input stream */
1533 CINIT(SEEKFUNCTION, FUNCTIONPOINT, 167),
1534 CINIT(SEEKDATA, OBJECTPOINT, 168),
1535
1536 /* CRL file */
1537 CINIT(CRLFILE, STRINGPOINT, 169),
1538
1539 /* Issuer certificate */
1540 CINIT(ISSUERCERT, STRINGPOINT, 170),
1541
1542 /* (IPv6) Address scope */
1543 CINIT(ADDRESS_SCOPE, LONG, 171),
1544
1545 /* Collect certificate chain info and allow it to get retrievable with
1546 CURLINFO_CERTINFO after the transfer is complete. */
1547 CINIT(CERTINFO, LONG, 172),
1548
1549 /* "name" and "pwd" to use when fetching. */
1550 CINIT(USERNAME, STRINGPOINT, 173),
1551 CINIT(PASSWORD, STRINGPOINT, 174),
1552
1553 /* "name" and "pwd" to use with Proxy when fetching. */
1554 CINIT(PROXYUSERNAME, STRINGPOINT, 175),
1555 CINIT(PROXYPASSWORD, STRINGPOINT, 176),
1556
1557 /* Comma separated list of hostnames defining no-proxy zones. These should
1558 match both hostnames directly, and hostnames within a domain. For
1559 example, local.com will match local.com and www.local.com, but NOT
1560 notlocal.com or www.notlocal.com. For compatibility with other
1561 implementations of this, .local.com will be considered to be the same as
1562 local.com. A single * is the only valid wildcard, and effectively
1563 disables the use of proxy. */
1564 CINIT(NOPROXY, STRINGPOINT, 177),
1565
1566 /* block size for TFTP transfers */
1567 CINIT(TFTP_BLKSIZE, LONG, 178),
1568
1569 /* Socks Service */
1570 CINIT(SOCKS5_GSSAPI_SERVICE, STRINGPOINT, 179), /* DEPRECATED, do not use! */
1571
1572 /* Socks Service */
1573 CINIT(SOCKS5_GSSAPI_NEC, LONG, 180),
1574
1575 /* set the bitmask for the protocols that are allowed to be used for the
1576 transfer, which thus helps the app which takes URLs from users or other
1577 external inputs and want to restrict what protocol(s) to deal
1578 with. Defaults to CURLPROTO_ALL. */
1579 CINIT(PROTOCOLS, LONG, 181),
1580
1581 /* set the bitmask for the protocols that libcurl is allowed to follow to,
1582 as a subset of the CURLOPT_PROTOCOLS ones. That means the protocol needs
1583 to be set in both bitmasks to be allowed to get redirected to. */
1584 CINIT(REDIR_PROTOCOLS, LONG, 182),
1585
1586 /* set the SSH knownhost file name to use */
1587 CINIT(SSH_KNOWNHOSTS, STRINGPOINT, 183),
1588
1589 /* set the SSH host key callback, must point to a curl_sshkeycallback
1590 function */
1591 CINIT(SSH_KEYFUNCTION, FUNCTIONPOINT, 184),
1592
1593 /* set the SSH host key callback custom pointer */
1594 CINIT(SSH_KEYDATA, OBJECTPOINT, 185),
1595
1596 /* set the SMTP mail originator */
1597 CINIT(MAIL_FROM, STRINGPOINT, 186),
1598
1599 /* set the list of SMTP mail receiver(s) */
1600 CINIT(MAIL_RCPT, SLISTPOINT, 187),
1601
1602 /* FTP: send PRET before PASV */
1603 CINIT(FTP_USE_PRET, LONG, 188),
1604
1605 /* RTSP request method (OPTIONS, SETUP, PLAY, etc...) */
1606 CINIT(RTSP_REQUEST, LONG, 189),
1607
1608 /* The RTSP session identifier */
1609 CINIT(RTSP_SESSION_ID, STRINGPOINT, 190),
1610
1611 /* The RTSP stream URI */
1612 CINIT(RTSP_STREAM_URI, STRINGPOINT, 191),
1613
1614 /* The Transport: header to use in RTSP requests */
1615 CINIT(RTSP_TRANSPORT, STRINGPOINT, 192),
1616
1617 /* Manually initialize the client RTSP CSeq for this handle */
1618 CINIT(RTSP_CLIENT_CSEQ, LONG, 193),
1619
1620 /* Manually initialize the server RTSP CSeq for this handle */
1621 CINIT(RTSP_SERVER_CSEQ, LONG, 194),
1622
1623 /* The stream to pass to INTERLEAVEFUNCTION. */
1624 CINIT(INTERLEAVEDATA, OBJECTPOINT, 195),
1625
1626 /* Let the application define a custom write method for RTP data */
1627 CINIT(INTERLEAVEFUNCTION, FUNCTIONPOINT, 196),
1628
1629 /* Turn on wildcard matching */
1630 CINIT(WILDCARDMATCH, LONG, 197),
1631
1632 /* Directory matching callback called before downloading of an
1633 individual file (chunk) started */
1634 CINIT(CHUNK_BGN_FUNCTION, FUNCTIONPOINT, 198),
1635
1636 /* Directory matching callback called after the file (chunk)
1637 was downloaded, or skipped */
1638 CINIT(CHUNK_END_FUNCTION, FUNCTIONPOINT, 199),
1639
1640 /* Change match (fnmatch-like) callback for wildcard matching */
1641 CINIT(FNMATCH_FUNCTION, FUNCTIONPOINT, 200),
1642
1643 /* Let the application define custom chunk data pointer */
1644 CINIT(CHUNK_DATA, OBJECTPOINT, 201),
1645
1646 /* FNMATCH_FUNCTION user pointer */
1647 CINIT(FNMATCH_DATA, OBJECTPOINT, 202),
1648
1649 /* send linked-list of name:port:address sets */
1650 CINIT(RESOLVE, SLISTPOINT, 203),
1651
1652 /* Set a username for authenticated TLS */
1653 CINIT(TLSAUTH_USERNAME, STRINGPOINT, 204),
1654
1655 /* Set a password for authenticated TLS */
1656 CINIT(TLSAUTH_PASSWORD, STRINGPOINT, 205),
1657
1658 /* Set authentication type for authenticated TLS */
1659 CINIT(TLSAUTH_TYPE, STRINGPOINT, 206),
1660
1661 /* Set to 1 to enable the "TE:" header in HTTP requests to ask for
1662 compressed transfer-encoded responses. Set to 0 to disable the use of TE:
1663 in outgoing requests. The current default is 0, but it might change in a
1664 future libcurl release.
1665
1666 libcurl will ask for the compressed methods it knows of, and if that
1667 isn't any, it will not ask for transfer-encoding at all even if this
1668 option is set to 1.
1669
1670 */
1671 CINIT(TRANSFER_ENCODING, LONG, 207),
1672
1673 /* Callback function for closing socket (instead of close(2)). The callback
1674 should have type curl_closesocket_callback */
1675 CINIT(CLOSESOCKETFUNCTION, FUNCTIONPOINT, 208),
1676 CINIT(CLOSESOCKETDATA, OBJECTPOINT, 209),
1677
1678 /* allow GSSAPI credential delegation */
1679 CINIT(GSSAPI_DELEGATION, LONG, 210),
1680
1681 /* Set the name servers to use for DNS resolution */
1682 CINIT(DNS_SERVERS, STRINGPOINT, 211),
1683
1684 /* Time-out accept operations (currently for FTP only) after this amount
1685 of milliseconds. */
1686 CINIT(ACCEPTTIMEOUT_MS, LONG, 212),
1687
1688 /* Set TCP keepalive */
1689 CINIT(TCP_KEEPALIVE, LONG, 213),
1690
1691 /* non-universal keepalive knobs (Linux, AIX, HP-UX, more) */
1692 CINIT(TCP_KEEPIDLE, LONG, 214),
1693 CINIT(TCP_KEEPINTVL, LONG, 215),
1694
1695 /* Enable/disable specific SSL features with a bitmask, see CURLSSLOPT_* */
1696 CINIT(SSL_OPTIONS, LONG, 216),
1697
1698 /* Set the SMTP auth originator */
1699 CINIT(MAIL_AUTH, STRINGPOINT, 217),
1700
1701 /* Enable/disable SASL initial response */
1702 CINIT(SASL_IR, LONG, 218),
1703
1704 /* Function that will be called instead of the internal progress display
1705 * function. This function should be defined as the curl_xferinfo_callback
1706 * prototype defines. (Deprecates CURLOPT_PROGRESSFUNCTION) */
1707 CINIT(XFERINFOFUNCTION, FUNCTIONPOINT, 219),
1708
1709 /* The XOAUTH2 bearer token */
1710 CINIT(XOAUTH2_BEARER, STRINGPOINT, 220),
1711
1712 /* Set the interface string to use as outgoing network
1713 * interface for DNS requests.
1714 * Only supported by the c-ares DNS backend */
1715 CINIT(DNS_INTERFACE, STRINGPOINT, 221),
1716
1717 /* Set the local IPv4 address to use for outgoing DNS requests.
1718 * Only supported by the c-ares DNS backend */
1719 CINIT(DNS_LOCAL_IP4, STRINGPOINT, 222),
1720
1721 /* Set the local IPv6 address to use for outgoing DNS requests.
1722 * Only supported by the c-ares DNS backend */
1723 CINIT(DNS_LOCAL_IP6, STRINGPOINT, 223),
1724
1725 /* Set authentication options directly */
1726 CINIT(LOGIN_OPTIONS, STRINGPOINT, 224),
1727
1728 /* Enable/disable TLS NPN extension (http2 over ssl might fail without) */
1729 CINIT(SSL_ENABLE_NPN, LONG, 225),
1730
1731 /* Enable/disable TLS ALPN extension (http2 over ssl might fail without) */
1732 CINIT(SSL_ENABLE_ALPN, LONG, 226),
1733
1734 /* Time to wait for a response to a HTTP request containing an
1735 * Expect: 100-continue header before sending the data anyway. */
1736 CINIT(EXPECT_100_TIMEOUT_MS, LONG, 227),
1737
1738 /* This points to a linked list of headers used for proxy requests only,
1739 struct curl_slist kind */
1740 CINIT(PROXYHEADER, SLISTPOINT, 228),
1741
1742 /* Pass in a bitmask of "header options" */
1743 CINIT(HEADEROPT, LONG, 229),
1744
1745 /* The public key in DER form used to validate the peer public key
1746 this option is used only if SSL_VERIFYPEER is true */
1747 CINIT(PINNEDPUBLICKEY, STRINGPOINT, 230),
1748
1749 /* Path to Unix domain socket */
1750 CINIT(UNIX_SOCKET_PATH, STRINGPOINT, 231),
1751
1752 /* Set if we should verify the certificate status. */
1753 CINIT(SSL_VERIFYSTATUS, LONG, 232),
1754
1755 /* Set if we should enable TLS false start. */
1756 CINIT(SSL_FALSESTART, LONG, 233),
1757
1758 /* Do not squash dot-dot sequences */
1759 CINIT(PATH_AS_IS, LONG, 234),
1760
1761 /* Proxy Service Name */
1762 CINIT(PROXY_SERVICE_NAME, STRINGPOINT, 235),
1763
1764 /* Service Name */
1765 CINIT(SERVICE_NAME, STRINGPOINT, 236),
1766
1767 /* Wait/don't wait for pipe/mutex to clarify */
1768 CINIT(PIPEWAIT, LONG, 237),
1769
1770 /* Set the protocol used when curl is given a URL without a protocol */
1771 CINIT(DEFAULT_PROTOCOL, STRINGPOINT, 238),
1772
1773 /* Set stream weight, 1 - 256 (default is 16) */
1774 CINIT(STREAM_WEIGHT, LONG, 239),
1775
1776 /* Set stream dependency on another CURL handle */
1777 CINIT(STREAM_DEPENDS, OBJECTPOINT, 240),
1778
1779 /* Set E-xclusive stream dependency on another CURL handle */
1780 CINIT(STREAM_DEPENDS_E, OBJECTPOINT, 241),
1781
1782 /* Do not send any tftp option requests to the server */
1783 CINIT(TFTP_NO_OPTIONS, LONG, 242),
1784
1785 /* Linked-list of host:port:connect-to-host:connect-to-port,
1786 overrides the URL's host:port (only for the network layer) */
1787 CINIT(CONNECT_TO, SLISTPOINT, 243),
1788
1789 /* Set TCP Fast Open */
1790 CINIT(TCP_FASTOPEN, LONG, 244),
1791
1792 /* Continue to send data if the server responds early with an
1793 * HTTP status code >= 300 */
1794 CINIT(KEEP_SENDING_ON_ERROR, LONG, 245),
1795
1796 /* The CApath or CAfile used to validate the proxy certificate
1797 this option is used only if PROXY_SSL_VERIFYPEER is true */
1798 CINIT(PROXY_CAINFO, STRINGPOINT, 246),
1799
1800 /* The CApath directory used to validate the proxy certificate
1801 this option is used only if PROXY_SSL_VERIFYPEER is true */
1802 CINIT(PROXY_CAPATH, STRINGPOINT, 247),
1803
1804 /* Set if we should verify the proxy in ssl handshake,
1805 set 1 to verify. */
1806 CINIT(PROXY_SSL_VERIFYPEER, LONG, 248),
1807
1808 /* Set if we should verify the Common name from the proxy certificate in ssl
1809 * handshake, set 1 to check existence, 2 to ensure that it matches
1810 * the provided hostname. */
1811 CINIT(PROXY_SSL_VERIFYHOST, LONG, 249),
1812
1813 /* What version to specifically try to use for proxy.
1814 See CURL_SSLVERSION defines below. */
1815 CINIT(PROXY_SSLVERSION, LONG, 250),
1816
1817 /* Set a username for authenticated TLS for proxy */
1818 CINIT(PROXY_TLSAUTH_USERNAME, STRINGPOINT, 251),
1819
1820 /* Set a password for authenticated TLS for proxy */
1821 CINIT(PROXY_TLSAUTH_PASSWORD, STRINGPOINT, 252),
1822
1823 /* Set authentication type for authenticated TLS for proxy */
1824 CINIT(PROXY_TLSAUTH_TYPE, STRINGPOINT, 253),
1825
1826 /* name of the file keeping your private SSL-certificate for proxy */
1827 CINIT(PROXY_SSLCERT, STRINGPOINT, 254),
1828
1829 /* type of the file keeping your SSL-certificate ("DER", "PEM", "ENG") for
1830 proxy */
1831 CINIT(PROXY_SSLCERTTYPE, STRINGPOINT, 255),
1832
1833 /* name of the file keeping your private SSL-key for proxy */
1834 CINIT(PROXY_SSLKEY, STRINGPOINT, 256),
1835
1836 /* type of the file keeping your private SSL-key ("DER", "PEM", "ENG") for
1837 proxy */
1838 CINIT(PROXY_SSLKEYTYPE, STRINGPOINT, 257),
1839
1840 /* password for the SSL private key for proxy */
1841 CINIT(PROXY_KEYPASSWD, STRINGPOINT, 258),
1842
1843 /* Specify which SSL ciphers to use for proxy */
1844 CINIT(PROXY_SSL_CIPHER_LIST, STRINGPOINT, 259),
1845
1846 /* CRL file for proxy */
1847 CINIT(PROXY_CRLFILE, STRINGPOINT, 260),
1848
1849 /* Enable/disable specific SSL features with a bitmask for proxy, see
1850 CURLSSLOPT_* */
1851 CINIT(PROXY_SSL_OPTIONS, LONG, 261),
1852
1853 /* Name of pre proxy to use. */
1854 CINIT(PRE_PROXY, STRINGPOINT, 262),
1855
1856 /* The public key in DER form used to validate the proxy public key
1857 this option is used only if PROXY_SSL_VERIFYPEER is true */
1858 CINIT(PROXY_PINNEDPUBLICKEY, STRINGPOINT, 263),
1859
1860 /* Path to an abstract Unix domain socket */
1861 CINIT(ABSTRACT_UNIX_SOCKET, STRINGPOINT, 264),
1862
1863 /* Suppress proxy CONNECT response headers from user callbacks */
1864 CINIT(SUPPRESS_CONNECT_HEADERS, LONG, 265),
1865
1866 /* The request target, instead of extracted from the URL */
1867 CINIT(REQUEST_TARGET, STRINGPOINT, 266),
1868
1869 /* bitmask of allowed auth methods for connections to SOCKS5 proxies */
1870 CINIT(SOCKS5_AUTH, LONG, 267),
1871
1872 /* Enable/disable SSH compression */
1873 CINIT(SSH_COMPRESSION, LONG, 268),
1874
1875 /* Post MIME data. */
1876 CINIT(MIMEPOST, OBJECTPOINT, 269),
1877
1878 /* Time to use with the CURLOPT_TIMECONDITION. Specified in number of
1879 seconds since 1 Jan 1970. */
1880 CINIT(TIMEVALUE_LARGE, OFF_T, 270),
1881
1882 /* Head start in milliseconds to give happy eyeballs. */
1883 CINIT(HAPPY_EYEBALLS_TIMEOUT_MS, LONG, 271),
1884
1885 /* Function that will be called before a resolver request is made */
1886 CINIT(RESOLVER_START_FUNCTION, FUNCTIONPOINT, 272),
1887
1888 /* User data to pass to the resolver start callback. */
1889 CINIT(RESOLVER_START_DATA, OBJECTPOINT, 273),
1890
1891 /* send HAProxy PROXY protocol header? */
1892 CINIT(HAPROXYPROTOCOL, LONG, 274),
1893
1894 /* shuffle addresses before use when DNS returns multiple */
1895 CINIT(DNS_SHUFFLE_ADDRESSES, LONG, 275),
1896
1897 /* Specify which TLS 1.3 ciphers suites to use */
1898 CINIT(TLS13_CIPHERS, STRINGPOINT, 276),
1899 CINIT(PROXY_TLS13_CIPHERS, STRINGPOINT, 277),
1900
1901 /* Disallow specifying username/login in URL. */
1902 CINIT(DISALLOW_USERNAME_IN_URL, LONG, 278),
1903
1904 /* DNS-over-HTTPS URL */
1905 CINIT(DOH_URL, STRINGPOINT, 279),
1906
1907 /* Preferred buffer size to use for uploads */
1908 CINIT(UPLOAD_BUFFERSIZE, LONG, 280),
1909
1910 /* Time in ms between connection upkeep calls for long-lived connections. */
1911 CINIT(UPKEEP_INTERVAL_MS, LONG, 281),
1912
1913 /* Specify URL using CURL URL API. */
1914 CINIT(CURLU, OBJECTPOINT, 282),
1915
1916 /* add trailing data just after no more data is available */
1917 CINIT(TRAILERFUNCTION, FUNCTIONPOINT, 283),
1918
1919 /* pointer to be passed to HTTP_TRAILER_FUNCTION */
1920 CINIT(TRAILERDATA, OBJECTPOINT, 284),
1921
1922 /* set this to 1L to allow HTTP/0.9 responses or 0L to disallow */
1923 CINIT(HTTP09_ALLOWED, LONG, 285),
1924
1925 /* alt-svc control bitmask */
1926 CINIT(ALTSVC_CTRL, LONG, 286),
1927
1928 /* alt-svc cache file name to possibly read from/write to */
1929 CINIT(ALTSVC, STRINGPOINT, 287),
1930
1931 /* maximum age of a connection to consider it for reuse (in seconds) */
1932 CINIT(MAXAGE_CONN, LONG, 288),
1933
1934 /* SASL authorisation identity */
1935 CINIT(SASL_AUTHZID, STRINGPOINT, 289),
1936
1937 CURLOPT_LASTENTRY /* the last unused */
1938} CURLoption;
1939
1940#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all
1941 the obsolete stuff removed! */
1942
1943/* Backwards compatibility with older names */
1944/* These are scheduled to disappear by 2011 */
1945
1946/* This was added in version 7.19.1 */
1947#define CURLOPT_POST301 CURLOPT_POSTREDIR
1948
1949/* These are scheduled to disappear by 2009 */
1950
1951/* The following were added in 7.17.0 */
1952#define CURLOPT_SSLKEYPASSWD CURLOPT_KEYPASSWD
1953#define CURLOPT_FTPAPPEND CURLOPT_APPEND
1954#define CURLOPT_FTPLISTONLY CURLOPT_DIRLISTONLY
1955#define CURLOPT_FTP_SSL CURLOPT_USE_SSL
1956
1957/* The following were added earlier */
1958
1959#define CURLOPT_SSLCERTPASSWD CURLOPT_KEYPASSWD
1960#define CURLOPT_KRB4LEVEL CURLOPT_KRBLEVEL
1961
1962#else
1963/* This is set if CURL_NO_OLDIES is defined at compile-time */
1964#undef CURLOPT_DNS_USE_GLOBAL_CACHE /* soon obsolete */
1965#endif
1966
1967
1968 /* Below here follows defines for the CURLOPT_IPRESOLVE option. If a host
1969 name resolves addresses using more than one IP protocol version, this
1970 option might be handy to force libcurl to use a specific IP version. */
1971#define CURL_IPRESOLVE_WHATEVER 0 /* default, resolves addresses to all IP
1972 versions that your system allows */
1973#define CURL_IPRESOLVE_V4 1 /* resolve to IPv4 addresses */
1974#define CURL_IPRESOLVE_V6 2 /* resolve to IPv6 addresses */
1975
1976 /* three convenient "aliases" that follow the name scheme better */
1977#define CURLOPT_RTSPHEADER CURLOPT_HTTPHEADER
1978
1979 /* These enums are for use with the CURLOPT_HTTP_VERSION option. */
1980enum {
1981 CURL_HTTP_VERSION_NONE, /* setting this means we don't care, and that we'd
1982 like the library to choose the best possible
1983 for us! */
1984 CURL_HTTP_VERSION_1_0, /* please use HTTP 1.0 in the request */
1985 CURL_HTTP_VERSION_1_1, /* please use HTTP 1.1 in the request */
1986 CURL_HTTP_VERSION_2_0, /* please use HTTP 2 in the request */
1987 CURL_HTTP_VERSION_2TLS, /* use version 2 for HTTPS, version 1.1 for HTTP */
1988 CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE, /* please use HTTP 2 without HTTP/1.1
1989 Upgrade */
1990 CURL_HTTP_VERSION_3 = 30, /* Makes use of explicit HTTP/3 without fallback.
1991 Use CURLOPT_ALTSVC to enable HTTP/3 upgrade */
1992 CURL_HTTP_VERSION_LAST /* *ILLEGAL* http version */
1993};
1994
1995/* Convenience definition simple because the name of the version is HTTP/2 and
1996 not 2.0. The 2_0 version of the enum name was set while the version was
1997 still planned to be 2.0 and we stick to it for compatibility. */
1998#define CURL_HTTP_VERSION_2 CURL_HTTP_VERSION_2_0
1999
2000/*
2001 * Public API enums for RTSP requests
2002 */
2003enum {
2004 CURL_RTSPREQ_NONE, /* first in list */
2005 CURL_RTSPREQ_OPTIONS,
2006 CURL_RTSPREQ_DESCRIBE,
2007 CURL_RTSPREQ_ANNOUNCE,
2008 CURL_RTSPREQ_SETUP,
2009 CURL_RTSPREQ_PLAY,
2010 CURL_RTSPREQ_PAUSE,
2011 CURL_RTSPREQ_TEARDOWN,
2012 CURL_RTSPREQ_GET_PARAMETER,
2013 CURL_RTSPREQ_SET_PARAMETER,
2014 CURL_RTSPREQ_RECORD,
2015 CURL_RTSPREQ_RECEIVE,
2016 CURL_RTSPREQ_LAST /* last in list */
2017};
2018
2019 /* These enums are for use with the CURLOPT_NETRC option. */
2020enum CURL_NETRC_OPTION {
2021 CURL_NETRC_IGNORED, /* The .netrc will never be read.
2022 * This is the default. */
2023 CURL_NETRC_OPTIONAL, /* A user:password in the URL will be preferred
2024 * to one in the .netrc. */
2025 CURL_NETRC_REQUIRED, /* A user:password in the URL will be ignored.
2026 * Unless one is set programmatically, the .netrc
2027 * will be queried. */
2028 CURL_NETRC_LAST
2029};
2030
2031enum {
2032 CURL_SSLVERSION_DEFAULT,
2033 CURL_SSLVERSION_TLSv1, /* TLS 1.x */
2034 CURL_SSLVERSION_SSLv2,
2035 CURL_SSLVERSION_SSLv3,
2036 CURL_SSLVERSION_TLSv1_0,
2037 CURL_SSLVERSION_TLSv1_1,
2038 CURL_SSLVERSION_TLSv1_2,
2039 CURL_SSLVERSION_TLSv1_3,
2040
2041 CURL_SSLVERSION_LAST /* never use, keep last */
2042};
2043
2044enum {
2045 CURL_SSLVERSION_MAX_NONE = 0,
2046 CURL_SSLVERSION_MAX_DEFAULT = (CURL_SSLVERSION_TLSv1 << 16),
2047 CURL_SSLVERSION_MAX_TLSv1_0 = (CURL_SSLVERSION_TLSv1_0 << 16),
2048 CURL_SSLVERSION_MAX_TLSv1_1 = (CURL_SSLVERSION_TLSv1_1 << 16),
2049 CURL_SSLVERSION_MAX_TLSv1_2 = (CURL_SSLVERSION_TLSv1_2 << 16),
2050 CURL_SSLVERSION_MAX_TLSv1_3 = (CURL_SSLVERSION_TLSv1_3 << 16),
2051
2052 /* never use, keep last */
2053 CURL_SSLVERSION_MAX_LAST = (CURL_SSLVERSION_LAST << 16)
2054};
2055
2056enum CURL_TLSAUTH {
2057 CURL_TLSAUTH_NONE,
2058 CURL_TLSAUTH_SRP,
2059 CURL_TLSAUTH_LAST /* never use, keep last */
2060};
2061
2062/* symbols to use with CURLOPT_POSTREDIR.
2063 CURL_REDIR_POST_301, CURL_REDIR_POST_302 and CURL_REDIR_POST_303
2064 can be bitwise ORed so that CURL_REDIR_POST_301 | CURL_REDIR_POST_302
2065 | CURL_REDIR_POST_303 == CURL_REDIR_POST_ALL */
2066
2067#define CURL_REDIR_GET_ALL 0
2068#define CURL_REDIR_POST_301 1
2069#define CURL_REDIR_POST_302 2
2070#define CURL_REDIR_POST_303 4
2071#define CURL_REDIR_POST_ALL \
2072 (CURL_REDIR_POST_301|CURL_REDIR_POST_302|CURL_REDIR_POST_303)
2073
2074typedef enum {
2075 CURL_TIMECOND_NONE,
2076
2077 CURL_TIMECOND_IFMODSINCE,
2078 CURL_TIMECOND_IFUNMODSINCE,
2079 CURL_TIMECOND_LASTMOD,
2080
2081 CURL_TIMECOND_LAST
2082} curl_TimeCond;
2083
2084/* Special size_t value signaling a zero-terminated string. */
2085#define CURL_ZERO_TERMINATED ((size_t) -1)
2086
2087/* curl_strequal() and curl_strnequal() are subject for removal in a future
2088 release */
2089CURL_EXTERN int curl_strequal(const char *s1, const char *s2);
2090CURL_EXTERN int curl_strnequal(const char *s1, const char *s2, size_t n);
2091
2092/* Mime/form handling support. */
2093typedef struct curl_mime_s curl_mime; /* Mime context. */
2094typedef struct curl_mimepart_s curl_mimepart; /* Mime part context. */
2095
2096/*
2097 * NAME curl_mime_init()
2098 *
2099 * DESCRIPTION
2100 *
2101 * Create a mime context and return its handle. The easy parameter is the
2102 * target handle.
2103 */
2104CURL_EXTERN curl_mime *curl_mime_init(CURL *easy);
2105
2106/*
2107 * NAME curl_mime_free()
2108 *
2109 * DESCRIPTION
2110 *
2111 * release a mime handle and its substructures.
2112 */
2113CURL_EXTERN void curl_mime_free(curl_mime *mime);
2114
2115/*
2116 * NAME curl_mime_addpart()
2117 *
2118 * DESCRIPTION
2119 *
2120 * Append a new empty part to the given mime context and return a handle to
2121 * the created part.
2122 */
2123CURL_EXTERN curl_mimepart *curl_mime_addpart(curl_mime *mime);
2124
2125/*
2126 * NAME curl_mime_name()
2127 *
2128 * DESCRIPTION
2129 *
2130 * Set mime/form part name.
2131 */
2132CURL_EXTERN CURLcode curl_mime_name(curl_mimepart *part, const char *name);
2133
2134/*
2135 * NAME curl_mime_filename()
2136 *
2137 * DESCRIPTION
2138 *
2139 * Set mime part remote file name.
2140 */
2141CURL_EXTERN CURLcode curl_mime_filename(curl_mimepart *part,
2142 const char *filename);
2143
2144/*
2145 * NAME curl_mime_type()
2146 *
2147 * DESCRIPTION
2148 *
2149 * Set mime part type.
2150 */
2151CURL_EXTERN CURLcode curl_mime_type(curl_mimepart *part, const char *mimetype);
2152
2153/*
2154 * NAME curl_mime_encoder()
2155 *
2156 * DESCRIPTION
2157 *
2158 * Set mime data transfer encoder.
2159 */
2160CURL_EXTERN CURLcode curl_mime_encoder(curl_mimepart *part,
2161 const char *encoding);
2162
2163/*
2164 * NAME curl_mime_data()
2165 *
2166 * DESCRIPTION
2167 *
2168 * Set mime part data source from memory data,
2169 */
2170CURL_EXTERN CURLcode curl_mime_data(curl_mimepart *part,
2171 const char *data, size_t datasize);
2172
2173/*
2174 * NAME curl_mime_filedata()
2175 *
2176 * DESCRIPTION
2177 *
2178 * Set mime part data source from named file.
2179 */
2180CURL_EXTERN CURLcode curl_mime_filedata(curl_mimepart *part,
2181 const char *filename);
2182
2183/*
2184 * NAME curl_mime_data_cb()
2185 *
2186 * DESCRIPTION
2187 *
2188 * Set mime part data source from callback function.
2189 */
2190CURL_EXTERN CURLcode curl_mime_data_cb(curl_mimepart *part,
2191 curl_off_t datasize,
2192 curl_read_callback readfunc,
2193 curl_seek_callback seekfunc,
2194 curl_free_callback freefunc,
2195 void *arg);
2196
2197/*
2198 * NAME curl_mime_subparts()
2199 *
2200 * DESCRIPTION
2201 *
2202 * Set mime part data source from subparts.
2203 */
2204CURL_EXTERN CURLcode curl_mime_subparts(curl_mimepart *part,
2205 curl_mime *subparts);
2206/*
2207 * NAME curl_mime_headers()
2208 *
2209 * DESCRIPTION
2210 *
2211 * Set mime part headers.
2212 */
2213CURL_EXTERN CURLcode curl_mime_headers(curl_mimepart *part,
2214 struct curl_slist *headers,
2215 int take_ownership);
2216
2217/* Old form API. */
2218/* name is uppercase CURLFORM_<name> */
2219#ifdef CFINIT
2220#undef CFINIT
2221#endif
2222
2223#ifdef CURL_ISOCPP
2224#define CFINIT(name) CURLFORM_ ## name
2225#else
2226/* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */
2227#define CFINIT(name) CURLFORM_/**/name
2228#endif
2229
2230typedef enum {
2231 CFINIT(NOTHING), /********* the first one is unused ************/
2232
2233 /* */
2234 CFINIT(COPYNAME),
2235 CFINIT(PTRNAME),
2236 CFINIT(NAMELENGTH),
2237 CFINIT(COPYCONTENTS),
2238 CFINIT(PTRCONTENTS),
2239 CFINIT(CONTENTSLENGTH),
2240 CFINIT(FILECONTENT),
2241 CFINIT(ARRAY),
2242 CFINIT(OBSOLETE),
2243 CFINIT(FILE),
2244
2245 CFINIT(BUFFER),
2246 CFINIT(BUFFERPTR),
2247 CFINIT(BUFFERLENGTH),
2248
2249 CFINIT(CONTENTTYPE),
2250 CFINIT(CONTENTHEADER),
2251 CFINIT(FILENAME),
2252 CFINIT(END),
2253 CFINIT(OBSOLETE2),
2254
2255 CFINIT(STREAM),
2256 CFINIT(CONTENTLEN), /* added in 7.46.0, provide a curl_off_t length */
2257
2258 CURLFORM_LASTENTRY /* the last unused */
2259} CURLformoption;
2260
2261#undef CFINIT /* done */
2262
2263/* structure to be used as parameter for CURLFORM_ARRAY */
2264struct curl_forms {
2265 CURLformoption option;
2266 const char *value;
2267};
2268
2269/* use this for multipart formpost building */
2270/* Returns code for curl_formadd()
2271 *
2272 * Returns:
2273 * CURL_FORMADD_OK on success
2274 * CURL_FORMADD_MEMORY if the FormInfo allocation fails
2275 * CURL_FORMADD_OPTION_TWICE if one option is given twice for one Form
2276 * CURL_FORMADD_NULL if a null pointer was given for a char
2277 * CURL_FORMADD_MEMORY if the allocation of a FormInfo struct failed
2278 * CURL_FORMADD_UNKNOWN_OPTION if an unknown option was used
2279 * CURL_FORMADD_INCOMPLETE if the some FormInfo is not complete (or error)
2280 * CURL_FORMADD_MEMORY if a curl_httppost struct cannot be allocated
2281 * CURL_FORMADD_MEMORY if some allocation for string copying failed.
2282 * CURL_FORMADD_ILLEGAL_ARRAY if an illegal option is used in an array
2283 *
2284 ***************************************************************************/
2285typedef enum {
2286 CURL_FORMADD_OK, /* first, no error */
2287
2288 CURL_FORMADD_MEMORY,
2289 CURL_FORMADD_OPTION_TWICE,
2290 CURL_FORMADD_NULL,
2291 CURL_FORMADD_UNKNOWN_OPTION,
2292 CURL_FORMADD_INCOMPLETE,
2293 CURL_FORMADD_ILLEGAL_ARRAY,
2294 CURL_FORMADD_DISABLED, /* libcurl was built with this disabled */
2295
2296 CURL_FORMADD_LAST /* last */
2297} CURLFORMcode;
2298
2299/*
2300 * NAME curl_formadd()
2301 *
2302 * DESCRIPTION
2303 *
2304 * Pretty advanced function for building multi-part formposts. Each invoke
2305 * adds one part that together construct a full post. Then use
2306 * CURLOPT_HTTPPOST to send it off to libcurl.
2307 */
2308CURL_EXTERN CURLFORMcode curl_formadd(struct curl_httppost **httppost,
2309 struct curl_httppost **last_post,
2310 ...);
2311
2312/*
2313 * callback function for curl_formget()
2314 * The void *arg pointer will be the one passed as second argument to
2315 * curl_formget().
2316 * The character buffer passed to it must not be freed.
2317 * Should return the buffer length passed to it as the argument "len" on
2318 * success.
2319 */
2320typedef size_t (*curl_formget_callback)(void *arg, const char *buf,
2321 size_t len);
2322
2323/*
2324 * NAME curl_formget()
2325 *
2326 * DESCRIPTION
2327 *
2328 * Serialize a curl_httppost struct built with curl_formadd().
2329 * Accepts a void pointer as second argument which will be passed to
2330 * the curl_formget_callback function.
2331 * Returns 0 on success.
2332 */
2333CURL_EXTERN int curl_formget(struct curl_httppost *form, void *arg,
2334 curl_formget_callback append);
2335/*
2336 * NAME curl_formfree()
2337 *
2338 * DESCRIPTION
2339 *
2340 * Free a multipart formpost previously built with curl_formadd().
2341 */
2342CURL_EXTERN void curl_formfree(struct curl_httppost *form);
2343
2344/*
2345 * NAME curl_getenv()
2346 *
2347 * DESCRIPTION
2348 *
2349 * Returns a malloc()'ed string that MUST be curl_free()ed after usage is
2350 * complete. DEPRECATED - see lib/README.curlx
2351 */
2352CURL_EXTERN char *curl_getenv(const char *variable);
2353
2354/*
2355 * NAME curl_version()
2356 *
2357 * DESCRIPTION
2358 *
2359 * Returns a static ascii string of the libcurl version.
2360 */
2361CURL_EXTERN char *curl_version(void);
2362
2363/*
2364 * NAME curl_easy_escape()
2365 *
2366 * DESCRIPTION
2367 *
2368 * Escapes URL strings (converts all letters consider illegal in URLs to their
2369 * %XX versions). This function returns a new allocated string or NULL if an
2370 * error occurred.
2371 */
2372CURL_EXTERN char *curl_easy_escape(CURL *handle,
2373 const char *string,
2374 int length);
2375
2376/* the previous version: */
2377CURL_EXTERN char *curl_escape(const char *string,
2378 int length);
2379
2380
2381/*
2382 * NAME curl_easy_unescape()
2383 *
2384 * DESCRIPTION
2385 *
2386 * Unescapes URL encoding in strings (converts all %XX codes to their 8bit
2387 * versions). This function returns a new allocated string or NULL if an error
2388 * occurred.
2389 * Conversion Note: On non-ASCII platforms the ASCII %XX codes are
2390 * converted into the host encoding.
2391 */
2392CURL_EXTERN char *curl_easy_unescape(CURL *handle,
2393 const char *string,
2394 int length,
2395 int *outlength);
2396
2397/* the previous version */
2398CURL_EXTERN char *curl_unescape(const char *string,
2399 int length);
2400
2401/*
2402 * NAME curl_free()
2403 *
2404 * DESCRIPTION
2405 *
2406 * Provided for de-allocation in the same translation unit that did the
2407 * allocation. Added in libcurl 7.10
2408 */
2409CURL_EXTERN void curl_free(void *p);
2410
2411/*
2412 * NAME curl_global_init()
2413 *
2414 * DESCRIPTION
2415 *
2416 * curl_global_init() should be invoked exactly once for each application that
2417 * uses libcurl and before any call of other libcurl functions.
2418 *
2419 * This function is not thread-safe!
2420 */
2421CURL_EXTERN CURLcode curl_global_init(long flags);
2422
2423/*
2424 * NAME curl_global_init_mem()
2425 *
2426 * DESCRIPTION
2427 *
2428 * curl_global_init() or curl_global_init_mem() should be invoked exactly once
2429 * for each application that uses libcurl. This function can be used to
2430 * initialize libcurl and set user defined memory management callback
2431 * functions. Users can implement memory management routines to check for
2432 * memory leaks, check for mis-use of the curl library etc. User registered
2433 * callback routines with be invoked by this library instead of the system
2434 * memory management routines like malloc, free etc.
2435 */
2436CURL_EXTERN CURLcode curl_global_init_mem(long flags,
2437 curl_malloc_callback m,
2438 curl_free_callback f,
2439 curl_realloc_callback r,
2440 curl_strdup_callback s,
2441 curl_calloc_callback c);
2442
2443/*
2444 * NAME curl_global_cleanup()
2445 *
2446 * DESCRIPTION
2447 *
2448 * curl_global_cleanup() should be invoked exactly once for each application
2449 * that uses libcurl
2450 */
2451CURL_EXTERN void curl_global_cleanup(void);
2452
2453/* linked-list structure for the CURLOPT_QUOTE option (and other) */
2454struct curl_slist {
2455 char *data;
2456 struct curl_slist *next;
2457};
2458
2459/*
2460 * NAME curl_global_sslset()
2461 *
2462 * DESCRIPTION
2463 *
2464 * When built with multiple SSL backends, curl_global_sslset() allows to
2465 * choose one. This function can only be called once, and it must be called
2466 * *before* curl_global_init().
2467 *
2468 * The backend can be identified by the id (e.g. CURLSSLBACKEND_OPENSSL). The
2469 * backend can also be specified via the name parameter (passing -1 as id).
2470 * If both id and name are specified, the name will be ignored. If neither id
2471 * nor name are specified, the function will fail with
2472 * CURLSSLSET_UNKNOWN_BACKEND and set the "avail" pointer to the
2473 * NULL-terminated list of available backends.
2474 *
2475 * Upon success, the function returns CURLSSLSET_OK.
2476 *
2477 * If the specified SSL backend is not available, the function returns
2478 * CURLSSLSET_UNKNOWN_BACKEND and sets the "avail" pointer to a NULL-terminated
2479 * list of available SSL backends.
2480 *
2481 * The SSL backend can be set only once. If it has already been set, a
2482 * subsequent attempt to change it will result in a CURLSSLSET_TOO_LATE.
2483 */
2484
2485typedef struct {
2486 curl_sslbackend id;
2487 const char *name;
2488} curl_ssl_backend;
2489
2490typedef enum {
2491 CURLSSLSET_OK = 0,
2492 CURLSSLSET_UNKNOWN_BACKEND,
2493 CURLSSLSET_TOO_LATE,
2494 CURLSSLSET_NO_BACKENDS /* libcurl was built without any SSL support */
2495} CURLsslset;
2496
2497CURL_EXTERN CURLsslset curl_global_sslset(curl_sslbackend id, const char *name,
2498 const curl_ssl_backend ***avail);
2499
2500/*
2501 * NAME curl_slist_append()
2502 *
2503 * DESCRIPTION
2504 *
2505 * Appends a string to a linked list. If no list exists, it will be created
2506 * first. Returns the new list, after appending.
2507 */
2508CURL_EXTERN struct curl_slist *curl_slist_append(struct curl_slist *,
2509 const char *);
2510
2511/*
2512 * NAME curl_slist_free_all()
2513 *
2514 * DESCRIPTION
2515 *
2516 * free a previously built curl_slist.
2517 */
2518CURL_EXTERN void curl_slist_free_all(struct curl_slist *);
2519
2520/*
2521 * NAME curl_getdate()
2522 *
2523 * DESCRIPTION
2524 *
2525 * Returns the time, in seconds since 1 Jan 1970 of the time string given in
2526 * the first argument. The time argument in the second parameter is unused
2527 * and should be set to NULL.
2528 */
2529CURL_EXTERN time_t curl_getdate(const char *p, const time_t *unused);
2530
2531/* info about the certificate chain, only for OpenSSL, GnuTLS, Schannel, NSS
2532 and GSKit builds. Asked for with CURLOPT_CERTINFO / CURLINFO_CERTINFO */
2533struct curl_certinfo {
2534 int num_of_certs; /* number of certificates with information */
2535 struct curl_slist **certinfo; /* for each index in this array, there's a
2536 linked list with textual information in the
2537 format "name: value" */
2538};
2539
2540/* Information about the SSL library used and the respective internal SSL
2541 handle, which can be used to obtain further information regarding the
2542 connection. Asked for with CURLINFO_TLS_SSL_PTR or CURLINFO_TLS_SESSION. */
2543struct curl_tlssessioninfo {
2544 curl_sslbackend backend;
2545 void *internals;
2546};
2547
2548#define CURLINFO_STRING 0x100000
2549#define CURLINFO_LONG 0x200000
2550#define CURLINFO_DOUBLE 0x300000
2551#define CURLINFO_SLIST 0x400000
2552#define CURLINFO_PTR 0x400000 /* same as SLIST */
2553#define CURLINFO_SOCKET 0x500000
2554#define CURLINFO_OFF_T 0x600000
2555#define CURLINFO_MASK 0x0fffff
2556#define CURLINFO_TYPEMASK 0xf00000
2557
2558typedef enum {
2559 CURLINFO_NONE, /* first, never use this */
2560 CURLINFO_EFFECTIVE_URL = CURLINFO_STRING + 1,
2561 CURLINFO_RESPONSE_CODE = CURLINFO_LONG + 2,
2562 CURLINFO_TOTAL_TIME = CURLINFO_DOUBLE + 3,
2563 CURLINFO_NAMELOOKUP_TIME = CURLINFO_DOUBLE + 4,
2564 CURLINFO_CONNECT_TIME = CURLINFO_DOUBLE + 5,
2565 CURLINFO_PRETRANSFER_TIME = CURLINFO_DOUBLE + 6,
2566 CURLINFO_SIZE_UPLOAD = CURLINFO_DOUBLE + 7,
2567 CURLINFO_SIZE_UPLOAD_T = CURLINFO_OFF_T + 7,
2568 CURLINFO_SIZE_DOWNLOAD = CURLINFO_DOUBLE + 8,
2569 CURLINFO_SIZE_DOWNLOAD_T = CURLINFO_OFF_T + 8,
2570 CURLINFO_SPEED_DOWNLOAD = CURLINFO_DOUBLE + 9,
2571 CURLINFO_SPEED_DOWNLOAD_T = CURLINFO_OFF_T + 9,
2572 CURLINFO_SPEED_UPLOAD = CURLINFO_DOUBLE + 10,
2573 CURLINFO_SPEED_UPLOAD_T = CURLINFO_OFF_T + 10,
2574 CURLINFO_HEADER_SIZE = CURLINFO_LONG + 11,
2575 CURLINFO_REQUEST_SIZE = CURLINFO_LONG + 12,
2576 CURLINFO_SSL_VERIFYRESULT = CURLINFO_LONG + 13,
2577 CURLINFO_FILETIME = CURLINFO_LONG + 14,
2578 CURLINFO_FILETIME_T = CURLINFO_OFF_T + 14,
2579 CURLINFO_CONTENT_LENGTH_DOWNLOAD = CURLINFO_DOUBLE + 15,
2580 CURLINFO_CONTENT_LENGTH_DOWNLOAD_T = CURLINFO_OFF_T + 15,
2581 CURLINFO_CONTENT_LENGTH_UPLOAD = CURLINFO_DOUBLE + 16,
2582 CURLINFO_CONTENT_LENGTH_UPLOAD_T = CURLINFO_OFF_T + 16,
2583 CURLINFO_STARTTRANSFER_TIME = CURLINFO_DOUBLE + 17,
2584 CURLINFO_CONTENT_TYPE = CURLINFO_STRING + 18,
2585 CURLINFO_REDIRECT_TIME = CURLINFO_DOUBLE + 19,
2586 CURLINFO_REDIRECT_COUNT = CURLINFO_LONG + 20,
2587 CURLINFO_PRIVATE = CURLINFO_STRING + 21,
2588 CURLINFO_HTTP_CONNECTCODE = CURLINFO_LONG + 22,
2589 CURLINFO_HTTPAUTH_AVAIL = CURLINFO_LONG + 23,
2590 CURLINFO_PROXYAUTH_AVAIL = CURLINFO_LONG + 24,
2591 CURLINFO_OS_ERRNO = CURLINFO_LONG + 25,
2592 CURLINFO_NUM_CONNECTS = CURLINFO_LONG + 26,
2593 CURLINFO_SSL_ENGINES = CURLINFO_SLIST + 27,
2594 CURLINFO_COOKIELIST = CURLINFO_SLIST + 28,
2595 CURLINFO_LASTSOCKET = CURLINFO_LONG + 29,
2596 CURLINFO_FTP_ENTRY_PATH = CURLINFO_STRING + 30,
2597 CURLINFO_REDIRECT_URL = CURLINFO_STRING + 31,
2598 CURLINFO_PRIMARY_IP = CURLINFO_STRING + 32,
2599 CURLINFO_APPCONNECT_TIME = CURLINFO_DOUBLE + 33,
2600 CURLINFO_CERTINFO = CURLINFO_PTR + 34,
2601 CURLINFO_CONDITION_UNMET = CURLINFO_LONG + 35,
2602 CURLINFO_RTSP_SESSION_ID = CURLINFO_STRING + 36,
2603 CURLINFO_RTSP_CLIENT_CSEQ = CURLINFO_LONG + 37,
2604 CURLINFO_RTSP_SERVER_CSEQ = CURLINFO_LONG + 38,
2605 CURLINFO_RTSP_CSEQ_RECV = CURLINFO_LONG + 39,
2606 CURLINFO_PRIMARY_PORT = CURLINFO_LONG + 40,
2607 CURLINFO_LOCAL_IP = CURLINFO_STRING + 41,
2608 CURLINFO_LOCAL_PORT = CURLINFO_LONG + 42,
2609 CURLINFO_TLS_SESSION = CURLINFO_PTR + 43,
2610 CURLINFO_ACTIVESOCKET = CURLINFO_SOCKET + 44,
2611 CURLINFO_TLS_SSL_PTR = CURLINFO_PTR + 45,
2612 CURLINFO_HTTP_VERSION = CURLINFO_LONG + 46,
2613 CURLINFO_PROXY_SSL_VERIFYRESULT = CURLINFO_LONG + 47,
2614 CURLINFO_PROTOCOL = CURLINFO_LONG + 48,
2615 CURLINFO_SCHEME = CURLINFO_STRING + 49,
2616 /* Fill in new entries below here! */
2617
2618 /* Preferably these would be defined conditionally based on the
2619 sizeof curl_off_t being 64-bits */
2620 CURLINFO_TOTAL_TIME_T = CURLINFO_OFF_T + 50,
2621 CURLINFO_NAMELOOKUP_TIME_T = CURLINFO_OFF_T + 51,
2622 CURLINFO_CONNECT_TIME_T = CURLINFO_OFF_T + 52,
2623 CURLINFO_PRETRANSFER_TIME_T = CURLINFO_OFF_T + 53,
2624 CURLINFO_STARTTRANSFER_TIME_T = CURLINFO_OFF_T + 54,
2625 CURLINFO_REDIRECT_TIME_T = CURLINFO_OFF_T + 55,
2626 CURLINFO_APPCONNECT_TIME_T = CURLINFO_OFF_T + 56,
2627 CURLINFO_RETRY_AFTER = CURLINFO_OFF_T + 57,
2628
2629 CURLINFO_LASTONE = 57
2630} CURLINFO;
2631
2632/* CURLINFO_RESPONSE_CODE is the new name for the option previously known as
2633 CURLINFO_HTTP_CODE */
2634#define CURLINFO_HTTP_CODE CURLINFO_RESPONSE_CODE
2635
2636typedef enum {
2637 CURLCLOSEPOLICY_NONE, /* first, never use this */
2638
2639 CURLCLOSEPOLICY_OLDEST,
2640 CURLCLOSEPOLICY_LEAST_RECENTLY_USED,
2641 CURLCLOSEPOLICY_LEAST_TRAFFIC,
2642 CURLCLOSEPOLICY_SLOWEST,
2643 CURLCLOSEPOLICY_CALLBACK,
2644
2645 CURLCLOSEPOLICY_LAST /* last, never use this */
2646} curl_closepolicy;
2647
2648#define CURL_GLOBAL_SSL (1<<0) /* no purpose since since 7.57.0 */
2649#define CURL_GLOBAL_WIN32 (1<<1)
2650#define CURL_GLOBAL_ALL (CURL_GLOBAL_SSL|CURL_GLOBAL_WIN32)
2651#define CURL_GLOBAL_NOTHING 0
2652#define CURL_GLOBAL_DEFAULT CURL_GLOBAL_ALL
2653#define CURL_GLOBAL_ACK_EINTR (1<<2)
2654
2655
2656/*****************************************************************************
2657 * Setup defines, protos etc for the sharing stuff.
2658 */
2659
2660/* Different data locks for a single share */
2661typedef enum {
2662 CURL_LOCK_DATA_NONE = 0,
2663 /* CURL_LOCK_DATA_SHARE is used internally to say that
2664 * the locking is just made to change the internal state of the share
2665 * itself.
2666 */
2667 CURL_LOCK_DATA_SHARE,
2668 CURL_LOCK_DATA_COOKIE,
2669 CURL_LOCK_DATA_DNS,
2670 CURL_LOCK_DATA_SSL_SESSION,
2671 CURL_LOCK_DATA_CONNECT,
2672 CURL_LOCK_DATA_PSL,
2673 CURL_LOCK_DATA_LAST
2674} curl_lock_data;
2675
2676/* Different lock access types */
2677typedef enum {
2678 CURL_LOCK_ACCESS_NONE = 0, /* unspecified action */
2679 CURL_LOCK_ACCESS_SHARED = 1, /* for read perhaps */
2680 CURL_LOCK_ACCESS_SINGLE = 2, /* for write perhaps */
2681 CURL_LOCK_ACCESS_LAST /* never use */
2682} curl_lock_access;
2683
2684typedef void (*curl_lock_function)(CURL *handle,
2685 curl_lock_data data,
2686 curl_lock_access locktype,
2687 void *userptr);
2688typedef void (*curl_unlock_function)(CURL *handle,
2689 curl_lock_data data,
2690 void *userptr);
2691
2692
2693typedef enum {
2694 CURLSHE_OK, /* all is fine */
2695 CURLSHE_BAD_OPTION, /* 1 */
2696 CURLSHE_IN_USE, /* 2 */
2697 CURLSHE_INVALID, /* 3 */
2698 CURLSHE_NOMEM, /* 4 out of memory */
2699 CURLSHE_NOT_BUILT_IN, /* 5 feature not present in lib */
2700 CURLSHE_LAST /* never use */
2701} CURLSHcode;
2702
2703typedef enum {
2704 CURLSHOPT_NONE, /* don't use */
2705 CURLSHOPT_SHARE, /* specify a data type to share */
2706 CURLSHOPT_UNSHARE, /* specify which data type to stop sharing */
2707 CURLSHOPT_LOCKFUNC, /* pass in a 'curl_lock_function' pointer */
2708 CURLSHOPT_UNLOCKFUNC, /* pass in a 'curl_unlock_function' pointer */
2709 CURLSHOPT_USERDATA, /* pass in a user data pointer used in the lock/unlock
2710 callback functions */
2711 CURLSHOPT_LAST /* never use */
2712} CURLSHoption;
2713
2714CURL_EXTERN CURLSH *curl_share_init(void);
2715CURL_EXTERN CURLSHcode curl_share_setopt(CURLSH *, CURLSHoption option, ...);
2716CURL_EXTERN CURLSHcode curl_share_cleanup(CURLSH *);
2717
2718/****************************************************************************
2719 * Structures for querying information about the curl library at runtime.
2720 */
2721
2722typedef enum {
2723 CURLVERSION_FIRST,
2724 CURLVERSION_SECOND,
2725 CURLVERSION_THIRD,
2726 CURLVERSION_FOURTH,
2727 CURLVERSION_FIFTH,
2728 CURLVERSION_SIXTH,
2729 CURLVERSION_LAST /* never actually use this */
2730} CURLversion;
2731
2732/* The 'CURLVERSION_NOW' is the symbolic name meant to be used by
2733 basically all programs ever that want to get version information. It is
2734 meant to be a built-in version number for what kind of struct the caller
2735 expects. If the struct ever changes, we redefine the NOW to another enum
2736 from above. */
2737#define CURLVERSION_NOW CURLVERSION_SIXTH
2738
2739typedef struct {
2740 CURLversion age; /* age of the returned struct */
2741 const char *version; /* LIBCURL_VERSION */
2742 unsigned int version_num; /* LIBCURL_VERSION_NUM */
2743 const char *host; /* OS/host/cpu/machine when configured */
2744 int features; /* bitmask, see defines below */
2745 const char *ssl_version; /* human readable string */
2746 long ssl_version_num; /* not used anymore, always 0 */
2747 const char *libz_version; /* human readable string */
2748 /* protocols is terminated by an entry with a NULL protoname */
2749 const char * const *protocols;
2750
2751 /* The fields below this were added in CURLVERSION_SECOND */
2752 const char *ares;
2753 int ares_num;
2754
2755 /* This field was added in CURLVERSION_THIRD */
2756 const char *libidn;
2757
2758 /* These field were added in CURLVERSION_FOURTH */
2759
2760 /* Same as '_libiconv_version' if built with HAVE_ICONV */
2761 int iconv_ver_num;
2762
2763 const char *libssh_version; /* human readable string */
2764
2765 /* These fields were added in CURLVERSION_FIFTH */
2766 unsigned int brotli_ver_num; /* Numeric Brotli version
2767 (MAJOR << 24) | (MINOR << 12) | PATCH */
2768 const char *brotli_version; /* human readable string. */
2769
2770 /* These fields were added in CURLVERSION_SIXTH */
2771 unsigned int nghttp2_ver_num; /* Numeric nghttp2 version
2772 (MAJOR << 16) | (MINOR << 8) | PATCH */
2773 const char *nghttp2_version; /* human readable string. */
2774 const char *quic_version; /* human readable quic (+ HTTP/3) library +
2775 version or NULL */
2776} curl_version_info_data;
2777
2778#define CURL_VERSION_IPV6 (1<<0) /* IPv6-enabled */
2779#define CURL_VERSION_KERBEROS4 (1<<1) /* Kerberos V4 auth is supported
2780 (deprecated) */
2781#define CURL_VERSION_SSL (1<<2) /* SSL options are present */
2782#define CURL_VERSION_LIBZ (1<<3) /* libz features are present */
2783#define CURL_VERSION_NTLM (1<<4) /* NTLM auth is supported */
2784#define CURL_VERSION_GSSNEGOTIATE (1<<5) /* Negotiate auth is supported
2785 (deprecated) */
2786#define CURL_VERSION_DEBUG (1<<6) /* Built with debug capabilities */
2787#define CURL_VERSION_ASYNCHDNS (1<<7) /* Asynchronous DNS resolves */
2788#define CURL_VERSION_SPNEGO (1<<8) /* SPNEGO auth is supported */
2789#define CURL_VERSION_LARGEFILE (1<<9) /* Supports files larger than 2GB */
2790#define CURL_VERSION_IDN (1<<10) /* Internationized Domain Names are
2791 supported */
2792#define CURL_VERSION_SSPI (1<<11) /* Built against Windows SSPI */
2793#define CURL_VERSION_CONV (1<<12) /* Character conversions supported */
2794#define CURL_VERSION_CURLDEBUG (1<<13) /* Debug memory tracking supported */
2795#define CURL_VERSION_TLSAUTH_SRP (1<<14) /* TLS-SRP auth is supported */
2796#define CURL_VERSION_NTLM_WB (1<<15) /* NTLM delegation to winbind helper
2797 is supported */
2798#define CURL_VERSION_HTTP2 (1<<16) /* HTTP2 support built-in */
2799#define CURL_VERSION_GSSAPI (1<<17) /* Built against a GSS-API library */
2800#define CURL_VERSION_KERBEROS5 (1<<18) /* Kerberos V5 auth is supported */
2801#define CURL_VERSION_UNIX_SOCKETS (1<<19) /* Unix domain sockets support */
2802#define CURL_VERSION_PSL (1<<20) /* Mozilla's Public Suffix List, used
2803 for cookie domain verification */
2804#define CURL_VERSION_HTTPS_PROXY (1<<21) /* HTTPS-proxy support built-in */
2805#define CURL_VERSION_MULTI_SSL (1<<22) /* Multiple SSL backends available */
2806#define CURL_VERSION_BROTLI (1<<23) /* Brotli features are present. */
2807#define CURL_VERSION_ALTSVC (1<<24) /* Alt-Svc handling built-in */
2808#define CURL_VERSION_HTTP3 (1<<25) /* HTTP3 support built-in */
2809
2810#define CURL_VERSION_ESNI (1<<26) /* ESNI support */
2811
2812 /*
2813 * NAME curl_version_info()
2814 *
2815 * DESCRIPTION
2816 *
2817 * This function returns a pointer to a static copy of the version info
2818 * struct. See above.
2819 */
2820CURL_EXTERN curl_version_info_data *curl_version_info(CURLversion);
2821
2822/*
2823 * NAME curl_easy_strerror()
2824 *
2825 * DESCRIPTION
2826 *
2827 * The curl_easy_strerror function may be used to turn a CURLcode value
2828 * into the equivalent human readable error string. This is useful
2829 * for printing meaningful error messages.
2830 */
2831CURL_EXTERN const char *curl_easy_strerror(CURLcode);
2832
2833/*
2834 * NAME curl_share_strerror()
2835 *
2836 * DESCRIPTION
2837 *
2838 * The curl_share_strerror function may be used to turn a CURLSHcode value
2839 * into the equivalent human readable error string. This is useful
2840 * for printing meaningful error messages.
2841 */
2842CURL_EXTERN const char *curl_share_strerror(CURLSHcode);
2843
2844/*
2845 * NAME curl_easy_pause()
2846 *
2847 * DESCRIPTION
2848 *
2849 * The curl_easy_pause function pauses or unpauses transfers. Select the new
2850 * state by setting the bitmask, use the convenience defines below.
2851 *
2852 */
2853CURL_EXTERN CURLcode curl_easy_pause(CURL *handle, int bitmask);
2854
2855#define CURLPAUSE_RECV (1<<0)
2856#define CURLPAUSE_RECV_CONT (0)
2857
2858#define CURLPAUSE_SEND (1<<2)
2859#define CURLPAUSE_SEND_CONT (0)
2860
2861#define CURLPAUSE_ALL (CURLPAUSE_RECV|CURLPAUSE_SEND)
2862#define CURLPAUSE_CONT (CURLPAUSE_RECV_CONT|CURLPAUSE_SEND_CONT)
2863
2864#ifdef __cplusplus
2865}
2866#endif
2867
2868/* unfortunately, the easy.h and multi.h include files need options and info
2869 stuff before they can be included! */
2870#include "easy.h" /* nothing in curl is fun without the easy stuff */
2871#include "multi.h"
2872#include "urlapi.h"
2873
2874/* the typechecker doesn't work in C++ (yet) */
2875#if defined(__GNUC__) && defined(__GNUC_MINOR__) && \
2876 ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) && \
2877 !defined(__cplusplus) && !defined(CURL_DISABLE_TYPECHECK)
2878#include "typecheck-gcc.h"
2879#else
2880#if defined(__STDC__) && (__STDC__ >= 1)
2881/* This preprocessor magic that replaces a call with the exact same call is
2882 only done to make sure application authors pass exactly three arguments
2883 to these functions. */
2884#define curl_easy_setopt(handle,opt,param) curl_easy_setopt(handle,opt,param)
2885#define curl_easy_getinfo(handle,info,arg) curl_easy_getinfo(handle,info,arg)
2886#define curl_share_setopt(share,opt,param) curl_share_setopt(share,opt,param)
2887#define curl_multi_setopt(handle,opt,param) curl_multi_setopt(handle,opt,param)
2888#endif /* __STDC__ >= 1 */
2889#endif /* gcc >= 4.3 && !__cplusplus */
2890
2891#endif /* CURLINC_CURL_H */
2892