diff options
author | Guy Harris <guy@alum.mit.edu> | 2018-02-08 16:19:12 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2018-02-09 00:29:51 +0000 |
commit | 1f5f63f8ef98bfe9c4d734674cee0df64855555d (patch) | |
tree | 133dd3563cc8d2d29dd85d4d43cd9a4636283192 /wiretap/wtap-int.h | |
parent | e4c5efafb7da2d25b7d47fe2dac3b1556c0b67b0 (diff) |
Generalize wtap_pkthdr into a structure for packet and non-packet records.
Separate the stuff that any record could have from the stuff that only
particular record types have; put the latter into a union, and put all
that into a wtap_rec structure.
Add some record-type checks as necessary.
Change-Id: Id6b3486858f826fce4b096c59231f463e44bfaa2
Reviewed-on: https://code.wireshark.org/review/25696
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'wiretap/wtap-int.h')
-rw-r--r-- | wiretap/wtap-int.h | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/wiretap/wtap-int.h b/wiretap/wtap-int.h index 0bf6279f0d..fb8d78e471 100644 --- a/wiretap/wtap-int.h +++ b/wiretap/wtap-int.h @@ -25,9 +25,8 @@ WS_DLL_PUBLIC int wtap_fstat(wtap *wth, ws_statb64 *statb, int *err); typedef gboolean (*subtype_read_func)(struct wtap*, int*, char**, gint64*); -typedef gboolean (*subtype_seek_read_func)(struct wtap*, gint64, - struct wtap_pkthdr *, Buffer *buf, - int *, char **); +typedef gboolean (*subtype_seek_read_func)(struct wtap*, gint64, wtap_rec *, + Buffer *, int *, char **); /** * Struct holding data of the currently read file. @@ -38,8 +37,8 @@ struct wtap { gboolean ispipe; /**< TRUE if the file is a pipe */ int file_type_subtype; guint snapshot_length; - struct Buffer *frame_buffer; - struct wtap_pkthdr phdr; + wtap_rec rec; + Buffer *rec_data; GArray *shb_hdrs; GArray *interface_data; /**< An array holding the interface data from pcapng IDB:s or equivalent(?)*/ GArray *nrb_hdrs; /**< holds the Name Res Block's comment/custom_opts, or NULL */ @@ -80,7 +79,7 @@ struct wtap_dumper; typedef void *WFILE_T; typedef gboolean (*subtype_write_func)(struct wtap_dumper*, - const struct wtap_pkthdr*, + const wtap_rec *rec, const guint8*, int*, gchar**); typedef gboolean (*subtype_finish_func)(struct wtap_dumper*, int*); |