CURLOPT_TELNETOPTIONS.md (1661B)
1 --- 2 c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al. 3 SPDX-License-Identifier: curl 4 Title: CURLOPT_TELNETOPTIONS 5 Section: 3 6 Source: libcurl 7 See-also: 8 - CURLOPT_HTTPHEADER (3) 9 - CURLOPT_QUOTE (3) 10 Protocol: 11 - TELNET 12 Added-in: 7.7 13 --- 14 15 # NAME 16 17 CURLOPT_TELNETOPTIONS - set of telnet options 18 19 # SYNOPSIS 20 21 ~~~c 22 #include <curl/curl.h> 23 24 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_TELNETOPTIONS, 25 struct curl_slist *cmds); 26 ~~~ 27 28 # DESCRIPTION 29 30 Provide a pointer to a curl_slist with variables to pass to the telnet 31 negotiations. The variables should be in the format \<option=value\>. libcurl 32 supports the options **TTYPE**, **XDISPLOC** and **NEW_ENV**. See the TELNET 33 standard for details. 34 35 Using this option multiple times makes the last set list override the previous 36 ones. Set it to NULL to disable its use again. 37 38 libcurl does not copy the list, it needs to be kept around until after the 39 transfer has completed. 40 41 # DEFAULT 42 43 NULL 44 45 # %PROTOCOLS% 46 47 # EXAMPLE 48 49 ~~~c 50 int main(void) 51 { 52 CURL *curl = curl_easy_init(); 53 if(curl) { 54 CURLcode res; 55 struct curl_slist *options; 56 options = curl_slist_append(NULL, "TTTYPE=vt100"); 57 options = curl_slist_append(options, "USER=foobar"); 58 curl_easy_setopt(curl, CURLOPT_URL, "telnet://example.com/"); 59 curl_easy_setopt(curl, CURLOPT_TELNETOPTIONS, options); 60 res = curl_easy_perform(curl); 61 curl_easy_cleanup(curl); 62 curl_slist_free_all(options); 63 } 64 } 65 ~~~ 66 67 # %AVAILABILITY% 68 69 # RETURN VALUE 70 71 curl_easy_setopt(3) returns a CURLcode indicating success or error. 72 73 CURLE_OK (0) means everything was OK, non-zero means an error occurred, see 74 libcurl-errors(3).