diff options
author | Guy Harris <guy@alum.mit.edu> | 2019-04-04 18:56:27 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2019-04-05 02:49:43 +0000 |
commit | 8a5b26efb14b7f8f5375383436f03108d52d9aed (patch) | |
tree | eb57791fc53deab1c618b259e11092f122a8ee97 /wiretap/netxray.c | |
parent | b572b65e518937f43b630991c07369d8e0c79f53 (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/netxray.c')
-rw-r--r-- | wiretap/netxray.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/wiretap/netxray.c b/wiretap/netxray.c index 806ca1fd34..36875341b0 100644 --- a/wiretap/netxray.c +++ b/wiretap/netxray.c @@ -389,8 +389,8 @@ typedef struct { guint isdn_type; /* 1 = E1 PRI, 2 = T1 PRI, 3 = BRI */ } netxray_t; -static gboolean netxray_read(wtap *wth, int *err, gchar **err_info, - gint64 *data_offset); +static gboolean netxray_read(wtap *wth, wtap_rec *rec, Buffer *buf, + int *err, gchar **err_info, gint64 *data_offset); static gboolean netxray_seek_read(wtap *wth, gint64 seek_off, wtap_rec *rec, Buffer *buf, int *err, gchar **err_info); static int netxray_process_rec_header(wtap *wth, FILE_T fh, @@ -967,8 +967,8 @@ netxray_open(wtap *wth, int *err, gchar **err_info) /* Read the next packet */ static gboolean -netxray_read(wtap *wth, int *err, gchar **err_info, - gint64 *data_offset) +netxray_read(wtap *wth, wtap_rec *rec, Buffer *buf, int *err, + gchar **err_info, gint64 *data_offset) { netxray_t *netxray = (netxray_t *)wth->priv; int padding; @@ -988,8 +988,7 @@ reread: } /* Read and process record header. */ - padding = netxray_process_rec_header(wth, wth->fh, &wth->rec, err, - err_info); + padding = netxray_process_rec_header(wth, wth->fh, rec, err, err_info); if (padding < 0) { /* * Error or EOF. @@ -1042,8 +1041,8 @@ reread: /* * Read the packet data. */ - if (!wtap_read_packet_bytes(wth->fh, wth->rec_data, - wth->rec.rec_header.packet_header.caplen, err, err_info)) + if (!wtap_read_packet_bytes(wth->fh, buf, + rec->rec_header.packet_header.caplen, err, err_info)) return FALSE; /* @@ -1057,7 +1056,7 @@ reread: * from the packet header to determine its type or subtype, * attempt to guess them from the packet data. */ - netxray_guess_atm_type(wth, &wth->rec, wth->rec_data); + netxray_guess_atm_type(wth, rec, buf); return TRUE; } |