/etc/c/curl.d

http://github.com/jcd/phobos · D · 2306 lines · 1012 code · 180 blank · 1114 comment · 0 complexity · 30b3973ffc184904c206be3002a53b08 MD5 · raw file

Large files are truncated click here to view the full file

  1. /**
  2. This is an interface to the libcurl library.
  3. Converted to D from curl headers by $(LINK2 http://www.digitalmars.com/d/2.0/htod.html, htod) and
  4. cleaned up by Jonas Drewsen (jdrewsen)
  5. */
  6. /* **************************************************************************
  7. * _ _ ____ _
  8. * Project ___| | | | _ \| |
  9. * / __| | | | |_) | |
  10. * | (__| |_| | _ <| |___
  11. * \___|\___/|_| \_\_____|
  12. */
  13. /**
  14. * Copyright (C) 1998 - 2010, Daniel Stenberg, &lt;daniel@haxx.se&gt;, et al.
  15. *
  16. * This software is licensed as described in the file COPYING, which
  17. * you should have received as part of this distribution. The terms
  18. * are also available at $(LINK http://curl.haxx.se/docs/copyright.html).
  19. *
  20. * You may opt to use, copy, modify, merge, publish, distribute and/or sell
  21. * copies of the Software, and permit persons to whom the Software is
  22. * furnished to do so, under the terms of the COPYING file.
  23. *
  24. * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  25. * KIND, either express or implied.
  26. *
  27. ***************************************************************************/
  28. module etc.c.curl;
  29. version (Windows) pragma(lib, "curl");
  30. import core.stdc.time;
  31. import core.stdc.config;
  32. import std.socket;
  33. // linux
  34. import core.sys.posix.sys.socket;
  35. //
  36. // LICENSE FROM CURL HEADERS
  37. //
  38. /** This is the global package copyright */
  39. enum LIBCURL_COPYRIGHT = "1996 - 2010 Daniel Stenberg, <daniel@haxx.se>.";
  40. /** This is the version number of the libcurl package from which this header
  41. file origins: */
  42. enum LIBCURL_VERSION = "7.21.4";
  43. /** The numeric version number is also available "in parts" by using these
  44. constants */
  45. enum LIBCURL_VERSION_MAJOR = 7;
  46. /// ditto
  47. enum LIBCURL_VERSION_MINOR = 21;
  48. /// ditto
  49. enum LIBCURL_VERSION_PATCH = 4;
  50. /** This is the numeric version of the libcurl version number, meant for easier
  51. parsing and comparions by programs. The LIBCURL_VERSION_NUM define will
  52. always follow this syntax:
  53. 0xXXYYZZ
  54. Where XX, YY and ZZ are the main version, release and patch numbers in
  55. hexadecimal (using 8 bits each). All three numbers are always represented
  56. using two digits. 1.2 would appear as "0x010200" while version 9.11.7
  57. appears as "0x090b07".
  58. This 6-digit (24 bits) hexadecimal number does not show pre-release number,
  59. and it is always a greater number in a more recent release. It makes
  60. comparisons with greater than and less than work.
  61. */
  62. enum LIBCURL_VERSION_NUM = 0x071504;
  63. /**
  64. * This is the date and time when the full source package was created. The
  65. * timestamp is not stored in git, as the timestamp is properly set in the
  66. * tarballs by the maketgz script.
  67. *
  68. * The format of the date should follow this template:
  69. *
  70. * "Mon Feb 12 11:35:33 UTC 2007"
  71. */
  72. enum LIBCURL_TIMESTAMP = "Thu Feb 17 12:19:40 UTC 2011";
  73. /** Data type definition of curl_off_t. */
  74. /// jdrewsen - Always 64bit signed and that is what long is in D.
  75. /// Comment below is from curlbuild.h:
  76. /**
  77. * NOTE 2:
  78. *
  79. * For any given platform/compiler curl_off_t must be typedef'ed to a
  80. * 64-bit wide signed integral data type. The width of this data type
  81. * must remain constant and independent of any possible large file
  82. * support settings.
  83. *
  84. * As an exception to the above, curl_off_t shall be typedef'ed to a
  85. * 32-bit wide signed integral data type if there is no 64-bit type.
  86. */
  87. alias long curl_off_t;
  88. ///
  89. alias void CURL;
  90. /// jdrewsen - Get socket alias from std.socket
  91. alias socket_t curl_socket_t;
  92. /// jdrewsen - Would like to get socket error constant from std.socket by it is private atm.
  93. version(Windows) {
  94. private import std.c.windows.windows, std.c.windows.winsock;
  95. enum CURL_SOCKET_BAD = SOCKET_ERROR;
  96. }
  97. version(Posix) enum CURL_SOCKET_BAD = -1;
  98. ///
  99. extern (C) struct curl_httppost
  100. {
  101. curl_httppost *next; /** next entry in the list */
  102. char *name; /** pointer to allocated name */
  103. c_long namelength; /** length of name length */
  104. char *contents; /** pointer to allocated data contents */
  105. c_long contentslength; /** length of contents field */
  106. char *buffer; /** pointer to allocated buffer contents */
  107. c_long bufferlength; /** length of buffer field */
  108. char *contenttype; /** Content-Type */
  109. curl_slist *contentheader; /** list of extra headers for this form */
  110. curl_httppost *more; /** if one field name has more than one
  111. file, this link should link to following
  112. files */
  113. c_long flags; /** as defined below */
  114. char *showfilename; /** The file name to show. If not set, the
  115. actual file name will be used (if this
  116. is a file part) */
  117. void *userp; /** custom pointer used for
  118. HTTPPOST_CALLBACK posts */
  119. }
  120. enum HTTPPOST_FILENAME = 1; /** specified content is a file name */
  121. enum HTTPPOST_READFILE = 2; /** specified content is a file name */
  122. enum HTTPPOST_PTRNAME = 4; /** name is only stored pointer
  123. do not free in formfree */
  124. enum HTTPPOST_PTRCONTENTS = 8; /** contents is only stored pointer
  125. do not free in formfree */
  126. enum HTTPPOST_BUFFER = 16; /** upload file from buffer */
  127. enum HTTPPOST_PTRBUFFER = 32; /** upload file from pointer contents */
  128. enum HTTPPOST_CALLBACK = 64; /** upload file contents by using the
  129. regular read callback to get the data
  130. and pass the given pointer as custom
  131. pointer */
  132. ///
  133. alias int function(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow) curl_progress_callback;
  134. /** Tests have proven that 20K is a very bad buffer size for uploads on
  135. Windows, while 16K for some odd reason performed a lot better.
  136. We do the ifndef check to allow this value to easier be changed at build
  137. time for those who feel adventurous. The practical minimum is about
  138. 400 bytes since libcurl uses a buffer of this size as a scratch area
  139. (unrelated to network send operations). */
  140. enum CURL_MAX_WRITE_SIZE = 16384;
  141. /** The only reason to have a max limit for this is to avoid the risk of a bad
  142. server feeding libcurl with a never-ending header that will cause reallocs
  143. infinitely */
  144. enum CURL_MAX_HTTP_HEADER = (100*1024);
  145. /** This is a magic return code for the write callback that, when returned,
  146. will signal libcurl to pause receiving on the current transfer. */
  147. enum CURL_WRITEFUNC_PAUSE = 0x10000001;
  148. ///
  149. alias size_t function(char *buffer, size_t size, size_t nitems, void *outstream)curl_write_callback;
  150. /** enumeration of file types */
  151. enum CurlFileType {
  152. file, ///
  153. directory, ///
  154. symlink, ///
  155. device_block, ///
  156. device_char, ///
  157. namedpipe, ///
  158. socket, ///
  159. door, ///
  160. unknown /** is possible only on Sun Solaris now */
  161. }
  162. ///
  163. alias int curlfiletype;
  164. ///
  165. enum CurlFInfoFlagKnown {
  166. filename = 1, ///
  167. filetype = 2, ///
  168. time = 4, ///
  169. perm = 8, ///
  170. uid = 16, ///
  171. gid = 32, ///
  172. size = 64, ///
  173. hlinkcount = 128 ///
  174. }
  175. /** Content of this structure depends on information which is known and is
  176. achievable (e.g. by FTP LIST parsing). Please see the url_easy_setopt(3) man
  177. page for callbacks returning this structure -- some fields are mandatory,
  178. some others are optional. The FLAG field has special meaning. */
  179. /** If some of these fields is not NULL, it is a pointer to b_data. */
  180. extern (C) struct _N2
  181. {
  182. char *time; ///
  183. char *perm; ///
  184. char *user; ///
  185. char *group; ///
  186. char *target; /** pointer to the target filename of a symlink */
  187. }
  188. /** Content of this structure depends on information which is known and is
  189. achievable (e.g. by FTP LIST parsing). Please see the url_easy_setopt(3) man
  190. page for callbacks returning this structure -- some fields are mandatory,
  191. some others are optional. The FLAG field has special meaning. */
  192. extern (C) struct curl_fileinfo
  193. {
  194. char *filename; ///
  195. curlfiletype filetype; ///
  196. time_t time; ///
  197. uint perm; ///
  198. int uid; ///
  199. int gid; ///
  200. curl_off_t size; ///
  201. c_long hardlinks; ///
  202. _N2 strings; ///
  203. uint flags; ///
  204. char *b_data; ///
  205. size_t b_size; ///
  206. size_t b_used; ///
  207. }
  208. /** return codes for CURLOPT_CHUNK_BGN_FUNCTION */
  209. enum CurlChunkBgnFunc {
  210. ok = 0, ///
  211. fail = 1, /** tell the lib to end the task */
  212. skip = 2 /** skip this chunk over */
  213. }
  214. /** if splitting of data transfer is enabled, this callback is called before
  215. download of an individual chunk started. Note that parameter "remains" works
  216. only for FTP wildcard downloading (for now), otherwise is not used */
  217. alias c_long function(void *transfer_info, void *ptr, int remains)curl_chunk_bgn_callback;
  218. /** return codes for CURLOPT_CHUNK_END_FUNCTION */
  219. enum CurlChunkEndFunc {
  220. ok = 0, ///
  221. fail = 1, ///
  222. }
  223. /** If splitting of data transfer is enabled this callback is called after
  224. download of an individual chunk finished.
  225. Note! After this callback was set then it have to be called FOR ALL chunks.
  226. Even if downloading of this chunk was skipped in CHUNK_BGN_FUNC.
  227. This is the reason why we don't need "transfer_info" parameter in this
  228. callback and we are not interested in "remains" parameter too. */
  229. alias c_long function(void *ptr)curl_chunk_end_callback;
  230. /** return codes for FNMATCHFUNCTION */
  231. enum CurlFnMAtchFunc {
  232. match = 0, ///
  233. nomatch = 1, ///
  234. fail = 2 ///
  235. }
  236. /** callback type for wildcard downloading pattern matching. If the
  237. string matches the pattern, return CURL_FNMATCHFUNC_MATCH value, etc. */
  238. alias int function(void *ptr, char *pattern, char *string)curl_fnmatch_callback;
  239. /// seek whence...
  240. enum CurlSeekPos {
  241. set, ///
  242. current, ///
  243. end ///
  244. }
  245. /** These are the return codes for the seek callbacks */
  246. enum CurlSeek {
  247. ok, ///
  248. fail, /** fail the entire transfer */
  249. cantseek /** tell libcurl seeking can't be done, so
  250. libcurl might try other means instead */
  251. }
  252. ///
  253. alias int function(void *instream, curl_off_t offset, int origin)curl_seek_callback;
  254. ///
  255. enum CurlReadFunc {
  256. /** This is a return code for the read callback that, when returned, will
  257. signal libcurl to immediately abort the current transfer. */
  258. abort = 0x10000000,
  259. /** This is a return code for the read callback that, when returned,
  260. will const signal libcurl to pause sending data on the current
  261. transfer. */
  262. pause = 0x10000001
  263. }
  264. ///
  265. alias size_t function(char *buffer, size_t size, size_t nitems, void *instream)curl_read_callback;
  266. ///
  267. enum CurlSockType {
  268. ipcxn, /** socket created for a specific IP connection */
  269. last /** never use */
  270. }
  271. ///
  272. alias int curlsocktype;
  273. ///
  274. alias int function(void *clientp, curl_socket_t curlfd, curlsocktype purpose)curl_sockopt_callback;
  275. /** addrlen was a socklen_t type before 7.18.0 but it turned really
  276. ugly and painful on the systems that lack this type */
  277. extern (C) struct curl_sockaddr
  278. {
  279. int family; ///
  280. int socktype; ///
  281. int protocol; ///
  282. uint addrlen; /** addrlen was a socklen_t type before 7.18.0 but it
  283. turned really ugly and painful on the systems that
  284. lack this type */
  285. sockaddr addr; ///
  286. }
  287. ///
  288. alias curl_socket_t function(void *clientp, curlsocktype purpose, curl_sockaddr *address)curl_opensocket_callback;
  289. ///
  290. enum CurlIoError
  291. {
  292. ok, /** I/O operation successful */
  293. unknowncmd, /** command was unknown to callback */
  294. failrestart, /** failed to restart the read */
  295. last /** never use */
  296. }
  297. ///
  298. alias int curlioerr;
  299. ///
  300. enum CurlIoCmd {
  301. nop, /** command was unknown to callback */
  302. restartread, /** failed to restart the read */
  303. last, /** never use */
  304. }
  305. ///
  306. alias int curliocmd;
  307. ///
  308. alias curlioerr function(CURL *handle, int cmd, void *clientp)curl_ioctl_callback;
  309. /**
  310. * The following typedef's are signatures of malloc, free, realloc, strdup and
  311. * calloc respectively. Function pointers of these types can be passed to the
  312. * curl_global_init_mem() function to set user defined memory management
  313. * callback routines.
  314. */
  315. alias void * function(size_t size)curl_malloc_callback;
  316. /// ditto
  317. alias void function(void *ptr)curl_free_callback;
  318. /// ditto
  319. alias void * function(void *ptr, size_t size)curl_realloc_callback;
  320. /// ditto
  321. alias char * function(char *str)curl_strdup_callback;
  322. /// ditto
  323. alias void * function(size_t nmemb, size_t size)curl_calloc_callback;
  324. /** the kind of data that is passed to information_callback*/
  325. enum CurlCallbackInfo {
  326. text, ///
  327. header_in, ///
  328. header_out, ///
  329. data_in, ///
  330. data_out, ///
  331. ssl_data_in, ///
  332. ssl_data_out, ///
  333. end ///
  334. }
  335. ///
  336. alias int curl_infotype;
  337. ///
  338. alias int function(CURL *handle, /** the handle/transfer this concerns */
  339. curl_infotype type, /** what kind of data */
  340. char *data, /** points to the data */
  341. size_t size, /** size of the data pointed to */
  342. void *userptr /** whatever the user please */
  343. )curl_debug_callback;
  344. /** All possible error codes from all sorts of curl functions. Future versions
  345. may return other values, stay prepared.
  346. Always add new return codes last. Never *EVER* remove any. The return
  347. codes must remain the same!
  348. */
  349. enum CurlError
  350. {
  351. ok, ///
  352. unsupported_protocol, /** 1 */
  353. failed_init, /** 2 */
  354. url_malformat, /** 3 */
  355. obsolete4, /** 4 - NOT USED */
  356. couldnt_resolve_proxy, /** 5 */
  357. couldnt_resolve_host, /** 6 */
  358. couldnt_connect, /** 7 */
  359. ftp_weird_server_reply, /** 8 */
  360. remote_access_denied, /** 9 a service was denied by the server
  361. due to lack of access - when login fails
  362. this is not returned. */
  363. obsolete10, /** 10 - NOT USED */
  364. ftp_weird_pass_reply, /** 11 */
  365. obsolete12, /** 12 - NOT USED */
  366. ftp_weird_pasv_reply, /** 13 */
  367. ftp_weird_227_format, /** 14 */
  368. ftp_cant_get_host, /** 15 */
  369. obsolete16, /** 16 - NOT USED */
  370. ftp_couldnt_set_type, /** 17 */
  371. partial_file, /** 18 */
  372. ftp_couldnt_retr_file, /** 19 */
  373. obsolete20, /** 20 - NOT USED */
  374. quote_error, /** 21 - quote command failure */
  375. http_returned_error, /** 22 */
  376. write_error, /** 23 */
  377. obsolete24, /** 24 - NOT USED */
  378. upload_failed, /** 25 - failed upload "command" */
  379. read_error, /** 26 - couldn't open/read from file */
  380. out_of_memory, /** 27 */
  381. /** Note: CURLE_OUT_OF_MEMORY may sometimes indicate a conversion error
  382. instead of a memory allocation error if CURL_DOES_CONVERSIONS
  383. is defined
  384. */
  385. operation_timedout, /** 28 - the timeout time was reached */
  386. obsolete29, /** 29 - NOT USED */
  387. ftp_port_failed, /** 30 - FTP PORT operation failed */
  388. ftp_couldnt_use_rest, /** 31 - the REST command failed */
  389. obsolete32, /** 32 - NOT USED */
  390. range_error, /** 33 - RANGE "command" didn't work */
  391. http_post_error, /** 34 */
  392. ssl_connect_error, /** 35 - wrong when connecting with SSL */
  393. bad_download_resume, /** 36 - couldn't resume download */
  394. file_couldnt_read_file, /** 37 */
  395. ldap_cannot_bind, /** 38 */
  396. ldap_search_failed, /** 39 */
  397. obsolete40, /** 40 - NOT USED */
  398. function_not_found, /** 41 */
  399. aborted_by_callback, /** 42 */
  400. bad_function_argument, /** 43 */
  401. obsolete44, /** 44 - NOT USED */
  402. interface_failed, /** 45 - CURLOPT_INTERFACE failed */
  403. obsolete46, /** 46 - NOT USED */
  404. too_many_redirects, /** 47 - catch endless re-direct loops */
  405. unknown_telnet_option, /** 48 - User specified an unknown option */
  406. telnet_option_syntax, /** 49 - Malformed telnet option */
  407. obsolete50, /** 50 - NOT USED */
  408. peer_failed_verification, /** 51 - peer's certificate or fingerprint
  409. wasn't verified fine */
  410. got_nothing, /** 52 - when this is a specific error */
  411. ssl_engine_notfound, /** 53 - SSL crypto engine not found */
  412. ssl_engine_setfailed, /** 54 - can not set SSL crypto engine as default */
  413. send_error, /** 55 - failed sending network data */
  414. recv_error, /** 56 - failure in receiving network data */
  415. obsolete57, /** 57 - NOT IN USE */
  416. ssl_certproblem, /** 58 - problem with the local certificate */
  417. ssl_cipher, /** 59 - couldn't use specified cipher */
  418. ssl_cacert, /** 60 - problem with the CA cert (path?) */
  419. bad_content_encoding, /** 61 - Unrecognized transfer encoding */
  420. ldap_invalid_url, /** 62 - Invalid LDAP URL */
  421. filesize_exceeded, /** 63 - Maximum file size exceeded */
  422. use_ssl_failed, /** 64 - Requested FTP SSL level failed */
  423. send_fail_rewind, /** 65 - Sending the data requires a rewind that failed */
  424. ssl_engine_initfailed, /** 66 - failed to initialise ENGINE */
  425. login_denied, /** 67 - user, password or similar was not accepted and we failed to login */
  426. tftp_notfound, /** 68 - file not found on server */
  427. tftp_perm, /** 69 - permission problem on server */
  428. remote_disk_full, /** 70 - out of disk space on server */
  429. tftp_illegal, /** 71 - Illegal TFTP operation */
  430. tftp_unknownid, /** 72 - Unknown transfer ID */
  431. remote_file_exists, /** 73 - File already exists */
  432. tftp_nosuchuser, /** 74 - No such user */
  433. conv_failed, /** 75 - conversion failed */
  434. conv_reqd, /** 76 - caller must register conversion
  435. callbacks using curl_easy_setopt options
  436. CURLOPT_CONV_FROM_NETWORK_FUNCTION,
  437. CURLOPT_CONV_TO_NETWORK_FUNCTION, and
  438. CURLOPT_CONV_FROM_UTF8_FUNCTION */
  439. ssl_cacert_badfile, /** 77 - could not load CACERT file, missing or wrong format */
  440. remote_file_not_found, /** 78 - remote file not found */
  441. ssh, /** 79 - error from the SSH layer, somewhat
  442. generic so the error message will be of
  443. interest when this has happened */
  444. ssl_shutdown_failed, /** 80 - Failed to shut down the SSL connection */
  445. again, /** 81 - socket is not ready for send/recv,
  446. wait till it's ready and try again (Added
  447. in 7.18.2) */
  448. ssl_crl_badfile, /** 82 - could not load CRL file, missing or wrong format (Added in 7.19.0) */
  449. ssl_issuer_error, /** 83 - Issuer check failed. (Added in 7.19.0) */
  450. ftp_pret_failed, /** 84 - a PRET command failed */
  451. rtsp_cseq_error, /** 85 - mismatch of RTSP CSeq numbers */
  452. rtsp_session_error, /** 86 - mismatch of RTSP Session Identifiers */
  453. ftp_bad_file_list, /** 87 - unable to parse FTP file list */
  454. chunk_failed, /** 88 - chunk callback reported error */
  455. curl_last /** never use! */
  456. }
  457. ///
  458. alias int CURLcode;
  459. /** This prototype applies to all conversion callbacks */
  460. alias CURLcode function(char *buffer, size_t length)curl_conv_callback;
  461. /** actually an OpenSSL SSL_CTX */
  462. alias CURLcode function(CURL *curl, /** easy handle */
  463. void *ssl_ctx, /** actually an
  464. OpenSSL SSL_CTX */
  465. void *userptr
  466. )curl_ssl_ctx_callback;
  467. ///
  468. enum CurlProxy {
  469. http, /** added in 7.10, new in 7.19.4 default is to use CONNECT HTTP/1.1 */
  470. http_1_0, /** added in 7.19.4, force to use CONNECT HTTP/1.0 */
  471. socks4 = 4, /** support added in 7.15.2, enum existed already in 7.10 */
  472. socks5 = 5, /** added in 7.10 */
  473. socks4a = 6, /** added in 7.18.0 */
  474. socks5_hostname =7 /** Use the SOCKS5 protocol but pass along the
  475. host name rather than the IP address. added
  476. in 7.18.0 */
  477. }
  478. ///
  479. alias int curl_proxytype;
  480. ///
  481. enum CurlAuth : long {
  482. none = 0,
  483. basic = 1, /** Basic (default) */
  484. digest = 2, /** Digest */
  485. gssnegotiate = 4, /** GSS-Negotiate */
  486. ntlm = 8, /** NTLM */
  487. digest_ie = 16, /** Digest with IE flavour */
  488. only = 2147483648, /** used together with a single other
  489. type to force no auth or just that
  490. single type */
  491. any = -17, /* (~CURLAUTH_DIGEST_IE) */ /** all fine types set */
  492. anysafe = -18 /* (~(CURLAUTH_BASIC|CURLAUTH_DIGEST_IE)) */ ///
  493. }
  494. ///
  495. enum CurlSshAuth {
  496. any = -1, /** all types supported by the server */
  497. none = 0, /** none allowed, silly but complete */
  498. publickey = 1, /** public/private key files */
  499. password = 2, /** password */
  500. host = 4, /** host key files */
  501. keyboard = 8, /** keyboard interactive */
  502. default_ = -1 // CURLSSH_AUTH_ANY;
  503. }
  504. ///
  505. enum CURL_ERROR_SIZE = 256;
  506. /** points to a zero-terminated string encoded with base64
  507. if len is zero, otherwise to the "raw" data */
  508. enum CurlKHType
  509. {
  510. unknown, ///
  511. rsa1, ///
  512. rsa, ///
  513. dss ///
  514. }
  515. ///
  516. extern (C) struct curl_khkey
  517. {
  518. char *key; /** points to a zero-terminated string encoded with base64
  519. if len is zero, otherwise to the "raw" data */
  520. size_t len; ///
  521. CurlKHType keytype; ///
  522. }
  523. /** this is the set of return values expected from the curl_sshkeycallback
  524. callback */
  525. enum CurlKHStat {
  526. fine_add_to_file, ///
  527. fine, ///
  528. reject, /** reject the connection, return an error */
  529. defer, /** do not accept it, but we can't answer right now so
  530. this causes a CURLE_DEFER error but otherwise the
  531. connection will be left intact etc */
  532. last /** not for use, only a marker for last-in-list */
  533. }
  534. /** this is the set of status codes pass in to the callback */
  535. enum CurlKHMatch {
  536. ok, /** match */
  537. mismatch, /** host found, key mismatch! */
  538. missing, /** no matching host/key found */
  539. last /** not for use, only a marker for last-in-list */
  540. }
  541. ///
  542. alias int function(CURL *easy, /** easy handle */
  543. curl_khkey *knownkey, /** known */
  544. curl_khkey *foundkey, /** found */
  545. CurlKHMatch m, /** libcurl's view on the keys */
  546. void *clientp /** custom pointer passed from app */
  547. )curl_sshkeycallback;
  548. /** parameter for the CURLOPT_USE_SSL option */
  549. enum CurlUseSSL {
  550. none, /** do not attempt to use SSL */
  551. tryssl, /** try using SSL, proceed anyway otherwise */
  552. control, /** SSL for the control connection or fail */
  553. all, /** SSL for all communication or fail */
  554. last /** not an option, never use */
  555. }
  556. ///
  557. alias int curl_usessl;
  558. /** parameter for the CURLOPT_FTP_SSL_CCC option */
  559. enum CurlFtpSSL {
  560. ccc_none, /** do not send CCC */
  561. ccc_passive, /** Let the server initiate the shutdown */
  562. ccc_active, /** Initiate the shutdown */
  563. ccc_last /** not an option, never use */
  564. }
  565. ///
  566. alias int curl_ftpccc;
  567. /** parameter for the CURLOPT_FTPSSLAUTH option */
  568. enum CurlFtpAuth {
  569. defaultauth, /** let libcurl decide */
  570. ssl, /** use "AUTH SSL" */
  571. tls, /** use "AUTH TLS" */
  572. last /** not an option, never use */
  573. }
  574. ///
  575. alias int curl_ftpauth;
  576. /** parameter for the CURLOPT_FTP_CREATE_MISSING_DIRS option */
  577. enum CurlFtp {
  578. create_dir_none, /** do NOT create missing dirs! */
  579. create_dir, /** (FTP/SFTP) if CWD fails, try MKD and then CWD again if MKD
  580. succeeded, for SFTP this does similar magic */
  581. create_dir_retry, /** (FTP only) if CWD fails, try MKD and then CWD again even if MKD
  582. failed! */
  583. create_dir_last /** not an option, never use */
  584. }
  585. ///
  586. alias int curl_ftpcreatedir;
  587. /** parameter for the CURLOPT_FTP_FILEMETHOD option */
  588. enum CurlFtpMethod {
  589. defaultmethod, /** let libcurl pick */
  590. multicwd, /** single CWD operation for each path part */
  591. nocwd, /** no CWD at all */
  592. singlecwd, /** one CWD to full dir, then work on file */
  593. last /** not an option, never use */
  594. }
  595. ///
  596. alias int curl_ftpmethod;
  597. /** CURLPROTO_ defines are for the CURLOPT_*PROTOCOLS options */
  598. enum CurlProto {
  599. http = 1, ///
  600. https = 2, ///
  601. ftp = 4, ///
  602. ftps = 8, ///
  603. scp = 16, ///
  604. sftp = 32, ///
  605. telnet = 64, ///
  606. ldap = 128, ///
  607. ldaps = 256, ///
  608. dict = 512, ///
  609. file = 1024, ///
  610. tftp = 2048, ///
  611. imap = 4096, ///
  612. imaps = 8192, ///
  613. pop3 = 16384, ///
  614. pop3s = 32768, ///
  615. smtp = 65536, ///
  616. smtps = 131072, ///
  617. rtsp = 262144, ///
  618. rtmp = 524288, ///
  619. rtmpt = 1048576, ///
  620. rtmpe = 2097152, ///
  621. rtmpte = 4194304, ///
  622. rtmps = 8388608, ///
  623. rtmpts = 16777216, ///
  624. gopher = 33554432, ///
  625. all = -1 /** enable everything */
  626. }
  627. /** long may be 32 or 64 bits, but we should never depend on anything else
  628. but 32 */
  629. enum CURLOPTTYPE_LONG = 0;
  630. /// ditto
  631. enum CURLOPTTYPE_OBJECTPOINT = 10000;
  632. /// ditto
  633. enum CURLOPTTYPE_FUNCTIONPOINT = 20000;
  634. /// ditto
  635. enum CURLOPTTYPE_OFF_T = 30000;
  636. /** name is uppercase CURLOPT_<name>,
  637. type is one of the defined CURLOPTTYPE_<type>
  638. number is unique identifier */
  639. /** The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */
  640. alias CURLOPTTYPE_LONG LONG;
  641. /// ditto
  642. alias CURLOPTTYPE_OBJECTPOINT OBJECTPOINT;
  643. /// ditto
  644. alias CURLOPTTYPE_FUNCTIONPOINT FUNCTIONPOINT;
  645. /// ditto
  646. alias CURLOPTTYPE_OFF_T OFF_T;
  647. ///
  648. enum CurlOption {
  649. /** This is the FILE * or void * the regular output should be written to. */
  650. file = 10001,
  651. /** The full URL to get/put */
  652. url,
  653. /** Port number to connect to, if other than default. */
  654. port = 3,
  655. /** Name of proxy to use. */
  656. proxy = 10004,
  657. /** "name:password" to use when fetching. */
  658. userpwd,
  659. /** "name:password" to use with proxy. */
  660. proxyuserpwd,
  661. /** Range to get, specified as an ASCII string. */
  662. range,
  663. /** not used */
  664. /** Specified file stream to upload from (use as input): */
  665. infile = 10009,
  666. /** Buffer to receive error messages in, must be at least CURL_ERROR_SIZE
  667. * bytes big. If this is not used, error messages go to stderr instead: */
  668. errorbuffer,
  669. /** Function that will be called to store the output (instead of fwrite). The
  670. * parameters will use fwrite() syntax, make sure to follow them. */
  671. writefunction = 20011,
  672. /** Function that will be called to read the input (instead of fread). The
  673. * parameters will use fread() syntax, make sure to follow them. */
  674. readfunction,
  675. /** Time-out the read operation after this amount of seconds */
  676. timeout = 13,
  677. /** If the CURLOPT_INFILE is used, this can be used to inform libcurl about
  678. * how large the file being sent really is. That allows better error
  679. * checking and better verifies that the upload was successful. -1 means
  680. * unknown size.
  681. *
  682. * For large file support, there is also a _LARGE version of the key
  683. * which takes an off_t type, allowing platforms with larger off_t
  684. * sizes to handle larger files. See below for INFILESIZE_LARGE.
  685. */
  686. infilesize,
  687. /** POST static input fields. */
  688. postfields = 10015,
  689. /** Set the referrer page (needed by some CGIs) */
  690. referer,
  691. /** Set the FTP PORT string (interface name, named or numerical IP address)
  692. Use i.e '-' to use default address. */
  693. ftpport,
  694. /** Set the User-Agent string (examined by some CGIs) */
  695. useragent,
  696. /** If the download receives less than "low speed limit" bytes/second
  697. * during "low speed time" seconds, the operations is aborted.
  698. * You could i.e if you have a pretty high speed connection, abort if
  699. * it is less than 2000 bytes/sec during 20 seconds.
  700. */
  701. /** Set the "low speed limit" */
  702. low_speed_limit = 19,
  703. /** Set the "low speed time" */
  704. low_speed_time,
  705. /** Set the continuation offset.
  706. *
  707. * Note there is also a _LARGE version of this key which uses
  708. * off_t types, allowing for large file offsets on platforms which
  709. * use larger-than-32-bit off_t's. Look below for RESUME_FROM_LARGE.
  710. */
  711. resume_from,
  712. /** Set cookie in request: */
  713. cookie = 10022,
  714. /** This points to a linked list of headers, struct curl_slist kind */
  715. httpheader,
  716. /** This points to a linked list of post entries, struct curl_httppost */
  717. httppost,
  718. /** name of the file keeping your private SSL-certificate */
  719. sslcert,
  720. /** password for the SSL or SSH private key */
  721. keypasswd,
  722. /** send TYPE parameter? */
  723. crlf = 27,
  724. /** send linked-list of QUOTE commands */
  725. quote = 10028,
  726. /** send FILE * or void * to store headers to, if you use a callback it
  727. is simply passed to the callback unmodified */
  728. writeheader,
  729. /** point to a file to read the initial cookies from, also enables
  730. "cookie awareness" */
  731. cookiefile = 10031,
  732. /** What version to specifically try to use.
  733. See CURL_SSLVERSION defines below. */
  734. sslversion = 32,
  735. /** What kind of HTTP time condition to use, see defines */
  736. timecondition,
  737. /** Time to use with the above condition. Specified in number of seconds
  738. since 1 Jan 1970 */
  739. timevalue,
  740. /** 35 = OBSOLETE */
  741. /** Custom request, for customizing the get command like
  742. HTTP: DELETE, TRACE and others
  743. FTP: to use a different list command
  744. */
  745. customrequest = 10036,
  746. /** HTTP request, for odd commands like DELETE, TRACE and others */
  747. stderr,
  748. /** 38 is not used */
  749. /** send linked-list of post-transfer QUOTE commands */
  750. postquote = 10039,
  751. /** Pass a pointer to string of the output using full variable-replacement
  752. as described elsewhere. */
  753. writeinfo,
  754. verbose = 41, /** talk a lot */
  755. header, /** throw the header out too */
  756. noprogress, /** shut off the progress meter */
  757. nobody, /** use HEAD to get http document */
  758. failonerror, /** no output on http error codes >= 300 */
  759. upload, /** this is an upload */
  760. post, /** HTTP POST method */
  761. dirlistonly, /** return bare names when listing directories */
  762. append = 50, /** Append instead of overwrite on upload! */
  763. /** Specify whether to read the user+password from the .netrc or the URL.
  764. * This must be one of the CURL_NETRC_* enums below. */
  765. netrc,
  766. followlocation, /** use Location: Luke! */
  767. transfertext, /** transfer data in text/ASCII format */
  768. put, /** HTTP PUT */
  769. /** 55 = OBSOLETE */
  770. /** Function that will be called instead of the internal progress display
  771. * function. This function should be defined as the curl_progress_callback
  772. * prototype defines. */
  773. progressfunction = 20056,
  774. /** Data passed to the progress callback */
  775. progressdata = 10057,
  776. /** We want the referrer field set automatically when following locations */
  777. autoreferer = 58,
  778. /** Port of the proxy, can be set in the proxy string as well with:
  779. "[host]:[port]" */
  780. proxyport,
  781. /** size of the POST input data, if strlen() is not good to use */
  782. postfieldsize,
  783. /** tunnel non-http operations through a HTTP proxy */
  784. httpproxytunnel,
  785. /** Set the interface string to use as outgoing network interface */
  786. intrface = 10062,
  787. /** Set the krb4/5 security level, this also enables krb4/5 awareness. This
  788. * is a string, 'clear', 'safe', 'confidential' or 'private'. If the string
  789. * is set but doesn't match one of these, 'private' will be used. */
  790. krblevel,
  791. /** Set if we should verify the peer in ssl handshake, set 1 to verify. */
  792. ssl_verifypeer = 64,
  793. /** The CApath or CAfile used to validate the peer certificate
  794. this option is used only if SSL_VERIFYPEER is true */
  795. cainfo = 10065,
  796. /** 66 = OBSOLETE */
  797. /** 67 = OBSOLETE */
  798. /** Maximum number of http redirects to follow */
  799. maxredirs = 68,
  800. /** Pass a long set to 1 to get the date of the requested document (if
  801. possible)! Pass a zero to shut it off. */
  802. filetime,
  803. /** This points to a linked list of telnet options */
  804. telnetoptions = 10070,
  805. /** Max amount of cached alive connections */
  806. maxconnects = 71,
  807. /** What policy to use when closing connections when the cache is filled
  808. up */
  809. closepolicy,
  810. /** 73 = OBSOLETE */
  811. /** Set to explicitly use a new connection for the upcoming transfer.
  812. Do not use this unless you're absolutely sure of this, as it makes the
  813. operation slower and is less friendly for the network. */
  814. fresh_connect = 74,
  815. /** Set to explicitly forbid the upcoming transfer's connection to be re-used
  816. when done. Do not use this unless you're absolutely sure of this, as it
  817. makes the operation slower and is less friendly for the network. */
  818. forbid_reuse,
  819. /** Set to a file name that contains random data for libcurl to use to
  820. seed the random engine when doing SSL connects. */
  821. random_file = 10076,
  822. /** Set to the Entropy Gathering Daemon socket pathname */
  823. egdsocket,
  824. /** Time-out connect operations after this amount of seconds, if connects
  825. are OK within this time, then fine... This only aborts the connect
  826. phase. [Only works on unix-style/SIGALRM operating systems] */
  827. connecttimeout = 78,
  828. /** Function that will be called to store headers (instead of fwrite). The
  829. * parameters will use fwrite() syntax, make sure to follow them. */
  830. headerfunction = 20079,
  831. /** Set this to force the HTTP request to get back to GET. Only really usable
  832. if POST, PUT or a custom request have been used first.
  833. */
  834. httpget = 80,
  835. /** Set if we should verify the Common name from the peer certificate in ssl
  836. * handshake, set 1 to check existence, 2 to ensure that it matches the
  837. * provided hostname. */
  838. ssl_verifyhost,
  839. /** Specify which file name to write all known cookies in after completed
  840. operation. Set file name to "-" (dash) to make it go to stdout. */
  841. cookiejar = 10082,
  842. /** Specify which SSL ciphers to use */
  843. ssl_cipher_list,
  844. /** Specify which HTTP version to use! This must be set to one of the
  845. CURL_HTTP_VERSION* enums set below. */
  846. http_version = 84,
  847. /** Specifically switch on or off the FTP engine's use of the EPSV command. By
  848. default, that one will always be attempted before the more traditional
  849. PASV command. */
  850. ftp_use_epsv,
  851. /** type of the file keeping your SSL-certificate ("DER", "PEM", "ENG") */
  852. sslcerttype = 10086,
  853. /** name of the file keeping your private SSL-key */
  854. sslkey,
  855. /** type of the file keeping your private SSL-key ("DER", "PEM", "ENG") */
  856. sslkeytype,
  857. /** crypto engine for the SSL-sub system */
  858. sslengine,
  859. /** set the crypto engine for the SSL-sub system as default
  860. the param has no meaning...
  861. */
  862. sslengine_default = 90,
  863. /** Non-zero value means to use the global dns cache */
  864. dns_use_global_cache,
  865. /** DNS cache timeout */
  866. dns_cache_timeout,
  867. /** send linked-list of pre-transfer QUOTE commands */
  868. prequote = 10093,
  869. /** set the debug function */
  870. debugfunction = 20094,
  871. /** set the data for the debug function */
  872. debugdata = 10095,
  873. /** mark this as start of a cookie session */
  874. cookiesession = 96,
  875. /** The CApath directory used to validate the peer certificate
  876. this option is used only if SSL_VERIFYPEER is true */
  877. capath = 10097,
  878. /** Instruct libcurl to use a smaller receive buffer */
  879. buffersize = 98,
  880. /** Instruct libcurl to not use any signal/alarm handlers, even when using
  881. timeouts. This option is useful for multi-threaded applications.
  882. See libcurl-the-guide for more background information. */
  883. nosignal,
  884. /** Provide a CURLShare for mutexing non-ts data */
  885. share = 10100,
  886. /** indicates type of proxy. accepted values are CURLPROXY_HTTP (default),
  887. CURLPROXY_SOCKS4, CURLPROXY_SOCKS4A and CURLPROXY_SOCKS5. */
  888. proxytype = 101,
  889. /** Set the Accept-Encoding string. Use this to tell a server you would like
  890. the response to be compressed. */
  891. encoding = 10102,
  892. /** Set pointer to private data */
  893. private_opt,
  894. /** Set aliases for HTTP 200 in the HTTP Response header */
  895. http200aliases,
  896. /** Continue to send authentication (user+password) when following locations,
  897. even when hostname changed. This can potentially send off the name
  898. and password to whatever host the server decides. */
  899. unrestricted_auth = 105,
  900. /** Specifically switch on or off the FTP engine's use of the EPRT command ( it
  901. also disables the LPRT attempt). By default, those ones will always be
  902. attempted before the good old traditional PORT command. */
  903. ftp_use_eprt,
  904. /** Set this to a bitmask value to enable the particular authentications
  905. methods you like. Use this in combination with CURLOPT_USERPWD.
  906. Note that setting multiple bits may cause extra network round-trips. */
  907. httpauth,
  908. /** Set the ssl context callback function, currently only for OpenSSL ssl_ctx
  909. in second argument. The function must be matching the
  910. curl_ssl_ctx_callback proto. */
  911. ssl_ctx_function = 20108,
  912. /** Set the userdata for the ssl context callback function's third
  913. argument */
  914. ssl_ctx_data = 10109,
  915. /** FTP Option that causes missing dirs to be created on the remote server.
  916. In 7.19.4 we introduced the convenience enums for this option using the
  917. CURLFTP_CREATE_DIR prefix.
  918. */
  919. ftp_create_missing_dirs = 110,
  920. /** Set this to a bitmask value to enable the particular authentications
  921. methods you like. Use this in combination with CURLOPT_PROXYUSERPWD.
  922. Note that setting multiple bits may cause extra network round-trips. */
  923. proxyauth,
  924. /** FTP option that changes the timeout, in seconds, associated with
  925. getting a response. This is different from transfer timeout time and
  926. essentially places a demand on the FTP server to acknowledge commands
  927. in a timely manner. */
  928. ftp_response_timeout,
  929. /** Set this option to one of the CURL_IPRESOLVE_* defines (see below) to
  930. tell libcurl to resolve names to those IP versions only. This only has
  931. affect on systems with support for more than one, i.e IPv4 _and_ IPv6. */
  932. ipresolve,
  933. /** Set this option to limit the size of a file that will be downloaded from
  934. an HTTP or FTP server.
  935. Note there is also _LARGE version which adds large file support for
  936. platforms which have larger off_t sizes. See MAXFILESIZE_LARGE below. */
  937. maxfilesize,
  938. /** See the comment for INFILESIZE above, but in short, specifies
  939. * the size of the file being uploaded. -1 means unknown.
  940. */
  941. infilesize_large = 30115,
  942. /** Sets the continuation offset. There is also a LONG version of this;
  943. * look above for RESUME_FROM.
  944. */
  945. resume_from_large,
  946. /** Sets the maximum size of data that will be downloaded from
  947. * an HTTP or FTP server. See MAXFILESIZE above for the LONG version.
  948. */
  949. maxfilesize_large,
  950. /** Set this option to the file name of your .netrc file you want libcurl
  951. to parse (using the CURLOPT_NETRC option). If not set, libcurl will do
  952. a poor attempt to find the user's home directory and check for a .netrc
  953. file in there. */
  954. netrc_file = 10118,
  955. /** Enable SSL/TLS for FTP, pick one of:
  956. CURLFTPSSL_TRY - try using SSL, proceed anyway otherwise
  957. CURLFTPSSL_CONTROL - SSL for the control connection or fail
  958. CURLFTPSSL_ALL - SSL for all communication or fail
  959. */
  960. use_ssl = 119,
  961. /** The _LARGE version of the standard POSTFIELDSIZE option */
  962. postfieldsize_large = 30120,
  963. /** Enable/disable the TCP Nagle algorithm */
  964. tcp_nodelay = 121,
  965. /** 122 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
  966. /** 123 OBSOLETE. Gone in 7.16.0 */
  967. /** 124 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
  968. /** 125 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
  969. /** 126 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
  970. /** 127 OBSOLETE. Gone in 7.16.0 */
  971. /** 128 OBSOLETE. Gone in 7.16.0 */
  972. /** When FTP over SSL/TLS is selected (with CURLOPT_USE_SSL), this option
  973. can be used to change libcurl's default action which is to first try
  974. "AUTH SSL" and then "AUTH TLS" in this order, and proceed when a OK
  975. response has been received.
  976. Available parameters are:
  977. CURLFTPAUTH_DEFAULT - let libcurl decide
  978. CURLFTPAUTH_SSL - try "AUTH SSL" first, then TLS
  979. CURLFTPAUTH_TLS - try "AUTH TLS" first, then SSL
  980. */
  981. ftpsslauth = 129,
  982. ioctlfunction = 20130, ///
  983. ioctldata = 10131, ///
  984. /** 132 OBSOLETE. Gone in 7.16.0 */
  985. /** 133 OBSOLETE. Gone in 7.16.0 */
  986. /** zero terminated string for pass on to the FTP server when asked for
  987. "account" info */
  988. ftp_account = 10134,
  989. /** feed cookies into cookie engine */
  990. cookielist,
  991. /** ignore Content-Length */
  992. ignore_content_length = 136,
  993. /** Set to non-zero to skip the IP address received in a 227 PASV FTP server
  994. response. Typically used for FTP-SSL purposes but is not restricted to
  995. that. libcurl will then instead use the same IP address it used for the
  996. control connection. */
  997. ftp_skip_pasv_ip,
  998. /** Select "file method" to use when doing FTP, see the curl_ftpmethod
  999. above. */
  1000. ftp_filemethod,
  1001. /** Local port number to bind the socket to */
  1002. localport,
  1003. /** Number of ports to try, including the first one set with LOCALPORT.
  1004. Thus, setting it to 1 will make no additional attempts but the first.
  1005. */
  1006. localportrange,
  1007. /** no transfer, set up connection and let application use the socket by
  1008. extracting it with CURLINFO_LASTSOCKET */
  1009. connect_only,
  1010. /** Function that will be called to convert from the
  1011. network encoding (instead of using the iconv calls in libcurl) */
  1012. conv_from_network_function = 20142,
  1013. /** Function that will be called to convert to the
  1014. network encoding (instead of using the iconv calls in libcurl) */
  1015. conv_to_network_function,
  1016. /** Function that will be called to convert from UTF8
  1017. (instead of using the iconv calls in libcurl)
  1018. Note that this is used only for SSL certificate processing */
  1019. conv_from_utf8_function,
  1020. /** if the connection proceeds too quickly then need to slow it down */
  1021. /** limit-rate: maximum number of bytes per second to send or receive */
  1022. max_send_speed_large = 30145,
  1023. max_recv_speed_large, /// ditto
  1024. /** Pointer to command string to send if USER/PASS fails. */
  1025. ftp_alternative_to_user = 10147,
  1026. /** callback function for setting socket options */
  1027. sockoptfunction = 20148,
  1028. sockoptdata = 10149,
  1029. /** set to 0 to disable session ID re-use for this transfer, default is
  1030. enabled (== 1) */
  1031. ssl_sessionid_cache = 150,
  1032. /** allowed SSH authentication methods */
  1033. ssh_auth_types,
  1034. /** Used by scp/sftp to do public/private key authentication */
  1035. ssh_public_keyfile = 10152,
  1036. ssh_private_keyfile,
  1037. /** Send CCC (Clear Command Channel) after authentication */
  1038. ftp_ssl_ccc = 154,
  1039. /** Same as TIMEOUT and CONNECTTIMEOUT, but with ms resolution */
  1040. timeout_ms,
  1041. connecttimeout_ms,
  1042. /** set to zero to disable the libcurl's decoding and thus pass the raw body
  1043. data to the application even when it is encoded/compressed */
  1044. http_transfer_decoding,
  1045. http_content_decoding, /// ditto
  1046. /** Permission used when creating new files and directories on the remote
  1047. server for protocols that support it, SFTP/SCP/FILE */
  1048. new_file_perms,
  1049. new_directory_perms, /// ditto
  1050. /** Set the behaviour of POST when redirecting. Values must be set to one
  1051. of CURL_REDIR* defines below. This used to be called CURLOPT_POST301 */
  1052. postredir,
  1053. /** used by scp/sftp to verify the host's public key */
  1054. ssh_host_public_key_md5 = 10162,
  1055. /** Callback function for opening socket (instead of socket(2)). Optionally,
  1056. callback is able change the address or refuse to connect returning
  1057. CURL_SOCKET_BAD. The callback should have type
  1058. curl_opensocket_callback */
  1059. opensocketfunction = 20163,
  1060. opensocketdata = 10164, /// ditto
  1061. /** POST volatile input fields. */
  1062. copypostfields,
  1063. /** set transfer mode (;type=<a|i>) when doing FTP via an HTTP proxy */
  1064. proxy_transfer_mode = 166,
  1065. /** Callback function for seeking in the input stream */
  1066. seekfunction = 20167,
  1067. seekdata = 10168, /// ditto
  1068. /** CRL file */
  1069. crlfile,
  1070. /** Issuer certificate */
  1071. issuercert,
  1072. /** (IPv6) Address scope */
  1073. address_scope = 171,
  1074. /** Collect certificate chain info and allow it to get retrievable with
  1075. CURLINFO_CERTINFO after the transfer is complete. (Unfortunately) only
  1076. working with OpenSSL-powered builds. */
  1077. certinfo,
  1078. /** "name" and "pwd" to use when fetching. */
  1079. username = 10173,
  1080. password, /// ditto
  1081. /** "name" and "pwd" to use with Proxy when fetching. */
  1082. proxyusername,
  1083. proxypassword, /// ditto
  1084. /** Comma separated list of hostnames defining no-proxy zones. These should
  1085. match both hostnames directly, and hostnames within a domain. For
  1086. example, local.com will match local.com and www.local.com, but NOT
  1087. notlocal.com or www.notlocal.com. For compatibility with other
  1088. implementations of this, .local.com will be considered to be the same as
  1089. local.com. A single * is the only valid wildcard, and effectively
  1090. disables the use of proxy. */
  1091. noproxy,
  1092. /** block size for TFTP transfers */
  1093. tftp_blksize = 178,
  1094. /** Socks Service */
  1095. socks5_gssapi_service = 10179,
  1096. /** Socks Service */
  1097. socks5_gssapi_nec = 180,
  1098. /** set the bitmask for the protocols that are allowed to be used for the
  1099. transfer, which thus helps the app which takes URLs from users or other
  1100. external inputs and want to restrict what protocol(s) to deal
  1101. with. Defaults to CURLPROTO_ALL. */
  1102. protocols,
  1103. /** set the bitmask for the protocols that libcurl is allowed to follow to,
  1104. as a subset of the CURLOPT_PROTOCOLS ones. That means the protocol needs
  1105. to be set in both bitmasks to be allowed to get redirected to. Defaults
  1106. to all protocols except FILE and SCP. */
  1107. redir_protocols,
  1108. /** set the SSH knownhost file name to use */
  1109. ssh_knownhosts = 10183,
  1110. /** set the SSH host key callback, must point to a curl_sshkeycallback
  1111. function */
  1112. ssh_keyfunction = 20184,
  1113. /** set the SSH host key callback custom pointer */
  1114. ssh_keydata = 10185,
  1115. /** set the SMTP mail originator */
  1116. mail_from,
  1117. /** set the SMTP mail receiver(s) */
  1118. mail_rcpt,
  1119. /** FTP: send PRET before PASV */
  1120. ftp_use_pret = 188,
  1121. /** RTSP request method (OPTIONS, SETUP, PLAY, etc...) */
  1122. rtsp_request,
  1123. /** The RTSP session identifier */
  1124. rtsp_session_id = 10190,
  1125. /** The RTSP stream URI */
  1126. rtsp_stream_uri,
  1127. /** The Transport: header to use in RTSP requests */
  1128. rtsp_transport,
  1129. /** Manually initialize the client RTSP CSeq for this handle */
  1130. rtsp_client_cseq = 193,
  1131. /** Manually initialize the server RTSP CSeq for this handle */
  1132. rtsp_server_cseq,
  1133. /** The stream to pass to INTERLEAVEFUNCTION. */
  1134. interleavedata = 10195,
  1135. /** Let the application define a custom write method for RTP data */
  1136. interleavefunction = 20196,
  1137. /** Turn on wildcard matching */
  1138. wildcardmatch = 197,
  1139. /** Directory matching callback called before downloading of an
  1140. individual file (chunk) started */
  1141. chunk_bgn_function = 20198,
  1142. /** Directory matching callback called after the file (chunk)
  1143. was downloaded, or skipped */
  1144. chunk_end_function,
  1145. /** Change match (fnmatch-like) callback for wildcard matching */
  1146. fnmatch_function,
  1147. /** Let the application define custom chunk data pointer */
  1148. chunk_data = 10201,
  1149. /** FNMATCH_FUNCTION user pointer */
  1150. fnmatch_data,
  1151. /** send linked-list of name:port:address sets */
  1152. resolve,
  1153. /** Set a username for authenticated TLS */
  1154. tlsauth_username,
  1155. /** Set a password for authenticated TLS */
  1156. tlsauth_password,
  1157. /** Set authentication type for authenticated TLS */
  1158. tlsauth_type,
  1159. /** the last unused */
  1160. lastentry
  1161. }
  1162. ///
  1163. alias int CURLoption;
  1164. ///
  1165. enum CURLOPT_SERVER_RESPONSE_TIMEOUT = CurlOption.ftp_response_timeout;
  1166. /** Below here follows defines for the CURLOPT_IPRESOLVE option. If a host
  1167. name resolves addresses using more than one IP protocol version, this
  1168. option migh…