summaryrefslogtreecommitdiff
path: root/wiretap/dbs-etherwatch.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2002-02-08 10:07:41 +0000
committerGuy Harris <guy@alum.mit.edu>2002-02-08 10:07:41 +0000
commit89a4acb4389e07e335aa8fbe791c223b533c0de1 (patch)
tree6822a5170f6f9aea4ad4516e9dff63725bda89c6 /wiretap/dbs-etherwatch.c
parentad1ce4a43d656ac7ef4a418317417fe503162636 (diff)
downloadwireshark-89a4acb4389e07e335aa8fbe791c223b533c0de1.tar.gz
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()" treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so that, when writing a capture file in a format that *does* store the snapshot length, we can at least put *something* in the file). If we don't know the snapshot length of the current capture file, don't display a value in the summary window. Don't use "cfile.snap" as the snapshot length option when capturing - doing so causes Ethereal to default, when capturing, to the snapshot length of the last capture file that you read in, rather than to the snapshot length of the last capture you did (or the initial default of "no snapshot length"). Redo the "Capture Options" dialog box to group options into sections with frames around them, and add units to the snapshot length, maximum file size, and capture duration options, as per a suggestion by Ulf Lamping. Also add units to the capture count option. Make the snapshot length, capture count, maximum file size, and capture duration options into a combination of a check box and a spin button. If the check box is not checked, the limit in question is inactive (snapshot length of 65535, no max packet count, no max file size, no max capture duration); if it's checked, the spinbox specifies the limit. Default all of the check boxes to "not checked" and all of the spin boxes to small values. Use "gtk_toggle_button_get_active()" rather than directly fetching the state of a check box. svn path=/trunk/; revision=4709
Diffstat (limited to 'wiretap/dbs-etherwatch.c')
-rw-r--r--wiretap/dbs-etherwatch.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/wiretap/dbs-etherwatch.c b/wiretap/dbs-etherwatch.c
index 4bc7707940..1bd1c94941 100644
--- a/wiretap/dbs-etherwatch.c
+++ b/wiretap/dbs-etherwatch.c
@@ -1,6 +1,6 @@
/* dbs-etherwatch.c
*
- * $Id: dbs-etherwatch.c,v 1.2 2002/01/08 22:30:29 guy Exp $
+ * $Id: dbs-etherwatch.c,v 1.3 2002/02/08 10:07:40 guy Exp $
*
* Wiretap Library
* Copyright (c) 2001 by Marc Milgram <mmilgram@arrayinc.com>
@@ -70,6 +70,11 @@ static const char dbs_etherwatch_rec_magic[] =
#define DBS_ETHERWATCH_REC_MAGIC_SIZE \
(sizeof dbs_etherwatch_rec_magic / sizeof dbs_etherwatch_rec_magic[0])
+/*
+ * XXX - is this the biggest packet we can get?
+ */
+#define DBS_ETHERWATCH_MAX_PACKET_LEN 16384
+
static gboolean dbs_etherwatch_read(wtap *wth, int *err, long *data_offset);
static int dbs_etherwatch_seek_read(wtap *wth, long seek_off,
union wtap_pseudo_header *pseudo_header, guint8 *pd, int len);
@@ -155,7 +160,7 @@ int dbs_etherwatch_open(wtap *wth, int *err)
wth->data_offset = 0;
wth->file_encap = WTAP_ENCAP_RAW_IP;
wth->file_type = WTAP_FILE_DBS_ETHERWATCH;
- wth->snapshot_length = 16384; /* just guessing */
+ wth->snapshot_length = 0; /* not known */
wth->subtype_read = dbs_etherwatch_read;
wth->subtype_seek_read = dbs_etherwatch_seek_read;
@@ -180,7 +185,7 @@ static gboolean dbs_etherwatch_read(wtap *wth, int *err, long *data_offset)
pkt_len = parse_dbs_etherwatch_rec_hdr(wth, wth->fh, err);
/* Make sure we have enough room for the packet */
- buffer_assure_space(wth->frame_buffer, wth->snapshot_length);
+ buffer_assure_space(wth->frame_buffer, DBS_ETHERWATCH_MAX_PACKET_LEN);
buf = buffer_start_ptr(wth->frame_buffer);
/* Convert the ASCII hex dump to binary data */