1CURLOPT_ADDRESS_SCOPE(3)   curl_easy_setopt options   CURLOPT_ADDRESS_SCOPE(3)
2
3
4

NAME

6       CURLOPT_ADDRESS_SCOPE - set scope id for IPv6 addresses
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       CURLcode  curl_easy_setopt(CURL  *handle,  CURLOPT_ADDRESS_SCOPE,  long
12       scope);
13

DESCRIPTION

15       Pass a long specifying the scope id value to  use  when  connecting  to
16       IPv6 addresses.
17

DEFAULT

19       0
20

PROTOCOLS

22       All, when using IPv6
23

EXAMPLE

25       CURL *curl = curl_easy_init();
26       if(curl) {
27         CURLcode ret;
28         long my_scope_id;
29         curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
30         my_scope_id = if_nametoindex("eth0");
31         curl_easy_setopt(curl, CURLOPT_ADDRESS_SCOPE, my_scope_id);
32         ret = curl_easy_perform(curl);
33         curl_easy_cleanup(curl);
34       }
35

AVAILABILITY

37       Added in 7.19.0
38

RETURN VALUE

40       Returns  CURLE_OK  if the option is supported, and CURLE_UNKNOWN_OPTION
41       if not.  Returns  CURLE_BAD_FUNCTION_ARGUMENT  if  set  to  a  negative
42       value.
43

SEE ALSO

45       CURLOPT_STDERR(3), CURLOPT_DEBUGFUNCTION(3),
46
47
48
49libcurl 7.69.1                  March 07, 2019        CURLOPT_ADDRESS_SCOPE(3)
Impressum