GNURLOPT_TELNETOPTIONS(3)
π¦ GNURLOPT_TELNETOPTIONS(3) π¦
okay bestie, this page lives in the curl_easy_setopt options manual, and it is literally all about giving telnet its own little custom-option moment. π
π NAME π
CURLOPT_TELNETOPTIONS β custom telnet options, no cap.
π SYNOPSIS π
#include <gnurl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_TELNETOPTIONS,
struct curl_slist *cmds);
β¨ DESCRIPTION β¨
So what you're doing here is handing over a pointer to a curl_slist full of variables that get passed into the telnet negotiations. π«Ά
Those variables need to be in the format <option=value>. Important! libcurl supports the options 'TTYPE', 'XDISPLOC' and 'NEW_ENV'. If you want the whole lore, see the TELNET standard for details. π§
The argument situation is:
struct curl_slist *cmdsβ your pointer to that list of telnet negotiation variables, bestie.
πΈ DEFAULT πΈ
NULL
π¦ PROTOCOLS π¦
TELNET
π EXAMPLE π
CURL *curl = curl_easy_init();
if(curl) {
struct curl_slist *options;
options = curl_slist_append(NULL, "TTTYPE=vt100");
options = curl_slist_append(options, "USER=foobar");
curl_easy_setopt(curl, CURLOPT_URL, "telnet://example.com/");
curl_easy_setopt(curl, CURLOPT_TELNETOPTIONS, options);
ret = curl_easy_perform(curl);
curl_easy_cleanup(curl);
curl_slist_free_all(options);
}
π AVAILABILITY π
Along with TELNET. π«‘
β RETURN VALUE β
Returns CURLE_OK if TELNET is supported, and CURLE_UNKNOWN_OPTION if not. That's the whole vibe check. π
π SEE ALSO π
Sibling pages to peep: CURLOPT_HTTPHEADER(3), CURLOPT_QUOTE(3),
mwah π β this cutie is from libcurl 7.37.0, dated 17 Jun 2014. π
π¦ where this page comes from
- nixos 26.05: libgnurl 7.72.0
- nixpkgs unstable: libgnurl 7.72.0
- Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms