summaryrefslogtreecommitdiff
path: root/wiretap/netxray.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2014-05-23 10:50:02 +0000
committerGuy Harris <guy@alum.mit.edu>2014-05-23 10:50:10 +0000
commita344c9736efe5519543da1290e1ad9065d0b0cff (patch)
tree7757d80d74ae710e5d4e4a1b0cb638d0ec644fc4 /wiretap/netxray.c
parent716fdc8e398ea7435b23192ab1f7d59e7b21e32b (diff)
downloadwireshark-a344c9736efe5519543da1290e1ad9065d0b0cff.tar.gz
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/netxray.c')
-rw-r--r--wiretap/netxray.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/wiretap/netxray.c b/wiretap/netxray.c
index 782918c921..e6dd704bb3 100644
--- a/wiretap/netxray.c
+++ b/wiretap/netxray.c
@@ -402,9 +402,9 @@ typedef struct {
guint isdn_type; /* 1 = E1 PRI, 2 = T1 PRI, 3 = BRI */
} netxray_t;
-static int netxray_read(wtap *wth, int *err, gchar **err_info,
+static gboolean netxray_read(wtap *wth, int *err, gchar **err_info,
gint64 *data_offset);
-static int netxray_seek_read(wtap *wth, gint64 seek_off,
+static gboolean netxray_seek_read(wtap *wth, gint64 seek_off,
struct wtap_pkthdr *phdr, Buffer *buf, int *err, gchar **err_info);
static int netxray_process_rec_header(wtap *wth, FILE_T fh,
struct wtap_pkthdr *phdr, int *err, gchar **err_info);
@@ -989,7 +989,7 @@ netxray_open(wtap *wth, int *err, gchar **err_info)
}
/* Read the next packet */
-static int
+static gboolean
netxray_read(wtap *wth, int *err, gchar **err_info,
gint64 *data_offset)
{
@@ -1007,7 +1007,7 @@ reread:
if (*data_offset == netxray->end_offset) {
/* Yes. */
*err = 0; /* it's just an EOF, not an error */
- return -1;
+ return FALSE;
}
/* Read and process record header. */
@@ -1021,7 +1021,7 @@ reread:
/*
* Error of some sort; give up.
*/
- return -1;
+ return FALSE;
}
/* We're at EOF. Wrap?
@@ -1046,7 +1046,7 @@ reread:
*/
if (netxray->start_offset < netxray->end_offset) {
*err = WTAP_ERR_SHORT_READ;
- return -1;
+ return FALSE;
}
if (!netxray->wrapped) {
@@ -1054,12 +1054,12 @@ reread:
netxray->wrapped = TRUE;
if (file_seek(wth->fh, CAPTUREFILE_HEADER_SIZE,
SEEK_SET, err) == -1)
- return -1;
+ return FALSE;
goto reread;
}
/* We've already wrapped - don't wrap again. */
- return -1;
+ return FALSE;
}
/*
@@ -1067,13 +1067,13 @@ reread:
*/
if (!wtap_read_packet_bytes(wth->fh, wth->frame_buffer,
wth->phdr.caplen, err, err_info))
- return -1;
+ return FALSE;
/*
* If there's extra stuff at the end of the record, skip it.
*/
if (file_seek(wth->fh, padding, SEEK_CUR, err) == -1)
- return -1;
+ return FALSE;
/*
* If it's an ATM packet, and we don't have enough information
@@ -1081,16 +1081,16 @@ reread:
* attempt to guess them from the packet data.
*/
netxray_guess_atm_type(wth, &wth->phdr, wth->frame_buffer);
- return REC_TYPE_PACKET;
+ return TRUE;
}
-static int
+static gboolean
netxray_seek_read(wtap *wth, gint64 seek_off,
struct wtap_pkthdr *phdr, Buffer *buf,
int *err, gchar **err_info)
{
if (file_seek(wth->random_fh, seek_off, SEEK_SET, err) == -1)
- return -1;
+ return FALSE;
if (netxray_process_rec_header(wth, wth->random_fh, phdr, err,
err_info) == -1) {
@@ -1102,7 +1102,7 @@ netxray_seek_read(wtap *wth, gint64 seek_off,
*/
*err = WTAP_ERR_SHORT_READ;
}
- return -1;
+ return FALSE;
}
/*
@@ -1110,7 +1110,7 @@ netxray_seek_read(wtap *wth, gint64 seek_off,
*/
if (!wtap_read_packet_bytes(wth->random_fh, buf, phdr->caplen, err,
err_info))
- return -1;
+ return FALSE;
/*
* If it's an ATM packet, and we don't have enough information
@@ -1118,7 +1118,7 @@ netxray_seek_read(wtap *wth, gint64 seek_off,
* attempt to guess them from the packet data.
*/
netxray_guess_atm_type(wth, phdr, buf);
- return REC_TYPE_PACKET;
+ return TRUE;
}
static int