diff options
author | Guy Harris <guy@alum.mit.edu> | 2014-05-22 20:01:31 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2014-05-23 03:02:32 +0000 |
commit | c0c480d08c175eed4524ea9e73ec86298f468cf4 (patch) | |
tree | 1234cd09094dcc8447e3fb2b13671f12aba5ae69 /wiretap/wtap.h | |
parent | 6287efb9c05482531ea675bb5a3d23b03b5715ab (diff) | |
download | wireshark-c0c480d08c175eed4524ea9e73ec86298f468cf4.tar.gz |
Allow wtap_read() and wtap_seek_read() to return non-packet records.
This is the first step towards implementing the mechanisms requestd in
bug 8590; currently, we don't return any records other than packet
records from libwiretap, and just ignore non-packet records in the rest
of Wireshark, but this at least gets the ball rolling.
Change-Id: I34a45b54dd361f69fdad1a758d8ca4f42d67d574
Reviewed-on: https://code.wireshark.org/review/1736
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'wiretap/wtap.h')
-rw-r--r-- | wiretap/wtap.h | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/wiretap/wtap.h b/wiretap/wtap.h index 005d748304..3e47b3c8dc 100644 --- a/wiretap/wtap.h +++ b/wiretap/wtap.h @@ -1349,15 +1349,24 @@ typedef void (*wtap_new_ipv6_callback_t) (const void *addrp, const gchar *name); WS_DLL_PUBLIC void wtap_set_cb_new_ipv6(wtap *wth, wtap_new_ipv6_callback_t add_new_ipv6); -/** Returns TRUE if read was successful. FALSE if failure. data_offset is - * set to the offset in the file where the data for the read packet is - * located. */ +/* + * Values returned by wtap_read() and wtap_seek_read(). They indicate the + * type of record read by that routine. + * + * This list will expand over time, so don't assume everything will be a + * file-type-specific record or a packet record. + */ +#define REC_TYPE_FILE_TYPE_SPECIFIC 0 /* file-type-specific record */ +#define REC_TYPE_PACKET 1 /* packet */ + +/** Returns a REC_TYPE_ value if read was successful, -1 if it failed. + * *data_offset is set to the offset in the file where the data for + * the read packet is located. */ WS_DLL_PUBLIC -gboolean wtap_read(wtap *wth, int *err, gchar **err_info, - gint64 *data_offset); +int wtap_read(wtap *wth, int *err, gchar **err_info, gint64 *data_offset); WS_DLL_PUBLIC -gboolean wtap_seek_read (wtap *wth, gint64 seek_off, +int wtap_seek_read (wtap *wth, gint64 seek_off, struct wtap_pkthdr *phdr, Buffer *buf, int *err, gchar **err_info); /*** get various information snippets about the current packet ***/ |