1 #include "tcp_sniffer.h"
18 // Get the list of available devices
19 printf("Finding available devices ... ");
20 if( pcap_findalldevs( &alldevsp
, errbuf
) )
22 printf("Error finding devices : %s" , errbuf
);
27 // Print available devices
28 printf("\nAvailable Devices are :\n");
29 for(device
= alldevsp
; device
!= NULL
; device
= device
->next
)
31 printf("%d. %s - %s\n" , count
, device
->name
, device
->description
);
32 if(device
->name
!= NULL
)
34 strcpy(devs
[count
] , device
->name
);
39 // Ask user which device to sniff
40 printf("Enter the number of the device you want to sniff : ");
45 sniffer
.loop(devname
);