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