All of this information is available through apis in various system DLLs. It can also be discovered by examining various keys in the registry. I don't know of any existing module (or combination of modules) that exposes it directly.
Certainly one could be written, using Win32::API or Inline::C or XS to access some combination of the following entrypoints:
netman.dll 77D0B3FC 5 HrPnpInstanceIdFromGuid 77D0177D 4 HrLanConnectionNameFromGuidOrPath DNSAPI.dll 76F329BE 21 DnsFreeConfigStructure 76F22D94 4B DnsQuery_W 76F25AD3 50 DnsRecordListFree 76F3757A 1C DnsFlushResolverCache 76F27A1D 44 DnsQueryConfigAllocEx 76F32E94 23 DnsGetCacheDataTable WS2_32.dll 71AB6979 7 WSAAddressToStringW 71AB2EE1 Ordinal 11 71AB2EAD Ordinal 8 71AB45C1 Ordinal 12 71AB3CCE Ordinal 111 71AB6A55 Ordinal 115 iphlpapi.dll 76D6D4F0 6E NhGetInterfaceNameFromGuid 76D62841 2D GetInterfaceInfo 76D65143 2A GetIfTable 76D63B9C 2E GetIpAddrTable 76D6AAC7 31 GetIpForwardTable 76D66AE8 6F NhpAllocateAndGetInterfaceInfoFromStack 76D6CCCF 39 GetNetworkParams 76D69B93 35 GetIpStatistics 76D63E54 1A GetAdaptersAddresses SETUPAPI.dll 7792C341 10E SetupDiCreateDeviceInfoList 7792EEEC 166 SetupDiOpenDeviceInfoW 7792B28D 11B SetupDiDestroyDeviceInfoList 7792EB01 146 SetupDiGetDeviceRegistryPropertyW DHCPCSVC.DLL 7D4BFD79 23 DhcpStaticRefreshParams 7D4C1F11 D DhcpHandlePnPEvent 7D4C1CA3 8 DhcpEnumClasses 7D4BFBC1 1B DhcpReleaseParameters 7D4BFA6F 0 DhcpAcquireParameters
But since that's just a selective imports dump from ipconfig.exe, which already knows how to get this information (and will be maintained by MS through patches and upgrades), and the output format of ipconfig /all is relatively straight forward to parse. The latter approach seems like a far simpler, quicker, and more maintainable way to go.
In reply to Re: How can I get current IP,DNS,MAC,GW under XP?
by BrowserUk
in thread How can I get current IP,DNS,MAC,GW under XP?
by perllee
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |