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

NAME

6       CURLOPT_ADDRESS_SCOPE - scope id for IPv6 addresses
7

SYNOPSIS

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

DESCRIPTION

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

DEFAULT

18       0
19

PROTOCOLS

21       All, when using IPv6
22

EXAMPLE

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

AVAILABILITY

36       Added in 7.19.0
37

RETURN VALUE

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

SEE ALSO

44       CURLOPT_STDERR(3), CURLOPT_DEBUGFUNCTION(3),
45
46
47
48libcurl 7.82.0                 November 26, 2021      CURLOPT_ADDRESS_SCOPE(3)
Impressum