dect
/
libpcap
Archived
13
0
Fork 0

Add a "pcap_dump_file()" API to get the "FILE *" corresponding to a

"pcap_dumper_t".
This commit is contained in:
guy 2003-11-16 10:07:35 +00:00
parent 52c71acb69
commit 0eac66d65e
3 changed files with 15 additions and 3 deletions

7
pcap.3
View File

@ -1,4 +1,4 @@
.\" @(#) $Header: /tcpdump/master/libpcap/Attic/pcap.3,v 1.51 2003-11-04 07:37:02 guy Exp $ .\" @(#) $Header: /tcpdump/master/libpcap/Attic/pcap.3,v 1.52 2003-11-16 10:07:35 guy Exp $
.\" .\"
.\" Copyright (c) 1994, 1996, 1997 .\" Copyright (c) 1994, 1996, 1997
.\" The Regents of the University of California. All rights reserved. .\" The Regents of the University of California. All rights reserved.
@ -109,6 +109,7 @@ const char *pcap_lib_version(void)
.ft B .ft B
void pcap_close(pcap_t *p) void pcap_close(pcap_t *p)
int pcap_dump_flush(pcap_dumper_t *p) int pcap_dump_flush(pcap_dumper_t *p)
FILE *pcap_dump_file(pcap_dumper_t *p)
void pcap_dump_close(pcap_dumper_t *p) void pcap_dump_close(pcap_dumper_t *p)
.ft .ft
.fi .fi
@ -989,6 +990,10 @@ closes the files associated with
.I p .I p
and deallocates resources. and deallocates resources.
.PP .PP
.B pcap_dump_file()
returns the standard I/O stream of the ``savefile'' opened by
.BR pcap_dump_open().
.PP
.B pcap_dump_flush() .B pcap_dump_flush()
flushes the output buffer to the ``savefile,'' so that any packets flushes the output buffer to the ``savefile,'' so that any packets
written with written with

3
pcap.h
View File

@ -31,7 +31,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* @(#) $Header: /tcpdump/master/libpcap/pcap.h,v 1.45 2003-11-04 07:05:39 guy Exp $ (LBL) * @(#) $Header: /tcpdump/master/libpcap/pcap.h,v 1.46 2003-11-16 10:07:36 guy Exp $ (LBL)
*/ */
#ifndef lib_pcap_h #ifndef lib_pcap_h
@ -209,6 +209,7 @@ pcap_dumper_t *pcap_dump_open(pcap_t *, const char *);
int pcap_dump_flush(pcap_dumper_t *); int pcap_dump_flush(pcap_dumper_t *);
void pcap_dump_close(pcap_dumper_t *); void pcap_dump_close(pcap_dumper_t *);
void pcap_dump(u_char *, const struct pcap_pkthdr *, const u_char *); void pcap_dump(u_char *, const struct pcap_pkthdr *, const u_char *);
FILE *pcap_dump_file(pcap_dumper_t *);
int pcap_findalldevs(pcap_if_t **, char *); int pcap_findalldevs(pcap_if_t **, char *);
void pcap_freealldevs(pcap_if_t *); void pcap_freealldevs(pcap_if_t *);

View File

@ -30,7 +30,7 @@
#ifndef lint #ifndef lint
static const char rcsid[] _U_ = static const char rcsid[] _U_ =
"@(#) $Header: /tcpdump/master/libpcap/savefile.c,v 1.94 2003-11-15 23:24:05 guy Exp $ (LBL)"; "@(#) $Header: /tcpdump/master/libpcap/savefile.c,v 1.95 2003-11-16 10:07:36 guy Exp $ (LBL)";
#endif #endif
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
@ -840,6 +840,12 @@ pcap_dump_open(pcap_t *p, const char *fname)
return ((pcap_dumper_t *)f); return ((pcap_dumper_t *)f);
} }
FILE *
pcap_dump_file(pcap_dumper_t *p)
{
return ((FILE *)p);
}
int int
pcap_dump_flush(pcap_dumper_t *p) pcap_dump_flush(pcap_dumper_t *p)
{ {