[Winpcap-users] pcap_loop pointers

Gianluca Varenni gianluca.varenni at cacetech.com
Tue Sep 11 06:34:43 GMT 2007

  ----- Original Message ----- 
  From: ceo at triplebit.com 
  To: winpcap-users at winpcap.org 
  Sent: Monday, September 10, 2007 6:13 AM
  Subject: [Winpcap-users] pcap_loop pointers

  I think that my question represents also other users.
  When using the function "pcap_loop"  the system uses the fallowing callback
  whenever a packet arrives -

        typedef void(* pcap_handler)(u_char *user, const struct pcap_pkthdr
  *pkt_header, const u_char *pkt_data)

  My questions-

  1. I saw that the pointers pkt_data and pkt_header differ from packet to
  Does that mean that the data on which they point occupies different area in


  2. How do I know if the data pointed by them is still valid in a certain

Those pointers are valid *only* in the context of the pcap_handler callback. Packets are reused as soon as the pcap_handler callback returns.

Have a nice day


  I. Lesher


  Winpcap-users mailing list
  Winpcap-users at winpcap.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.winpcap.org/pipermail/winpcap-users/attachments/20070911/de43ff4c/attachment-0001.htm

More information about the Winpcap-users mailing list