1CURLOPT_ADDRESS_SCOPE(3) curl_easy_setopt options CURLOPT_ADDRESS_SCOPE(3)
2
3
4
6 CURLOPT_ADDRESS_SCOPE - scope id for IPv6 addresses
7
9 #include <curl/curl.h>
10
11 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_ADDRESS_SCOPE, long scope);
12
14 Pass a long specifying the scope id value to use when connecting to
15 IPv6 addresses.
16
18 0
19
21 All, when using IPv6
22
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
36 Added in 7.19.0
37
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
44 CURLOPT_STDERR(3), CURLOPT_DEBUGFUNCTION(3),
45
46
47
48libcurl 8.0.1 January 02, 2023 CURLOPT_ADDRESS_SCOPE(3)