aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/erf.c
diff options
context:
space:
mode:
Diffstat (limited to 'wiretap/erf.c')
-rw-r--r--wiretap/erf.c34
1 files changed, 18 insertions, 16 deletions
diff --git a/wiretap/erf.c b/wiretap/erf.c
index 67b7ccab1d..3513642121 100644
--- a/wiretap/erf.c
+++ b/wiretap/erf.c
@@ -64,11 +64,11 @@ static int erf_read_header(FILE_T fh,
gchar **err_info,
guint32 *bytes_read,
guint32 *packet_size);
-static gboolean erf_read(wtap *wth, int *err, gchar **err_info,
- gint64 *data_offset);
-static gboolean erf_seek_read(wtap *wth, gint64 seek_off,
- struct wtap_pkthdr *phdr, Buffer *buf,
- int *err, gchar **err_info);
+static int erf_read(wtap *wth, int *err, gchar **err_info,
+ gint64 *data_offset);
+static int erf_seek_read(wtap *wth, gint64 seek_off,
+ struct wtap_pkthdr *phdr, Buffer *buf,
+ int *err, gchar **err_info);
static const struct {
int erf_encap_value;
@@ -280,7 +280,7 @@ extern int erf_open(wtap *wth, int *err, gchar **err_info)
}
/* Read the next packet */
-static gboolean erf_read(wtap *wth, int *err, gchar **err_info,
+static int erf_read(wtap *wth, int *err, gchar **err_info,
gint64 *data_offset)
{
erf_header_t erf_header;
@@ -292,36 +292,38 @@ static gboolean erf_read(wtap *wth, int *err, gchar **err_info,
if (!erf_read_header(wth->fh,
&wth->phdr, &erf_header,
err, err_info, &bytes_read, &packet_size)) {
- return FALSE;
+ return -1;
}
if (!wtap_read_packet_bytes(wth->fh, wth->frame_buffer, packet_size,
err, err_info))
- return FALSE;
+ return -1;
} while ( erf_header.type == ERF_TYPE_PAD );
- return TRUE;
+ return REC_TYPE_PACKET;
}
-static gboolean erf_seek_read(wtap *wth, gint64 seek_off,
- struct wtap_pkthdr *phdr, Buffer *buf,
- int *err, gchar **err_info)
+static int erf_seek_read(wtap *wth, gint64 seek_off,
+ struct wtap_pkthdr *phdr, Buffer *buf,
+ int *err, gchar **err_info)
{
erf_header_t erf_header;
guint32 packet_size;
if (file_seek(wth->random_fh, seek_off, SEEK_SET, err) == -1)
- return FALSE;
+ return -1;
do {
if (!erf_read_header(wth->random_fh, phdr, &erf_header,
err, err_info, NULL, &packet_size))
- return FALSE;
+ return -1;
} while ( erf_header.type == ERF_TYPE_PAD );
- return wtap_read_packet_bytes(wth->random_fh, buf, packet_size,
- err, err_info);
+ if (!wtap_read_packet_bytes(wth->random_fh, buf, packet_size,
+ err, err_info))
+ return -1;
+ return REC_TYPE_PACKET;
}
static int erf_read_header(FILE_T fh,