summaryrefslogtreecommitdiff
path: root/wiretap/iseries.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/iseries.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/iseries.c')
-rw-r--r--wiretap/iseries.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/wiretap/iseries.c b/wiretap/iseries.c
index 4c42fb4502..0a171a6341 100644
--- a/wiretap/iseries.c
+++ b/wiretap/iseries.c
@@ -187,9 +187,9 @@ static gboolean iseries_seek_read (wtap * wth, gint64 seek_off,
static gboolean iseries_check_file_type (wtap * wth, int *err, gchar **err_info,
int format);
static gint64 iseries_seek_next_packet (wtap * wth, int *err, gchar **err_info);
-static int iseries_parse_packet (wtap * wth, FILE_T fh,
- struct wtap_pkthdr *phdr,
- Buffer * buf, int *err, gchar ** err_info);
+static gboolean iseries_parse_packet (wtap * wth, FILE_T fh,
+ struct wtap_pkthdr *phdr,
+ Buffer * buf, int *err, gchar ** err_info);
static int iseries_UNICODE_to_ASCII (guint8 * buf, guint bytes);
static gboolean iseries_parse_hex_string (const char * ascii, guint8 * buf,
size_t len);
@@ -370,7 +370,7 @@ iseries_check_file_type (wtap * wth, int *err, gchar **err_info, int format)
/*
* Find the next packet and parse it; called from wtap_read().
*/
-static int
+static gboolean
iseries_read (wtap * wth, int *err, gchar ** err_info, gint64 *data_offset)
{
gint64 offset;
@@ -457,14 +457,14 @@ iseries_seek_next_packet (wtap * wth, int *err, gchar **err_info)
/*
* Read packets in random-access fashion
*/
-static int
+static gboolean
iseries_seek_read (wtap * wth, gint64 seek_off, struct wtap_pkthdr *phdr,
Buffer * buf, int *err, gchar ** err_info)
{
/* seek to packet location */
if (file_seek (wth->random_fh, seek_off - 1, SEEK_SET, err) == -1)
- return -1;
+ return FALSE;
/*
* Parse the packet and extract the various fields
@@ -554,7 +554,7 @@ done:
}
/* Parses a packet. */
-static int
+static gboolean
iseries_parse_packet (wtap * wth, FILE_T fh, struct wtap_pkthdr *phdr,
Buffer *buf, int *err, gchar **err_info)
{
@@ -581,7 +581,7 @@ iseries_parse_packet (wtap * wth, FILE_T fh, struct wtap_pkthdr *phdr,
if (file_gets (data, ISERIES_LINE_LENGTH, fh) == NULL)
{
*err = file_error (fh, err_info);
- return -1;
+ return FALSE;
}
/* Convert UNICODE data to ASCII */
if (iseries->format == ISERIES_FORMAT_UNICODE)
@@ -615,7 +615,7 @@ iseries_parse_packet (wtap * wth, FILE_T fh, struct wtap_pkthdr *phdr,
{
*err = WTAP_ERR_BAD_FILE;
*err_info = g_strdup ("iseries: packet header isn't valid");
- return -1;
+ return FALSE;
}
phdr->presence_flags = WTAP_HAS_CAP_LEN;
@@ -747,7 +747,7 @@ iseries_parse_packet (wtap * wth, FILE_T fh, struct wtap_pkthdr *phdr,
if (ascii_offset == -1)
{
/* Bad line. */
- return -1;
+ return FALSE;
}
continue;
}
@@ -769,7 +769,7 @@ iseries_parse_packet (wtap * wth, FILE_T fh, struct wtap_pkthdr *phdr,
if (ascii_offset == -1)
{
/* Bad line. */
- return -1;
+ return FALSE;
}
continue;
}
@@ -792,7 +792,7 @@ iseries_parse_packet (wtap * wth, FILE_T fh, struct wtap_pkthdr *phdr,
if (ascii_offset == -1)
{
/* Bad line. */
- return -1;
+ return FALSE;
}
continue;
}
@@ -842,11 +842,11 @@ iseries_parse_packet (wtap * wth, FILE_T fh, struct wtap_pkthdr *phdr,
/* free buffer allocs and return */
*err = 0;
g_free (ascii_buf);
- return REC_TYPE_PACKET;
+ return TRUE;
errxit:
g_free (ascii_buf);
- return -1;
+ return FALSE;
}
/*