On 9/23/07, Guy Harris <[EMAIL PROTECTED]> wrote: > > Varuna De Silva wrote: > > Yes, the callback function is in the higher-layer software that uses > libpcap/WinPcap. tcpdump, for example, has two callback functions that > write raw packet data to a capture file and one callback function that > dissects the packet and prints the dissection; other programs such as > Wireshark/TShark, snort, etc. have their own callback functions. > > The callback function processes the packet data handed to it as the third > argument, and the packet time stamp and length information in the > structure passed to it as the second argument. > > If you're modifying libpcap to support a new type of capture, you don't > write the callback function,
I am doing this for my device to be supported by wireshark. As I understand I dont need to write the callback function??? Please correct me if I am wrong. you write code in the read_op routine to call > the callback function; Yes, I did so as following, ( I am guilty, of copying it directly from pcap-septel.c) int muwis_read(pcap_t *p, int cnt, pcap_handler callback, u_char *user) { callback(user, &pcap_header, dp); : : } As I understand this need to be called for each packet captured. a pointer to the callback function is passed to the > read_op routine. > This is the "user" in the above code. Now my question is what will be this "user" function in my case. That is when I call xxxx_read() pointer to what function will I have to pass to it as " *user " Thanks, Varuna > - > This is the tcpdump-workers list. > Visit https://cod.sandelman.ca/ to unsubscribe. > - This is the tcpdump-workers list. Visit https://cod.sandelman.ca/ to unsubscribe.