diff options
author | Guy Harris <guy@alum.mit.edu> | 2002-02-08 10:07:41 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2002-02-08 10:07:41 +0000 |
commit | 89a4acb4389e07e335aa8fbe791c223b533c0de1 (patch) | |
tree | 6822a5170f6f9aea4ad4516e9dff63725bda89c6 /mergecap.c | |
parent | ad1ce4a43d656ac7ef4a418317417fe503162636 (diff) | |
download | wireshark-89a4acb4389e07e335aa8fbe791c223b533c0de1.tar.gz wireshark-89a4acb4389e07e335aa8fbe791c223b533c0de1.tar.bz2 wireshark-89a4acb4389e07e335aa8fbe791c223b533c0de1.zip |
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 'mergecap.c')
-rw-r--r-- | mergecap.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/mergecap.c b/mergecap.c index 79966f5dfb..d5ce6c63d1 100644 --- a/mergecap.c +++ b/mergecap.c @@ -1,6 +1,6 @@ /* Combine two dump files, either by appending or by merging by timestamp * - * $Id: mergecap.c,v 1.5 2001/10/04 08:30:33 guy Exp $ + * $Id: mergecap.c,v 1.6 2002/02/08 10:07:34 guy Exp $ * * Written by Scott Renfro <scott@renfro.org> based on * editcap by Richard Sharpe and Guy Harris @@ -275,10 +275,16 @@ max_snapshot_length(int count, in_file_t in_files[]) { int i; int max_snapshot = 0; + int snapshot_length; for (i = 0; i < count; i++) { - if (wtap_snapshot_length(in_files[i].wth) > max_snapshot) - max_snapshot = wtap_snapshot_length(in_files[i].wth); + snapshot_length = wtap_snapshot_length(in_files[i].wth); + if (snapshot_length == 0) { + /* Snapshot length of input file not known. */ + snapshot_length = WTAP_MAX_PACKET_SIZE; + } + if (snapshot_length > max_snapshot) + max_snapshot = snapshot_length; } return max_snapshot; } |