1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
int NIC()
{
/* Retrieve the device list on the local machine */
if (pcap_findalldevs_ex(PCAP_SRC_IF_STRING, NULL, &alldevs, errbuf) == -1)
.............
}
int SelectNIC()
{
printf("Choisir l'interface a utiliser (1-%d):",i);
scanf("%d", &inum);
............
}
int Filtre()
{
if (d->addresses != NULL)
/* Retrieve the mask of the first address of the interface */
.......
}
int Capture()
{
printf("\nCapture de trames en cours sur %s.......
}
void main()
{
NIC();
SelectNIC();
Filtre();
Capture();
} |
Partager