aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/file.c
diff options
context:
space:
mode:
authorGilbert Ramirez <gram@alumni.rice.edu>1999-03-01 18:57:07 +0000
committerGilbert Ramirez <gram@alumni.rice.edu>1999-03-01 18:57:07 +0000
commit2dbd008ea50317cc7645a540f4b456eef432c703 (patch)
tree16651cda09bd216cf1ecee07363ef4ce546aeaad /wiretap/file.c
parent2744866326f422d4293f5ecf7ac2c6de8bee0237 (diff)
Added display filters to wiretap.
svn path=/trunk/; revision=198
Diffstat (limited to 'wiretap/file.c')
-rw-r--r--wiretap/file.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/wiretap/file.c b/wiretap/file.c
index 4003fc6868..5a13761002 100644
--- a/wiretap/file.c
+++ b/wiretap/file.c
@@ -1,6 +1,6 @@
/* file.c
*
- * $Id: file.c,v 1.8 1999/02/20 06:49:26 guy Exp $
+ * $Id: file.c,v 1.9 1999/03/01 18:57:04 gram Exp $
*
* Wiretap Library
* Copyright (c) 1998 by Gilbert Ramirez <gram@verdict.uthscsa.edu>
@@ -25,6 +25,7 @@
#include <string.h>
#include <stdlib.h>
#include "wtap.h"
+#include "buffer.h"
#include "lanalyzer.h"
#include "ngsniffer.h"
#include "libpcap.h"
@@ -50,7 +51,14 @@ wtap* wtap_open_offline(char *filename)
return NULL;
}
- /* Try all my file types */
+ /* initialization */
+ wth->file_encap = WTAP_ENCAP_NONE;
+ wth->filter.offline = NULL;
+ wth->filter_type = WTAP_FILTER_NONE;
+ wth->filter_length = 0;
+ wth->offline_filter_lengths = NULL;
+
+ /* Try all file types */
/* WTAP_FILE_PCAP */
if ((wth->file_type = libpcap_open(wth)) != WTAP_FILE_UNKNOWN) {
@@ -89,8 +97,7 @@ wtap* wtap_open_offline(char *filename)
return wth;
success:
- buffer_init(&wth->frame_buffer, 1500);
- wth->frame_number = 0;
- wth->file_byte_offset = 0;
+ wth->frame_buffer = g_malloc(sizeof(struct Buffer));
+ buffer_init(wth->frame_buffer, 1500);
return wth;
}