curl.h 131 KB

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