PageRenderTime 194ms CodeModel.GetById 52ms app.highlight 126ms RepoModel.GetById 1ms app.codeStats 0ms

/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 files are truncated, but you can click here to view the full file

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

Large files files are truncated, but you can click here to view the full file