1
0

curl.h 126 KB

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