]> The Tcpdump Group git mirrors - libpcap/commitdiff
Add a "pcap_dump_file()" API to get the "FILE *" corresponding to a
authorguy <guy>
Sun, 16 Nov 2003 10:07:35 +0000 (10:07 +0000)
committerguy <guy>
Sun, 16 Nov 2003 10:07:35 +0000 (10:07 +0000)
"pcap_dumper_t".

pcap.3
pcap.h
savefile.c

diff --git a/pcap.3 b/pcap.3
index f2add984a976a83432d70eb5b5b0df51ff1f20be..709181992d0d739ce9190ebbf359d9f5873b9211 100644 (file)
--- a/pcap.3
+++ b/pcap.3
@@ -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
 .\"    The Regents of the University of California.  All rights reserved.
@@ -109,6 +109,7 @@ const char *pcap_lib_version(void)
 .ft B
 void pcap_close(pcap_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)
 .ft
 .fi
@@ -989,6 +990,10 @@ closes the files associated with
 .I p
 and deallocates resources.
 .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()
 flushes the output buffer to the ``savefile,'' so that any packets
 written with
diff --git a/pcap.h b/pcap.h
index 3277b9899382088f6cc266edb470e610fdd682d4..2ce11a150b483d522116974b5ac686910c3b2bf7 100644 (file)
--- a/pcap.h
+++ b/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.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
@@ -209,6 +209,7 @@ pcap_dumper_t *pcap_dump_open(pcap_t *, const char *);
 int    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 *);
+FILE   *pcap_dump_file(pcap_dumper_t *);
 
 int    pcap_findalldevs(pcap_if_t **, char *);
 void   pcap_freealldevs(pcap_if_t *);
index 1f5798c52a076d9c4a982210a1e2d87358960a90..d3b952889eceb79f4e9eaf6d4a6c47d008a1680c 100644 (file)
@@ -30,7 +30,7 @@
 
 #ifndef lint
 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
 
 #ifdef HAVE_CONFIG_H
@@ -840,6 +840,12 @@ pcap_dump_open(pcap_t *p, const char *fname)
        return ((pcap_dumper_t *)f);
 }
 
+FILE *
+pcap_dump_file(pcap_dumper_t *p)
+{
+       return ((FILE *)p);
+}
+
 int
 pcap_dump_flush(pcap_dumper_t *p)
 {