curl.h 114 KB

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