Annotation of parser3/src/lib/curl/curl.h, revision 1.7
1.2 moko 1: #ifndef __CURL_CURL_H
2: #define __CURL_CURL_H
3: /***************************************************************************
4: * _ _ ____ _
5: * Project ___| | | | _ \| |
6: * / __| | | | |_) | |
7: * | (__| |_| | _ <| |___
8: * \___|\___/|_| \_\_____|
9: *
10: * Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
11: *
12: * This software is licensed as described in the file COPYING, which
13: * you should have received as part of this distribution. The terms
14: * are also available at http://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: *
1.7 ! moko 23: * $Id: curl.h,v 1.6 2026/07/13 21:42:16 moko Exp $
1.2 moko 24: ***************************************************************************/
25:
26: /*
27: * If you have libcurl problems, all docs and details are found here:
28: * http://curl.haxx.se/libcurl/
29: *
30: * curl-library mailing list subscription and unsubscription web interface:
31: * http://cool.haxx.se/mailman/listinfo/curl-library/
32: */
33:
34:
35: typedef struct CURL CURL;
36:
1.7 ! moko 37: /* linked-list structure for the CURLOPT_QUOTE option (and other) */
! 38: struct curl_slist {
! 39: char *data;
! 40: struct curl_slist *next;
! 41: };
! 42:
1.2 moko 43: typedef enum {
44: CURLE_OK = 0,
45: CURLE_UNSUPPORTED_PROTOCOL, /* 1 */
46: CURLE_FAILED_INIT, /* 2 */
47: CURLE_URL_MALFORMAT, /* 3 */
48: CURLE_OBSOLETE4, /* 4 - NOT USED */
49: CURLE_COULDNT_RESOLVE_PROXY, /* 5 */
50: CURLE_COULDNT_RESOLVE_HOST, /* 6 */
51: CURLE_COULDNT_CONNECT, /* 7 */
52: CURLE_FTP_WEIRD_SERVER_REPLY, /* 8 */
53: CURLE_REMOTE_ACCESS_DENIED, /* 9 a service was denied by the server
54: due to lack of access - when login fails
55: this is not returned. */
56: CURLE_OBSOLETE10, /* 10 - NOT USED */
57: CURLE_FTP_WEIRD_PASS_REPLY, /* 11 */
58: CURLE_OBSOLETE12, /* 12 - NOT USED */
59: CURLE_FTP_WEIRD_PASV_REPLY, /* 13 */
60: CURLE_FTP_WEIRD_227_FORMAT, /* 14 */
61: CURLE_FTP_CANT_GET_HOST, /* 15 */
62: CURLE_OBSOLETE16, /* 16 - NOT USED */
63: CURLE_FTP_COULDNT_SET_TYPE, /* 17 */
64: CURLE_PARTIAL_FILE, /* 18 */
65: CURLE_FTP_COULDNT_RETR_FILE, /* 19 */
66: CURLE_OBSOLETE20, /* 20 - NOT USED */
67: CURLE_QUOTE_ERROR, /* 21 - quote command failure */
68: CURLE_HTTP_RETURNED_ERROR, /* 22 */
69: CURLE_WRITE_ERROR, /* 23 */
70: CURLE_OBSOLETE24, /* 24 - NOT USED */
71: CURLE_UPLOAD_FAILED, /* 25 - failed upload "command" */
72: CURLE_READ_ERROR, /* 26 - couldn't open/read from file */
73: CURLE_OUT_OF_MEMORY, /* 27 */
74: /* Note: CURLE_OUT_OF_MEMORY may sometimes indicate a conversion error
75: instead of a memory allocation error if CURL_DOES_CONVERSIONS
76: is defined
77: */
78: CURLE_OPERATION_TIMEDOUT, /* 28 - the timeout time was reached */
79: CURLE_OBSOLETE29, /* 29 - NOT USED */
80: CURLE_FTP_PORT_FAILED, /* 30 - FTP PORT operation failed */
81: CURLE_FTP_COULDNT_USE_REST, /* 31 - the REST command failed */
82: CURLE_OBSOLETE32, /* 32 - NOT USED */
83: CURLE_RANGE_ERROR, /* 33 - RANGE "command" didn't work */
84: CURLE_HTTP_POST_ERROR, /* 34 */
85: CURLE_SSL_CONNECT_ERROR, /* 35 - wrong when connecting with SSL */
86: CURLE_BAD_DOWNLOAD_RESUME, /* 36 - couldn't resume download */
87: CURLE_FILE_COULDNT_READ_FILE, /* 37 */
88: CURLE_LDAP_CANNOT_BIND, /* 38 */
89: CURLE_LDAP_SEARCH_FAILED, /* 39 */
90: CURLE_OBSOLETE40, /* 40 - NOT USED */
91: CURLE_FUNCTION_NOT_FOUND, /* 41 */
92: CURLE_ABORTED_BY_CALLBACK, /* 42 */
93: CURLE_BAD_FUNCTION_ARGUMENT, /* 43 */
94: CURLE_OBSOLETE44, /* 44 - NOT USED */
95: CURLE_INTERFACE_FAILED, /* 45 - CURLOPT_INTERFACE failed */
96: CURLE_OBSOLETE46, /* 46 - NOT USED */
97: CURLE_TOO_MANY_REDIRECTS , /* 47 - catch endless re-direct loops */
98: CURLE_UNKNOWN_TELNET_OPTION, /* 48 - User specified an unknown option */
99: CURLE_TELNET_OPTION_SYNTAX , /* 49 - Malformed telnet option */
100: CURLE_OBSOLETE50, /* 50 - NOT USED */
101: CURLE_PEER_FAILED_VERIFICATION, /* 51 - peer's certificate or fingerprint
102: wasn't verified fine */
103: CURLE_GOT_NOTHING, /* 52 - when this is a specific error */
104: CURLE_SSL_ENGINE_NOTFOUND, /* 53 - SSL crypto engine not found */
105: CURLE_SSL_ENGINE_SETFAILED, /* 54 - can not set SSL crypto engine as
106: default */
107: CURLE_SEND_ERROR, /* 55 - failed sending network data */
108: CURLE_RECV_ERROR, /* 56 - failure in receiving network data */
109: CURLE_OBSOLETE57, /* 57 - NOT IN USE */
110: CURLE_SSL_CERTPROBLEM, /* 58 - problem with the local certificate */
111: CURLE_SSL_CIPHER, /* 59 - couldn't use specified cipher */
112: CURLE_SSL_CACERT, /* 60 - problem with the CA cert (path?) */
113: CURLE_BAD_CONTENT_ENCODING, /* 61 - Unrecognized transfer encoding */
114: CURLE_LDAP_INVALID_URL, /* 62 - Invalid LDAP URL */
115: CURLE_FILESIZE_EXCEEDED, /* 63 - Maximum file size exceeded */
116: CURLE_USE_SSL_FAILED, /* 64 - Requested FTP SSL level failed */
117: CURLE_SEND_FAIL_REWIND, /* 65 - Sending the data requires a rewind
118: that failed */
119: CURLE_SSL_ENGINE_INITFAILED, /* 66 - failed to initialise ENGINE */
120: CURLE_LOGIN_DENIED, /* 67 - user, password or similar was not
121: accepted and we failed to login */
122: CURLE_TFTP_NOTFOUND, /* 68 - file not found on server */
123: CURLE_TFTP_PERM, /* 69 - permission problem on server */
124: CURLE_REMOTE_DISK_FULL, /* 70 - out of disk space on server */
125: CURLE_TFTP_ILLEGAL, /* 71 - Illegal TFTP operation */
126: CURLE_TFTP_UNKNOWNID, /* 72 - Unknown transfer ID */
127: CURLE_REMOTE_FILE_EXISTS, /* 73 - File already exists */
128: CURLE_TFTP_NOSUCHUSER, /* 74 - No such user */
129: CURLE_CONV_FAILED, /* 75 - conversion failed */
130: CURLE_CONV_REQD, /* 76 - caller must register conversion
131: callbacks using curl_easy_setopt options
132: CURLOPT_CONV_FROM_NETWORK_FUNCTION,
133: CURLOPT_CONV_TO_NETWORK_FUNCTION, and
134: CURLOPT_CONV_FROM_UTF8_FUNCTION */
135: CURLE_SSL_CACERT_BADFILE, /* 77 - could not load CACERT file, missing
136: or wrong format */
137: CURLE_REMOTE_FILE_NOT_FOUND, /* 78 - remote file not found */
138: CURLE_SSH, /* 79 - error from the SSH layer, somewhat
139: generic so the error message will be of
140: interest when this has happened */
141:
142: CURLE_SSL_SHUTDOWN_FAILED, /* 80 - Failed to shut down the SSL
143: connection */
144: CURLE_AGAIN, /* 81 - socket is not ready for send/recv,
145: wait till it's ready and try again (Added
146: in 7.18.2) */
147: CURLE_SSL_CRL_BADFILE, /* 82 - could not load CRL file, missing or
148: wrong format (Added in 7.19.0) */
149: CURLE_SSL_ISSUER_ERROR, /* 83 - Issuer check failed. (Added in
150: 7.19.0) */
151: CURL_LAST /* never use! */
152: } CURLcode;
153:
1.6 moko 154: /* the minimum CURLOPT_ERRORBUFFER size, error messages are truncated to fit */
155: #define CURL_ERROR_SIZE 256
156:
1.2 moko 157:
158: /* long may be 32 or 64 bits, but we should never depend on anything else
159: but 32 */
160: #define CURLOPTTYPE_LONG 0
161: #define CURLOPTTYPE_OBJECTPOINT 10000
162: #define CURLOPTTYPE_FUNCTIONPOINT 20000
163: #define CURLOPTTYPE_OFF_T 30000
164:
165: /* name is uppercase CURLOPT_<name>,
166: type is one of the defined CURLOPTTYPE_<type>
167: number is unique identifier */
168:
169: #define CINIT(name,type,number) CURLOPT_ ## name = CURLOPTTYPE_ ## type + number
170:
171: /*
172: * This macro-mania below setups the CURLOPT_[what] enum, to be used with
173: * curl_easy_setopt(). The first argument in the CINIT() macro is the [what]
174: * word.
175: */
176:
177: typedef enum {
178: /* This is the FILE * or void * the regular output should be written to. */
179: CINIT(FILE, OBJECTPOINT, 1),
180:
181: /* The full URL to get/put */
182: CINIT(URL, OBJECTPOINT, 2),
183:
184: /* Port number to connect to, if other than default. */
185: CINIT(PORT, LONG, 3),
186:
187: /* Name of proxy to use. */
188: CINIT(PROXY, OBJECTPOINT, 4),
189:
190: /* "name:password" to use when fetching. */
191: CINIT(USERPWD, OBJECTPOINT, 5),
192:
193: /* "name:password" to use with proxy. */
194: CINIT(PROXYUSERPWD, OBJECTPOINT, 6),
195:
196: /* Range to get, specified as an ASCII string. */
197: CINIT(RANGE, OBJECTPOINT, 7),
198:
199: /* not used */
200:
201: /* Specified file stream to upload from (use as input): */
202: CINIT(INFILE, OBJECTPOINT, 9),
203:
204: /* Buffer to receive error messages in, must be at least CURL_ERROR_SIZE
205: * bytes big. If this is not used, error messages go to stderr instead: */
206: CINIT(ERRORBUFFER, OBJECTPOINT, 10),
207:
208: /* Function that will be called to store the output (instead of fwrite). The
209: * parameters will use fwrite() syntax, make sure to follow them. */
210: CINIT(WRITEFUNCTION, FUNCTIONPOINT, 11),
211:
212: /* Function that will be called to read the input (instead of fread). The
213: * parameters will use fread() syntax, make sure to follow them. */
214: CINIT(READFUNCTION, FUNCTIONPOINT, 12),
215:
216: /* Time-out the read operation after this amount of seconds */
217: CINIT(TIMEOUT, LONG, 13),
218:
219: /* If the CURLOPT_INFILE is used, this can be used to inform libcurl about
220: * how large the file being sent really is. That allows better error
221: * checking and better verifies that the upload was successful. -1 means
222: * unknown size.
223: *
224: * For large file support, there is also a _LARGE version of the key
225: * which takes an off_t type, allowing platforms with larger off_t
226: * sizes to handle larger files. See below for INFILESIZE_LARGE.
227: */
228: CINIT(INFILESIZE, LONG, 14),
229:
230: /* POST static input fields. */
231: CINIT(POSTFIELDS, OBJECTPOINT, 15),
232:
233: /* Set the referrer page (needed by some CGIs) */
234: CINIT(REFERER, OBJECTPOINT, 16),
235:
236: /* Set the FTP PORT string (interface name, named or numerical IP address)
237: Use i.e '-' to use default address. */
238: CINIT(FTPPORT, OBJECTPOINT, 17),
239:
240: /* Set the User-Agent string (examined by some CGIs) */
241: CINIT(USERAGENT, OBJECTPOINT, 18),
242:
243: /* If the download receives less than "low speed limit" bytes/second
244: * during "low speed time" seconds, the operations is aborted.
245: * You could i.e if you have a pretty high speed connection, abort if
246: * it is less than 2000 bytes/sec during 20 seconds.
247: */
248:
249: /* Set the "low speed limit" */
250: CINIT(LOW_SPEED_LIMIT, LONG, 19),
251:
252: /* Set the "low speed time" */
253: CINIT(LOW_SPEED_TIME, LONG, 20),
254:
255: /* Set the continuation offset.
256: *
257: * Note there is also a _LARGE version of this key which uses
258: * off_t types, allowing for large file offsets on platforms which
259: * use larger-than-32-bit off_t's. Look below for RESUME_FROM_LARGE.
260: */
261: CINIT(RESUME_FROM, LONG, 21),
262:
263: /* Set cookie in request: */
264: CINIT(COOKIE, OBJECTPOINT, 22),
265:
266: /* This points to a linked list of headers, struct curl_slist kind */
267: CINIT(HTTPHEADER, OBJECTPOINT, 23),
268:
269: /* This points to a linked list of post entries, struct curl_httppost */
270: CINIT(HTTPPOST, OBJECTPOINT, 24),
271:
272: /* name of the file keeping your private SSL-certificate */
273: CINIT(SSLCERT, OBJECTPOINT, 25),
274:
275: /* password for the SSL or SSH private key */
276: CINIT(KEYPASSWD, OBJECTPOINT, 26),
277:
278: /* send TYPE parameter? */
279: CINIT(CRLF, LONG, 27),
280:
281: /* send linked-list of QUOTE commands */
282: CINIT(QUOTE, OBJECTPOINT, 28),
283:
284: /* send FILE * or void * to store headers to, if you use a callback it
285: is simply passed to the callback unmodified */
286: CINIT(WRITEHEADER, OBJECTPOINT, 29),
287:
288: /* point to a file to read the initial cookies from, also enables
289: "cookie awareness" */
290: CINIT(COOKIEFILE, OBJECTPOINT, 31),
291:
292: /* What version to specifically try to use.
293: See CURL_SSLVERSION defines below. */
294: CINIT(SSLVERSION, LONG, 32),
295:
296: /* What kind of HTTP time condition to use, see defines */
297: CINIT(TIMECONDITION, LONG, 33),
298:
299: /* Time to use with the above condition. Specified in number of seconds
300: since 1 Jan 1970 */
301: CINIT(TIMEVALUE, LONG, 34),
302:
303: /* 35 = OBSOLETE */
304:
305: /* Custom request, for customizing the get command like
306: HTTP: DELETE, TRACE and others
307: FTP: to use a different list command
308: */
309: CINIT(CUSTOMREQUEST, OBJECTPOINT, 36),
310:
311: /* HTTP request, for odd commands like DELETE, TRACE and others */
312: CINIT(STDERR, OBJECTPOINT, 37),
313:
314: /* 38 is not used */
315:
316: /* send linked-list of post-transfer QUOTE commands */
317: CINIT(POSTQUOTE, OBJECTPOINT, 39),
318:
319: /* Pass a pointer to string of the output using full variable-replacement
320: as described elsewhere. */
321: CINIT(WRITEINFO, OBJECTPOINT, 40),
322:
323: CINIT(VERBOSE, LONG, 41), /* talk a lot */
324: CINIT(HEADER, LONG, 42), /* throw the header out too */
325: CINIT(NOPROGRESS, LONG, 43), /* shut off the progress meter */
326: CINIT(NOBODY, LONG, 44), /* use HEAD to get http document */
327: CINIT(FAILONERROR, LONG, 45), /* no output on http error codes >= 300 */
328: CINIT(UPLOAD, LONG, 46), /* this is an upload */
329: CINIT(POST, LONG, 47), /* HTTP POST method */
330: CINIT(DIRLISTONLY, LONG, 48), /* return bare names when listing directories */
331:
332: CINIT(APPEND, LONG, 50), /* Append instead of overwrite on upload! */
333:
334: /* Specify whether to read the user+password from the .netrc or the URL.
335: * This must be one of the CURL_NETRC_* enums below. */
336: CINIT(NETRC, LONG, 51),
337:
338: CINIT(FOLLOWLOCATION, LONG, 52), /* use Location: Luke! */
339:
340: CINIT(TRANSFERTEXT, LONG, 53), /* transfer data in text/ASCII format */
341: CINIT(PUT, LONG, 54), /* HTTP PUT */
342:
343: /* 55 = OBSOLETE */
344:
345: /* Function that will be called instead of the internal progress display
346: * function. This function should be defined as the curl_progress_callback
347: * prototype defines. */
348: CINIT(PROGRESSFUNCTION, FUNCTIONPOINT, 56),
349:
350: /* Data passed to the progress callback */
351: CINIT(PROGRESSDATA, OBJECTPOINT, 57),
352:
353: /* We want the referrer field set automatically when following locations */
354: CINIT(AUTOREFERER, LONG, 58),
355:
356: /* Port of the proxy, can be set in the proxy string as well with:
357: "[host]:[port]" */
358: CINIT(PROXYPORT, LONG, 59),
359:
360: /* size of the POST input data, if strlen() is not good to use */
361: CINIT(POSTFIELDSIZE, LONG, 60),
362:
363: /* tunnel non-http operations through a HTTP proxy */
364: CINIT(HTTPPROXYTUNNEL, LONG, 61),
365:
366: /* Set the interface string to use as outgoing network interface */
367: CINIT(INTERFACE, OBJECTPOINT, 62),
368:
369: /* Set the krb4/5 security level, this also enables krb4/5 awareness. This
370: * is a string, 'clear', 'safe', 'confidential' or 'private'. If the string
371: * is set but doesn't match one of these, 'private' will be used. */
372: CINIT(KRBLEVEL, OBJECTPOINT, 63),
373:
374: /* Set if we should verify the peer in ssl handshake, set 1 to verify. */
375: CINIT(SSL_VERIFYPEER, LONG, 64),
376:
377: /* The CApath or CAfile used to validate the peer certificate
378: this option is used only if SSL_VERIFYPEER is true */
379: CINIT(CAINFO, OBJECTPOINT, 65),
380:
381: /* 66 = OBSOLETE */
382: /* 67 = OBSOLETE */
383:
384: /* Maximum number of http redirects to follow */
385: CINIT(MAXREDIRS, LONG, 68),
386:
387: /* Pass a long set to 1 to get the date of the requested document (if
388: possible)! Pass a zero to shut it off. */
389: CINIT(FILETIME, LONG, 69),
390:
391: /* This points to a linked list of telnet options */
392: CINIT(TELNETOPTIONS, OBJECTPOINT, 70),
393:
394: /* Max amount of cached alive connections */
395: CINIT(MAXCONNECTS, LONG, 71),
396:
397: /* What policy to use when closing connections when the cache is filled
398: up */
399: CINIT(CLOSEPOLICY, LONG, 72),
400:
401: /* 73 = OBSOLETE */
402:
403: /* Set to explicitly use a new connection for the upcoming transfer.
404: Do not use this unless you're absolutely sure of this, as it makes the
405: operation slower and is less friendly for the network. */
406: CINIT(FRESH_CONNECT, LONG, 74),
407:
408: /* Set to explicitly forbid the upcoming transfer's connection to be re-used
409: when done. Do not use this unless you're absolutely sure of this, as it
410: makes the operation slower and is less friendly for the network. */
411: CINIT(FORBID_REUSE, LONG, 75),
412:
413: /* Set to a file name that contains random data for libcurl to use to
414: seed the random engine when doing SSL connects. */
415: CINIT(RANDOM_FILE, OBJECTPOINT, 76),
416:
417: /* Set to the Entropy Gathering Daemon socket pathname */
418: CINIT(EGDSOCKET, OBJECTPOINT, 77),
419:
420: /* Time-out connect operations after this amount of seconds, if connects
421: are OK within this time, then fine... This only aborts the connect
422: phase. [Only works on unix-style/SIGALRM operating systems] */
423: CINIT(CONNECTTIMEOUT, LONG, 78),
424:
425: /* Function that will be called to store headers (instead of fwrite). The
426: * parameters will use fwrite() syntax, make sure to follow them. */
427: CINIT(HEADERFUNCTION, FUNCTIONPOINT, 79),
428:
429: /* Set this to force the HTTP request to get back to GET. Only really usable
430: if POST, PUT or a custom request have been used first.
431: */
432: CINIT(HTTPGET, LONG, 80),
433:
434: /* Set if we should verify the Common name from the peer certificate in ssl
435: * handshake, set 1 to check existence, 2 to ensure that it matches the
436: * provided hostname. */
437: CINIT(SSL_VERIFYHOST, LONG, 81),
438:
439: /* Specify which file name to write all known cookies in after completed
440: operation. Set file name to "-" (dash) to make it go to stdout. */
441: CINIT(COOKIEJAR, OBJECTPOINT, 82),
442:
443: /* Specify which SSL ciphers to use */
444: CINIT(SSL_CIPHER_LIST, OBJECTPOINT, 83),
445:
446: /* Specify which HTTP version to use! This must be set to one of the
447: CURL_HTTP_VERSION* enums set below. */
448: CINIT(HTTP_VERSION, LONG, 84),
449:
450: /* Specifically switch on or off the FTP engine's use of the EPSV command. By
451: default, that one will always be attempted before the more traditional
452: PASV command. */
453: CINIT(FTP_USE_EPSV, LONG, 85),
454:
455: /* type of the file keeping your SSL-certificate ("DER", "PEM", "ENG") */
456: CINIT(SSLCERTTYPE, OBJECTPOINT, 86),
457:
458: /* name of the file keeping your private SSL-key */
459: CINIT(SSLKEY, OBJECTPOINT, 87),
460:
461: /* type of the file keeping your private SSL-key ("DER", "PEM", "ENG") */
462: CINIT(SSLKEYTYPE, OBJECTPOINT, 88),
463:
464: /* crypto engine for the SSL-sub system */
465: CINIT(SSLENGINE, OBJECTPOINT, 89),
466:
467: /* set the crypto engine for the SSL-sub system as default
468: the param has no meaning...
469: */
470: CINIT(SSLENGINE_DEFAULT, LONG, 90),
471:
472: /* Non-zero value means to use the global dns cache */
473: CINIT(DNS_USE_GLOBAL_CACHE, LONG, 91), /* To become OBSOLETE soon */
474:
475: /* DNS cache timeout */
476: CINIT(DNS_CACHE_TIMEOUT, LONG, 92),
477:
478: /* send linked-list of pre-transfer QUOTE commands */
479: CINIT(PREQUOTE, OBJECTPOINT, 93),
480:
481: /* set the debug function */
482: CINIT(DEBUGFUNCTION, FUNCTIONPOINT, 94),
483:
484: /* set the data for the debug function */
485: CINIT(DEBUGDATA, OBJECTPOINT, 95),
486:
487: /* mark this as start of a cookie session */
488: CINIT(COOKIESESSION, LONG, 96),
489:
490: /* The CApath directory used to validate the peer certificate
491: this option is used only if SSL_VERIFYPEER is true */
492: CINIT(CAPATH, OBJECTPOINT, 97),
493:
494: /* Instruct libcurl to use a smaller receive buffer */
495: CINIT(BUFFERSIZE, LONG, 98),
496:
497: /* Instruct libcurl to not use any signal/alarm handlers, even when using
498: timeouts. This option is useful for multi-threaded applications.
499: See libcurl-the-guide for more background information. */
500: CINIT(NOSIGNAL, LONG, 99),
501:
502: /* Provide a CURLShare for mutexing non-ts data */
503: CINIT(SHARE, OBJECTPOINT, 100),
504:
505: /* indicates type of proxy. accepted values are CURLPROXY_HTTP (default),
506: CURLPROXY_SOCKS4, CURLPROXY_SOCKS4A and CURLPROXY_SOCKS5. */
507: CINIT(PROXYTYPE, LONG, 101),
508:
509: /* Set the Accept-Encoding string. Use this to tell a server you would like
510: the response to be compressed. */
1.3 moko 511: CINIT(ACCEPT_ENCODING, OBJECTPOINT, 102),
1.2 moko 512:
513: /* Set pointer to private data */
514: CINIT(PRIVATE, OBJECTPOINT, 103),
515:
516: /* Set aliases for HTTP 200 in the HTTP Response header */
517: CINIT(HTTP200ALIASES, OBJECTPOINT, 104),
518:
519: /* Continue to send authentication (user+password) when following locations,
520: even when hostname changed. This can potentially send off the name
521: and password to whatever host the server decides. */
522: CINIT(UNRESTRICTED_AUTH, LONG, 105),
523:
524: /* Specifically switch on or off the FTP engine's use of the EPRT command ( it
525: also disables the LPRT attempt). By default, those ones will always be
526: attempted before the good old traditional PORT command. */
527: CINIT(FTP_USE_EPRT, LONG, 106),
528:
529: /* Set this to a bitmask value to enable the particular authentications
530: methods you like. Use this in combination with CURLOPT_USERPWD.
531: Note that setting multiple bits may cause extra network round-trips. */
532: CINIT(HTTPAUTH, LONG, 107),
533:
534: /* Set the ssl context callback function, currently only for OpenSSL ssl_ctx
535: in second argument. The function must be matching the
536: curl_ssl_ctx_callback proto. */
537: CINIT(SSL_CTX_FUNCTION, FUNCTIONPOINT, 108),
538:
539: /* Set the userdata for the ssl context callback function's third
540: argument */
541: CINIT(SSL_CTX_DATA, OBJECTPOINT, 109),
542:
543: /* FTP Option that causes missing dirs to be created on the remote server.
544: In 7.19.4 we introduced the convenience enums for this option using the
545: CURLFTP_CREATE_DIR prefix.
546: */
547: CINIT(FTP_CREATE_MISSING_DIRS, LONG, 110),
548:
549: /* Set this to a bitmask value to enable the particular authentications
550: methods you like. Use this in combination with CURLOPT_PROXYUSERPWD.
551: Note that setting multiple bits may cause extra network round-trips. */
552: CINIT(PROXYAUTH, LONG, 111),
553:
554: /* FTP option that changes the timeout, in seconds, associated with
555: getting a response. This is different from transfer timeout time and
556: essentially places a demand on the FTP server to acknowledge commands
557: in a timely manner. */
558: CINIT(FTP_RESPONSE_TIMEOUT, LONG, 112),
559:
560: /* Set this option to one of the CURL_IPRESOLVE_* defines (see below) to
561: tell libcurl to resolve names to those IP versions only. This only has
562: affect on systems with support for more than one, i.e IPv4 _and_ IPv6. */
563: CINIT(IPRESOLVE, LONG, 113),
564:
565: /* Set this option to limit the size of a file that will be downloaded from
566: an HTTP or FTP server.
567:
568: Note there is also _LARGE version which adds large file support for
569: platforms which have larger off_t sizes. See MAXFILESIZE_LARGE below. */
570: CINIT(MAXFILESIZE, LONG, 114),
571:
572: /* See the comment for INFILESIZE above, but in short, specifies
573: * the size of the file being uploaded. -1 means unknown.
574: */
575: CINIT(INFILESIZE_LARGE, OFF_T, 115),
576:
577: /* Sets the continuation offset. There is also a LONG version of this;
578: * look above for RESUME_FROM.
579: */
580: CINIT(RESUME_FROM_LARGE, OFF_T, 116),
581:
582: /* Sets the maximum size of data that will be downloaded from
583: * an HTTP or FTP server. See MAXFILESIZE above for the LONG version.
584: */
585: CINIT(MAXFILESIZE_LARGE, OFF_T, 117),
586:
587: /* Set this option to the file name of your .netrc file you want libcurl
588: to parse (using the CURLOPT_NETRC option). If not set, libcurl will do
589: a poor attempt to find the user's home directory and check for a .netrc
590: file in there. */
591: CINIT(NETRC_FILE, OBJECTPOINT, 118),
592:
593: /* Enable SSL/TLS for FTP, pick one of:
594: CURLFTPSSL_TRY - try using SSL, proceed anyway otherwise
595: CURLFTPSSL_CONTROL - SSL for the control connection or fail
596: CURLFTPSSL_ALL - SSL for all communication or fail
597: */
598: CINIT(USE_SSL, LONG, 119),
599:
600: /* The _LARGE version of the standard POSTFIELDSIZE option */
601: CINIT(POSTFIELDSIZE_LARGE, OFF_T, 120),
602:
603: /* Enable/disable the TCP Nagle algorithm */
604: CINIT(TCP_NODELAY, LONG, 121),
605:
606: /* 122 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
607: /* 123 OBSOLETE. Gone in 7.16.0 */
608: /* 124 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
609: /* 125 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
610: /* 126 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
611: /* 127 OBSOLETE. Gone in 7.16.0 */
612: /* 128 OBSOLETE. Gone in 7.16.0 */
613:
614: /* When FTP over SSL/TLS is selected (with CURLOPT_USE_SSL), this option
615: can be used to change libcurl's default action which is to first try
616: "AUTH SSL" and then "AUTH TLS" in this order, and proceed when a OK
617: response has been received.
618:
619: Available parameters are:
620: CURLFTPAUTH_DEFAULT - let libcurl decide
621: CURLFTPAUTH_SSL - try "AUTH SSL" first, then TLS
622: CURLFTPAUTH_TLS - try "AUTH TLS" first, then SSL
623: */
624: CINIT(FTPSSLAUTH, LONG, 129),
625:
626: CINIT(IOCTLFUNCTION, FUNCTIONPOINT, 130),
627: CINIT(IOCTLDATA, OBJECTPOINT, 131),
628:
629: /* 132 OBSOLETE. Gone in 7.16.0 */
630: /* 133 OBSOLETE. Gone in 7.16.0 */
631:
632: /* zero terminated string for pass on to the FTP server when asked for
633: "account" info */
634: CINIT(FTP_ACCOUNT, OBJECTPOINT, 134),
635:
636: /* feed cookies into cookie engine */
637: CINIT(COOKIELIST, OBJECTPOINT, 135),
638:
639: /* ignore Content-Length */
640: CINIT(IGNORE_CONTENT_LENGTH, LONG, 136),
641:
642: /* Set to non-zero to skip the IP address received in a 227 PASV FTP server
643: response. Typically used for FTP-SSL purposes but is not restricted to
644: that. libcurl will then instead use the same IP address it used for the
645: control connection. */
646: CINIT(FTP_SKIP_PASV_IP, LONG, 137),
647:
648: /* Select "file method" to use when doing FTP, see the curl_ftpmethod
649: above. */
650: CINIT(FTP_FILEMETHOD, LONG, 138),
651:
652: /* Local port number to bind the socket to */
653: CINIT(LOCALPORT, LONG, 139),
654:
655: /* Number of ports to try, including the first one set with LOCALPORT.
656: Thus, setting it to 1 will make no additional attempts but the first.
657: */
658: CINIT(LOCALPORTRANGE, LONG, 140),
659:
660: /* no transfer, set up connection and let application use the socket by
661: extracting it with CURLINFO_LASTSOCKET */
662: CINIT(CONNECT_ONLY, LONG, 141),
663:
664: /* Function that will be called to convert from the
665: network encoding (instead of using the iconv calls in libcurl) */
666: CINIT(CONV_FROM_NETWORK_FUNCTION, FUNCTIONPOINT, 142),
667:
668: /* Function that will be called to convert to the
669: network encoding (instead of using the iconv calls in libcurl) */
670: CINIT(CONV_TO_NETWORK_FUNCTION, FUNCTIONPOINT, 143),
671:
672: /* Function that will be called to convert from UTF8
673: (instead of using the iconv calls in libcurl)
674: Note that this is used only for SSL certificate processing */
675: CINIT(CONV_FROM_UTF8_FUNCTION, FUNCTIONPOINT, 144),
676:
677: /* if the connection proceeds too quickly then need to slow it down */
678: /* limit-rate: maximum number of bytes per second to send or receive */
679: CINIT(MAX_SEND_SPEED_LARGE, OFF_T, 145),
680: CINIT(MAX_RECV_SPEED_LARGE, OFF_T, 146),
681:
682: /* Pointer to command string to send if USER/PASS fails. */
683: CINIT(FTP_ALTERNATIVE_TO_USER, OBJECTPOINT, 147),
684:
685: /* callback function for setting socket options */
686: CINIT(SOCKOPTFUNCTION, FUNCTIONPOINT, 148),
687: CINIT(SOCKOPTDATA, OBJECTPOINT, 149),
688:
689: /* set to 0 to disable session ID re-use for this transfer, default is
690: enabled (== 1) */
691: CINIT(SSL_SESSIONID_CACHE, LONG, 150),
692:
693: /* allowed SSH authentication methods */
694: CINIT(SSH_AUTH_TYPES, LONG, 151),
695:
696: /* Used by scp/sftp to do public/private key authentication */
697: CINIT(SSH_PUBLIC_KEYFILE, OBJECTPOINT, 152),
698: CINIT(SSH_PRIVATE_KEYFILE, OBJECTPOINT, 153),
699:
700: /* Send CCC (Clear Command Channel) after authentication */
701: CINIT(FTP_SSL_CCC, LONG, 154),
702:
703: /* Same as TIMEOUT and CONNECTTIMEOUT, but with ms resolution */
704: CINIT(TIMEOUT_MS, LONG, 155),
705: CINIT(CONNECTTIMEOUT_MS, LONG, 156),
706:
707: /* set to zero to disable the libcurl's decoding and thus pass the raw body
708: data to the application even when it is encoded/compressed */
709: CINIT(HTTP_TRANSFER_DECODING, LONG, 157),
710: CINIT(HTTP_CONTENT_DECODING, LONG, 158),
711:
712: /* Permission used when creating new files and directories on the remote
713: server for protocols that support it, SFTP/SCP/FILE */
714: CINIT(NEW_FILE_PERMS, LONG, 159),
715: CINIT(NEW_DIRECTORY_PERMS, LONG, 160),
716:
717: /* Set the behaviour of POST when redirecting. Values must be set to one
718: of CURL_REDIR* defines below. This used to be called CURLOPT_POST301 */
719: CINIT(POSTREDIR, LONG, 161),
720:
721: /* used by scp/sftp to verify the host's public key */
722: CINIT(SSH_HOST_PUBLIC_KEY_MD5, OBJECTPOINT, 162),
723:
724: /* Callback function for opening socket (instead of socket(2)). Optionally,
725: callback is able change the address or refuse to connect returning
726: CURL_SOCKET_BAD. The callback should have type
727: curl_opensocket_callback */
728: CINIT(OPENSOCKETFUNCTION, FUNCTIONPOINT, 163),
729: CINIT(OPENSOCKETDATA, OBJECTPOINT, 164),
730:
731: /* POST volatile input fields. */
732: CINIT(COPYPOSTFIELDS, OBJECTPOINT, 165),
733:
734: /* set transfer mode (;type=<a|i>) when doing FTP via an HTTP proxy */
735: CINIT(PROXY_TRANSFER_MODE, LONG, 166),
736:
737: /* Callback function for seeking in the input stream */
738: CINIT(SEEKFUNCTION, FUNCTIONPOINT, 167),
739: CINIT(SEEKDATA, OBJECTPOINT, 168),
740:
741: /* CRL file */
742: CINIT(CRLFILE, OBJECTPOINT, 169),
743:
744: /* Issuer certificate */
745: CINIT(ISSUERCERT, OBJECTPOINT, 170),
746:
747: /* (IPv6) Address scope */
748: CINIT(ADDRESS_SCOPE, LONG, 171),
749:
750: /* Collect certificate chain info and allow it to get retrievable with
751: CURLINFO_CERTINFO after the transfer is complete. (Unfortunately) only
752: working with OpenSSL-powered builds. */
753: CINIT(CERTINFO, LONG, 172),
754:
755: /* "name" and "pwd" to use when fetching. */
756: CINIT(USERNAME, OBJECTPOINT, 173),
757: CINIT(PASSWORD, OBJECTPOINT, 174),
758:
759: /* "name" and "pwd" to use with Proxy when fetching. */
760: CINIT(PROXYUSERNAME, OBJECTPOINT, 175),
761: CINIT(PROXYPASSWORD, OBJECTPOINT, 176),
762:
763: /* Comma separated list of hostnames defining no-proxy zones. These should
764: match both hostnames directly, and hostnames within a domain. For
765: example, local.com will match local.com and www.local.com, but NOT
766: notlocal.com or www.notlocal.com. For compatibility with other
767: implementations of this, .local.com will be considered to be the same as
768: local.com. A single * is the only valid wildcard, and effectively
769: disables the use of proxy. */
770: CINIT(NOPROXY, OBJECTPOINT, 177),
771:
772: /* block size for TFTP transfers */
773: CINIT(TFTP_BLKSIZE, LONG, 178),
774:
775: /* Socks Service */
776: CINIT(SOCKS5_GSSAPI_SERVICE, OBJECTPOINT, 179),
777:
778: /* Socks Service */
779: CINIT(SOCKS5_GSSAPI_NEC, LONG, 180),
780:
781: /* set the bitmask for the protocols that are allowed to be used for the
782: transfer, which thus helps the app which takes URLs from users or other
783: external inputs and want to restrict what protocol(s) to deal
784: with. Defaults to CURLPROTO_ALL. */
785: CINIT(PROTOCOLS, LONG, 181),
786:
787: /* set the bitmask for the protocols that libcurl is allowed to follow to,
788: as a subset of the CURLOPT_PROTOCOLS ones. That means the protocol needs
789: to be set in both bitmasks to be allowed to get redirected to. Defaults
790: to all protocols except FILE and SCP. */
791: CINIT(REDIR_PROTOCOLS, LONG, 182),
792:
793: /* set the SSH knownhost file name to use */
794: CINIT(SSH_KNOWNHOSTS, OBJECTPOINT, 183),
795:
796: /* set the SSH host key callback, must point to a curl_sshkeycallback
797: function */
798: CINIT(SSH_KEYFUNCTION, FUNCTIONPOINT, 184),
799:
800: /* set the SSH host key callback custom pointer */
801: CINIT(SSH_KEYDATA, OBJECTPOINT, 185),
802:
1.7 ! moko 803: /* linked-list of host:port:address entries to populate the DNS cache with,
! 804: bypassing the resolver (added in 7.21.3) */
! 805: CINIT(RESOLVE, OBJECTPOINT, 203),
! 806:
1.2 moko 807: CURLOPT_LASTENTRY /* the last unused */
808: } CURLoption;
809:
1.3 moko 810: /* compatibility with older names */
811: #define CURLOPT_ENCODING CURLOPT_ACCEPT_ENCODING
812:
813: /* three convenient "aliases" that follow the name scheme better */
1.2 moko 814: #define CURLOPT_WRITEDATA CURLOPT_FILE
815: #define CURLOPT_READDATA CURLOPT_INFILE
816: #define CURLOPT_HEADERDATA CURLOPT_WRITEHEADER
817:
818: #define CFINIT(name) CURLFORM_ ## name
819:
820: typedef enum {
821: CFINIT(NOTHING), /********* the first one is unused ************/
822:
823: /* */
824: CFINIT(COPYNAME),
825: CFINIT(PTRNAME),
826: CFINIT(NAMELENGTH),
827: CFINIT(COPYCONTENTS),
828: CFINIT(PTRCONTENTS),
829: CFINIT(CONTENTSLENGTH),
830: CFINIT(FILECONTENT),
831: CFINIT(ARRAY),
832: CFINIT(OBSOLETE),
833: CFINIT(FILE),
834:
835: CFINIT(BUFFER),
836: CFINIT(BUFFERPTR),
837: CFINIT(BUFFERLENGTH),
838:
839: CFINIT(CONTENTTYPE),
840: CFINIT(CONTENTHEADER),
841: CFINIT(FILENAME),
842: CFINIT(END),
843: CFINIT(OBSOLETE2),
844:
845: CFINIT(STREAM),
846:
847: CURLFORM_LASTENTRY /* the last unused */
848: } CURLformoption;
849:
850: #define CURLINFO_STRING 0x100000
851: #define CURLINFO_LONG 0x200000
852: #define CURLINFO_DOUBLE 0x300000
853: #define CURLINFO_SLIST 0x400000
1.5 moko 854: #define CURLINFO_PTR 0x400000 /* same as SLIST */
855: #define CURLINFO_SOCKET 0x500000
856: #define CURLINFO_OFF_T 0x600000
1.2 moko 857: #define CURLINFO_MASK 0x0fffff
858: #define CURLINFO_TYPEMASK 0xf00000
859:
860: typedef enum {
1.5 moko 861: CURLINFO_NONE, /* first, never use this */
862: CURLINFO_EFFECTIVE_URL = CURLINFO_STRING + 1,
863: CURLINFO_RESPONSE_CODE = CURLINFO_LONG + 2,
864: CURLINFO_TOTAL_TIME = CURLINFO_DOUBLE + 3,
865: CURLINFO_NAMELOOKUP_TIME = CURLINFO_DOUBLE + 4,
866: CURLINFO_CONNECT_TIME = CURLINFO_DOUBLE + 5,
867: CURLINFO_PRETRANSFER_TIME = CURLINFO_DOUBLE + 6,
868: CURLINFO_SIZE_UPLOAD = CURLINFO_DOUBLE + 7,
869: CURLINFO_SIZE_DOWNLOAD = CURLINFO_DOUBLE + 8,
870: CURLINFO_SPEED_DOWNLOAD = CURLINFO_DOUBLE + 9,
871: CURLINFO_SPEED_UPLOAD = CURLINFO_DOUBLE + 10,
872: CURLINFO_HEADER_SIZE = CURLINFO_LONG + 11,
873: CURLINFO_REQUEST_SIZE = CURLINFO_LONG + 12,
874: CURLINFO_SSL_VERIFYRESULT = CURLINFO_LONG + 13,
875: CURLINFO_FILETIME = CURLINFO_LONG + 14,
876: CURLINFO_CONTENT_LENGTH_DOWNLOAD = CURLINFO_DOUBLE + 15,
877: CURLINFO_CONTENT_LENGTH_UPLOAD = CURLINFO_DOUBLE + 16,
878: CURLINFO_STARTTRANSFER_TIME = CURLINFO_DOUBLE + 17,
879: CURLINFO_CONTENT_TYPE = CURLINFO_STRING + 18,
880: CURLINFO_REDIRECT_TIME = CURLINFO_DOUBLE + 19,
881: CURLINFO_REDIRECT_COUNT = CURLINFO_LONG + 20,
882: CURLINFO_PRIVATE = CURLINFO_STRING + 21,
883: CURLINFO_HTTP_CONNECTCODE = CURLINFO_LONG + 22,
884: CURLINFO_HTTPAUTH_AVAIL = CURLINFO_LONG + 23,
885: CURLINFO_PROXYAUTH_AVAIL = CURLINFO_LONG + 24,
886: CURLINFO_OS_ERRNO = CURLINFO_LONG + 25,
887: CURLINFO_NUM_CONNECTS = CURLINFO_LONG + 26,
888: CURLINFO_SSL_ENGINES = CURLINFO_SLIST + 27,
889: CURLINFO_COOKIELIST = CURLINFO_SLIST + 28,
890: CURLINFO_LASTSOCKET = CURLINFO_LONG + 29,
891: CURLINFO_FTP_ENTRY_PATH = CURLINFO_STRING + 30,
892: CURLINFO_REDIRECT_URL = CURLINFO_STRING + 31,
893: CURLINFO_PRIMARY_IP = CURLINFO_STRING + 32,
894: CURLINFO_APPCONNECT_TIME = CURLINFO_DOUBLE + 33,
895: CURLINFO_CERTINFO = CURLINFO_SLIST + 34,
896: CURLINFO_CONDITION_UNMET = CURLINFO_LONG + 35,
897: CURLINFO_RTSP_SESSION_ID = CURLINFO_STRING + 36,
898: CURLINFO_RTSP_CLIENT_CSEQ = CURLINFO_LONG + 37,
899: CURLINFO_RTSP_SERVER_CSEQ = CURLINFO_LONG + 38,
900: CURLINFO_RTSP_CSEQ_RECV = CURLINFO_LONG + 39,
901: CURLINFO_PRIMARY_PORT = CURLINFO_LONG + 40,
902: CURLINFO_LOCAL_IP = CURLINFO_STRING + 41,
903: CURLINFO_LOCAL_PORT = CURLINFO_LONG + 42,
904: CURLINFO_TLS_SESSION = CURLINFO_PTR + 43,
905: CURLINFO_ACTIVESOCKET = CURLINFO_SOCKET + 44,
906: CURLINFO_TLS_SSL_PTR = CURLINFO_PTR + 45,
907: CURLINFO_HTTP_VERSION = CURLINFO_LONG + 46,
908: CURLINFO_PROXY_SSL_VERIFYRESULT = CURLINFO_LONG + 47,
909: CURLINFO_PROTOCOL = CURLINFO_LONG + 48,
910: CURLINFO_SCHEME = CURLINFO_STRING + 49,
1.2 moko 911: /* Fill in new entries below here! */
912:
1.5 moko 913: CURLINFO_LASTONE = 49
1.2 moko 914: } CURLINFO;
915:
1.4 moko 916: #define CURL_IPRESOLVE_WHATEVER 0 /* default, resolves addresses to all IP versions that your system allows */
917: #define CURL_IPRESOLVE_V4 1 /* resolve to ipv4 addresses */
918: #define CURL_IPRESOLVE_V6 2 /* resolve to ipv6 addresses */
919:
1.2 moko 920:
921: typedef enum {
922: CURL_FORMADD_OK, /* first, no error */
923:
924: CURL_FORMADD_MEMORY,
925: CURL_FORMADD_OPTION_TWICE,
926: CURL_FORMADD_NULL,
927: CURL_FORMADD_UNKNOWN_OPTION,
928: CURL_FORMADD_INCOMPLETE,
929: CURL_FORMADD_ILLEGAL_ARRAY,
930: CURL_FORMADD_DISABLED, /* libcurl was built with this disabled */
931:
932: CURL_FORMADD_LAST /* last */
933: } CURLFORMcode;
934:
1.5 moko 935:
936: enum {
937: CURL_HTTP_VERSION_NONE, /* setting this means we don't care, and that we'd
938: like the library to choose the best possible for us! */
939: CURL_HTTP_VERSION_1_0, /* please use HTTP 1.0 in the request */
940: CURL_HTTP_VERSION_1_1, /* please use HTTP 1.1 in the request */
941: CURL_HTTP_VERSION_2_0, /* please use HTTP 2 in the request */
942: CURL_HTTP_VERSION_2TLS, /* use version 2 for HTTPS, version 1.1 for HTTP */
943: CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE, /* please use HTTP 2 without HTTP/1.1 Upgrade */
944:
945: CURL_HTTP_VERSION_LAST /* *ILLEGAL* http version */
946: };
947:
948: /* Convenience definition simple because the name of the version is HTTP/2 and
949: not 2.0. The 2_0 version of the enum name was set while the version was
950: still planned to be 2.0 and we stick to it for compatibility. */
951: #define CURL_HTTP_VERSION_2 CURL_HTTP_VERSION_2_0
952:
1.2 moko 953: #endif /* __CURL_CURL_H */
E-mail: