[Winpcap-users] pcap_findalldevs()
Tola Ndumari
tody.da.master at gmail.com
Mon May 20 08:33:15 PDT 2013
I'm recently new to using winpcap and pcap in general and i've had this
issue i can't seem to get over. everytime i call pcap_findalldevs() it only
ever seems to return the name and description of the device and i can't
seem to find the IP addresses of the interface i am using.
The whole piece of code is as shown:
void getDevices()
{
pcap_if* devices;
pcap_addr* address;
ULONG test;
char errors[PCAP_ERRBUF_SIZE];
int counter = 1;
pcap_findalldevs(&devices, errors);
address = devices ->addresses;
for (devices; devices!=NULL; devices = devices->next)
{
printf("%d. %s (%d) \n \n", counter, devices -> description, devices
->addresses ->addr -> sa_data);
printf("\n");
}
}
every time i call the function it returns the name and description of the
device. It returns 23 and 2 for the sa_family but in both cases sa_data is
an empty string, any help is much appreciated
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winpcap.org/pipermail/winpcap-users/attachments/20130520/c8d47604/attachment.html>
More information about the Winpcap-users
mailing list