aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/ipfix.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2013-06-16 00:20:00 +0000
committerGuy Harris <guy@alum.mit.edu>2013-06-16 00:20:00 +0000
commit8c9edf12800bc6d68894dc457e7ebaf994429da8 (patch)
treeec6efefbd4e7f8227a7b96661f721ff4ba2986c3 /wiretap/ipfix.c
parent3846abe34d6861c6ee0bba61fcd5baa4d213885c (diff)
Have the seek-read routines take a Buffer rather than a guint8 pointer
as the "where to put the packet data" argument. This lets more of the libwiretap code be common between the read and seek-read code paths, and also allows for more flexibility in the "fill in the data" path - we can expand the buffer as needed in both cases. svn path=/trunk/; revision=49949
Diffstat (limited to 'wiretap/ipfix.c')
-rw-r--r--wiretap/ipfix.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/wiretap/ipfix.c b/wiretap/ipfix.c
index b10faf489a..26b2e43e49 100644
--- a/wiretap/ipfix.c
+++ b/wiretap/ipfix.c
@@ -92,7 +92,7 @@ ipfix_read(wtap *wth, int *err, gchar **err_info,
gint64 *data_offset);
static gboolean
ipfix_seek_read(wtap *wth, gint64 seek_off,
- struct wtap_pkthdr *phdr, guint8 *pd, int length,
+ struct wtap_pkthdr *phdr, Buffer *buf, int length,
int *err, gchar **err_info);
static void
ipfix_close(wtap *wth);
@@ -295,17 +295,15 @@ ipfix_read(wtap *wth, int *err, gchar **err_info, gint64 *data_offset)
return FALSE;
}
- buffer_assure_space(wth->frame_buffer, wth->phdr.caplen);
- wtap_file_read_expected_bytes(buffer_start_ptr(wth->frame_buffer),
- wth->phdr.caplen, wth->fh, err, err_info);
- return TRUE;
+ return wtap_read_packet_bytes(wth->fh, wth->frame_buffer, wth->phdr.caplen,
+ err, err_info);
}
/* classic wtap: seek to file position and read packet */
static gboolean
ipfix_seek_read(wtap *wth, gint64 seek_off,
- struct wtap_pkthdr *phdr, guint8 *pd, int length,
+ struct wtap_pkthdr *phdr, Buffer *buf, int length,
int *err, gchar **err_info)
{
/* seek to the right file position */
@@ -330,9 +328,7 @@ ipfix_seek_read(wtap *wth, gint64 seek_off,
return FALSE;
}
- wtap_file_read_expected_bytes(pd, length, wth->random_fh, err, err_info);
-
- return TRUE;
+ return wtap_read_packet_bytes(wth->random_fh, buf, length, err, err_info);
}