diff options
author | Guy Harris <guy@alum.mit.edu> | 2014-05-23 10:50:02 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2014-05-23 10:50:10 +0000 |
commit | a344c9736efe5519543da1290e1ad9065d0b0cff (patch) | |
tree | 7757d80d74ae710e5d4e4a1b0cb638d0ec644fc4 /wiretap/k12text.l | |
parent | 716fdc8e398ea7435b23192ab1f7d59e7b21e32b (diff) |
Revert "Allow wtap_read() and wtap_seek_read() to return non-packet records."
This reverts commit c0c480d08c175eed4524ea9e73ec86298f468cf4.
A better way to do this is to have the record type be part of struct wtap_pkthdr; that keeps the metadata for the record together and requires fewer API changes. That is in-progress.
Change-Id: Ic558f163a48e2c6d0df7f55e81a35a5e24b53bc6
Reviewed-on: https://code.wireshark.org/review/1741
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 8db5c673c8..42de8e6875 100644 --- a/wiretap/k12text.l +++ b/wiretap/k12text.l @@ -244,7 +244,7 @@ k12text_reset(FILE_T fh) ii=0; } -static int +static gboolean 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 -1; + return FALSE; } 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 -1; + return FALSE; } *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 REC_TYPE_PACKET; + return TRUE; } -static int +static gboolean 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 -1; + return FALSE; } 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 -1; + return FALSE; } 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 REC_TYPE_PACKET; + return TRUE; } int |