curl.h 131 KB

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