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/k12text.l | |
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/k12text.l')
-rw-r--r-- | wiretap/k12text.l | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/wiretap/k12text.l b/wiretap/k12text.l index 42de8e6875..8db5c673c8 100644 --- a/wiretap/k12text.l +++ b/wiretap/k12text.l @@ -244,7 +244,7 @@ k12text_reset(FILE_T fh) ii=0; } -static gboolean +static int k12text_read(wtap *wth, int *err, char ** err_info, gint64 *data_offset) { k12text_t *k12text = (k12text_t *)wth->priv; @@ -259,7 +259,7 @@ k12text_read(wtap *wth, int *err, char ** err_info, gint64 *data_offset) */ if ( file_seek(wth->fh, k12text->next_frame_offset, SEEK_SET, err) == -1) { - return FALSE; + return -1; } k12text_reset(wth->fh); /* init lexer buffer and vars set by lexer */ @@ -274,7 +274,7 @@ k12text_read(wtap *wth, int *err, char ** err_info, gint64 *data_offset) *err = WTAP_ERR_BAD_FILE; *err_info = error_str; } - return FALSE; + return -1; } *data_offset = k12text->next_frame_offset; /* file position for beginning of this frame */ @@ -285,14 +285,14 @@ k12text_read(wtap *wth, int *err, char ** err_info, gint64 *data_offset) buffer_assure_space(wth->frame_buffer, wth->phdr.caplen); memcpy(buffer_start_ptr(wth->frame_buffer), bb, wth->phdr.caplen); - return TRUE; + return REC_TYPE_PACKET; } -static gboolean +static int k12text_seek_read(wtap *wth, gint64 seek_off, struct wtap_pkthdr *phdr, Buffer *buf, int *err, char **err_info) { if ( file_seek(wth->random_fh, seek_off, SEEK_SET, err) == -1) { - return FALSE; + return -1; } k12text_reset(wth->random_fh); /* init lexer buffer and vars set by lexer */ @@ -307,7 +307,7 @@ k12text_seek_read(wtap *wth, gint64 seek_off, struct wtap_pkthdr *phdr, Buffer * } else { *err_info = error_str; } - return FALSE; + return -1; } k12text_set_headers(phdr); @@ -315,7 +315,7 @@ k12text_seek_read(wtap *wth, gint64 seek_off, struct wtap_pkthdr *phdr, Buffer * buffer_assure_space(buf, phdr->caplen); memcpy(buffer_start_ptr(buf), bb, phdr->caplen); - return TRUE; + return REC_TYPE_PACKET; } int |