1--- 2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al. 3SPDX-License-Identifier: curl 4Title: CURLOPT_TELNETOPTIONS 5Section: 3 6Source: libcurl 7See-also: 8 - CURLOPT_HTTPHEADER (3) 9 - CURLOPT_QUOTE (3) 10Protocol: 11 - TELNET 12--- 13 14# NAME 15 16CURLOPT_TELNETOPTIONS - set of telnet options 17 18# SYNOPSIS 19 20~~~c 21#include <curl/curl.h> 22 23CURLcode curl_easy_setopt(CURL *handle, CURLOPT_TELNETOPTIONS, 24 struct curl_slist *cmds); 25~~~ 26 27# DESCRIPTION 28 29Provide a pointer to a curl_slist with variables to pass to the telnet 30negotiations. The variables should be in the format \<option=value\>. libcurl 31supports the options **TTYPE**, **XDISPLOC** and **NEW_ENV**. See the TELNET 32standard for details. 33 34# DEFAULT 35 36NULL 37 38# EXAMPLE 39 40~~~c 41int main(void) 42{ 43 CURL *curl = curl_easy_init(); 44 if(curl) { 45 CURLcode res; 46 struct curl_slist *options; 47 options = curl_slist_append(NULL, "TTTYPE=vt100"); 48 options = curl_slist_append(options, "USER=foobar"); 49 curl_easy_setopt(curl, CURLOPT_URL, "telnet://example.com/"); 50 curl_easy_setopt(curl, CURLOPT_TELNETOPTIONS, options); 51 res = curl_easy_perform(curl); 52 curl_easy_cleanup(curl); 53 curl_slist_free_all(options); 54 } 55} 56~~~ 57 58# AVAILABILITY 59 60Along with TELNET 61 62# RETURN VALUE 63 64Returns CURLE_OK if TELNET is supported, and CURLE_UNKNOWN_OPTION if not. 65