Deleted Added
full compact
pcap_next_ex.3pcap (214518) pcap_next_ex.3pcap (235426)
1.\" @(#) $Header: /tcpdump/master/libpcap/pcap_next_ex.3pcap,v 1.3 2008-04-06 02:53:22 guy Exp $
2.\"
3.\" Copyright (c) 1994, 1996, 1997
4.\" The Regents of the University of California. All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that: (1) source code distributions
8.\" retain the above copyright notice and this paragraph in its entirety, (2)

--- 31 unchanged lines hidden (view full) ---

40reads the next packet and returns a success/failure indication.
41If the packet was read without problems, the pointer pointed to by the
42.I pkt_header
43argument is set to point to the
44.I pcap_pkthdr
45struct for the packet, and the
46pointer pointed to by the
47.I pkt_data
1.\" @(#) $Header: /tcpdump/master/libpcap/pcap_next_ex.3pcap,v 1.3 2008-04-06 02:53:22 guy Exp $
2.\"
3.\" Copyright (c) 1994, 1996, 1997
4.\" The Regents of the University of California. All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that: (1) source code distributions
8.\" retain the above copyright notice and this paragraph in its entirety, (2)

--- 31 unchanged lines hidden (view full) ---

40reads the next packet and returns a success/failure indication.
41If the packet was read without problems, the pointer pointed to by the
42.I pkt_header
43argument is set to point to the
44.I pcap_pkthdr
45struct for the packet, and the
46pointer pointed to by the
47.I pkt_data
48argument is set to point to the data in the packet.
48argument is set to point to the data in the packet. The
49.I struct pcap_pkthdr
50and the packet data are not to be freed by the caller, and are not
51guaranteed to be valid after the next call to
52.BR pcap_next_ex() ,
53.BR pcap_next() ,
54.BR pcap_loop() ,
55or
56.BR pcap_dispatch() ;
57if the code needs them to remain valid, it must make a copy of them.
49.PP
50.B pcap_next()
51reads the next packet (by calling
52.B pcap_dispatch()
53with a
54.I cnt
55of 1) and returns a
56.I u_char
58.PP
59.B pcap_next()
60reads the next packet (by calling
61.B pcap_dispatch()
62with a
63.I cnt
64of 1) and returns a
65.I u_char
57pointer to the data in that packet.
66pointer to the data in that packet. The
67packet data is not to be freed by the caller, and is not
68guaranteed to be valid after the next call to
69.BR pcap_next_ex() ,
70.BR pcap_next() ,
71.BR pcap_loop() ,
72or
73.BR pcap_dispatch() ;
74if the code needs it to remain valid, it must make a copy of it.
58The
59.I pcap_pkthdr
60structure pointed to by
61.I h
62is filled in with the appropriate values for the packet.
63.SH RETURN VALUE
64.B pcap_next_ex()
65returns 1 if the packet was read without problems, 0

--- 7 unchanged lines hidden (view full) ---

73.B pcap_perror()
74may be called with
75.I p
76as an argument to fetch or display the error text.
77.PP
78.B pcap_next()
79returns a pointer to the packet data on success, and returns
80.B NULL
75The
76.I pcap_pkthdr
77structure pointed to by
78.I h
79is filled in with the appropriate values for the packet.
80.SH RETURN VALUE
81.B pcap_next_ex()
82returns 1 if the packet was read without problems, 0

--- 7 unchanged lines hidden (view full) ---

90.B pcap_perror()
91may be called with
92.I p
93as an argument to fetch or display the error text.
94.PP
95.B pcap_next()
96returns a pointer to the packet data on success, and returns
97.B NULL
81if an error occured, or if no packets were read from a live
98if an error occurred, or if no packets were read from a live
82capture (if, for example, they were discarded because they didn't pass
83the packet filter, or if, on platforms that support a read timeout that
84starts before any packets arrive, the timeout expires before any packets
85arrive, or if the file descriptor for the capture device is in
86non-blocking mode and no packets were available to be read), or if no
87more packets are available in a ``savefile.'' Unfortunately, there is
99capture (if, for example, they were discarded because they didn't pass
100the packet filter, or if, on platforms that support a read timeout that
101starts before any packets arrive, the timeout expires before any packets
102arrive, or if the file descriptor for the capture device is in
103non-blocking mode and no packets were available to be read), or if no
104more packets are available in a ``savefile.'' Unfortunately, there is
88no way to determine whether an error occured or not.
105no way to determine whether an error occurred or not.
89.SH SEE ALSO
90pcap(3PCAP), pcap_geterr(3PCAP), pcap_dispatch(3PCAP)
106.SH SEE ALSO
107pcap(3PCAP), pcap_geterr(3PCAP), pcap_dispatch(3PCAP)