From 8a5b26efb14b7f8f5375383436f03108d52d9aed Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Thu, 4 Apr 2019 18:56:27 -0700 Subject: 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 Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris --- wiretap/cosine.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'wiretap/cosine.c') diff --git a/wiretap/cosine.c b/wiretap/cosine.c index d2c2fae9e4..26641b156b 100644 --- a/wiretap/cosine.c +++ b/wiretap/cosine.c @@ -149,8 +149,8 @@ static gboolean empty_line(const gchar *line); static gint64 cosine_seek_next_packet(wtap *wth, int *err, gchar **err_info, char *hdr); static gboolean cosine_check_file_type(wtap *wth, int *err, gchar **err_info); -static gboolean cosine_read(wtap *wth, int *err, gchar **err_info, - gint64 *data_offset); +static gboolean cosine_read(wtap *wth, wtap_rec *rec, Buffer *buf, + int *err, gchar **err_info, gint64 *data_offset); static gboolean cosine_seek_read(wtap *wth, gint64 seek_off, wtap_rec *rec, Buffer *buf, int *err, gchar **err_info); static int parse_cosine_packet(FILE_T fh, wtap_rec *rec, Buffer* buf, @@ -266,8 +266,8 @@ wtap_open_return_val cosine_open(wtap *wth, int *err, gchar **err_info) } /* Find the next packet and parse it; called from wtap_read(). */ -static gboolean cosine_read(wtap *wth, int *err, gchar **err_info, - gint64 *data_offset) +static gboolean cosine_read(wtap *wth, wtap_rec *rec, Buffer *buf, + int *err, gchar **err_info, gint64 *data_offset) { gint64 offset; char line[COSINE_LINE_LENGTH]; @@ -279,8 +279,7 @@ static gboolean cosine_read(wtap *wth, int *err, gchar **err_info, *data_offset = offset; /* Parse the header and convert the ASCII hex dump to binary data */ - return parse_cosine_packet(wth->fh, &wth->rec, wth->rec_data, - line, err, err_info); + return parse_cosine_packet(wth->fh, rec, buf, line, err, err_info); } /* Used to read packets in random-access fashion */ -- cgit v1.2.3