psutil icon indicating copy to clipboard operation
psutil copied to clipboard

net_if_() functions should provide info about the gateway

Open giampaolo opened this issue 9 years ago • 2 comments

Original discussion: https://groups.google.com/forum/#!topic/psutil/GLKNvgSGs28

giampaolo avatar Aug 04 '15 23:08 giampaolo

It works ?

Wellers0n avatar Aug 13 '20 04:08 Wellers0n

from the Windows API documentation for the GetAdaptersAddresses() function:

GAA_FLAG_INCLUDE_GATEWAYS 0x0080 Return the addresses of default gateways. This flag is supported on Windows Vista and later.

This is this function used in windows/net.c to get the IP, netmask, etc info. It looks like the same function can also return the default gateway info

bruingineer avatar Nov 03 '21 08:11 bruingineer