650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M00/89/4C/wKiom1gPDKegUJ9FAAAsmGzfaXs451.png-wh_500x0-wm_3 -wmp_4-s_3645182045.png "style=" Float:none; "title=" capture. PNG "alt=" Wkiom1gpdkeguj9faaasmgzfaxs451.png-wh_50 "/>
650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M00/89/4A/wKioL1gPDKfQGQu8AAAuw3WZDDU154.png-wh_500x0-wm_3 -wmp_4-s_3082020317.png "style=" Float:none; "title=" 1.PNG "alt=" Wkiol1gpdkfqgqu8aaauw3wzddu154.png-wh_50 "/>
#include "stdafx.h"
#include "Pcap.h"
int _tmain (int argc, _tchar* argv[])
{
pcap_if_t *alldevs;
pcap_if_t *d;
int i=0;
Char Errbuf[pcap_errbuf_size];
/* Get a list of local machine devices */
if (PCAP_FINDALLDEVS_EX (pcap_src_if_string, NULL/* auth is not needed */, &alldevs, errbuf) = =-1)
{
fprintf (stderr, "Error in PCAP_FINDALLDEVS_EX:%s\n", errbuf);
Exit (1);
}
/* Print List */
for (d= Alldevs; d! = NULL; d= d->next)
{
printf ("%d.%s", ++i, D->name);
if (d->description)
printf ("(%s) \ n", d->description);
Else
printf ("(No description available) \ n");
}
if (i = = 0)
{
printf ("\nno Interfaces found! Make sure WinPcap is installed.\n ");
return 0;
}
/* No more device list required, release it */
Pcap_freealldevs (Alldevs);
}
Get a list of devices