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