Hi I'm using c++ and libpcap. When I try to call the function "mycallback" I get a building error. These are the function:
void Capture::mycallback (unsigned char * useless, const struct pcap_pkthdr *pkthdr, const unsigned char * packet){
[...]
}
and the call to the function:
void Capture::capturar(){
[...]
pcap_loop (descr, -1, mycallback, NULL); //entramos en el bucle (infinito)
}
And this is the error:
error: argument of type 'void (Capture ::) (unsigned char *, const pcap_pkthdr *, const unsigned char *)' does not match '{aka pcap_handler void (*) (unsigned char *, const pcap_pkthdr *, const unsigned char *)} '
I don't understand the errors because the declaration is the same, can anyone help me?
Thanks.