(as given in the
.I struct pcap_pkthdr
a pointer to which is passed to the callback routine)
-bytes of data from the packet.
+bytes of data from the packet. The
+.I struct pcap_pkthdr
+and the packet data are not to be freed by the callback routine, and are
+not guaranteed to be valid after the callback routine returns; if the
+code needs them to be valid after the callback, it must make a copy of
+them.
.SH RETURN VALUE
.B pcap_loop()
returns 0 if
struct for the packet, and the
pointer pointed to by the
.I pkt_data
-argument is set to point to the data in the packet.
+argument is set to point to the data in the packet. The
+.I struct pcap_pkthdr
+and the packet data are not to be freed by the caller, and are not
+guaranteed to be valid after the next call to
+.BR pcap_next_ex() ,
+.BR pcap_next() ,
+.BR pcap_loop() ,
+or
+.BR pcap_dispatch() ;
+if the code needs them to remain valid, it must make a copy of them.
.PP
.B pcap_next()
reads the next packet (by calling
.I cnt
of 1) and returns a
.I u_char
-pointer to the data in that packet.
+pointer to the data in that packet. The
+packet data is not to be freed by the caller, and is not
+guaranteed to be valid after the next call to
+.BR pcap_next_ex() ,
+.BR pcap_next() ,
+.BR pcap_loop() ,
+or
+.BR pcap_dispatch() ;
+if the code needs it to remain valid, it must make a copy of it.
The
.I pcap_pkthdr
structure pointed to by