From Andrew Brown <atatat@atatdot.net>: add a "pcap_dump_flush()" call,
to flush the standard I/O buffer for a "pcap_dumper_t" and force all packets written with "pcap_dump()" to the savefile.
This commit is contained in:
parent
482fa426bc
commit
eca5a61ef1
1
CREDITS
1
CREDITS
|
@ -14,6 +14,7 @@ The current maintainers:
|
|||
|
||||
Additional people who have contributed patches:
|
||||
|
||||
Andrew Brown <atatat@atatdot.net>
|
||||
Arkadiusz Miskiewicz <misiek@pld.org.pl>
|
||||
Armando L. Caro Jr. <acaro@mail.eecis.udel.edu>
|
||||
Charles M. Hannum <mycroft@netbsd.org>
|
||||
|
|
9
pcap.3
9
pcap.3
|
@ -1,4 +1,4 @@
|
|||
.\" @(#) $Header: /tcpdump/master/libpcap/Attic/pcap.3,v 1.41 2002-12-19 09:05:48 guy Exp $
|
||||
.\" @(#) $Header: /tcpdump/master/libpcap/Attic/pcap.3,v 1.42 2002-12-21 23:38:51 guy Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 1994, 1996, 1997
|
||||
.\" The Regents of the University of California. All rights reserved.
|
||||
|
@ -100,6 +100,7 @@ char *pcap_strerror(int error)
|
|||
.LP
|
||||
.ft B
|
||||
void pcap_close(pcap_t *p)
|
||||
void pcap_dump_flush(pcap_dumper_t *p)
|
||||
void pcap_dump_close(pcap_dumper_t *p)
|
||||
.ft
|
||||
.fi
|
||||
|
@ -877,6 +878,12 @@ closes the files associated with
|
|||
.I p
|
||||
and deallocates resources.
|
||||
.PP
|
||||
.B pcap_dump_flush()
|
||||
flushes the output buffer to the ``savefile,'' so that any packets
|
||||
written with
|
||||
.B pcap_dump()
|
||||
but not yet written to the ``savefile'' will be written.
|
||||
.PP
|
||||
.B pcap_dump_close()
|
||||
closes the ``savefile.''
|
||||
.PP
|
||||
|
|
3
pcap.h
3
pcap.h
|
@ -31,7 +31,7 @@
|
|||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#) $Header: /tcpdump/master/libpcap/pcap.h,v 1.38 2002-12-19 09:05:49 guy Exp $ (LBL)
|
||||
* @(#) $Header: /tcpdump/master/libpcap/pcap.h,v 1.39 2002-12-21 23:38:52 guy Exp $ (LBL)
|
||||
*/
|
||||
|
||||
#ifndef lib_pcap_h
|
||||
|
@ -202,6 +202,7 @@ FILE *pcap_file(pcap_t *);
|
|||
int pcap_fileno(pcap_t *);
|
||||
|
||||
pcap_dumper_t *pcap_dump_open(pcap_t *, const char *);
|
||||
void pcap_dump_flush(pcap_dumper_t *);
|
||||
void pcap_dump_close(pcap_dumper_t *);
|
||||
void pcap_dump(u_char *, const struct pcap_pkthdr *, const u_char *);
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
|
||||
#ifndef lint
|
||||
static const char rcsid[] =
|
||||
"@(#) $Header: /tcpdump/master/libpcap/savefile.c,v 1.70 2002-12-11 22:43:31 guy Exp $ (LBL)";
|
||||
"@(#) $Header: /tcpdump/master/libpcap/savefile.c,v 1.71 2002-12-21 23:38:52 guy Exp $ (LBL)";
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
|
@ -691,6 +691,13 @@ pcap_dump_open(pcap_t *p, const char *fname)
|
|||
return ((pcap_dumper_t *)f);
|
||||
}
|
||||
|
||||
void
|
||||
pcap_dump_flush(pcap_dumper_t *p)
|
||||
{
|
||||
|
||||
(void)fflush((FILE *)p);
|
||||
}
|
||||
|
||||
void
|
||||
pcap_dump_close(pcap_dumper_t *p)
|
||||
{
|
||||
|
|
Reference in New Issue