curl.h 127 KB

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