[Winpcap-users] Getting IP from pcap_findalldevs in VISTA

Schumi Imor schumiimor at gmail.com
Sat May 10 20:53:53 GMT 2008


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;*
        }
    }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.winpcap.org/pipermail/winpcap-users/attachments/20080510/b2da99ee/attachment.htm


More information about the Winpcap-users mailing list