Programmatically check if IPv6 is enabled in windows

Is there a way to programmatically check if IPv6 is installed / enabled on Windows using C ++? Either at the interface level, or in the system.

+3
source share
5 answers

WSCEnumProtocols() can be used to check if IPv6 is installed as a protocol.

+1
source

With a lot of networking features, the easiest way is to try to use it and catch exceptions if it doesn't work.

+3
source

- GetAdapterAddresses() IPv6.

0

, XP ipv6 install , IPv6, , .

0

,

const int sock6 = socket (AF_INET6, SOCK_DGRAM, 0);
const BOOL is_ip6_enabled = (SOCKET_ERROR != sock6);
close (sock6);
-1
source

Source: https://habr.com/ru/post/1751570/


All Articles