[Winpcap-users] Getting IP from pcap_findalldevs in VISTA
Gianluca Varenni
gianluca.varenni at cacetech.com
Wed May 21 00:11:33 GMT 2008
Sorry for the late reply.
Nothing should be different on Vista. Have you tried the sample called "iflist" in the developer's pack? The sample lists both IPv4 and IPv6 of each adapter.
Have a nice day
GV
----- Original Message -----
From: Schumi Imor
To: winpcap-users at winpcap.org
Sent: Saturday, May 10, 2008 1:53 PM
Subject: [Winpcap-users] Getting IP from pcap_findalldevs in VISTA
Hello,
It seems that getting the device's IP from pcap_findalldevs changed from XP to VISTA.
((struct sockaddr_in *)(d->addresses->addr))->sin_addr.S_un.S_addr;
is returning 0 in Vista. Did this struct change in Vista because of IPv6 or something?
pcap_findalldevs(&alldevs, errbuf)
/* Print the list */
for(d=alldevs; d; d=d->next)
{
i++;
if (d->description) {
printf(" (%s)\n", d->description);
srcIP = ((struct sockaddr_in *)(d->addresses->addr))->sin_addr.S_un.S_addr;
srcNetMask = ((struct sockaddr_in *)(d->addresses->netmask))->sin_addr.S_un.S_addr;
}
}
------------------------------------------------------------------------------
_______________________________________________
Winpcap-users mailing list
Winpcap-users at winpcap.org
https://www.winpcap.org/mailman/listinfo/winpcap-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.winpcap.org/pipermail/winpcap-users/attachments/20080521/5f265ba4/attachment.htm
More information about the Winpcap-users
mailing list