tcpdump mailing list archives

What is meant by the callback function


From: "Varuna De Silva" <varunax () gmail com>
Date: Sat, 22 Sep 2007 15:08:37 +0530

Hi all,

With regard to one of my earlier messages, I got a comprehensive reply by
Guy.
and it says in one point regarding the xxxx_read() function on
pcap-xxxx.cfile as
below,

"  read_op should point to a routine that takes, as an argument, a
pointer to a pcap_t, a count, a pointer to a callback routine, and a
"u_char *" pointer, and that waits a buffer full of packets to arrive
and, when it arrives, calls the callback routine for each packet,
passing it, as arguments, the "u_char *", a pointer to a header giving
the arrival time of the packet, the packet's length, and the amount of
packet data captured;"

I have some questions regarding this,

1. what is really meant by the callback routine, what does it do? How
should I write this function?where should this be written. please be kind to

guide me to starting place. my idea is that it is the higher layer sw which
makes use of libpcap.

Thanks

Varuna
-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.


Current thread: