[tcpdump-workers] Problems with libpcap and C++

2006-06-14 Thread David Rosal
Hello. I'm writing a packet sniffer in C++ using libpcap-0.9.4. I've tried to use a class function member as a callback for pcap_loop(), but the compiler complains that arguments don't match. The code is something like this (I have simplified it): 8- class X {

Re: [tcpdump-workers] Problems with libpcap and C++

2006-06-14 Thread Ury Segal
The buttom of the problem is this: You excpect libpcap to call X::dumper in the context of an instance of class X. (The real first parameter of X::dumper is a variable named this of the type X*.) But the libpcap API is not defining a `void (X::)(u_char*, const pcap_pkthdr*, const u_char*)'

Re: [tcpdump-workers] Problems with libpcap and C++

2006-06-14 Thread David Rosal
Ury Segal wrote: The buttom of the problem is this: You excpect libpcap to call X::dumper in the context of an instance of class X. (The real first parameter of X::dumper is a variable named this of the type X*.) But the libpcap API is not defining a `void (X::)(u_char*, const