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/ascendtext.c | |
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/ascendtext.c')
-rw-r--r-- | wiretap/ascendtext.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/wiretap/ascendtext.c b/wiretap/ascendtext.c index 32d4d49418..58ea2fbea6 100644 --- a/wiretap/ascendtext.c +++ b/wiretap/ascendtext.c @@ -74,9 +74,9 @@ static const ascend_magic_string ascend_magic[] = { { ASCEND_PFX_ETHER, "ETHER" }, }; -static gboolean ascend_read(wtap *wth, int *err, gchar **err_info, +static int ascend_read(wtap *wth, int *err, gchar **err_info, gint64 *data_offset); -static gboolean ascend_seek_read(wtap *wth, gint64 seek_off, +static int ascend_seek_read(wtap *wth, gint64 seek_off, struct wtap_pkthdr *phdr, Buffer *buf, int *err, gchar **err_info); @@ -237,36 +237,36 @@ static gboolean ascend_read(wtap *wth, int *err, gchar **err_info, packet's header because we might mistake part of it for a new header. */ if (file_seek(wth->fh, ascend->next_packet_seek_start, SEEK_SET, err) == -1) - return FALSE; + return -1; offset = ascend_seek(wth, err, err_info); if (offset == -1) - return FALSE; + return -1; if (parse_ascend(ascend, wth->fh, &wth->phdr, wth->frame_buffer, wth->snapshot_length) != PARSED_RECORD) { *err = WTAP_ERR_BAD_FILE; *err_info = g_strdup((ascend_parse_error != NULL) ? ascend_parse_error : "parse error"); - return FALSE; + return -1; } *data_offset = offset; - return TRUE; + return REC_TYPE_PACKET; } -static gboolean ascend_seek_read(wtap *wth, gint64 seek_off, +static int ascend_seek_read(wtap *wth, gint64 seek_off, struct wtap_pkthdr *phdr, Buffer *buf, int *err, gchar **err_info) { ascend_t *ascend = (ascend_t *)wth->priv; if (file_seek(wth->random_fh, seek_off, SEEK_SET, err) == -1) - return FALSE; + return -1; if (parse_ascend(ascend, wth->random_fh, phdr, buf, wth->snapshot_length) != PARSED_RECORD) { *err = WTAP_ERR_BAD_FILE; *err_info = g_strdup((ascend_parse_error != NULL) ? ascend_parse_error : "parse error"); - return FALSE; + return -1; } - return TRUE; + return REC_TYPE_PACKET; } |