aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/nettl.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2019-04-04 18:56:27 -0700
committerGuy Harris <guy@alum.mit.edu>2019-04-05 02:49:43 +0000
commit8a5b26efb14b7f8f5375383436f03108d52d9aed (patch)
treeeb57791fc53deab1c618b259e11092f122a8ee97 /wiretap/nettl.c
parentb572b65e518937f43b630991c07369d8e0c79f53 (diff)
Have wtap_read() fill in a wtap_rec and Buffer.
That makes it - and the routines that implement it - work more like the seek-read routine. Change-Id: I0cace2d0e4c9ebfc21ac98fd1af1ec70f60a240d Reviewed-on: https://code.wireshark.org/review/32727 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'wiretap/nettl.c')
-rw-r--r--wiretap/nettl.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/wiretap/nettl.c b/wiretap/nettl.c
index 57bf441e31..9aa5c004e2 100644
--- a/wiretap/nettl.c
+++ b/wiretap/nettl.c
@@ -162,8 +162,8 @@ typedef struct {
gboolean is_hpux_11;
} nettl_t;
-static gboolean nettl_read(wtap *wth, int *err, gchar **err_info,
- gint64 *data_offset);
+static gboolean nettl_read(wtap *wth, wtap_rec *rec, Buffer *buf,
+ int *err, gchar **err_info, gint64 *data_offset);
static gboolean nettl_seek_read(wtap *wth, gint64 seek_off,
wtap_rec *rec, Buffer *buf,
int *err, gchar **err_info);
@@ -261,13 +261,12 @@ wtap_open_return_val nettl_open(wtap *wth, int *err, gchar **err_info)
}
/* Read the next packet */
-static gboolean nettl_read(wtap *wth, int *err, gchar **err_info,
- gint64 *data_offset)
+static gboolean nettl_read(wtap *wth, wtap_rec *rec, Buffer *buf,
+ int *err, gchar **err_info, gint64 *data_offset)
{
/* Read record. */
*data_offset = file_tell(wth->fh);
- if (!nettl_read_rec(wth, wth->fh, &wth->rec, wth->rec_data,
- err, err_info)) {
+ if (!nettl_read_rec(wth, wth->fh, rec, buf, err, err_info)) {
/* Read error or EOF */
return FALSE;
}
@@ -281,9 +280,9 @@ static gboolean nettl_read(wtap *wth, int *err, gchar **err_info,
* have a single encapsulation for all packets in the file.
*/
if (wth->file_encap == WTAP_ENCAP_UNKNOWN)
- wth->file_encap = wth->rec.rec_header.packet_header.pkt_encap;
+ wth->file_encap = rec->rec_header.packet_header.pkt_encap;
else {
- if (wth->file_encap != wth->rec.rec_header.packet_header.pkt_encap)
+ if (wth->file_encap != rec->rec_header.packet_header.pkt_encap)
wth->file_encap = WTAP_ENCAP_PER_PACKET;
}