Use longs as file offsets, so that on platforms with 64-bit "long" we
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 4 Oct 2001 08:30:36 +0000 (08:30 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 4 Oct 2001 08:30:36 +0000 (08:30 +0000)
can handle capture files bigger than 2GB.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@3993 f5534014-38df-0310-8fa8-9805f1628bb7

23 files changed:
editcap.c
file.c
mergecap.c
tethereal.c
wiretap/ascend.c
wiretap/csids.c
wiretap/etherpeek.c
wiretap/file.c
wiretap/i4btrace.c
wiretap/iptrace.c
wiretap/lanalyzer.c
wiretap/libpcap.c
wiretap/netmon.c
wiretap/nettl.c
wiretap/netxray.c
wiretap/ngsniffer.c
wiretap/pppdump.c
wiretap/radcom.c
wiretap/snoop.c
wiretap/toshiba.c
wiretap/wtap-int.h
wiretap/wtap.c
wiretap/wtap.h

index b609acbe62840683b98d65def4b6a3a68916fc3c..42f6d569d12e02ce08054ffca1d7a8cb68d93ad3 100644 (file)
--- a/editcap.c
+++ b/editcap.c
@@ -1,7 +1,7 @@
 /* Edit capture files.  We can delete records, adjust timestamps, or
  * simply convert from one format to another format.
  *
- * $Id: editcap.c,v 1.17 2001/07/13 07:55:13 guy Exp $
+ * $Id: editcap.c,v 1.18 2001/10/04 08:30:33 guy Exp $
  *
  * Originally written by Richard Sharpe.
  * Improved by Guy Harris.
@@ -137,7 +137,7 @@ typedef struct {
  */
 
 static void
-edit_callback(u_char *user, const struct wtap_pkthdr *phdr, int offset,
+edit_callback(u_char *user, const struct wtap_pkthdr *phdr, long offset,
     union wtap_pseudo_header *pseudo_header, const u_char *buf) 
 {
   callback_arg *argp = (callback_arg *)user;
diff --git a/file.c b/file.c
index 88389ea6fac078daafec6a21ec0c77e0bca822aa..ed2e69fc075b9f97dc091dd2b12afe832523df78 100644 (file)
--- a/file.c
+++ b/file.c
@@ -1,7 +1,7 @@
 /* file.c
  * File I/O routines
  *
- * $Id: file.c,v 1.244 2001/08/21 06:39:14 guy Exp $
+ * $Id: file.c,v 1.245 2001/10/04 08:30:33 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -98,7 +98,7 @@ extern GtkWidget *packet_list, *byte_nb_ptr, *tree_view;
 static guint32 firstsec, firstusec;
 static guint32 prevsec, prevusec;
 
-static void read_packet(capture_file *cf, int offset);
+static void read_packet(capture_file *cf, long offset);
 
 static void rescan_packets(capture_file *cf, const char *action,
        gboolean refilter, gboolean redissect);
@@ -314,7 +314,7 @@ read_cap_file(capture_file *cf, int *err)
   char     *errmsg;
   char      errmsg_errno[1024+1];
   gchar     err_str[2048+1];
-  int       data_offset;
+  long      data_offset;
   progdlg_t *progbar;
   gboolean  stop_flag;
   int       file_pos;
@@ -477,7 +477,7 @@ start_tail_cap_file(char *fname, gboolean is_tempfile, capture_file *cf)
 read_status_t
 continue_tail_cap_file(capture_file *cf, int to_read, int *err)
 {
-  int data_offset = 0;
+  long data_offset = 0;
 
   gtk_clist_freeze(GTK_CLIST(packet_list));
 
@@ -518,7 +518,7 @@ continue_tail_cap_file(capture_file *cf, int to_read, int *err)
 read_status_t
 finish_tail_cap_file(capture_file *cf, int *err)
 {
-  int data_offset;
+  long data_offset;
 
   gtk_clist_freeze(GTK_CLIST(packet_list));
 
@@ -758,7 +758,7 @@ add_packet_to_packet_list(frame_data *fdata, capture_file *cf,
 }
 
 static void
-read_packet(capture_file *cf, int offset)
+read_packet(capture_file *cf, long offset)
 {
   const struct wtap_pkthdr *phdr = wtap_phdr(cf->wth);
   union wtap_pseudo_header *pseudo_header = wtap_pseudoheader(cf->wth);
index ac84d42c20a090e03659c7b7c243a39fd86770b7..79966f5dfb6945eb802014f73766371e18948eaf 100644 (file)
@@ -1,6 +1,6 @@
 /* Combine two dump files, either by appending or by merging by timestamp
  *
- * $Id: mergecap.c,v 1.4 2001/07/20 07:22:40 guy Exp $
+ * $Id: mergecap.c,v 1.5 2001/10/04 08:30:33 guy Exp $
  *
  * Written by Scott Renfro <scott@renfro.org> based on
  * editcap by Richard Sharpe and Guy Harris
@@ -47,7 +47,7 @@ typedef struct in_file_t {
   const char *filename;
   wtap       *wth;
   int         err;
-  int         data_offset;
+  long        data_offset;
   gboolean    ok;
 } in_file_t;
 
@@ -65,7 +65,7 @@ static out_file_t out_file;
  * Routine to write frame to output file
  */
 static void
-write_frame(u_char *user, const struct wtap_pkthdr *phdr, int offset,
+write_frame(u_char *user, const struct wtap_pkthdr *phdr, long offset,
             union wtap_pseudo_header *pseudo_header, const u_char *buf) 
 {
   wtap_dumper *pdh = (wtap_dumper*)user;
index 989ba10118f6dc6011589c8b3f3ee5093a6aec9c..5d94bc22a556d02a32440004dc2b24b6f7756575 100644 (file)
@@ -1,6 +1,6 @@
 /* tethereal.c
  *
- * $Id: tethereal.c,v 1.91 2001/09/05 05:03:47 guy Exp $
+ * $Id: tethereal.c,v 1.92 2001/10/04 08:30:33 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -133,10 +133,10 @@ typedef struct {
 } cb_args_t;
 
 static int load_cap_file(capture_file *, int);
-static void wtap_dispatch_cb_write(u_char *, const struct wtap_pkthdr *, int,
+static void wtap_dispatch_cb_write(u_char *, const struct wtap_pkthdr *, long,
     union wtap_pseudo_header *, const u_char *);
 static void show_capture_file_io_error(const char *, int, gboolean);
-static void wtap_dispatch_cb_print(u_char *, const struct wtap_pkthdr *, int,
+static void wtap_dispatch_cb_print(u_char *, const struct wtap_pkthdr *, long,
     union wtap_pseudo_header *, const u_char *);
 
 packet_info  pi;
@@ -974,7 +974,7 @@ out:
 static void
 fill_in_fdata(frame_data *fdata, capture_file *cf,
        const struct wtap_pkthdr *phdr,
-       const union wtap_pseudo_header *pseudo_header, int offset)
+       const union wtap_pseudo_header *pseudo_header, long offset)
 {
   int i;
 
@@ -1050,8 +1050,8 @@ clear_fdata(frame_data *fdata)
 }
 
 static void
-wtap_dispatch_cb_write(u_char *user, const struct wtap_pkthdr *phdr, int offset,
-  union wtap_pseudo_header *pseudo_header, const u_char *buf)
+wtap_dispatch_cb_write(u_char *user, const struct wtap_pkthdr *phdr,
+  long offset, union wtap_pseudo_header *pseudo_header, const u_char *buf)
 {
   cb_args_t    *args = (cb_args_t *) user;
   capture_file *cf = args->cf;
@@ -1147,8 +1147,8 @@ show_capture_file_io_error(const char *fname, int err, gboolean is_close)
 }
 
 static void
-wtap_dispatch_cb_print(u_char *user, const struct wtap_pkthdr *phdr, int offset,
-  union wtap_pseudo_header *pseudo_header, const u_char *buf)
+wtap_dispatch_cb_print(u_char *user, const struct wtap_pkthdr *phdr,
+  long offset, union wtap_pseudo_header *pseudo_header, const u_char *buf)
 {
   cb_args_t    *args = (cb_args_t *) user;
   capture_file *cf = args->cf;
index 04a34783cf18903fba8dc692640acd7cf771f4ce..a2c76dca21f871f44a845ae78c242b82c26a7f29 100644 (file)
@@ -1,6 +1,6 @@
 /* ascend.c
  *
- * $Id: ascend.c,v 1.24 2001/07/13 00:55:57 guy Exp $
+ * $Id: ascend.c,v 1.25 2001/10/04 08:30:35 guy Exp $
  *
  * Wiretap Library
  * Copyright (c) 1998 by Gilbert Ramirez <gram@xiexie.org>
@@ -99,8 +99,8 @@ static const char ascend_w2magic[] = { 'W', 'D', '_', 'D', 'I', 'A', 'L', 'O', '
 #define ASCEND_W1_SIZE (sizeof ascend_w1magic / sizeof ascend_w1magic[0])
 #define ASCEND_W2_SIZE (sizeof ascend_w2magic / sizeof ascend_w2magic[0])
 
-static gboolean ascend_read(wtap *wth, int *err, int *data_offset);
-static int ascend_seek_read (wtap *wth, int seek_off,
+static gboolean ascend_read(wtap *wth, int *err, long *data_offset);
+static int ascend_seek_read (wtap *wth, long seek_off,
        union wtap_pseudo_header *pseudo_header, guint8 *pd, int len);
 static void ascend_close(wtap *wth);
 
@@ -113,9 +113,10 @@ static void ascend_close(wtap *wth);
    at which the seek pointer should be set before this routine is called
    to find the packet *after* the packet it finds. */
 /* XXX - Handle I/O errors. */
-static int ascend_seek(wtap *wth, int max_seek)
+static long ascend_seek(wtap *wth, int max_seek)
 {
-  int byte, bytes_read = 0, date_off = -1, cur_off, packet_off;
+  int byte, bytes_read = 0;
+  long date_off = -1, cur_off, packet_off;
   unsigned int r_level = 0, x_level = 0, w1_level = 0, w2_level = 0;
 
   while (((byte = file_getc(wth->fh)) != EOF) && bytes_read < max_seek) {
@@ -201,7 +202,7 @@ found:
 /* XXX - return -1 on I/O error and actually do something with 'err'. */
 int ascend_open(wtap *wth, int *err)
 {
-  int offset;
+  long offset;
   struct stat statbuf;
 
   /* We haven't yet allocated a data structure for our private stuff;
@@ -243,9 +244,9 @@ int ascend_open(wtap *wth, int *err)
 }
 
 /* Read the next packet; called from wtap_loop(). */
-static gboolean ascend_read(wtap *wth, int *err, int *data_offset)
+static gboolean ascend_read(wtap *wth, int *err, long *data_offset)
 {
-  int offset;
+  long offset;
   guint8 *buf = buffer_start_ptr(wth->frame_buffer);
   ascend_pkthdr header;
 
@@ -296,7 +297,7 @@ static gboolean ascend_read(wtap *wth, int *err, int *data_offset)
   return TRUE;
 }
 
-static int ascend_seek_read (wtap *wth, int seek_off,
+static int ascend_seek_read (wtap *wth, long seek_off,
        union wtap_pseudo_header *pseudo_header, guint8 *pd, int len)
 {
   file_seek(wth->random_fh, seek_off, SEEK_SET);
index 7196b0ea92992fba7845d36cf3194dff7a7ab4f4..35425d4ce9f23063321759fb6bcac9059258efcd 100644 (file)
@@ -1,6 +1,6 @@
 /* csids.c
  *
- * $Id: csids.c,v 1.7 2001/07/13 00:55:58 guy Exp $
+ * $Id: csids.c,v 1.8 2001/10/04 08:30:35 guy Exp $
  *
  * Copyright (c) 2000 by Mike Hall <mlh@io.com>
  * Copyright (c) 2000 by Cisco Systems
@@ -44,8 +44,8 @@
  *
  */
 
-static gboolean csids_read(wtap *wth, int *err, int *data_offset);
-static int csids_seek_read(wtap *wth, int seek_off,
+static gboolean csids_read(wtap *wth, int *err, long *data_offset);
+static int csids_seek_read(wtap *wth, long seek_off,
        union wtap_pseudo_header *pseudo_header, guint8 *pd, int len);
 
 struct csids_header {
@@ -138,7 +138,7 @@ int csids_open(wtap *wth, int *err)
 }
 
 /* Find the next packet and parse it; called from wtap_loop(). */
-static gboolean csids_read(wtap *wth, int *err, int *data_offset)
+static gboolean csids_read(wtap *wth, int *err, long *data_offset)
 {
   guint8 *buf;
   int bytesRead = 0;
@@ -194,7 +194,7 @@ static gboolean csids_read(wtap *wth, int *err, int *data_offset)
 /* Used to read packets in random-access fashion */
 static int
 csids_seek_read (wtap *wth,
-                int seek_off,
+                long seek_off,
                 union wtap_pseudo_header *pseudo_header,
                 guint8 *pd,
                 int len)
index 32102eba20df4d5f28c6d5410fe9450234544505..1f9f18f3741f86e456a648dc1497604b55376b1e 100644 (file)
@@ -2,7 +2,7 @@
  * Routines for opening etherpeek files
  * Copyright (c) 2001, Daniel Thompson <d.thompson@gmx.net>
  *
- * $Id: etherpeek.c,v 1.4 2001/07/13 00:55:58 guy Exp $
+ * $Id: etherpeek.c,v 1.5 2001/10/04 08:30:35 guy Exp $
  *
  * Wiretap Library
  * Copyright (c) 1998 by Gilbert Ramirez <gram@xiexie.org>
@@ -112,8 +112,8 @@ static const etherpeek_encap_lookup_t etherpeek_encap[] = {
 #define NUM_ETHERPEEK_ENCAPS \
        (sizeof (etherpeek_encap) / sizeof (etherpeek_encap[0]))
 
-static gboolean etherpeek_read_m7(wtap *wth, int *err, int *data_offset);
-static gboolean etherpeek_read_m56(wtap *wth, int *err, int *data_offset);
+static gboolean etherpeek_read_m7(wtap *wth, int *err, long *data_offset);
+static gboolean etherpeek_read_m56(wtap *wth, int *err, long *data_offset);
 
 int etherpeek_open(wtap *wth, int *err)
 {
@@ -206,7 +206,7 @@ int etherpeek_open(wtap *wth, int *err)
        return 1;
 }
 
-static gboolean etherpeek_read_m7(wtap *wth, int *err, int *data_offset)
+static gboolean etherpeek_read_m7(wtap *wth, int *err, long *data_offset)
 {
        etherpeek_m7_packet_t ep_pkt;
        double  t;
@@ -262,7 +262,7 @@ static gboolean etherpeek_read_m7(wtap *wth, int *err, int *data_offset)
        return TRUE;
 }
 
-static gboolean etherpeek_read_m56(wtap *wth, int *err, int *data_offset)
+static gboolean etherpeek_read_m56(wtap *wth, int *err, long *data_offset)
 {
        etherpeek_m56_packet_t ep_pkt;
        unsigned int i;
index 62b5dcdbeaa68409daddaca8626a4f15d0bff974..92748471afbb04e497abd433000d3ee61d31659c 100644 (file)
@@ -1,6 +1,6 @@
 /* file.c
  *
- * $Id: file.c,v 1.67 2001/07/13 00:55:58 guy Exp $
+ * $Id: file.c,v 1.68 2001/10/04 08:30:35 guy Exp $
  *
  * Wiretap Library
  * Copyright (c) 1998 by Gilbert Ramirez <gram@xiexie.org>
@@ -111,7 +111,7 @@ static int (*open_routines[])(wtap *, int *) = {
 
 #define        N_FILE_TYPES    (sizeof open_routines / sizeof open_routines[0])
 
-int wtap_def_seek_read(wtap *wth, int seek_off,
+int wtap_def_seek_read(wtap *wth, long seek_off,
        union wtap_pseudo_header *pseudo_header, guint8 *pd, int len)
 {
        file_seek(wth->random_fh, seek_off, SEEK_SET);
index bbf0e43b52fb3700e8a31e98f991982223974715..55059f1d2846f1d96e414aa2e04151afb08b5c3d 100644 (file)
@@ -1,6 +1,6 @@
 /* i4btrace.c
  *
- * $Id: i4btrace.c,v 1.14 2001/03/10 06:33:57 guy Exp $
+ * $Id: i4btrace.c,v 1.15 2001/10/04 08:30:35 guy Exp $
  *
  * Wiretap Library
  * Copyright (c) 1999 by Bert Driehuis <driehuis@playbeing.org>
@@ -32,8 +32,8 @@
 #include "buffer.h"
 #include "i4b_trace.h"
 
-static gboolean i4btrace_read(wtap *wth, int *err, int *data_offset);
-static int i4btrace_seek_read(wtap *wth, int seek_off,
+static gboolean i4btrace_read(wtap *wth, int *err, long *data_offset);
+static int i4btrace_seek_read(wtap *wth, long seek_off,
     union wtap_pseudo_header *pseudo_header, u_char *pd, int length);
 static int i4b_read_rec_header(FILE_T fh, i4b_trace_hdr_t *hdr, int *err);
 static void i4b_byte_swap_header(wtap *wth, i4b_trace_hdr_t *hdr);
@@ -112,7 +112,7 @@ int i4btrace_open(wtap *wth, int *err)
 #define V120SABME      "\010\001\177"
 
 /* Read the next packet */
-static gboolean i4btrace_read(wtap *wth, int *err, int *data_offset)
+static gboolean i4btrace_read(wtap *wth, int *err, long *data_offset)
 {
        int     ret;
        i4b_trace_hdr_t hdr;
@@ -219,7 +219,7 @@ static gboolean i4btrace_read(wtap *wth, int *err, int *data_offset)
 }
 
 static int
-i4btrace_seek_read(wtap *wth, int seek_off,
+i4btrace_seek_read(wtap *wth, long seek_off,
     union wtap_pseudo_header *pseudo_header, u_char *pd, int length)
 {
        int     ret;
index dcecd0e082684b53cf2a343995a300f4344f59e9..42dd00b0a21004026817ae89d567051a003e90e2 100644 (file)
@@ -1,6 +1,6 @@
 /* iptrace.c
  *
- * $Id: iptrace.c,v 1.33 2001/03/10 06:33:57 guy Exp $
+ * $Id: iptrace.c,v 1.34 2001/10/04 08:30:35 guy Exp $
  *
  * Wiretap Library
  * Copyright (c) 1998 by Gilbert Ramirez <gram@xiexie.org>
 #include "buffer.h"
 #include "iptrace.h"
 
-static gboolean iptrace_read_1_0(wtap *wth, int *err, int *data_offset);
-static int iptrace_seek_read_1_0(wtap *wth, int seek_off,
+static gboolean iptrace_read_1_0(wtap *wth, int *err, long *data_offset);
+static int iptrace_seek_read_1_0(wtap *wth, long seek_off,
     union wtap_pseudo_header *pseudo_header, u_char *pd, int packet_size);
 
-static gboolean iptrace_read_2_0(wtap *wth, int *err, int *data_offset);
-static int iptrace_seek_read_2_0(wtap *wth, int seek_off,
+static gboolean iptrace_read_2_0(wtap *wth, int *err, long *data_offset);
+static int iptrace_seek_read_2_0(wtap *wth, long seek_off,
     union wtap_pseudo_header *pseudo_header, u_char *pd, int packet_size);
 
 static int iptrace_read_rec_header(FILE_T fh, guint8 *header, int header_len,
@@ -96,7 +96,7 @@ typedef struct {
 } iptrace_1_0_phdr;
 
 /* Read the next packet */
-static gboolean iptrace_read_1_0(wtap *wth, int *err, int *data_offset)
+static gboolean iptrace_read_1_0(wtap *wth, int *err, long *data_offset)
 {
        int                     ret;
        guint32                 packet_size;
@@ -161,7 +161,7 @@ static gboolean iptrace_read_1_0(wtap *wth, int *err, int *data_offset)
        return TRUE;
 }
 
-static int iptrace_seek_read_1_0(wtap *wth, int seek_off,
+static int iptrace_seek_read_1_0(wtap *wth, long seek_off,
     union wtap_pseudo_header *pseudo_header, u_char *pd, int packet_size)
 {
        int                     ret;
@@ -204,7 +204,7 @@ typedef struct {
 } iptrace_2_0_phdr;
 
 /* Read the next packet */
-static gboolean iptrace_read_2_0(wtap *wth, int *err, int *data_offset)
+static gboolean iptrace_read_2_0(wtap *wth, int *err, long *data_offset)
 {
        int                     ret;
        guint32                 packet_size;
@@ -273,7 +273,7 @@ static gboolean iptrace_read_2_0(wtap *wth, int *err, int *data_offset)
        return TRUE;
 }
 
-static int iptrace_seek_read_2_0(wtap *wth, int seek_off,
+static int iptrace_seek_read_2_0(wtap *wth, long seek_off,
     union wtap_pseudo_header *pseudo_header, u_char *pd, int packet_size)
 {
        int                     ret;
index 44013670d4c349d4eaeb7d4412373274a64f3c07..313703ce2722ecfbef5be248663daac26584ac41 100644 (file)
@@ -1,6 +1,6 @@
 /* lanalyzer.c
  *
- * $Id: lanalyzer.c,v 1.28 2001/04/16 22:06:34 guy Exp $
+ * $Id: lanalyzer.c,v 1.29 2001/10/04 08:30:35 guy Exp $
  *
  * Wiretap Library
  * Copyright (c) 1998 by Gilbert Ramirez <gram@xiexie.org>
@@ -47,7 +47,7 @@
 #define BOARD_325              226     /* LANalyzer 325 (Ethernet) */
 #define BOARD_325TR            227     /* LANalyzer 325TR (Token-ring) */
 
-static gboolean lanalyzer_read(wtap *wth, int *err, int *data_offset);
+static gboolean lanalyzer_read(wtap *wth, int *err, long *data_offset);
 static void lanalyzer_close(wtap *wth);
 
 int lanalyzer_open(wtap *wth, int *err)
@@ -193,7 +193,7 @@ int lanalyzer_open(wtap *wth, int *err)
 #define DESCRIPTOR_LEN 32
 
 /* Read the next packet */
-static gboolean lanalyzer_read(wtap *wth, int *err, int *data_offset)
+static gboolean lanalyzer_read(wtap *wth, int *err, long *data_offset)
 {
        int             packet_size = 0;
        int             bytes_read;
index f1164cfa3f37e2ccba47af974ba113efd8f1531d..323ff469090ceabe2ce9697005fabcb52038b6c6 100644 (file)
@@ -1,6 +1,6 @@
 /* libpcap.c
  *
- * $Id: libpcap.c,v 1.50 2001/08/25 03:18:48 guy Exp $
+ * $Id: libpcap.c,v 1.51 2001/10/04 08:30:36 guy Exp $
  *
  * Wiretap Library
  * Copyright (c) 1998 by Gilbert Ramirez <gram@xiexie.org>
@@ -47,7 +47,7 @@ typedef enum {
 } libpcap_try_t;
 static libpcap_try_t libpcap_try(wtap *wth, int *err);
 
-static gboolean libpcap_read(wtap *wth, int *err, int *data_offset);
+static gboolean libpcap_read(wtap *wth, int *err, long *data_offset);
 static int libpcap_read_header(wtap *wth, int *err,
     struct pcaprec_ss990915_hdr *hdr, gboolean silent);
 static void adjust_header(wtap *wth, struct pcaprec_hdr *hdr);
@@ -705,7 +705,7 @@ static libpcap_try_t libpcap_try(wtap *wth, int *err)
 }
 
 /* Read the next packet */
-static gboolean libpcap_read(wtap *wth, int *err, int *data_offset)
+static gboolean libpcap_read(wtap *wth, int *err, long *data_offset)
 {
        struct pcaprec_ss990915_hdr hdr;
        guint packet_size;
index 76cf2246406c8c3471c97d9425c6f9fcd0896102..aa3ebf9872c014e16d90578a13754c7a60f81361 100644 (file)
@@ -1,6 +1,6 @@
 /* netmon.c
  *
- * $Id: netmon.c,v 1.40 2001/08/25 03:18:48 guy Exp $
+ * $Id: netmon.c,v 1.41 2001/10/04 08:30:36 guy Exp $
  *
  * Wiretap Library
  * Copyright (c) 1998 by Gilbert Ramirez <gram@xiexie.org>
@@ -93,7 +93,7 @@ struct netmonrec_2_x_hdr {
        guint32 incl_len;       /* number of octets captured in file */
 };
 
-static gboolean netmon_read(wtap *wth, int *err, int *data_offset);
+static gboolean netmon_read(wtap *wth, int *err, long *data_offset);
 static void netmon_close(wtap *wth);
 static gboolean netmon_dump(wtap_dumper *wdh, const struct wtap_pkthdr *phdr,
     const union wtap_pseudo_header *pseudo_header, const u_char *pd, int *err);
@@ -276,7 +276,7 @@ int netmon_open(wtap *wth, int *err)
 }
 
 /* Read the next packet */
-static gboolean netmon_read(wtap *wth, int *err, int *data_offset)
+static gboolean netmon_read(wtap *wth, int *err, long *data_offset)
 {
        netmon_t *netmon = wth->capture.netmon;
        guint32 packet_size = 0;
index 5c75358bbad953cd001d450a49d2782164e0581b..c19b219d4f8c2bc90aaba45e2233e36286fd47d5 100644 (file)
@@ -1,6 +1,6 @@
 /* nettl.c
  *
- * $Id: nettl.c,v 1.19 2001/03/10 06:33:57 guy Exp $
+ * $Id: nettl.c,v 1.20 2001/10/04 08:30:36 guy Exp $
  *
  * Wiretap Library
  * Copyright (c) 1998 by Gilbert Ramirez <gram@xiexie.org>
@@ -66,8 +66,8 @@ struct nettlrec_ns_ls_ip_hdr {
 
 /* header is followed by data and once again the total length (2 bytes) ! */
 
-static gboolean nettl_read(wtap *wth, int *err, int *data_offset);
-static int nettl_seek_read(wtap *wth, int seek_off,
+static gboolean nettl_read(wtap *wth, int *err, long *data_offset);
+static int nettl_seek_read(wtap *wth, long seek_off,
                union wtap_pseudo_header *pseudo_header, u_char *pd, int length);
 static int nettl_read_rec_header(wtap *wth, FILE_T fh,
                struct wtap_pkthdr *phdr, union wtap_pseudo_header *pseudo_header,
@@ -124,7 +124,7 @@ int nettl_open(wtap *wth, int *err)
 }
 
 /* Read the next packet */
-static gboolean nettl_read(wtap *wth, int *err, int *data_offset)
+static gboolean nettl_read(wtap *wth, int *err, long *data_offset)
 {
     int ret;
 
@@ -150,7 +150,7 @@ static gboolean nettl_read(wtap *wth, int *err, int *data_offset)
 }
 
 static int
-nettl_seek_read(wtap *wth, int seek_off,
+nettl_seek_read(wtap *wth, long seek_off,
                union wtap_pseudo_header *pseudo_header, u_char *pd, int length)
 {
     int ret;
index f6fa286364e1fde3b1c2212e9a62bef80cab53d6..898476bf0eaa8dc856387bd422d76f96c5b2c592 100644 (file)
@@ -1,6 +1,6 @@
 /* netxray.c
  *
- * $Id: netxray.c,v 1.40 2001/08/25 03:18:48 guy Exp $
+ * $Id: netxray.c,v 1.41 2001/10/04 08:30:36 guy Exp $
  *
  * Wiretap Library
  * Copyright (c) 1998 by Gilbert Ramirez <gram@xiexie.org>
@@ -101,7 +101,7 @@ struct netxrayrec_2_x_hdr {
        guint32 xxx[7];         /* unknown */
 };
 
-static gboolean netxray_read(wtap *wth, int *err, int *data_offset);
+static gboolean netxray_read(wtap *wth, int *err, long *data_offset);
 static void netxray_close(wtap *wth);
 static gboolean netxray_dump_1_1(wtap_dumper *wdh, const struct wtap_pkthdr *phdr,
        const union wtap_pseudo_header *pseudo_header, const u_char *pd, int *err);
@@ -231,7 +231,7 @@ int netxray_open(wtap *wth, int *err)
 }
 
 /* Read the next packet */
-static gboolean netxray_read(wtap *wth, int *err, int *data_offset)
+static gboolean netxray_read(wtap *wth, int *err, long *data_offset)
 {
        guint32 packet_size;
        int     bytes_read;
index c010447dec6d6e93d6bd852c9f30049b1c6b41fc..710751e95db62769125162c203a55fbe0d4fa0d6 100644 (file)
@@ -1,6 +1,6 @@
 /* ngsniffer.c
  *
- * $Id: ngsniffer.c,v 1.66 2001/08/25 03:18:48 guy Exp $
+ * $Id: ngsniffer.c,v 1.67 2001/10/04 08:30:36 guy Exp $
  *
  * Wiretap Library
  * Copyright (c) 1998 by Gilbert Ramirez <gram@xiexie.org>
@@ -285,8 +285,8 @@ struct frame6_rec {
 static double Usec[] = { 15.0, 0.838096, 15.0, 0.5, 2.0, 1.0, 0.1 };
 
 static int skip_header_records(wtap *wth, int *err, gint16 version);
-static gboolean ngsniffer_read(wtap *wth, int *err, int *data_offset);
-static int ngsniffer_seek_read(wtap *wth, int seek_off,
+static gboolean ngsniffer_read(wtap *wth, int *err, long *data_offset);
+static int ngsniffer_seek_read(wtap *wth, long seek_off,
     union wtap_pseudo_header *pseudo_header, u_char *pd, int packet_size);
 static int ngsniffer_read_rec_header(wtap *wth, gboolean is_random,
     guint16 *typep, guint16 *lengthp, int *err);
@@ -645,7 +645,7 @@ skip_header_records(wtap *wth, int *err, gint16 version)
 }
 
 /* Read the next packet */
-static gboolean ngsniffer_read(wtap *wth, int *err, int *data_offset)
+static gboolean ngsniffer_read(wtap *wth, int *err, long *data_offset)
 {
        int     ret;
        guint16 type, length;
@@ -858,7 +858,7 @@ found:
        return TRUE;
 }
 
-static int ngsniffer_seek_read(wtap *wth, int seek_off,
+static int ngsniffer_seek_read(wtap *wth, long seek_off,
     union wtap_pseudo_header *pseudo_header, u_char *pd, int packet_size)
 {
        int     ret;
index 1ed11e5ef4c46b7fab3e480a7dc2e5832b9397a5..ce3d3c8a6573bc86a2205437f7b94ce734997060 100644 (file)
@@ -1,6 +1,6 @@
 /* pppdump.c
  *
- * $Id: pppdump.c,v 1.8 2001/03/10 06:33:58 guy Exp $
+ * $Id: pppdump.c,v 1.9 2001/10/04 08:30:36 guy Exp $
  *
  * Copyright (c) 2000 by Gilbert Ramirez <gram@xiexie.org>
  * 
@@ -93,8 +93,8 @@ typedef enum {
        DIRECTION_RECV
 } direction_enum;
 
-static gboolean pppdump_read(wtap *wth, int *err, int *data_offset);
-static int pppdump_seek_read(wtap *wth, int seek_off,
+static gboolean pppdump_read(wtap *wth, int *err, long *data_offset);
+static int pppdump_seek_read(wtap *wth, long seek_off,
        union wtap_pseudo_header *pseudo_header, guint8 *pd, int len);
 
 typedef struct {
@@ -222,7 +222,7 @@ pppdump_open(wtap *wth, int *err)
 
 /* Find the next packet and parse it; called from wtap_loop(). */
 static gboolean
-pppdump_read(wtap *wth, int *err, int *data_offset)
+pppdump_read(wtap *wth, int *err, long *data_offset)
 {
        gboolean        retval;
        int             num_bytes;
@@ -517,7 +517,7 @@ collate(pppdump_t* state, FILE_T fh, int *err, guint8 *pd, int *num_bytes,
 /* Used to read packets in random-access fashion */
 static int
 pppdump_seek_read (wtap *wth,
-                int seek_off,
+                long seek_off,
                 union wtap_pseudo_header *pseudo_header,
                 guint8 *pd,
                 int len)
index 733e48ff4045a8f72095b74346b5fcfa802be2dd..3a129af69ad8ecafebb14e1022688d2d09e951ca 100644 (file)
@@ -1,6 +1,6 @@
 /* radcom.c
  *
- * $Id: radcom.c,v 1.29 2001/03/10 06:33:58 guy Exp $
+ * $Id: radcom.c,v 1.30 2001/10/04 08:30:36 guy Exp $
  *
  * Wiretap Library
  * Copyright (c) 1998 by Gilbert Ramirez <gram@xiexie.org>
@@ -67,8 +67,8 @@ struct radcomrec_hdr {
        char    xxw[9];         /* unknown */
 };
 
-static gboolean radcom_read(wtap *wth, int *err, int *data_offset);
-static int radcom_seek_read(wtap *wth, int seek_off,
+static gboolean radcom_read(wtap *wth, int *err, long *data_offset);
+static int radcom_seek_read(wtap *wth, long seek_off,
        union wtap_pseudo_header *pseudo_header, u_char *pd, int length);
 static int radcom_read_rec_header(FILE_T fh, struct radcomrec_hdr *hdr,
        int *err);
@@ -219,7 +219,7 @@ read_error:
 }
 
 /* Read the next packet */
-static gboolean radcom_read(wtap *wth, int *err, int *data_offset)
+static gboolean radcom_read(wtap *wth, int *err, long *data_offset)
 {
        int     ret;
        struct radcomrec_hdr hdr;
@@ -287,7 +287,7 @@ static gboolean radcom_read(wtap *wth, int *err, int *data_offset)
 }
 
 static int
-radcom_seek_read(wtap *wth, int seek_off,
+radcom_seek_read(wtap *wth, long seek_off,
     union wtap_pseudo_header *pseudo_header, u_char *pd, int length)
 {
        int     ret;
index fd7d2f338d0b549ada78ef66ae9663ec8a5968cf..85c169baa1c9893123a57fb26609a0f320ef1c14 100644 (file)
@@ -1,6 +1,6 @@
 /* snoop.c
  *
- * $Id: snoop.c,v 1.36 2001/08/25 03:18:48 guy Exp $
+ * $Id: snoop.c,v 1.37 2001/10/04 08:30:36 guy Exp $
  *
  * Wiretap Library
  * Copyright (c) 1998 by Gilbert Ramirez <gram@xiexie.org>
@@ -56,8 +56,8 @@ struct snooprec_hdr {
        guint32 ts_usec;        /* timestamp microseconds */
 };
 
-static gboolean snoop_read(wtap *wth, int *err, int *data_offset);
-static int snoop_seek_read(wtap *wth, int seek_off,
+static gboolean snoop_read(wtap *wth, int *err, long *data_offset);
+static int snoop_seek_read(wtap *wth, long seek_off,
     union wtap_pseudo_header *pseudo_header, u_char *pd, int length);
 static int snoop_read_atm_pseudoheader(FILE_T fh,
     union wtap_pseudo_header *pseudo_header, int *err);
@@ -294,7 +294,7 @@ int snoop_open(wtap *wth, int *err)
 }
 
 /* Read the next packet */
-static gboolean snoop_read(wtap *wth, int *err, int *data_offset)
+static gboolean snoop_read(wtap *wth, int *err, long *data_offset)
 {
        guint32 rec_size;
        guint32 packet_size;
@@ -403,7 +403,7 @@ static gboolean snoop_read(wtap *wth, int *err, int *data_offset)
 }
 
 static int
-snoop_seek_read(wtap *wth, int seek_off,
+snoop_seek_read(wtap *wth, long seek_off,
     union wtap_pseudo_header *pseudo_header, u_char *pd, int length)
 {
        int     ret;
index daafe782e5f7da2a5a1bb4093cb8b11bd5f271cc..de52620553e7396087dfcbc7ca020009cb86174d 100644 (file)
@@ -1,6 +1,6 @@
 /* toshiba.c
  *
- * $Id: toshiba.c,v 1.15 2001/03/10 06:33:58 guy Exp $
+ * $Id: toshiba.c,v 1.16 2001/10/04 08:30:36 guy Exp $
  *
  * Wiretap Library
  * Copyright (c) 1998 by Gilbert Ramirez <gram@xiexie.org>
@@ -104,8 +104,8 @@ static const char toshiba_hdr_magic[]  =
 static const char toshiba_rec_magic[]  = { '[', 'N', 'o', '.' };
 #define TOSHIBA_REC_MAGIC_SIZE  (sizeof toshiba_rec_magic  / sizeof toshiba_rec_magic[0])
 
-static gboolean toshiba_read(wtap *wth, int *err, int *data_offset);
-static int toshiba_seek_read(wtap *wth, int seek_off,
+static gboolean toshiba_read(wtap *wth, int *err, long *data_offset);
+static int toshiba_seek_read(wtap *wth, long seek_off,
        union wtap_pseudo_header *pseudo_header, guint8 *pd, int len);
 static gboolean parse_single_hex_dump_line(char* rec, guint8 *buf, int byte_offset);
 static int parse_toshiba_hex_dump(FILE_T fh, int pkt_len, guint8* buf, int *err);
@@ -115,7 +115,7 @@ static int parse_toshiba_rec_hdr(wtap *wth, FILE_T fh,
 /* Seeks to the beginning of the next packet, and returns the
    byte offset.  Returns -1 on failure. */
 /* XXX - Handle I/O errors. */
-static int toshiba_seek_next_packet(wtap *wth)
+static long toshiba_seek_next_packet(wtap *wth)
 {
   int byte;
   int level = 0;
@@ -198,9 +198,9 @@ int toshiba_open(wtap *wth, int *err)
 }
 
 /* Find the next packet and parse it; called from wtap_loop(). */
-static gboolean toshiba_read(wtap *wth, int *err, int *data_offset)
+static gboolean toshiba_read(wtap *wth, int *err, long *data_offset)
 {
-       int     offset = 0;
+       long    offset;
        guint8  *buf;
        int     pkt_len;
 
@@ -229,8 +229,8 @@ static gboolean toshiba_read(wtap *wth, int *err, int *data_offset)
 
 /* Used to read packets in random-access fashion */
 static int
-toshiba_seek_read (wtap *wth, int seek_off, union wtap_pseudo_header *pseudo_header,
-       guint8 *pd, int len)
+toshiba_seek_read (wtap *wth, long seek_off,
+       union wtap_pseudo_header *pseudo_header, guint8 *pd, int len)
 {
        int     pkt_len;
        int     err;
index f6b64d03466d0669ca0c761791e67b4784dd1f17..49a13a58ac8474e70180a15b727a380695b1849f 100644 (file)
@@ -1,6 +1,6 @@
 /* wtap-int.h
  *
- * $Id: wtap-int.h,v 1.13 2001/08/25 03:18:48 guy Exp $
+ * $Id: wtap-int.h,v 1.14 2001/10/04 08:30:36 guy Exp $
  *
  * Wiretap Library
  * Copyright (c) 1998 by Gilbert Ramirez <gram@xiexie.org>
@@ -109,15 +109,15 @@ typedef struct {
 typedef struct {
        time_t inittime;
        int adjusted;
-       int next_packet_seek_start;
+       long next_packet_seek_start;
 } ascend_t;
 
 typedef struct {
        gboolean byteswapped;
 } csids_t;
 
-typedef int (*subtype_read_func)(struct wtap*, int*, int*);
-typedef int (*subtype_seek_read_func)(struct wtap*, int, union wtap_pseudo_header*,
+typedef int (*subtype_read_func)(struct wtap*, int*, long*);
+typedef int (*subtype_seek_read_func)(struct wtap*, long, union wtap_pseudo_header*,
                                        guint8*, int);
 struct wtap {
        FILE_T                  fh;
index db9bbae29312d11534185c979332abdfa2653f30..0937ab8e245640e51d20141eb27a4092f6b14677 100644 (file)
@@ -1,6 +1,6 @@
 /* wtap.c
  *
- * $Id: wtap.c,v 1.54 2001/07/13 00:55:58 guy Exp $
+ * $Id: wtap.c,v 1.55 2001/10/04 08:30:36 guy Exp $
  *
  * Wiretap Library
  * Copyright (c) 1998 by Gilbert Ramirez <gram@xiexie.org>
@@ -247,7 +247,7 @@ wtap_close(wtap *wth)
 }
 
 gboolean
-wtap_read(wtap *wth, int *err, int *data_offset)
+wtap_read(wtap *wth, int *err, long *data_offset)
 {
        return wth->subtype_read(wth, err, data_offset);
 }
@@ -273,7 +273,8 @@ wtap_buf_ptr(wtap *wth)
 gboolean
 wtap_loop(wtap *wth, int count, wtap_handler callback, u_char* user, int *err)
 {
-       int             data_offset, loop = 0;
+       long            data_offset;
+       int             loop = 0;
 
        /* Start by clearing error flag */
        *err = 0;
@@ -292,7 +293,7 @@ wtap_loop(wtap *wth, int count, wtap_handler callback, u_char* user, int *err)
 }
 
 int
-wtap_seek_read(wtap *wth, int seek_off,
+wtap_seek_read(wtap *wth, long seek_off,
        union wtap_pseudo_header *pseudo_header, guint8 *pd, int len)
 {
        return wth->subtype_seek_read(wth, seek_off, pseudo_header, pd, len);
index b6067e13c3f67c55d2951226f3d466adbe21320b..fdbab173ad746fc23455ea05fc7d42eccdd41e59 100644 (file)
@@ -1,6 +1,6 @@
 /* wtap.h
  *
- * $Id: wtap.h,v 1.88 2001/09/23 21:55:21 guy Exp $
+ * $Id: wtap.h,v 1.89 2001/10/04 08:30:36 guy Exp $
  *
  * Wiretap Library
  * Copyright (c) 1998 by Gilbert Ramirez <gram@xiexie.org>
@@ -270,7 +270,7 @@ struct wtap_pkthdr {
 };
 
 typedef void (*wtap_handler)(u_char*, const struct wtap_pkthdr*,
-               int, union wtap_pseudo_header *pseudo_header, const u_char *);
+               long, union wtap_pseudo_header *pseudo_header, const u_char *);
 
 struct wtap;
 struct Buffer;
@@ -296,7 +296,7 @@ gboolean wtap_loop(wtap *wth, int, wtap_handler, u_char*, int *err);
 /* Returns TRUE if read was successful. FALSE if failure. data_offset is
  * set the the offset in the file where the data for the read packet is
  * located. */
-gboolean wtap_read(wtap *wth, int *err, int *data_offset);
+gboolean wtap_read(wtap *wth, int *err, long *data_offset);
 
 struct wtap_pkthdr *wtap_phdr(wtap *wth);
 union wtap_pseudo_header *wtap_pseudoheader(wtap *wth);
@@ -318,9 +318,9 @@ int wtap_short_string_to_encap(const char *short_name);
 const char *wtap_strerror(int err);
 void wtap_sequential_close(wtap *wth);
 void wtap_close(wtap *wth);
-int wtap_seek_read (wtap *wth, int seek_off,
+int wtap_seek_read (wtap *wth, long seek_off,
        union wtap_pseudo_header *pseudo_header, guint8 *pd, int len);
-int wtap_def_seek_read (wtap *wth, int seek_off,
+int wtap_def_seek_read (wtap *wth, long seek_off,
        union wtap_pseudo_header *pseudo_header, guint8 *pd, int len);
 
 gboolean wtap_dump_can_open(int filetype);