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
12Added-in: 7.7
13---
14
15# NAME
16
17CURLOPT_TELNETOPTIONS - set of telnet options
18
19# SYNOPSIS
20
21~~~c
22#include <curl/curl.h>
23
24CURLcode curl_easy_setopt(CURL *handle, CURLOPT_TELNETOPTIONS,
25                          struct curl_slist *cmds);
26~~~
27
28# DESCRIPTION
29
30Provide a pointer to a curl_slist with variables to pass to the telnet
31negotiations. The variables should be in the format \<option=value\>. libcurl
32supports the options **TTYPE**, **XDISPLOC** and **NEW_ENV**. See the TELNET
33standard for details.
34
35Using this option multiple times makes the last set list override the previous
36ones. Set it to NULL to disable its use again.
37
38libcurl does not copy the list, it needs to be kept around until after the
39transfer has completed.
40
41# DEFAULT
42
43NULL
44
45# %PROTOCOLS%
46
47# EXAMPLE
48
49~~~c
50int 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
71Returns CURLE_OK if TELNET is supported, and CURLE_UNKNOWN_OPTION if not.
72