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