curl.h 112 KB

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