#include "i4btrace.h"
static gboolean i4btrace_read(wtap *wth, int *err, gchar **err_info,
- long *data_offset);
-static gboolean i4btrace_seek_read(wtap *wth, long seek_off,
+ gint64 *data_offset);
+static gboolean i4btrace_seek_read(wtap *wth, gint64 seek_off,
union wtap_pseudo_header *pseudo_header, guchar *pd, int length,
int *err, gchar **err_info);
static int i4b_read_rec_header(FILE_T fh, i4b_trace_hdr_t *hdr, int *err);
* Test some fields in the header to see if they make sense.
*/
#define I4B_HDR_IS_OK(hdr) \
- (!((unsigned)hdr.length < 3 || (unsigned)hdr.unit > 4 || \
- (unsigned)hdr.type > 4 || (unsigned)hdr.dir > 2 || \
- (unsigned)hdr.trunc > 2048))
+ (!((unsigned)hdr.length < 3 || (unsigned)hdr.length > 16384 || \
+ (unsigned)hdr.unit > 4 || (unsigned)hdr.type > 4 || \
+ (unsigned)hdr.dir > 2 || (unsigned)hdr.trunc > 2048))
int i4btrace_open(wtap *wth, int *err, gchar **err_info _U_)
{
/* Read the next packet */
static gboolean i4btrace_read(wtap *wth, int *err, gchar **err_info,
- long *data_offset)
+ gint64 *data_offset)
{
int ret;
i4b_trace_hdr_t hdr;
- guint16 length;
+ guint32 length;
void *bufp;
/* Read record header. */
hdr.length, (unsigned long)sizeof(hdr));
return FALSE;
}
- length = hdr.length - sizeof(hdr);
+ length = hdr.length - (guint32)sizeof(hdr);
wth->phdr.len = length;
wth->phdr.caplen = length;
}
static gboolean
-i4btrace_seek_read(wtap *wth, long seek_off,
+i4btrace_seek_read(wtap *wth, gint64 seek_off,
union wtap_pseudo_header *pseudo_header, guchar *pd, int length,
int *err, gchar **err_info _U_)
{