GNURLOPT_TELNETOPTIONS(3)

πŸ“¦ version 7.72.0, in nixos 26.05, nixpkgs unstable

πŸ¦‹ 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