Bonjour,
je debute en c je suis un tuto sur libpcap, mais j'ai du raté un truc et je trouve pas. J'ai fait une fonction
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
void got_packet(u_char *useless, struct pcap_pkthdr *header, const u_char *packet)
	{
		static int count = 1;
		printf("%d - Jacked a packet with length of [%d]\n",count);
		count++;
	}
mais quand je l'appel avec
Code : Sélectionner tout - Visualiser dans une fenêtre à part
pcap_loop(handle,10,got_packet,NULL);
j'ai ces erreur :
$ gcc -lpcap -o sniff sniff.c
sniff.c: In function ‘main’:
sniff.c:61: error: ‘got_packet’ undeclared (first use in this function)
sniff.c:61: error: (Each undeclared identifier is reported only once
sniff.c:61: error: for each function it appears in.)
quelqu'un peut m'aider, je ne comprend pas et je en vois pas mon erreur.