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 pcap_

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

2006-06-14 Thread Mike Kershaw
On Wed, Jun 14, 2006 at 04:48:02PM +0200, David Rosal wrote: > 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

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_

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

2006-06-14 Thread Guy Harris
David Rosal wrote: 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): ... Should I avoid C++ and use C instead (don't say that please...) Should you

[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 {